public class AnnoyingMessage extends Stringable
MessagesOptions.fileName file| Constructor and Description |
|---|
AnnoyingMessage(@NotNull AnnoyingMessage message)
Constructs a new
AnnoyingMessage from another AnnoyingMessage (copy constructor) |
AnnoyingMessage(@NotNull AnnoyingPlugin plugin,
@NotNull java.lang.String key)
Constructs a new
AnnoyingMessage with the specified key |
AnnoyingMessage(@NotNull AnnoyingPlugin plugin,
@NotNull java.lang.String key,
boolean parsePapiPlaceholders)
Constructs a new
AnnoyingMessage with the specified key |
| Modifier and Type | Method and Description |
|---|---|
void |
broadcast(@NotNull BroadcastType type)
Broadcasts the message with the specified
BroadcastType and default title parameters |
void |
broadcast(@NotNull BroadcastType type,
@Nullable java.lang.Integer fadeIn,
@Nullable java.lang.Integer stay,
@Nullable java.lang.Integer fadeOut)
Broadcasts the message with the specified
BroadcastType and title parameters. |
@NotNull net.md_5.bungee.api.chat.BaseComponent[] |
getComponents()
Runs
getComponents(AnnoyingSender) using null |
@NotNull net.md_5.bungee.api.chat.BaseComponent[] |
getComponents(@Nullable AnnoyingSender sender)
Gets the message in
BaseComponents |
void |
log()
Runs
log(Level) using null |
void |
log(@Nullable java.util.logging.Level level)
Logs the message to the console with the specified
Level |
@NotNull AnnoyingMessage |
replace(@NotNull java.lang.String before,
@Nullable java.lang.Object after)
Replace a
String in the message with another Object |
@NotNull AnnoyingMessage |
replace(@NotNull java.lang.String placeholder,
@Nullable java.lang.Object value,
@Nullable ReplaceType type)
replace(String, Object) except using parameter placeholders |
void |
send(@NotNull AnnoyingSender sender)
Sends the message to the specified
AnnoyingSender |
void |
send(@NotNull org.bukkit.command.CommandSender sender)
Sends the message to the specified
CommandSender |
@NotNull java.lang.String |
toString()
Runs
toString(AnnoyingSender) using null |
@NotNull java.lang.String |
toString(@Nullable AnnoyingSender sender)
Gets the message using
getComponents(AnnoyingSender) then joins the BaseComponents together |
toStringpublic AnnoyingMessage(@NotNull
@NotNull AnnoyingPlugin plugin,
@NotNull
@NotNull java.lang.String key,
boolean parsePapiPlaceholders)
AnnoyingMessage with the specified keyplugin - pluginkey - keyparsePapiPlaceholders - parsePapiPlaceholderspublic AnnoyingMessage(@NotNull
@NotNull AnnoyingPlugin plugin,
@NotNull
@NotNull java.lang.String key)
AnnoyingMessage with the specified keypublic AnnoyingMessage(@NotNull
@NotNull AnnoyingMessage message)
AnnoyingMessage from another AnnoyingMessage (copy constructor)message - the AnnoyingMessage to copy@NotNull public @NotNull AnnoyingMessage replace(@NotNull @NotNull java.lang.String placeholder, @Nullable @Nullable java.lang.Object value, @Nullable @Nullable ReplaceType type)
replace(String, Object) except using parameter placeholdersplaceholder - the placeholder to replace (must have % on both sides)value - the Object to replace withtype - the DefaultReplaceType to use. If null, the replacement will be treated normallyAnnoyingMessage instancereplace(String, Object),
ReplaceType@NotNull public @NotNull AnnoyingMessage replace(@NotNull @NotNull java.lang.String before, @Nullable @Nullable java.lang.Object after)
String in the message with another Objectbefore - the String to replaceafter - the Object to replace withAnnoyingMessage instancereplace(String, Object, xyz.srnyx.annoyingapi.message.ReplaceType)@NotNull
public @NotNull net.md_5.bungee.api.chat.BaseComponent[] getComponents(@Nullable
@Nullable AnnoyingSender sender)
BaseComponentssender - the AnnoyingSender to useBaseComponentssend(AnnoyingSender)@NotNull public @NotNull net.md_5.bungee.api.chat.BaseComponent[] getComponents()
getComponents(AnnoyingSender) using nullBaseComponentssend(AnnoyingSender),
getComponents(AnnoyingSender)@NotNull
public @NotNull java.lang.String toString(@Nullable
@Nullable AnnoyingSender sender)
getComponents(AnnoyingSender) then joins the BaseComponents together
This will only have the display text of the components, use getComponents(AnnoyingSender) for all parts
sender - the AnnoyingSender to usegetComponents(AnnoyingSender)@NotNull public @NotNull java.lang.String toString()
toString(AnnoyingSender) using null
This will only have the display text of the components, use getComponents() for all parts
toString in class StringablegetComponents(),
toString(AnnoyingSender)public void broadcast(@NotNull
@NotNull BroadcastType type,
@Nullable
@Nullable java.lang.Integer fadeIn,
@Nullable
@Nullable java.lang.Integer stay,
@Nullable
@Nullable java.lang.Integer fadeOut)
BroadcastType and title parameters. fadeIn, stay, and fadeOut are 1.11+ only and will be ignored on older versionstype - the BroadcastType to broadcast withfadeIn - the fade in time for the titlestay - the stay time for the titlefadeOut - the fade out time for the titlebroadcast(BroadcastType)public void broadcast(@NotNull
@NotNull BroadcastType type)
BroadcastType and default title parameters
This is equivalent to calling broadcast(BroadcastType, Integer, Integer, Integer) with null for all title parameters
type - the BroadcastType to broadcast withbroadcast(BroadcastType, Integer, Integer, Integer)public void send(@NotNull
@NotNull AnnoyingSender sender)
AnnoyingSendersender - the AnnoyingSender to send the message tosend(CommandSender),
getComponents(AnnoyingSender)public void send(@NotNull
@NotNull org.bukkit.command.CommandSender sender)
CommandSender
This will convert the CommandSender to a AnnoyingSender and then run send(AnnoyingSender)
sender - the CommandSender to send the message tosend(AnnoyingSender)public void log(@Nullable
@Nullable java.util.logging.Level level)
Levellevel - the Level to log withpublic void log()
log(Level) using null