Fix for when there is a chance of mc being null

This commit is contained in:
coolGi
2023-11-03 23:02:43 +10:30
parent a227547daa
commit ee867e972f
2 changed files with 8 additions and 2 deletions
@@ -28,7 +28,10 @@ public class MixinLightmap
{
// since the light map is always updated on the client render thread we should be able to access the client level at the same time
IMinecraftClientWrapper mc = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class);
if (mc.getWrappedClientLevel() == null)
if (
mc != null &&
mc.getWrappedClientLevel() == null
)
return;
IClientLevelWrapper clientLevel = mc.getWrappedClientLevel();
@@ -28,7 +28,10 @@ public class MixinLightmap
{
// since the light map is always updated on the client render thread we should be able to access the client level at the same time
IMinecraftClientWrapper mc = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class);
if (mc.getWrappedClientLevel() == null)
if (
mc != null &&
mc.getWrappedClientLevel() == null
)
return;
IClientLevelWrapper clientLevel = mc.getWrappedClientLevel();