From 2a1e4578d65b9293f7350a63e731db9541475b3c Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 5 Jan 2021 03:06:27 +0100 Subject: [PATCH 1/9] Fixing Detonator --- .../bausystem/world/AutoLoader_15.java | 7 ++ .../steamwar/bausystem/world/Detonator.java | 67 ++++++++++--------- 2 files changed, 43 insertions(+), 31 deletions(-) diff --git a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java index 89fc7fa..8353ce9 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -24,6 +24,7 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.block.data.BlockData; +import org.bukkit.block.data.Openable; import org.bukkit.block.data.Powerable; import org.bukkit.block.data.type.Switch; import org.bukkit.event.player.PlayerInteractEvent; @@ -52,6 +53,12 @@ class AutoLoader_15 { powerable.setPowered(active); block.setBlockData(powerable); + if(data instanceof Openable) { + Openable openable = (Openable) data; + openable.setOpen(active); + block.setBlockData(openable); + } + if (data instanceof Switch){ Switch swtch = (Switch) data; Block relative; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java index bdb62b6..0a27f53 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java @@ -20,13 +20,15 @@ package de.steamwar.bausystem.world; import de.steamwar.bausystem.BauSystem; -import de.steamwar.core.Core; +import de.steamwar.core.VersionedCallable; +import de.steamwar.core.VersionedRunnable; import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerQuitEvent; @@ -39,7 +41,7 @@ import java.util.stream.Collectors; public class Detonator implements Listener { public static final ItemStack WAND; - private static final Map players = new HashMap<>(); + private static final Map PLAYERS = new HashMap<>(); private final Set locs = new HashSet<>(); private final Player player; @@ -59,49 +61,49 @@ public class Detonator implements Listener { } public static Detonator getDetonator(Player player){ - if(!players.containsKey(player)) + if(!PLAYERS.containsKey(player)) return new Detonator(player); - return players.get(player); + return PLAYERS.get(player); } public Detonator(Player player) { this.player = player; Bukkit.getPluginManager().registerEvents(this, BauSystem.getPlugin()); - players.put(player, this); + PLAYERS.put(player, this); } public static void deleteDetonator(Player player) { - if(players.containsKey(player)) - players.remove(player); + HandlerList.unregisterAll(PLAYERS.remove(player)); } public void execute() { for (Detoloader.DetonatorActivation activation: getLocations()) { - Boolean powered; - if(activation.activation == -1) switch (Core.getVersion()) { - case 15: + if(activation.activation == -1) { + VersionedRunnable.call(new VersionedRunnable(() -> { + boolean powered = AutoLoader_12.getLever(activation.location.getBlock()); + AutoLoader_12.setRedstone(activation.location, !powered); + + }, 12), new VersionedRunnable(() -> { + boolean powered; try { powered = AutoLoader_15.getLever(activation.location.getBlock()); - }catch (ClassCastException e) { + } catch (ClassCastException e) { locs.remove(activation); return; } AutoLoader_15.setRedstone(activation.location, !powered); - break; - default: - powered = AutoLoader_12.getLever(activation.location.getBlock()); - AutoLoader_12.setRedstone(activation.location, !powered); - }else switch (Core.getVersion()) { - case 15: - AutoLoader_15.setRedstone(activation.location, true); - Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> - AutoLoader_15.setRedstone(activation.location, false), activation.activation); - break; - default: + }, 15)); + } else { + VersionedRunnable.call(new VersionedRunnable(() -> { AutoLoader_12.setRedstone(activation.location, true); Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> AutoLoader_12.setRedstone(activation.location, false), activation.activation); + }, 12), new VersionedRunnable(() -> { + AutoLoader_15.setRedstone(activation.location, true); + Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> + AutoLoader_15.setRedstone(activation.location, false), activation.activation); + }, 15)); } } player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("§a" + locs.size() + " Punkt" + (locs.size() > 1 ? "e" : "") + " ausgelöst!")); @@ -116,16 +118,19 @@ public class Detonator implements Listener { event.setCancelled(true); switch (event.getAction()) { case LEFT_CLICK_BLOCK: - Detoloader detoloader; - switch(Core.getVersion()){ - case 15: - detoloader = AutoLoader_15.onPlayerInteractLoader(event); - break; - default: - detoloader = AutoLoader_12.onPlayerInteractLoader(event); + Detoloader detoloader = VersionedCallable.call( + new VersionedCallable<>(() -> + AutoLoader_12.onPlayerInteractLoader(event), 12), + new VersionedCallable<>(() -> + AutoLoader_15.onPlayerInteractLoader(event), 15)); + if(detoloader == null) { + return; + } else if (detoloader.activation == -1) { + print(detoloader.getBlock(), detoloader.addBack); + return; } - if(detoloader == null || detoloader.activation == -1) return; + if(event.getPlayer().isSneaking()) { if(locs.stream().filter(detonatorActivation -> detonatorActivation.location.equals(event.getClickedBlock().getLocation())).collect(Collectors.toList()).size() == 1) { @@ -151,7 +156,7 @@ public class Detonator implements Listener { print(detoloader.addBack ? "§e" + detoloader.getBlock() + " getsetzt" : detoloader.getBlock(), detoloader.addBack); } - break; + break; case RIGHT_CLICK_AIR: case RIGHT_CLICK_BLOCK: execute(); From b1672be384905cd6e35cfebe99ea703f18e0f4da Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 5 Jan 2021 13:13:05 +0100 Subject: [PATCH 2/9] Fixing some Things --- .../bausystem/world/AutoLoader_15.java | 15 +++++++-------- .../steamwar/bausystem/world/Detonator.java | 19 ++++++++----------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java index 8353ce9..a69a11f 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/AutoLoader_15.java @@ -49,6 +49,7 @@ class AutoLoader_15 { if (!(data instanceof Powerable)) return false; + Powerable powerable = (Powerable) data; powerable.setPowered(active); block.setBlockData(powerable); @@ -59,7 +60,7 @@ class AutoLoader_15 { block.setBlockData(openable); } - if (data instanceof Switch){ + if (data instanceof Switch) { Switch swtch = (Switch) data; Block relative; switch(swtch.getFace()){ @@ -74,7 +75,7 @@ class AutoLoader_15 { break; } updateBlock(relative); - }else if(block.getType() == Material.TRIPWIRE) { + } else if(block.getType() == Material.TRIPWIRE) { updateBlock(block); } return true; @@ -97,11 +98,7 @@ class AutoLoader_15 { Material material = block.getType(); if (material == Material.LEVER) { - if (powerable.isPowered()) { - return new Detoloader("Hebel", 0).setActive(false); - } else { - return new Detoloader("Hebel", 0).setActive(true); - } + return new Detoloader("Hebel", 0).setActive(!powerable.isPowered()); } else if (material == Material.STONE_BUTTON) { return new Detoloader("Knopf", Detoloader.STONE_BUTTON); } else if (material.name().contains("PRESSURE_PLATE")){ @@ -118,6 +115,8 @@ class AutoLoader_15 { } static boolean getLever(Block block) { - return ((Powerable)block.getBlockData()).isPowered(); + if(!(block.getBlockData() instanceof Powerable)) + return false; + return ((Powerable) block.getBlockData()).isPowered(); } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java index 0a27f53..e557d30 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java @@ -41,7 +41,7 @@ import java.util.stream.Collectors; public class Detonator implements Listener { public static final ItemStack WAND; - private static final Map PLAYERS = new HashMap<>(); + private static final Map players = new HashMap<>(); private final Set locs = new HashSet<>(); private final Player player; @@ -61,19 +61,20 @@ public class Detonator implements Listener { } public static Detonator getDetonator(Player player){ - if(!PLAYERS.containsKey(player)) + if(!players.containsKey(player)) return new Detonator(player); - return PLAYERS.get(player); + return players.get(player); } public Detonator(Player player) { this.player = player; Bukkit.getPluginManager().registerEvents(this, BauSystem.getPlugin()); - PLAYERS.put(player, this); + players.put(player, this); } public static void deleteDetonator(Player player) { - HandlerList.unregisterAll(PLAYERS.remove(player)); + if(players.containsKey(player)) + HandlerList.unregisterAll(players.remove(player)); } public void execute() { @@ -86,12 +87,7 @@ public class Detonator implements Listener { }, 12), new VersionedRunnable(() -> { boolean powered; - try { - powered = AutoLoader_15.getLever(activation.location.getBlock()); - } catch (ClassCastException e) { - locs.remove(activation); - return; - } + powered = AutoLoader_15.getLever(activation.location.getBlock()); AutoLoader_15.setRedstone(activation.location, !powered); }, 15)); } else { @@ -113,6 +109,7 @@ public class Detonator implements Listener { public void onPlayerInteract(PlayerInteractEvent event) { if(!event.getPlayer().equals(player)) return; + if (event.getItem() == null) return; if (event.getItem().isSimilar(WAND)) { event.setCancelled(true); From 9fd1efb61012c488548a93443f595f1e71cfbef1 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 5 Jan 2021 13:15:37 +0100 Subject: [PATCH 3/9] Fixing some more Things --- BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java index e557d30..34f39a4 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java @@ -86,8 +86,7 @@ public class Detonator implements Listener { AutoLoader_12.setRedstone(activation.location, !powered); }, 12), new VersionedRunnable(() -> { - boolean powered; - powered = AutoLoader_15.getLever(activation.location.getBlock()); + boolean powered = AutoLoader_15.getLever(activation.location.getBlock()); AutoLoader_15.setRedstone(activation.location, !powered); }, 15)); } else { From 09ba3a091b343fe358c56e6260a99359c68763a5 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 5 Jan 2021 13:31:07 +0100 Subject: [PATCH 4/9] Fixing even more Things --- .../steamwar/bausystem/commands/CommandDetonator.java | 11 ++++++++--- .../src/de/steamwar/bausystem/world/Detonator.java | 7 ++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java index bd8317e..be118ac 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java @@ -33,7 +33,8 @@ public class CommandDetonator implements CommandExecutor { private void help(Player player) { player.sendMessage("§8/§edetonator wand §8- §7Legt den Fernzünder ins Inventar"); player.sendMessage("§8/§edetonator detonate §8- §7Benutzt den Fernzünder"); - player.sendMessage("§8/§edetonator reset §8- §7Löscht alle markierten Positionen"); + player.sendMessage("§8/§edetonator reset §8- §7Lösche alle markierten Positionen"); + player.sendMessage("§8/§edetonator remove §8- §7Entferne den Fernzünder"); } private boolean permissionCheck(Player player) { @@ -65,16 +66,20 @@ public class CommandDetonator implements CommandExecutor { player.updateInventory(); Detonator.getDetonator(player); break; - case "delete": - case "reset": case "remove": Detonator.deleteDetonator(player); + player.getInventory().removeItem(Detonator.WAND); break; case "detonate": case "click": case "use": Detonator.getDetonator(player).execute(); break; + case "clear": + case "delete": + case "reset": + Detonator.getDetonator(player).clearLocs(); + break; default: help(player); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java index 34f39a4..edc0409 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java @@ -163,7 +163,8 @@ public class Detonator implements Listener { @EventHandler public void onPlayerQuit(PlayerQuitEvent event) { - deleteDetonator(event.getPlayer()); + if(event.getPlayer().equals(player)) + deleteDetonator(player); } Set getLocations() { @@ -174,6 +175,10 @@ public class Detonator implements Listener { return player; } + public void clearLocs() { + locs.clear(); + } + void print(String message, boolean withSize){ if(withSize) getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message + " §8" + getLocations().size())); From b69c7dda16c1660da77cd0358461aaf1e582ebf7 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 5 Jan 2021 13:31:40 +0100 Subject: [PATCH 5/9] Fixing even even more Things --- .../bausystem/commands/CommandDetonatorTabCompleter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonatorTabCompleter.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonatorTabCompleter.java index 32d98ec..4a20f89 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonatorTabCompleter.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonatorTabCompleter.java @@ -40,6 +40,7 @@ public class CommandDetonatorTabCompleter implements TabCompleter { tabComplete.add("wand"); tabComplete.add("reset"); tabComplete.add("detonate"); + tabComplete.add("remove"); if (args.length >= 2) { return new ArrayList<>(); From 94cb735bd42252163df507b09f75a61c7d6db358 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 5 Jan 2021 17:18:58 +0100 Subject: [PATCH 6/9] Changes --- .../src/de/steamwar/bausystem/commands/CommandDetonator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java index be118ac..52bc21e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java @@ -33,8 +33,8 @@ public class CommandDetonator implements CommandExecutor { private void help(Player player) { player.sendMessage("§8/§edetonator wand §8- §7Legt den Fernzünder ins Inventar"); player.sendMessage("§8/§edetonator detonate §8- §7Benutzt den Fernzünder"); - player.sendMessage("§8/§edetonator reset §8- §7Lösche alle markierten Positionen"); - player.sendMessage("§8/§edetonator remove §8- §7Entferne den Fernzünder"); + player.sendMessage("§8/§edetonator reset §8- §7Löscht alle markierten Positionen"); + player.sendMessage("§8/§edetonator remove §8- §7Entfernt den Fernzünder"); } private boolean permissionCheck(Player player) { From 9150a3a4c76254b8e682909561e7eaf66b2661cb Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 5 Jan 2021 17:36:57 +0100 Subject: [PATCH 7/9] Changes --- .../steamwar/bausystem/world/Detonator.java | 50 +++++++++---------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java index edc0409..707d70c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java @@ -60,8 +60,8 @@ public class Detonator implements Listener { WAND.setItemMeta(im); } - public static Detonator getDetonator(Player player){ - if(!players.containsKey(player)) + public static Detonator getDetonator(Player player) { + if (!players.containsKey(player)) return new Detonator(player); return players.get(player); } @@ -73,14 +73,14 @@ public class Detonator implements Listener { } public static void deleteDetonator(Player player) { - if(players.containsKey(player)) + if (players.containsKey(player)) HandlerList.unregisterAll(players.remove(player)); } public void execute() { - for (Detoloader.DetonatorActivation activation: getLocations()) { + for (Detoloader.DetonatorActivation activation : getLocations()) { - if(activation.activation == -1) { + if (activation.activation == -1) { VersionedRunnable.call(new VersionedRunnable(() -> { boolean powered = AutoLoader_12.getLever(activation.location.getBlock()); AutoLoader_12.setRedstone(activation.location, !powered); @@ -92,12 +92,10 @@ public class Detonator implements Listener { } else { VersionedRunnable.call(new VersionedRunnable(() -> { AutoLoader_12.setRedstone(activation.location, true); - Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> - AutoLoader_12.setRedstone(activation.location, false), activation.activation); + Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> AutoLoader_12.setRedstone(activation.location, false), activation.activation); }, 12), new VersionedRunnable(() -> { AutoLoader_15.setRedstone(activation.location, true); - Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> - AutoLoader_15.setRedstone(activation.location, false), activation.activation); + Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> AutoLoader_15.setRedstone(activation.location, false), activation.activation); }, 15)); } } @@ -106,7 +104,7 @@ public class Detonator implements Listener { @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { - if(!event.getPlayer().equals(player)) + if (!event.getPlayer().equals(player)) return; if (event.getItem() == null) return; @@ -115,38 +113,36 @@ public class Detonator implements Listener { switch (event.getAction()) { case LEFT_CLICK_BLOCK: Detoloader detoloader = VersionedCallable.call( - new VersionedCallable<>(() -> - AutoLoader_12.onPlayerInteractLoader(event), 12), - new VersionedCallable<>(() -> - AutoLoader_15.onPlayerInteractLoader(event), 15)); + new VersionedCallable<>(() -> AutoLoader_12.onPlayerInteractLoader(event), 12), + new VersionedCallable<>(() -> AutoLoader_15.onPlayerInteractLoader(event), 15)); - if(detoloader == null) { + if (detoloader == null) { return; - } else if (detoloader.activation == -1) { + } else if (detoloader.activation == -1) { print(detoloader.getBlock(), detoloader.addBack); return; } - if(event.getPlayer().isSneaking()) { - if(locs.stream().filter(detonatorActivation -> detonatorActivation.location.equals(event.getClickedBlock().getLocation())).collect(Collectors.toList()).size() == 1) { + if (event.getPlayer().isSneaking()) { + if (locs.stream().filter(detonatorActivation -> detonatorActivation.location.equals(event.getClickedBlock().getLocation())).collect(Collectors.toList()).size() == 1) { locs.removeIf(detonatorActivation -> detonatorActivation.location.equals(event.getClickedBlock().getLocation())); print(detoloader.addBack ? "§e" + detoloader.getBlock() + " entfernt" : detoloader.getBlock(), detoloader.addBack); - }else { - if(detoloader.getActivation() == 0) { + } else { + if (detoloader.getActivation() == 0) { locs.add(new Detoloader.DetonatorActivation(event.getClickedBlock().getLocation())); - }else { + } else { locs.add(new Detoloader.DetonatorActivation(detoloader.getActivation(), event.getClickedBlock().getLocation())); } print(detoloader.addBack ? "§e" + detoloader.getBlock() + " hinzugefügt" : detoloader.getBlock(), detoloader.addBack); } - }else { + } else { locs.clear(); - if(detoloader.getActivation() == 0) { + if (detoloader.getActivation() == 0) { locs.add(new Detoloader.DetonatorActivation(event.getClickedBlock().getLocation())); - }else { + } else { locs.add(new Detoloader.DetonatorActivation(detoloader.getActivation(), event.getClickedBlock().getLocation())); } print(detoloader.addBack ? "§e" + detoloader.getBlock() + " getsetzt" : @@ -163,7 +159,7 @@ public class Detonator implements Listener { @EventHandler public void onPlayerQuit(PlayerQuitEvent event) { - if(event.getPlayer().equals(player)) + if (event.getPlayer().equals(player)) deleteDetonator(player); } @@ -179,8 +175,8 @@ public class Detonator implements Listener { locs.clear(); } - void print(String message, boolean withSize){ - if(withSize) + void print(String message, boolean withSize) { + if (withSize) getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message + " §8" + getLocations().size())); else getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message)); From d20cda08ce2c443fe2276ed47d78a00df7d60fc6 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 5 Jan 2021 17:46:00 +0100 Subject: [PATCH 8/9] Changes --- BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java | 1 - 1 file changed, 1 deletion(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java index 707d70c..703e939 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java @@ -84,7 +84,6 @@ public class Detonator implements Listener { VersionedRunnable.call(new VersionedRunnable(() -> { boolean powered = AutoLoader_12.getLever(activation.location.getBlock()); AutoLoader_12.setRedstone(activation.location, !powered); - }, 12), new VersionedRunnable(() -> { boolean powered = AutoLoader_15.getLever(activation.location.getBlock()); AutoLoader_15.setRedstone(activation.location, !powered); From fb7b9ae39372f1d9889060a93e7e896a874cbb43 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 9 Jan 2021 20:53:26 +0100 Subject: [PATCH 9/9] Error 404 Changeset Unknown --- .../src/de/steamwar/bausystem/world/Detonator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java index 703e939..6a7e214 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java @@ -175,9 +175,10 @@ public class Detonator implements Listener { } void print(String message, boolean withSize) { - if (withSize) + if (withSize) { getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message + " §8" + getLocations().size())); - else + }else { getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message)); + } } }