Best way to store 2 values (String, Integer)

Discussion in 'Plugin Development' started by Sparmerlin, Apr 18, 2015.

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

    Sparmerlin

    For the plugin I'm working on, I need a way to store a world name (as a string) and an integer. I was considering making a config file that just lists each world as well as the integer like this without the brackets (worldname,10) and then parse it later. Or I guess I could make a key for each worldname (worlds.worldname) and then the value of worldname could be the integer.

    If you have any suggestions on better or easier methods I'd really appreciate it.

    Thanks, Luke.
     
  2. Offline

    teej107

  3. Offline

    Zombie_Striker

    The best way of doing this would be a Hasmap<String,Integer>
     
    Sparmerlin likes this.
  4. Offline

    Sparmerlin

    How would you store hashmaps to a file? In case of reload or restart.
     
  5. Offline

    Zombie_Striker

    You can store them to the Config.yml, or to any other .yml file.
     
Thread Status:
Not open for further replies.

Share This Page