Skip to content

Commit

Permalink
Fix AFTER_SETUP event not being able to render (#4219)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
JustRed23 authored Nov 25, 2024
1 parent 2758bfb commit 6922831
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ private void beforeRender(ObjectAllocator objectAllocator, RenderTickCounter tic
@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);
}

Expand Down

0 comments on commit 6922831

Please sign in to comment.