This library is something a little bit different. So the first thing it provides is very simple: a massive smattering of utility classes.
- Tested Minecraft Versions:
- Source Code:
ItemUtil: for constructing various items in one line
InventoryUtil: for manipulating inventories
LoreUtil: at the moment this just has a colorizeLore method, but it saves tons of time
MetaUtil: various methods for metadata manipulation
Pair: A pair class that doesn't require javafx (so things can work without Java 8)
ReflectUtil: some helper methods for using reflection
SkullUtil: methods for modifying skulls
Second this plugin provides various useful classes and interfaces:
WeightedChooser: this lets you add items with weighted chances, and pull them out using that weighted chance. Far easier to use than EnumeratedRandom
TriConsumer: this is just a Consumer interface that accepts 3 objects
Defaultable: an interface that allows a base class for default values. Used for code uniformity, and to prevent nullpointers
Sliceable (interface), SliceableList: these classes provide tools for time slicing tasks. So let's say we have a list of 5000 tasks, and want to do 20-40 every few takes based on a piece of logic. This makes that trivially simple.
BatchedSliceableList provides a means of doing this in fixed batch sizes in a highly automated fashion.
RedPlugin: this is the key class here, and I'll explain in more detail below.
The third thing this plugin provides is a complete all-in-one databasing/caching solution. This is accomplished through 3 means:
1) RedPlugin uses a SubDatabase. Multiple SubDatabases can exist per RedPlugin instance. Each SubDatabase has a google Guava cache built in which uses the Defaultable interface, so you never nullpointer.
2) Provides a hikariCP-backed connection pool for SQL. Connections can be pulled from the individual SubDatabases.
3) Provides object-relational mappings via the ever-popular "hibernate" library. This means you will very rarely have to write raw SQL. Objects can be persisted into the database DIRECTLY using the HibernateUtil class.
Note: your sub plugins must provide their own mappings as in the example found in the jar ( hibernate.cfg.xml)
I hope you guys find this useful. This setup has created some incredibly powerful bukkit plugins. It has the potential to save you an ishload of development time.