fix item null or AIR...

Signed-off-by: j502647092 <jtb1@163.com>
master
j502647092 2015-10-24 18:02:03 +08:00
parent 82cf576315
commit 6be962b13a
1 changed files with 4 additions and 0 deletions

View File

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