mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 16:49:11 +00:00
Support (custom) filterable privacy state.
This commit is contained in:
@@ -20,7 +20,17 @@ public final class ServerMessageEvent extends Event {
|
||||
* @param message The 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:" : "");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -692,6 +692,15 @@ public final class Player extends Mob {
|
||||
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
|
||||
*
|
||||
|
||||
@@ -26,7 +26,12 @@ public enum PrivacyState {
|
||||
/**
|
||||
* 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.
|
||||
|
||||
Reference in New Issue
Block a user