diff --git a/src/main/java/com/enderio/core/client/render/TechneUtil.java b/src/main/java/com/enderio/core/client/render/TechneUtil.java index a19ba75..e614d05 100644 --- a/src/main/java/com/enderio/core/client/render/TechneUtil.java +++ b/src/main/java/com/enderio/core/client/render/TechneUtil.java @@ -289,9 +289,20 @@ public class TechneUtil { tv.add(0.5, 0, 0.5); if(vt != null) { vt.apply(v); + // TODO BLECH + if (vt instanceof VertexRotationFacing) { + normal = ((VertexRotationFacing) vt).rotate(normal); + } + if (vt instanceof VertexTransformComposite) { + for (VertexTransform xform : ((VertexTransformComposite) vt).xforms) { + if (xform instanceof VertexRotationFacing) { + normal = ((VertexRotationFacing) xform).rotate(normal); + } + } + } } - if (isbrh) { + if(isbrh) { int c = (int) (0xFF * RenderUtil.getColorMultiplierForFace(normal)); tes.setColorOpaque(c, c, c); } diff --git a/src/main/java/com/enderio/core/client/render/VertexRotationFacing.java b/src/main/java/com/enderio/core/client/render/VertexRotationFacing.java index 485d627..f33301e 100644 --- a/src/main/java/com/enderio/core/client/render/VertexRotationFacing.java +++ b/src/main/java/com/enderio/core/client/render/VertexRotationFacing.java @@ -26,4 +26,20 @@ public class VertexRotationFacing extends VertexRotation { setAngle(ROTATION_AMOUNT * 3); } } + + public ForgeDirection rotate(ForgeDirection dir) { + if (dir.offsetY != 0) { + return dir; + } + if (getAngle() == ROTATION_AMOUNT) { + return dir.getRotation(ForgeDirection.DOWN); + } + if (getAngle() == ROTATION_AMOUNT * 2) { + return dir.getOpposite(); + } + if (getAngle() == ROTATION_AMOUNT * 3) { + return dir.getRotation(ForgeDirection.UP); + } + return dir; + } }