how to save an inventory with spout

Discussion in 'Plugin Development' started by okami35, Oct 21, 2011.

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

    okami35

    Hello,
    In my plugin, when the player interacts with a special cube, I open an inventory:

    Code:
    SpoutPlayer.openInventoryWindow(inventory);
    But now, i would want to save this inventory when it is closed by the player. I know i must use a screenListener with :
    public void onScreenClose(ScreenCloseEvent event)

    But how do you do to recover the inventory object?
    i have tried:

    Code:
     public void onScreenClose(ScreenCloseEvent event) {
             if(event.getScreenType().equals(ScreenType.CHEST_INVENTORY)) {
                 Inventory inv = (Inventory)event.getScreen();
             }
            }
    But the method is called when the player close a chest inventory too.

    Do you haves ideas?

    Really sorry if my english is bad...
     
  2. Offline

    okami35

    no ideas?
     
Thread Status:
Not open for further replies.

Share This Page