diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTListener.java index 81a10992..b52dff50 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTListener.java @@ -19,7 +19,7 @@ package de.steamwar.bausystem.features.region; -import de.steamwar.bausystem.features.script.CustomScriptListener; +import de.steamwar.bausystem.features.script.CustomScriptManager; import de.steamwar.bausystem.features.script.EventType; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; @@ -42,7 +42,7 @@ import java.util.concurrent.atomic.AtomicBoolean; public class TNTListener implements Listener { @LinkedInstance - private CustomScriptListener customScriptListener; + private CustomScriptManager customScriptManager; @EventHandler public void onExplode(EntityExplodeEvent event) { @@ -69,7 +69,7 @@ public class TNTListener implements Listener { Region region = Region.getRegion(event.getLocation()); for (Player player : Bukkit.getOnlinePlayers()) { if (region.inRegion(player.getLocation(), RegionType.NORMAL, RegionExtensionType.NORMAL)) { - customScriptListener.callEvent(EventType.TNTExplodeInBuild, player, event); + customScriptManager.callEvent(EventType.TNTExplodeInBuild, player, event); } } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScriptListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScriptManager.java similarity index 99% rename from BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScriptListener.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScriptManager.java index 85757005..13300337 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScriptListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScriptManager.java @@ -52,7 +52,7 @@ import java.util.*; import java.util.stream.Collectors; @Linked(LinkageType.LISTENER) -public class CustomScriptListener implements Listener { +public class CustomScriptManager implements Listener { private final Map> playerMap = Collections.synchronizedMap(new HashMap<>()); // new ConcurrentHashMap<>(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptCommand.java index 061a0414..581b07e0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptCommand.java @@ -25,7 +25,7 @@ public class ScriptCommand extends SWCommand { } @LinkedInstance - private CustomScriptListener customScriptListener = null; + private CustomScriptManager customScriptManager = null; private static List> swItems = new ArrayList<>(); @@ -152,6 +152,6 @@ public class ScriptCommand extends SWCommand { @Register(value = "menu", description = "SCRIPT_COMMAND_HELP_MENU") public void menuGUICommand(Player p) { - customScriptListener.openCommandsMenu(p); + customScriptManager.openCommandsMenu(p); } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptEventListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptEventListener.java index 946f6474..fc7ebde8 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptEventListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptEventListener.java @@ -48,7 +48,7 @@ import java.util.Set; public class ScriptEventListener implements Listener { @LinkedInstance - private CustomScriptListener customScriptListener; + private CustomScriptManager customScriptManager; private static final Set LAST_FS = new HashSet<>(); @@ -58,18 +58,18 @@ public class ScriptEventListener implements Listener { @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { - customScriptListener.callEvent(EventType.SelfJoin, event.getPlayer(), event); + customScriptManager.callEvent(EventType.SelfJoin, event.getPlayer(), event); } @EventHandler public void onPlayerQuit(PlayerQuitEvent event) { - customScriptListener.callEvent(EventType.SelfLeave, event.getPlayer(), event); + customScriptManager.callEvent(EventType.SelfLeave, event.getPlayer(), event); } @EventHandler public void onPlayerSwapHandItems(PlayerSwapHandItemsEvent event) { if (LAST_FS.contains(event.getPlayer())) { - customScriptListener.callEvent(EventType.FF, event.getPlayer(), event); + customScriptManager.callEvent(EventType.FF, event.getPlayer(), event); } else { LAST_FS.add(event.getPlayer()); } @@ -77,21 +77,21 @@ public class ScriptEventListener implements Listener { @EventHandler public void onBlockPlace(BlockPlaceEvent event) { - customScriptListener.callEvent(EventType.PlaceBlock, event.getPlayer(), event); + customScriptManager.callEvent(EventType.PlaceBlock, event.getPlayer(), event); } @EventHandler public void onBlockBreak(BlockBreakEvent event) { - customScriptListener.callEvent(EventType.BreakBlock, event.getPlayer(), event); + customScriptManager.callEvent(EventType.BreakBlock, event.getPlayer(), event); } @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) { - customScriptListener.callEvent(EventType.RightClick, event.getPlayer(), event); + customScriptManager.callEvent(EventType.RightClick, event.getPlayer(), event); } if (event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK) { - customScriptListener.callEvent(EventType.LeftClick, event.getPlayer(), event); + customScriptManager.callEvent(EventType.LeftClick, event.getPlayer(), event); } } @@ -104,7 +104,7 @@ public class ScriptEventListener implements Listener { for (Player player : Bukkit.getOnlinePlayers()) { if (tntRegion.inRegion(player.getLocation(), RegionType.NORMAL, RegionExtensionType.NORMAL)) { - customScriptListener.callEvent(EventType.TNTSpawn, player, event); + customScriptManager.callEvent(EventType.TNTSpawn, player, event); } } } @@ -118,7 +118,7 @@ public class ScriptEventListener implements Listener { for (Player player : Bukkit.getOnlinePlayers()) { if (tntRegion.inRegion(player.getLocation(), RegionType.NORMAL, RegionExtensionType.NORMAL)) { - customScriptListener.callEvent(EventType.TNTExplode, player, event); + customScriptManager.callEvent(EventType.TNTExplode, player, event); } } }