diff --git a/src/main/java/org/dimdev/dimdoors/listener/BlockRegistryEntryAddedListener.java b/src/main/java/org/dimdev/dimdoors/listener/BlockRegistryEntryAddedListener.java index 53b811c5..514d4677 100644 --- a/src/main/java/org/dimdev/dimdoors/listener/BlockRegistryEntryAddedListener.java +++ b/src/main/java/org/dimdev/dimdoors/listener/BlockRegistryEntryAddedListener.java @@ -5,13 +5,7 @@ import net.minecraft.block.Block; import net.minecraft.util.Identifier; import org.dimdev.dimdoors.block.door.DimensionalDoorBlockRegistrar; -public class BlockRegistryEntryAddedListener implements RegistryEntryAddedCallback { - private final DimensionalDoorBlockRegistrar registrar; - - public BlockRegistryEntryAddedListener(DimensionalDoorBlockRegistrar registrar) { - this.registrar = registrar; - } - +public record BlockRegistryEntryAddedListener(DimensionalDoorBlockRegistrar registrar) implements RegistryEntryAddedCallback { @Override public void onEntryAdded(int rawId, Identifier id, Block object) { registrar.handleEntry(id, object); diff --git a/src/main/java/org/dimdev/dimdoors/listener/ItemRegistryEntryAddedListener.java b/src/main/java/org/dimdev/dimdoors/listener/ItemRegistryEntryAddedListener.java index 679c1fa6..7e929c3b 100644 --- a/src/main/java/org/dimdev/dimdoors/listener/ItemRegistryEntryAddedListener.java +++ b/src/main/java/org/dimdev/dimdoors/listener/ItemRegistryEntryAddedListener.java @@ -5,12 +5,7 @@ import net.minecraft.item.Item; import net.minecraft.util.Identifier; import org.dimdev.dimdoors.item.DimensionalDoorItemRegistrar; -public class ItemRegistryEntryAddedListener implements RegistryEntryAddedCallback { - private final DimensionalDoorItemRegistrar registrar; - - public ItemRegistryEntryAddedListener(DimensionalDoorItemRegistrar registrar) { - this.registrar = registrar; - } +public record ItemRegistryEntryAddedListener(DimensionalDoorItemRegistrar registrar) implements RegistryEntryAddedCallback { @Override public void onEntryAdded(int rawId, Identifier id, Item object) { diff --git a/src/main/java/org/dimdev/dimdoors/listener/UseDoorItemOnBlockCallbackListener.java b/src/main/java/org/dimdev/dimdoors/listener/UseDoorItemOnBlockCallbackListener.java index a4b5f4c5..bc039966 100644 --- a/src/main/java/org/dimdev/dimdoors/listener/UseDoorItemOnBlockCallbackListener.java +++ b/src/main/java/org/dimdev/dimdoors/listener/UseDoorItemOnBlockCallbackListener.java @@ -1,6 +1,10 @@ package org.dimdev.dimdoors.listener; -import net.fabricmc.fabric.api.event.player.UseBlockCallback; +import org.dimdev.dimdoors.DimensionalDoorsInitializer; +import org.dimdev.dimdoors.api.event.UseItemOnBlockCallback; +import org.dimdev.dimdoors.block.ModBlocks; +import org.dimdev.dimdoors.item.DimensionalDoorItemRegistrar; + import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemPlacementContext; @@ -9,10 +13,6 @@ import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.world.World; -import org.dimdev.dimdoors.DimensionalDoorsInitializer; -import org.dimdev.dimdoors.api.event.UseItemOnBlockCallback; -import org.dimdev.dimdoors.block.ModBlocks; -import org.dimdev.dimdoors.item.DimensionalDoorItemRegistrar; public class UseDoorItemOnBlockCallbackListener implements UseItemOnBlockCallback { @Override diff --git a/src/main/java/org/dimdev/dimdoors/mixin/accessor/BuiltinBiomesAccessor.java b/src/main/java/org/dimdev/dimdoors/mixin/accessor/BuiltinBiomesAccessor.java deleted file mode 100644 index 22793bcd..00000000 --- a/src/main/java/org/dimdev/dimdoors/mixin/accessor/BuiltinBiomesAccessor.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.dimdev.dimdoors.mixin.accessor; - -import it.unimi.dsi.fastutil.ints.Int2ObjectMap; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -import net.minecraft.util.registry.RegistryKey; -import net.minecraft.world.biome.Biome; -import net.minecraft.world.biome.BuiltinBiomes; - -@Mixin(BuiltinBiomes.class) -public interface BuiltinBiomesAccessor { - @Accessor("BY_RAW_ID") - static Int2ObjectMap> getIdMap() { - throw new AssertionError(); - } -} diff --git a/src/main/java/org/dimdev/dimdoors/pockets/PocketGenerationContext.java b/src/main/java/org/dimdev/dimdoors/pockets/PocketGenerationContext.java index ed7c0601..46b49ef2 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/PocketGenerationContext.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/PocketGenerationContext.java @@ -9,35 +9,7 @@ import org.dimdev.dimdoors.world.pocket.VirtualLocation; import java.util.Map; -public class PocketGenerationContext { - private final ServerWorld world; - private final VirtualLocation sourceVirtualLocation; - private final VirtualTarget linkTo; - private final LinkProperties linkProperties; - - public PocketGenerationContext(ServerWorld world, VirtualLocation sourceVirtualLocation, VirtualTarget linkTo, LinkProperties linkProperties) { - this.world = world; - this.sourceVirtualLocation = sourceVirtualLocation; - this.linkTo = linkTo; - this.linkProperties = linkProperties; - } - - public ServerWorld getWorld() { - return this.world; - } - - public VirtualLocation getSourceVirtualLocation() { - return this.sourceVirtualLocation; - } - - public VirtualTarget getLinkTo() { - return this.linkTo; - } - - public LinkProperties getLinkProperties() { - return this.linkProperties; - } - +public record PocketGenerationContext(ServerWorld world, VirtualLocation sourceVirtualLocation, VirtualTarget linkTo, LinkProperties linkProperties) { public Map toVariableMap(Map stringDoubleMap) { stringDoubleMap.put("depth", (double) this.sourceVirtualLocation.getDepth()); stringDoubleMap.put("public_size", (double) DimensionalDoorsInitializer.getConfig().getPocketsConfig().publicPocketSize); diff --git a/src/main/java/org/dimdev/dimdoors/pockets/generator/ChunkGenerator.java b/src/main/java/org/dimdev/dimdoors/pockets/generator/ChunkGenerator.java index 4abfaabf..761798d9 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/generator/ChunkGenerator.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/generator/ChunkGenerator.java @@ -10,14 +10,16 @@ import net.minecraft.server.world.ServerWorld; import net.minecraft.util.Identifier; import net.minecraft.util.Util; import net.minecraft.util.math.*; -import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.RegistryKey; import net.minecraft.world.ChunkRegion; import net.minecraft.world.HeightLimitView; import net.minecraft.world.Heightmap; +import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.*; import net.minecraft.world.gen.GenerationStep; +import net.minecraft.world.gen.chunk.Blender; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.dimdev.dimdoors.DimensionalDoorsInitializer; @@ -71,8 +73,8 @@ public class ChunkGenerator extends PocketGenerator { @Override public Pocket prepareAndPlacePocket(PocketGenerationContext parameters, Pocket.PocketBuilder builder) { - ServerWorld world = parameters.getWorld(); - VirtualLocation sourceVirtualLocation = parameters.getSourceVirtualLocation(); + ServerWorld world = parameters.world(); + VirtualLocation sourceVirtualLocation = parameters.sourceVirtualLocation(); int chunkSizeX = ((this.size.getX() >> 4) + (this.size.getX() % 16 == 0 ? 0 : 1)); int chunkSizeZ = ((this.size.getZ() >> 4) + (this.size.getZ() % 16 == 0 ? 0 : 1)); @@ -87,7 +89,7 @@ public class ChunkGenerator extends PocketGenerator { ArrayList protoChunks = new ArrayList<>(); for (int z = 0; z < chunkSizeZ; z++) { for (int x = 0; x < chunkSizeX; x++) { - ProtoChunk protoChunk = new ProtoChunk(new ChunkPos(pocket.getOrigin().add(x * 16, 0, z * 16)), UpgradeData.NO_UPGRADE_DATA, world); + ProtoChunk protoChunk = new ProtoChunk(new ChunkPos(pocket.getOrigin().add(x * 16, 0, z * 16)), UpgradeData.NO_UPGRADE_DATA, world, genWorld.getRegistryManager().get(Registry.BIOME_KEY), null); protoChunk.setLightingProvider(genWorld.getLightingProvider()); protoChunks.add(protoChunk); } @@ -102,24 +104,24 @@ public class ChunkGenerator extends PocketGenerator { ((ProtoChunk) protoChunk).setStatus(ChunkStatus.STRUCTURE_REFERENCES); } for (Chunk protoChunk : protoChunks) { - genWorldChunkGenerator.populateBiomes(BuiltinRegistries.BIOME, protoChunk); + genWorldChunkGenerator.populateBiomes(genWorld.getRegistryManager().get(Registry.BIOME_KEY), Util.getMainWorkerExecutor(), Blender.getNoBlending(), genWorld.getStructureAccessor(), protoChunk); ((ProtoChunk) protoChunk).setStatus(ChunkStatus.BIOMES); } for (Chunk protoChunk : protoChunks) { try { - genWorldChunkGenerator.populateNoise(Util.getMainWorkerExecutor(), genWorld.getStructureAccessor().forRegion(protoRegion), protoChunk).get(); + genWorldChunkGenerator.populateNoise(Util.getMainWorkerExecutor(), Blender.getNoBlending(), genWorld.getStructureAccessor().forRegion(protoRegion), protoChunk).get(); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } ((ProtoChunk) protoChunk).setStatus(ChunkStatus.NOISE); } for (Chunk protoChunk : protoChunks) { - genWorldChunkGenerator.buildSurface(protoRegion, protoChunk); + genWorldChunkGenerator.buildSurface(protoRegion, genWorld.getStructureAccessor(), protoChunk); ((ProtoChunk) protoChunk).setStatus(ChunkStatus.SURFACE); } for (GenerationStep.Carver carver : GenerationStep.Carver.values()) { for (Chunk protoChunk : protoChunks) { - genWorldChunkGenerator.carve(genWorld.getSeed(), genWorld.getBiomeAccess(), protoChunk, carver); + genWorldChunkGenerator.carve(protoRegion, genWorld.getSeed(), genWorld.getBiomeAccess(), genWorld.getStructureAccessor(), protoChunk, carver); ProtoChunk pChunk = ((ProtoChunk) protoChunk); if (pChunk.getStatus() == ChunkStatus.SURFACE) pChunk.setStatus(ChunkStatus.CARVERS); else pChunk.setStatus(ChunkStatus.LIQUID_CARVERS); @@ -127,7 +129,7 @@ public class ChunkGenerator extends PocketGenerator { } for (Chunk protoChunk : protoChunks) { ChunkRegion tempRegion = new ChunkRegionHack(genWorld, ChunkPos.stream(protoChunk.getPos(), 10).map(chunkPos -> protoRegion.getChunk(chunkPos.x, chunkPos.z)).collect(Collectors.toList())); - genWorldChunkGenerator.generateFeatures(tempRegion, genWorld.getStructureAccessor().forRegion(tempRegion)); + genWorldChunkGenerator.generateFeatures(tempRegion, protoChunk, genWorld.getStructureAccessor().forRegion(tempRegion)); ((ProtoChunk) protoChunk).setStatus(ChunkStatus.FEATURES); } for (Chunk protoChunk : protoChunks) { // likely only necessary for spawn step since we copy over anyways @@ -201,15 +203,15 @@ public class ChunkGenerator extends PocketGenerator { @Override public Chunk getChunk(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) { Chunk chunk = super.getChunk(chunkX, chunkZ, leastStatus, false); - return chunk == null ? new ProtoChunkHack(new ChunkPos(chunkX, chunkZ), UpgradeData.NO_UPGRADE_DATA, this) : chunk; + return chunk == null ? new ProtoChunkHack(new ChunkPos(chunkX, chunkZ), UpgradeData.NO_UPGRADE_DATA, this, this.getRegistryManager().get(Registry.BIOME_KEY)) : chunk; } // TODO: Override getSeed() } private static class ProtoChunkHack extends ProtoChunk { // exists solely to make some calls in the non utilized chunks faster - public ProtoChunkHack(ChunkPos pos, UpgradeData upgradeData, HeightLimitView world) { - super(pos, upgradeData, world); + public ProtoChunkHack(ChunkPos pos, UpgradeData upgradeData, HeightLimitView world, Registry biomeRegistry) { + super(pos, upgradeData, world, biomeRegistry, null); } @Override diff --git a/src/main/java/org/dimdev/dimdoors/pockets/generator/PocketGenerator.java b/src/main/java/org/dimdev/dimdoors/pockets/generator/PocketGenerator.java index eee16e6b..8ee1d00a 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/generator/PocketGenerator.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/generator/PocketGenerator.java @@ -162,7 +162,7 @@ public abstract class PocketGenerator implements Weighted rift.getDestination().setLocation(new Location(world, rift.getPos()))); - TemplateUtils.registerRifts(manager.getRifts(), parameters.getLinkTo(), parameters.getLinkProperties(), pocket); + TemplateUtils.registerRifts(manager.getRifts(), parameters.linkTo(), parameters.linkProperties(), pocket); } public RiftManager getRiftManager(Pocket pocket) { diff --git a/src/main/java/org/dimdev/dimdoors/pockets/generator/SchematicGenerator.java b/src/main/java/org/dimdev/dimdoors/pockets/generator/SchematicGenerator.java index 80e4e990..68d1dedb 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/generator/SchematicGenerator.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/generator/SchematicGenerator.java @@ -1,56 +1,40 @@ package org.dimdev.dimdoors.pockets.generator; -import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; -import net.fabricmc.fabric.api.util.NbtType; -import net.fabricmc.loader.api.FabricLoader; -import net.minecraft.client.network.PlayerListEntry; -import net.minecraft.client.network.ServerInfo; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.PlayerManager; -import net.minecraft.server.network.ServerPlayNetworkHandler; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.server.network.ServerPlayerInteractionManager; -import net.minecraft.server.world.ServerEntityManager; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.text.TranslatableText; -import net.minecraft.util.Identifier; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3i; -import net.minecraft.world.chunk.Chunk; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.dimdev.dimdoors.api.util.Path; -import org.dimdev.dimdoors.block.entity.RiftBlockEntity; -import org.dimdev.dimdoors.command.PocketCommand; -import org.dimdev.dimdoors.pockets.PocketLoader; -import org.dimdev.dimdoors.pockets.PocketTemplate; -import org.dimdev.dimdoors.pockets.modifier.AbsoluteRiftBlockEntityModifier; -import org.dimdev.dimdoors.pockets.modifier.RiftManager; -import org.dimdev.dimdoors.api.util.BlockPlacementType; -import org.dimdev.dimdoors.pockets.PocketGenerationContext; -import org.dimdev.dimdoors.util.schematic.Schematic; -import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry; -import org.dimdev.dimdoors.world.pocket.type.LazyGenerationPocket; -import org.dimdev.dimdoors.world.pocket.type.Pocket; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.dimdev.dimdoors.api.util.BlockPlacementType; +import org.dimdev.dimdoors.api.util.Path; +import org.dimdev.dimdoors.block.entity.RiftBlockEntity; +import org.dimdev.dimdoors.command.PocketCommand; +import org.dimdev.dimdoors.pockets.PocketGenerationContext; +import org.dimdev.dimdoors.pockets.PocketLoader; +import org.dimdev.dimdoors.pockets.PocketTemplate; +import org.dimdev.dimdoors.pockets.modifier.AbsoluteRiftBlockEntityModifier; +import org.dimdev.dimdoors.pockets.modifier.RiftManager; +import org.dimdev.dimdoors.util.schematic.Schematic; +import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry; +import org.dimdev.dimdoors.world.pocket.type.LazyGenerationPocket; +import org.dimdev.dimdoors.world.pocket.type.Pocket; + +import net.minecraft.nbt.NbtCompound; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.text.TranslatableText; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3i; +import net.minecraft.world.chunk.Chunk; + +import net.fabricmc.fabric.api.util.NbtType; + public class SchematicGenerator extends LazyPocketGenerator{ private static final Logger LOGGER = LogManager.getLogger(); public static final String KEY = "schematic"; - /* - public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( - Codec.INT.fieldOf("size").forGetter(SchematicGenerator::getSize), - Codec.STRING.fieldOf("id").forGetter(SchematicGenerator::getName), - Codec.INT.optionalFieldOf("weight", 5).forGetter(schematicGenerator -> schematicGenerator.getWeight(null)) - ).apply(instance, SchematicGenerator::new)); - */ - private String id; private Identifier templateID; private BlockPlacementType placementType = BlockPlacementType.SECTION_NO_UPDATE; @@ -149,7 +133,7 @@ public class SchematicGenerator extends LazyPocketGenerator{ @Override public Pocket prepareAndPlacePocket(PocketGenerationContext parameters, Pocket.PocketBuilder builder) { - ServerWorld world = parameters.getWorld(); + ServerWorld world = parameters.world(); Map variableMap = parameters.toVariableMap(new HashMap<>()); PocketTemplate template = PocketLoader.getInstance().getTemplates().get(Path.stringPath(templateID)); diff --git a/src/main/java/org/dimdev/dimdoors/pockets/generator/VoidGenerator.java b/src/main/java/org/dimdev/dimdoors/pockets/generator/VoidGenerator.java index c6c4e3ad..bc538b7d 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/generator/VoidGenerator.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/generator/VoidGenerator.java @@ -26,7 +26,7 @@ public class VoidGenerator extends LazyPocketGenerator { @Override public Pocket prepareAndPlacePocket(PocketGenerationContext parameters, Pocket.PocketBuilder builder) { - Pocket pocket = DimensionalRegistry.getPocketDirectory(parameters.getWorld().getRegistryKey()).newPocket(builder); + Pocket pocket = DimensionalRegistry.getPocketDirectory(parameters.world().getRegistryKey()).newPocket(builder); Map variableMap = parameters.toVariableMap(new HashMap<>()); pocket.setSize((int) widthEquation.apply(variableMap), (int) heightEquation.apply(variableMap), (int) lengthEquation.apply(variableMap)); diff --git a/src/main/java/org/dimdev/dimdoors/pockets/modifier/AbsoluteRiftBlockEntityModifier.java b/src/main/java/org/dimdev/dimdoors/pockets/modifier/AbsoluteRiftBlockEntityModifier.java index e6fff881..1e37f7b1 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/modifier/AbsoluteRiftBlockEntityModifier.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/modifier/AbsoluteRiftBlockEntityModifier.java @@ -59,7 +59,11 @@ public class AbsoluteRiftBlockEntityModifier implements LazyModifier { NbtList riftsNbt; if (rifts != null) { - riftsNbt = rifts.values().parallelStream().unordered().map(rift -> rift.writeNbt(new NbtCompound())).collect(Collectors.toCollection(NbtList::new)); + riftsNbt = rifts.values().parallelStream().unordered().map(rift -> { + NbtCompound e = new NbtCompound(); + rift.writeNbt(e); + return e; + }).collect(Collectors.toCollection(NbtList::new)); } else { riftsNbt = new NbtList(); riftsNbt.addAll(serializedRifts.values()); diff --git a/src/main/java/org/dimdev/dimdoors/pockets/modifier/DimensionalDoorModifier.java b/src/main/java/org/dimdev/dimdoors/pockets/modifier/DimensionalDoorModifier.java index c633e845..e221a9f3 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/modifier/DimensionalDoorModifier.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/modifier/DimensionalDoorModifier.java @@ -156,7 +156,7 @@ public class DimensionalDoorModifier implements LazyCompatibleModifier { chunk.setBlockState(pos.up(), upper, false); }); } else { - ServerWorld world = parameters.getWorld(); + ServerWorld world = parameters.world(); world.setBlockState(pos, lower); world.setBlockState(pos.up(), upper); diff --git a/src/main/java/org/dimdev/dimdoors/pockets/modifier/ShellModifier.java b/src/main/java/org/dimdev/dimdoors/pockets/modifier/ShellModifier.java index 1a943dfe..e47db4c8 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/modifier/ShellModifier.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/modifier/ShellModifier.java @@ -162,7 +162,7 @@ public class ShellModifier implements LazyModifier { boxToDrawAround = BlockBox.create(new Vec3i(pocketBox.getMinX(), pocketBox.getMinY(), pocketBox.getMinZ()), new Vec3i(pocketBox.getMaxX(), pocketBox.getMaxY(), pocketBox.getMaxZ())); layers.forEach(layer -> pocket.expand(layer.getThickness(variableMap))); } else { - layers.forEach(layer -> drawLayer(layer, manager.getPocket(), parameters.getWorld())); + layers.forEach(layer -> drawLayer(layer, manager.getPocket(), parameters.world())); } } diff --git a/src/main/java/org/dimdev/dimdoors/pockets/virtual/reference/PocketGeneratorReference.java b/src/main/java/org/dimdev/dimdoors/pockets/virtual/reference/PocketGeneratorReference.java index 84089e02..44922aa1 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/virtual/reference/PocketGeneratorReference.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/virtual/reference/PocketGeneratorReference.java @@ -130,14 +130,14 @@ public abstract class PocketGeneratorReference implements ImplementedVirtualPock Pocket.PocketBuilder builder = generator.pocketBuilder(parameters) - .virtualLocation(parameters.getSourceVirtualLocation()); // TODO: virtualLocation thing still makes little sense + .virtualLocation(parameters.sourceVirtualLocation()); // TODO: virtualLocation thing still makes little sense generator.applyModifiers(parameters, builder); this.applyModifiers(parameters, builder); LazyPocketGenerator.currentlyGenerating = true; // ensure we aren't missing any chunks that were already loaded previously // for lazy gen - Set alreadyLoadedChunks = StreamSupport.stream(parameters.getWorld().getChunkManager().threadedAnvilChunkStorage.entryIterator().spliterator(), false).map(ChunkHolder::getWorldChunk).filter(Objects::nonNull).collect(Collectors.toSet()); + Set alreadyLoadedChunks = StreamSupport.stream(parameters.world().getChunkManager().threadedAnvilChunkStorage.entryIterator().spliterator(), false).map(ChunkHolder::getWorldChunk).filter(Objects::nonNull).collect(Collectors.toSet()); Pocket pocket = generator.prepareAndPlacePocket(parameters, builder); BlockPos originalOrigin = pocket.getOrigin(); diff --git a/src/main/java/org/dimdev/dimdoors/pockets/virtual/selection/AbstractVirtualPocketList.java b/src/main/java/org/dimdev/dimdoors/pockets/virtual/selection/AbstractVirtualPocketList.java index 24d84749..cd57225d 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/virtual/selection/AbstractVirtualPocketList.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/virtual/selection/AbstractVirtualPocketList.java @@ -12,7 +12,6 @@ public abstract class AbstractVirtualPocketList extends WeightedList