mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-11 02:06:07 +00:00
Implement additional cave config
This commit is contained in:
@@ -35,9 +35,15 @@ public class CavePopulator extends BlockPopulator {
|
||||
if(e.getValue().equals(CarvingData.CarvingType.CENTER) && c.isReplaceableInner(m)) {
|
||||
if(c.getShiftedBlocks().containsKey(b.getType())) shiftCandidate.put(b.getLocation(), b.getType());
|
||||
b.setBlockData(c.getPaletteInner(v.getBlockY()).get(random), false);
|
||||
} else if(c.isReplaceableOuter(m)){
|
||||
} else if(e.getValue().equals(CarvingData.CarvingType.WALL) && c.isReplaceableOuter(m)){
|
||||
if(c.getShiftedBlocks().containsKey(b.getType())) shiftCandidate.put(b.getLocation(), b.getType());
|
||||
b.setBlockData(c.getPaletteOuter(v.getBlockY()).get(random), false);
|
||||
} else if(e.getValue().equals(CarvingData.CarvingType.TOP) && c.isReplaceableTop(m)){
|
||||
if(c.getShiftedBlocks().containsKey(b.getType())) shiftCandidate.put(b.getLocation(), b.getType());
|
||||
b.setBlockData(c.getPaletteTop(v.getBlockY()).get(random), false);
|
||||
} else if(e.getValue().equals(CarvingData.CarvingType.BOTTOM) && c.isReplaceableBottom(m)){
|
||||
if(c.getShiftedBlocks().containsKey(b.getType())) shiftCandidate.put(b.getLocation(), b.getType());
|
||||
b.setBlockData(c.getPaletteBottom(v.getBlockY()).get(random), false);
|
||||
}
|
||||
if(c.getUpdateBlocks().contains(m)) {
|
||||
updateNeeded.add(b);
|
||||
|
||||
@@ -25,7 +25,7 @@ public class TreePopulator extends GaeaBlockPopulator {
|
||||
Biome b = TerraBiomeGrid.fromWorld(world).getBiome(origin);
|
||||
if(((UserDefinedDecorator) b.getDecorator()).getTreeChance() < random.nextInt(100)) return;
|
||||
int numTrees = 0;
|
||||
for(int i = 0; i < 10; i++) {
|
||||
for(int i = 0; i < 48; i++) {
|
||||
int y = WorldUtil.getHighestValidSpawnAt(chunk, x, z);
|
||||
if(y <= 0) continue;
|
||||
origin = chunk.getBlock(x, y, z).getLocation().add(0, 1, 0);
|
||||
@@ -34,7 +34,7 @@ public class TreePopulator extends GaeaBlockPopulator {
|
||||
try {
|
||||
b.getDecorator().getTrees().get(random).plant(origin, random, false, Terra.getInstance());
|
||||
} catch(NullPointerException ignored) {}
|
||||
if(numTrees >= b.getDecorator().getTreeDensity()) return;
|
||||
if(numTrees >= b.getDecorator().getTreeDensity()) break;
|
||||
x = random.nextInt(16); // Decrease chances of chunk-crossing trees
|
||||
z = random.nextInt(16);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user