2014-12-15 00:11:48 +00:00
|
|
|
package com.cricketcraft.chisel.client.render;
|
2014-04-21 19:13:15 +01:00
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
|
import net.minecraft.client.renderer.RenderBlocks;
|
|
|
|
|
import net.minecraft.client.renderer.Tessellator;
|
|
|
|
|
import net.minecraft.util.IIcon;
|
|
|
|
|
|
2015-02-18 15:27:57 -05:00
|
|
|
import static com.cricketcraft.chisel.client.render.RenderBlocksCTM.Vert.*;
|
|
|
|
|
import static com.cricketcraft.chisel.client.render.RenderBlocksCTM.SubSide.*;
|
2015-02-20 00:32:05 -05:00
|
|
|
import static com.cricketcraft.chisel.client.render.RenderBlocksCTM.Vert.Y_HALF_X;
|
2015-02-18 15:27:57 -05:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
public class RenderBlocksCTM extends RenderBlocks {
|
|
|
|
|
|
2015-02-18 15:27:57 -05:00
|
|
|
/**
|
|
|
|
|
* An enum for all possible 26 sub-side vertices.
|
|
|
|
|
* <p>
|
|
|
|
|
* The naming scheme is as follows:
|
|
|
|
|
* <ul>
|
|
|
|
|
* <li>ZERO and ONE are special cases, they are the absolute min and absolute max of the block.</li>
|
|
|
|
|
* <li>X, Y, Z, or any combination means that the axes listed in the name are at 1.</li>
|
|
|
|
|
* <li>X, Y, Z, or any combination followed by HALF means that those axes are at 0.5.</li>
|
|
|
|
|
* <li>X, Y, Z, or any combination after a HALF means those axes are at 1.</li>
|
|
|
|
|
* </ul>
|
|
|
|
|
*/
|
|
|
|
|
enum Vert {
|
|
|
|
|
|
|
|
|
|
ZERO(0, 0, 0),
|
2015-02-20 00:32:05 -05:00
|
|
|
XYZ(1, 1, 1),
|
2015-02-18 15:27:57 -05:00
|
|
|
X(1, 0, 0),
|
|
|
|
|
Y(0, 1, 0),
|
|
|
|
|
Z(0, 0, 1),
|
|
|
|
|
XY(1, 1, 0),
|
|
|
|
|
YZ(0, 1, 1),
|
|
|
|
|
XZ(1, 0, 1),
|
|
|
|
|
X_HALF(0.5, 0, 0),
|
|
|
|
|
Y_HALF(0, 0.5, 0),
|
|
|
|
|
Z_HALF(0, 0, 0.5),
|
|
|
|
|
XY_HALF(0.5, 0.5, 0),
|
|
|
|
|
YZ_HALF(0, 0.5, 0.5),
|
|
|
|
|
XZ_HALF(0.5, 0, 0.5),
|
|
|
|
|
X_HALF_Y(0.5, 1, 0),
|
|
|
|
|
X_HALF_Z(0.5, 0, 1),
|
|
|
|
|
Y_HALF_X(1, 0.5, 0),
|
|
|
|
|
Y_HALF_Z(0, 0.5, 1),
|
|
|
|
|
Z_HALF_X(1, 0, 0.5),
|
|
|
|
|
Z_HALF_Y(0, 1, 0.5),
|
|
|
|
|
X_HALF_YZ(0.5, 1, 1),
|
|
|
|
|
Y_HALF_XZ(1, 0.5, 1),
|
|
|
|
|
Z_HALF_XY(1, 1, 0.5),
|
|
|
|
|
XY_HALF_Z(0.5, 0.5, 1),
|
|
|
|
|
YZ_HALF_X(1, 0.5, 0.5),
|
|
|
|
|
XZ_HALF_Y(0.5, 1, 0.5);
|
|
|
|
|
|
|
|
|
|
private double x, y, z;
|
|
|
|
|
|
|
|
|
|
private Vert(double x, double y, double z) {
|
|
|
|
|
this.x = x;
|
|
|
|
|
this.y = y;
|
|
|
|
|
this.z = z;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void render(RenderBlocksCTM inst, int cacheID) {
|
|
|
|
|
if (inst.enableAO) {
|
|
|
|
|
// inst.tessellator.setColorOpaque_F(inst.redCache[cacheID], inst.greenCache[cacheID], inst.blueCache[cacheID]);
|
|
|
|
|
inst.tessellator.setBrightness(inst.lightingCache[cacheID]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inst.tessellator.addVertexWithUV(x, y, z, inst.uCache[cacheID], inst.vCache[cacheID]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Each side is divided into 4 sub-sides. LB(left bottom), RB(right bottom), LT(right top), and RT(right top).
|
|
|
|
|
* <p>
|
|
|
|
|
* Each sub-side contains 4 {@link Vert} objects representing its position on the block.
|
|
|
|
|
*/
|
|
|
|
|
enum SubSide {
|
2015-02-20 00:32:05 -05:00
|
|
|
XNEG_LB(ZERO, Z_HALF, YZ_HALF, Y_HALF), XNEG_RB(Z_HALF, Z, Y_HALF_Z, YZ_HALF), XNEG_RT(YZ_HALF, Y_HALF_Z, YZ, Z_HALF_Y), XNEG_LT(Y_HALF, YZ_HALF, Z_HALF_Y, Y),
|
|
|
|
|
XPOS_LB(XZ, Z_HALF_X, YZ_HALF_X, Y_HALF_XZ), XPOS_RB(Z_HALF_X, X, Y_HALF_X, YZ_HALF_X), XPOS_RT(YZ_HALF_X, Y_HALF_X, XY, Z_HALF_XY), XPOS_LT(Y_HALF_XZ, YZ_HALF_X, Z_HALF_XY, XYZ),
|
|
|
|
|
|
|
|
|
|
ZNEG_LB(X, X_HALF, XY_HALF, Y_HALF_X), ZNEG_RB(X_HALF, ZERO, Y_HALF, XY_HALF), ZNEG_RT(XY_HALF, Y_HALF, Y, X_HALF_Y), ZNEG_LT(Y_HALF_X, XY_HALF, X_HALF_Y, XY),
|
|
|
|
|
ZPOS_LB(Z, X_HALF_Z, XY_HALF_Z, Y_HALF_Z), ZPOS_RB(X_HALF_Z, XZ, Y_HALF_XZ, XY_HALF_Z), ZPOS_RT(XY_HALF_Z, Y_HALF_XZ, XYZ, X_HALF_YZ), ZPOS_LT(Y_HALF_Z, XY_HALF_Z, X_HALF_YZ, YZ),
|
|
|
|
|
|
|
|
|
|
YNEG_LB(ZERO, X_HALF, XZ_HALF, Z_HALF), YNEG_RB(X_HALF, X, Z_HALF_X, XZ_HALF), YNEG_RT(XZ_HALF, Z_HALF_X, XZ, X_HALF_Z), YNEG_LT(Z_HALF, XZ_HALF, X_HALF_Z, Z);
|
2015-02-18 15:27:57 -05:00
|
|
|
|
|
|
|
|
private Vert xmin, xmax, ymin, ymax;
|
|
|
|
|
|
|
|
|
|
SubSide(Vert xmin, Vert ymin, Vert ymax, Vert xmax) {
|
|
|
|
|
this.xmin = xmin;
|
|
|
|
|
this.ymin = ymin;
|
|
|
|
|
this.ymax = ymax;
|
|
|
|
|
this.xmax = xmax;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void render(RenderBlocksCTM inst) {
|
|
|
|
|
xmin.render(inst, 0);
|
|
|
|
|
ymin.render(inst, 1);
|
|
|
|
|
ymax.render(inst, 2);
|
|
|
|
|
xmax.render(inst, 3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
// globals added to save the JVM some trouble. No need to constantly create
|
|
|
|
|
// and destroy ints if we don't have to
|
|
|
|
|
int blockLightBitChannel = 0;
|
|
|
|
|
int redBitChannel = 0;
|
|
|
|
|
int greenBitChannel = 0;
|
|
|
|
|
int blueBitChannel = 0;
|
|
|
|
|
int sunlightBitChannel = 0;
|
|
|
|
|
|
|
|
|
|
RenderBlocksCTM() {
|
|
|
|
|
super();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Tessellator tessellator;
|
2015-02-18 15:27:57 -05:00
|
|
|
double[] uCache = new double[4];
|
|
|
|
|
double[] vCache = new double[4];
|
|
|
|
|
int[] lightingCache = new int[4];
|
|
|
|
|
float[] redCache = new float[4];
|
|
|
|
|
float[] greenCache = new float[4];
|
|
|
|
|
float[] blueCache = new float[4];
|
2015-01-07 19:50:18 -05:00
|
|
|
TextureSubmap submap;
|
|
|
|
|
TextureSubmap submapSmall;
|
|
|
|
|
RenderBlocks rendererOld;
|
|
|
|
|
|
2015-02-20 00:32:05 -05:00
|
|
|
int[][] lightmap = new int[3][3];
|
|
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
int bx, by, bz;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean renderStandardBlock(Block block, int x, int y, int z) {
|
|
|
|
|
bx = x;
|
|
|
|
|
by = y;
|
|
|
|
|
bz = z;
|
|
|
|
|
|
|
|
|
|
tessellator = Tessellator.instance;
|
|
|
|
|
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
|
|
|
|
|
|
|
|
|
|
tessellator.addTranslation(x, y, z);
|
|
|
|
|
|
|
|
|
|
boolean res = super.renderStandardBlock(block, x, y, z);
|
|
|
|
|
|
|
|
|
|
tessellator.addTranslation(-x, -y, -z);
|
|
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-20 00:32:05 -05:00
|
|
|
|
|
|
|
|
/* This method fills a 3x3 grid of light values based on the four corners, by averaging them together.
|
|
|
|
|
*
|
|
|
|
|
* 2 TL x TR
|
|
|
|
|
*
|
|
|
|
|
* 1 x x x
|
|
|
|
|
*
|
|
|
|
|
* 0 BL x BR
|
|
|
|
|
* 0 1 2
|
|
|
|
|
*
|
|
|
|
|
* Note: Variable names mean nothing... don't touch
|
|
|
|
|
*
|
|
|
|
|
* ._.
|
|
|
|
|
*
|
|
|
|
|
* shakes fist in anger
|
|
|
|
|
*/
|
|
|
|
|
void fillLightmap(int bottomLeft, int bottomRight, int topRight, int topLeft) {
|
|
|
|
|
lightmap[0][0] = bottomRight;
|
|
|
|
|
lightmap[2][0] = topRight;
|
|
|
|
|
lightmap[2][2] = topLeft;
|
|
|
|
|
lightmap[0][2] = bottomLeft;
|
|
|
|
|
|
|
|
|
|
lightmap[1][0] = avg(bottomRight, topRight);
|
|
|
|
|
lightmap[2][1] = avg(topRight, topLeft);
|
|
|
|
|
lightmap[1][2] = avg(topLeft, bottomLeft);
|
|
|
|
|
lightmap[0][1] = avg(bottomLeft, bottomRight);
|
|
|
|
|
|
|
|
|
|
lightmap[1][1] = avg(bottomLeft, bottomRight, topRight, topLeft);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getLight(int x, int y) {
|
|
|
|
|
lightingCache[0] = lightmap[0+x][0+y];
|
|
|
|
|
lightingCache[1] = lightmap[1+x][0+y];
|
|
|
|
|
lightingCache[2] = lightmap[1+x][1+y];
|
|
|
|
|
lightingCache[3] = lightmap[0+x][1+y];
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-18 15:27:57 -05:00
|
|
|
void updateLighting() {
|
2015-02-20 00:32:05 -05:00
|
|
|
//nop
|
2015-01-07 19:50:18 -05:00
|
|
|
}
|
|
|
|
|
|
2015-02-18 15:27:57 -05:00
|
|
|
/**
|
2015-02-20 00:32:05 -05:00
|
|
|
* This works around a bug in CLC atm
|
2015-01-07 19:50:18 -05:00
|
|
|
*/
|
2015-02-20 00:32:05 -05:00
|
|
|
int avg(int... lightVals) {
|
2015-01-07 19:50:18 -05:00
|
|
|
blockLightBitChannel = 0;
|
|
|
|
|
redBitChannel = 0;
|
|
|
|
|
greenBitChannel = 0;
|
|
|
|
|
blueBitChannel = 0;
|
|
|
|
|
sunlightBitChannel = 0;
|
|
|
|
|
|
|
|
|
|
for (int light : lightVals) {
|
|
|
|
|
blockLightBitChannel += (light & 0xFF);
|
|
|
|
|
redBitChannel += (light & 0xF00);
|
|
|
|
|
greenBitChannel += (light & 0xF000);
|
|
|
|
|
blueBitChannel += (light & 0xF0000);
|
|
|
|
|
sunlightBitChannel += (light & 0xF00000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ((blockLightBitChannel / lightVals.length) & 0xFF) | ((redBitChannel / lightVals.length) & 0xF00) | ((greenBitChannel / lightVals.length) & 0xF000)
|
|
|
|
|
| ((blueBitChannel / lightVals.length) & 0xF0000) | ((sunlightBitChannel / lightVals.length) & 0xF00000);
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-18 15:27:57 -05:00
|
|
|
void side(SubSide side, int iconIndex, boolean flip) {
|
2015-01-07 19:50:18 -05:00
|
|
|
IIcon icon = iconIndex >= 16 ? submapSmall.icons[iconIndex - 16] : submap.icons[iconIndex];
|
|
|
|
|
|
2015-02-18 15:27:57 -05:00
|
|
|
double umax = icon.getMaxU();
|
|
|
|
|
double umin = icon.getMinU();
|
|
|
|
|
double vmax = icon.getMaxV();
|
|
|
|
|
double vmin = icon.getMinV();
|
2015-01-07 19:50:18 -05:00
|
|
|
|
2015-02-18 15:27:57 -05:00
|
|
|
uCache[0] = flip ? umax : umin;
|
|
|
|
|
uCache[1] = umax;
|
|
|
|
|
uCache[2] = flip ? umin : umax;
|
|
|
|
|
uCache[3] = umin;
|
|
|
|
|
|
|
|
|
|
vCache[0] = flip ? vmin : vmax;
|
|
|
|
|
vCache[1] = vmax;
|
|
|
|
|
vCache[2] = flip ? vmax : vmin;
|
|
|
|
|
vCache[3] = vmin;
|
2015-01-07 19:50:18 -05:00
|
|
|
|
2015-02-18 15:27:57 -05:00
|
|
|
side.render(this);
|
2015-01-07 19:50:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) {
|
|
|
|
|
if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) {
|
|
|
|
|
IIcon i = rendererOld.overrideBlockTexture;
|
|
|
|
|
|
|
|
|
|
tessellator.addVertexWithUV(0.0, 1.0, 0.0, i.getMinU(), i.getMinV());
|
|
|
|
|
tessellator.addVertexWithUV(0.0, 0.0, 0.0, i.getMinU(), i.getMaxV());
|
|
|
|
|
tessellator.addVertexWithUV(0.0, 0.0, 1.0, i.getMaxU(), i.getMaxV());
|
|
|
|
|
tessellator.addVertexWithUV(0.0, 1.0, 1.0, i.getMaxU(), i.getMinV());
|
|
|
|
|
} else {
|
|
|
|
|
int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 4);
|
|
|
|
|
|
2015-02-20 00:32:05 -05:00
|
|
|
fillLightmap(brightnessBottomLeft, brightnessBottomRight, brightnessTopRight, brightnessTopLeft);
|
|
|
|
|
getLight(0, 0);
|
2015-02-18 15:27:57 -05:00
|
|
|
side(XNEG_LB, tex[2], false);
|
2015-02-20 00:32:05 -05:00
|
|
|
getLight(1, 0);
|
2015-02-18 15:27:57 -05:00
|
|
|
side(XNEG_RB, tex[3], false);
|
2015-02-20 00:32:05 -05:00
|
|
|
getLight(1, 1);
|
2015-02-18 15:27:57 -05:00
|
|
|
side(XNEG_RT, tex[1], false);
|
2015-02-20 00:32:05 -05:00
|
|
|
getLight(0, 1);
|
2015-02-18 15:27:57 -05:00
|
|
|
side(XNEG_LT, tex[0], false);
|
2015-01-07 19:50:18 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) {
|
|
|
|
|
if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) {
|
|
|
|
|
IIcon i = rendererOld.overrideBlockTexture;
|
|
|
|
|
|
|
|
|
|
tessellator.addVertexWithUV(1.0, 1.0, 1.0, i.getMaxU(), i.getMinV());
|
|
|
|
|
tessellator.addVertexWithUV(1.0, 0.0, 1.0, i.getMaxU(), i.getMaxV());
|
|
|
|
|
tessellator.addVertexWithUV(1.0, 0.0, 0.0, i.getMinU(), i.getMaxV());
|
|
|
|
|
tessellator.addVertexWithUV(1.0, 1.0, 0.0, i.getMinU(), i.getMinV());
|
|
|
|
|
} else {
|
|
|
|
|
int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 5);
|
|
|
|
|
|
2015-02-20 00:32:05 -05:00
|
|
|
fillLightmap(brightnessTopRight, brightnessTopLeft, brightnessBottomLeft, brightnessBottomRight);
|
|
|
|
|
getLight(0, 0);
|
|
|
|
|
side(XPOS_LB, tex[2], false);
|
|
|
|
|
getLight(1, 0);
|
|
|
|
|
side(XPOS_RB, tex[3], false);
|
|
|
|
|
getLight(1, 1);
|
|
|
|
|
side(XPOS_RT, tex[1], false);
|
|
|
|
|
getLight(0, 1);
|
|
|
|
|
side(XPOS_LT, tex[0], false);
|
2015-01-07 19:50:18 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) {
|
|
|
|
|
if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) {
|
|
|
|
|
IIcon i = rendererOld.overrideBlockTexture;
|
|
|
|
|
|
|
|
|
|
tessellator.addVertexWithUV(1.0, 1.0, 0.0, i.getMaxU(), i.getMinV());
|
|
|
|
|
tessellator.addVertexWithUV(1.0, 0.0, 0.0, i.getMaxU(), i.getMaxV());
|
|
|
|
|
tessellator.addVertexWithUV(0.0, 0.0, 0.0, i.getMinU(), i.getMaxV());
|
|
|
|
|
tessellator.addVertexWithUV(0.0, 1.0, 0.0, i.getMinU(), i.getMinV());
|
|
|
|
|
} else {
|
|
|
|
|
int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 2);
|
|
|
|
|
|
2015-02-20 00:32:05 -05:00
|
|
|
fillLightmap(brightnessBottomLeft, brightnessBottomRight, brightnessTopRight, brightnessTopLeft);
|
|
|
|
|
getLight(0, 0);
|
|
|
|
|
side(ZNEG_LB, tex[2], false);
|
|
|
|
|
getLight(1, 0);
|
|
|
|
|
side(ZNEG_RB, tex[3], false);
|
|
|
|
|
getLight(1, 1);
|
|
|
|
|
side(ZNEG_RT, tex[1], false);
|
|
|
|
|
getLight(0, 1);
|
|
|
|
|
side(ZNEG_LT, tex[0], false);
|
2015-01-07 19:50:18 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) {
|
|
|
|
|
if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) {
|
|
|
|
|
IIcon i = rendererOld.overrideBlockTexture;
|
|
|
|
|
|
|
|
|
|
tessellator.addVertexWithUV(0.0, 1.0, 1.0, i.getMinU(), i.getMinV());
|
|
|
|
|
tessellator.addVertexWithUV(0.0, 0.0, 1.0, i.getMinU(), i.getMaxV());
|
|
|
|
|
tessellator.addVertexWithUV(1.0, 0.0, 1.0, i.getMaxU(), i.getMaxV());
|
|
|
|
|
tessellator.addVertexWithUV(1.0, 1.0, 1.0, i.getMaxU(), i.getMinV());
|
|
|
|
|
} else {
|
|
|
|
|
int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 3);
|
|
|
|
|
|
2015-02-20 00:32:05 -05:00
|
|
|
fillLightmap(brightnessTopLeft, brightnessBottomLeft, brightnessBottomRight, brightnessTopRight);
|
|
|
|
|
getLight(0, 0);
|
|
|
|
|
side(ZPOS_LB, tex[2], false);
|
|
|
|
|
getLight(1, 0);
|
|
|
|
|
side(ZPOS_RB, tex[3], false);
|
|
|
|
|
getLight(1, 1);
|
|
|
|
|
side(ZPOS_RT, tex[1], false);
|
|
|
|
|
getLight(0, 1);
|
|
|
|
|
side(ZPOS_LT, tex[0], false);
|
2015-01-07 19:50:18 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) {
|
|
|
|
|
if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) {
|
|
|
|
|
IIcon i = rendererOld.overrideBlockTexture;
|
|
|
|
|
|
|
|
|
|
tessellator.addVertexWithUV(0.0, 0.0, 1.0, i.getMinU(), i.getMaxV());
|
|
|
|
|
tessellator.addVertexWithUV(0.0, 0.0, 0.0, i.getMinU(), i.getMinV());
|
|
|
|
|
tessellator.addVertexWithUV(1.0, 0.0, 0.0, i.getMaxU(), i.getMinV());
|
|
|
|
|
tessellator.addVertexWithUV(1.0, 0.0, 1.0, i.getMaxU(), i.getMaxV());
|
|
|
|
|
} else {
|
|
|
|
|
int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 0);
|
|
|
|
|
|
2015-02-20 00:32:05 -05:00
|
|
|
fillLightmap(brightnessBottomLeft, brightnessBottomRight, brightnessTopRight, brightnessTopLeft);
|
|
|
|
|
getLight(0, 0);
|
|
|
|
|
side(YNEG_LB, tex[2], false);
|
|
|
|
|
getLight(1, 0);
|
|
|
|
|
side(YNEG_RB, tex[3], false);
|
|
|
|
|
getLight(1, 1);
|
|
|
|
|
side(YNEG_RT, tex[1], false);
|
|
|
|
|
getLight(0, 1);
|
|
|
|
|
side(YNEG_LT, tex[0], false);
|
2015-01-07 19:50:18 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) {
|
|
|
|
|
if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) {
|
|
|
|
|
IIcon i = rendererOld.overrideBlockTexture;
|
|
|
|
|
|
|
|
|
|
tessellator.addVertexWithUV(0.0, 1.0, 0.0, i.getMinU(), i.getMinV());
|
|
|
|
|
tessellator.addVertexWithUV(0.0, 1.0, 1.0, i.getMinU(), i.getMaxV());
|
|
|
|
|
tessellator.addVertexWithUV(1.0, 1.0, 1.0, i.getMaxU(), i.getMaxV());
|
|
|
|
|
tessellator.addVertexWithUV(1.0, 1.0, 0.0, i.getMaxU(), i.getMinV());
|
|
|
|
|
} else {
|
|
|
|
|
int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 1);
|
|
|
|
|
|
2015-02-18 15:27:57 -05:00
|
|
|
updateLighting();
|
|
|
|
|
// side(12, 24, 6, 25, tex[3], false);
|
|
|
|
|
// side(22, 12, 25, 2, tex[1], false);
|
|
|
|
|
// side(1, 23, 12, 22, tex[0], false);
|
|
|
|
|
// side(23, 5, 24, 12, tex[2], false);
|
2015-01-07 19:50:18 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-21 19:13:15 +01:00
|
|
|
}
|