Fix AFTER_SETUP event not being able to render (#4219)

* Add BEFORE_TERRAIN world render event

* Add 1.21.2 rendering issue warning

* Add comment to injection point

* close b tag

* Undo all new event changes

* Move AFTER_SETUP event to new mixin

* Remove event interface

* Refine mixin
This commit is contained in:
JustRed23 2024-11-25 19:23:30 +01:00 committed by GitHub
parent 2758bfbf66
commit 69228316a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,6 +80,18 @@ public abstract class WorldRendererMixin {
@Inject(method = "setupTerrain", at = @At("RETURN"))
private void afterTerrainSetup(Camera camera, Frustum frustum, boolean hasForcedFrustum, boolean spectator, CallbackInfo ci) {
context.setFrustum(frustum);
}
@Inject(
method = "method_62214",
at = @At(
value = "INVOKE_STRING",
target = "Lnet/minecraft/util/profiler/Profiler;push(Ljava/lang/String;)V",
args = "ldc=terrain",
shift = Shift.AFTER
) // Points to after profiler.push("terrain");
)
private void beforeTerrainSolid(CallbackInfo ci) {
WorldRenderEvents.AFTER_SETUP.invoker().afterSetup(context);
}