How to synchronize a Thread to Bukkit ?

Discussion in 'Spigot Plugin Help' started by jakob1988, Feb 8, 2020.

  1. I was making an annotation manager for an advanced game API, but now I recognized that I have to use Multithreading. My main problem is that I don't want to use the bukkit schedulers because there are plugins who clean up the schedulers to boost up the server performance. So I decide to use the normal runnables from java but if I use methods from bukkit its always yelling that it isn't synchronized. What can I do to synchronize those threads?
     
  2. First of all, what plugins would clean the runnables? That's highly dangerous to do?!

    Second of all, it's telling you that because you're doing something that's unsupported for asynchronous interaction with the bukkit API. For example changing block type. What are you trying to do in your async thread?
     
  3. Teleport a Player, for example, it doesn't care about what because the data pool is not synchronized with Bukkit and I don't know how to synchronize them to bukkit.