SteamWar/BauSystem
Archiviert
13
0

Fix Advanced Tracer

Dieser Commit ist enthalten in:
jojo 2020-12-25 21:58:55 +01:00
Ursprung 62d223b470
Commit dee5d9598d
3 geänderte Dateien mit 6 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -24,10 +24,6 @@ import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.tracer.record.RecordStateMachine; import de.steamwar.bausystem.tracer.record.RecordStateMachine;
import de.steamwar.bausystem.tracer.show.StoredRecords; import de.steamwar.bausystem.tracer.show.StoredRecords;
import de.steamwar.bausystem.tracer.show.TraceShowManager; import de.steamwar.bausystem.tracer.show.TraceShowManager;
import de.steamwar.bausystem.tracer.show.mode.Advanced;
import de.steamwar.bausystem.tracer.show.mode.AdvancedNoWater;
import de.steamwar.bausystem.tracer.show.mode.Basic;
import de.steamwar.bausystem.tracer.show.mode.BasicNoWater;
import de.steamwar.bausystem.world.Welt; import de.steamwar.bausystem.world.Welt;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;

Datei anzeigen

@ -49,7 +49,7 @@ public class CommandTraceTabCompleter implements TabCompleter {
tabComplete.add("auto"); tabComplete.add("auto");
tabComplete.add("show"); tabComplete.add("show");
if (args[0].equalsIgnoreCase("show") && args.length == 2) { if (args[0].equalsIgnoreCase("show") && args.length == 2) {
return manageList(new ArrayList<>(Arrays.asList("nowater", "basic", "default", "advanced", "advanced-nowater")), args, 1); return manageList(new ArrayList<>(Arrays.asList("nowater", "basic", "advanced", "advanced-nowater")), args, 1);
} }
tabComplete.add("hide"); tabComplete.add("hide");
tabComplete.add("delete"); tabComplete.add("delete");

Datei anzeigen

@ -44,15 +44,16 @@ public class Advanced extends Basic {
public void show(TNTPosition position) { public void show(TNTPosition position) {
super.show(position); super.show(position);
if (position.isExploded()) return;
if (position.getVelocity() == null) return; if (position.getVelocity() == null) return;
Vector previousLocation = position.getLocation().clone().subtract(position.getVelocity()); Vector nextLocation = position.getLocation().clone().add(position.getVelocity());
Vector updatePointY = previousLocation.clone().setY(position.getLocation().getY()); Vector updatePointY = position.getLocation().clone().setY(nextLocation.getY());
Vector updatePointXZ; Vector updatePointXZ;
if (Math.abs(position.getVelocity().getX()) > Math.abs(position.getVelocity().getZ())) { if (Math.abs(position.getVelocity().getX()) > Math.abs(position.getVelocity().getZ())) {
updatePointXZ = updatePointY.clone().setX(position.getLocation().getX()); updatePointXZ = updatePointY.clone().setX(nextLocation.getX());
} else { } else {
updatePointXZ = updatePointY.clone().setZ(position.getLocation().getZ()); updatePointXZ = updatePointY.clone().setZ(nextLocation.getZ());
} }
if (!position.getLocation().equals(updatePointY)) { if (!position.getLocation().equals(updatePointY)) {