mirror of
https://github.com/filoghost/ChestCommands.git
synced 2024-11-23 02:25:26 +01:00
Merge pull request #20 from SRC-Bukkit-Recover/patch-1
Show all required items
This commit is contained in:
commit
535f101cdf
@ -177,16 +177,20 @@ public class ExtendedIcon extends Icon {
|
||||
}
|
||||
|
||||
if (requiredItems != null) {
|
||||
boolean notHasItem = false;
|
||||
for (RequiredItem item : requiredItems) {
|
||||
if (!item.hasItem(player)) {
|
||||
notHasItem = true;
|
||||
player.sendMessage(ChestCommands.getLang().no_required_item
|
||||
.replace("{material}", MaterialsRegistry.formatMaterial(item.getMaterial()))
|
||||
.replace("{amount}", Integer.toString(item.getAmount()))
|
||||
.replace("{datavalue}", item.hasRestrictiveDataValue() ? Short.toString(item.getDataValue()) : ChestCommands.getLang().any)
|
||||
);
|
||||
return closeOnClick;
|
||||
}
|
||||
}
|
||||
if (notHasItem) {
|
||||
return closeOnClick;
|
||||
}
|
||||
}
|
||||
|
||||
// Take the money and the required item
|
||||
|
Loading…
Reference in New Issue
Block a user