Class DenyChatReason<H extends DenyChatReasonHandler>
java.lang.Object
me.remigio07.chatplugin.api.server.chat.antispam.DenyChatReason<H>
- Type Parameters:
H
- Reason's handler
Represents the reason why a message may be prevented from being sent.
This class is a pseudo-Enum
. It contains the following methods:
name()
, ordinal()
, valueOf(String)
and values()
.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final DenyChatReason<ChatManager>
The messageString.isEmpty()
after stripping colors and removing spaces.static final DenyChatReason<AntispamManager>
The messageAntispamManager.exceedsMaxCapsLength(String)
andAntispamManager.exceedsMaxCapsPercentage(String)
and the sender does not have the permission "chatplugin.antispam.caps" or "chatplugin.antispam.bypass".static final DenyChatReason<AntispamManager>
TheAntispamManager.getFloodCache()
list contains the sender and they do not have the permission "chatplugin.antispam.flood" or "chatplugin.antispam.bypass".static final DenyChatReason<FormattedChatManager>
When the messageFormattedChatManager.containsFormattedText(String, List, boolean)
and the sender does not have the permission "chatplugin.formatted-chat".static final DenyChatReason<AntispamManager>
When the messageAntispamManager.containsDisallowedIP(String)
and the sender does not have the permission "chatplugin.antispam.bypass".static final DenyChatReason<MuteManager>
When the senderMuteManager.isMuted(OfflinePlayer, String)
.static final DenyChatReason<ChatManager>
WhenChatManager.isChatMuted()
== true
.static final DenyChatReason<AntispamManager>
TheAntispamManager.getSpamCache()
map contains the sender and they do not have the permission "chatplugin.antispam.spam" or "chatplugin.antispam.bypass".static final DenyChatReason<AntispamManager>
When the messageAntispamManager.containsBlacklistedWord(String)
and the sender does not have the permission "chatplugin.antispam.bypass".static final DenyChatReason<AntispamManager>
When the messageAntispamManager.containsDisallowedURL(String)
and the sender does not have the permission "chatplugin.antispam.bypass".static final DenyChatReason<VanishManager>
When the senderChatPluginServerPlayer.isVanished()
. -
Method Summary
Modifier and TypeMethodDescriptionGets this deny chat reason's handler's class.getMessage
(Language language) Gets this deny chat reason's message translated for the specified language.Gets this deny chat reason's message's path in the messages' files.name()
Equivalent ofEnum.name()
.int
ordinal()
Equivalent ofEnum.ordinal()
.static DenyChatReason<?>
Equivalent ofEnum#valueOf(String)
, with the only difference that instead of throwingIllegalArgumentException
null
is returned if the constant's name is invalid.static DenyChatReason<?>[]
values()
Equivalent ofEnum#values()
.
-
Field Details
-
BLANK_MESSAGE
The messageString.isEmpty()
after stripping colors and removing spaces.Handler:
ChatManager
Message path: "chat.no-blank-messages" -
CAPS
The messageAntispamManager.exceedsMaxCapsLength(String)
andAntispamManager.exceedsMaxCapsPercentage(String)
and the sender does not have the permission "chatplugin.antispam.caps" or "chatplugin.antispam.bypass".Handler:
AntispamManager
Message path: "chat.antispam.no-caps" -
FLOOD
TheAntispamManager.getFloodCache()
list contains the sender and they do not have the permission "chatplugin.antispam.flood" or "chatplugin.antispam.bypass".Handler:
AntispamManager
Message path: "chat.antispam.no-flood" -
FORMAT
When the messageFormattedChatManager.containsFormattedText(String, List, boolean)
and the sender does not have the permission "chatplugin.formatted-chat".Handler:
FormattedChatManager
Message path: "chat.no-format" -
IP_ADDRESS
When the messageAntispamManager.containsDisallowedIP(String)
and the sender does not have the permission "chatplugin.antispam.bypass".Handler:
AntispamManager
Message path: "chat.antispam.no-ip" -
MUTE
When the senderMuteManager.isMuted(OfflinePlayer, String)
.Handler:
MuteManager
Message path: "mute.no-chat" -
MUTEALL
-
SPAM
TheAntispamManager.getSpamCache()
map contains the sender and they do not have the permission "chatplugin.antispam.spam" or "chatplugin.antispam.bypass".Handler:
AntispamManager
Message path: "chat.antispam.no-spam" -
SWEAR
When the messageAntispamManager.containsBlacklistedWord(String)
and the sender does not have the permission "chatplugin.antispam.bypass".Handler:
AntispamManager
Message path: "chat.antispam.no-swear" -
URL
When the messageAntispamManager.containsDisallowedURL(String)
and the sender does not have the permission "chatplugin.antispam.bypass".Handler:
AntispamManager
Message path: "chat.antispam.no-url" -
VANISH
When the senderChatPluginServerPlayer.isVanished()
.Handler:
VanishManager
Message path: "vanish.no-chat"
-
-
Method Details
-
name
Equivalent ofEnum.name()
.- Returns:
- Constant's name
-
ordinal
public int ordinal()Equivalent ofEnum.ordinal()
.- Returns:
- Constant's ordinal
-
getMessagePath
Gets this deny chat reason's message's path in the messages' files.- Returns:
- Reason's message's path
-
getMessage
Gets this deny chat reason's message translated for the specified language.- Parameters:
language
- Language used to translate the message- Returns:
- Translated message
-
getHandlerClass
Gets this deny chat reason's handler's class.- Returns:
- Reason's handler's class
-
valueOf
Equivalent ofEnum#valueOf(String)
, with the only difference that instead of throwingIllegalArgumentException
null
is returned if the constant's name is invalid.- Parameters:
name
- Constant's name- Returns:
- Enum constant
-
values
Equivalent ofEnum#values()
.- Returns:
- Enum constants
-