[Solved] Adding a block to an ArrayList?

Discussion in 'Plugin Development' started by FTWin01Gurl, Jun 21, 2012.

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

    FTWin01Gurl

    How would I go doing this? I wanted to make a list of blocks a player can use as his role (like farmer, blacksmith) as well place/break? I've found no solution to this.
     
  2. Offline

    Orcem12

    public ArrayList<Block> BlockList = new ArrayList<Block>();
    BlockList.add(...)
    BlockList.remove(...)
     
  3. Offline

    FTWin01Gurl

    I know.. but how do I actually add it?
     
  4. Offline

    r0306

    You can also create a list of allowed block names under each job in the config file.

    Instead of adding the blocks themselves, I would add their materials.
    Code:
    public List<Material> allowedList () {
    List<Material> allowed = new ArrayList<Material>();
    allowed.add(Material.STONE);
    allowed.add(Material.DIRT);
    return allowed;
    }
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  5. Offline

    FTWin01Gurl

    Okay, thanks.
     
Thread Status:
Not open for further replies.

Share This Page