continue work on janky pregenerator

This commit is contained in:
dfsek
2021-01-04 01:29:51 -07:00
parent ee093397d3
commit 75fbda5a9f
10 changed files with 265 additions and 32 deletions

View File

@@ -160,4 +160,9 @@ public class Location implements Cloneable {
public Vector3 toVector() {
return vector.clone();
}
@Override
public String toString() {
return "(" + getX() + ", " + getY() + ", " + getZ() + ")";
}
}

View File

@@ -152,8 +152,10 @@ public class MasterChunkGenerator implements TerraChunkGenerator {
Palette<BlockData> stairPalette = stairs.get(down.getMaterial());
if(stairPalette != null) {
BlockData stair = stairPalette.get(0, block.getBlockX(), block.getBlockZ()).clone();
Stairs stairNew = (Stairs) stair;
if(placeStair(orig, chunk, block, thresh, sampler, stairNew)) return; // Successfully placed part.
if(stair instanceof Stairs) {
Stairs stairNew = (Stairs) stair;
if(placeStair(orig, chunk, block, thresh, sampler, stairNew)) return; // Successfully placed part.
}
}
}
BlockData slab = slabs.getOrDefault(down.getMaterial(), blank).get(0, block.getBlockX(), block.getBlockZ());
@@ -171,9 +173,11 @@ public class MasterChunkGenerator implements TerraChunkGenerator {
Palette<BlockData> stairPalette = stairs.get(up.getMaterial());
if(stairPalette != null) {
BlockData stair = stairPalette.get(0, block.getBlockX(), block.getBlockZ()).clone();
Stairs stairNew = (Stairs) stair.clone();
stairNew.setHalf(Bisected.Half.TOP);
if(placeStair(orig, chunk, block, thresh, sampler, stairNew)) return; // Successfully placed part.
if(stair instanceof Stairs) {
Stairs stairNew = (Stairs) stair.clone();
stairNew.setHalf(Bisected.Half.TOP);
if(placeStair(orig, chunk, block, thresh, sampler, stairNew)) return; // Successfully placed part.
}
}
}
BlockData slab = slabs.getOrDefault(up.getMaterial(), blank).get(0, block.getBlockX(), block.getBlockZ()).clone();