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

(cherry picked from commit 69228316a9)
This commit is contained in:
JustRed23 2024-11-25 19:23:30 +01:00 committed by modmuss50
parent 56e78b9be0
commit 6dc662b6c6

View file

@ -79,6 +79,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);
}