🇮🇹
zMenu
Italian
Italian
  • Inizio
  • Plugin Supportati
  • Configurations
    • Informazioni
    • Comandi e Permessi
    • PlaceHolder
    • Come creare un menu passo passo
    • Menu
    • Bottoni/Tasti
      • Requisiti
      • Azioni
    • Oggetti
    • Schemi
    • Comandi
    • Dati dei giocatori
    • Config.json
  • API
    • Informazioni
    • Crea bottone/tasto
    • Crea Loader del Materiale
    • Crea ButtonOption
    • Carica Inventario/Menu
    • Eventi Veloci
  • Lista Files
  • Esempi Menus
Powered by GitBook
On this page
  • Maven
  • Gradle
  • First step
  1. API

Informazioni

API Information

PreviousConfig.jsonNextCrea bottone/tasto

Last updated 1 year ago

The zMenu API will allow you to create your own inventory and button. You can have the same configuration system for all your plugins.

Javadocs:

Example:

Last version here:

Maven

<repositories>
	<repository>
		<id>jitpack.io</id>
		<url>https://jitpack.io</url>
	</repository>
</repositories>

<dependencies>
	<dependency>
		<groupId>com.github.Maxlego08</groupId>
		<artifactId>zMenu-API</artifactId>
		<version>VERSION</version>
	</dependency>
</dependencies>

Gradle

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

dependencies {
		implementation 'com.github.Maxlego08:zMenu-API:VERSION'
}

First step

@Override
public void onEnable() {
    InventoryManager inventoryManager = getProvider(InventoryManager.class);
    ButtonManager buttonManager = getProvider(ButtonManager.class);
}

private <T> T getProvider(Class<T> classz) {
    RegisteredServiceProvider<T> provider = getServer().getServicesManager().getRegistration(classz);
    return provider == null ? null : provider.getProvider() != null ? (T) provider.getProvider() : null;
}

The first step is to get the and interface with the spigot service provider system.

https://javadocs.groupez.dev/zmenu/index.html
https://github.com/Maxlego08/zMenuExample
https://github.com/Maxlego08/zMenu-API/tags
InventoryManager
ButtonManager