Fixed piston rotation for renderer
This commit is contained in:
parent
209dd99820
commit
fa376f44a9
1 changed files with 46 additions and 47 deletions
|
@ -33,6 +33,9 @@ public class RenderMechanicalPiston extends TileEntitySpecialRenderer
|
||||||
|
|
||||||
if (tile.worldObj != null)
|
if (tile.worldObj != null)
|
||||||
{
|
{
|
||||||
|
if (tile.getDirection() != ForgeDirection.UP && tile.getDirection() != ForgeDirection.DOWN)
|
||||||
|
RenderUtility.rotateBlockBasedOnDirection(tile.getDirection().getOpposite());
|
||||||
|
else
|
||||||
RenderUtility.rotateBlockBasedOnDirection(tile.getDirection());
|
RenderUtility.rotateBlockBasedOnDirection(tile.getDirection());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,17 +46,13 @@ public class RenderMechanicalPiston extends TileEntitySpecialRenderer
|
||||||
final String[] staticParts = { "baseRing", "leg1", "leg2", "leg3", "leg4", "connector", "basePlate", "basePlateTop", "connectorBar", "centerPiston" };
|
final String[] staticParts = { "baseRing", "leg1", "leg2", "leg3", "leg4", "connector", "basePlate", "basePlateTop", "connectorBar", "centerPiston" };
|
||||||
final String[] shaftParts = { "topPlate", "outerPiston" };
|
final String[] shaftParts = { "topPlate", "outerPiston" };
|
||||||
|
|
||||||
/**
|
/** Render Piston Rotor */
|
||||||
* Render Piston Rotor
|
|
||||||
*/
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glRotated(-Math.toDegrees(angle), 0, 0, 1);
|
GL11.glRotated(-Math.toDegrees(angle), 0, 0, 1);
|
||||||
MODEL.renderAllExcept(ArrayUtils.addAll(shaftParts, staticParts));
|
MODEL.renderAllExcept(ArrayUtils.addAll(shaftParts, staticParts));
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
/**
|
/** Render Piston Shaft */
|
||||||
* Render Piston Shaft
|
|
||||||
*/
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
if (tile.worldObj != null)
|
if (tile.worldObj != null)
|
||||||
|
|
Loading…
Reference in a new issue