From 175f7c740382663a3bfd164be30d0736f9d6e292 Mon Sep 17 00:00:00 2001 From: makamys Date: Wed, 21 Sep 2022 15:27:21 +0200 Subject: Fix a hook in MixinRenderGlobal being incompatible with DragonAPI cc #9 --- src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java b/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java index 51cc52a..3eed7b2 100644 --- a/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java +++ b/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java @@ -23,10 +23,10 @@ abstract class MixinRenderGlobal { private boolean nd$isInsideUpdateRenderers; - @Redirect(method = "renderSortedRenderers", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderGlobal;renderAllRenderLists(ID)V")) - private void redirectRenderAllRenderLists(RenderGlobal thiz, int p1, double p2) { - if(Neodymium.shouldRenderVanillaWorld()) { - thiz.renderAllRenderLists(p1, p2); + @Inject(method = "renderAllRenderLists", at = @At(value = "HEAD"), cancellable = true) + private void preRenderAllRenderLists(int p1, double p2, CallbackInfo ci) { + if(!Neodymium.shouldRenderVanillaWorld()) { + ci.cancel(); } } -- cgit