MessageAPI
The Message class automatically formats and aligns text to display in player's chat window. Text that is too long will be split into multiple lines.
Imports:
package com.adamantdreamer.ui.message.Message package com.adamantdreamer.ui.message.MessageFormat
Basic Usage:
// Creates a format that's center aligned and red exclemation marks below and after the text. MessageFormat alertFormat = new MessageFormat(Message.Align.CENTER, ChatColor.RED + "! " + ChatColor.RESET, ChatColor.RED + " !"); Message.send(player, alertFormat, "Don't do that again");
Messages can also be pre-made and sent to multiple players over time:
Message greetings = new Message(MessageFormat.DEFAULT); MessageFormat titleFormat = new MessageFormat(Message.Align.Center); greetings.add(titleFormat, "Welcome to our server!"); // Using a seperate format for this one line greetings.add("Rules: No spamming, xray, or harrasement."); greetings.add("etc."); greetings.send(player);
Comments