SPIGOT-6741: shouldGenerateStructures isn't implemented

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2021-09-28 17:52:29 +02:00
parent 50d4716e9f
commit 65625f410c

View file

@ -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()) {