dispatchCommand

Discussion in 'Plugin Development' started by AinSophAur, Sep 30, 2011.

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

    AinSophAur

    I'm trying to send commands to my console and use this line:

    Everything works like its supposed to but the problem is I get double console output when I use it. I've tried getting a cast of ConsoleCommandSender but that doesn't seem to work. Anyone know how to block the second console output or a different way to do this?

    P.S. If I did everything in the same line, each time its called the console spams that many number of times this is called on, so that's why I kept the css variable away, to prevent forming new object each time. Unfortunately, the minimum I can get and keep the console output is 2 times, which is still one too many for me, but I don't want it to output more than it should have to.

     
  2. If I recall the changelog correctly, you should no longer create an own ConsoleCommandSender, but get the server's one. You can use getServer().getConsoleServer().
    I dunno if it was even added after the last RB, look at the changelog at ci.bukkit.org.

    edit: Oh well, it was in bukkit build 857, 855 was the RB ...
     
  3. Offline

    AinSophAur

    getConsoleSender () is there it looks like. I will try that thanks.

    The method getConsoleSender() is undefined for the type Server

    I guess not...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  4. Look at the edit in my post above.
    It was added after the last RB, and you probably compile against that.
     
Thread Status:
Not open for further replies.

Share This Page