public void previousPage() {
   if (((SlotPhantom) inventorySlots.get(1)).getSlotIndex() - 9 < 0) {
     return;
   }
   for (int i = 1; i < 10; i++) {
     SlotPhantom slot = (SlotPhantom) inventorySlots.get(i);
     slot.setSlotIndex(slot.getSlotIndex() - 9);
   }
   page--;
 }
  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++;
  }