SteamWar/BauSystem
Archiviert
13
0

Tracer-entity #147

Manuell gemergt
YoyoNow hat 47 Commits von Tracer-entity nach master 2020-12-27 22:16:04 +01:00 zusammengeführt
2 geänderte Dateien mit 8 neuen und 27 gelöschten Zeilen
Nur Änderungen aus Commit f8d69deaa3 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -23,6 +23,7 @@ package de.steamwar.bausystem.tracer.show.mode;
import de.steamwar.bausystem.tracer.*; import de.steamwar.bausystem.tracer.*;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import de.steamwar.core.VersionedCallable;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
@ -60,30 +61,16 @@ public class Advanced extends Basic {
if (updateEntityMap.containsKey(updatePointPosition)) { if (updateEntityMap.containsKey(updatePointPosition)) {
return; return;
} }
updateEntityMap.put(updatePointPosition, VersionedCallable.call(new VersionedCallable<>(() -> TNTTracer_12.createUpdatePoint(player.getWorld(), updatePointY, player), 8),
switch (Core.getVersion()) { new VersionedCallable<>(() -> TNTTracer_15.createUpdatePoint(player.getWorld(), updatePointY, player), 14)));
case 12:
updateEntityMap.put(updatePointPosition, TNTTracer_12.createUpdatePoint(player.getWorld(), new TNTPosition(updatePointY).getLocation(), player));
break;
default:
updateEntityMap.put(updatePointPosition, TNTTracer_15.createUpdatePoint(player.getWorld(), new TNTPosition(updatePointY).getLocation(), player));
break;
}
} }
if (!position.getLocation().equals(updatePointXZ)) { if (!position.getLocation().equals(updatePointXZ)) {
RoundedTNTPosition updatePointPosition = new RoundedTNTPosition(updatePointXZ); RoundedTNTPosition updatePointPosition = new RoundedTNTPosition(updatePointXZ);
if (updateEntityMap.containsKey(updatePointPosition)) { if (updateEntityMap.containsKey(updatePointPosition)) {
return; return;
} }
updateEntityMap.put(updatePointPosition, VersionedCallable.call(new VersionedCallable<>(() -> TNTTracer_12.createUpdatePoint(player.getWorld(), updatePointXZ, player), 8),
switch (Core.getVersion()) { new VersionedCallable<>(() -> TNTTracer_15.createUpdatePoint(player.getWorld(), updatePointXZ, player), 14)));
case 12:
updateEntityMap.put(updatePointPosition, TNTTracer_12.createUpdatePoint(player.getWorld(), new TNTPosition(updatePointXZ).getLocation(), player));
break;
default:
updateEntityMap.put(updatePointPosition, TNTTracer_15.createUpdatePoint(player.getWorld(), new TNTPosition(updatePointXZ).getLocation(), player));
break;
}
} }
} }

Datei anzeigen

@ -3,6 +3,7 @@ package de.steamwar.bausystem.tracer.show.mode;
import de.steamwar.bausystem.tracer.*; import de.steamwar.bausystem.tracer.*;
import de.steamwar.bausystem.tracer.show.ShowMode; import de.steamwar.bausystem.tracer.show.ShowMode;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import de.steamwar.core.VersionedCallable;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.HashMap; import java.util.HashMap;
@ -24,15 +25,8 @@ public class Basic implements ShowMode {
if (tntEntityMap.containsKey(roundedTNTPosition)) { if (tntEntityMap.containsKey(roundedTNTPosition)) {
return; return;
} }
tntEntityMap.put(roundedTNTPosition, VersionedCallable.call(new VersionedCallable<>(() -> TNTTracer_12.createTNT(player.getWorld(), position.getLocation(), player, position.isExploded()), 8),
switch (Core.getVersion()) { new VersionedCallable<>(() -> TNTTracer_15.createTNT(player.getWorld(), position.getLocation(), player, position.isExploded()), 14)));
case 12:
tntEntityMap.put(roundedTNTPosition, TNTTracer_12.createTNT(player.getWorld(), position.getLocation(), player, position.isExploded()));
break;
default:
tntEntityMap.put(roundedTNTPosition, TNTTracer_15.createTNT(player.getWorld(), position.getLocation(), player, position.isExploded()));
break;
}
} }
@Override @Override