Support (custom) filterable privacy state.

This commit is contained in:
Major-
2014-02-15 03:12:09 +00:00
parent e89214e7be
commit 72f00e2fbe
3 changed files with 26 additions and 2 deletions
@@ -20,7 +20,17 @@ public final class ServerMessageEvent extends Event {
* @param message The message. * @param message The message.
*/ */
public ServerMessageEvent(String message) { public ServerMessageEvent(String message) {
this.message = message; this(message, false);
}
/**
* Creates a server message event.
*
* @param message The message.
* @param filterable If the message can be filtered.
*/
public ServerMessageEvent(String message, boolean filterable) {
this.message = message + (filterable ? ":filterable:" : "");
} }
/** /**
+9
View File
@@ -692,6 +692,15 @@ public final class Player extends Mob {
send(new ServerMessageEvent(message)); send(new ServerMessageEvent(message));
} }
/**
* Sends a message to the player.
*
* @param message The message.
*/
public void sendMessage(String message, boolean filterable) {
send(new ServerMessageEvent(message, filterable));
}
/** /**
* Sends the quest interface * Sends the quest interface
* *
@@ -26,7 +26,12 @@ public enum PrivacyState {
/** /**
* Represents the 'off' state, when only messages from moderators are displayed. * Represents the 'off' state, when only messages from moderators are displayed.
*/ */
OFF(3); OFF(3),
/**
* Represents the 'filterable' state - a custom state that filters 'unnecessary' server messages.
*/
FILTERABLE(4);
/** /**
* Gets the privacy state for the specified numerical value. * Gets the privacy state for the specified numerical value.