Skip to content

Instantly share code, notes, and snippets.

@jmhertlein
Created June 29, 2012 23:41
Show Gist options
  • Select an option

  • Save jmhertlein/3021437 to your computer and use it in GitHub Desktop.

Select an option

Save jmhertlein/3021437 to your computer and use it in GitHub Desktop.
Listeners (CraftBukkit)
//let's say we're replacing this:
public MyChatListener extends ChatListener {
public void onPlayerChat(PlayerChatEvent event) {
//do something
}
}
//We'll change it to this:
public class MyCustomListener implements Listener {
@EventHandler
public void onPlayerSaySomething(PlayerChatEvent e) {
//do something
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment