aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium/mixin
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-22 06:44:39 +0200
committermakamys <makamys@outlook.com>2022-06-22 06:44:39 +0200
commitd7852470c3618466aa8105c97bd6786cafb45756 (patch)
tree0621f62a82ffdfc660adced8be87093978863069 /src/main/java/makamys/neodymium/mixin
parent6b5d4e876fe83691a9eb65d72fef3a62282afd33 (diff)
downloadNeodymium-d7852470c3618466aa8105c97bd6786cafb45756.tar.gz
Neodymium-d7852470c3618466aa8105c97bd6786cafb45756.tar.bz2
Neodymium-d7852470c3618466aa8105c97bd6786cafb45756.zip
Reload NeoRenderer when the world renderers are reloaded
Diffstat (limited to 'src/main/java/makamys/neodymium/mixin')
-rw-r--r--src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java b/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java
index 2316aa0..58331d2 100644
--- a/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java
+++ b/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java
@@ -5,6 +5,7 @@ import org.spongepowered.asm.mixin.Shadow;
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 org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import makamys.neodymium.Neodymium;
@@ -31,4 +32,11 @@ abstract class MixinRenderGlobal {
Neodymium.renderer.preRenderSortedRenderers(renderPass, partialTickTime, sortedWorldRenderers);
}
}
+
+ @Inject(method = "loadRenderers", at = @At(value = "HEAD"))
+ public void preLoadRenderers(CallbackInfo ci) {
+ if(Neodymium.isActive()) {
+ Neodymium.renderer = null;
+ }
+ }
}