SteamWar/BauSystem2.0
Archiviert
12
0

Fix NPE of KillcheckerVisualizer.hide
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2023-03-15 20:59:34 +01:00
Ursprung b902fffb76
Commit ca730f7b8f
2 geänderte Dateien mit 15 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -78,7 +78,7 @@ public class KillcheckerCommand extends SWCommand implements Listener {
Player player = event.getPlayer();
Set<Region> regions = new HashSet<>();
visualizers.forEach((region, visualizer) -> {
if (visualizer.hide(player)) {
if (visualizer.disconnect(player)) {
regions.add(region);
}
});

Datei anzeigen

@ -97,6 +97,7 @@ public class KillcheckerVisualizer {
if (block.getType().isAir()) continue;
String name = block.getType().name();
if (!name.endsWith("_WOOL") && !name.endsWith("_STAINED_GLASS") && !name.endsWith("_CONCRETE") && !name.endsWith("_TERRACOTTA")) continue;
if (name.equals("_GLAZED_TERRACOTTA")) continue;
Cuboid cuboid = create(block.getType(), x, y, z);
cuboids.add(cuboid);
for (int dx = (int) cuboid.getX(); dx <= cuboid.getDx(); dx++) {
@ -378,6 +379,19 @@ public class KillcheckerVisualizer {
bossBarService.remove(player, region, "killchecker");
if (players.isEmpty()) {
outline.close();
inner.close();
return true;
}
return false;
}
public boolean disconnect(Player player) {
players.remove(player);
areaPlayers.remove(player);
bossBarService.remove(player, region, "killchecker");
if (players.isEmpty()) {
outline.close();
inner.close();
return true;
}
return false;