diff options
author | makamys <makamys@outlook.com> | 2022-06-09 13:01:33 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-09 13:01:33 +0200 |
commit | 1cb15f76be86920af5dde287ca6403b5657145ea (patch) | |
tree | eddf7030e41e6de2005174aa2342f36d64e5b3fb /src/main/java/makamys/neodymium/renderer | |
parent | 5bea63de0d78487b91dd701a8f6931b9314f2be5 (diff) | |
download | Neodymium-1cb15f76be86920af5dde287ca6403b5657145ea.tar.gz Neodymium-1cb15f76be86920af5dde287ca6403b5657145ea.tar.bz2 Neodymium-1cb15f76be86920af5dde287ca6403b5657145ea.zip |
Rebrand pt.2: Rename things in code
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer')
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/ChunkMesh.java | 6 | ||||
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java | 6 | ||||
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/NeoChunk.java (renamed from src/main/java/makamys/neodymium/renderer/LODChunk.java) | 24 | ||||
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/NeoRegion.java (renamed from src/main/java/makamys/neodymium/renderer/LODRegion.java) | 30 | ||||
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/NeoRenderer.java (renamed from src/main/java/makamys/neodymium/renderer/LODRenderer.java) | 74 | ||||
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/SimpleChunkMesh.java | 6 |
6 files changed, 73 insertions, 73 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/ChunkMesh.java b/src/main/java/makamys/neodymium/renderer/ChunkMesh.java index 6c4cd59..6d5dc2d 100644 --- a/src/main/java/makamys/neodymium/renderer/ChunkMesh.java +++ b/src/main/java/makamys/neodymium/renderer/ChunkMesh.java @@ -14,7 +14,7 @@ import java.util.stream.Collectors; import org.lwjgl.BufferUtils; -import makamys.neodymium.LODMod; +import makamys.neodymium.Neodymium; import makamys.neodymium.MixinConfigPlugin; import makamys.neodymium.ducks.IWorldRenderer; import makamys.neodymium.util.BufferWriter; @@ -78,12 +78,12 @@ public class ChunkMesh extends Mesh { int yOffset = wr.posY; int zOffset = wr.posZ; - boolean fr = MixinConfigPlugin.isOptiFinePresent() && LODMod.ofFastRender; + boolean fr = MixinConfigPlugin.isOptiFinePresent() && Neodymium.ofFastRender; int tessellatorXOffset = fr ? xOffset : 0; int tessellatorYOffset = fr ? yOffset : 0; int tessellatorZOffset = fr ? zOffset : 0; - boolean optimize = LODMod.optimizeChunkMeshes; + boolean optimize = Neodymium.optimizeChunkMeshes; ChunkMesh.Flags flags = new ChunkMesh.Flags(t.hasTexture, t.hasBrightness, t.hasColor, t.hasNormals); diff --git a/src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java b/src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java index 75b1f64..1bb2623 100644 --- a/src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java +++ b/src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java @@ -6,7 +6,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; -import makamys.neodymium.LODMod; +import makamys.neodymium.Neodymium; import makamys.neodymium.renderer.Mesh.GPUStatus; import makamys.neodymium.util.GuiHelper; @@ -23,7 +23,7 @@ public class GPUMemoryManager { public GPUMemoryManager() { VBO = glGenBuffers(); - bufferSize = LODMod.VRAMSize * 1024 * 1024; + bufferSize = Neodymium.VRAMSize * 1024 * 1024; glBindBuffer(GL_ARRAY_BUFFER, VBO); @@ -109,7 +109,7 @@ public class GPUMemoryManager { if(end() + mesh.bufferSize() >= bufferSize) { System.out.println("VRAM is full! Try increasing the allocated VRAM in the config, if possible. Reverting to vanilla renderer."); - LODMod.renderer.destroyPending = true; + Neodymium.renderer.destroyPending = true; // TODO restart renderer with more VRAM allocated when this happens. return; } diff --git a/src/main/java/makamys/neodymium/renderer/LODChunk.java b/src/main/java/makamys/neodymium/renderer/NeoChunk.java index 5dd3762..1184d84 100644 --- a/src/main/java/makamys/neodymium/renderer/LODChunk.java +++ b/src/main/java/makamys/neodymium/renderer/NeoChunk.java @@ -2,14 +2,14 @@ package makamys.neodymium.renderer; import java.util.List; -import makamys.neodymium.LODMod; +import makamys.neodymium.Neodymium; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagEnd; import net.minecraft.nbt.NBTTagList; import net.minecraft.world.chunk.Chunk; -public class LODChunk { +public class NeoChunk { int x, z; public boolean needsChunk = true; @@ -23,9 +23,9 @@ public class LODChunk { public boolean[] isSectionVisible = new boolean[16]; - LODRenderer renderer = LODMod.renderer; + NeoRenderer renderer = Neodymium.renderer; - public LODChunk(int x, int z) { + public NeoChunk(int x, int z) { this.x = x; this.z = z; } @@ -70,7 +70,7 @@ public class LODChunk { } chunkMeshes[cy * 2 + i] = newChunkMesh; } - LODMod.renderer.lodChunkChanged(this); + Neodymium.renderer.lodChunkChanged(this); dirty = true; discardedMesh = false; } @@ -89,7 +89,7 @@ public class LODChunk { } simpleMeshes[i] = newSimpleMesh; } - LODMod.renderer.lodChunkChanged(this); + Neodymium.renderer.lodChunkChanged(this); } public boolean hasChunkMeshes() { @@ -103,9 +103,9 @@ public class LODChunk { public void tick(Entity player) { double distSq = distSq(player); - if(LODMod.disableSimpleMeshes || distSq < Math.pow((LODMod.renderer.renderRange / 2) * 16, 2)) { + if(Neodymium.disableSimpleMeshes || distSq < Math.pow((Neodymium.renderer.renderRange / 2) * 16, 2)) { setLOD(2); - } else if(distSq < Math.pow((LODMod.renderer.renderRange) * 16, 2)) { + } else if(distSq < Math.pow((Neodymium.renderer.renderRange) * 16, 2)) { setLOD(1); } else { setLOD(0); @@ -116,7 +116,7 @@ public class LODChunk { if(lod == this.lod) return; this.lod = lod; - LODMod.renderer.lodChunkChanged(this); + Neodymium.renderer.lodChunkChanged(this); if(!dirty) { if(lod < 2) { for(int i = 0; i < chunkMeshes.length; i++) { @@ -144,7 +144,7 @@ public class LODChunk { } } else if(oldNbt != null && discardedMesh && lod == 2) { loadChunkMeshesNBT(chunkMeshesCompound, oldStringTable); - LODMod.renderer.lodChunkChanged(this); + Neodymium.renderer.lodChunkChanged(this); } nbt.setTag("chunkMeshes", chunkMeshesCompound); dirty = false; @@ -162,11 +162,11 @@ public class LODChunk { cm.destroy(); } } - LODMod.renderer.setVisible(this, false); + Neodymium.renderer.setVisible(this, false); } public void receiveChunk(Chunk chunk) { - if(!LODMod.disableSimpleMeshes) { + if(!Neodymium.disableSimpleMeshes) { putSimpleMeshes(SimpleChunkMesh.generateSimpleMeshes(chunk)); } } diff --git a/src/main/java/makamys/neodymium/renderer/LODRegion.java b/src/main/java/makamys/neodymium/renderer/NeoRegion.java index 22316f7..c670525 100644 --- a/src/main/java/makamys/neodymium/renderer/LODRegion.java +++ b/src/main/java/makamys/neodymium/renderer/NeoRegion.java @@ -12,7 +12,7 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; -import makamys.neodymium.LODMod; +import makamys.neodymium.Neodymium; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; @@ -22,19 +22,19 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.util.Constants.NBT; -public class LODRegion { +public class NeoRegion { - private LODChunk[][] data = new LODChunk[32][32]; + private NeoChunk[][] data = new NeoChunk[32][32]; int regionX, regionZ; - public LODRegion(int regionX, int regionZ) { + public NeoRegion(int regionX, int regionZ) { this.regionX = regionX; this.regionZ = regionZ; for(int i = 0; i < 32; i++) { for(int j = 0; j < 32; j++) { - data[i][j] = new LODChunk(regionX * 32 + i, regionZ * 32 + j); + data[i][j] = new NeoChunk(regionX * 32 + i, regionZ * 32 + j); } } } @@ -51,14 +51,14 @@ public class LODRegion { for(int j = 0; j < 32; j++) { data[i][j] = new LODChunk(list.getCompoundTagAt(idx++), stringTable); if(data[i][j].hasChunkMeshes()) { - LODMod.renderer.setVisible(data[i][j], true); + Neodymium.renderer.setVisible(data[i][j], true); } } } } */ - public static LODRegion load(Path saveDir, int regionX, int regionZ) { - /*if(!(LODMod.disableChunkMeshes || !LODMod.saveMeshes)) { + public static NeoRegion load(Path saveDir, int regionX, int regionZ) { + /*if(!(.disableChunkMeshes || !.saveMeshes)) { File saveFile = getSavePath(saveDir, regionX, regionZ).toFile(); if(saveFile.exists()) { try { @@ -69,7 +69,7 @@ public class LODRegion { } } }*/ - return new LODRegion(regionX, regionZ); + return new NeoRegion(regionX, regionZ); } /* private static Path getSavePath(Path saveDir, int regionX, int regionZ) { @@ -77,7 +77,7 @@ public class LODRegion { } public void save(Path saveDir) { - if(LODMod.disableChunkMeshes || !LODMod.saveMeshes) return; + if(.disableChunkMeshes || !.saveMeshes) return; try { File saveFile = getSavePath(saveDir, regionX, regionZ).toFile(); @@ -128,11 +128,11 @@ public class LODRegion { } } */ - public LODChunk getChunkAbsolute(int chunkXAbs, int chunkZAbs) { + public NeoChunk getChunkAbsolute(int chunkXAbs, int chunkZAbs) { return getChunk(chunkXAbs - regionX * 32, chunkZAbs - regionZ * 32); } - public LODChunk getChunk(int x, int z) { + public NeoChunk getChunk(int x, int z) { if(x >= 0 && x < 32 && z >= 0 && z < 32) { return data[x][z]; } else { @@ -140,7 +140,7 @@ public class LODRegion { } } - public LODChunk putChunk(Chunk chunk) { + public NeoChunk putChunk(Chunk chunk) { int relX = chunk.xPosition - regionX * 32; int relZ = chunk.zPosition - regionZ * 32; @@ -155,7 +155,7 @@ public class LODRegion { int visibleChunks = 0; for(int i = 0; i < 32; i++) { for(int j = 0; j < 32; j++) { - LODChunk chunk = data[i][j]; + NeoChunk chunk = data[i][j]; if(chunk != null) { chunk.tick(player); if(chunk.visible) { @@ -171,7 +171,7 @@ public class LODRegion { //save(saveDir); for(int i = 0; i < 32; i++) { for(int j = 0; j < 32; j++) { - LODChunk chunk = data[i][j]; + NeoChunk chunk = data[i][j]; if(chunk != null) { chunk.destroy(); } diff --git a/src/main/java/makamys/neodymium/renderer/LODRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java index 974c408..708a9db 100644 --- a/src/main/java/makamys/neodymium/renderer/LODRenderer.java +++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java @@ -40,7 +40,7 @@ import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import org.lwjgl.util.vector.Matrix4f; -import makamys.neodymium.LODMod; +import makamys.neodymium.Neodymium; import makamys.neodymium.ducks.IWorldRenderer; import makamys.neodymium.renderer.Mesh.GPUStatus; import makamys.neodymium.util.GuiHelper; @@ -52,7 +52,7 @@ import static org.lwjgl.opengl.GL15.*; import static org.lwjgl.opengl.GL20.*; import static org.lwjgl.opengl.GL30.*; -public class LODRenderer { +public class NeoRenderer { public boolean hasInited = false; public boolean destroyPending; @@ -73,10 +73,10 @@ public class LODRenderer { GPUMemoryManager mem; List<Chunk> myChunks = new ArrayList<Chunk>(); - List<LODChunk> pendingLODChunks = new ArrayList<>(); + List<NeoChunk> pendingLODChunks = new ArrayList<>(); private boolean hasServerInited = false; - private Map<ChunkCoordIntPair, LODRegion> loadedRegionsMap = new HashMap<>(); + private Map<ChunkCoordIntPair, NeoRegion> loadedRegionsMap = new HashMap<>(); public World world; @@ -101,7 +101,7 @@ public class LODRenderer { private boolean freezeMeshes; - public LODRenderer(World world){ + public NeoRenderer(World world){ this.world = world; if(shouldRenderInWorld(world)) { hasInited = init(); @@ -114,7 +114,7 @@ public class LODRenderer { public void preRenderSortedRenderers(int renderPass, double alpha, WorldRenderer[] sortedWorldRenderers) { if(renderPass != 0) return; - LODMod.fogEventWasPosted = false; + Neodymium.fogEventWasPosted = false; renderedMeshes = 0; @@ -129,13 +129,13 @@ public class LODRenderer { mem.runGC(false); } lastGCTime = System.currentTimeMillis(); - if(lastSaveTime == -1 || (System.currentTimeMillis() - lastSaveTime) > saveInterval && LODMod.saveMeshes) { + if(lastSaveTime == -1 || (System.currentTimeMillis() - lastSaveTime) > saveInterval && Neodymium.saveMeshes) { onSave(); lastSaveTime = System.currentTimeMillis(); } if(rendererActive && renderWorld) { - if(frameCount % LODMod.sortFrequency == 0) { + if(frameCount % Neodymium.sortFrequency == 0) { sort(); } @@ -152,7 +152,7 @@ public class LODRenderer { public void onRenderTickEnd() { if(destroyPending) { - LODMod.renderer = null; + Neodymium.renderer = null; return; } if(showMemoryDebugger && mem != null) { @@ -182,7 +182,7 @@ public class LODRenderer { piFirst[i].limit(sentMeshes[i].size()); piCount[i].limit(sentMeshes[i].size()); for(Mesh mesh : sentMeshes[i]) { - if(mesh.visible && (LODMod.maxMeshesPerFrame == -1 || renderedMeshes < LODMod.maxMeshesPerFrame)) { + if(mesh.visible && (Neodymium.maxMeshesPerFrame == -1 || renderedMeshes < Neodymium.maxMeshesPerFrame)) { renderedMeshes++; piFirst[i].put(mesh.iFirst); piCount[i].put(mesh.iCount); @@ -195,7 +195,7 @@ public class LODRenderer { private void mainLoop() { while(!farChunks.isEmpty()) { - LODChunk lodChunk = receiveFarChunk(farChunks.remove()); + NeoChunk lodChunk = receiveFarChunk(farChunks.remove()); sendChunkToGPU(lodChunk); } @@ -229,7 +229,7 @@ public class LODRenderer { lastSortZ = player.posZ; for(Iterator<ChunkCoordIntPair> it = loadedRegionsMap.keySet().iterator(); it.hasNext();) { ChunkCoordIntPair k = it.next(); - LODRegion v = loadedRegionsMap.get(k); + NeoRegion v = loadedRegionsMap.get(k); if(v.distanceTaxicab(player) > renderRange * 16 + 16 * 16) { System.out.println("unloading " + v); @@ -244,19 +244,19 @@ public class LODRenderer { } public float getFarPlaneDistanceMultiplier() { - return (float)LODMod.farPlaneDistanceMultiplier; + return (float)Neodymium.farPlaneDistanceMultiplier; } public void afterSetupFog(int mode, float alpha, float farPlaneDistance) { EntityLivingBase entity = Minecraft.getMinecraft().renderViewEntity; - if(LODMod.fogEventWasPosted && !Minecraft.getMinecraft().theWorld.provider.doesXZShowFog((int)entity.posX, (int)entity.posZ)) { - GL11.glFogf(GL11.GL_FOG_START, mode < 0 ? 0 : farPlaneDistance * (float)LODMod.fogStart); - GL11.glFogf(GL11.GL_FOG_END, mode < 0 ? farPlaneDistance/4 : farPlaneDistance * (float)LODMod.fogEnd); + if(Neodymium.fogEventWasPosted && !Minecraft.getMinecraft().theWorld.provider.doesXZShowFog((int)entity.posX, (int)entity.posZ)) { + GL11.glFogf(GL11.GL_FOG_START, mode < 0 ? 0 : farPlaneDistance * (float)Neodymium.fogStart); + GL11.glFogf(GL11.GL_FOG_END, mode < 0 ? farPlaneDistance/4 : farPlaneDistance * (float)Neodymium.fogEnd); } } private void handleKeyboard() { - if(LODMod.debugPrefix == 0 || (LODMod.debugPrefix != -1 && Keyboard.isKeyDown(LODMod.debugPrefix))) { + if(Neodymium.debugPrefix == 0 || (Neodymium.debugPrefix != -1 && Keyboard.isKeyDown(Neodymium.debugPrefix))) { if(Keyboard.isKeyDown(Keyboard.KEY_F) && !wasDown[Keyboard.KEY_F]) { rendererActive = !rendererActive; } @@ -421,7 +421,7 @@ public class LODRenderer { int fragmentShader; fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); - glShaderSource(fragmentShader, Util.readFile(LODMod.enableFog ? "shaders/chunk_fog.frag" : "shaders/chunk.frag")); + glShaderSource(fragmentShader, Util.readFile(Neodymium.enableFog ? "shaders/chunk_fog.frag" : "shaders/chunk.frag")); glCompileShader(fragmentShader); if(glGetShaderi(fragmentShader, GL_COMPILE_STATUS) == 0) { @@ -458,7 +458,7 @@ public class LODRenderer { int x = Math.floorDiv(wr.posX, 16); int y = Math.floorDiv(wr.posY, 16); int z = Math.floorDiv(wr.posZ, 16); - LODChunk lodChunk = getLODChunk(x, z); + NeoChunk lodChunk = getLODChunk(x, z); lodChunk.isSectionVisible[y] = change == WorldRendererChange.VISIBLE; if(change == WorldRendererChange.DELETED) { @@ -468,14 +468,14 @@ public class LODRenderer { } public void onWorldRendererPost(WorldRenderer wr) { - if(LODMod.disableChunkMeshes) return; + if(Neodymium.disableChunkMeshes) return; int x = Math.floorDiv(wr.posX, 16); int y = Math.floorDiv(wr.posY, 16); int z = Math.floorDiv(wr.posZ, 16); if(Minecraft.getMinecraft().theWorld.getChunkFromChunkCoords(x, z).isChunkLoaded) { - LODChunk lodChunk = getLODChunk(x, z); + NeoChunk lodChunk = getLODChunk(x, z); lodChunk.isSectionVisible[y] = ((IWorldRenderer)wr).isDrawn(); lodChunk.putChunkMeshes(y, ((IWorldRenderer)wr).getChunkMeshes()); } @@ -489,12 +489,12 @@ public class LODRenderer { serverChunkLoadQueue.addAll(coords); } - private LODChunk receiveFarChunk(Chunk chunk) { - LODRegion region = getRegionContaining(chunk.xPosition, chunk.zPosition); + private NeoChunk receiveFarChunk(Chunk chunk) { + NeoRegion region = getRegionContaining(chunk.xPosition, chunk.zPosition); return region.putChunk(chunk); } - private LODChunk getLODChunk(int chunkX, int chunkZ) { + private NeoChunk getLODChunk(int chunkX, int chunkZ) { return getRegionContaining(chunkX, chunkZ).getChunkAbsolute(chunkX, chunkZ); } @@ -503,7 +503,7 @@ public class LODRenderer { } public synchronized void serverTick() { - int chunkLoadsRemaining = LODMod.chunkLoadsPerTick; + int chunkLoadsRemaining = Neodymium.chunkLoadsPerTick; while(!serverChunkLoadQueue.isEmpty() && chunkLoadsRemaining-- > 0) { ChunkCoordIntPair coords = serverChunkLoadQueue.remove(0); ChunkProviderServer chunkProviderServer = Minecraft.getMinecraft().getIntegratedServer().worldServerForDimension(world.provider.dimensionId).theChunkProviderServer; @@ -513,36 +513,36 @@ public class LODRenderer { } } - private LODRegion getRegionContaining(int chunkX, int chunkZ) { + private NeoRegion getRegionContaining(int chunkX, int chunkZ) { ChunkCoordIntPair key = new ChunkCoordIntPair(Math.floorDiv(chunkX , 32), Math.floorDiv(chunkZ, 32)); - LODRegion region = loadedRegionsMap.get(key); + NeoRegion region = loadedRegionsMap.get(key); if(region == null) { - region = LODRegion.load(getSaveDir(), Math.floorDiv(chunkX , 32), Math.floorDiv(chunkZ , 32)); + region = NeoRegion.load(getSaveDir(), Math.floorDiv(chunkX , 32), Math.floorDiv(chunkZ , 32)); loadedRegionsMap.put(key, region); } return region; } - private void sendChunkToGPU(LODChunk lodChunk) { + private void sendChunkToGPU(NeoChunk lodChunk) { Entity player = Minecraft.getMinecraft().renderViewEntity; lodChunk.tick(player); setVisible(lodChunk, true, true); } - public void setVisible(LODChunk chunk, boolean visible) { + public void setVisible(NeoChunk chunk, boolean visible) { setVisible(chunk, visible, false); } - public void setVisible(LODChunk lodChunk, boolean visible, boolean forceCheck) { + public void setVisible(NeoChunk lodChunk, boolean visible, boolean forceCheck) { if(!forceCheck && visible == lodChunk.visible) return; lodChunk.visible = visible; lodChunkChanged(lodChunk); } - public void lodChunkChanged(LODChunk lodChunk) { - int newLOD = (!lodChunk.hasChunkMeshes() && lodChunk.lod == 2) ? (LODMod.disableSimpleMeshes ? 0 : 1) : lodChunk.lod; + public void lodChunkChanged(NeoChunk lodChunk) { + int newLOD = (!lodChunk.hasChunkMeshes() && lodChunk.lod == 2) ? (Neodymium.disableSimpleMeshes ? 0 : 1) : lodChunk.lod; for(SimpleChunkMesh sm : lodChunk.simpleMeshes) { if(sm != null) { if(lodChunk.isFullyVisible() && newLOD == 1) { @@ -641,14 +641,14 @@ public class LODRenderer { } private Path getSaveDir(){ - return Minecraft.getMinecraft().mcDataDir.toPath().resolve("lodmod").resolve(Minecraft.getMinecraft().getIntegratedServer().getFolderName()); + return Minecraft.getMinecraft().mcDataDir.toPath().resolve("neodymium").resolve(Minecraft.getMinecraft().getIntegratedServer().getFolderName()); } private boolean shouldRenderInWorld(World world) { return world != null && !world.provider.isHellWorld; } - public static class LODChunkComparator implements Comparator<LODChunk> { + public static class LODChunkComparator implements Comparator<NeoChunk> { Entity player; public LODChunkComparator(Entity player) { @@ -656,13 +656,13 @@ public class LODRenderer { } @Override - public int compare(LODChunk p1, LODChunk p2) { + public int compare(NeoChunk p1, NeoChunk p2) { int distSq1 = distSq(p1); int distSq2 = distSq(p2); return distSq1 < distSq2 ? -1 : distSq1 > distSq2 ? 1 : 0; } - int distSq(LODChunk p) { + int distSq(NeoChunk p) { return (int)( Math.pow(((p.x * 16) - player.chunkCoordX), 2) + Math.pow(((p.z * 16) - player.chunkCoordZ), 2) diff --git a/src/main/java/makamys/neodymium/renderer/SimpleChunkMesh.java b/src/main/java/makamys/neodymium/renderer/SimpleChunkMesh.java index 964dec8..44031d4 100644 --- a/src/main/java/makamys/neodymium/renderer/SimpleChunkMesh.java +++ b/src/main/java/makamys/neodymium/renderer/SimpleChunkMesh.java @@ -16,7 +16,7 @@ import java.util.List; import org.lwjgl.BufferUtils; -import makamys.neodymium.LODMod; +import makamys.neodymium.Neodymium; import makamys.neodymium.util.MCUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockGrass; @@ -45,7 +45,7 @@ public class SimpleChunkMesh extends Mesh { } private static boolean isBad(Block block) { - for(Class clazz : LODMod.blockClassBlacklist) { + for(Class clazz : Neodymium.blockClassBlacklist) { if(clazz.isInstance(block)) { return true; } @@ -126,7 +126,7 @@ public class SimpleChunkMesh extends Mesh { } color = (0xFF << 24) | ((color >> 16 & 0xFF) << 0) | ((color >> 8 & 0xFF) << 8) | ((color >> 0 & 0xFF) << 16); - if((LODMod.forceVanillaBiomeTemperature ? MCUtil.getBiomeTemperatureVanilla(biome, worldX, y, worldZ) + if((Neodymium.forceVanillaBiomeTemperature ? MCUtil.getBiomeTemperatureVanilla(biome, worldX, y, worldZ) : biome.getFloatTemperature(worldX, y, worldZ)) < 0.15f) { builder.addCube(divX, divZ, worldY + 0.2f, 1f, Blocks.snow_layer.getIcon(1, 0), 0xFFFFFFFF, brightnessMult); |