CitizensDev / Citizens

NPCs for Bukkit
citizensnpcs.co
Other
107 stars 53 forks source link

Trader potion fix (and potentially other durability based things) #1096

Closed jwebbdev closed 12 years ago

jwebbdev commented 12 years ago

... identifying potions on Traders)

Fix for: https://github.com/CitizensDev/Citizens/issues/972 https://github.com/CitizensDev/Citizens/issues/769 https://github.com/CitizensDev/Citizens/issues/518

fullwall commented 12 years ago

I noticed this myself actually... didn't get around to pushing it though. Thanks for the request. I think durability is the same as MaterialData.get/setData though... can you change that before I merge?

jwebbdev commented 12 years ago

If you mean like the 4th (data) field in ItemStack's constructor, it's different (and the reason there was the problem). For a healing potion (373:8179) you end up with 373 as the ID, 8179 as the durability and 5 as the data. (So the save writes out 373/1/8179/5 where as previously without durability added in it would write out 373/1/5, losing the 8179).