mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 14:21:08 +00:00
implement SamplerCache for drastically increased structure perf
This commit is contained in:
@@ -145,8 +145,9 @@ public class TerraBukkitPlugin extends JavaPlugin implements TerraPlugin {
|
||||
public @Nullable ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, @Nullable String id) {
|
||||
return new BukkitChunkGeneratorWrapper(generatorMap.computeIfAbsent(worldName, name -> {
|
||||
if(!registry.contains(id)) throw new IllegalArgumentException("No such config pack \"" + id + "\"");
|
||||
worlds.put(worldName, registry.get(id));
|
||||
return new MasterChunkGenerator(registry.get(id), this);
|
||||
ConfigPack pack = registry.get(id);
|
||||
worlds.put(worldName, pack);
|
||||
return new MasterChunkGenerator(registry.get(id), this, pack.getSamplerCache());
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ public class SpawnCommand extends WorldCommand implements DebugCommand {
|
||||
int z = p.getBlockZ();
|
||||
Position dummy = new Position(0, 0);
|
||||
com.dfsek.terra.api.platform.world.World w = BukkitAdapter.adapt(world);
|
||||
String check = new CheckFunction(getMain(), new NumericConstant(0, dummy), new NumericConstant(0, dummy), new NumericConstant(0, dummy), getMain().getWorld(w).getConfig().getCheckCache(), dummy).apply(new TerraImplementationArguments(new StructureBuffer(
|
||||
String check = new CheckFunction(getMain(), new NumericConstant(0, dummy), new NumericConstant(0, dummy), new NumericConstant(0, dummy), getMain().getWorld(w).getConfig().getSamplerCache(), dummy).apply(new TerraImplementationArguments(new StructureBuffer(
|
||||
new com.dfsek.terra.api.math.vector.Location(w, x, y, z)
|
||||
), Rotation.NONE, new FastRandom(), 0));
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@ dump-default: true
|
||||
biome-search-resolution: 4
|
||||
cache:
|
||||
carver: 512
|
||||
structure: 128
|
||||
structure: 1024
|
||||
master-disable:
|
||||
caves: false
|
||||
+1
-1
@@ -76,7 +76,7 @@ public class FabricChunkGeneratorWrapper extends ChunkGenerator implements Gener
|
||||
super(biomeSource, new StructuresConfig(false));
|
||||
this.pack = configPack;
|
||||
|
||||
this.delegate = new MasterChunkGenerator(configPack, TerraFabricPlugin.getInstance());
|
||||
this.delegate = new MasterChunkGenerator(configPack, TerraFabricPlugin.getInstance(), pack.getSamplerCache());
|
||||
delegate.getMain().getLogger().info("Loading world...");
|
||||
this.biomeSource = biomeSource;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user