mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-02-03 14:01:56 +01:00
Updated for ItemStack change in Bukkit.
This commit is contained in:
parent
541b1dbc44
commit
21040b306a
@ -65,7 +65,7 @@ public void onBlockDamage(BlockDamageEvent event) {
|
||||
if (!plugin.itemDurability && event.getDamageLevel() == BlockDamageLevel.BROKEN) {
|
||||
ItemStack held = player.getItemInHand();
|
||||
if (held.getTypeId() > 0) {
|
||||
held.setDamage((byte)-1);
|
||||
held.setDurability((short) -1);
|
||||
player.setItemInHand(held);
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public void onPlayerItem(PlayerItemEvent event) {
|
||||
if (!plugin.itemDurability) {
|
||||
// Hoes
|
||||
if (item.getTypeId() >= 290 && item.getTypeId() <= 294) {
|
||||
item.setDamage((byte)-1);
|
||||
item.setDurability((byte)-1);
|
||||
player.setItemInHand(item);
|
||||
}
|
||||
}
|
||||
|
@ -625,7 +625,7 @@ private boolean handleCommand(Player player, String cmd, String[] args)
|
||||
// Blocks store their color in the damage value
|
||||
if (item2.getTypeId() == item.getTypeId() &&
|
||||
(!ItemType.usesDamageValue(item.getTypeId())
|
||||
|| item.getDamage() == item2.getDamage())) {
|
||||
|| item.getDurability() == item2.getDurability())) {
|
||||
// This stack won't fit in the parent stack
|
||||
if (item2.getAmount() > needed) {
|
||||
item.setAmount(64);
|
||||
|
Loading…
Reference in New Issue
Block a user