Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
27
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None
  1. List<String> addto = config.getStringList("kits." + kitName + ".items");
  2. addto.add(item.toString());
  3. config.set("kits." + kitName + ".items", addto);
  4. try
  5. {
  6. config.save(new File("plugins" + File.separator + "Essentials" + File.separator + "config.yml"));
  7. config.load(new File("plugins" + File.separator + "Essentials" + File.separator + "config.yml"));
  8. }
  9. catch (IOException e)
  10. {
  11. Bukkit.getServer().getLogger().log(
  12. Level.SEVERE,
  13. "Unable to save configuration file! Caused by: " +
  14. e.getMessage());
  15. }
  16. catch (InvalidConfigurationException e)
  17. {
  18. Bukkit.getServer().getLogger().log(Level.SEVERE,
  19. "Invalid configuration! Caused by: " + e.getMessage());
  20. }
  21. Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "essentials reload");
  22. }
Advertisement
RAW Paste Data Copied
Advertisement