Merge branch 'vivecraft'
This commit is contained in:
+22
-41
@@ -23,17 +23,18 @@ import com.mojang.blaze3d.vertex.PoseStack;
|
||||
#if PRE_MC_1_19_4
|
||||
import com.mojang.math.Matrix4f;
|
||||
#else
|
||||
import com.seibel.distanthorizons.common.rendering.SeamlessOverdraw;
|
||||
import com.seibel.distanthorizons.common.wrappers.McObjectConverter;
|
||||
import com.seibel.distanthorizons.common.wrappers.world.ClientLevelWrapper;
|
||||
import com.seibel.distanthorizons.core.api.internal.ClientApi;
|
||||
import com.seibel.distanthorizons.coreapi.util.math.Mat4f;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import org.joml.Matrix4f;
|
||||
#endif
|
||||
import com.seibel.distanthorizons.common.wrappers.chunk.ChunkWrapper;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.world.level.lighting.LevelLightEngine;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -41,7 +42,6 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
/**
|
||||
@@ -107,39 +107,20 @@ public class MixinLevelRenderer
|
||||
callback.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method =
|
||||
"Lnet/minecraft/client/renderer/LevelRenderer;" +
|
||||
"renderLevel(Lcom/mojang/blaze3d/vertex/PoseStack;" +
|
||||
"FJZLnet/minecraft/client/Camera;" +
|
||||
"Lnet/minecraft/client/renderer/GameRenderer;" +
|
||||
"Lnet/minecraft/client/renderer/LightTexture;" +
|
||||
#if PRE_MC_1_19_4
|
||||
"Lcom/mojang/math/Matrix4f;)V"
|
||||
#else
|
||||
"Lorg/joml/Matrix4f;)V"
|
||||
#endif
|
||||
,
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
#if PRE_MC_1_20_1
|
||||
target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"
|
||||
#else
|
||||
target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"
|
||||
#endif
|
||||
))
|
||||
private int callAfterRunUpdates(LevelLightEngine light #if PRE_MC_1_20_1 , int pos, boolean isQueueEmpty, boolean updateBlockLight #endif)
|
||||
{
|
||||
#if PRE_MC_1_20_1
|
||||
int r = light.runUpdates(pos, isQueueEmpty, updateBlockLight);
|
||||
#else
|
||||
int r = light.runLightUpdates();
|
||||
#endif
|
||||
ChunkWrapper.syncedUpdateClientLightStatus();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRE_MC_1_19_4
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#elif PRE_MC_1_20_1
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#else
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
|
||||
private void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#endif
|
||||
{
|
||||
ChunkWrapper.syncedUpdateClientLightStatus();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+13
-27
@@ -23,6 +23,9 @@ import com.mojang.blaze3d.vertex.PoseStack;
|
||||
#if PRE_MC_1_19_4
|
||||
import com.mojang.math.Matrix4f;
|
||||
#else
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import org.joml.Matrix4f;
|
||||
#endif
|
||||
import com.seibel.distanthorizons.common.rendering.SeamlessOverdraw;
|
||||
@@ -154,35 +157,18 @@ public class MixinLevelRenderer
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method =
|
||||
"Lnet/minecraft/client/renderer/LevelRenderer;" +
|
||||
"renderLevel(Lcom/mojang/blaze3d/vertex/PoseStack;" +
|
||||
"FJZLnet/minecraft/client/Camera;" +
|
||||
"Lnet/minecraft/client/renderer/GameRenderer;" +
|
||||
"Lnet/minecraft/client/renderer/LightTexture;" +
|
||||
#if PRE_MC_1_19_4
|
||||
"Lcom/mojang/math/Matrix4f;)V"
|
||||
#else
|
||||
"Lorg/joml/Matrix4f;)V"
|
||||
#endif
|
||||
,
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
#if PRE_MC_1_20_1
|
||||
target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"
|
||||
#else
|
||||
target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"
|
||||
#endif
|
||||
))
|
||||
private int callAfterRunUpdates(LevelLightEngine light #if PRE_MC_1_20_1 , int pos, boolean isQueueEmpty, boolean updateBlockLight #endif )
|
||||
#if PRE_MC_1_19_4
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#elif PRE_MC_1_20_1
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#else
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
|
||||
private void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#endif
|
||||
{
|
||||
#if PRE_MC_1_20_1
|
||||
int r = light.runUpdates(pos, isQueueEmpty, updateBlockLight);
|
||||
#else
|
||||
int r = light.runLightUpdates();
|
||||
#endif
|
||||
ChunkWrapper.syncedUpdateClientLightStatus();
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user