mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 13:24:17 -07:00
Fixed NPE in ItemStack. Thanks jascotty2!
By: EvilSeph <evilseph@gmail.com>
This commit is contained in:
@@ -122,8 +122,9 @@ public class ItemStack implements ConfigurationSerializable {
|
|||||||
* @return MaterialData for this item
|
* @return MaterialData for this item
|
||||||
*/
|
*/
|
||||||
public MaterialData getData() {
|
public MaterialData getData() {
|
||||||
if (Material.getMaterial(getTypeId()).getData() != null) {
|
Material mat = Material.getMaterial(getTypeId());
|
||||||
data = Material.getMaterial(getTypeId()).getNewData((byte) this.durability);
|
if (mat != null && mat.getData() != null) {
|
||||||
|
data = mat.getNewData((byte) this.durability);
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
Reference in New Issue
Block a user