[SPIGOT-2821] ItemStack.setData() is not working? Created: 22/Nov/16 Updated: 22/Nov/16 Resolved: 22/Nov/16 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | wysohn | Assignee: | Unassigned |
Resolution: | Invalid | Votes: | 0 |
Labels: | 1.11 | ||
Environment: |
[21:13:38] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-16c940b-0b154b1 (MC: 1.11) (Implementing API version 1.11-R0.1-SNAPSHOT)[m |
Description |
because the DyeColor enum's getData() method is separated into two getWoolData() and getDyeData() (they are deprecated anyway), I recently changed my code like below: new ItemStack(Material.WOOL, 1, DyeColor.GREEN.getData()); to new ItemStack(Material.WOOL, 1){{ and the actual item I see is just a white wool instead of green wool did I do something wrong? or is it a bug in 1.11? |
Comments |
Comment by wysohn [ 22/Nov/16 ] |
Hmm I thought it was quite legit change :/ I will go back to getWoolData() and I have to use inner class just because I have to provide ItemStack right in the constructor a new additional overloaded ItemStack constructor will be really help whenevr MaterialData problem is sorted out |
Comment by md_5 [ 22/Nov/16 ] |
Well for starters getData called getWoolData, so your original code can just be getWoolData. |