SteamWar/BauSystem2.0
Archiviert
12
0

Optimize Depth System

Dieser Commit ist enthalten in:
yoyosource 2021-05-02 17:43:58 +02:00
Ursprung c0b35c5da7
Commit abcc80f314

Datei anzeigen

@ -99,7 +99,7 @@ public class Depth {
} }
public boolean update(List<Block> blocks) { public boolean update(List<Block> blocks) {
long totalBlastResistanceBroken = blocks.stream().filter(block -> { double totalBlastResistanceBroken = blocks.stream().filter(block -> {
Vector vector = DepthCounter.blockVector(block.getLocation().toVector()); Vector vector = DepthCounter.blockVector(block.getLocation().toVector());
return vector.getX() >= minVector.getX() return vector.getX() >= minVector.getX()
&& vector.getY() >= minVector.getY() && vector.getY() >= minVector.getY()
@ -108,9 +108,9 @@ public class Depth {
&& vector.getY() <= maxVector.getY() && vector.getY() <= maxVector.getY()
&& vector.getZ() <= maxVector.getZ(); && vector.getZ() <= maxVector.getZ();
}).filter(block -> block.getType().isBlock()) }).filter(block -> block.getType().isBlock())
.mapToLong(block -> (long) (block.getType().getBlastResistance() * 100)) .mapToDouble(block -> block.getType().getBlastResistance())
.sum(); .sum();
if (totalBlastResistanceBroken < 1800) { if (totalBlastResistanceBroken < 18) {
return false; return false;
} }
lastUpdate = TPSUtils.currentTick.get(); lastUpdate = TPSUtils.currentTick.get();