API Modules
Docs/dominion-api/API Modules

API Modules

The public DominionAPI modules, package structure, and boundaries of each module.

Module overview

ModuleMain packagePurposeDetails
Main APIcn.lunadeer.dominion.apiGet the singleton, query data, check permissions, and access providersMain API
Providerscn.lunadeer.dominion.providersCreate, modify, and delete data in a controlled wayProviders
DTOs and data modelcn.lunadeer.dominion.api.dtosRepresent claims, members, groups, players, templates, and spatial rangesDTOs and data model
Flagscn.lunadeer.dominion.api.dtos.flagRead built-in flags, register custom flags, and organize UI groupsFlags
Eventscn.lunadeer.dominion.eventsListen for claim movement, data operations, and custom flag registrationEvents
Utilitiescn.lunadeer.dominion.utilsHandle colors, MCA region records, and cuboid rangesUtilities

Dependencies

A typical call path looks like this:

DominionAPI
  ├─ Query -> DominionDTO / MemberDTO / GroupDTO / PlayerDTO
  ├─ Permission -> PriFlag / EnvFlag
  ├─ Write -> DominionProvider / GroupProvider / MemberProvider / ...
  └─ Integration -> Dominion events

Most addons only need the main API, DTOs, Flags, and a few events. Add providers only when you actually need to create or modify Dominion data. The fact that an internal class is accessible does not make it part of the extension API.

How to choose a module

  • To display a claim name, boundary, or owner: use DTOs;
  • to check whether a player can perform an action: use DominionAPI.checkPrivilegeFlag(...);
  • to check a claim’s environment rule: use DominionAPI.checkEnvironmentFlag(...);
  • to rename a claim, add a member, or change a flag: use the corresponding provider;
  • to respond to claim entry or exit: listen for PlayerMoveInDominionEvent, PlayerMoveOutDominionEvent, or PlayerCrossDominionBorderEvent;
  • to add a rule configurable in the Dominion UI: register a custom flag and implement its actual behavior in the addon.