Advertisement
broken-arrow

Untitled

May 29th, 2021
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. public int countItemStacks(Location location) {
  2. ItemStack[] ItemStacks = ChestRegistry.getInstance().getcontents().get(location);
  3.  
  4. return ItemStacks.length;
  5. }
  6.  
  7. public void setContents(int size, String title, Location location) {
  8. ItemStack[] itemStacks = ChestRegistry.getInstance().getcontents().get(location);
  9.  
  10. if (itemStacks == null)
  11. itemStacks = new ItemStack[0];
  12. //System.out.println("itemstack orginal" + Arrays.toString(itemStacks1));
  13. int currentInventory = 0;
  14. int conterItems = 0;
  15. //System.out.println("Itemstacks before" + Arrays.toString(itemStacks1));
  16. do {
  17. for (int i = 0; i < countItemStacks(location); i++) {
  18. Inventory inventory = getPage(currentInventory, location);
  19. if (i < GuiSize) {
  20. inventory.setItem(i, itemStacks[conterItems]);
  21. conterItems++;
  22. System.out.println("itemstack " + itemStacks[i] + "value i = " + conterItems);
  23. }
  24.  
  25. }
  26. currentInventory++;
  27. } while (currentInventory < getPageIndex);
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement