mcMMO/src/main/java/com/gmail/nossr50/events/chat/McMMOAdminChatEvent.java

63 lines
1.4 KiB
Java
Raw Normal View History

2012-04-18 19:01:07 +02:00
package com.gmail.nossr50.events.chat;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Called when a chat is sent to the admin chat channel
*/
public class McMMOAdminChatEvent extends Event implements Cancellable {
private boolean cancelled;
private String sender, message;
public McMMOAdminChatEvent(String sender, String message) {
this.sender = sender;
this.message = message;
}
/**
* @return String name of the player who sent the chat, or "Console"
*/
public String getSender() {
return sender;
}
/**
* @return String message that will be sent
*/
public String getMessage() {
return message;
}
/**
* @param message String message to be sent in chat
*/
public void setMessage(String message) {
this.message = message;
}
/** Rest of file is required boilerplate for custom events **/
private static final HandlerList handlers = new HandlerList();
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
/** Following are required for Cancellable **/
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}