FoundryAPi
Package: me.that1koda.foundry.api. Addons receive this interface in FoundryAddon.onEnable(api).
| Property | Type | Purpose |
|---|---|---|
| plugin | Plugin | The Bukkit plugin instance. |
| abilities | AbilityRegistry | Register, find, enumerate, and unregister abilities. |
| abilityService | AbilityService | Activate a registered ability by ID and context. |
| playerAbilities | PlayerAbilityService | Assign, retrieve, remove, or clear player action bindings. |
| itemAbilities | ItemAbilityService | Assign, retrieve, or remove an ability ID on an item. |
FoundryAddon
Package: me.that1koda.foundry.api.addon. Implement id and version, then implement onEnable(api). onDisable() has a default empty implementation; see the addon lifecycle note because the current core does not invoke it on shutdown.
Ability and AbilityContext
| Member | Signature / default | Behavior |
|---|---|---|
| id | val id: String | Ability identifier. Registration rejects blank and duplicate IDs. |
| cooldownSeconds | val cooldownSeconds: Long = 0L | Cooldown duration. Positive values are applied after a successful activation. |
| actions | val actions: Set<Action> = emptySet() | Declared property; currently not consulted by the activation listener. |
| activate | fun activate(context: AbilityContext) | Runs the ability implementation. |
| AbilityContext.player | Player | Player passed to the activation. |
| AbilityContext.id | String | ID supplied to AbilityService.activate(). |
Registry and services
| Interface | Methods |
|---|---|
| AbilityRegistry | register(base), unregister(id): Boolean, get(id): Ability?, getAll(): Collection<Ability>, isRegistered(id): Boolean |
| AbilityService | activate(id, context): Boolean |
| PlayerAbilityService | assign(player, action, abilityId), remove(player, action), get(player, action): String?, clear(player) |
| ItemAbilityService | assign(item, abilityId), remove(item), get(item): String? |
Action enum
Package: me.that1koda.foundry.api.activation. Action contains LEFT_CLICK, RIGHT_CLICK, SHIFT_LEFT_CLICK, SHIFT_RIGHT_CLICK, OFFHAND_LEFT_CLICK, OFFHAND_RIGHT_CLICK, OFFHAND_SHIFT_LEFT_CLICK, and OFFHAND_SHIFT_RIGHT_CLICK.