From 552f4395b9589349ae4896a2c9fd5887afa3a542 Mon Sep 17 00:00:00 2001 From: Robert S Date: Thu, 20 Mar 2014 21:18:12 -0400 Subject: [PATCH] Changed block placer to only render items on two sides --- .../mechanical/process/edit/TilePlacer.java | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/mechanical/src/main/java/resonantinduction/mechanical/process/edit/TilePlacer.java b/mechanical/src/main/java/resonantinduction/mechanical/process/edit/TilePlacer.java index cb199207..64f014df 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/process/edit/TilePlacer.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/process/edit/TilePlacer.java @@ -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(); }