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) {
for (SpecialItem missileItem : missileItems) {
if (item.isSimilar(missileItem.getItem())) {
return missileItem.handleUse(player);
}
}
for (SpecialItem specialItem : supportItems) {
if (item.isSimilar(specialItem.getItem())) {
return specialItem.handleUse(player);
}
return handleUse(item, player, missileItems) || handleUse(item, player, supportItems);
}
private static boolean handleUse(ItemStack item, Player player, List<SpecialItem> items) {
for (SpecialItem specialItem : items) {
if (item.isSimilar(specialItem.getItem())) return specialItem.handleUse(player);
}
return false;
}