SteamWar/MissileWars
Archiviert
13
0

Add SpecialMissile Info in Sidebar

Dieser Commit ist enthalten in:
jojo 2020-09-18 22:28:25 +02:00
Ursprung 9e15b267fa
Commit 1ece39b75f

Datei anzeigen

@ -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<String> 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<File> 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);
}