BC Facades work again.
This commit is contained in:
parent
e25014fd5b
commit
0ed7cd7bb4
2 changed files with 7 additions and 10 deletions
|
@ -35,10 +35,10 @@ import appeng.api.util.AECableType;
|
|||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.core.AELog;
|
||||
import appeng.facade.IFacadeItem;
|
||||
import appeng.helpers.AEMultiTile;
|
||||
import appeng.parts.BusCollisionHelper;
|
||||
import appeng.parts.CableBusContainer;
|
||||
import appeng.parts.PartPlacement;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.util.Platform;
|
||||
import codechicken.lib.data.MCDataInput;
|
||||
|
@ -285,19 +285,14 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
|
|||
@Override
|
||||
public boolean canAddPart(ItemStack is, ForgeDirection side)
|
||||
{
|
||||
if ( is.getItem() instanceof IFacadeItem )
|
||||
IFacadePart fp = PartPlacement.isFacade( is, side );
|
||||
if ( fp != null )
|
||||
{
|
||||
IFacadeItem bi = (IFacadeItem) is.getItem();
|
||||
|
||||
is = is.copy();
|
||||
is.stackSize = 1;
|
||||
|
||||
IFacadePart bp = bi.createPartFromItemStack( is, side );
|
||||
if ( !(side == null || side == ForgeDirection.UNKNOWN || tile() == null) )
|
||||
{
|
||||
List<AxisAlignedBB> boxes = new ArrayList();
|
||||
IPartCollsionHelper bch = new BusCollisionHelper( boxes, side, null, true );
|
||||
bp.getBoxes( bch );
|
||||
fp.getBoxes( bch );
|
||||
for (AxisAlignedBB bb : boxes)
|
||||
{
|
||||
disableFacadeOcclusion.set( true );
|
||||
|
|
|
@ -377,16 +377,18 @@ public class PartPlacement
|
|||
return true;
|
||||
}
|
||||
|
||||
private static IFacadePart isFacade(ItemStack held, ForgeDirection side)
|
||||
public static IFacadePart isFacade(ItemStack held, ForgeDirection side)
|
||||
{
|
||||
if ( held.getItem() instanceof IFacadeItem )
|
||||
return ((IFacadeItem) held.getItem()).createPartFromItemStack( held, side );
|
||||
|
||||
if ( AppEng.instance.isIntegrationEnabled( "BC" ) )
|
||||
{
|
||||
IBC bc = (IBC) AppEng.instance.getIntegration( "BC" );
|
||||
if ( bc.isFacade( held ) )
|
||||
return bc.createFacadePart( held, side );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue