Class ChatEvent
java.lang.Object
org.bukkit.event.Event
net.sacredlabyrinth.phaed.simpleclans.events.ChatEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class ChatEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
- Author:
- RoinujNosde
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionChatEvent(String message, ClanPlayer sender, List<ClanPlayer> receivers, ChatEvent.Type type) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPlaceholder(String placeholderName, String value) Adds a placeholder and its value to the chat messagestatic org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the message to be sentGets the placeholdersGets the message receiversGets the message sendergetType()Gets the chat typebooleanvoidremovePlaceholder(String placeholderName) Removes a placeholder from the chat messagevoidsetCancelled(boolean cancel) voidsetMessage(String message) Changes the chat messageMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
ChatEvent
public ChatEvent(String message, ClanPlayer sender, List<ClanPlayer> receivers, ChatEvent.Type type)
-
-
Method Details
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getType
Gets the chat type- Returns:
- the chat type
-
getPlaceholders
Gets the placeholders- Returns:
- an unmodifiable map of the placeholders
-
addPlaceholder
Adds a placeholder and its value to the chat message- Parameters:
placeholderName- the placeholder namevalue- the String to be replaced- Throws:
IllegalArgumentException- if one of the args are null; if one of the args are empty; if the placeholder name equals "clan", "nick-color", "player", "rank" or "message"
-
removePlaceholder
Removes a placeholder from the chat message- Parameters:
placeholderName- the placeholder name
-
getReceivers
Gets the message receivers- Returns:
- the receivers
-
setMessage
Changes the chat message- Parameters:
message- the new message
-
getMessage
Gets the message to be sent- Returns:
- the message
-
getSender
Gets the message sender- Returns:
- the sender
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-