Feature: #0617 - If you combine Anchor & Facade, you can see the Anchor.

This commit is contained in:
AlgorithmX2 2014-07-13 15:28:59 -05:00
parent 8558824532
commit 094d632a2c

View file

@ -33,6 +33,7 @@ public class PartCableAnchor implements IPart
protected ISimplifiedBundle renderCache = null;
ItemStack is = null;
IPartHost host = null;
ForgeDirection mySide = ForgeDirection.UP;
public PartCableAnchor(ItemStack is) {
@ -46,6 +47,9 @@ public class PartCableAnchor implements IPart
renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache );
IIcon myIcon = is.getIconIndex();
rh.setTexture( myIcon );
if ( host != null && host.getFacadeContainer().getFacade( mySide ) != null )
rh.setBounds( 7, 7, 10, 9, 9, 14 );
else
rh.setBounds( 7, 7, 10, 9, 9, 16 );
rh.renderBlock( x, y, z, renderer );
rh.setTexture( null );
@ -71,6 +75,9 @@ public class PartCableAnchor implements IPart
@Override
public void getBoxes(IPartCollsionHelper bch)
{
if ( host != null && host.getFacadeContainer().getFacade( mySide ) != null )
bch.addBox( 7, 7, 10, 9, 9, 14 );
else
bch.addBox( 7, 7, 10, 9, 9, 16 );
}
@ -186,6 +193,7 @@ public class PartCableAnchor implements IPart
@Override
public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile)
{
this.host = host;
mySide = side;
}