Merge pull request #20 from SRC-Bukkit-Recover/patch-1

Show all required items
This commit is contained in:
filoghost 2020-04-12 11:15:33 +02:00 committed by GitHub
commit 535f101cdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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