PrimalLib is a library designed specifically for Paper (not Spigot) plugins, offering a range of additional features that are not included in the standard API, developed with flexibility and efficiency in mind.
-
Advancements API
- PrimalLib allows developers to fully manage advancements visible to each player, including modification of currently existing advancements.
-
Auth API
- PrimalLib contains multiple classes for easier interactions with Mojang services for getting player skins and UUIDs.
-
Client Configuration
- PrimalLib allows to move clients in and out of configuration state and modify registries and tags sent to the client without disconnecting it.
-
NBT Integration
- PrimalLib integrates Adventure's NBT library for ItemStacks and PDC holders.
- Adventure NBT is utilized at other places as well such as data-driven registries.
-
And More
- These are only some of the extra features PrimalLib offers. Developers are encouraged to explore the source code and discover additional APIs! :)
PrimalLib utilizes the newly introduced bootstrapper API for Paper plugins. To use it you need to replace the plugin's bootstrapper with one provided by PrimalLib that will delegate all methods calls to the original one (so no functionality is lost). This allows PrimalLib to register its own listeners and services without the requirement of extra plugin dependency or other special initialization.
Here's an example of paper-plugin.yml
for a plugin using PrimalLib.
# PrimalLib's bootstrapper
bootstrapper: org.machinemc.primallib.internal.PrimalLibBootstrap
# Plugin's own bootstrapper
delegate-bootstrapper: foo.bar.Bootstrap
Working example can be seen in the test-plugin
module in this project.
Note
If you relocate the PrimalLib package, do not forget to change the path for the bootstrapper.
PrimalLib is free software licensed under the MIT license.