diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 16a81d8..e2610d2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -265,51 +265,53 @@ public class BauSystem extends JavaPlugin implements Listener { attachment.setPermission("worldedit.calc", true); attachment.setPermission("worldedit.fill", true);*/ - if (Core.getVersion() == 15) ShowManager.add(p); + if (Core.getVersion() == 15) { + ShowManager.add(p); + } } @EventHandler public void onLeave(PlayerQuitEvent e) { - Player player = e.getPlayer(); - SWScoreboard.removeScoreboard(player); - if (Bukkit.getOnlinePlayers().isEmpty() || (Bukkit.getOnlinePlayers().size() == 1 && Bukkit.getOnlinePlayers().contains(player))) { + Player p = e.getPlayer(); + SWScoreboard.removeScoreboard(p); + if (Bukkit.getOnlinePlayers().isEmpty() || (Bukkit.getOnlinePlayers().size() == 1 && Bukkit.getOnlinePlayers().contains(p))) { Bukkit.shutdown(); return; } - if (Core.getVersion() == 15) ShowManager.remove(e.getPlayer()); + if (Core.getVersion() == 15) { + ShowManager.remove(p); + } } @EventHandler public void onInventoryClick(InventoryClickEvent e) { ItemStack stack = e.getCursor(); - if (stack == null) - return; - if (!stack.hasItemMeta()) - return; + if (stack == null) return; + if (!stack.hasItemMeta()) return; if (stack.getItemMeta().hasEnchants()) { for (Enchantment en : Enchantment.values()) { if (stack.getEnchantmentLevel(en) > en.getMaxLevel()) stack.removeEnchantment(en); } } - Player p = (Player) e.getWhoClicked(); Material material = stack.getType(); - if (material == Material.POTION || material == Material.SPLASH_POTION || material == Material.LINGERING_POTION) + if (material == Material.POTION || material == Material.SPLASH_POTION || material == Material.LINGERING_POTION) { stack.setType(Material.MILK_BUCKET); + } - if(Core.getVersion() < 14){ + if (Core.getVersion() < 14) { e.setCurrentItem(stack); return; } if (stack.getItemMeta().hasAttributeModifiers()) { ItemMeta meta = stack.getItemMeta(); - for (Attribute a : Attribute.values()) - meta.removeAttributeModifier(a); + for (Attribute a : Attribute.values()) { + meta.removeAttributeModifier(a); + } stack.setItemMeta(meta); - Bukkit.getLogger().log(Level.SEVERE, "Spieler " + p.getName() + " (" + p.getUniqueId().toString() + ") hat versucht ein Item mit einem Attribute-Modifier zu bekommen."); } e.setCurrentItem(stack); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/tracer/trace/ShowStatus.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/trace/ShowStatus.java index c28e118..72fdd96 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/tracer/trace/ShowStatus.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/tracer/trace/ShowStatus.java @@ -39,21 +39,8 @@ public class ShowStatus { PARTICLE } - public boolean toggleShow() { - dirty = true; - if (show == Show.NONE) { - show = Show.ALL; - return true; - } else { - selected.clear(); - show = Show.NONE; - return false; - } - } - public boolean toggleShow(int tntID) { dirty = true; - if (show == Show.ALL) { removeSelection(tntID); return false; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/tracer/trace/TNTFrame.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/trace/TNTFrame.java index 11301aa..667e8c8 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/tracer/trace/TNTFrame.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/tracer/trace/TNTFrame.java @@ -15,7 +15,6 @@ public class TNTFrame { private static int uniqueIdentifier = 0; private long startTime = System.currentTimeMillis(); - private long endTime = System.currentTimeMillis(); private Map positions = new HashMap<>(); private Map aliveTNT = new HashMap<>(); @@ -87,7 +86,6 @@ public class TNTFrame { entry.getValue().cleanUp(); delete(entry.getKey(), false); } - endTime = System.currentTimeMillis(); aliveTNT.clear(); aliveTNT = null; return positions.isEmpty();