mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-19 12:56:30 +00:00
Fixed NPE in ItemStack. Thanks jascotty2!
This commit is contained in:
parent
b1815cc6c6
commit
30bb875342
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue