Code guide

Foundry classes

Here is what each type in the Foundry plugin does. Start with the Addon API if you are making an addon.

Open generated API docs

Addon API

Types addon developers use to make abilities and connect them to players.

InterfaceFoundryAPI

The API Foundry gives an addon when it starts. It provides the plugin, ability registry, ability runner, player assignments, and item data service.

me.that1koda.foundry.api
InterfaceFoundryAddon

The required shape of an addon. An addon provides an ID and version, then registers its abilities in onEnable().

me.that1koda.foundry.api.addon
InterfaceAbility

The required shape of an ability: an ID, an activate() function, and an optional cooldown.

me.that1koda.foundry.api.ability
Data classAbilityContext

The player and ability ID passed to an ability when Foundry runs it.

me.that1koda.foundry.api.ability
InterfaceAbilityRegistry

Lets addons register, find, list, and remove abilities.

me.that1koda.foundry.api.ability
InterfaceAbilityService

Runs an ability by ID. It returns false if the ability is missing or the player is on cooldown.

me.that1koda.foundry.api.ability
InterfacePlayerAbilityService

Saves which ability a player uses for each click action.

me.that1koda.foundry.api.ability
InterfaceItemAbilityService

Saves or reads an ability ID on an item. This does not make the item activate the ability yet.

me.that1koda.foundry.api.ability
EnumAction

The eight supported clicks: left or right, main hand or offhand, while sneaking or not sneaking.

me.that1koda.foundry.api.activation

Plugin classes

The classes Foundry uses to load addons and handle abilities.

Plugin classFoundry

The main Paper plugin. It creates the API, listens for player clicks, and loads addons when the server starts.

me.that1koda.foundry.core
ImplementationFoundryAPIImpl

Builds the API and connects it to the plugin's ability and data services.

me.that1koda.foundry.core.impl
ImplementationAbilityRegistryImpl

Keeps registered abilities in a map, rejects blank or duplicate IDs, and lets the API look them up.

me.that1koda.foundry.core.impl.ability
ImplementationAbilityServiceImpl

Finds the requested ability, checks the player's cooldown, runs it, and starts its next cooldown.

me.that1koda.foundry.core.impl.ability
ImplementationPlayerAbilityServiceImpl

Stores player-to-action ability assignments in each player's saved data.

me.that1koda.foundry.core.impl.ability
ImplementationItemAbilityServiceImpl

Stores an ability ID in an item's saved data. It only stores the ID; it does not trigger the ability.

me.that1koda.foundry.core.impl.ability
LoaderAddonLoader

Finds JAR files in plugins/Foundry/packs, reads each foundry.yml, loads the addon class, and calls onEnable().

me.that1koda.foundry.core.impl.addon
Private data classLoadedAddon

An internal record holding a loaded addon and the class loader that opened its JAR.

me.that1koda.foundry.core.impl.addon.AddonLoader
WrapperFoundryAddonImpl

Wraps a loaded addon and exposes its ID, version, and shutdown callback to the loader.

me.that1koda.foundry.core.impl.addon
Event listenerAbilityActivationListener

Checks player click events for an assigned ability and asks the ability service to run it.

me.that1koda.foundry.core.listeners
SingletonCooldownManager

Keeps cooldown end times in memory for each player and ability, and can read or clear them.

me.that1koda.foundry.core.utilities