From 43ea0d434806010c21c2ba4fca0f768166989219 Mon Sep 17 00:00:00 2001 From: TataTawa <136007076@qq.com> Date: Mon, 23 Oct 2017 10:07:17 +0800 Subject: [PATCH] Update RenderBlocksCTM.java Now CTM Block work fine with Optifine MultiCore-ChunkLoading !! --- .../java/team/chisel/ctmlib/RenderBlocksCTM.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/team/chisel/ctmlib/RenderBlocksCTM.java b/src/main/java/team/chisel/ctmlib/RenderBlocksCTM.java index 478dd15..81f9b7f 100644 --- a/src/main/java/team/chisel/ctmlib/RenderBlocksCTM.java +++ b/src/main/java/team/chisel/ctmlib/RenderBlocksCTM.java @@ -63,8 +63,8 @@ private Vert(double x, double y, double z) { void render(RenderBlocksCTM inst, ForgeDirection normal, int cacheID) { if (inst.enableAO) { - inst.tessellator.setColorOpaque_F(inst.redCache[cacheID], inst.grnCache[cacheID], inst.bluCache[cacheID]); - inst.tessellator.setBrightness(inst.lightingCache[cacheID]); + Tessellator.instance.setColorOpaque_F(inst.redCache[cacheID], inst.grnCache[cacheID], inst.bluCache[cacheID]); + Tessellator.instance.setBrightness(inst.lightingCache[cacheID]); } u = cacheID == 1 || cacheID == 2 ? inst.maxU : inst.minU; @@ -98,7 +98,7 @@ void render(RenderBlocksCTM inst, ForgeDirection normal, int cacheID) { xDiff = yDiff = zDiff = 1; } - inst.tessellator.addVertexWithUV(inst.renderMinX + (x * xDiff), inst.renderMinY + (y * yDiff), inst.renderMinZ + (z * zDiff), u, v); + Tessellator.instance.addVertexWithUV(inst.renderMinX + (x * xDiff), inst.renderMinY + (y * yDiff), inst.renderMinZ + (z * zDiff), u, v); } } @@ -166,7 +166,6 @@ public RenderBlocksCTM() { renderMaxX = renderMaxY = renderMaxZ = 1; } - protected Tessellator tessellator = Tessellator.instance; protected double minU, maxU; protected double minV, maxV; protected int[] lightingCache = new int[4]; @@ -195,15 +194,15 @@ public boolean renderStandardBlock(Block block, int x, int y, int z) { bz = z; meta = Minecraft.getMinecraft().theWorld.getBlockMetadata(x, y, z); - tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); - tessellator.addTranslation(x, y, z); + Tessellator.instance.setColorOpaque_F(1.0F, 1.0F, 1.0F); + Tessellator.instance.addTranslation(x, y, z); if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) { setOverrideBlockTexture(rendererOld.overrideBlockTexture); } inWorld = true; boolean res = super.renderStandardBlock(block, x, y, z); inWorld = false; - tessellator.addTranslation(-x, -y, -z); + Tessellator.instance.addTranslation(-x, -y, -z); return res; } @@ -497,4 +496,4 @@ protected void pre(ForgeDirection face) { protected void post(ForgeDirection face) { manager.postRenderSide(this, blockAccess, bx, by, bz, face); } -} \ No newline at end of file +}