SteamWar/MissileWars
Archiviert
13
0

Simplify SpecialItem

Dieser Commit ist enthalten in:
jojo 2020-09-26 21:55:10 +02:00
Ursprung 0c5f909d3a
Commit 07ef804a52

Datei anzeigen

@ -58,15 +58,12 @@ public abstract class SpecialItem {
} }
public static boolean handleUse(ItemStack item, Player player) { public static boolean handleUse(ItemStack item, Player player) {
for (SpecialItem missileItem : missileItems) { return handleUse(item, player, missileItems) || handleUse(item, player, supportItems);
if (item.isSimilar(missileItem.getItem())) { }
return missileItem.handleUse(player);
} private static boolean handleUse(ItemStack item, Player player, List<SpecialItem> items) {
} for (SpecialItem specialItem : items) {
for (SpecialItem specialItem : supportItems) { if (item.isSimilar(specialItem.getItem())) return specialItem.handleUse(player);
if (item.isSimilar(specialItem.getItem())) {
return specialItem.handleUse(player);
}
} }
return false; return false;
} }