Developer API Starter - Multiverse/Multiverse-Core GitHub Wiki
This document outlines the basics of how plugin developers can read and modify Multiverse data to enhance world management on their server.
All Multiverse modules are hosted on our very own nexus repository.
Replace the [MODULE] placeholders with the various Multiverse modules:
- Core
- Inventories
- Portals
- NetherPortals
- SignPortals
As for the version, use the latest release version based on their respective Bukkit site.
<repositories>
<repository>
<id>OnARandomBox</id>
<url>https://repo.onarandombox.com/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.onarandombox.multiverse[MODULE]</groupId> <!-- Don't forget to replace this -->
<artifactId>Multiverse-[MODULE]</artifactId> <!-- Replace this as well -->
<version>[VERSION]</version> <!-- This too -->
<scope>provided</scope>
</dependency>
</dependencies>
Example
<dependencies>
<dependency>
<groupId>com.onarandombox.multiversecore</groupId>
<artifactId>Multiverse-Core</artifactId>
<version>4.3.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
repositories {
maven { url = "https://repo.onarandombox.com/content/groups/public/" }
}
dependencies {
compileOnly 'com.onarandombox.multiverse[MODULE]:Multiverse-[MODULE]:[VERSION]'
}
repositories {
maven("https://repo.onarandombox.com/content/groups/public/")
}
dependencies {
compileOnly("com.onarandombox.multiverse[MODULE]:Multiverse-[MODULE]:[VERSION]")
}
If you wish to download the dependency to classpath, you can do the following:
- Navigate to https://repo.onarandombox.com/content/groups/public/com/onarandombox/.
- Click into the directory of the Multiverse modules you wish to have.
- Select the
Multiverse-[MODULE]-[VERSION].jar
.
Multiverse-Core:
MultiverseCore core = (MultiverseCore) Bukkit.getServer().getPluginManager().getPlugin("Multiverse-Core");
Multiverse-Inventories
MultiverseInventories inventories = (MultiverseInventories) Bukkit.getServer().getPluginManager().getPlugin("Multiverse-Inventories");
Multiverse-Portals
MultiversePortals portals = (MultiversePortals) Bukkit.getServer().getPluginManager().getPlugin("Multiverse-Portals");
Multiverse-NetherPortals
MultiverseNetherPortals netherportals = (MultiverseNetherPortals) Bukkit.getServer().getPluginManager().getPlugin("Multiverse-NetherPortals");
To ensure that getting the plugin instance of Multiverse does not result in an NPE, for all the modules you use, you need to add them as depend
or softdepend
in plugins.yml
. As example as follows:
name: FlyPerms
main: dev.benergy10.flyperms
authors: benwoo1110
softdepend: ['Multiverse-Core', 'Multiverse-Inventories']
It is also possible to listen to PluginEnableEvent
and PluginDisableEvent
to detect when a Multiverse module is enabled/disabled.
We have curated a bunch of common usages for the various multiverse modules:
- Multiverse-Core API Usage
- Multiverse-Inventories API Usage
- Multiverse-Portals API Usage
- Multiverse-NetherPortals API Usage
- https://github.com/benwoo1110/Multiverse-CommandDestination
- https://github.com/benwoo1110/Multiverse-Patches
Feel free to join our discord or open an issue, people who can help will reply ;)