Fix(render): Bottom face rotation and UV (#58)

This commit is contained in:
Léa Gris authored and GitHub committed 2026-01-13 16:29:27 +01:00
1 parent 7d878e15b8
commit 6ed65fcb3b
3 files changed
+8 -6

No files matched your search

@@ -75,7 +75,9 @@ public class DrawersRenderer implements ISimpleBlockRenderingHandler {
int meta = world.getBlockMetadata(x, y, z);
renderHelper.state
.setUVRotation(RenderHelper.YPOS, RenderHelperState.ROTATION_BY_FACE_FACE[RenderHelper.ZNEG][side]);
.setUVRotation(RenderHelper.YPOS, RenderHelperState.ROTATION_BY_FACE_FACE[RenderHelper.YPOS][side]);
renderHelper.state
.setUVRotation(RenderHelper.YNEG, RenderHelperState.ROTATION_BY_FACE_FACE[RenderHelper.YNEG][side]);
boxRenderer.setUnit(block.getTrimWidth());
boxRenderer.setColor(ModularBoxRenderer.COLOR_WHITE);
@@ -147,17 +147,17 @@ public class RenderHelperLL {
private void setFaceYNegUV(IIcon icon, double minX, double minZ, double maxX, double maxZ) {
int rotate = state.uvRotate[RenderHelper.YNEG];
if (rotate == RenderHelperState.ROTATE0)
setUV(icon, minX + state.shiftU, maxX + state.shiftU, maxZ + state.shiftV, minZ + state.shiftV);
setUV(icon, maxX + state.shiftU, minX + state.shiftU, maxZ + state.shiftV, minZ + state.shiftV);
if (rotate == RenderHelperState.ROTATE90)
setUV(icon, 1 - maxZ + state.shiftU, 1 - minZ + state.shiftU, minX + state.shiftV, maxX + state.shiftV);
setUV(icon, 1 - minZ + state.shiftU, 1 - maxZ + state.shiftU, minX + state.shiftV, maxX + state.shiftV);
if (rotate == RenderHelperState.ROTATE180) setUV(
icon,
1 - minX + state.shiftU,
1 - maxX + state.shiftU,
1 - minX + state.shiftU,
1 - maxZ + state.shiftV,
1 - minZ + state.shiftV);
if (rotate == RenderHelperState.ROTATE270)
setUV(icon, maxZ + state.shiftU, minZ + state.shiftU, 1 - minX + state.shiftV, 1 - maxX + state.shiftV);
setUV(icon, minZ + state.shiftU, maxZ + state.shiftU, 1 - minX + state.shiftV, 1 - maxX + state.shiftV);
}
private void setFaceYPosUV(IIcon icon, double minX, double minZ, double maxX, double maxZ) {
@@ -7,7 +7,7 @@ public class RenderHelperState {
public static final int ROTATE180 = 2;
public static final int ROTATE270 = 3;
public static final int[][] ROTATION_BY_FACE_FACE = { { 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0 },
public static final int[][] ROTATION_BY_FACE_FACE = { { 0, 0, 0, 2, 1, 3 }, { 0, 0, 0, 2, 3, 1 },
{ 0, 0, 0, 2, 3, 1 }, { 0, 0, 2, 0, 1, 3 }, { 0, 0, 1, 3, 0, 2 }, { 0, 0, 3, 1, 2, 0 }, };
public static final int[][] FACE_BY_FACE_ROTATION = { { 0, 0, 0, 0 }, { 1, 1, 1, 1 }, { 2, 5, 3, 4 },