mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-25 12:15:53 +01:00
Make command item missing-item error use display name if present
This commit is contained in:
parent
28e2e87a80
commit
bb43940a0a
@ -117,7 +117,9 @@ public class CommandTrait extends Trait {
|
|||||||
Transaction action = new ItemAction(command.itemCost).take(player, 1);
|
Transaction action = new ItemAction(command.itemCost).take(player, 1);
|
||||||
if (!action.isPossible()) {
|
if (!action.isPossible()) {
|
||||||
ItemStack stack = command.itemCost.get(0);
|
ItemStack stack = command.itemCost.get(0);
|
||||||
sendErrorMessage(player, CommandTraitError.MISSING_ITEM, null, Util.prettyEnum(stack.getType()),
|
sendErrorMessage(player, CommandTraitError.MISSING_ITEM, null,
|
||||||
|
stack.getItemMeta().hasDisplayName() ? stack.getItemMeta().getDisplayName()
|
||||||
|
: Util.prettyEnum(stack.getType()),
|
||||||
stack.getAmount());
|
stack.getAmount());
|
||||||
}
|
}
|
||||||
txns.add(action);
|
txns.add(action);
|
||||||
@ -148,7 +150,9 @@ public class CommandTrait extends Trait {
|
|||||||
Transaction action = new ItemAction(itemRequirements).take(player, 1);
|
Transaction action = new ItemAction(itemRequirements).take(player, 1);
|
||||||
if (!action.isPossible()) {
|
if (!action.isPossible()) {
|
||||||
ItemStack stack = itemRequirements.get(0);
|
ItemStack stack = itemRequirements.get(0);
|
||||||
sendErrorMessage(player, CommandTraitError.MISSING_ITEM, null, Util.prettyEnum(stack.getType()),
|
sendErrorMessage(player, CommandTraitError.MISSING_ITEM, null,
|
||||||
|
stack.getItemMeta().hasDisplayName() ? stack.getItemMeta().getDisplayName()
|
||||||
|
: Util.prettyEnum(stack.getType()),
|
||||||
stack.getAmount());
|
stack.getAmount());
|
||||||
}
|
}
|
||||||
txns.add(action);
|
txns.add(action);
|
||||||
|
Loading…
Reference in New Issue
Block a user