Optimize Depth
Dieser Commit ist enthalten in:
Ursprung
1fa3015b36
Commit
5a5a59305a
@ -62,7 +62,7 @@ public class Depth {
|
|||||||
dimensions.setY(Math.abs(dimensions.getY()));
|
dimensions.setY(Math.abs(dimensions.getY()));
|
||||||
dimensions.setZ(Math.abs(dimensions.getZ()));
|
dimensions.setZ(Math.abs(dimensions.getZ()));
|
||||||
|
|
||||||
if (dimensions.getX() != 0 && dimensions.getY() != 0 && dimensions.getZ() != 0) {
|
if (tntCount > 4 && dimensions.getX() != 0 && dimensions.getY() != 0 && dimensions.getZ() != 0) {
|
||||||
RegionUtils.message(region, player -> DepthCounter.getMessage(player, dimensions.getBlockX() + 1, dimensions.getBlockY() + 1, dimensions.getBlockZ() + 1, tntCount));
|
RegionUtils.message(region, player -> DepthCounter.getMessage(player, dimensions.getBlockX() + 1, dimensions.getBlockY() + 1, dimensions.getBlockZ() + 1, tntCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ public class Depth {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean update(List<Block> blocks) {
|
public boolean update(List<Block> blocks) {
|
||||||
long overlappingBlocks = blocks.stream().filter(block -> {
|
long 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()
|
||||||
@ -87,8 +87,10 @@ public class Depth {
|
|||||||
&& vector.getX() <= maxVector.getX()
|
&& vector.getX() <= maxVector.getX()
|
||||||
&& vector.getY() <= maxVector.getY()
|
&& vector.getY() <= maxVector.getY()
|
||||||
&& vector.getZ() <= maxVector.getZ();
|
&& vector.getZ() <= maxVector.getZ();
|
||||||
}).count();
|
}).filter(block -> block.getType().isBlock())
|
||||||
if (overlappingBlocks < 4) {
|
.mapToLong(block -> (long) (block.getType().getBlastResistance() * 100))
|
||||||
|
.sum();
|
||||||
|
if (totalBlastResistanceBroken < 1800) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
lastUpdate = TPSUtils.currentTick.get();
|
lastUpdate = TPSUtils.currentTick.get();
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren