コード例 #1
0
  public FluidStack drainInternal(int tank, int maxDrain, boolean doDrain) {
    if (tank >= 0 && tank < 3) {
      FluidStack result = tanks[tank].drain(maxDrain, doDrain);

      if (result != null && doDrain) {
        for (int i = 0; i < 6; i++) {
          SocketModule m = getSide(ForgeDirection.getOrientation(i));
          m.onTankChange(configs[i], tank, this, ForgeDirection.getOrientation(i), false);
        }
      }

      return result;
    }
    return null;
  }
コード例 #2
0
  public int fillInternal(int tank, FluidStack resource, boolean doFill) {
    if (tank >= 0 && tank < 3) {
      int result = tanks[tank].fill(resource, doFill);

      if (result > 0 && doFill) {
        for (int i = 0; i < 6; i++) {
          SocketModule m = getSide(ForgeDirection.getOrientation(i));
          m.onTankChange(configs[i], tank, this, ForgeDirection.getOrientation(i), true);
        }
      }

      return result;
    }
    return 0;
  }