New Event System

Discussion in 'Bukkit Preview' started by md_5, Jan 20, 2012.

  1. Offline

    md_5

    As many of you may have noticed either by watching recent commits, the forums, or the sudden influx of yellow warnings in your code, we now have a new event system in Bukkit, largely thanks to zml2008
    The full system can be seen in this code below, but basically the event system is now much faster and sleeker. Instead of registering events based on there type, you can instead use annotations to do so:
    https://github.com/Bukkit/Bukkit/tree/e35037ab50157b006d00cba6d1b2c898e2bf5258
    I there is a preliminary tutorial available in the thread below, and relevant info will be on the wiki soon.
    http://forums.bukkit.org/threads/new-event-system.55249/
    In short you can now register any event type in any class and any method name:
    Short example:
    Code:
    @EventHandler
    public void whenPlayerMoves(final PlayerMoveEvent event){
    }
     
    mushroomhostage likes this.

Share This Page