Welcome to MenuMan
Implementation
Create a new MenuBuilder object and follow the fluent interface where it takes you.
ClickAction describes a functional interface that accepts MenuClick objects, a native encapsulation of InventoryClickEvent. You'll find that class comes with an easy-to-use (by method reference), static helper method for the simple action of closing a player's inventory. It looks like this in the wild:
import com.github.ms5984.lib.menuman.Menu;
import org.bukkit.plugin.java.JavaPlugin;
class MyMenuClass {
public MyMenuClass(JavaPlugin plugin) {
Menu menu = new MenuBuilder(rows, title)
.addElement(new ItemStack(Material.DIRT))
.setText("I've got a jar of dirt!")
.setLore("I've got a jar of dirt!")
.setAction(ClickAction::close) // Right here, it's a beaut.
.assignToSlots(0, 2).create(plugin);
}
}
Importing
Releases: Just add the following into your `pom.xml`. No additional repository needed!
<!-- For Maven Central releases -->
<dependencies>
<dependency>
<groupId>com.github.ms5984.lib</groupId>
<artifactId>menu-man</artifactId>
<version>1.0.3</version>
</dependency>
</dependencies>
Snapshots (requires sonatype repository)
<project>
<!-- For Sonatype Nexus snapshots (primary development here) -->
<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<!-- Optional: configure a custom artifact timeout -->
<updatePolicy>interval:5</updatePolicy>
<!-- re-downloads artifacts over five minutes old -->
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.ms5984.lib</groupId>
<artifactId>menu-man</artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
GitHub+Jitpack (requires jitpack repository)
<project>
<!-- For Jitpack pre-release, custom commit builds -->
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.ms5984</groupId>
<artifactId>MenuMan</artifactId>
<version>7b2da4f</version>
</dependency>
</dependencies>
</project>
As always, you are welcome to use the issue tracker, open a PR or contact me directly.
Thanks, Matt.
Licensing
My favorite license, the GNU LGPLv3.0. You are welcome to link from proprietary code as long as you disclose the linking and provide end users a way to find the source code they are using. Practically, this is as easy as providing said information with your usual packaging--and a quite simple way to get exact details down to the version is simply providing users a copy of your project's pom.xml. Note that I did not use the word "publishing"; the GPL and LGPL are specifically about empowering end users--and ultimately you still determine who those are and what (if anything) to charge them for it.
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta