mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-17 21:51:25 +01:00
Fixed the item durability disable setting changing the damage value on an empty hand.
This commit is contained in:
parent
f03a2263d8
commit
02913780ec
@ -63,8 +63,10 @@ public void onBlockDamage(BlockDamageEvent event) {
|
||||
|
||||
if (!plugin.itemDurability && event.getDamageLevel() == BlockDamageLevel.BROKEN) {
|
||||
ItemStack held = player.getItemInHand();
|
||||
held.setDamage((byte)-1);
|
||||
player.setItemInHand(held);
|
||||
if (held.getTypeId() > 0) {
|
||||
held.setDamage((byte)-1);
|
||||
player.setItemInHand(held);
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin.useRegions && event.getDamageLevel() == BlockDamageLevel.BROKEN) {
|
||||
|
Loading…
Reference in New Issue
Block a user