Refresh Workbench Inventory?

Discussion in 'Plugin Development' started by pkt, Jun 19, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    pkt

    I am working on making some custom item recipes for my server, I got everything working, but the item in slot 0 (the "finished product" when crafting) is invisible and there is no updateInventory() method for workbenches.

    Code:
        @EventHandler
        public void crafting(InventoryClickEvent event) {
            System.out.println(event.getSlot());
            if (event.getInventory().getType() == InventoryType.WORKBENCH) {
                if (!event.getInventory().getItem(3).equals(null) && event.getInventory().getItem(3).equals(r.item1) && !event.getInventory().getItem(5).equals(null) && event.getInventory().getItem(5).equals(r.item2)) {
                    System.out.println("Confirmed");
                    event.getInventory().setItem(0, f);   //THIS item is the "finished product", but it is invisible
                }
            }
        }
    Before you ask why I don't just make a ShapedRecipe is because my items are custom named, and recipes require a Material, not ItemStack....
     
  2. Offline

    the_merciless

    player.updateInventory()
     
  3. Offline

    pkt

    already tried

    it's not a players inventory, so it would not work
     
  4. Offline

    pkt

    I tried setting slot 0 to an item, then adding a custom meta, but it seems that every item put in slot 0 is invisible.
     
Thread Status:
Not open for further replies.

Share This Page