This API supports all versions >= 1.20.6!
Maven
<repository>
<id>roxymc-releases</id>
<name>RoxyMC Repository</name>
<url>https://repo.roxymc.net/releases</url>
</repository>
<repository>
<id>roxymc-snapshots</id>
<name>RoxyMC Repository</name>
<url>https://repo.roxymc.net/snapshots</url>
</repository>
<dependency>
<groupId>me.glicz</groupId>
<artifactId>inventoryapi-api</artifactId>
<version>VERSION</version>
</dependency>
Gradle
maven {
name = "roxymcReleases"
url = uri("https://repo.roxymc.net/releases")
}
maven {
name = "roxymcSnapshots"
url = uri("https://repo.roxymc.net/snapshots")
}
dependencies {
implementation("me.glicz:inventoryapi-api:VERSION")
}
If you want to shade this API into your plugin, you have to load it in onEnable()
@Override
public void onEnable() {
GlitchInventoryAPI.init(new GlitchInventoryAPIImpl(GlitchInventoryAPIConfig.create(this)));
}
GlitchInventory.simple(3) // Create simple inventory with 3 rows (Bukkit InventoryType can be also used)
.title(Component.text("GlitchInventoryAPI")) // Set title to GlitchInventoryAPI
.item(10, ItemBuilder.itemBuilder(Material.STONE).asGuiItem(e -> {
e.player().sendMessage("Simple GUI created with GlitchInventoryAPI!");
})) // Set slot to stone item with click action
.open(player); // Open inventory to player