1
0
mirror of https://e.coding.net/circlecloud/EquipManager.git synced 2024-12-04 12:38:48 +00:00

fix Material.AIR error...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2015-09-21 20:43:59 +08:00
parent 3ed2f3e82f
commit d3b6f44eaa

View File

@ -17,6 +17,8 @@ public class ArmorHandlerTask implements Runnable {
return; return;
ItemStack[] armors = p.getInventory().getArmorContents(); ItemStack[] armors = p.getInventory().getArmorContents();
for (ItemStack armor : armors) { for (ItemStack armor : armors) {
if (armor == null || armor.getType() == Material.AIR)
continue;
String armorperm = "em." + armor.getType().toString().toLowerCase(); String armorperm = "em." + armor.getType().toString().toLowerCase();
if (!p.hasPermission(armorperm) && !p.isOp() && !p.hasPermission("em.*")) { if (!p.hasPermission(armorperm) && !p.isOp() && !p.hasPermission("em.*")) {
p.getInventory().addItem(armor); p.getInventory().addItem(armor);