Fix for FMP facade conflict.
This commit is contained in:
+14
-5
@@ -73,6 +73,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
|
|||||||
new Cuboid6( 10.0 / 16.0, 6.0 / 16.0, 6.0 / 16.0, 1.0, 10.0 / 16.0, 10.0 / 16.0 ),// EAST(1, 0, 0),
|
new Cuboid6( 10.0 / 16.0, 6.0 / 16.0, 6.0 / 16.0, 1.0, 10.0 / 16.0, 10.0 / 16.0 ),// EAST(1, 0, 0),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static ThreadLocal<Boolean> disableFacadeOcclusion = new ThreadLocal<Boolean>();
|
||||||
public CableBusContainer cb = new CableBusContainer( this );
|
public CableBusContainer cb = new CableBusContainer( this );
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -149,7 +150,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
|
|||||||
{
|
{
|
||||||
AxisAlignedBB b = null;
|
AxisAlignedBB b = null;
|
||||||
|
|
||||||
for (AxisAlignedBB bx : cb.getSelectedBoundingBoxsFromPool( false, null, true ))
|
for (AxisAlignedBB bx : cb.getSelectedBoundingBoxsFromPool( false, true, null, true ))
|
||||||
{
|
{
|
||||||
if ( b == null )
|
if ( b == null )
|
||||||
b = bx;
|
b = bx;
|
||||||
@@ -299,7 +300,10 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
|
|||||||
bp.getBoxes( bch );
|
bp.getBoxes( bch );
|
||||||
for (AxisAlignedBB bb : boxes)
|
for (AxisAlignedBB bb : boxes)
|
||||||
{
|
{
|
||||||
if ( !tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) ) )
|
disableFacadeOcclusion.set( true );
|
||||||
|
boolean canAdd = tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) );
|
||||||
|
disableFacadeOcclusion.remove();
|
||||||
|
if ( !canAdd )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -389,7 +393,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
|
|||||||
public Iterable<Cuboid6> getCollisionBoxes()
|
public Iterable<Cuboid6> getCollisionBoxes()
|
||||||
{
|
{
|
||||||
LinkedList l = new LinkedList();
|
LinkedList l = new LinkedList();
|
||||||
for (AxisAlignedBB b : cb.getSelectedBoundingBoxsFromPool( false, null, false ))
|
for (AxisAlignedBB b : cb.getSelectedBoundingBoxsFromPool( false, true, null, false ))
|
||||||
{
|
{
|
||||||
l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) );
|
l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) );
|
||||||
}
|
}
|
||||||
@@ -412,7 +416,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
|
|||||||
public Iterable<Cuboid6> getOcclusionBoxes()
|
public Iterable<Cuboid6> getOcclusionBoxes()
|
||||||
{
|
{
|
||||||
LinkedList l = new LinkedList();
|
LinkedList l = new LinkedList();
|
||||||
for (AxisAlignedBB b : cb.getSelectedBoundingBoxsFromPool( true, null, true ))
|
for (AxisAlignedBB b : cb.getSelectedBoundingBoxsFromPool( true, disableFacadeOcclusion.get() == null, null, true ))
|
||||||
{
|
{
|
||||||
l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) );
|
l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) );
|
||||||
}
|
}
|
||||||
@@ -442,7 +446,12 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
|
|||||||
{
|
{
|
||||||
if ( side == null || side == ForgeDirection.UNKNOWN || tile() == null )
|
if ( side == null || side == ForgeDirection.UNKNOWN || tile() == null )
|
||||||
return false;
|
return false;
|
||||||
return !tile().canAddPart( new NormallyOccludedPart( sideTests[side.ordinal()] ) );
|
|
||||||
|
disableFacadeOcclusion.set( true );
|
||||||
|
boolean blocked = !tile().canAddPart( new NormallyOccludedPart( sideTests[side.ordinal()] ) );
|
||||||
|
disableFacadeOcclusion.remove();
|
||||||
|
|
||||||
|
return blocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxsFromPool(boolean ignoreCableConnections, Entity e, boolean visual)
|
public Iterable<AxisAlignedBB> getSelectedBoundingBoxsFromPool(boolean ignoreCableConnections, boolean includeFacades, Entity e, boolean visual)
|
||||||
{
|
{
|
||||||
List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();
|
List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();
|
||||||
|
|
||||||
@@ -394,13 +394,6 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
|||||||
{
|
{
|
||||||
IPartCollsionHelper bch = new BusCollisionHelper( boxes, s, e, visual );
|
IPartCollsionHelper bch = new BusCollisionHelper( boxes, s, e, visual );
|
||||||
|
|
||||||
if ( s != ForgeDirection.UNKNOWN )
|
|
||||||
{
|
|
||||||
IFacadePart fpa = fc.getFacade( s );
|
|
||||||
if ( fpa != null )
|
|
||||||
fpa.getBoxes( bch );
|
|
||||||
}
|
|
||||||
|
|
||||||
IPart part = getPart( s );
|
IPart part = getPart( s );
|
||||||
if ( part != null )
|
if ( part != null )
|
||||||
{
|
{
|
||||||
@@ -411,7 +404,7 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !ignoreCableConnections && s != null && s != ForgeDirection.UNKNOWN )
|
if ( includeFacades && s != null && s != ForgeDirection.UNKNOWN )
|
||||||
{
|
{
|
||||||
IFacadePart fp = fc.getFacade( s );
|
IFacadePart fp = fc.getFacade( s );
|
||||||
if ( fp != null )
|
if ( fp != null )
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
|
|||||||
@Override
|
@Override
|
||||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxsFromPool(World w, int x, int y, int z, Entity e, boolean visual)
|
public Iterable<AxisAlignedBB> getSelectedBoundingBoxsFromPool(World w, int x, int y, int z, Entity e, boolean visual)
|
||||||
{
|
{
|
||||||
return cb.getSelectedBoundingBoxsFromPool( false, e, visual );
|
return cb.getSelectedBoundingBoxsFromPool( false, true, e, visual );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -321,7 +321,8 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cleanup() {
|
public void cleanup()
|
||||||
|
{
|
||||||
getWorldObj().setBlock( xCoord, yCoord, zCoord, Platform.air );
|
getWorldObj().setBlock( xCoord, yCoord, zCoord, Platform.air );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user