About NegiLib
In EasyMenu 7, UI rendering operations have been cleanly separated into an independent rendering engine named NegiLib.
This page explains why NegiLib is used by EasyMenu and details the developer API for integrating with EasyMenu from external plugins.
Why Separate the UI Renderer?
Traditional menu plugins tightly couple YAML configuration parsing with Bukkit inventory manipulation code.
EasyMenu 7 establishes a clear separation of concerns:
EasyMenu 7 = YAML parsing, menu semantics, actions, condition evaluation, session state
NegiLib 1 = UI rendering, session transport, Folia scheduling, server platform abstraction
Key Advantages
- Unified Configuration for Multiple UIs: EasyMenu decides what to display, while NegiLib determines how to draw it on the current server version. The same YAML works seamlessly for both Chest UIs and Native Dialogs.
- High Concurrency & Stability: NegiLib coordinates asynchronous and main-thread operations across Folia's region scheduler, providing thread safety and high performance across Paper, Purpur, and Folia.
- Future Extensibility: Support for new client interfaces can be introduced without changing EasyMenu YAML syntax or breaking existing menus.
Developer API (EasyMenuApi)
If your plugin needs to programmatically open EasyMenu menus for players, use the official EasyMenuApi.
Maven Dependency
<dependency>
<groupId>org.mituba01</groupId>
<artifactId>easymenu</artifactId>
<version>7.0.1</version>
<scope>provided</scope>
</dependency>
Java Usage Example
import org.mituba01.easymenu.api.EasyMenuProvider;
import org.bukkit.entity.Player;
public void openShopMenu(Player player) {
EasyMenuProvider.get().ifPresent(api -> {
// Check if menu is loaded
if (api.isMenuLoaded("shop")) {
// Open menu for the player
api.open(player, "shop");
}
});
}
The public EasyMenuApi interface exposes open, isMenuLoaded, and reload methods.