Skip to Content
APIAquaAPI

AquaAPI

A single, version-safe entry point to every Aquatic plugin installed on the server. Instead of hard-depending on each plugin, you ask the registry what is available and get back a typed service — or an empty Optional when the plugin is not installed.

Groupcom.github.aquatic-studios
ArtifactAquaAPI
ProvidedBy AquaCore 2.0+
Java17+
ScopecompileOnly / provided

Installation

build.gradle.kts
repositories { maven("https://jitpack.io") } dependencies { compileOnly("com.github.aquatic-studios:AquaAPI:2.0.0") }
plugin.yml
softdepend: [AquaCore, AquaTags]

Use softdepend, not depend. The whole point of the registry is that your plugin keeps working when an Aquatic plugin is missing.

Looking up a service

import com.aquaticstudios.api.AquaAPI; import com.aquaticstudios.api.tags.TagService; AquaAPI.service(TagService.class).ifPresent(tags -> { tags.equipped(player).ifPresent(tag -> getLogger().info(player.getName() + " is wearing " + tag.id()) ); });
ServiceProvided bySince
BroadcastServiceAquaCore2.0.0
MessageServiceAquaCore2.0.0
HeadServiceAquaCore2.0.0
TagServiceAquaTags1.3.0
CrateServiceAquaCratesunreleased

Checking what is installed

if (AquaAPI.isPresent("AquaTags")) { // AquaTags is installed and enabled } AquaAPI.installed().forEach((name, version) -> getLogger().info(name + " " + version) );

Events

Registry-level events, all in com.aquaticstudios.api.event.

EventCancellableFired
AquaServiceRegisterEventNoA plugin publishes a service
AquaServiceUnregisterEventNoA plugin is disabled
AquaReadyEventNoEvery Aquatic plugin finished enabling
@EventHandler public void onReady(AquaReadyEvent event) { getLogger().info("Aquatic stack ready: " + event.services().size() + " services"); }

Do not resolve services inside your own onEnable. Plugin load order is not guaranteed — listen for AquaReadyEvent instead, or resolve lazily at the point of use.

Version guards

Every service carries the version of the plugin that published it, so you can degrade gracefully instead of throwing NoSuchMethodError.

AquaAPI.service(TagService.class).ifPresent(tags -> { if (tags.apiVersion().isAtLeast(1, 4)) { tags.setTemporary(player, "vip", Duration.ofHours(1)); } else { tags.equip(player, "vip"); } });

Stability contract

PackageStability
com.aquaticstudios.api.*Stable, semver
com.aquaticstudios.api.event.*Stable, semver
com.aquaticstudios.*.internal.*No guarantees, do not use

Deprecated methods survive at least one full minor cycle and always name their replacement in the @Deprecated annotation.

Last updated on