[REQUEST] Cancel your Commands

Discussion in 'Plugin Development' started by LRFLEW, Jan 25, 2011.

?

Should we cancel our Commands

  1. Yes, let's not confuse other people's plugins

    7 vote(s)
    77.8%
  2. No, I'm too lazy to change this for my plugin

    0 vote(s)
    0.0%
  3. I don't care, just shut up!!!

    2 vote(s)
    22.2%
Thread Status:
Not open for further replies.
  1. Offline

    LRFLEW

    I need to get this off my chest.

    Every event has a setCanceled(boolean); function in it; even commands do. I realized with my plugin http://forums.bukkit.org/threads/1753/ that nobody seems to cancel them.

    I am requesting that any time you create a command, you use this as a template:

    Code:
        @Override
        public void onPlayerCommand (PlayerChatEvent event) {
            if (!event.isCancelled() && (event.getMessage().toLowerCase().startsWith("/*command*"))) {
                event.setCancelled(true);
    
                //Insert Command Junk Here
    
            }
        }
    That way no double-commands occur and any plugins set to Monitor can see if a plugin got used.

    LRFLEW

    P.S. added a poll to see if anybody agrees with me
     
  2. Offline

    Mattie

    I thought the eventual plan was that no one use onPlayerCommand() and just use onCommand() so that there aren't conflicts.
     
  3. Offline

    LRFLEW

    Maybe that's the eventual plan, but it's not implemented yet. For the time being, everybody should do this.
     
Thread Status:
Not open for further replies.

Share This Page