Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int countItemStacks(Location location) {
- ItemStack[] ItemStacks = ChestRegistry.getInstance().getcontents().get(location);
- return ItemStacks.length;
- }
- public void setContents(int size, String title, Location location) {
- ItemStack[] itemStacks = ChestRegistry.getInstance().getcontents().get(location);
- if (itemStacks == null)
- itemStacks = new ItemStack[0];
- //System.out.println("itemstack orginal" + Arrays.toString(itemStacks1));
- int currentInventory = 0;
- int conterItems = 0;
- //System.out.println("Itemstacks before" + Arrays.toString(itemStacks1));
- do {
- for (int i = 0; i < countItemStacks(location); i++) {
- Inventory inventory = getPage(currentInventory, location);
- if (i < GuiSize) {
- inventory.setItem(i, itemStacks[conterItems]);
- conterItems++;
- System.out.println("itemstack " + itemStacks[i] + "value i = " + conterItems);
- }
- }
- currentInventory++;
- } while (currentInventory < getPageIndex);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement