From 1ece39b75f06bf4e0994abd53460a6501c9e1b4d Mon Sep 17 00:00:00 2001 From: jojo Date: Fri, 18 Sep 2020 22:28:25 +0200 Subject: [PATCH] Add SpecialMissile Info in Sidebar --- src/de/steamwar/misslewars/items/Missile.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/de/steamwar/misslewars/items/Missile.java b/src/de/steamwar/misslewars/items/Missile.java index a5bb458..c2eefed 100644 --- a/src/de/steamwar/misslewars/items/Missile.java +++ b/src/de/steamwar/misslewars/items/Missile.java @@ -84,7 +84,7 @@ public class Missile extends SpecialItem { } item = createItem(itemType, "§c" + name, 1, lore, special); - specialMissiles.add(name); + if (special) specialMissiles.add(name); } private void lore(List lore, String[] args, int index, String tag) { @@ -178,17 +178,14 @@ public class Missile extends SpecialItem { return; } File[] files = missileFolder.listFiles(); - if (files == null) { - return; - } - if (files.length < 4) { - return; - } + if (files == null) return; + if (files.length < 4) return; List pool = new ArrayList<>(files.length); pool.addAll(Arrays.asList(files)); for (int i = 0; i < 4; i++) { File missileFile = pool.remove(r.nextInt(pool.size())); + Bukkit.getLogger().log(Level.SEVERE, missileFile.getAbsolutePath()); if (!missileFile.canRead() || !missileFile.isFile()) continue; new Missile(missileFile, true); }