[API] MessageBuilder 1.1.0-SNAPSHOT

Easily create dynamic, formatted messages & load messages from configurations

  1. inventivetalent
    This API allows you to to create dynamic messages, load messages from configuration files and format the messages you created.


    Examples
    Add messages
    Code (Java):

    new MessageBuilder()
    .withMessage("test.message1", "This is the first test message")
    .withMessage("test.another.message", "This is another test message")
    .build();
     
    Load additional messages from the plugin's configuration file
    Code (Java):

    new MessageBuilder()
                    .withMessage("test.message1", "This is the first test message")
                    .withMessage("test.another.message", "This is another test message")
                    .fromConfig(myPlugin.getConfig())
                    .build();
     
    Access built messages
    Code (Java):

    MessageContainer container = new MessageBuilder()
    .withMessage("test.message1", "This is the first test message")
    .withMessage("test.another.message", "This is another test message")
    .build();
    container.getMessage("test.message1"); // Returns 'This is the first test message'
     
    Access built messages with additional replacements
    Code (Java):

    MessageContainer container = new MessageBuilder()
    .withMessage("test.message1", "This is the first test message")
    .withMessage("test.another.message", "This is another test message")
    .withMessage("test.formatted.message", "This is a formatted message for %player%")
    .build();
    container.getMessage("test.formatted.message", new ReplacementContainer().replace("%player%", player.getName())); //Returns (for example) 'This is a formatted message for inventivetalent'
     


    Maven
    Code (XML):

    <repositories>
       <repository>
           <id>inventive-repo</id>
           <url>https://repo.inventivetalent.org/content/groups/public/</url>
       </repository>
    </repositories>
    <dependencies>
       <dependency>
           <groupId>org.inventivetalent</groupId>
           <artifactId>messagebuilder</artifactId>
           <version>1.0.0</version>
       </dependency>
    </dependencies>
     


    Links
    Andres25558 likes this.

Recent Updates

  1. 1.11 support