Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void setContents(int size, String title, Location location) {
- ArrayList<Inventory> inventories = this.openedInventoriesTest.get(location);
- ChestRegistry registry = ChestRegistry.getInstance();
- Map<Location, ItemStack[]> ItemStack = registry.getcontents();
- org.bukkit.inventory.ItemStack[] itemStacks = ItemStack.get(location);
- List<ItemStack[]> testing = new ArrayList<>();
- testing.add(itemStacks);
- String CountItems = Arrays.toString(testing.get(0));
- ItemStack[] itemStacks1 = testing.get(0);
- String[] inputSplited;
- if (itemStacks1 == null)
- itemStacks1 = new ItemStack[0];
- int length = CountItems.split(",").length;
- int currentInventory = 0;
- //System.out.println("Itemstacks before" + Arrays.toString(itemStacks1));
- do {
- for (int i = 0; i < length; i++) {
- Inventory inventory = getPage(currentInventory, location);
- //String inputs = inputSplited[i];
- if (i < GuiSize) {
- //inventory.setContents(new ItemStack[]{(itemStacks1[i] != null ? itemStacks1[i] : new ItemStack(Material.AIR))});
- inventory.setItem(i, itemStacks1[i]);
- System.out.println("itemstack " + itemStacks1[i] + "value i = " + i);
- }
- }
- currentInventory++;
- } while (currentInventory < getPageIndex);
- }
Add Comment
Please, Sign In to add comment