Permalink
Browse files

Fix NPE when given invalid material ids

  • Loading branch information...
PseudoKnight committed Aug 9, 2018
1 parent 02ce140 commit a81a65992f7b8a2f268d8ed67fe9d4da71d651e2
@@ -511,6 +511,9 @@ public static Material getMaterial(String type, int data) {
}
public static Material getMaterial(Material legacymat, int data) {
if(legacymat == null) {
return null;
}
if(legacymat.getMaxDurability() == 0) {
return Bukkit.getUnsafe().fromLegacy(new MaterialData(legacymat, (byte) data));
} else {

0 comments on commit a81a659

Please sign in to comment.