Ejemplo n.º 1
0
  @Override
  public boolean canInsertItem(int slot, ItemStack is, int side) {
    SocketModule m = getSide(ForgeDirection.getOrientation(side));
    if (m != null && m.canDirectlyInsertItems(configs[side], this)) {
      int[] slots = getAccessibleSlotsFromSide(side);
      if (slots.length > 0) {
        if (slots[0] == slot) return true;
      }
    }

    return false;
  }
Ejemplo n.º 2
0
  @Override
  public int[] getAccessibleSlotsFromSide(int side) {
    int[] result = new int[1];
    SocketModule m = getSide(ForgeDirection.getOrientation(side));

    if (m != null
        && (m.canDirectlyExtractItems(configs[side], this)
            || m.canDirectlyInsertItems(configs[side], this))) {
      SideConfig config = configs[side];
      if (config.inventory >= 0 && config.inventory <= 2) {
        result[0] = config.inventory;
      } else {
        result = new int[] {};
      }
    } else {
      result = new int[] {};
    }

    return result;
  }