Various utilities for easier programming in bukkit. Some might require protocol lib ( eks AdvancedChat). Everything is version independent and no NMS code has been used.
- Countdown - Easy way of creating a countdown. ( requires ProtocolLib for lower than 1.9.2)
- ItemMenus - Take an OOP approach to GUI based menus.
- RegionEvents - Region exit/enter events for WorldGuard. Supports 6.2 and up (including 7.0)
- OOP Bukkit Style Commands Create commands with sub commands, that support basic tabulation.
BookUtilsUse https://github.com/upperlevel/book-api this API is removed as other better apis exists. Link in to final published version.
Sorted from most to the least useful (for an average plugin)
- ConfigUtil Various utilities with bukkit YAML configuration.
- ChatUtil - Easier chat usage, including newline and tab fixer.
- FileUtils - Easily read and write files for a plugin.
- AdvancedChat - Use System and Action Bar for minecraft versions that doesn't support them, 1.8.x being one. (requires ProtocolLib for lower than 1.9.2)
- InventoryUtil - Get more control over Bukkit's inventories.
- MCConstans - Convert millisecond to tick and visa versa, also contains some time constants.
- OnJoinMessage - Let players get messages even if they're not on.
- WorldUtil - Get the highest valid block from a location.
- MultiPage - Create a help-ish menu but with any text.
- InterfaceImplManager Add an API layer to implementation of interfaces.
- EntityUtil Metadata utility for entities.
- Debuggable Simplify debugging of complex objects
- Nameable Forces an object to have a name and, optionally, a description
- Saveable Simple save and load methods
- ConfigurationSectionSavable Save/load an object to a ConfigurationSection
For more general java utilities see CommonUtilsJava
If BukkitUtil fails to build because it cannot find org.bukkit:bukkit:1.14.4-R0.1-SNAPSHOT
(or something similar) you need to locally build the spigot using
its BuildTools you can either do this manually (remember to build the correct version) or run the script setup.sh
found in the root folder.
Add my repo to your pom.xml
. https://raw.githubusercontent.com/rjenkinsjr/maven2/repo
and https://maven.sk89q.com/repo/
might also be needed
Then add this as a dependency under the dependencies
tag
<dependency>
<groupId>no.kh498.util</groupId>
<artifactId>BukkitUtil</artifactId>
<version>4.4.5</version>
</dependency>
You might also need to shade (read copy) the used classes into your jar. Add the following into your pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>shade</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<minimizeJar>true</minimizeJar> <!-- Only include packages that you are using. Note: Requires Java 1.5 or higher. -->
<artifactSet>
<includes>
<include>no.kh498.util:BukkitUtil</include>
</includes>
</artifactSet>
</configuration>
</plugin>
</plugins>
</build>
The following is a skeleton gradle.build file. NOTE the order of the methods is required as is below.
//setup shade (ie include the whole of this lib in your jar)
configurations {
shade
implementation.extendsFrom shade
}
repositories {
mavenCentral()
//your other repositories goes here
//my repo
maven { url "https://raw.githubusercontent.com/elgbar/maven2/repo" }
//these might be required
maven { url "https://raw.githubusercontent.com/rjenkinsjr/maven2/repo" } // needed by slf4bukkit (a logger)
maven { url "https://maven.sk89q.com/repo/" } //needed by WorldGuard
}
dependencies {
//your other decencies goes here
//use implementation if you do not want to include it in your jar
shade "no.kh498.util:BukkitUtil:4.4.5"
}
jar {
configurations.shade.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**', 'plugin.yml' //delete unwanted/duplicate stuff
}
}
}