Fix NPE with legacy plugin
This commit is contained in:
parent
3d40d345fc
commit
3af14dee6e
@ -21,7 +21,7 @@ public class CraftLegacyLegacyMixin {
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Material material = Material.valueOf(name);
|
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;
|
return material;
|
||||||
} else {
|
} else {
|
||||||
return Material.valueOf("LEGACY_" + name);
|
return Material.valueOf("LEGACY_" + name);
|
||||||
@ -43,7 +43,7 @@ public class CraftLegacyLegacyMixin {
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Material material = Material.getMaterial(name);
|
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;
|
return material;
|
||||||
} else {
|
} else {
|
||||||
return Material.getMaterial("LEGACY_" + name);
|
return Material.getMaterial("LEGACY_" + name);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user