mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-08 08:46:13 +00:00
basic Fabric pack selection
This commit is contained in:
@@ -36,6 +36,7 @@ import com.dfsek.terra.fabric.world.FabricTree;
|
||||
import com.dfsek.terra.fabric.world.FabricWorldHandle;
|
||||
import com.dfsek.terra.fabric.world.TerraBiomeSource;
|
||||
import com.dfsek.terra.fabric.world.features.PopulatorFeature;
|
||||
import com.dfsek.terra.fabric.world.generator.FabricChunkGenerator;
|
||||
import com.dfsek.terra.fabric.world.generator.FabricChunkGeneratorWrapper;
|
||||
import com.dfsek.terra.registry.exception.DuplicateEntryException;
|
||||
import com.dfsek.terra.registry.master.AddonRegistry;
|
||||
@@ -134,9 +135,10 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
|
||||
|
||||
@Override
|
||||
public TerraWorld getWorld(World world) {
|
||||
if(worldMap.size() > 1) System.out.println(worldMap.size());
|
||||
return worldMap.computeIfAbsent(world.getSeed(), w -> {
|
||||
logger.info("Loading world " + w);
|
||||
return new TerraWorld(world, getConfigRegistry().get("DEFAULT"), this);
|
||||
return new TerraWorld(world, ((FabricChunkGeneratorWrapper) ((FabricChunkGenerator) world.getGenerator()).getHandle()).getPack(), this);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,9 @@ public class FabricChunkGeneratorWrapper extends ChunkGenerator implements com.d
|
||||
.apply(instance, instance.stable(FabricChunkGeneratorWrapper::new)));
|
||||
private final ConfigPack pack;
|
||||
|
||||
public ConfigPack getPack() {
|
||||
return pack;
|
||||
}
|
||||
|
||||
private final FloraPopulator floraPopulator = new FloraPopulator(TerraFabricPlugin.getInstance());
|
||||
private final OrePopulator orePopulator = new OrePopulator(TerraFabricPlugin.getInstance());
|
||||
@@ -75,8 +78,8 @@ public class FabricChunkGeneratorWrapper extends ChunkGenerator implements com.d
|
||||
super(biomeSource, new StructuresConfig(false));
|
||||
this.pack = configPack;
|
||||
|
||||
this.delegate = new DefaultChunkGenerator3D(configPack, TerraFabricPlugin.getInstance(), pack.getSamplerCache());
|
||||
delegate.getMain().logger().info("Loading world...");
|
||||
this.delegate = new DefaultChunkGenerator3D(pack, TerraFabricPlugin.getInstance(), pack.getSamplerCache());
|
||||
delegate.getMain().logger().info("Loading world with config pack " + pack.getTemplate().getID());
|
||||
this.biomeSource = biomeSource;
|
||||
|
||||
this.seed = seed;
|
||||
|
||||
Reference in New Issue
Block a user