mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-17 22:00:08 +00:00
Misc Perf improvements
This commit is contained in:
@@ -66,14 +66,15 @@ public class CavePopulator extends BlockPopulator {
|
||||
updateNeeded.add(b);
|
||||
}
|
||||
}
|
||||
for(Location l : shiftCandidate.keySet()) {
|
||||
for(Map.Entry<Location, Material> entry : shiftCandidate.entrySet()) {
|
||||
Location l = entry.getKey();
|
||||
Location mut = l.clone();
|
||||
Material orig = l.getBlock().getType();
|
||||
do mut.subtract(0, 1, 0);
|
||||
while(mut.getBlock().getType().equals(orig));
|
||||
try {
|
||||
if(c.getShiftedBlocks().get(shiftCandidate.get(l)).contains(mut.getBlock().getType())) {
|
||||
mut.getBlock().setBlockData(shiftStorage.computeIfAbsent(shiftCandidate.get(l), Material::createBlockData), false);
|
||||
if(c.getShiftedBlocks().get(entry.getValue()).contains(mut.getBlock().getType())) {
|
||||
mut.getBlock().setBlockData(shiftStorage.computeIfAbsent(entry.getValue(), Material::createBlockData), false);
|
||||
}
|
||||
} catch(NullPointerException ignore) {
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ public class OrePopulator extends GaeaBlockPopulator {
|
||||
OreConfig ore = e.getKey();
|
||||
int edgeOffset = ore.getChunkEdgeOffset();
|
||||
for(int i = 0; i < num; i++) {
|
||||
int x = random.nextInt(16 - edgeOffset * 2) + edgeOffset;
|
||||
int z = random.nextInt(16 - edgeOffset * 2) + edgeOffset;
|
||||
int x = random.nextInt(16 - (edgeOffset << 1)) + edgeOffset;
|
||||
int z = random.nextInt(16 - (edgeOffset << 1)) + edgeOffset;
|
||||
int y = ores.getOreHeights().get(ore).get(random);
|
||||
|
||||
Vector v = new Vector(x, y, z);
|
||||
|
||||
Reference in New Issue
Block a user