Using the new Register Event api

Discussion in 'Plugin Development' started by TheTrixsta, Mar 24, 2012.

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

    TheTrixsta

    is this used correctly?

    BlockListener Class:
    Code:
    @EventHandler
    public void onBlockPlace(BlockPlaceEvent e){
    //code
    }
    Main Class:
    Code:
    private final BlockListener blockListener = new BlockListener();
     
    public void onEnable(){
    PluginManager pm = getServer().getPluginManager();
    pm.RegisterEvents(blockListener, this);
    }
    is this correct? the new API is shit, i dont like it :/
     
  2. Offline

    Iron_Crystal

    That looks right, except I hope thats not all that you have in the Listener class
     
  3. Offline

    TheTrixsta

    yea i have the listener class implementing Listener
     
  4. Offline

    comp8nerd4u2

    :p Is there a particular reason why you don't like the new event system? I'm curious because I love it but I'm interested in the opinion of others. Not trying to be a troll or anything. Lol
     
  5. shouldn't it be registerEvents with a lower case r ?
     
    audhen likes this.
Thread Status:
Not open for further replies.

Share This Page