Logo

KeesLib

Maven Release Javadocs GitHub code size in bytes GitHub
This is a library I use for my plugins to make my life easier. But you can use it too! How? Just take a look!

It contains a few methods for checking bukkit versions and if certain dependencies are enabled on the server. It also has an amazing UpdateChecker!

Setup


								<dependency>
									<groupId>dev.casiebarie</groupId>
									<artifactId>KeesLib</artifactId>
									<version>{VERSION}</version>
								</dependency>
							
implementation group: 'dev.casiebarie', name: 'KeesLib', version: '{VERSION}'
implementation 'dev.casiebarie:KeesLib:{VERSION}'
implementation("dev.casiebarie:KeesLib:{VERSION}")
libraryDependencies += "dev.casiebarie" % "KeesLib" % "{VERSION}"
<dependency org="dev.casiebarie" name="KeesLib" rev="{VERSION}"/>

								@Grapes(
									@Grab(group='dev.casiebarie', module='KeesLib', version='{VERSION}')
								)
							
[dev.casiebarie/KeesLib "{VERSION}"]
'dev.casiebarie:KeesLib:jar:{VERSION}'

Import

To start you first have to import the libary and provide your main class that extends JavaPlugin.


							import dev.casiebarie.keeslib.KeesLib;
							...
							KeesLib keeslib = new KeesLib(JavaPlugin plugin);
						

Methods

  • .createLogger()

    Changes the prefix of the plugin logger to the value `Prefix:` in the `plugin.yml` with ChatColor support. You have to override the default logger with this.

  • .hasPlaceholerAPI();

    Returns true when PlaceholderAPI is enabled in the server.

  • .hasVault(Boolean economy, Boolean permissions, Boolean chat)

    Returns true if Vault is enabled and all the servicemanagers are registered.

  • .hex(String msg)

    Translates all the #HEX codes in the message to ChatColor codes.

  • .isLegacy(Double lowestVersion, Double highestVersion)

    Checks if the server is legacy and disables the plugin if the version is lower than the lowestversion. If the version is higher than the highest it will send a warning.

  • .roundNumber(Number number)

    Rounds the specified number and returns it as a String. (E.g. 3748 to 3.7K)

Update Checker

This library also has a fancy Update Checker. The ultimate tool for ensuring your plugin users are always up-to-date with the latest features, bug fixes, and improvements.

Initialise the update checker using this and specify your Spigot resourceid:

new keeslib.updateChecker(Integer recourceID)

After that you can customize your update checker using these methods:

  • .setPluginName(String name)
  • .setBorderColor(ChatColor color)
  • .setTextColor(ChatColor color)
  • .setNameColor(ChatColor color)
  • .setNewVersionColor(ChatColor color)
  • .setCurrentVersionColor(ChatColor color)
  • .setUrlColor(ChatColor color)
  • .setBorderCharacter(Character character)
  • .setPermission(String permission)
  • .setUpdateFrequency(Long frequency, TimeUnit timeUnit)

After the customization you start the updatechecker by calling:

.startChecking();
Music Preview