From 094d632a2cd7c3cf2aa485e23ae9883294449448 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 13 Jul 2014 15:28:59 -0500 Subject: [PATCH] Feature: #0617 - If you combine Anchor & Facade, you can see the Anchor. --- parts/misc/PartCableAnchor.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/parts/misc/PartCableAnchor.java b/parts/misc/PartCableAnchor.java index f60e13b6..8a5d2ce1 100644 --- a/parts/misc/PartCableAnchor.java +++ b/parts/misc/PartCableAnchor.java @@ -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,7 +47,10 @@ public class PartCableAnchor implements IPart renderCache = rh.useSimpliedRendering( x, y, z, this, renderCache ); IIcon myIcon = is.getIconIndex(); rh.setTexture( myIcon ); - rh.setBounds( 7, 7, 10, 9, 9, 16 ); + 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,7 +75,10 @@ public class PartCableAnchor implements IPart @Override public void getBoxes(IPartCollsionHelper bch) { - bch.addBox( 7, 7, 10, 9, 9, 16 ); + 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 ); } @Override @@ -186,6 +193,7 @@ public class PartCableAnchor implements IPart @Override public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile) { + this.host = host; mySide = side; }