Bukkit events - which are main-thread only?

Discussion in 'Bukkit Discussion' started by bergerkiller, Jan 25, 2012.

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

    bergerkiller

    As some may know, NoLagg offers a warning message when events are called from a thread other than the main thread to help explain various errors and odd behaviour.

    In the newest build(s) a new Event handler got introduced (which is a lot better). I now have the option to listen for all events (including custom types) to check if they are on the main thread, or to listen only for certain events.

    Which events can be considered main-thread only? Which events can be considered coming from different threads? In other words: which events require synchronization by the developer, and which don't?

    This is a semi-development question, but I feel it's better to post here since it is more related to Bukkit itself than plugin development.

    Events I consider main-thread only:
    Code:
    PLAYER_JOIN
    PLAYER_QUIT
    PLAYER_KICK
    PLAYER_MOVE
    PLAYER_TELEPORT
    PLAYER_CHANGED_WORLD
    PLAYER_ITEM_HELD
    BLOCK_PHYSICS
    BLOCK_FROMTO
    REDSTONE_CHANGE
    CREATURE_SPAWN
    ITEM_SPAWN
    PAINTING_BREAK
    PAINTING_PLACE
    CHUNK_LOAD
    CHUNK_UNLOAD
    WORLD_LOAD
    CHUNK_POPULATED
    WORLD_UNLOAD
    WORLD_INIT
    WORLD_SAVE
    SPAWN_CHANGE
     
  2. Offline

    md_5

    bergerkiller
    The only async one I can think of is onPlayerLoginPreprocess
     
Thread Status:
Not open for further replies.

Share This Page