Interface MessageAPI
- 
Method SummaryModifier and TypeMethodDescriptionstatic MessageAPIget()Returns the global MessageAPI instance.Returns the default PlayerLocaleFetcher initiated by the MBedwars pluginReturns all registered default mappings (This won't include the MBedwars' one).Returns the default MessageProcessor initiated by the MBedwars pluginGet the active instance that fetches the locale of a player.A MessageProcessor overtakes the post processing of a message.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 onebooleanA 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.voidsetLocaleFetcher(PlayerLocaleFetcher fetcher) Set the active instance that fetches the locale of a player.voidsetProcessor(MessageProcessor processor) A MessageProcessor overtakes the post processing of a message.booleanUnregisteres an already registered mapping.
- 
Method Details- 
getProcessorMessageProcessor 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
 
- 
setProcessorA 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
 
- 
getDefaultProcessorMessageProcessor getDefaultProcessor()Returns the default MessageProcessor initiated by the MBedwars plugin- Returns:
- The default processor
 
- 
getLocaleFetcherPlayerLocaleFetcher getLocaleFetcher()Get the active instance that fetches the locale of a player.The locale is used to translate messages into the language of the player, if activated by the server-admin. - Returns:
- The current set fetcher
 
- 
setLocaleFetcherSet the active instance that fetches the locale of a player.The locale is used to translate messages into the language of the player, if activated by the server-admin. - Parameters:
- fetcher- The new fetcher
 
- 
getDefaultLocaleFetcherPlayerLocaleFetcher getDefaultLocaleFetcher()Returns the default PlayerLocaleFetcher initiated by the MBedwars plugin- Returns:
- The default fetcher
 
- 
getStoredLocalesReturns 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
 
- 
registerDefaultMappingsA 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:
- trueif wasn't already present
 
- 
unregisterDefaultMappingsUnregisteres an already registered mapping.- Parameters:
- mappings- The mappings that shall be registered
- Returns:
- trueif it has been found and unregistered
 
- 
getDefaultMappingsCollection<DefaultMessageMappings> getDefaultMappings()Returns all registered default mappings (This won't include the MBedwars' one).- Returns:
- All registered mappings
 
- 
getReturns the global MessageAPI instance.- Returns:
- The global MessageAPI instance
 
 
-