Fix/improve rendering again

This commit is contained in:
James Seibel
2021-08-05 20:40:12 -05:00
parent 781aa339bc
commit e313a03410
4 changed files with 46 additions and 33 deletions
+11 -15
View File
@@ -20,7 +20,6 @@ package com.seibel.lod.util;
import java.awt.Color;
import java.io.File;
import com.seibel.lod.objects.LodQuadTreeNode;
import com.seibel.lod.objects.RegionPos;
import net.minecraft.client.Minecraft;
@@ -96,21 +95,18 @@ public class LodUtil
public static RegionPos convertChunkPosToRegionPos(ChunkPos pos)
{
RegionPos rPos = new RegionPos();
// rPos.x = pos.x / 512;
// rPos.z = pos.z / 512;
//
// // prevent issues if X/Z is negative and less than 16
// if (pos.x < 0)
// {
// rPos.x = (Math.abs(rPos.x) * -1) - 1;
// }
// if (pos.z < 0)
// {
// rPos.z = (Math.abs(rPos.z) * -1) - 1;
// }
rPos.x = pos.x / 512;
rPos.z = pos.z / 512;
rPos.x = (Math.floorDiv(pos.x, (int) (512/Math.pow(LodQuadTreeNode.CHUNK_LEVEL,2))));
rPos.z = (Math.floorDiv(pos.z, (int) (512/Math.pow(LodQuadTreeNode.CHUNK_LEVEL,2))));
// prevent issues if X/Z is negative and less than 16
if (pos.x < 0)
{
rPos.x = (Math.abs(rPos.x) * -1) - 1;
}
if (pos.z < 0)
{
rPos.z = (Math.abs(rPos.z) * -1) - 1;
}
return rPos;
}