Update to latest Gaea

This commit is contained in:
dfsek
2020-11-06 15:04:01 -07:00
parent d4fc92d770
commit bfa55fdb5d
8 changed files with 23 additions and 18 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ dependencies {
compileOnly("org.spigotmc:spigot-api:1.16.2-R0.1-SNAPSHOT") compileOnly("org.spigotmc:spigot-api:1.16.2-R0.1-SNAPSHOT")
compileOnly("org.jetbrains:annotations:20.1.0") // more recent. compileOnly("org.jetbrains:annotations:20.1.0") // more recent.
implementation("commons-io:commons-io:2.4") implementation("commons-io:commons-io:2.4")
compileOnly(name = "Gaea-1.13.2", group = "") compileOnly(name = "Gaea-1.14.0", group = "")
implementation("org.apache.commons:commons-imaging:1.0-alpha2") implementation("org.apache.commons:commons-imaging:1.0-alpha2")
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT") compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT")
implementation("org.bstats:bstats-bukkit:1.7") implementation("org.bstats:bstats-bukkit:1.7")
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -23,7 +23,7 @@ import java.util.Objects;
public class Terra extends GaeaPlugin { public class Terra extends GaeaPlugin {
private static Terra instance; private static Terra instance;
private Map<String, TerraChunkGenerator> generatorMap = new HashMap<>(); private final Map<String, TerraChunkGenerator> generatorMap = new HashMap<>();
public static Terra getInstance() { public static Terra getInstance() {
return instance; return instance;
@@ -26,6 +26,7 @@ import org.bukkit.generator.BlockPopulator;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.polydev.gaea.biome.Biome; import org.polydev.gaea.biome.Biome;
import org.polydev.gaea.biome.BiomeGrid;
import org.polydev.gaea.generation.GaeaChunkGenerator; import org.polydev.gaea.generation.GaeaChunkGenerator;
import org.polydev.gaea.generation.GenerationPhase; import org.polydev.gaea.generation.GenerationPhase;
import org.polydev.gaea.generation.GenerationPopulator; import org.polydev.gaea.generation.GenerationPopulator;
@@ -62,7 +63,7 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
} }
@Override @Override
public ChunkData generateBase(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, FastNoiseLite fastNoise) { public ChunkData generateBase(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, ChunkInterpolator interpolator) {
if(needsLoad) load(world); // Load population data for world. if(needsLoad) load(world); // Load population data for world.
ChunkData chunk = createChunkData(world); ChunkData chunk = createChunkData(world);
TerraWorld tw = TerraWorld.getWorld(world); TerraWorld tw = TerraWorld.getWorld(world);
@@ -70,23 +71,23 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
ConfigPack config = tw.getConfig(); ConfigPack config = tw.getConfig();
int xOrig = (chunkX << 4); int xOrig = (chunkX << 4);
int zOrig = (chunkZ << 4); int zOrig = (chunkZ << 4);
org.polydev.gaea.biome.BiomeGrid grid = getBiomeGrid(world);
for(byte x = 0; x < 16; x++) { for(byte x = 0; x < 16; x++) {
for(byte z = 0; z < 16; z++) { for(byte z = 0; z < 16; z++) {
int paletteLevel = 0; int paletteLevel = 0;
int cx = xOrig + x; int cx = xOrig + x;
int cz = zOrig + z; int cz = zOrig + z;
Biome orig = getBiomeGrid(world).getBiome(xOrig + x, zOrig + z, GenerationPhase.BASE); Biome b = grid.getBiome(xOrig + x, zOrig + z, GenerationPhase.PALETTE_APPLY);
Biome b = getBiomeGrid(world).getBiome(xOrig + x, zOrig + z, GenerationPhase.PALETTE_APPLY);
BiomeConfig c = config.getBiome((UserDefinedBiome) b); BiomeConfig c = config.getBiome((UserDefinedBiome) b);
BiomeSlabConfig slab = c.getSlabs(); BiomeSlabConfig slab = c.getSlabs();
int sea = config.getBiome((UserDefinedBiome) orig).getOcean().getSeaLevel(); int sea = c.getOcean().getSeaLevel();
Palette<BlockData> seaPalette = c.getOcean().getOcean(); Palette<BlockData> seaPalette = c.getOcean().getOcean();
for(int y = world.getMaxHeight() - 1; y >= 0; y--) { for(int y = world.getMaxHeight() - 1; y >= 0; y--) {
if(super.getInterpolatedNoise(x, y, z) > 0) { if(interpolator.getNoise(x, y, z) > 0) {
BlockData data = b.getGenerator().getPalette(y).get(paletteLevel, cx, cz); BlockData data = b.getGenerator().getPalette(y).get(paletteLevel, cx, cz);
chunk.setBlock(x, y, z, data); chunk.setBlock(x, y, z, data);
if(paletteLevel == 0 && slab != null && y < 255) { if(paletteLevel == 0 && slab != null && y < 255) {
prepareBlockPart(data, chunk.getBlockData(x, y + 1, z), chunk, new Vector(x, y + 1, z), slab.getSlabs(), slab.getStairs(), slab.getSlabThreshold()); prepareBlockPart(data, chunk.getBlockData(x, y + 1, z), chunk, new Vector(x, y + 1, z), slab.getSlabs(), slab.getStairs(), slab.getSlabThreshold(), interpolator);
} }
paletteLevel++; paletteLevel++;
} else if(y <= sea) { } else if(y <= sea) {
@@ -99,20 +100,20 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
return chunk; return chunk;
} }
private void prepareBlockPart(BlockData down, BlockData orig, ChunkData chunk, Vector block, Map<Material, Palette<BlockData>> slabs, Map<Material, Palette<BlockData>> stairs, double thresh) { private void prepareBlockPart(BlockData down, BlockData orig, ChunkData chunk, Vector block, Map<Material, Palette<BlockData>> slabs, Map<Material, Palette<BlockData>> stairs, double thresh, ChunkInterpolator interpolator) {
if(getInterpolatedNoise(block.getBlockX(), block.getBlockY() - 0.4, block.getBlockZ()) > thresh) { if(interpolator.getNoise(block.getBlockX(), block.getBlockY() - 0.4, block.getBlockZ()) > thresh) {
if(stairs != null) { if(stairs != null) {
Palette<BlockData> stairPalette = stairs.get(down.getMaterial()); Palette<BlockData> stairPalette = stairs.get(down.getMaterial());
if(stairPalette != null) { if(stairPalette != null) {
BlockData stair = stairPalette.get(0, block.getBlockX(), block.getBlockZ()); BlockData stair = stairPalette.get(0, block.getBlockX(), block.getBlockZ());
Stairs stairNew = (Stairs) stair.clone(); Stairs stairNew = (Stairs) stair.clone();
if(getInterpolatedNoise(block.getBlockX() - 0.5, block.getBlockY(), block.getBlockZ()) > thresh) { if(interpolator.getNoise(block.getBlockX() - 0.5, block.getBlockY(), block.getBlockZ()) > thresh) {
stairNew.setFacing(BlockFace.WEST); stairNew.setFacing(BlockFace.WEST);
} else if(getInterpolatedNoise(block.getBlockX(), block.getBlockY(), block.getBlockZ() - 0.5) > thresh) { } else if(interpolator.getNoise(block.getBlockX(), block.getBlockY(), block.getBlockZ() - 0.5) > thresh) {
stairNew.setFacing(BlockFace.NORTH); stairNew.setFacing(BlockFace.NORTH);
} else if(getInterpolatedNoise(block.getBlockX(), block.getBlockY(), block.getBlockZ() + 0.5) > thresh) { } else if(interpolator.getNoise(block.getBlockX(), block.getBlockY(), block.getBlockZ() + 0.5) > thresh) {
stairNew.setFacing(BlockFace.SOUTH); stairNew.setFacing(BlockFace.SOUTH);
} else if(getInterpolatedNoise(block.getBlockX() + 0.5, block.getBlockY(), block.getBlockZ()) > thresh) { } else if(interpolator.getNoise(block.getBlockX() + 0.5, block.getBlockY(), block.getBlockZ()) > thresh) {
stairNew.setFacing(BlockFace.EAST); stairNew.setFacing(BlockFace.EAST);
} else stairNew = null; } else stairNew = null;
if(stairNew != null) { if(stairNew != null) {
@@ -210,5 +211,9 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
return configPack.vanillaStructures; return configPack.vanillaStructures;
} }
@Override
public boolean isParallelCapable() {
return true;
}
} }
+1 -1
View File
@@ -40,7 +40,7 @@ grids:
frequencies: frequencies:
grid-x: 3072 grid-x: 3072
grid-z: 4096 grid-z: 4096
zone: 3072 zone: 2048
blend: blend:
enable: true enable: true
frequency: 0.125 frequency: 0.125
@@ -17,11 +17,11 @@ loot:
features: features:
- ENTITY_FEATURE: - ENTITY_FEATURE:
entity: SILVERFISH entity: SILVERFISH
attempts: 20 attempts: 40
in-height: 1 in-height: 1
amount: amount:
min: 10 min: 20
max: 15 max: 30
spawnable-on: spawnable-on:
- "minecraft:stone" - "minecraft:stone"
- "minecraft:stone_bricks" - "minecraft:stone_bricks"