Updated for ItemStack change in Bukkit.

This commit is contained in:
sk89q 2011-01-31 14:35:46 -08:00
parent 541b1dbc44
commit 21040b306a
3 changed files with 3 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);