Combine PlaybackSolver.PosEntry with PosEntry

This commit is contained in:
Heliosares
2023-02-27 21:30:26 -05:00
parent df1b41bf75
commit 8207d2ecd8
3 changed files with 10 additions and 9 deletions

View File

@@ -395,7 +395,7 @@ public class LookupCommand extends Command {
List<PlaybackSolver.PosPoint> points = PlaybackSolver.getLocations(plugin, rs, 0);
List<DbEntry> newResults = new ArrayList<>();
for (PlaybackSolver.PosPoint point : points) {
newResults.add(new PlaybackSolver.PosEntry(point.time(), point.uid(), point.location()));
newResults.add(new PosEntry(point.time(), point.uid(), point.location()));
}
Collections.reverse(newResults);
rs = newResults;

View File

@@ -23,6 +23,15 @@ public class PosEntry extends DbEntry {
this.z = z + dInc[2];
}
public PosEntry(long time, int uid, Location location) {
super(time, uid, EntryAction.POS, false, Objects.requireNonNull(location.getWorld()).getName(),
(int) Math.round(location.getX()), (int) Math.round(location.getY()), (int) Math.round(location.getZ()),
Math.round(location.getPitch()), Math.round(location.getYaw()), "", -1, "");
this.x = location.getX();
this.y = location.getY();
this.z = location.getZ();
}
public double getDoubleX() {
return x;
}

View File

@@ -152,12 +152,4 @@ public class PlaybackSolver extends BukkitRunnable {
public record PosPoint(long time, UUID uuid, String name, int uid, Location location, boolean inc) {
}
public static class PosEntry extends DbEntry {
public PosEntry(long time, int uid, Location location) {
super(time, uid, EntryAction.POS, false, Objects.requireNonNull(location.getWorld()).getName(),
(int) Math.round(location.getX()), (int) Math.round(location.getY()), (int) Math.round(location.getZ()),
Math.round(location.getPitch()), Math.round(location.getYaw()), "", -1, "");
}
}
}