aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-25 17:30:14 +0200
committermakamys <makamys@outlook.com>2022-06-25 17:31:39 +0200
commit993ae21251face5a7de2e6647f1fdb7682d7a19b (patch)
treec9690dd9ea8d0e98e949bfef27246a9746c759a1 /src/main/java
parent7e78f2ebcc2428d21d1c7549d5b5949c36c6682b (diff)
downloadNeodymium-993ae21251face5a7de2e6647f1fdb7682d7a19b.tar.gz
Neodymium-993ae21251face5a7de2e6647f1fdb7682d7a19b.tar.bz2
Neodymium-993ae21251face5a7de2e6647f1fdb7682d7a19b.zip
Implement OF Fast Render compat properly
Fixes chunks disappearing when you go beyond max(abs(XZ))>2000
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/makamys/neodymium/Neodymium.java15
-rw-r--r--src/main/java/makamys/neodymium/renderer/ChunkMesh.java7
-rw-r--r--src/main/java/makamys/neodymium/renderer/MeshQuad.java4
3 files changed, 3 insertions, 23 deletions
diff --git a/src/main/java/makamys/neodymium/Neodymium.java b/src/main/java/makamys/neodymium/Neodymium.java
index ce2f8eb..d47d03a 100644
--- a/src/main/java/makamys/neodymium/Neodymium.java
+++ b/src/main/java/makamys/neodymium/Neodymium.java
@@ -42,9 +42,6 @@ public class Neodymium
public static NeoRenderer renderer;
- public static boolean ofFastRender;
- private static Method ofIsFastRenderMethod;
-
@EventHandler
public void preInit(FMLConstructionEvent event) {
MCLib.init();
@@ -122,18 +119,6 @@ public class Neodymium
if(!Config.enabled) return;
if(event.phase == TickEvent.Phase.START) {
- if(OFUtil.isOptiFinePresent()) {
- try {
- if(ofIsFastRenderMethod == null) {
- ofIsFastRenderMethod = Class.forName("Config").getMethod("isFastRender");
- }
- ofFastRender = (boolean)ofIsFastRenderMethod.invoke(null);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
- | SecurityException | ClassNotFoundException e) {
- // oops
- }
- }
-
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
World world = player != null ? player.worldObj : null;
if(world != getRendererWorld()) {
diff --git a/src/main/java/makamys/neodymium/renderer/ChunkMesh.java b/src/main/java/makamys/neodymium/renderer/ChunkMesh.java
index 26429a7..3971c65 100644
--- a/src/main/java/makamys/neodymium/renderer/ChunkMesh.java
+++ b/src/main/java/makamys/neodymium/renderer/ChunkMesh.java
@@ -72,17 +72,12 @@ public class ChunkMesh extends Mesh {
int yOffset = wr.posY;
int zOffset = wr.posZ;
- boolean fr = OFUtil.isOptiFinePresent() && Neodymium.ofFastRender;
- int tessellatorXOffset = fr ? 0 : xOffset;
- int tessellatorYOffset = fr ? 0 : yOffset;
- int tessellatorZOffset = fr ? 0 : zOffset;
-
ChunkMesh.Flags flags = new ChunkMesh.Flags(t.hasTexture, t.hasBrightness, t.hasColor, t.hasNormals);
quadBuf.reset();
for(int quadI = 0; quadI < t.vertexCount / 4; quadI++) {
- quadBuf.next().setState(t.rawBuffer, quadI * 32, flags, tessellatorXOffset, tessellatorYOffset, tessellatorZOffset);
+ quadBuf.next().setState(t.rawBuffer, quadI * 32, flags, (float)-t.xOffset, (float)-t.yOffset, (float)-t.zOffset);
}
List<MeshQuad> quads = quadBuf.getAsList();
diff --git a/src/main/java/makamys/neodymium/renderer/MeshQuad.java b/src/main/java/makamys/neodymium/renderer/MeshQuad.java
index 71daf1a..d33bc75 100644
--- a/src/main/java/makamys/neodymium/renderer/MeshQuad.java
+++ b/src/main/java/makamys/neodymium/renderer/MeshQuad.java
@@ -66,7 +66,7 @@ public class MeshQuad {
private static Vector3f vectorB = new Vector3f();
private static Vector3f vectorC = new Vector3f();
- private void read(int[] rawBuffer, int offset, int offsetX, int offsetY, int offsetZ) {
+ private void read(int[] rawBuffer, int offset, float offsetX, float offsetY, float offsetZ) {
for(int vi = 0; vi < 4; vi++) {
int i = offset + vi * 8;
@@ -84,7 +84,7 @@ public class MeshQuad {
}
}
- public void setState(int[] rawBuffer, int offset, ChunkMesh.Flags flags, int offsetX, int offsetY, int offsetZ) {
+ public void setState(int[] rawBuffer, int offset, ChunkMesh.Flags flags, float offsetX, float offsetY, float offsetZ) {
resetState();
read(rawBuffer, offset, offsetX, offsetY, offsetZ);