[SPIGOT-4214] [1.13] BlockData is not created for specific materials. Created: 02/Aug/18 Updated: 02/Aug/18 Resolved: 02/Aug/18 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Daniel Scalzi | Assignee: | md_5 |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | 1.13, BlockData | ||
| Attachments: |
|
| Version: | CraftBukkit version git-Spigot-69774b3-272426a (MC: 1.13) (Implementing API version 1.13-R0.1-SNAPSHOT) |
| Guidelines Read: | Yes |
| Description |
|
Block data is not created for some materials, and defaults to Material.AIR. This occurs with both Material#createBlockData and Server#createBlockData and the equivalent overloaded methods. To Reproduce: sender.sendMessage("Expected: " + Material.DIRT + " Got: " + Material.DIRT.createBlockData().getMaterial()); sender.sendMessage("Expected: " + Material.IRON_SHOVEL + " Got: " + Material.IRON_SHOVEL.createBlockData().getMaterial()); Output of the above lines: [02:30:44 INFO]: Expected: DIRT Got: DIRT Running the latest version of Spigot at the time of submission, see the version field. I am converting a large list of item aliases to 1.13 and ran into this issue during conversion. I'll attach the output of that process. All Materials where the output is equal to API: AIR are affected. The API material is the result of converting the NEW material to BlockData. I am also under the assumption that all Materials can be represented by BlockData. If this is not the case, JavaDocs should be added to the BlockData class which indicate this. |
| Comments |
| Comment by md_5 [ 02/Aug/18 ] |
|
I thought this was obvious because its BLOCKdata, iron shovel is not a block. However it should throw an exception when you do this, not return air. |
| Comment by Daniel Scalzi [ 02/Aug/18 ] |
|
Going to change this to minor because on IRC we're thinking it might be that only placable blocks have BlockData. If this is the case, might be good to add this to the Javadocs for the BlockData class. |