Package com.nickuc.chat.api.events
Class ProxyPrivateMessageEvent
java.lang.Object
org.bukkit.event.Event
com.nickuc.chat.api.events.internal.nChatEvent
com.nickuc.chat.api.events.internal.MessageEvent<ProxyPrivateMessageEvent>
com.nickuc.chat.api.events.internal.MultiFragmentableMessageEvent<ProxyPrivateMessageEvent>
com.nickuc.chat.api.events.ProxyPrivateMessageEvent
- All Implemented Interfaces:
SpoofableEvent,org.bukkit.event.Cancellable
public class ProxyPrivateMessageEvent
extends MultiFragmentableMessageEvent<ProxyPrivateMessageEvent>
implements SpoofableEvent
Event triggered when a private message is received via proxy.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intSender to Target (preparation) Server: the same as the sender (server A). Available player instances: only the sender Available formats: target and spy. What is performed: translators are called to process internal tags.static final intSender to Target (ready) Server: the same as the target (server B). Available player instances: only the target Available formats: target and spy. What is performed: translators are called to process the external tags.static final intTarget to Sender (preparation) Server: the same as the target (server B). Available player instances: only the target Available formats: sender and spy. What is performed: translators are called to process internal tags.static final intTarget to Sender (ready) Server: the same as the sender (server A). Available player instances: only the sender Available formats: sender and spy. What is performed: translators are called to process the external tags.Fields inherited from class com.nickuc.chat.api.events.internal.MultiFragmentableMessageEvent
piecesFields inherited from class com.nickuc.chat.api.events.internal.MessageEvent
recipientsFields inherited from class com.nickuc.chat.api.events.internal.nChatEvent
cancelled, start -
Constructor Summary
ConstructorsConstructorDescriptionProxyPrivateMessageEvent(PrivateChannel privateChannel, UUID senderId, UUID targetId, String senderName, String targetName, String message, String serverName, int stage, String... formats) -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]getBungeeTellFormats(PrivateChannel channel, int stage) Deprecated.Gets the channel used in this event.getPiece(String tag, ProxyPrivateMessageEvent.Type type) static String[]getProxyTellFormats(PrivateChannel channel, int stage) Gets the player who produced this message.Gets the sender's format.Gets the UUID of the player who produced this message.Gets the server name who produced this message.Gets the spy's format.intgetStage()Returns the stage of this message.Optional<net.md_5.bungee.api.chat.TextComponent> getTag(String tag, ProxyPrivateMessageEvent.Type type) Deprecated.usegetTagComponent(String, Type)insteadgetTagComponent(String tag, ProxyPrivateMessageEvent.Type type) net.md_5.bungee.api.chat.TextComponentgetTagValue(String tag, ProxyPrivateMessageEvent.Type type) Deprecated.usegetTagComponent(String, Type)insteadGets the player who will receive this message.Gets the target's format.Gets the UUID of the player who will receive this message.booleanReturns if spoof mode is being used in this event.voidsetFormat(String format, ProxyPrivateMessageEvent.Type type) voidDefines that spoof mode will be used in this event.voidsetTag(String tag, Component component, ProxyPrivateMessageEvent.Type type) voidsetTag(String tag, String content, ProxyPrivateMessageEvent.Type type) voidsetTag(String tag, net.md_5.bungee.api.chat.TextComponent component, ProxyPrivateMessageEvent.Type type) Deprecated.usesetTag(String, Component, Type)insteadtoString()Methods inherited from class com.nickuc.chat.api.events.internal.MultiFragmentableMessageEvent
getFormat, getMessage, getOriginalMessage, getPiece, getPieces, getTag, getTags, setFormat, setMessage, setTag, setTagMethods inherited from class com.nickuc.chat.api.events.internal.MessageEvent
getRecipients, setRecipientsMethods inherited from class com.nickuc.chat.api.events.internal.nChatEvent
getHandlersMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronousMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.event.Cancellable
isCancelled, setCancelled
-
Field Details
-
STAGE_SENDER_PREPARING_MESSAGE
public static final int STAGE_SENDER_PREPARING_MESSAGESender to Target (preparation)- Server: the same as the sender (server A).
- Available player instances: only the sender
- Available formats: target and spy.
- What is performed: translators are called to process internal tags.
- See Also:
-
STAGE_SENDER_TO_TARGET
public static final int STAGE_SENDER_TO_TARGETSender to Target (ready)- Server: the same as the target (server B).
- Available player instances: only the target
- Available formats: target and spy.
- What is performed: translators are called to process the external tags.
- See Also:
-
STAGE_TARGET_PREPARING_MESSAGE
public static final int STAGE_TARGET_PREPARING_MESSAGETarget to Sender (preparation)- Server: the same as the target (server B).
- Available player instances: only the target
- Available formats: sender and spy.
- What is performed: translators are called to process internal tags.
- See Also:
-
STAGE_TARGET_TO_SENDER
public static final int STAGE_TARGET_TO_SENDERTarget to Sender (ready)- Server: the same as the sender (server A).
- Available player instances: only the sender
- Available formats: sender and spy.
- What is performed: translators are called to process the external tags.
- See Also:
-
ERR_PLAYER_IS_OFFLINE
public static final int ERR_PLAYER_IS_OFFLINE- See Also:
-
ERR_TELL_DISABLED
public static final int ERR_TELL_DISABLED- See Also:
-
ERR_TELL_IGNORED
public static final int ERR_TELL_IGNORED- See Also:
-
ERR_NOT_AUTHENTICATED
public static final int ERR_NOT_AUTHENTICATED- See Also:
-
-
Constructor Details
-
ProxyPrivateMessageEvent
-
-
Method Details
-
getProxyTellFormats
-
getBungeeTellFormats
Deprecated.usegetProxyTellFormats(PrivateChannel, int)instead -
getSender
Gets the player who produced this message. -
getTarget
Gets the player who will receive this message. -
getSenderId
Gets the UUID of the player who produced this message. -
getTargetId
Gets the UUID of the player who will receive this message. -
isSpoofSend
public boolean isSpoofSend()Returns if spoof mode is being used in this event.- Specified by:
isSpoofSendin interfaceSpoofableEvent- Returns:
- true if spoof mode is being used
-
setSpoofSend
public void setSpoofSend()Defines that spoof mode will be used in this event.- Specified by:
setSpoofSendin interfaceSpoofableEvent
-
getChannel
Gets the channel used in this event. -
getStage
public int getStage()Returns the stage of this message.For more information, check out the
ProxyPrivateMessageEventclass fields. -
getServerName
Gets the server name who produced this message.- Returns:
- null if
getStage()is equal toSTAGE_SENDER_PREPARING_MESSAGE
-
getSenderFormat
Gets the sender's format.- Throws:
IllegalArgumentException- if thegetStage()does not support this methodIllegalStateException
-
getTargetFormat
Gets the target's format.- Throws:
IllegalArgumentException- if thegetStage()does not support this methodIllegalStateException
-
getSpyFormat
Gets the spy's format. -
getPiece
-
getPieces
-
getTagComponent
-
getTag
public Optional<net.md_5.bungee.api.chat.TextComponent> getTag(String tag, ProxyPrivateMessageEvent.Type type) Deprecated.usegetTagComponent(String, Type)instead -
getTagValue
@Nonnull public net.md_5.bungee.api.chat.TextComponent getTagValue(String tag, ProxyPrivateMessageEvent.Type type) Deprecated.usegetTagComponent(String, Type)instead -
setTag
-
setTag
public void setTag(String tag, net.md_5.bungee.api.chat.TextComponent component, ProxyPrivateMessageEvent.Type type) Deprecated.usesetTag(String, Component, Type)instead -
setTag
-
getFormat
-
setFormat
-
toString
-
getProxyTellFormats(PrivateChannel, int)instead