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); 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) { private void lore(List<String> lore, String[] args, int index, String tag) {
@ -178,17 +178,14 @@ public class Missile extends SpecialItem {
return; return;
} }
File[] files = missileFolder.listFiles(); File[] files = missileFolder.listFiles();
if (files == null) { if (files == null) return;
return; if (files.length < 4) return;
}
if (files.length < 4) {
return;
}
List<File> pool = new ArrayList<>(files.length); List<File> pool = new ArrayList<>(files.length);
pool.addAll(Arrays.asList(files)); pool.addAll(Arrays.asList(files));
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
File missileFile = pool.remove(r.nextInt(pool.size())); File missileFile = pool.remove(r.nextInt(pool.size()));
Bukkit.getLogger().log(Level.SEVERE, missileFile.getAbsolutePath());
if (!missileFile.canRead() || !missileFile.isFile()) continue; if (!missileFile.canRead() || !missileFile.isFile()) continue;
new Missile(missileFile, true); new Missile(missileFile, true);
} }