Fixed compolation on older mc versions

This commit is contained in:
coolGi
2023-11-03 23:20:26 +10:30
parent 04ee9d58bc
commit 8a882d7bf4
4 changed files with 8 additions and 4 deletions
@@ -40,11 +40,11 @@ import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraftforge.event.world.ChunkEvent;
import net.minecraftforge.event.world.WorldEvent;
#else
import net.minecraftforge.client.event.RenderLevelStageEvent;
import net.minecraftforge.event.level.ChunkEvent;
import net.minecraftforge.event.level.LevelEvent;
#endif
import net.minecraftforge.client.event.RenderLevelStageEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraft.world.level.chunk.ChunkAccess;
@@ -298,7 +298,11 @@ public class ForgeClientProxy
@SubscribeEvent
public void afterLevelRenderEvent(RenderLevelStageEvent event)
{
#if POST_MC_1_20_1
if (event.getStage() == RenderLevelStageEvent.Stage.AFTER_LEVEL)
#else
if (event.getStage() == RenderLevelStageEvent.Stage.AFTER_SOLID_BLOCKS)
#endif
{
try
{
@@ -29,7 +29,7 @@ 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 == null &&
mc == null ||
mc.getWrappedClientLevel() == null
)
return;