From d5d25e9fb09eb6995ff98703b4ae57d9c7838e4e Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 2 Sep 2023 13:10:57 +0200 Subject: [PATCH] Update Record Signed-off-by: yoyosource --- .../bausystem/features/tracer/TNTPosition.java | 6 +++--- .../bausystem/features/tracer/show/Record.java | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TNTPosition.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TNTPosition.java index be47e4bc..21a05357 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TNTPosition.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TNTPosition.java @@ -36,10 +36,10 @@ public class TNTPosition extends Position { private final boolean source; private final boolean exploded; - public TNTPosition(Record.TNTRecord record, TNTPrimed entity, Vector previousLocation, Vector velocity, Vector updateVelocity, boolean source, boolean exploded) { - super(entity.getLocation().toVector()); + public TNTPosition(Record.TNTRecord record, Vector position, int fuseTicks, Vector previousLocation, Vector velocity, Vector updateVelocity, boolean source, boolean exploded) { + super(position); this.record = record; - this.fuseTicks = entity.getFuseTicks(); + this.fuseTicks = fuseTicks; this.previousLocation = previousLocation; this.velocity = velocity; this.updateVelocity = updateVelocity; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/Record.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/Record.java index 8314b640..ca7f7156 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/Record.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/Record.java @@ -103,26 +103,26 @@ public class Record { } public void source(TNTPrimed tntPrimed) { - add(tntPrimed, true, false); + add(tntPrimed.getLocation().toVector(), tntPrimed.getVelocity(), tntPrimed.getFuseTicks(), true, false); } public void location(TNTPrimed tntPrimed) { - add(tntPrimed, false, false); + add(tntPrimed.getLocation().toVector(), tntPrimed.getVelocity(), tntPrimed.getFuseTicks(), false, false); } public void explode(TNTPrimed tntPrimed) { - add(tntPrimed, false, true); + add(tntPrimed.getLocation().toVector(), tntPrimed.getVelocity(), tntPrimed.getFuseTicks(), false, true); 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; 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 { TNTPosition tntPosition = positions.get(positions.size() - 1); - Vector lastVelocity = tntPrimed.getLocation().toVector().clone().subtract(tntPosition.getLocation()); - position = new TNTPosition(this, tntPrimed, positions.get(positions.size() - 1).getLocation(), tntPrimed.getVelocity(), lastVelocity, source, exploded); + Vector lastVelocity = location.clone().subtract(tntPosition.getLocation()); + position = new TNTPosition(this, location, fuseTicks, positions.get(positions.size() - 1).getLocation(), velocity, lastVelocity, source, exploded); } positions.add(position); TraceShowManager.show(region, position);