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
[02:30:44 INFO]: Expected: IRON_SHOVEL Got: AIR
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.