Package de.marcely.bedwars.api.message
Interface MessageAPI
public interface MessageAPI
Contains API for the process of messages and languages.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MessageAPI
get()
Returns the global MessageAPI instance.Returns all registered default mappings (This won't include the MBedwars' one).Returns the default MessageProcessor initiated by the MBedwars pluginA MessageProcessor overtakes the post processing of a message.
This includes: replacing placeholders, message placeholders and replacing chat color codes.
The methodMessage.done()
passes a message to the current set processorReturns all locales that are currently in memory.
Keep in mind that this may vary depending on the configuration of the user.
Does not include the default oneboolean
A mapping contains a collection of messages that'll be used when the user tries to obtain a message from his messages file that is however not present.void
setProcessor
(MessageProcessor processor) A MessageProcessor overtakes the post processing of a message.
This includes: replacing placeholders, message placeholders and replacing chat color codes.
The methodMessage.done()
passes a message to the current set processorboolean
Unregisteres an already registered mapping.
-
Method Details
-
getProcessor
MessageProcessor getProcessor()A MessageProcessor overtakes the post processing of a message.
This includes: replacing placeholders, message placeholders and replacing chat color codes.
The methodMessage.done()
passes a message to the current set processor- Returns:
- The current set processor
-
setProcessor
A MessageProcessor overtakes the post processing of a message.
This includes: replacing placeholders, message placeholders and replacing chat color codes.
The methodMessage.done()
passes a message to the current set processor- Parameters:
processor
- The new processor
-
getDefaultProcessor
MessageProcessor getDefaultProcessor()Returns the default MessageProcessor initiated by the MBedwars plugin- Returns:
- The default processor
-
getStoredLocales
Returns all locales that are currently in memory.
Keep in mind that this may vary depending on the configuration of the user.
Does not include the default one- Returns:
- The locales stored in memory
-
registerDefaultMappings
A mapping contains a collection of messages that'll be used when the user tries to obtain a message from his messages file that is however not present.This class is helpful for plugins that want to retain the users ability to customize the message. MBedwars will automatically unregister the mappings when the plugin is not loaded anymore.
- Parameters:
mappings
- The mappings that shall be registered- Returns:
true
if wasn't already present
-
unregisterDefaultMappings
Unregisteres an already registered mapping.- Parameters:
mappings
- The mappings that shall be registered- Returns:
true
if it has been found and unregistered
-
getDefaultMappings
Collection<DefaultMessageMappings> getDefaultMappings()Returns all registered default mappings (This won't include the MBedwars' one).- Returns:
- All registered mappings
-
get
Returns the global MessageAPI instance.- Returns:
- The global MessageAPI instance
-