Fire RenderLevelStageEvent for chunk render layers (#486)
This commit is contained in:
1 parent
96981494a4
commit
527e44dc9d
1 file changed
+17
+17
@@ -13,12 +13,14 @@ import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import org.spongepowered.asm.mixin.*;
|
||||
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;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.SortedSet;
|
||||
|
||||
@Mixin(WorldRenderer.class)
|
||||
@@ -31,6 +33,16 @@ public abstract class MixinWorldRenderer implements WorldRendererExtended {
|
||||
@Final
|
||||
private Long2ObjectMap<SortedSet<BlockBreakingInfo>> blockBreakingProgressions;
|
||||
|
||||
@Shadow
|
||||
private int ticks;
|
||||
@Shadow
|
||||
@Nullable
|
||||
private Frustum capturedFrustum;
|
||||
@Shadow
|
||||
private Frustum frustum;
|
||||
@Shadow
|
||||
@Final
|
||||
private MinecraftClient client;
|
||||
private SodiumWorldRenderer renderer;
|
||||
|
||||
@Unique
|
||||
@@ -99,6 +111,11 @@ public abstract class MixinWorldRenderer implements WorldRendererExtended {
|
||||
} finally {
|
||||
RenderDevice.exitManagedCode();
|
||||
}
|
||||
Frustum frustrum = this.capturedFrustum != null ? this.capturedFrustum : this.frustum;
|
||||
Camera camera = this.client.gameRenderer.getCamera();
|
||||
ForgeHooksClient.dispatchRenderStage(
|
||||
renderLayer, (WorldRenderer) (Object) this, matrices, matrix, this.ticks, camera, frustrum
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user