SteamWar/MissileWars
Archiviert
13
0

Fix handleItem for Missiles

Dieser Commit ist enthalten in:
jojo 2020-09-19 09:29:11 +02:00
Ursprung f265408a42
Commit 290180309c
2 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -165,7 +165,7 @@ public class Missile extends SpecialItem {
} }
public static void init(){ public static void init(){
File missileFolder = new File(MissileWars.getPlugin().getDataFolder(), "default-missles"); File missileFolder = new File(MissileWars.getPlugin().getDataFolder(), "default-missiles");
if (!missileFolder.exists() || !missileFolder.canRead() || !missileFolder.isDirectory()) { if (!missileFolder.exists() || !missileFolder.canRead() || !missileFolder.isDirectory()) {
throw new SecurityException("Missiles could not be loaded"); throw new SecurityException("Missiles could not be loaded");
} }

Datei anzeigen

@ -67,6 +67,11 @@ public abstract class SpecialItem {
} }
public static boolean handleUse(ItemStack item, Player player) { 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) { for (SpecialItem specialItem : supportItems) {
if (item.isSimilar(specialItem.getItem())) { if (item.isSimilar(specialItem.getItem())) {
return specialItem.handleUse(player); return specialItem.handleUse(player);