Skip to content

Commit

Permalink
Allow unbreakable to not take any arguments, defaulting to true. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SupaHam committed Aug 7, 2017
1 parent 117704b commit 203d656
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Essentials/src/com/earth2me/essentials/MetaItemStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ public void addStringMeta(final CommandSource sender, final boolean allowUnsafe,
final ItemMeta meta = stack.getItemMeta();
meta.setLore(lore);
stack.setItemMeta(meta);
} else if (split.length > 1 && (split[0].equalsIgnoreCase("unbreakable") && hasMetaPermission(sender, "unbreakable", false, true, ess))) {
setUnbreakable(stack, Boolean.valueOf(split[1]));
} else if (split[0].equalsIgnoreCase("unbreakable") && hasMetaPermission(sender, "unbreakable", false, true, ess)) {
boolean value = split.length > 1 ? Boolean.valueOf(split[1]) : true;
setUnbreakable(stack, value);
} else if (split.length > 1 && (split[0].equalsIgnoreCase("player") || split[0].equalsIgnoreCase("owner")) && stack.getType() == Material.SKULL_ITEM && hasMetaPermission(sender, "head", false, true, ess)) {
if (stack.getDurability() == 3) {
final String owner = split[1];
Expand Down

0 comments on commit 203d656

Please sign in to comment.