Add cancelable custom event for reporting of messages received from web
This commit is contained in:
parent
88fde1fcd6
commit
f4e9b8ffce
3 changed files with 43 additions and 4 deletions
31
src/main/java/org/dynmap/DynmapWebChatEvent.java
Normal file
31
src/main/java/org/dynmap/DynmapWebChatEvent.java
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package org.dynmap;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
|
||||
/**
|
||||
* Custom bukkit event, corresponding to the receiving of a web-chat message from a web UI user
|
||||
*/
|
||||
public class DynmapWebChatEvent extends Event implements Cancellable {
|
||||
private String source;
|
||||
private String name;
|
||||
private String message;
|
||||
private boolean cancelled;
|
||||
|
||||
public DynmapWebChatEvent(String source, String name, String message) {
|
||||
super("org.dynmap.DynmapWebChatEvent");
|
||||
this.source = source;
|
||||
this.name = name;
|
||||
this.message = message;
|
||||
this.cancelled = false;
|
||||
}
|
||||
public boolean isCancelled() { return cancelled; }
|
||||
|
||||
public void setCancelled(boolean cancel) { cancelled = cancel; }
|
||||
|
||||
public String getSource() { return source; }
|
||||
|
||||
public String getName() { return name; }
|
||||
|
||||
public String getMessage() { return message; }
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue