[SPIGOT-1284] Schedulers are not run before player-caused events are fired Created: 10/Nov/15 Updated: 30/Jun/16 Resolved: 30/Jun/16 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Major |
Reporter: | libraryaddict | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | None |
Description |
At line 708 in MinecraftServer is code that runs 'FutureTask's which are nms's equivelent of Schedulers. When the server receives an async packet from mojang, if its not a async supported action, its added to a FutureTask to be run on the main thread. The Bukkit Schedulers have its own internal field which it uses to determine when to run a scheduler, and the current tick of the scheduler stuff. This is updated by the main thread, after Future Tasks have finished. This means that if a player right clicks a block, the server will call the "PlayerInteractEvent" and the plugins listening for that event will fire a new scheduler for 5 ticks. This can be fixed by moving the scheduler code to occur before the FutureTask code. |