Fixed NPE in ItemStack. Thanks jascotty2!

This commit is contained in:
EvilSeph
2012-01-07 19:58:26 -05:00
parent 187a961d2e
commit f131151325

View File

@@ -122,8 +122,9 @@ public class ItemStack implements ConfigurationSerializable {
* @return MaterialData for this item
*/
public MaterialData getData() {
if (Material.getMaterial(getTypeId()).getData() != null) {
data = Material.getMaterial(getTypeId()).getNewData((byte) this.durability);
Material mat = Material.getMaterial(getTypeId());
if (mat != null && mat.getData() != null) {
data = mat.getNewData((byte) this.durability);
}
return data;