SteamWar/BauSystem
Archiviert
13
0

Fix Advanced Trace mode

Dieser Commit ist enthalten in:
jojo 2021-01-16 18:33:51 +01:00
Ursprung cbc8a919a6
Commit 1afa2b9242

Datei anzeigen

@ -47,13 +47,13 @@ public class Advanced extends Basic {
if (!showModeParameter.isWater() && position.isExploded() && checkWater(position.getLocation())) { if (!showModeParameter.isWater() && position.isExploded() && checkWater(position.getLocation())) {
for(TNTPosition pos : position.getRecord().getPositions()){ for(TNTPosition pos : position.getRecord().getPositions()){
applyOnPosition(pos, updatePointPosition -> applyOnPosition(pos, updatePointPosition ->
updateEntityMap.computeIfPresent(updatePointPosition, (p, point) -> point.hide(player, false) ? null : point)); updateEntityMap.computeIfPresent(new RoundedTNTPosition(updatePointPosition), (p, point) -> point.hide(player, false) ? null : point));
} }
return; return;
} }
applyOnPosition(position, updatePointPosition -> applyOnPosition(position, updatePointPosition ->
updateEntityMap.computeIfAbsent(updatePointPosition, pos -> createEntity(position.getLocation(), false)) updateEntityMap.computeIfAbsent(new RoundedTNTPosition(updatePointPosition), pos -> createEntity(updatePointPosition, false))
.display(player, position.isExploded())); .display(player, position.isExploded()));
} }
@ -64,13 +64,13 @@ public class Advanced extends Basic {
updateEntityMap.clear(); updateEntityMap.clear();
} }
private void applyOnPosition(TNTPosition position, Consumer<RoundedTNTPosition> function){ private void applyOnPosition(TNTPosition position, Consumer<Vector> function){
if (position.getPreviousLocation() == null) return; if (position.getPreviousLocation() == null) return;
if (showModeParameter.isInterpolate_Y()) { if (showModeParameter.isInterpolate_Y()) {
Vector updatePointY = position.getPreviousLocation().clone().setY(position.getLocation().getY()); Vector updatePointY = position.getPreviousLocation().clone().setY(position.getLocation().getY());
if(!position.getLocation().equals(updatePointY)) if(!position.getLocation().equals(updatePointY))
function.accept(new RoundedTNTPosition(updatePointY)); function.accept(updatePointY);
} }
if (showModeParameter.isInterpolate_XZ()){ if (showModeParameter.isInterpolate_XZ()){
@ -79,7 +79,7 @@ public class Advanced extends Basic {
? position.getLocation().clone().setZ(position.getPreviousLocation().getZ()) ? position.getLocation().clone().setZ(position.getPreviousLocation().getZ())
: position.getLocation().clone().setX(position.getPreviousLocation().getX()); : position.getLocation().clone().setX(position.getPreviousLocation().getX());
if(!position.getLocation().equals(updatePointXZ)) if(!position.getLocation().equals(updatePointXZ))
function.accept(new RoundedTNTPosition(updatePointXZ)); function.accept(updatePointXZ);
} }
} }
} }