How to get a double chest instance?

Discussion in 'Plugin Development' started by Satros, May 23, 2012.

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

    Satros

    Hi, I am trying to see if a chest is a double chest based on the location of one of the chest blocks, then if it is cast it into a double chest object like so:

    Code:
    BlockState bs = plugin.getServer().getWorld(loc.getWorld().getName()).getBlockAt(loc).getState();
    if(bs instanceof DoubleChest) {
                //Code will never get this far, even if at 'loc' the chest is a double chest
                DoubleChest chest = (DoubleChest)bs;
    }
    Any ideas on what I'm doing wrong? It seems to treat it as a single chest no matter what, even if its connected to another chest...
     
  2. Offline

    Nitnelave

    What I'm doing in my plugin is that I'm looking around the chest to see if there's another one. Then I believe the inventory can be cast to a doublechestinventory.
     
Thread Status:
Not open for further replies.

Share This Page