Quark Oddities

Quark Oddities

22M Downloads

Quark accesses game objects off the main thread

Aaron1011 opened this issue ยท 0 comments

commented

DropoffHandler#execute interacts with the game in a number of ways, such as calling World#getTileEntityand Container#detectAndSendChanges. However, DropoffHandler#execute is called directly from a packet handler, which means that all of these operations take place off of the main thread.

While this often produces no visible exceptions, it's extremely easy to cause world corruption by accessing the game off the main thread. Since almost nothing in Minecraft is thread safe, all of these actions should be done on a scheduled task via MinecraftServer#addScheduledTask.