use of com.bluepowermod.api.wire.redstone.IRedwire in project BluePower by Qmunity.
the class GateNullCell method canConnect.
@Override
public boolean canConnect(ForgeDirection side, IRedstoneDevice device, ConnectionType type) {
if (type == ConnectionType.OPEN_CORNER && device instanceof IGate<?, ?, ?, ?, ?, ?>)
return false;
if (type == ConnectionType.STRAIGHT)
if ((side == getFace().getOpposite() || side == ForgeDirection.UNKNOWN) && device instanceof DummyRedstoneDevice)
return false;
if (type == ConnectionType.CLOSED_CORNER) {
if (side == getFace())
return false;
if (side == getFace().getOpposite())
return false;
if (side == ForgeDirection.UNKNOWN)
return false;
}
if (device instanceof IRedwire) {
RedwireType rwt = getRedwireType(side);
if (rwt == null)
return false;
RedwireType rwt_ = ((IRedwire) device).getRedwireType(type == ConnectionType.STRAIGHT ? side.getOpposite() : (type == ConnectionType.CLOSED_CORNER ? getFace() : getFace().getOpposite()));
if (rwt_ == null)
return false;
return rwt.canConnectTo(rwt_);
}
return true;
}
use of com.bluepowermod.api.wire.redstone.IRedwire in project BluePower by Qmunity.
the class PneumaticTube method canConnect.
@Override
public boolean canConnect(ForgeDirection side, IRedstoneDevice device, ConnectionType type) {
if (type == ConnectionType.STRAIGHT) {
if (getRedwireType(side) == null)
return false;
if (device instanceof IRedwire) {
RedwireType rwt = getRedwireType(side);
if (type == null)
return false;
RedwireType rwt_ = ((IRedwire) device).getRedwireType(type == ConnectionType.STRAIGHT ? side.getOpposite() : side.getOpposite());
if (rwt_ == null)
return false;
if (!rwt.canConnectTo(rwt_))
return false;
}
if (device instanceof IFace)
return ((IFace) device).getFace() == side.getOpposite();
if (!OcclusionHelper.microblockOcclusionTest(new Vec3i(this), MicroblockShape.FACE_HOLLOW, 8, side))
return false;
if (device instanceof PneumaticTube)
if (device instanceof MagTube != this instanceof MagTube)
return false;
return true;
}
return false;
}
Aggregations