-
Notifications
You must be signed in to change notification settings - Fork 30
Migrating to version 3
The new version 3.0 is especially needed to restructure the project's packages, previously everything was unified in a single package "me.saiintbrisson.minecraft", and also, everything that was created had to be compatible with previous versions so nothing could be changed if it would not break code compatibility.
To give you an idea, it has working code from 2016 using the first version of Inventory Framework that works perfectly in the latest version 2.5.4-rc.1.
But things get complicated when it comes to adding features, fixing bugs and so on, so now we have version 3.
- Relocation
- Platform Features
- Lombok-compatible API design
- Extensibility
- Pagination Changes
- New State Management System
- Rewriting your views
Everything that was in the "me.saiintbrisson.minecraft" package has been moved to "me.devnatan.inventoryframework" and subpackages.
An attempt has been made to preserve as many names as possible such as the root View name and context names to make relocation easier.
As of this new version 3, all of its views are designed with a single platform in mind, and when I say platform I mean: Bukkit, Sponge, Bungeecord, among others. Now you will have access to the APIs you are most familiar with like ItemStack
in Bukkit, ProxiedPlayer
in BungeeCord and more.
Previously it was not possible to use Lombok in views because it was mandatory to define a constructor and use super
to choose the properties and initial options of the view.
This has changed, now we have a method specifically for configuring the view and another specifically for defining the items that will be rendered.
So you can use all Lombok annotations naturally like this
@RequiredArgsConstructor
private final class PetShopView extends View {
private final PetsManager petsManager;
}
Perhaps the biggest change of all was on the pagination issue, the PaginatedView
class no longer exists. Now everything is handled through states so if you have a PaginatedView
, simply change it to a View
. Any and all views are now paginated if they have pagination state, and the IF internally takes care of everything else for you.
- public final class PetShopView extends PaginatedView<Pet>
+ public final class PetShopView extends View
The way paging was defined has also changed, before we had specific methods for each type of paging: static, dynamic computed and dynamic asynchronous, we don't have that anymore. Now the type of paging will depend on what kind of data source you provide for the paging state.
The new state handling came to make the data handling experience inside the view more reactive, easy and explicit.
Previously it was necessary to use a combination of context.set
, context.get
and context.update
together to get and update data and this was a bit strange because the Inventory Framework was not specifically written for this so some things they just didn't work which led to several issues.
- Installation
- Introduction
- Advanced Usage
- Built-In Features
- Extra Features
- Anvil Input
- Proxy Inventory