mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-24 18:09:41 -05:00
Fixed NPE in ItemStack. Thanks jascotty2!
By: EvilSeph <evilseph@gmail.com>
This commit is contained in:
1 parent
0f21027498
commit
5fc8f4f576
1 file changed
+3
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user