Is getServer().dispatchCommand() thread safe?

Discussion in 'Plugin Development' started by Weasel_Squeezer, Dec 24, 2013.

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

    Weasel_Squeezer

    The title pretty much says it all. I am wondering if dispatching a command via console programmatically is thread safe as I need to execute this from an asynchronous thread. Or would I better off to schedule a synchronous task from the asynch thread that would execute the command?

    thanks
     
  2. Offline

    clienthax

    you'd be better off asking this one in the irc i believe.
     
  3. Offline

    RawCode

    commands executed inside main thread.
     
  4. Offline

    Skyost

    Yes.
    But you should use Bukkit.dispatchCommand(...) ;)
     
  5. the methode itself is threadsafe, however most commands call the bukkit api, so you can't reliable do this. I seen bugs caused by this
    Do it from the bukkit thread
     
Thread Status:
Not open for further replies.

Share This Page