Simple API for Bukkit plugins
Also support Adventure components on modern PaperMC versions
- Texter
- DebugLogger
- ProgressbarCreator
- ItemCreator
Texter
Texter is a simple class that allows to send messages to players with a predefined prefix.
public static Texter texter;
private void testTexters() {
final String PREFIX = "&7[&6XaBasis&7] &r";
texter = new Texter(PREFIX);
texter.logConsole("&aThis is a test message");
Texter.logConsoleRaw("&aThis is a also test message, but without a prefix :(");
Player player = Bukkit.getPlayer("PlayerName");
texter.response(player, "&aHello!");
}DebugLogger
DebugLogger allows to log messages into a file. It is useful for debugging purposes.
public static DebugLogger debugLogger;
File logFile = new File(getDataFolder(), "log.txt");
debugLogger = new DebugLogger(logFile);
debugLogger.setIgnoreErrors(true);
debugLogger.setPattern("{%d--%i} -> %t | %m | %o");
debugLogger.init();
// Let's imagine that we are calling a SQL query, and we want to log it and also log the elapsed time that it took to execute the query
debugLogger.log("Calling SQL QUERY", LogType.CALL);
debugLogger.log("COLUMS: 2", LogType.RESULT, 871L, TimeUnit.MILLISECONDS);