aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2024-01-20 13:16:36 +0100
committermakamys <makamys@outlook.com>2024-01-20 13:18:12 +0100
commit7da5fb9ed13688800e3ffd52f1dddeaba6d997cf (patch)
tree4038d477663d434d9f026ec998b6a75342baf1a9 /src/main/java/makamys/neodymium
parent1cc374fdbefc26e709db213b439c8a7961d55d1e (diff)
downloadNeodymium-7da5fb9ed13688800e3ffd52f1dddeaba6d997cf.tar.gz
Neodymium-7da5fb9ed13688800e3ffd52f1dddeaba6d997cf.tar.bz2
Neodymium-7da5fb9ed13688800e3ffd52f1dddeaba6d997cf.zip
Add JVM flag to keep running render list logic
Fixes Hodgepodge incompat (#44), but there's probably a better way
Diffstat (limited to 'src/main/java/makamys/neodymium')
-rw-r--r--src/main/java/makamys/neodymium/Constants.java2
-rw-r--r--src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java6
-rw-r--r--src/main/java/makamys/neodymium/mixin/MixinWorldRenderer.java5
3 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/makamys/neodymium/Constants.java b/src/main/java/makamys/neodymium/Constants.java
index 47ea8c6..02482bd 100644
--- a/src/main/java/makamys/neodymium/Constants.java
+++ b/src/main/java/makamys/neodymium/Constants.java
@@ -11,4 +11,6 @@ public class Constants {
public static final String PROTOCOL = "neodymiumvirtualjar";
+ public static final boolean KEEP_RENDER_LIST_LOGIC = Boolean.parseBoolean(System.getProperty("neodymium.keepRenderListLogic", "false"));
+
}
diff --git a/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java b/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java
index c430bf6..76593b0 100644
--- a/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java
+++ b/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal.java
@@ -9,6 +9,7 @@ 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.Constants;
import makamys.neodymium.Neodymium;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.client.renderer.WorldRenderer;
@@ -39,7 +40,10 @@ abstract class MixinRenderGlobal {
require = 1)
public void preRenderSortedRenderers(int startRenderer, int numRenderers, int renderPass, double partialTickTime, CallbackInfoReturnable<Integer> cir) {
if(Neodymium.isActive()) {
- cir.setReturnValue(Neodymium.renderer.preRenderSortedRenderers(renderPass, partialTickTime, sortedWorldRenderers));
+ int updated = Neodymium.renderer.preRenderSortedRenderers(renderPass, partialTickTime, sortedWorldRenderers);
+ if(!Constants.KEEP_RENDER_LIST_LOGIC) {
+ cir.setReturnValue(updated);
+ }
}
}
diff --git a/src/main/java/makamys/neodymium/mixin/MixinWorldRenderer.java b/src/main/java/makamys/neodymium/mixin/MixinWorldRenderer.java
index be3cadd..fe6e999 100644
--- a/src/main/java/makamys/neodymium/mixin/MixinWorldRenderer.java
+++ b/src/main/java/makamys/neodymium/mixin/MixinWorldRenderer.java
@@ -2,6 +2,7 @@ package makamys.neodymium.mixin;
import com.google.common.collect.Lists;
import makamys.neodymium.Compat;
+import makamys.neodymium.Constants;
import makamys.neodymium.Neodymium;
import makamys.neodymium.ducks.ITessellator;
import makamys.neodymium.ducks.IWorldRenderer;
@@ -109,7 +110,7 @@ abstract class MixinWorldRenderer implements IWorldRenderer {
target = "Lorg/lwjgl/opengl/GL11;glNewList(II)V"),
require = 1)
private void noNewList(int list, int mode) {
- if (!Neodymium.isActive()) {
+ if (!Neodymium.isActive() || Constants.KEEP_RENDER_LIST_LOGIC) {
GL11.glNewList(list, mode);
}
}
@@ -119,7 +120,7 @@ abstract class MixinWorldRenderer implements IWorldRenderer {
target = "Lorg/lwjgl/opengl/GL11;glEndList()V"),
require = 1)
private void noEndList() {
- if (!Neodymium.isActive())
+ if (!Neodymium.isActive() || Constants.KEEP_RENDER_LIST_LOGIC)
GL11.glEndList();
}