mirror of
https://github.com/CarmJos/ScriptItems
synced 2026-07-15 07:21:23 +08:00
fix(null): 修复物品可能为空导致的报错问题
This commit is contained in:
@@ -118,8 +118,9 @@ public class ItemsManager {
|
||||
return new ScriptItem(UUID.fromString(itemUUID), settings, item);
|
||||
}
|
||||
|
||||
public boolean isScriptItem(ItemStack item) {
|
||||
return item.hasItemMeta() && item.getItemMeta() != null
|
||||
public boolean isScriptItem(@Nullable ItemStack item) {
|
||||
return item != null && item.getType() != Material.AIR
|
||||
&& item.hasItemMeta() && item.getItemMeta() != null
|
||||
&& item.getItemMeta().getCustomTagContainer().hasCustomTag(idKey, ItemTagType.STRING);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user