From 83c942764cc068400b527b85b3c5e54d8bba4300 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 13 Sep 2020 19:57:48 +0200 Subject: [PATCH] Fixed Autloader --- .../src/de/steamwar/bausystem/world/AutoLoader.java | 2 +- BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/AutoLoader.java b/BauSystem_Main/src/de/steamwar/bausystem/world/AutoLoader.java index 4ffb48a..6af24d7 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/AutoLoader.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/AutoLoader.java @@ -171,7 +171,7 @@ public class AutoLoader extends IAutoLoader implements Listener { detoloader = AutoLoader_12.onPlayerInteractLoader(event); } - if(detoloader == null) return; + if(detoloader == null || detoloader.getActivation() < 0) return; if(detoloader.useActive) new IAutoLoader.RedstoneActivation(this, event.getClickedBlock().getLocation() , detoloader.getActivation() == 0 ? getLastActivation() : detoloader.getActivation() diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java index 1ce5df1..8c54abe 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java @@ -76,7 +76,6 @@ public class Detonator implements Listener { } public void execute() { - player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("§a" + locs.size() + " Punkt(e) ausgelöst!")); for (Detoloader.DetonatorActivation activation: getLocations()) { Boolean powered; @@ -100,6 +99,7 @@ public class Detonator implements Listener { AutoLoader_12.setRedstone(activation.location, false), activation.activation); } } + player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("§a" + locs.size() + " Punkt" + (locs.size() > 1 ? "e" : "") + " ausgelöst!")); } @EventHandler @@ -157,7 +157,7 @@ public class Detonator implements Listener { } } - @EventHandler(ignoreCancelled = true) + @EventHandler public void onPlayerQuit(PlayerQuitEvent event) { deleteDetonator(event.getPlayer()); }