SteamWar/BauSystem2.0
Archiviert
12
0

Fix show and hide of TNTSimulator
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2023-09-09 16:32:03 +02:00
Ursprung 63e8b96ec9
Commit 85527f7004
3 geänderte Dateien mit 2 neuen und 19 gelöschten Zeilen

Datei anzeigen

@ -44,7 +44,7 @@ public class SimulatorCommand extends SWCommand {
@Register(description = "SIMULATOR_HELP") @Register(description = "SIMULATOR_HELP")
public void genericCommand(@Validator Player p) { public void genericCommand(@Validator Player p) {
SimulatorCursor.hide(p, null); SimulatorCursor.hide(p);
SWUtils.giveItemToPlayer(p, SimulatorStorage.getWand(p)); SWUtils.giveItemToPlayer(p, SimulatorStorage.getWand(p));
} }

Datei anzeigen

@ -48,9 +48,6 @@ public class SimulatorCursor {
if (cursor != null) if (cursor != null)
cursor.close(); cursor.close();
tntSimulator.show(player);
if (result == null) if (result == null)
return; return;
@ -84,21 +81,6 @@ public class SimulatorCursor {
if (cursor == null) return; if (cursor == null) return;
cursor.close(); cursor.close();
SimulatorStorage.getSimulatorNames().forEach(s -> {
SimulatorStorage.getSimulator(s).hide(player);
});
}
public void hide(Player player, TNTSimulator tntSimulator) {
REntityServer cursor = rEntityServerMap.get(player);
if (cursor != null)
cursor.close();
if (tntSimulator != null) {
tntSimulator.hide(player);
}
rEntityServerMap.remove(player);
} }
public static Vector getPos(Player player, RayTraceUtils.RRayTraceResult result) { public static Vector getPos(Player player, RayTraceUtils.RRayTraceResult result) {

Datei anzeigen

@ -94,6 +94,7 @@ public class TNTSimulatorListener implements Listener {
if (!tntSimulator.getKey().hasPreview(player)) return o; if (!tntSimulator.getKey().hasPreview(player)) return o;
if (!tntSimulator.getKey().getPreviewRecord().isAir(x.get(o), y.get(o), z.get(o))) return o; if (!tntSimulator.getKey().getPreviewRecord().isAir(x.get(o), y.get(o), z.get(o))) return o;
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> { Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
SimulatorCursor.hide(player);
PlayerMovementWrapper.impl.setPosition(player, o); PlayerMovementWrapper.impl.setPosition(player, o);
}, 0L); }, 0L);
return null; return null;