get list of blocks from config

Discussion in 'Plugin Development' started by Serubin323, Dec 5, 2011.

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

    Serubin323

    How would i get a list of blocks from the config.yml? I have it set to:
    Code:
    this.getConfig().set("restrictblocks.allowed", "1 2 3 4 5 12 13 14 15 17 18 20 22 23 24 25 35 41 42 44 45 46 47 48 49 52 54 57 58 80 81 82 87 88 89 91 98 103 112");
                
    Then how do i get the list as a array? This is what i tried, but it did not work:
    Code:
    String[] rbBlocks = this.getConfig().getString("restrictblocks.allowed", "1, 2, 3, 4, 5, 12, 13, 14, 15, 17, 18, 20, 22, 23, 24, 25, 35, 41, 42, 44, 45, 46, 47, 48, 49, 52, 54, 57, 58, 80, 81, 82, 87, 88, 89, 91, 98, 103, 112");
    		
    Hope some one can help, Thank you!
     
  2. Offline

    Sagacious_Zed Bukkit Docs

    Code:
    String[] rbBlocks = this.getConfig().getString("restrictedblocks.allow").split(" ");
     
  3. Offline

    Don Redhorse

    it also helps if you post the config in code tags.. trust me..
     
Thread Status:
Not open for further replies.

Share This Page