SteamWar/BauSystem2.0
Archiviert
12
0

Fix some NPE's
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2023-02-25 14:29:26 +01:00
Ursprung 2dd5e16bda
Commit 1086808cf0
2 geänderte Dateien mit 14 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -88,12 +88,20 @@ public class TNTSimulator {
} }
public void show(Player player) { public void show(Player player) {
entityServer.addPlayer(player); if (!players.contains(player)) {
players.add(player); entityServer.addPlayer(player);
players.add(player);
}
} }
public void hide(Player player) { public void hide(Player player) {
entityServer.removePlayer(player); if (players.contains(player)) {
entityServer.removePlayer(player);
players.remove(player);
}
}
void _hide(Player player) {
players.remove(player); players.remove(player);
} }

Datei anzeigen

@ -88,6 +88,9 @@ public class TNTSimulatorListener implements Listener {
@EventHandler @EventHandler
public void onPlayerQuit(PlayerQuitEvent event) { public void onPlayerQuit(PlayerQuitEvent event) {
SimulatorCursor.hide(event.getPlayer(), null); SimulatorCursor.hide(event.getPlayer(), null);
SimulatorStorage.getSimulatorNames().forEach(s -> {
SimulatorStorage.getSimulator(s)._hide(event.getPlayer());
});
} }
@EventHandler @EventHandler