- Native Minecraft Version:
- Tested Minecraft Versions:
Plugin Library is a plugin that allows developers to use the API's of other plugins without the need of importing the plugin itself onto the classpath. Plugin Library was created because the plugin Autorank loaded into a lot of different plugins. This resulted in a big clumsy mess of imports from all kinds of different plugins. To solve this issue, we created Plugin Library to manage all the connections to other API's. Since other developers may also find this handy, we decided to make it publicly available.
Automatically hooks into all plugins that it supports. Developers just have to hook into Plugin Library to use its API.
HOW TO USE (AS A SERVER OWNER):
Just download and drop this plugin into your plugins folder. It will do its magic from there!
Plugin Library currently supports these APIs:
HOW TO USE (AS A DEVELOPER):
- AFKTerminator v3.0.8
- Autorank v4.2.6
- Factions v2.14.0
- mcMMO v2.1.111
- OnTime v4.1.4
- RoyalCommands v4.1.1
- Stats v5.3.3
- UltimateCore v2.1.16
- RPGme v1.0.2
- AdvancedAchievements v5.13.1
- GriefPrevention v16.12.0
- WorldGuard v7.0.1
- WorldEdit v7.0.1
- uSkyBlock v2.8.5
- Quests v3.8.1
- EssentialsX v2.17.1
- BattleLevels v8.2.2
- ASkyBlock v184.108.40.206
- AcidIsland v220.127.116.11
- Jobs v4.14.3
- Vault 1.7
- Statz 1.5.3
- CMI 18.104.22.168
To use Plugin Library, you'll have to add a 'depend' in your plugin.yml.
Like this: .
Once you've done that, you can get access to the API of a plugin in two ways:
1. If you want to be sure that the plugin you're trying to reach is supported by Plugin Library, you can use. Library is an enum, which is provided by the me.staartvin.plugins.pluginlibrary.Library class.Code (Text):PluginLibrary.getLibrary(Library lib);
2. If you only know the (String) name of a library, you can use.Code (Text):PluginLibrary.getLibrary(String pluginName);
We want to know the archery level (mcMMO) of a specific player.
First, we get the LibraryHook:
LibraryHook hook = PluginLibrary.getLibrary(Library.MCMMO);
McMMOHook mcmmoHook = (McMMOHook) hook;
// To get useful information off of a hook, we need to cast it to a specific plugin.
int archeryLevel = mcmmoHook.getLevel(player, "archery");
Plugin Library v1.2.4
Allows developers to get a lot of data from other plugins without importing the API's themselves.