Skip to content

DApi

One Java API for every Devamy plugin. Read balances, run moderation, find NPCs or listen to every suite event, all through DApi in DCore.

plugin APIs
18
methods
380
events
13
API version
1.0

Start here

  1. Step 1

    Depend on DCore

    Every API ships inside DCore. Add DCore as a dependency, and soft-depend on each plugin whose API you call so it loads first.

    depend: [DCore]
    softdepend: [DCurrency, DSell]
  2. Step 2

    Compile against the DCore jar

    Use the DCore.jar from your server as a compile-only dependency. Never shade it into your plugin.

    <dependency>
      <groupId>net.devamy</groupId>
      <artifactId>DCore</artifactId>
      <version>1.0</version>
      <scope>system</scope>
      <systemPath>${project.basedir}/libs/DCore.jar</systemPath>
    </dependency>
  3. Step 3

    Ask DApi

    Each plugin's API is an Optional: empty while that plugin is missing or off. Look it up when you need it instead of keeping it.

    DApi.points().ifPresent(points ->
        points.give(uuid, 50, Cause.of(this, "quest")));

Look it up each time

A plugin can be reloaded while the server runs. Call DApi.points() when you need it; a kept reference throws ModuleUnavailableException after its plugin turns off.

Mind the thread

Every method says which thread may call it. "any" is safe everywhere; anything touching a player or block runs on that region's thread on Folia.

Futures for storage

Reads and writes that hit the database return a CompletableFuture. Cheap in-memory reads answer right away.

One listener for everything

DApi.events().listen(plugin, priority, event -> ...) receives every suite event with its module and phase, or listen to single events with @EventHandler.

Pick a plugin

DApi

The entry point: typed accessors, module states and one listener for every suite event.

45 methods
class

ApiEvents

net.devamy.api

Listens to every module event with one call.

  • Registers one listener for every event that implements SuiteEvent. It only observes: cancelled events are skipped, and a change goes through the typed event. It runs on the thread that fires the event, sync or async as that event's javadoc says. Registrations end when the plugin disables.

    plugin
    the owning plugin
    priority
    the priority
    listener
    receives each event
class

DApi

net.devamy.api

The one entry point to every Devamy module API. It never keeps a service: each call looks the module up again, so a module reload is invisible to callers that use it per call.

DApi.points().ifPresent(points -> points.give(uuid, 50, Cause.of(this, "quest")));
PointsApi points = DApi.require(PointsApi.class);
enum

DModule

net.devamy.api

Every module of the suite, by the id that stays the same under a rebrand. New constants may be added.

  • AFK
  • ANTI_VPN
  • ANNOUNCE
  • AUCTION
  • BOUNTY
  • CLEAR_LAG
  • COMBAT
  • COMMANDS
  • CORE
  • CRATES
  • DEATHS
  • EFFECTS
  • ENDER_CHESTS
  • GAMES
  • HOLOGRAMS
  • HOMES
  • LINKS
  • KEY_ALL
  • KITS
  • LOOT_DROPS
  • MOB_TOGGLE
  • MOD
  • MONEY
  • CHAT
  • NPCS
  • ORDERS
  • POINT_SHOP
  • POINTS
  • GUARD
  • REPORTS
  • ROLLBACKS
  • RTP
  • RULES
  • SELL
  • SETTINGS
  • SHOP
  • SPAWNERS
  • SPAWN
  • STAFF
  • STATS
  • TAGS
  • TEAM
  • TOOLS
  • TPA
  • EXTRAS
  • VOTE
  • WARPS
  • WIPE
interface

ModuleHandle

net.devamy.api

A module as the API sees it: whether it runs, which version, which API it carries.

  • DModule module()
    thread: any

    Returns the module.

    returns
    the module
  • Returns why the module's API does or does not answer.

    returns
    the state
  • Returns the version of the module's plugin.

    returns
    the version, empty when the module is not installed
  • Returns the version of the module's API artifact that this server carries.

    returns
    the version, empty when the module has no API artifact yet
  • boolean hasApi()
    thread: any

    Tells whether the module has an API artifact.

    returns
    true when apiVersion() is present
  • Tells whether the module runs inside a host plugin rather than as its own jar.

    returns
    true when embedded
  • Returns the name players and admins see for the module, which a rebrand changes.

    returns
    the display name
  • Returns the module's plugin.

    returns
    the plugin, empty when it is not loaded
enum

ModuleState

net.devamy.api

Why a module's API does or does not answer. New constants may be added.

  • RUNNING
  • RELOADING
  • STOPPED
  • DISABLED
  • FAILED
  • NOT_INSTALLED
  • STALE
class

ModuleUnavailableException

net.devamy.api

Thrown when a module's API is used while the module is not running, for example through a service kept across a reload. Futures returned by such a service fail with it instead.

class

ModuleStateEvent

net.devamy.api.event

Fired after a module changed state: the signal for a plugin that enabled before the module it wants. Fires synchronously on the thread that changed the state (the global region thread on Folia, the main thread on Paper).

DAntiVPN

VPN, proxy and country checks for players joining the server.

81 methodsDAntiVPN docs
DApi.antiVpn() // Optional<AntiVpnApi>, empty while DAntiVPN is off
class

AdmissionObservation

net.devamy.api.antivpn

Redacted source status, independent of detection/cache facts.

interface

AdmissionRegistration

net.devamy.api.antivpn

Closing this exact handle cannot close a later registration using the same ID.

  • String getId()
    thread: any

    Returns the id the hook was registered under.

    returns
    the id
  • Tells whether this exact registration is still active.

    returns
    true until closed or replaced
class

AdmissionRequest

net.devamy.api.antivpn

Immutable literal address and optional current verified identity; no platform/player object.

class

AdmissionResponse

net.devamy.api.antivpn

A selected external policy fact, never VPN evidence, punishment creation or a grant.

enum

AdmissionResponse.Reason

net.devamy.api.antivpn

Why an admission source decided so.

  • NONE
  • ACTIVE_BAN
  • UNAVAILABLE
  • TIMEOUT
  • OVERLOADED
  • INVALID_RESPONSE
  • STALE_DATA
  • CANCELLED
class

DecisionObservation

net.devamy.api.antivpn

The guard's result at one login phase, not a guarantee of final admission by other plugins.

enum

DecisionObservation.IdentityTrust

net.devamy.api.antivpn

How far the player identity is trusted.

  • UNTRUSTED
  • AUTHENTICATED
  • FORWARDED
  • PLATFORM_ONLINE
  • FLOODGATE
  • VERIFIED_FORWARDING
enum

DecisionObservation.Reason

net.devamy.api.antivpn

Why the guard decided so.

  • CHECKS_COMPLETE
  • FLAG_ALLOWED
  • UNKNOWN_ALLOWED
  • ACCESS_RULE
  • LOOKUP_UNAVAILABLE
  • OVERLOAD
  • VPN_FLAG
  • GEO_FLAG
  • INTERNAL_ERROR
  • IDENTITY_UNAVAILABLE
  • EXTERNAL_POLICY
  • EXTERNAL_UNAVAILABLE
class

DecisionObservation.Source

net.devamy.api.antivpn

One detection source and what it answered.

class

DecisionObservation.Rule

net.devamy.api.antivpn

One access rule and how it matched.

interface

DecisionObserver

net.devamy.api.antivpn

Receives immutable observations on a bounded guard worker, never a platform/player thread.

class

DetectionMetadata

net.devamy.api.antivpn

Immutable source observations. Absent fields mean unknown, never an inferred zero/false.

enum

DetectionMetadata.Type

net.devamy.api.antivpn

The kinds of network a source can flag.

  • VPN
  • PROXY
  • TOR
  • RELAY
  • HOSTING
class

DetectionObservation

net.devamy.api.antivpn

Immutable result of one selected detection source. No platform/player object or exception text.

enum

DetectionObservation.Reason

net.devamy.api.antivpn

Why a detection source found nothing.

  • NONE
  • TIMEOUT
  • RATE_LIMIT
  • HTTP_ERROR
  • AUTHENTICATION
  • INVALID_RESPONSE
  • NETWORK
  • OVERLOADED
  • CIRCUIT_OPEN
  • BUDGET_EXHAUSTED
  • NO_PROVIDER
  • CACHE_ERROR
  • CANCELLED
  • NO_EVIDENCE
  • STALE_DATA
interface

ObserverRegistration

net.devamy.api.antivpn

Registration alone does not activate an observer; explicit selection and reload are required.

  • String getId()
    thread: any

    Returns the id the observer was registered under.

    returns
    the id
  • Tells whether this exact registration is still active.

    returns
    true until closed or replaced
class

ProviderDescriptor

net.devamy.api.antivpn

Public stable ID/version and hash of detection configuration; never pass endpoints or secrets as labels.

interface

ProviderRegistration

net.devamy.api.antivpn

Close on addon shutdown. Registration alone never activates a provider in operator configuration.

  • String getId()
    thread: any

    Returns the id the provider was registered under.

    returns
    the id
  • Tells whether this exact registration is still active.

    returns
    true until closed or replaced
interface

AntiVpnApi

net.devamy.api.antivpn

The developer API of DAntiVPN: admission hooks, detection providers and decision observers. On Paper it comes from DApi.antiVpn(); on Velocity from the DAntiVPN-Velocity jar's net.devamy.dantivpn.api.DAntiVPNApi.

DBounty

Player bounties - a sorted head menu, a confirmation screen and a payout on the kill.

7 methodsDBounty docs
DApi.bounty() // Optional<BountyApi>, empty while DBounty is off
record

BountyView

net.devamy.api.bounty

A read-only snapshot of the bounty on one player.

(@NotNull UUID target, @NotNull String name, double amount)

interface

BountyApi

net.devamy.api.bounty

The DBounty API: read bounties and add to them.

  • Returns the bounty on a player.

    player
    the player's id
    returns
    the amount, 0 when there is no bounty
  • Adds to the bounty on a player without charging anyone.

    player
    the player's id
    amount
    the amount to add, above 0
    cause
    who asked, recorded as the bounty's last setter
    returns
    the new total, or the current amount when amount is not above 0
  • Returns the highest bounties.

    limit
    the most entries to return
    returns
    the bounties, highest first

Events

Normal Bukkit events: listen with @EventHandler, or get every suite event at once through DApi.events().

class

BountyClaimEvent

net.devamy.api.bounty.event

Fired after a player claimed the bounty on a player they killed and was paid. Runs on the thread of the death, so a region thread on Folia.

DCombat

Combat tagging - no running to spawn, no logging out mid-fight.

12 methodsDCombat docs
DApi.combat() // Optional<CombatApi>, empty while DCombat is off
interface

CombatApi

net.devamy.api.combat

The developer API of DCombat: read and change combat tags.

DApi.combat().filter(combat -> combat.tagged(uuid)).ifPresent(combat -> deny(player));
  • Tells whether a player is combat tagged right now.

    player
    the player id
    returns
    true while the tag runs
  • Returns how long a player stays tagged.

    player
    the player id
    returns
    the remaining milliseconds, 0 when not tagged
  • UUID enemy(UUID player)
    nullablethread: any

    Returns who tagged a player.

    player
    the player id
    returns
    the opponent, or null when not tagged or tagged without an opponent
  • Returns every player that is tagged right now.

    returns
    a snapshot of the player ids
  • Tags an online player. Fires a cancellable net.devamy.api.combat.event.CombatTagEvent first.

    player
    the player id
    opponent
    the opponent, or null for none
    durationMillis
    the tag length in milliseconds, at least 1
    cause
    who asks
    returns
    true when the player is now tagged, false when offline or an event listener cancelled it
  • boolean untag(UUID player, Cause cause)
    thread: the player's region thread

    Removes the tag of a player. Fires a net.devamy.api.combat.event.CombatEndEvent.

    player
    the player id
    cause
    who asks
    returns
    true when the player was tagged

Events

Normal Bukkit events: listen with @EventHandler, or get every suite event at once through DApi.events().

enum

CombatEndEvent.Reason

net.devamy.api.combat.event

Why a tag ended.

  • EXPIRED
  • DEATH
  • LOGOUT
  • OPPONENT_DEFEATED
  • UNTAGGED
class

CombatTagEvent

net.devamy.api.combat.event

Fired before a player is combat tagged or an existing tag is refreshed. Cancel it to stop the tag.

DCrates

Crates - right-click a block, spend a key, then pick your reward or roll for one, per crate.

4 methodsDCrates docs
DApi.crates() // Optional<CratesApi>, empty while DCrates is off
interface

CratesApi

net.devamy.api.crates

The DCrates API: find out which blocks are crates.

DEnderChests

Ender chests sized by permission, with a retrieval chest for overflow, MySQL and Redis support across servers.

DApi.enderChests() // Optional<EnderChestApi>, empty while DEnderChests is off
interface

ChestView

net.devamy.api.enderchests

A live view of one player's ender chest.

interface

EnderChestApi

net.devamy.api.enderchests

The DEnderChests API: read sizes and open ender chests.

DHolograms

Floating text at spawn, drawn with vanilla text displays.

DApi.holograms() // Optional<HologramsApi>, empty while DHolograms is off
interface

HologramsApi

net.devamy.api.holograms

The DHolograms API: create, read and remove holograms.

DHomes

Personal homes with a menu and a countdown that breaks when you move.

3 methodsDHomes docs
DApi.homes() // Optional<HomesApi>, empty while DHomes is off
record

HomeView

net.devamy.api.homes

A read-only view of one home.

(int slot, @NotNull String name, @NotNull Location location)

interface

HomesApi

net.devamy.api.homes

The developer API of DHomes: read the homes players set.

DApi.homes().map(homes -> homes.home(uuid, "base")).ifPresent(home -> show(home.location()));

DKits

Rank kits with a preview, cooldowns and a free starter kit on first join.

4 methodsDKits docs
DApi.kits() // Optional<KitsApi>, empty while DKits is off
enum

KitsApi.GiveResult

net.devamy.api.kits

The outcome of give.

  • GIVEN
  • UNKNOWN_KIT
  • ON_COOLDOWN
  • PAYMENT_REFUSED
interface

KitsApi

net.devamy.api.kits

The developer API of DKits: read kits and hand them out.

DApi.kits().ifPresent(kits -> kits.give(player, "starter", false, Cause.of(this, "welcome")));

DMod

50 methods
DApi.mod() // Optional<ModApi>, empty while DMod is off
enum

Outcome

net.devamy.api.mod

How a punishment call ended.

  • APPLIED
  • LIFTED
  • NOTHING_TO_LIFT
  • UNKNOWN_PLAYER
  • UNKNOWN_ADDRESS
  • BAD_ADDRESS
  • BAD_DURATION
  • TARGET_IMMUNE
  • NO_PERMISSION
  • NO_ESCALATION_PERMISSION
  • NO_PERMISSION_CHECK
  • BAD_REQUEST
  • FAILED
  • ALREADY_ACTIVE
record

PunishRequest

net.devamy.api.mod

One punishment to apply through ModApi.apply(PunishRequest). Player types need target; address types (PunishmentType.byAddress()) need address and may name a target whose address is used when address is null.

(Executor executor, PunishmentType type, UUID target, String targetName, String address, long duration, String reason, boolean silent, boolean override, String evidence)

record

PunishmentRecord

net.devamy.api.mod

One punishment as the provider stored it.

(long id, UUID target, String targetName, PunishmentType type, String reason, UUID executorUuid, String executorName, long issuedAt, long expiresAt, long revokedAt, UUID revokerUuid, String revokerName, String ip, String code, String evidence)

record

PunishmentResult

net.devamy.api.mod

The result of a punishment call.

(Outcome outcome, UUID target, String targetName, String ip, PunishmentRecord punishment, List<PunishmentRecord> lifted, PunishmentResult escalation, String detail)

  • Tells whether the call applied or lifted something.

    returns
    true for APPLIED and LIFTED
  • Returns the id of the applied punishment.

    returns
    the id, 0 when none was applied
  • Returns how many punishments were lifted.

    returns
    the count
enum

PunishmentType

net.devamy.api.mod

The kinds of punishment.

  • WARN
  • KICK
  • MUTE
  • BAN
  • IP_MUTE
  • IP_BAN
  • VOICE_MUTE
  • Tells whether the punishment targets an address instead of an account.

    returns
    true for address punishments
  • Tells whether the punishment can be lifted.

    returns
    false for warnings and kicks
interface

ModApi

net.devamy.api.mod

The punishment API: punish players and addresses, lift punishments and read history. Every call completes on the main thread. DStaff serves it from DStaff 2.0 on; older servers got it from DMod.

Events

Normal Bukkit events: listen with @EventHandler, or get every suite event at once through DApi.events().

class

PunishmentEvent

net.devamy.api.mod

Fired after a punishment was applied or lifted.

DNpcs

Packet NPCs with skins, actions and hologram anchors for DHolograms. Runs on Paper and forks from 1.21 to 26.3.

15 methodsDNpcs docs
DApi.npcs() // Optional<NpcsApi>, empty while DNpcs is off
interface

ClickActionSet

net.devamy.api.npcs

Click actions read by NpcsApi.readActions.

  • Tells whether no trigger has any action.

    returns
    true when empty
  • Counts the actions of one trigger.

    trigger
    LEFT_CLICK, RIGHT_CLICK or ANY_CLICK
    returns
    the count, 0 for an unknown trigger
  • void run(Player player, boolean left)
    thread: the player's region thread

    Runs the actions for a click: the side's own list, then the ANY_CLICK list.

    player
    the player who clicked
    left
    true for a left click
interface

NpcView

net.devamy.api.npcs

A read-only view of one NPC.

interface

NpcsApi

net.devamy.api.npcs

The developer API of DNpcs: read NPCs and run DNpcs click actions from your own content.

DApi.npcs().map(npcs -> npcs.npc("guide")).ifPresent(npc -> anchor(npc.location(), npc.height()));

Events

Normal Bukkit events: listen with @EventHandler, or get every suite event at once through DApi.events().

enum

NpcChangeEvent.Change

net.devamy.api.npcs.event

What changes about an NPC.

  • LOCATION
  • SCALE
  • TYPE
  • REMOVED
  • OTHER
class

NpcsLoadedEvent

net.devamy.api.npcs.event

Fired when DNpcs has loaded or reloaded every NPC.

DRollbacks

Backs up player inventories and lets staff restore them or export them as a shulker.

14 methodsDRollbacks docs
DApi.rollbacks() // Optional<RollbacksApi>, empty while DRollbacks is off
interface

InventoryBackup

net.devamy.api.rollbacks

A saved inventory backup.

interface

RollbacksApi

net.devamy.api.rollbacks

The developer API of DRollbacks: inventory backups.

DApi.rollbacks().ifPresent(rollbacks -> rollbacks.saveInventory(player, "quest", "Boss fight"));

Events

Normal Bukkit events: listen with @EventHandler, or get every suite event at once through DApi.events().

class

InventoryBackupEvent

net.devamy.api.rollbacks.event

Fired before DRollbacks saves an inventory backup. Cancelling it saves nothing. Async when fired off the main thread.

class

InventoryRestoreEvent

net.devamy.api.rollbacks.event

Fired before a backup is restored. Cancelling it restores nothing. Async when fired off the main thread.

DSell

Item prices, a drop-in sell chest, sell history and category sell multipliers.

4 methodsDSell docs
DApi.sell() // Optional<SellApi>, empty while DSell is off
interface

SellApi

net.devamy.api.sell

The DSell API: read what items sell for.

DSpawn

The spawn island - its safe zone, its PvP ring and the /spawn teleport.

6 methodsDSpawn docs
DApi.spawn() // Optional<SpawnApi>, empty while DSpawn is off
interface

SpawnApi

net.devamy.api.spawn

The DSpawn API: read the protected spawn area.

  • Tells whether a location is inside the safe area.

    location
    the location
    returns
    true when inside the safe area
  • double [] safeRing()
    nullablethread: any

    {x, z, radius} of the round safe area, or null when the area is made of regions.

    returns
    the ring, or null
  • Region boxes {minX, minY, minZ, maxX, maxY, maxZ} keyed by world key; empty when the area is a ring.

    returns
    the boxes per world key
  • String safeWorld()
    nullablethread: any

    Returns the world key the safe area is in.

    returns
    the world key, or null when none is set
  • Returns the spawn point.

    returns
    the location, or null while the spawn world is not loaded
  • default boolean sendToSpawn(Player player)
    thread: any; the teleport runs on the player's region thread

    Sends a player to the spawn point.

    player
    the player
    returns
    true when a teleport was started, false when no spawn point is available

DStats

Player statistics and leaderboards.

3 methodsDStats docs
DApi.stats() // Optional<StatsApi>, empty while DStats is off
record

StatEntry

net.devamy.api.stats

One row of a statistic ranking.

(@NotNull UUID player, @NotNull String name, double value)

interface

StatsApi

net.devamy.api.stats

The DStats API: read player statistics and rankings.

  • Returns the statistics DStats tracks.

    returns
    the stat names, such as kills or playtime
  • Returns one statistic of a player.

    player
    the player's id
    stat
    a name from statNames()
    returns
    the value, empty for an unknown stat or a player DStats has no record of
  • Returns the top players of a statistic from the cached ranking.

    stat
    a name from statNames()
    limit
    the most entries to return
    returns
    the entries, highest first; empty for an unknown stat

DTags

Chat and tab tags - equip one, wear it behind your name.

6 methodsDTags docs
DApi.tags() // Optional<TagsApi>, empty while DTags is off
record

TagView

net.devamy.api.tags

A read-only view of one tag.

(@NotNull String id, @NotNull String name, @NotNull String hex, @NotNull String display)

interface

TagsApi

net.devamy.api.tags

The developer API of DTags: read and change the tag a player wears.

DApi.tags().map(tags -> tags.active(uuid)).ifPresent(tag -> prefix(tag.display()));

DTeam

Teams with invites, alliances, a team score and top list, a member menu, a team home, team chat and friendly-fire protection.

5 methodsDTeam docs
DApi.team() // Optional<TeamApi>, empty while DTeam is off
record

TeamView

net.devamy.api.team

A read-only snapshot of a team.

(@NotNull String name, @NotNull UUID leader, @NotNull List<UUID> members)

interface

TeamApi

net.devamy.api.team

The DTeam API: read a player's team membership.

DVote

Voting with a built-in Votifier receiver, vote sites menu, rewards, vote party, reminders and a Discord feed.

7 methodsDVote docs
DApi.vote() // Optional<VoteApi>, empty while DVote is off
record

VoterView

net.devamy.api.vote

One row of a vote ranking.

(@NotNull UUID player, @NotNull String name, int votes)

interface

VoteApi

net.devamy.api.vote

The DVote API: read vote counts.

Events

Normal Bukkit events: listen with @EventHandler, or get every suite event at once through DApi.events().

class

VoteReceivedEvent

net.devamy.api.vote.event

Fired after a vote was counted for a player. A repeat vote inside the guard window is not counted and fires nothing. Runs on the player's region thread.

DWarps

Player-made public warps with a browse menu, ratings and a countdown that breaks when you move.

7 methodsDWarps docs
DApi.warps() // Optional<WarpsApi>, empty while DWarps is off
record

WarpView

net.devamy.api.warps

A read-only view of one warp.

(@NotNull String name, @NotNull Location location, @Nullable UUID owner)

  • Tells whether this is a server warp.

    returns
    true when it has no owner
interface

WarpsApi

net.devamy.api.warps

The developer API of DWarps: read server warps and player warps.

DApi.warps().map(warps -> warps.serverWarp("market")).ifPresent(warp -> show(warp.location()));

Hooks

Plugin-neutral questions such as "is this player in combat" or "may they build here". Whichever plugin the server owner picked in connections.yml answers, ours or a third-party one.

72 methods
enum

Answer

net.devamy.dcore.hook

A yes, a no, or no opinion. The asking plugin decides what no opinion means.

  • ALLOW
  • DENY
  • NONE
interface

BlockRoles

net.devamy.dcore.hook

Blocks that a plugin has given a job, such as crates.

interface

Capability

net.devamy.dcore.hook

One question the D plugins ask about the rest of the server, with the plugin that currently answers it.

  • T get()
    thread: any

    Returns the answerer. Never null: when no plugin answers, a built-in default does.

    returns
    the answerer, valid until the next change of connections
    throws IllegalStateException
    when DCore is not enabled
  • Names the plugins that answer right now.

    returns
    the names joined by commas, empty while the built-in default answers
  • Offers a plugin's own answerer. It is used when connections.yml allows it.

    plugin
    the plugin that answers
    answerer
    the implementation
  • Withdraws what a plugin offered.

    plugin
    the plugin
interface

CombatTag

net.devamy.dcore.hook

Who is in combat.

interface

CompositeCapability

net.devamy.dcore.hook

A question every installed plugin is asked. get() merges their answers.

  • List<T> all()
    thread: any

    Lists every plugin that answers right now.

    returns
    the answerers, empty while the built-in default answers
enum

DFlag

net.devamy.dcore.hook

The region flags the D plugins add to WorldGuard. Names are unprefixed.

  • Gives the name the flag has in WorldGuard.

    returns
    the unprefixed name
  • Tells whether the flag carries a text value instead of allow or deny.

    returns
    true for a text flag
interface

Holograms

net.devamy.dcore.hook

Floating text. Not persistent: put it again on every enable.

class

Hooks

net.devamy.dcore.hook

Entry point to every question the D plugins ask about the rest of the server. Which plugin answers each one is decided by plugins/DCore/connections.yml.

interface

ItemPrices

net.devamy.dcore.hook

Item prices from whichever shop plugin the server uses. Prices are per single item in the server's Vault money.

  • Reads what the shop charges for one item.

    player
    the buyer, or null for the base price
    item
    the item, taken as amount 1
    returns
    the price, empty when it is not for sale or priced in another currency
  • Reads what the shop pays for one item.

    player
    the seller, or null for the base price
    item
    the item, taken as amount 1
    returns
    the price, empty when it is not bought or priced in another currency
interface

NamedCapability

net.devamy.dcore.hook

A question where a caller may also ask one named plugin directly.

  • Finds one plugin's answerer, whether or not it is the one in use.

    pluginName
    the plugin name as /plugins shows it
    returns
    the answerer, empty when that plugin does not answer
  • Offers an answerer that is never chosen by auto, only by named(String) or by name in connections.yml.

    plugin
    the plugin that owns it
    name
    the name callers ask for
    answerer
    the implementation
interface

Permissions

net.devamy.dcore.hook

Ranks and permissions, also for players who are offline.

interface

Protection

net.devamy.dcore.hook

What the land and region plugins say about a place. Answers are Answer; the consumer decides what NONE means.

interface

Teams

net.devamy.dcore.hook

Teams, towns and their allies.

Shared types

Types every module API uses: the cause of a change, ranking rows, event phases and thread helpers.

14 methods
record

Cause

net.devamy.dcore.api

Who changed a value and why, for logs and events.

(@NotNull String plugin, @NotNull String detail)

record

Ranked

net.devamy.dcore.api

One row of a top list. Do not deconstruct with record patterns: components may be added.

(@NotNull UUID uuid, @NotNull String name, double value, int rank)

class

ServiceRef

net.devamy.dcore.api

Looks a module's API up in Bukkit's ServicesManager and remembers the registration until its plugin is disabled. Safe from any thread.

interface

SuiteEvent

net.devamy.dcore.api

Implemented by every event a Devamy module API fires, so one listener can observe all of them. Register it through DApi.events(); to cancel or change something, listen to the typed event instead.

  • Returns the id of the module that fired the event, as DApi.module(...) knows it.

    returns
    the module id, for example DCurrency
  • Returns when the event fires relative to the change.

    returns
    the phase
  • Returns who asked for the change, when the event knows.

    returns
    the cause, or empty
enum

SuiteEvent.Phase

net.devamy.dcore.api

When an event fires relative to the change it describes.

  • BEFORE
  • AFTER
class

Threads

net.devamy.dcore.api

Executors and ownership checks that work the same on Paper and Folia. Use them to continue a future on the right thread: api.balance(uuid).thenAcceptAsync(balance -> ..., Threads.entity(this, player)). An executor runs the task inline when the caller already owns the target, and schedules it otherwise. On Folia a task for an entity that has been removed is dropped without an error.

  • Creates an executor that runs on the thread owning an entity.

    plugin
    the plugin the tasks belong to
    entity
    the entity
    returns
    the executor
    throws IllegalStateException
    when DCore is not enabled
  • Creates an executor that runs on the region thread owning a location.

    plugin
    the plugin the tasks belong to
    location
    the location; copied
    returns
    the executor
    throws IllegalStateException
    when DCore is not enabled
  • Creates an executor that runs on the global thread: the main thread on Paper, the global region thread on Folia.

    plugin
    the plugin the tasks belong to
    returns
    the executor
    throws IllegalStateException
    when DCore is not enabled
  • Creates an executor that runs on an async thread, never on a tick thread.

    plugin
    the plugin the tasks belong to
    returns
    the executor
    throws IllegalStateException
    when DCore is not enabled
  • Tells whether the calling thread may touch the entity.

    entity
    the entity
    returns
    true when the caller owns it
    throws IllegalStateException
    when DCore is not enabled
  • Tells whether the calling thread may touch the location.

    location
    the location
    returns
    true when the caller owns it
    throws IllegalStateException
    when DCore is not enabled
  • Tells whether the calling thread is a server tick thread: the main thread on Paper, any region or global thread on Folia.

    returns
    true on a tick thread