mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 22:31:52 +00:00
add API for addons to register populators
This commit is contained in:
+1
-5
@@ -27,11 +27,7 @@ public class PopulatorFeature extends Feature<DefaultFeatureConfig> {
|
||||
FabricChunkGeneratorWrapper gen = (FabricChunkGeneratorWrapper) chunkGenerator;
|
||||
FabricChunkWorldAccess chunk = new FabricChunkWorldAccess(world, pos.getX() >> 4, pos.getZ() >> 4);
|
||||
FabricWorld world1 = new FabricWorld(world.toServerWorld(), new FabricChunkGenerator(chunkGenerator));
|
||||
gen.getCavePopulator().populate(new FabricWorldAccess(world), chunk);
|
||||
gen.getStructurePopulator().populate(new FabricWorldAccess(world), chunk);
|
||||
gen.getOrePopulator().populate(world1, chunk);
|
||||
gen.getTreePopulator().populate(world1, chunk);
|
||||
gen.getFloraPopulator().populate(world1, chunk);
|
||||
gen.getHandle().getPopulators().forEach(populator -> populator.populate(world1, chunk));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-26
@@ -50,32 +50,6 @@ public class FabricChunkGeneratorWrapper extends ChunkGenerator implements Gener
|
||||
return pack;
|
||||
}
|
||||
|
||||
private final FloraPopulator floraPopulator = new FloraPopulator(TerraFabricPlugin.getInstance());
|
||||
private final OrePopulator orePopulator = new OrePopulator(TerraFabricPlugin.getInstance());
|
||||
private final TreePopulator treePopulator = new TreePopulator(TerraFabricPlugin.getInstance());
|
||||
private final StructurePopulator structurePopulator = new StructurePopulator(TerraFabricPlugin.getInstance());
|
||||
private final CavePopulator cavePopulator = new CavePopulator(TerraFabricPlugin.getInstance());
|
||||
|
||||
public TreePopulator getTreePopulator() {
|
||||
return treePopulator;
|
||||
}
|
||||
|
||||
public OrePopulator getOrePopulator() {
|
||||
return orePopulator;
|
||||
}
|
||||
|
||||
public FloraPopulator getFloraPopulator() {
|
||||
return floraPopulator;
|
||||
}
|
||||
|
||||
public StructurePopulator getStructurePopulator() {
|
||||
return structurePopulator;
|
||||
}
|
||||
|
||||
public CavePopulator getCavePopulator() {
|
||||
return cavePopulator;
|
||||
}
|
||||
|
||||
public FabricChunkGeneratorWrapper(TerraBiomeSource biomeSource, long seed, ConfigPack configPack) {
|
||||
super(biomeSource, new StructuresConfig(false));
|
||||
this.pack = configPack;
|
||||
@@ -124,6 +98,8 @@ public class FabricChunkGeneratorWrapper extends ChunkGenerator implements Gener
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isStrongholdStartingChunk(ChunkPos chunkPos) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user