Filling Chest Help

Discussion in 'Plugin Development' started by dlange, Feb 12, 2015.

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

    dlange

    Chest Filling Help
    I'm making a plugin and part of it needs the chests to be filled in the arena. I can't seem to figure out how to go about doing this. If someone can help it would be greatly appreciated. :)

    - dlange
     
  2. Offline

    aaomidi

    Iterate on all the blocks within a cuboid range, if the block is a chest then fill it with items. If not continue with your iteration.
     
  3. In addition to what aaomidi said:

    How are you storing the two boundaries of the arena? In two separate Location instances or one cuboid (a custom class) instance?

    Also, if you want a small Cuboid class:
    https://gist.github.com/KingFaris10/4527fbaf8caa9fd7b800

    You can get all the blocks by doing:
    Code:
    for (Block block : cuboid) {
    }
    
    Or alternatively, List<Block> blocks = cuboid.getBlocks();
     
  4. @dlange I was wondering the same thing too but I want to fill chests inside a WorldEdit Selection. Anyone can help me with that?
     
  5. Offline

    dlange

    Thanks a lot, i will try :)
     
  6. Offline

    ReadySetPawn

    What I do is that I fill the chest when it opens. That way, it's a lot less laggy.
     
  7. That's very clever, I'd recommend that to be honest instead of my suggestion.
     
    ReadySetPawn likes this.
Thread Status:
Not open for further replies.

Share This Page