mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-24 11:36:11 +01:00
Added additional worldguard.stack.damaged permissions to allow stacking of tools with a different damage value
This commit is contained in:
parent
b1256eedcf
commit
aa306a8df7
@ -238,6 +238,7 @@ public void stack(CommandContext args, CommandSender sender) throws CommandExcep
|
|||||||
|
|
||||||
Player player = plugin.checkPlayer(sender);
|
Player player = plugin.checkPlayer(sender);
|
||||||
boolean ignoreMax = plugin.hasPermission(player, "worldguard.stack.illegitimate");
|
boolean ignoreMax = plugin.hasPermission(player, "worldguard.stack.illegitimate");
|
||||||
|
boolean ignoreDamaged = plugin.hasPermission(player, "worldguard.stack.damaged");
|
||||||
|
|
||||||
ItemStack[] items = player.getInventory().getContents();
|
ItemStack[] items = player.getInventory().getContents();
|
||||||
int len = items.length;
|
int len = items.length;
|
||||||
@ -271,7 +272,7 @@ public void stack(CommandContext args, CommandSender sender) throws CommandExcep
|
|||||||
// Same type?
|
// Same type?
|
||||||
// Blocks store their color in the damage value
|
// Blocks store their color in the damage value
|
||||||
if (item2.getTypeId() == item.getTypeId() &&
|
if (item2.getTypeId() == item.getTypeId() &&
|
||||||
(!ItemType.usesDamageValue(item.getTypeId())
|
((!ItemType.usesDamageValue(item.getTypeId()) && ignoreDamaged)
|
||||||
|| item.getDurability() == item2.getDurability()) &&
|
|| item.getDurability() == item2.getDurability()) &&
|
||||||
item.getEnchantments().equals(item2.getEnchantments())) {
|
item.getEnchantments().equals(item2.getEnchantments())) {
|
||||||
// This stack won't fit in the parent stack
|
// This stack won't fit in the parent stack
|
||||||
|
Loading…
Reference in New Issue
Block a user