From aa306a8df7232d5e3ad84dea62370f5c66f983c9 Mon Sep 17 00:00:00 2001 From: zml2008 Date: Wed, 7 Dec 2011 22:27:00 -0800 Subject: [PATCH] Added additional worldguard.stack.damaged permissions to allow stacking of tools with a different damage value --- .../com/sk89q/worldguard/bukkit/commands/GeneralCommands.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/commands/GeneralCommands.java b/src/main/java/com/sk89q/worldguard/bukkit/commands/GeneralCommands.java index 91fc8ae6..675e738e 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/commands/GeneralCommands.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/commands/GeneralCommands.java @@ -238,6 +238,7 @@ public void stack(CommandContext args, CommandSender sender) throws CommandExcep Player player = plugin.checkPlayer(sender); boolean ignoreMax = plugin.hasPermission(player, "worldguard.stack.illegitimate"); + boolean ignoreDamaged = plugin.hasPermission(player, "worldguard.stack.damaged"); ItemStack[] items = player.getInventory().getContents(); int len = items.length; @@ -271,7 +272,7 @@ public void stack(CommandContext args, CommandSender sender) throws CommandExcep // Same type? // Blocks store their color in the damage value if (item2.getTypeId() == item.getTypeId() && - (!ItemType.usesDamageValue(item.getTypeId()) + ((!ItemType.usesDamageValue(item.getTypeId()) && ignoreDamaged) || item.getDurability() == item2.getDurability()) && item.getEnchantments().equals(item2.getEnchantments())) { // This stack won't fit in the parent stack