1
0
mirror of https://e.coding.net/circlecloud/ProtectItem.git synced 2024-12-27 20:48:51 +00:00

fix item null or AIR...

Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
j502647092 2015-10-24 18:02:03 +08:00
parent 82cf576315
commit 6be962b13a

View File

@ -4,6 +4,7 @@ import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -51,6 +52,9 @@ public class ItemManager {
} }
public boolean canAction(final ItemStack i, final ActionType action) { public boolean canAction(final ItemStack i, final ActionType action) {
if (i == null || i.getType() == Material.AIR) {
return true;
}
final String itemname = getItemName(i); final String itemname = getItemName(i);
final List<ActionType> actlist = itemlist.get(itemname); final List<ActionType> actlist = itemlist.get(itemname);
if (actlist == null) { if (actlist == null) {