コード例 #1
0
  public void nextPage() {
    if (((SlotPhantom) inventorySlots.get(1)).getSlotIndex() + 8 > inventory.getItemListSize()) {
      return;
    }

    for (int i = 1; i < 10; i++) {
      SlotPhantom slot = (SlotPhantom) inventorySlots.get(i);
      slot.setSlotIndex(slot.getSlotIndex() + 9);
    }
    page++;
  }
コード例 #2
0
  public ContainerSortingImporter(EntityPlayer player, TileSortingImporter inventory) {
    allowStackSizes = false;
    this.inventory = inventory;
    inventory.openInventory();
    inventory.addCrafter(player);

    for (int y = 0; y < 3; y++) {
      for (int x = 0; x < 3; x++) {
        this.addSlotToContainer(
            new SlotPhantom(inventory, 1 + y * 3 + x, 62 + x * 18, 22 + y * 18));
      }
    }

    for (int y = 0; y < 3; ++y) {
      for (int x = 0; x < 9; ++x) {
        this.addSlotToContainer(new Slot(player.inventory, x + y * 9 + 9, 8 + x * 18, 84 + y * 18));
      }
    }

    for (int x = 0; x < 9; ++x) {
      this.addSlotToContainer(new Slot(player.inventory, x, 8 + x * 18, 142));
    }
  }