MCBans/MCBans — pull request #53 by syamn (2012-10-14 17:53:19+00:00)
Title: Add custom events.

## Add custom bukkit events!
* PlayerBanEvent (Cancellable)
* PlayerGlobalBanEvent (Cancellable)
* PlayerLocalBanEvent (Cancellable)
* PlayerTempBanEvent (Cancellable)
* PlayerBannedEvent

* PlayerUnbanEvent (Cancellable)
* PlayerUnbannedEvent

* PlayerKickEvent (Cancellable)

## Example
```Java
import com.mcbans.firestar.mcbans.events.PlayerBannedEvent;

public class MCBansListener implements Listener {
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerBan(final PlayerBanEvent event){
if (event.getPlayerName().equalsIgnoreCase("syamn")){
if (!event.getSenderName().equalsIgnoreCase("console")){
Player p = Bukkit.getPlayer(event.getSenderName());
if (p != null && p.isOnline()){
p.sendMessage("Cannot issue ban to this player!");
}
}else{
log.info("Cannot issue ban to this player!");
}
event.setCancelled(true);
}
}

@EventHandler
public void onPlayerBanned(final PlayerBannedEvent event){
if (!event.isGlobalBan()) return;

final String ip = event.getPlayerIP();
String ipstr = (ip != null && ip.length() > 0) ? "[" + ip + "]" : "";
Twitter.tweet(event.getPlayerName + ipstr + " has been globally banned by " + event.getSenderName + "!");
log.info("Tweet posted by server account!");
}
```