SteamWar/BauSystem2.0
Archiviert
12
0

Fix EventListener for TNT explosions in Build Region
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2023-09-15 17:32:09 +02:00
Ursprung 1da569c41b
Commit 9e9c653aba

Datei anzeigen

@ -159,9 +159,14 @@ public class EventListener implements Listener {
table.set("y", event.getLocation().getY());
table.set("z", event.getLocation().getZ());
boolean inBuild = event.blockList().stream().anyMatch(block -> tntRegion.inRegion(block.getLocation(), RegionType.BUILD, RegionExtensionType.EXTENSION));
for (Player player : Bukkit.getOnlinePlayers()) {
if (tntRegion.inRegion(player.getLocation(), RegionType.NORMAL, RegionExtensionType.NORMAL)) {
ScriptRunner.callEvent(player, SteamWarGlobalLuaPlugin.EventType.TNTExplode, table, event);
if (inBuild) {
ScriptRunner.callEvent(player, SteamWarGlobalLuaPlugin.EventType.TNTExplodeInBuild, table, event);
}
}
}
}