Create Arrakis brushable deposits after terrain population
This commit is contained in:
parent
2eb3f54b8f
commit
3322ba507e
1 changed files with 21 additions and 10 deletions
|
|
@ -444,6 +444,10 @@ public final class DuneTerrain extends JavaPlugin implements Listener {
|
|||
placeRandomSpicePatch(data, chunkX, chunkZ, heights,emittedSpice);
|
||||
if (plugin.getConfig().getBoolean("dense-spice.enabled", true)) {
|
||||
int spacing = Math.max(128, plugin.getConfig().getInt("dense-spice.spacing", 512));
|
||||
for(var entries=emittedSpice.iterator();entries.hasNext();){
|
||||
var p=entries.next();
|
||||
if(DenseSpice.contains(world.getSeed(),chunkX*16+p.x(),chunkZ*16+p.z(),spacing))entries.remove();
|
||||
}
|
||||
for (int x=0;x<16;x++) for(int z=0;z<16;z++)
|
||||
if(DenseSpice.contains(world.getSeed(),chunkX*16+x,chunkZ*16+z,spacing))
|
||||
data.setBlock(x,heights[x][z],z,Material.ORANGE_TERRACOTTA);
|
||||
|
|
@ -573,8 +577,8 @@ public final class DuneTerrain extends JavaPlugin implements Listener {
|
|||
for (int i = 0; i < count; i++) {
|
||||
int x = random.nextInt(16), z = random.nextInt(16), y = heights[x][z];
|
||||
Material surface = data.getType(x, y, z);
|
||||
if (y + 1 < maxY && y > minY && (surface == Material.SAND || surface == Material.RED_SAND)){
|
||||
data.setBlock(x, y, z, Material.SUSPICIOUS_SAND);emitted.add(new SpiceDepositProvenance.Position(x,y,z));}
|
||||
if (y + 1 < maxY && y > minY && SpiceDepositProvenance.hostSand(surface))
|
||||
emitted.add(new SpiceDepositProvenance.Position(x,y,z));
|
||||
}
|
||||
}
|
||||
private void placeRandomSpicePatch(ChunkData data, int chunkX, int chunkZ, int[][] heights,List<SpiceDepositProvenance.Position> emitted) {
|
||||
|
|
@ -604,8 +608,8 @@ public final class DuneTerrain extends JavaPlugin implements Listener {
|
|||
long blockSeed = mix64(gx * 0x9E3779B97F4A7C15L ^ gz * 0xC2B2AE3D27D4EB4FL ^ salt);
|
||||
if (hashUnit(blockSeed) >= density) continue;
|
||||
int y = heights[x][z];
|
||||
if (data.getType(x, y, z) == Material.SAND || data.getType(x, y, z) == Material.RED_SAND)
|
||||
{data.setBlock(x, y, z, Material.SUSPICIOUS_SAND);emitted.add(new SpiceDepositProvenance.Position(x,y,z));}
|
||||
if (SpiceDepositProvenance.hostSand(data.getType(x, y, z)))
|
||||
emitted.add(new SpiceDepositProvenance.Position(x,y,z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff