Skip to content

xap3y/XaBasis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XaBasis

Simple API for Bukkit plugins
Also support Adventure components on modern PaperMC versions

Javadocs

Features

  • Texter
  • DebugLogger
  • ProgressbarCreator
  • ItemCreator

Features details

Texter

Texter is a simple class that allows to send messages to players with a predefined prefix.

Example of usage

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.

Example of usage

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);

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages