Set Blocks (Chest, Dispenser,...) Inventory

Discussion in 'Bukkit Help' started by Zero9195, Sep 5, 2011.

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


    Hi Guys,
    Probably it's just too late for me to find the method, but is there a way to set the Inventory of a chest? I found some "getInventory()" methods, but not one single "setInventory(Inventory)" method. Any other way to do it?
    Thank you in advance, a very tired
  2. Offline


    Couldn't you just do
    1. chest.getInventory().setContents(otherinv.getContents());
    2. otherinv.clear();

    which "moves" all of the contents into the chest?
    Also, you might want to ask for help in the Plugin Development section.
  3. Offline


    As you see, I was very tired last night xD
    Maybe, but if you do this, wouldn't you just change a Inventory's contents, without setting the chests Inventory to the one changed?
  4. Offline


    Yes, but why would you need to set the inventory?
    in CraftBukkit, the getInventory method is implemented as
    1. public Inventory getInventory() {
    2. return new CraftInventory(chest);
    3. }

    So I don't think you can set it.
Thread Status:
Not open for further replies.

Share This Page