Advertisement
ZP4RKER

Untitled

Sep 19th, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. // The ArrayList
  2. List<String> mods = new ArrayList<>();
  3.  
  4. // Saving it to the config
  5. getConfig().set("mods", mods);
  6. // "mods" is the path you are saving it to and mods is the ArrayList
  7.  
  8. // Saving the config, always do this when changing something in the config
  9. saveConfig();
  10.  
  11. // Retrieving it from the config
  12. mods = new ArrayList<>();
  13. // Empty mods, or create the variable again
  14.  
  15. for (Object object : getConfig.getList("mods")) {
  16. mods.add(object.toString());
  17. }
  18.  
  19. // Now all the players in the list from the config are in the ArrayList, mods.
  20.  
  21. // Now that is how you use it!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement