<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>
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.Maxlego08:zMenu-API:VERSION'
}
@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;
}