1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Plugin config.yml

Discussion in 'Development' started by KygekDev, Jul 20, 2020.

  1. KygekDev

    KygekDev Witch

    Messages:
    72
    GitHub:
    KygekDev
    I've made a plugin called KygekJoinUI. You can check it out here ---> https://poggit.pmmp.io/p/KygekJoinUI. But what will happen if I update the plugin with a new config.yml? Will it cause problems?
     
  2. anirudh246

    anirudh246 Spider Jockey

    Messages:
    29
  3. KygekDev

    KygekDev Witch

    Messages:
    72
    GitHub:
    KygekDev
    The old config.yml doesn't change in plugin_data. If I add new features, this will cause problems. How to solve this?
     
  4. JviguyGamesYT

    JviguyGamesYT Baby Zombie

    Messages:
    113
    GitHub:
    jviguy
    umm delete the one in the plugin data?? or mayabe put a version indicator in ur config and put the real version in ur main and check if their equal if not tell them to upgrade their config by deleting it
     
  5. KygekDev

    KygekDev Witch

    Messages:
    72
    GitHub:
    KygekDev
    But how? What code should I put? And how to make the 1.0.0 config.yml updated? I haven't put any config version.
     
  6. JviguyGamesYT

    JviguyGamesYT Baby Zombie

    Messages:
    113
    GitHub:
    jviguy
    PHP:
    $cfgversion $this->getConfig()->get("version");
    $mainversion 1.1;
    if (
    $cfgversion !== $mainversion) {
        
    $this->getLogger()->error("Old Config Detected Please Delete Ur Config and a new version should generate!")
    }
    do this on onEnable
     
  7. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    Yes it will. Remove your config.yml on your plugin_data\yourplugin folder and start the server again.
     
  8. KygekDev

    KygekDev Witch

    Messages:
    72
    GitHub:
    KygekDev
    Sorry but I've found a way to update the config.yml without the users to delete theirs manually. And the old config.yml will be created as config_old.yml first.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.