Skip to content

Now CTM Block work fine with Optifine MultiCore-ChunkLoading !! #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/main/java/team/chisel/ctmlib/RenderBlocksCTM.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -497,4 +496,4 @@ protected void pre(ForgeDirection face) {
protected void post(ForgeDirection face) {
manager.postRenderSide(this, blockAccess, bx, by, bz, face);
}
}
}