This is the repository of the Cytooxien Realm API. Here you can find the wiki which contain basic information about the usage of this API.
Repository:
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
Dependencies:
<dependency>
<groupId>com.github.cytooxien</groupId>
<artifactId>realms-api</artifactId>
<version>3.0-20240519193357</version>
<scope>provided</scope>
</dependency>
Repository:
repositories {
maven {
url 'https://jitpack.io'
}
}
Dependencies:
dependencies {
compileOnly 'com.github.cytooxien:realms-api:3.0-20240519193357'
}
All providers are registered using Bukkit's internal ServicesManager
. This is how you get an instance of a provider:
RealmInformationProvider informationProvider = Bukkit.getServicesManager().load(RealmInformationProvider.class);
You can access the display system using the following code:
DisplayController controller = JavaPlugin.getPlugin(DisplayPlugin.class).displayController();
This is a quick example on how to change the prefix of a player:
DisplayController controller = JavaPlugin.getPlugin(DisplayPlugin.class).displayController();
MasterDisplayData masterDisplayData = controller.getCache().getMaster(player.getUniqueId());
// This sets prefix to "§a" for CHAT, TABLIST and NAMETAG
masterDisplayData.getPrefixes().forEach((displayTarget, map) -> map.put("group", "§a"));
You can edit the DisplayData for a special viewer:
DisplayController controller = JavaPlugin.getPlugin(DisplayPlugin.class).displayController();
DiffedDisplayData diff = controller.getCache().getDiff(player.getUniqueId(), viewer.getUniqueId());
diff.getSuffixes().get(DisplayTarget.TABLIST).put("party", "§8[§dParty§8]");