Reload Config

Discussion in 'Plugin Development' started by BetaNyan, Jun 18, 2014.

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

    BetaNyan

    I am trying to make a command that reloads the config?
    Any help? Heres my current code:
    Code:java
    1. if(!p.hasPermission("simpleprotect.reload")) {
    2. p.sendMessage(ChatColor.BLACK + "[" + ChatColor.GREEN + "SimpleProtection" + ChatColor.BLACK + "]: " + ChatColor.RED + "You do not have permission to reload SimpleProtection.");
    3. } else {
    4. instance.reloadConfig();
    5. instance.saveConfig();
    6. p.sendMessage(ChatColor.BLACK + "[" + ChatColor.GREEN + "SimpleProtection" + ChatColor.BLACK + "]: " + ChatColor.RED + "SimpleProtection has reloaded.");
    7. }
    8. }
     
  2. Offline

    D4rkz

    is the Instance like This.Blah?
     
  3. Offline

    BetaNyan

    Main.instance = this;

    and public static Main instance;

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  4. Offline

    fireblast709

    BetaNyan I bet there is no need for static, which might just be the cause of your issues
     
Thread Status:
Not open for further replies.

Share This Page