Skip to content
Success

Changes

Summary

  1. SPIGOT-4706: Can't interact with active item (details)
  2. Remove the Damage tag from items when it is 0. (details)
Commit f74c7b9578132e74fa45be53f0b69ac510258f75 by md_5
SPIGOT-4706: Can't interact with active item
The file was modified nms-patches/PlayerConnection.patch
Commit c3749a2358d93d272702a20fa6d36b08722f9ea3 by md_5
Remove the Damage tag from items when it is 0.
CraftBukkit (and Minecraft as well in some cases, such as when getting
an item from the creative inventory menu) will omit the Damage tag when
it is zero. However, minecraft will add the tag in some situations
nevertheless, such as when loading the ItemStack, or when explictly
setting the item undamaged.
These items (with and without the Damage tag for undamaged items) will
be considered as different by minecraft and CraftBukkit in various
situations, even though they should not. In CraftBukkit these items will
actually only be considered unsimilar if the items' metadata is not
'empty' (if it contains other additional metadata, such as enchantments,
etc.).
If the item's tag is empty after removing the Damage tag, it gets
completely removed. The setRepairCost function was adapted to behave in
the same way (removal of the tag if it becomes empty).
The file was modified src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
The file was modified nms-patches/ItemStack.patch