mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-25 03:55:30 +01:00
Check for item meta presence as well
This commit is contained in:
parent
bb43940a0a
commit
2dd4a2001b
@ -118,7 +118,8 @@ public class CommandTrait extends Trait {
|
||||
if (!action.isPossible()) {
|
||||
ItemStack stack = command.itemCost.get(0);
|
||||
sendErrorMessage(player, CommandTraitError.MISSING_ITEM, null,
|
||||
stack.getItemMeta().hasDisplayName() ? stack.getItemMeta().getDisplayName()
|
||||
stack.hasItemMeta() && stack.getItemMeta().hasDisplayName()
|
||||
? stack.getItemMeta().getDisplayName()
|
||||
: Util.prettyEnum(stack.getType()),
|
||||
stack.getAmount());
|
||||
}
|
||||
@ -151,7 +152,8 @@ public class CommandTrait extends Trait {
|
||||
if (!action.isPossible()) {
|
||||
ItemStack stack = itemRequirements.get(0);
|
||||
sendErrorMessage(player, CommandTraitError.MISSING_ITEM, null,
|
||||
stack.getItemMeta().hasDisplayName() ? stack.getItemMeta().getDisplayName()
|
||||
stack.hasItemMeta() && stack.getItemMeta().hasDisplayName()
|
||||
? stack.getItemMeta().getDisplayName()
|
||||
: Util.prettyEnum(stack.getType()),
|
||||
stack.getAmount());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user