-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
[09:32:37 INFO]: Minecraft Launcher 1.6.11 (through bootstrap 100) started on windows...
[09:32:37 INFO]: Current time is Feb 18, 2015 9:32:37 AM
[09:32:37 INFO]: System.getProperty('os.name') == 'Windows 7'
[09:32:37 INFO]: System.getProperty('os.version') == '6.1'
[09:32:37 INFO]: System.getProperty('os.arch') == 'amd64'
[09:32:37 INFO]: System.getProperty('java.version') == '1.8.0_25'
[09:32:37 INFO]: System.getProperty('java.vendor') == 'Oracle Corporation'
[09:32:37 INFO]: System.getProperty('sun.arch.data.model') == '64'
[09:32:37 INFO]: proxy == DIRECT
[09:32:37 INFO]: JFX is already initializedTesting Using Latest Spigot/API
Also run and compiled it on Cent OS 6.5 with same results.
[09:32:37 INFO] : Minecraft Launcher 1.6.11 (through bootstrap 100) started on windows... [09:32:37 INFO] : Current time is Feb 18, 2015 9:32:37 AM [09:32:37 INFO] : System.getProperty('os.name') == 'Windows 7' [09:32:37 INFO] : System.getProperty('os.version') == '6.1' [09:32:37 INFO] : System.getProperty('os.arch') == 'amd64' [09:32:37 INFO] : System.getProperty('java.version') == '1.8.0_25' [09:32:37 INFO] : System.getProperty('java.vendor') == 'Oracle Corporation' [09:32:37 INFO] : System.getProperty('sun.arch.data.model') == '64' [09:32:37 INFO] : proxy == DIRECT [09:32:37 INFO] : JFX is already initialized Testing Using Latest Spigot/API Also run and compiled it on Cent OS 6.5 with same results.
Hi
There seems to be an issue with the new HideFlags API. From the Java Docs the following should set the item unbreaking and set to hide the unbreaking tag in the lore.
ItemStack stack = new ItemStack(Material.DIAMOND_SWORD, 1); ItemMeta meta = stack.getItemMeta(); meta.spigot().setUnbreakable(true); meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE); stack.setItemMeta(meta);
Now it does apply the unbreakable but does not hide the unbreakable tag in the client.
I did a small test and created the same Item using following give command
/give Relicum minecraft:diamond_sword 1 0
{HideFlags:4,Unbreakable:1}I then used NBTexplorer to see that was actually being written to my players dat file. The image shows to entries from my inventory.
Slot 0 contains the item created by the Give command.
Slot 2 contains the items from the code snippet above.
I presume you meant for the actual tag to be HideFlags not ItemFlags. Also minecraft saved the Unbreakable tag as an int where you have it saved as a byte, that might be intentional thought i'd point it out. If i manually change it in NBTexplorer to match what is in slot 0 the tag now gets hidden as expected.
Serialization doesn't work but I presume that's a knock on effect of the possible miss naming of the tag. Here is what it gets serialized to.
==: org.bukkit.inventory.ItemStack
type: DIAMOND_SWORD
meta:
==: ItemMeta
meta-type: UNSPECIFIC
Unbreakable: true
hideFlags: !!set
HIDE_UNBREAKABLE: null
Hope this gives you enough to go on. Sorry for the spelling remember I'm dyslexic.
Regards
Relicum