event.setCancelled(true) not firing as it should be.

XMLWordPrintable

    • Type: Bug
    • Resolution: Invalid
    • Priority: Minor
    • Environment:

      Windows 7
      Java 7
      Spigot Server 1.8

    • Commander - Own Plugin

      When checking for a command such as /op from a StringList and then canceling the usage of this, the event.setcancled(true); does not stop this from happening and it carries on regardless.

      CODE:

      List<String> logcommands = plugin.Config.getStringList("Misc.commandlogger.commands");
      for (String s : logcommands) {
      if (plugin.Config.getBoolean("Misc.commandlogger.enabled", true)) {
      if (message.startsWith(s))

      { event.setCancelled(true); BufferedWriter out = new BufferedWriter(new FileWriter("admincommands.log", true)); event.setCancelled(true); out.write("[Command Logger]" + " " + " " + player.getName() + " " + " " + message + "\r\n"); out.close(); }

      }

      }

            Assignee:
            Unassigned
            Reporter:
            KyleD1986
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: