SteamWar/BauSystem2.0
Archiviert
12
0

Update Record
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2023-09-02 13:10:57 +02:00
Ursprung 0b8a34bbe5
Commit d5d25e9fb0
2 geänderte Dateien mit 10 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -36,10 +36,10 @@ public class TNTPosition extends Position {
private final boolean source; private final boolean source;
private final boolean exploded; private final boolean exploded;
public TNTPosition(Record.TNTRecord record, TNTPrimed entity, Vector previousLocation, Vector velocity, Vector updateVelocity, boolean source, boolean exploded) { public TNTPosition(Record.TNTRecord record, Vector position, int fuseTicks, Vector previousLocation, Vector velocity, Vector updateVelocity, boolean source, boolean exploded) {
super(entity.getLocation().toVector()); super(position);
this.record = record; this.record = record;
this.fuseTicks = entity.getFuseTicks(); this.fuseTicks = fuseTicks;
this.previousLocation = previousLocation; this.previousLocation = previousLocation;
this.velocity = velocity; this.velocity = velocity;
this.updateVelocity = updateVelocity; this.updateVelocity = updateVelocity;

Datei anzeigen

@ -103,26 +103,26 @@ public class Record {
} }
public void source(TNTPrimed tntPrimed) { public void source(TNTPrimed tntPrimed) {
add(tntPrimed, true, false); add(tntPrimed.getLocation().toVector(), tntPrimed.getVelocity(), tntPrimed.getFuseTicks(), true, false);
} }
public void location(TNTPrimed tntPrimed) { public void location(TNTPrimed tntPrimed) {
add(tntPrimed, false, false); add(tntPrimed.getLocation().toVector(), tntPrimed.getVelocity(), tntPrimed.getFuseTicks(), false, false);
} }
public void explode(TNTPrimed tntPrimed) { public void explode(TNTPrimed tntPrimed) {
add(tntPrimed, false, true); add(tntPrimed.getLocation().toVector(), tntPrimed.getVelocity(), tntPrimed.getFuseTicks(), false, true);
record.checkMicroMotion(); record.checkMicroMotion();
} }
private void add(TNTPrimed tntPrimed, boolean source, boolean exploded) { private void add(Vector location, Vector velocity, int fuseTicks, boolean source, boolean exploded) {
TNTPosition position; TNTPosition position;
if (positions.isEmpty()) { if (positions.isEmpty()) {
position = new TNTPosition(this, tntPrimed, null, tntPrimed.getVelocity(), null, source, exploded); position = new TNTPosition(this, location, fuseTicks, null, velocity, null, source, exploded);
} else { } else {
TNTPosition tntPosition = positions.get(positions.size() - 1); TNTPosition tntPosition = positions.get(positions.size() - 1);
Vector lastVelocity = tntPrimed.getLocation().toVector().clone().subtract(tntPosition.getLocation()); Vector lastVelocity = location.clone().subtract(tntPosition.getLocation());
position = new TNTPosition(this, tntPrimed, positions.get(positions.size() - 1).getLocation(), tntPrimed.getVelocity(), lastVelocity, source, exploded); position = new TNTPosition(this, location, fuseTicks, positions.get(positions.size() - 1).getLocation(), velocity, lastVelocity, source, exploded);
} }
positions.add(position); positions.add(position);
TraceShowManager.show(region, position); TraceShowManager.show(region, position);