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!

The library includes handy methods for checking Bukkit versions and verifying if certain dependencies are enabled on the server. Plus, it features an excellent 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 get started, you need to import the library and provide your main class that extends JavaPlugin.



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

Methods

  • .createLogger()
  • .hasPlaceholerAPI()
  • .hasVault(boolean economy, boolean permissions, boolean chat)
  • .hex(@Nonnull String msg)
  • .isLegacy(@Nonnull Double lowestVersion, Double highestVersion)
  • .roundNumber(@Nonnull Number number)
Updatechecker Preview

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 and specify your Spigot resourceId:

keeslib.updateChecker(@Nonnull Integer recourceId)

You can customize your update checker using these methods:


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

After the customization you start the updatechecker by calling:

.startChecking();