22
33import com .github .cubiomes .CanyonCarverConfig ;
44import com .github .cubiomes .Cubiomes ;
5+ import dev .xpple .seedmapper .world .WorldPresetManager ;
56import com .github .cubiomes .Generator ;
67import com .github .cubiomes .ItemStack ;
78import com .github .cubiomes .LootTableContext ;
@@ -104,7 +105,7 @@ private static int locateBiome(CustomClientCommandSource source, int biome) thro
104105 }
105106 try (Arena arena = Arena .ofConfined ()) {
106107 MemorySegment generator = Generator .allocate (arena );
107- Cubiomes .setupGenerator (generator , source .getVersion (), 0 );
108+ Cubiomes .setupGenerator (generator , source .getVersion (), WorldPresetManager . activePreset (). generatorFlags () );
108109 Cubiomes .applySeed (generator , dimension , source .getSeed ().getSecond ());
109110
110111 BlockPos center = BlockPos .containing (source .getPosition ());
@@ -141,7 +142,7 @@ private static int locateStructure(CustomClientCommandSource source, StructureAn
141142 long seed = source .getSeed ().getSecond ();
142143
143144 MemorySegment generator = Generator .allocate (arena );
144- Cubiomes .setupGenerator (generator , version , 0 );
145+ Cubiomes .setupGenerator (generator , version , WorldPresetManager . activePreset (). generatorFlags () );
145146 Cubiomes .applySeed (generator , dimension , seed );
146147
147148 // currently only used for end cities
@@ -229,7 +230,7 @@ private static int locateStronghold(CustomClientCommandSource source) throws Com
229230
230231 BlockPos position = BlockPos .containing (source .getPosition ());
231232
232- TwoDTree tree = SeedMapScreen .strongholdDataCache .computeIfAbsent (new WorldIdentifier (seed , dimension , version ), _ -> calculateStrongholds (seed , dimension , version ));
233+ TwoDTree tree = SeedMapScreen .strongholdDataCache .computeIfAbsent (new WorldIdentifier (seed , dimension , version , dev . xpple . seedmapper . world . WorldPresetManager . activePreset (). cacheKey () ), _ -> calculateStrongholds (seed , dimension , version ));
233234
234235 BlockPos pos = tree .nearestTo (position .atY (0 ));
235236
@@ -243,7 +244,7 @@ public static TwoDTree calculateStrongholds(long seed, int dimension, int versio
243244 MemorySegment strongholdIter = StrongholdIter .allocate (arena );
244245 Cubiomes .initFirstStronghold (arena , strongholdIter , version , seed );
245246 MemorySegment generator = Generator .allocate (arena );
246- Cubiomes .setupGenerator (generator , version , 0 );
247+ Cubiomes .setupGenerator (generator , version , WorldPresetManager . activePreset (). generatorFlags () );
247248 Cubiomes .applySeed (generator , dimension , seed );
248249
249250 final int count = version <= Cubiomes .MC_1_8 () ? 3 : 128 ;
@@ -289,7 +290,7 @@ private static int locateLoot(CustomClientCommandSource source, int amount, Ench
289290
290291 try (Arena arena = Arena .ofConfined ()) {
291292 MemorySegment generator = Generator .allocate (arena );
292- Cubiomes .setupGenerator (generator , version , 0 );
293+ Cubiomes .setupGenerator (generator , version , WorldPresetManager . activePreset (). generatorFlags () );
293294 Cubiomes .applySeed (generator , dimension , seed );
294295
295296 // currently only used for end cities
@@ -542,8 +543,8 @@ static ToIntBiFunction<Integer, Integer> getCarverBiomeFunction(Arena arena, lon
542543 if (version > Cubiomes .MC_1_17_1 ()) {
543544 return (_ , _ ) -> -1 ;
544545 }
545- MemorySegment generator = Generator .allocate (arena );
546- Cubiomes .setupGenerator (generator , version , 0 );
546+ MemorySegment generator = Generator .allocate (arena );
547+ Cubiomes .setupGenerator (generator , version , WorldPresetManager . activePreset (). generatorFlags () );
547548 Cubiomes .applySeed (generator , dimension , seed );
548549 return (chunkX , chunkZ ) -> Cubiomes .getBiomeAt (generator , 4 , chunkX << 2 , 0 , chunkZ << 2 );
549550 }
0 commit comments