Fix NPE with legacy plugin
This commit is contained in:
parent
3d40d345fc
commit
3af14dee6e
@ -21,7 +21,7 @@ public class CraftLegacyLegacyMixin {
|
||||
} else {
|
||||
try {
|
||||
Material material = Material.valueOf(name);
|
||||
if (((MaterialBridge) (Object) material).bridge$getType() == MaterialPropertySpec.MaterialType.FORGE) {
|
||||
if (material != null && ((MaterialBridge) (Object) material).bridge$getType() == MaterialPropertySpec.MaterialType.FORGE) {
|
||||
return material;
|
||||
} else {
|
||||
return Material.valueOf("LEGACY_" + name);
|
||||
@ -43,7 +43,7 @@ public class CraftLegacyLegacyMixin {
|
||||
} else {
|
||||
try {
|
||||
Material material = Material.getMaterial(name);
|
||||
if (((MaterialBridge) (Object) material).bridge$getType() == MaterialPropertySpec.MaterialType.FORGE) {
|
||||
if (material != null && ((MaterialBridge) (Object) material).bridge$getType() == MaterialPropertySpec.MaterialType.FORGE) {
|
||||
return material;
|
||||
} else {
|
||||
return Material.getMaterial("LEGACY_" + name);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user