mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 14:21:08 +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.FabricWorldHandle;
|
||||||
import com.dfsek.terra.fabric.world.TerraBiomeSource;
|
import com.dfsek.terra.fabric.world.TerraBiomeSource;
|
||||||
import com.dfsek.terra.fabric.world.features.PopulatorFeature;
|
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.fabric.world.generator.FabricChunkGeneratorWrapper;
|
||||||
import com.dfsek.terra.registry.exception.DuplicateEntryException;
|
import com.dfsek.terra.registry.exception.DuplicateEntryException;
|
||||||
import com.dfsek.terra.registry.master.AddonRegistry;
|
import com.dfsek.terra.registry.master.AddonRegistry;
|
||||||
@@ -134,9 +135,10 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TerraWorld getWorld(World world) {
|
public TerraWorld getWorld(World world) {
|
||||||
|
if(worldMap.size() > 1) System.out.println(worldMap.size());
|
||||||
return worldMap.computeIfAbsent(world.getSeed(), w -> {
|
return worldMap.computeIfAbsent(world.getSeed(), w -> {
|
||||||
logger.info("Loading world " + 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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -44,6 +44,9 @@ public class FabricChunkGeneratorWrapper extends ChunkGenerator implements com.d
|
|||||||
.apply(instance, instance.stable(FabricChunkGeneratorWrapper::new)));
|
.apply(instance, instance.stable(FabricChunkGeneratorWrapper::new)));
|
||||||
private final ConfigPack pack;
|
private final ConfigPack pack;
|
||||||
|
|
||||||
|
public ConfigPack getPack() {
|
||||||
|
return pack;
|
||||||
|
}
|
||||||
|
|
||||||
private final FloraPopulator floraPopulator = new FloraPopulator(TerraFabricPlugin.getInstance());
|
private final FloraPopulator floraPopulator = new FloraPopulator(TerraFabricPlugin.getInstance());
|
||||||
private final OrePopulator orePopulator = new OrePopulator(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));
|
super(biomeSource, new StructuresConfig(false));
|
||||||
this.pack = configPack;
|
this.pack = configPack;
|
||||||
|
|
||||||
this.delegate = new DefaultChunkGenerator3D(configPack, TerraFabricPlugin.getInstance(), pack.getSamplerCache());
|
this.delegate = new DefaultChunkGenerator3D(pack, TerraFabricPlugin.getInstance(), pack.getSamplerCache());
|
||||||
delegate.getMain().logger().info("Loading world...");
|
delegate.getMain().logger().info("Loading world with config pack " + pack.getTemplate().getID());
|
||||||
this.biomeSource = biomeSource;
|
this.biomeSource = biomeSource;
|
||||||
|
|
||||||
this.seed = seed;
|
this.seed = seed;
|
||||||
|
|||||||
Reference in New Issue
Block a user