Saving Empty Defaults In The Config

Discussion in 'Plugin Development' started by Zach_1919, Aug 10, 2013.

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

    Zach_1919

    I am trying to make a revamped factions plugin for a server, and I have lists in the config for each faction, such as a chunk list. When the faction is created, I add defaults to the config with the new faction's lists and such, but if the list is empty, it doesn't save in the config. I need the chunk list to start out empty, because I don't want a faction to own any chunks when they're created. The weird thing is, if I make a faction manually by typing in the config, even if I save the config and everything, it doesn't remove the empty lists that were put there manually. Help please?

    Also, if you know how to save the config vertically, please tell me, because I hate how when you do saveConfig(), it saves it all on one line.
     
  2. Offline

    caseif

    Create a default config and save it in the onEnable() with saveDefaultConfig(). To define a blank list, do something like "list1: []", but I guess you already knew that. :p
     
  3. Offline

    Zach_1919

    AngryNerd Okay thanks. Do you know anything about this bit:

     
  4. Offline

    caseif

    I've never experienced that problem myself, but perhaps Google could help you with it.
     
Thread Status:
Not open for further replies.

Share This Page