public class AnnoyingMessage
extends java.lang.Object
AnnoyingOptions.messagesFileName file| Modifier and Type | Class and Description |
|---|---|
static class |
AnnoyingMessage.BroadcastType
The different types of broadcasts for an
AnnoyingMessage |
static class |
AnnoyingMessage.DefaultReplaceType
Default replace types for
replace(String, Object, ReplaceType) |
static interface |
AnnoyingMessage.ReplaceType
|
| Constructor and Description |
|---|
AnnoyingMessage(@NotNull AnnoyingPlugin plugin,
@NotNull java.lang.String key)
Constructs a new
AnnoyingMessage with the specified key |
| Modifier and Type | Method and Description |
|---|---|
void |
broadcast(@NotNull AnnoyingMessage.BroadcastType type)
Broadcasts the message with the specified
AnnoyingMessage.BroadcastType and default title parameters |
void |
broadcast(@NotNull AnnoyingMessage.BroadcastType type,
@Nullable java.lang.Integer fadeIn,
@Nullable java.lang.Integer stay,
@Nullable java.lang.Integer fadeOut)
Broadcasts the message with the specified
AnnoyingMessage.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 |
@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 AnnoyingMessage.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 |
public AnnoyingMessage(@NotNull
@NotNull AnnoyingPlugin plugin,
@NotNull
@NotNull java.lang.String key)
AnnoyingMessage with the specified keyplugin - the plugin getting the messagekey - the key of the message@NotNull public @NotNull AnnoyingMessage replace(@NotNull @NotNull java.lang.String placeholder, @Nullable @Nullable java.lang.Object value, @Nullable @Nullable AnnoyingMessage.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 AnnoyingMessage.DefaultReplaceType to use. If null, the replacement will be treated normallyAnnoyingMessage instancereplace(String, Object),
AnnoyingMessage.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, 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 java.lang.ObjectgetComponents(),
toString(AnnoyingSender)public void broadcast(@NotNull
@NotNull AnnoyingMessage.BroadcastType type,
@Nullable
@Nullable java.lang.Integer fadeIn,
@Nullable
@Nullable java.lang.Integer stay,
@Nullable
@Nullable java.lang.Integer fadeOut)
AnnoyingMessage.BroadcastType and title parameters. fadeIn, stay, and fadeOut are 1.11+ only and will be ignored on older versionstype - the AnnoyingMessage.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 AnnoyingMessage.BroadcastType type)
AnnoyingMessage.BroadcastType and default title parameters
This is equivalent to calling broadcast(BroadcastType, Integer, Integer, Integer) with null for all title parameters
type - the AnnoyingMessage.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)