From aab97ffee07f127297ae63de9fc767db8c13e998 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 1 Aug 2021 08:26:30 +1000 Subject: [PATCH] SPIGOT-6220: Structures in the world with custom generator not work By: DerFrZocker --- .../craftbukkit/generator/CustomChunkGenerator.java | 8 ++++++++ 1 file changed, 8 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 c44e77d9c5..6dacc0038b 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 @@ -10,6 +10,8 @@ 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; +import net.minecraft.world.entity.EnumCreatureType; import net.minecraft.world.level.BlockColumn; import net.minecraft.world.level.GeneratorAccess; import net.minecraft.world.level.GeneratorAccessSeed; @@ -18,6 +20,7 @@ import net.minecraft.world.level.LevelHeightAccessor; import net.minecraft.world.level.StructureManager; import net.minecraft.world.level.biome.BiomeBase; import net.minecraft.world.level.biome.BiomeManager; +import net.minecraft.world.level.biome.BiomeSettingsMobs; import net.minecraft.world.level.biome.WorldChunkManager; import net.minecraft.world.level.block.ITileEntity; import net.minecraft.world.level.block.entity.TileEntity; @@ -194,6 +197,11 @@ public class CustomChunkGenerator extends InternalChunkGenerator { return delegate.getBaseHeight(i, j, heightmap_type, levelheightaccessor); } + @Override + public WeightedRandomList getMobsFor(BiomeBase biomebase, StructureManager structuremanager, EnumCreatureType enumcreaturetype, BlockPosition blockposition) { + return delegate.getMobsFor(biomebase, structuremanager, enumcreaturetype, blockposition); + } + @Override public void addDecorations(RegionLimitedWorldAccess regionlimitedworldaccess, StructureManager structuremanager) { if (generator.shouldGenerateDecorations()) {