@Override
  public void setRedstonePower(ForgeDirection side, byte power) {

    byte[] b = device.getBundledPower(side);
    if (b == null) b = new byte[16];

    b[color.ordinal()] = power;

    device.setBundledPower(side, b);
  }
  @Override
  public byte getRedstonePower(ForgeDirection side) {

    byte[] b = device.getBundledOutput(side);

    if (b == null) return 0;

    return b[color.ordinal()];
  }
Exemplo n.º 3
0
  @Override
  public void propagate() {

    if ((device instanceof IPart && ((IPart) device).getParent() == null)
        || device.getWorld() == null) return;

    for (MinecraftColor c : MinecraftColor.VALID_COLORS) {
      IRedstoneDevice dev;
      if (device instanceof IInsulatedRedwire) {
        dev = (IRedstoneDevice) device;
      } else {
        dev = BundledDeviceWrapper.wrap(device, c);
      }
      if (dev == null) continue;
      RedstoneApi.getInstance().getRedstonePropagator(dev, side).propagate();
    }
  }
  @Override
  public int getZ() {

    return device.getZ();
  }
  @Override
  public World getWorld() {

    return device.getWorld();
  }
  @Override
  public boolean isNormalFace(ForgeDirection side) {

    return device.isNormalFace(side);
  }
  @Override
  public void onRedstoneUpdate() {

    device.onBundledUpdate();
  }