From 65625f410c6ea09a1335afd69d60928a741a6d96 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Tue, 28 Sep 2021 17:52:29 +0200 Subject: [PATCH] SPIGOT-6741: shouldGenerateStructures isn't implemented By: DerFrZocker --- .../craftbukkit/generator/CustomChunkGenerator.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/paper-server/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java index d823f08cec..3983425e87 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -7,6 +7,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import net.minecraft.core.BlockPosition; import net.minecraft.core.IRegistry; +import net.minecraft.core.IRegistryCustom; import net.minecraft.server.level.RegionLimitedWorldAccess; import net.minecraft.server.level.WorldServer; import net.minecraft.util.random.WeightedRandomList; @@ -28,6 +29,7 @@ import net.minecraft.world.level.chunk.ProtoChunk; import net.minecraft.world.level.levelgen.HeightMap; import net.minecraft.world.level.levelgen.SeededRandom; import net.minecraft.world.level.levelgen.WorldGenStage; +import net.minecraft.world.level.levelgen.structure.templatesystem.DefinedStructureManager; import org.bukkit.block.Biome; import org.bukkit.craftbukkit.CraftHeightMap; import org.bukkit.craftbukkit.block.CraftBlock; @@ -100,6 +102,13 @@ public class CustomChunkGenerator extends InternalChunkGenerator { return delegate.getSeaLevel(); } + @Override + public void createStructures(IRegistryCustom iregistrycustom, StructureManager structuremanager, IChunkAccess ichunkaccess, DefinedStructureManager definedstructuremanager, long i) { + if (generator.shouldGenerateStructures()) { + super.createStructures(iregistrycustom, structuremanager, ichunkaccess, definedstructuremanager, i); + } + } + @Override public void buildBase(RegionLimitedWorldAccess regionlimitedworldaccess, IChunkAccess ichunkaccess) { if (generator.shouldGenerateSurface()) {