From b533e27b854328f7015c0832bf07b3cbb86d6f90 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 25 Mar 2021 07:54:43 +0100 Subject: [PATCH] Removing Debug Messages --- .../de/steamwar/bausystem/world/Detonator.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java index bc89942..fe445c3 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Detonator.java @@ -28,7 +28,6 @@ import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.NamespacedKey; -import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack; import org.bukkit.entity.Player; import org.bukkit.event.Listener; import org.bukkit.inventory.ItemStack; @@ -70,7 +69,6 @@ public class Detonator implements Listener { }, 12), new VersionedCallable<>(() -> { ItemMeta meta = item.getItemMeta(); PersistentDataContainer container = meta.getPersistentDataContainer(); - player.sendMessage(CraftItemStack.asNMSCopy(item).getTag().toString()); List locs = new ArrayList<>(); for (int i = 0; i < getDetoLocs(container); i++) { NamespacedKey key = new NamespacedKey(BauSystem.getPlugin(), DETO_PREFIX + i); @@ -116,11 +114,15 @@ public class Detonator implements Listener { public static void execute(Player player) { VersionedRunnable.call(new VersionedRunnable(() -> execute(player, PLAYER_LOCS.get(player)), 12), new VersionedRunnable(() -> { - ItemStack item = getNextBestDetonator(player); - if(item == null) - return; - Detonator detonator = getDetonator(player, item); - execute(player, detonator.getLocs()); + try { + ItemStack item = getNextBestDetonator(player); + if(item == null) + return; + Detonator detonator = getDetonator(player, item); + execute(player, detonator.getLocs()); + }catch (SecurityException e) { + player.sendMessage(BauSystem.PREFIX + "§c" + e.getMessage()); + } }, 15)); }