use of com.bluepowermod.redstone.DummyRedstoneDevice in project BluePower by Qmunity.
the class GateConnectionBase method notifyUpdate.
@Override
public void notifyUpdate() {
if (gate.getParent() == null || gate.getWorld() == null)
return;
ForgeDirection d = getForgeDirection();
IConnection<? extends IRedstoneDevice> c = gate.getRedstoneConnectionCache().getConnectionOnSide(d);
if (c == null || c.getB() instanceof DummyRedstoneDevice) {
World world = gate.getWorld();
int x = gate.getX(), y = gate.getY(), z = gate.getZ();
RedstoneHelper.notifyRedstoneUpdate(world, x, y, z, d, true);
} else {
RedstoneApi.getInstance().getRedstonePropagator(getGate(), d).propagate();
}
}
use of com.bluepowermod.redstone.DummyRedstoneDevice 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.redstone.DummyRedstoneDevice in project BluePower by Qmunity.
the class PneumaticTube method onRedstoneUpdate.
@Override
public void onRedstoneUpdate() {
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
IConnection<IRedstoneDevice> c = redConnections.getConnectionOnSide(dir);
IRedstoneDevice dev = null;
if (c != null)
dev = c.getB();
if (dev == null || dev instanceof DummyRedstoneDevice)
RedstoneHelper.notifyRedstoneUpdate(getWorld(), getX(), getY(), getZ(), dir, false);
}
sendUpdatePacket();
}
Aggregations