Changed block placer to only render items on two sides

This commit is contained in:
Robert S 2014-03-20 21:18:12 -04:00
parent 53f323b975
commit 552f4395b9

View file

@ -120,6 +120,32 @@ public class TilePlacer extends TileInventory implements IRotatable, IPacketRece
}
}
@Override
public void setDirection(ForgeDirection direction)
{
super.setDirection(direction);
this.updateDirection();
}
@SuppressWarnings("incomplete-switch")
public void updateDirection()
{
switch (this.getDirection())
{
case EAST:
case WEST:
this.renderItemSide_a = ForgeDirection.NORTH;
this.renderItemSide_b = ForgeDirection.SOUTH;
break;
case NORTH:
case SOUTH:
this.renderItemSide_a = ForgeDirection.EAST;
this.renderItemSide_b = ForgeDirection.WEST;
break;
}
}
@Override
@SideOnly(Side.CLIENT)
protected TileRender newRenderer()
@ -131,8 +157,12 @@ public class TilePlacer extends TileInventory implements IRotatable, IPacketRece
{
if (!isItem)
{
if (TilePlacer.this.worldObj != null && (TilePlacer.this.renderItemSide_a == null || TilePlacer.this.renderItemSide_b == null))
{
TilePlacer.this.updateDirection();
}
GL11.glPushMatrix();
RenderItemOverlayUtility.renderItemOnSides(TilePlacer.this, getStackInSlot(0), position.x, position.y, position.z);
RenderItemOverlayUtility.renderItemOnSides(TilePlacer.this, getStackInSlot(0), position.x, position.y, position.z, LanguageUtility.getLocal("tooltip.noOutput"), TilePlacer.this.renderItemSide_a, TilePlacer.this.renderItemSide_b);
GL11.glPopMatrix();
}