For the complete documentation index, see llms.txt. This page is also available as Markdown.

๐Ÿ–ฅ๏ธFor Developers

UltimateGuilds ships an api module (com.ohalee.ultimateguilds.api) that exposes a stable, read/write interface to guild data. Add UltimateGuilds to your plugin.yml (depend or softdepend) so the API is loaded before your plugin.

Obtaining the API

The entry point is UltimateGuildsProvider. Call it once the UltimateGuilds plugin has enabled (for example inside your own onEnable), not from a constructor.

Accessing the API
UltimateGuilds api = UltimateGuildsProvider.get();
GuildManager guildManager = api.getGuildManager();
public interface UltimateGuilds {

    /**
     * The manager responsible for all guild operations.
     */
    @NotNull GuildManager getGuildManager();

}

GuildManager

GuildManager is the main service. Its methods fall into a few groups:

  • Database lookups โ€” blocking I/O that queries the database (e.g. loadGuild, find, getLogs, hasGuild).

  • Asynchronous modification โ€” non-blocking writes returning CompletableFuture (e.g. createGuild, renameGuild, addMember, banPlayer).

  • Server cache retrieval โ€” in-memory, non-blocking reads (e.g. getLoadedGuild, getCached, getLoadedGuilds).

  • Cosmetics & messaging โ€” suffix refreshing and cross-server message delivery.

Methods annotated @Blocking (and the loadGuild/find lookups) touch the database. Never call them on the main server thread โ€” use the cache methods there, or run the lookup asynchronously.

Guild

A Guild is the mutable model returned by the manager. It exposes the guild's identity, progression and roster.

Models

GuildMember, GuildRank, GuildBan and GuildInvite are lightweight, immutable models.

GuildRank is ordered so that a lower ordinal means a higher rank โ€” GUILD_MASTER is 0 and RECRUIT is the last value. Keep this in mind when comparing ranks (rank().ordinal() <= other.ordinal() means "at least as senior").

Last updated