Pljugin breaks when a config file is created before reloading.

Discussion in 'Plugin Development' started by Geekhellmc, Aug 22, 2014.

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

    Geekhellmc

    Hey guys! I got a problem here! I got my plugin, it works fine and everything I created a config file with exemple: Arena File created containing Locatation of spawn and stuff. But when I reload the server... The plugin breaks and when I try to type the plugin's command it gives me just the usage from the plugin.yml... pls help!
     
  2. Offline

    Konkz

    'breaks'
    How?
     
  3. Offline

    Geekhellmc

    Konkz when I try to type a command that usually works, it sends me in chat the usage that was in the plugin.yml! Like nothing works but sending this message!
     
  4. Offline

    Zettelkasten

    Geekhellmc That sounds like your onCommand(..) method would return false.
     
  5. Offline

    Geekhellmc

  6. Offline

    Geekhellmc

    Zettelkasten Nope it return true.
    Code:java
    1. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    2. if (!(sender instanceof Player)) {
    3. MessageManager.getInstance().msg(sender, MessageTypie.BAD, "Only players can use the plugin!");
    4. return true;
    5. }
    6.  
    7. Player p = (Player) sender;
    8.  
    9. if (cmd.getName().equalsIgnoreCase("ssb")) {
    10. if (args.length == 0) {
    11. for (MagicCommand mc : cmds) MessageManager.getInstance().msg(p, MessageTypie.INFO, "/supersmashbender " + aliases(mc) + " " + mc.getUsage() + " - " + mc.getMessage());
    12. return true;
    13. }
    14.  
    15. MagicCommand c = getCommand(args[0]);
    16.  
    17. if (c == null) {
    18. MessageManager.getInstance().msg(sender, MessageTypie.BAD, "That command doesn't exist!");
    19. return true;
    20. }
    21.  
    22. Vector<String> a = new Vector<String>(Arrays.asList(args));
    23. a.remove(0);
    24. args = a.toArray(new String[a.size()]);
    25.  
    26. c.onCommand(p, args);
    27.  
    28. return true;
    29. }
    30. return true;
    31. }
     
  7. Offline

    Rocoty

    Then that method is not the one being executed when the command is run. The plugin fails to properly set the executor for that command.
     
  8. Offline

    Geekhellmc

    I just figured out that the plugin works fine as long as I don't use the signs to join an arena. The problem is there.
     
Thread Status:
Not open for further replies.

Share This Page