Quick Start
Install the library
This is the ways to access the API:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.broken1arrow.Utility-Library</groupId>
<artifactId>Utility-Library</artifactId>
<version>0.51</version>
<scope>provided</scope>
</dependency>
</dependencies>
How to use the library
This guide provides suggestions on how to load the different modules of the library into your project. Please note that there are minor differences if you plan to use the menu library and only want to depend on this library and the Utility Library plugin. For more details, refer to the following instructions below.
Classes you load ones.
These classes are designed to be instantiated only once in your code. It is recommended to create a single instance of each class.
Menu API
A class used for registering and utilizing the menu API. This class provides various methods that can be accessed from the library, especially if you have added the ItemCreator and NBT module to the dependency's. Refer to Menu api for more information.
RegisterMenuAPI menuAPI = new RegisterMenuAPI(plugin);
CommandRegister
A class used for registering commands. This class is responsible for caching your commands and ensuring thread safety when modifying the cache. It offers methods for registering and removing subcommands, as well as registering the main command. Refer to Command for more information.
CommandRegister commandRegistering = new CommandRegister()
ItemCreator
A class used for creating items. This class adds support for both old and new naming conventions of items. You can use the 1.13+ item names, and if you are running an older version, it will automatically convert them to the old naming format as long as the item exists in that version. Refer to ItemCreator for more information.
ItemCreator itemCreator = new ItemCreator(plugin);
Classes you extend.
These are classes that you can directly extend and use in your code. They provide reusable functionality and are not limited to a single instance.
SimplePrompt
A class that extends the SimplePrompt
class. It is used to create prompts and write the code that will be executed. Refer to Conversation for more information.
public class ExampleSimplePrompt extends SimplePrompt{}
SimpleConversation
A class that extends the SimpleConversation
class. It is used for players to type in chat what they want the code to do. For example,you can use it for naming items or changing their player name. Refer to Conversation for more information.
public class ExampleSimpleConversation extends SimpleConversation{}
CommandHolder
CommandHolder
A class that extends the CommandHolder
class. This extension is used to create subcommands for your plugin, which can then be registered. Refer to Command for more information.
public class ExampleCommand extends CommandHolder{}
MenuHolder
A class that extends the MenuHolder
class. It is used to create simple menus and also supports filling items. Instead of setting the type of class for the objects in your list, you use objects directly. Refer to Menu api for more information.
public class Menu extends MenuHolder {}
GenericMenuHolder
A class that extends the GenericMenuHolder<T>
class. It allows you to set the type you have in your list, and otherwise works the same as the MenuHolder
class. Refer to Menu api for more information.
public class GenericMenu extends GenericMenuHolder<T> {}
YamlFileManager
A class that extends the YamlFileManager
class. It aids in creating files easily, loading settings or data, saving files, and updating data without removing comments. Refer to Yaml Utility for more information.
public class Settings extends YamlFileManager {}
Classes you implement
This library provides several classes that you can implement based on your specific requirements.
ConfigurationSerializable
The ConfigurationSerializable
interface, allowing easy serialization and deserialization of configuration data. Refer to Configuration Serialization for more information.
public class SettingsData implements ConfigurationSerializable {}
ParticleEffectAccessor
The ParticleEffectAccessor
interface, providing utility methods for managing particle effects. Refer to Particles for more information.
public class ParticleClass implements ParticleEffectAccessor {}
Last updated