Class Flags
java.lang.Object
cn.lunadeer.dominion.api.dtos.flag.Flags
Built-in environment and privilege flags and the flag registry.
The public constants are the canonical flag instances. Custom flags can be
registered with registerEnvFlag(JavaPlugin, EnvFlag) or
registerPriFlag(JavaPlugin, PriFlag). Legacy constants are kept
for migration and are not returned by the active-flag lookup methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PriFlagAllows managing ordinary members and groups.static final PriFlagControls setting and using respawn anchors.static final EnvFlagControls respawn-anchor explosions and their block damage.static final EnvFlagControls animal breeding.static final PriFlagControls damaging animals.static final EnvFlagControls animal movement inside a dominion.static final EnvFlagControls natural or world-generated animal spawning.static final EnvFlagControls creation of animals with spawn eggs.static final EnvFlagControls animal spawning from monster spawners.static final PriFlagControls using anvils.static final PriFlagControls directly breaking armor stands.static final EnvFlagDeprecated.static final PriFlagControls changing equipment on armor stands.static final EnvFlagControls non-player entities damaging armor stands.static final PriFlagDeprecated.static final PriFlagControls player-fired projectiles breaking armor stands.static final PriFlagControls damage caused by player-fired arrows.static final PriFlagControls impacts caused by player-fired arrows.static final PriFlagControls launching arrows.static final PriFlagControls opening barrels.static final PriFlagControls interacting with beacons.static final PriFlagControls sleeping in beds and setting a spawn point.static final EnvFlagControls bed explosions and their block damage.static final PriFlagControls opening blast furnaces.static final EnvFlagDeprecated.static final PriFlagControls interacting with chiseled bookshelves.static final PriFlagControls ordinary block breaking.static final PriFlagDeprecated.static final PriFlagControls removing contents from flower pots.static final PriFlagControls collecting water and lava.static final PriFlagControls using brewing stands.static final EnvFlagDeprecated.static final EnvFlagControls blocks burning.static final EnvFlagDeprecated.static final EnvFlagControls non-player entities taking fire damage.static final EnvFlagControls non-player entities taking lava or hot-floor damage.static final PriFlagControls clicking buttons.static final PriFlagControls eating cake.static final PriFlagControls opening chests.static final PriFlagControls interaction with comparators.static final PriFlagDeprecated.static final PriFlagControls opening copper chests.static final PriFlagControls using crafting tables.static final PriFlagControls interacting with crafters.static final PriFlagAllows creating sub-dominions.static final EnvFlagControls Creeper explosion damage to armor stands.static final EnvFlagControls Creeper explosion damage to ordinary entities.static final EnvFlagControls Creeper explosion damage to hanging entities.static final EnvFlagControls Creeper explosion block damage.static final EnvFlagControls leaf decay.static final PriFlagAllows deleting sub-dominions.static final PriFlagControls opening dispensers.static final PriFlagControls interaction with ordinary doors.static final EnvFlagControls Ender Dragon block breaking.static final PriFlagControls interacting with dragon eggs.static final PriFlagControls dropping items.static final PriFlagControls opening droppers.static final PriFlagControls dyeing animals and their accessories.static final PriFlagControls editing signs.static final PriFlagControls throwing eggs.static final PriFlagControls using enchanting tables.static final EnvFlagControls End Crystal explosion damage to armor stands.static final EnvFlagControls End Crystal explosion damage to ordinary entities.static final EnvFlagControls End Crystal explosion damage to hanging entities.static final EnvFlagControls End Crystal explosion block damage.static final EnvFlagDeprecated.static final EnvFlagControls Endermen picking up blocks.static final EnvFlagControls Endermen placing blocks.static final EnvFlagControls Enderman spawning.static final EnvFlagControls Enderman teleportation.static final PriFlagControls throwing ender pearls.static final PriFlagControls feeding animals.static final PriFlagControls interaction with fence gates.static final PriFlagControls using bone meal and other fertilizer.static final EnvFlagControls fire spreading.static final PriFlagDeprecated.static final EnvFlagControls Fireball explosion damage to armor stands.static final EnvFlagControls Fireball explosion damage to ordinary entities.static final EnvFlagControls Fireball explosion damage to hanging entities.static final EnvFlagControls Fireball explosion block damage.static final PriFlagControls impacts caused by player-fired fireballs.static final PriFlagControls launching fireballs.static final EnvFlagControls external lava flowing into the dominion.static final EnvFlagDeprecated.static final EnvFlagControls external water flowing into the dominion.static final PriFlagControls opening flower pots.static final PriFlagControls creative-style flight; it does not control elytra flight.static final PriFlagControls opening furnaces.static final EnvFlagControls gravity-affected blocks falling inside the dominion.static final PriFlagControls directly breaking hanging entities.static final EnvFlagDeprecated.static final EnvFlagControls non-player entities damaging hanging entities.static final PriFlagDeprecated.static final PriFlagControls player-fired projectiles breaking hanging entities.static final PriFlagControls harvesting crops.static final PriFlagControls collecting honey from hives.static final PriFlagControls using fishing rods.static final PriFlagControls opening hoppers.static final EnvFlagControls an outside hopper pulling from containers in the dominion.static final EnvFlagDeprecated.static final EnvFlagControls ice formation caused by Frost Walker.static final EnvFlagControls natural ice formation.static final EnvFlagControls ice melting.static final PriFlagControls igniting fire.static final PriFlagControls inserting and removing items in item frames.static final PriFlagControls rotating items in item frames.static final EnvFlagDeprecated.static final PriFlagControls interacting with jukeboxes.static final PriFlagControls leashing entities.static final PriFlagControls interacting with lecterns.static final PriFlagControls switching levers.static final EnvFlagControls whether mobs drop items when killed.static final EnvFlagControls non-player entities trampling farmland.static final EnvFlagControls damage dealt to players by monsters.static final PriFlagControls damaging monsters.static final EnvFlagControls monster movement inside a dominion.static final EnvFlagControls natural or world-generated monster spawning.static final EnvFlagControls creation of monsters with spawn eggs.static final EnvFlagControls monster spawning from monster spawners.static final PriFlagControls player movement inside a dominion.static final PriFlagControls interaction with note blocks.static final PriFlagControls picking up dropped items.static final EnvFlagControls pistons crossing the dominion boundary.static final PriFlagControls ordinary block placement.static final PriFlagControls placing armor stands.static final PriFlagDeprecated.static final PriFlagControls placing contents into flower pots.static final PriFlagControls placing hanging entities.static final PriFlagControls placing water and lava.static final PriFlagControls planting saplings and similar tree plants.static final PriFlagControls player-triggered pressure plates.static final PriFlagControls charging bows and crossbows.static final PriFlagControls player-versus-player damage.static final PriFlagControls triggering raids.static final PriFlagControls interaction with redstone dust.static final PriFlagAllows renaming a dominion.static final PriFlagAllows renaming sub-dominions.static final PriFlagControls interaction with repeaters.static final PriFlagAllows resizing a dominion.static final PriFlagAllows resizing sub-dominions.static final PriFlagControls riding vehicles and rideable entities.static final PriFlagControls shearing sheep.static final PriFlagControls opening shelves.static final PriFlagDeprecated.static final EnvFlagControls whether a dominion border is shown to entering players.static final PriFlagControls opening shulker boxes.static final PriFlagControls opening smokers.static final EnvFlagControls snow accumulation.static final EnvFlagControls snow melting.static final PriFlagControls planting crops.static final PriFlagControls teleportation to the dominion.static final EnvFlagControls TNT explosion damage to armor stands.static final EnvFlagControls TNT explosion damage to ordinary entities.static final EnvFlagControls TNT explosion damage to hanging entities.static final EnvFlagControls TNT explosion block damage.static final PriFlagControls trading with villagers.static final EnvFlagControls player trampling of farmland.static final PriFlagControls interaction with trapdoors.static final PriFlagDeprecated.static final PriFlagControls impacts caused by player-fired tridents.static final PriFlagControls launching tridents.static final EnvFlagControls dropped-item-triggered pressure plates.static final EnvFlagControls mob-triggered pressure plates.static final EnvFlagControls projectile-triggered pressure plates.static final PriFlagControls destroying vehicles.static final PriFlagControls spawning vehicles.static final EnvFlagControls villager breeding.static final PriFlagControls damaging villagers.static final EnvFlagControls natural or world-generated villager spawning.static final EnvFlagControls creation of villagers with spawn eggs.static final EnvFlagControls villager spawning from monster spawners.static final PriFlagDeprecated.static final PriFlagControls explosions caused by player-fired wind charges.static final PriFlagControls impacts caused by player-fired wind charges.static final PriFlagControls launching wind charges.static final EnvFlagControls block breaking caused by an injured Wither.static final EnvFlagControls block damage caused by a Wither spawning explosion.static final EnvFlagControls Wither Skull explosion damage to armor stands.static final EnvFlagControls Wither Skull explosion damage to ordinary entities.static final EnvFlagControls Wither Skull explosion damage to hanging entities.static final EnvFlagControls Wither Skull explosion block damage.static final EnvFlagControls Wither spawning. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<Void>Queues pending custom flag and flag-group changes for application.static voidDeprecated.Returns all active environment flags.Returns all enabled environment flags.Returns all active flags, including both environment and privilege flags.Returns all enabled environment and privilege flags.Returns all active privilege flags.Returns all enabled privilege flags.static EnvFlaggetEnvFlag(String name) Finds an active environment flag by its stable name.static FlagFinds an active flag by its stable name.static FlaggetLegacySource(Flag flag) Returns the legacy flag whose value should seed a newly split flag.getLegacySources(Flag flag) Returns all legacy flags whose values should seed a newly split flag.static PriFlaggetPreFlag(String name) Finds an active privilege flag by its stable name.static longGets the revision of the active custom-flag registry.static booleanChecks whether migration should preserve a spawn-egg flag's existing allowed value instead of applying the normal legacy default.static booleanregisterEnvFlag(org.bukkit.plugin.java.JavaPlugin plugin, EnvFlag flag) Registers a custom environment flag.static booleanregisterPriFlag(org.bukkit.plugin.java.JavaPlugin plugin, PriFlag flag) Registers a custom privilege flag.
-
Field Details
-
ANIMAL_SPAWN
Controls natural or world-generated animal spawning. -
ANIMAL_BREED
Controls animal breeding. -
ANIMAL_SPAWNER
Controls animal spawning from monster spawners. -
ANIMAL_SPAWN_EGG
Controls creation of animals with spawn eggs. -
ANIMAL_MOVE
Controls animal movement inside a dominion. -
VILLAGER_SPAWN
Controls natural or world-generated villager spawning. -
VILLAGER_BREED
Controls villager breeding. -
VILLAGER_SPAWNER
Controls villager spawning from monster spawners. -
VILLAGER_SPAWN_EGG
Controls creation of villagers with spawn eggs. -
MONSTER_SPAWN
Controls natural or world-generated monster spawning. -
MONSTER_SPAWNER
Controls monster spawning from monster spawners. -
MONSTER_SPAWN_EGG
Controls creation of monsters with spawn eggs. -
MONSTER_MOVE
Controls monster movement inside a dominion. -
MONSTER_DAMAGE
Controls damage dealt to players by monsters. -
ENDER_MAN
Deprecated.Former combined Enderman block movement flag retained for migration. -
ENDER_MAN_PICKUP_BLOCK
Controls Endermen picking up blocks. -
ENDER_MAN_PLACE_BLOCK
Controls Endermen placing blocks. -
ENDER_MAN_SPAWN
Controls Enderman spawning. -
ENDER_MAN_TELEPORT
Controls Enderman teleportation. -
TNT_EXPLODE
Controls TNT explosion block damage. -
TNT_DAMAGE_ENTITY
Controls TNT explosion damage to ordinary entities. -
WITHER_SPAWN
Controls Wither spawning. -
WITHER_EXPLODE
Controls block damage caused by a Wither spawning explosion. -
WITHER_BREAK_BLOCK
Controls block breaking caused by an injured Wither. -
CREEPER_EXPLODE
Controls Creeper explosion block damage. -
CREEPER_DAMAGE_ENTITY
Controls Creeper explosion damage to ordinary entities. -
WITHER_SKULL_EXPLODE
Controls Wither Skull explosion block damage. -
WITHER_SKULL_DAMAGE_ENTITY
Controls Wither Skull explosion damage to ordinary entities. -
ENDER_CRYSTAL_EXPLODE
Controls End Crystal explosion block damage. -
ENDER_CRYSTAL_DAMAGE_ENTITY
Controls End Crystal explosion damage to ordinary entities. -
FIREBALL_EXPLODE
Controls Fireball explosion block damage. -
FIREBALL_DAMAGE_ENTITY
Controls Fireball explosion damage to ordinary entities. -
TNT_DAMAGE_ARMOR_STAND
Controls TNT explosion damage to armor stands. -
TNT_DAMAGE_HANGING_ENTITY
Controls TNT explosion damage to hanging entities. -
CREEPER_DAMAGE_ARMOR_STAND
Controls Creeper explosion damage to armor stands. -
CREEPER_DAMAGE_HANGING_ENTITY
Controls Creeper explosion damage to hanging entities. -
WITHER_SKULL_DAMAGE_ARMOR_STAND
Controls Wither Skull explosion damage to armor stands. -
WITHER_SKULL_DAMAGE_HANGING_ENTITY
Controls Wither Skull explosion damage to hanging entities. -
ENDER_CRYSTAL_DAMAGE_ARMOR_STAND
Controls End Crystal explosion damage to armor stands. -
ENDER_CRYSTAL_DAMAGE_HANGING_ENTITY
Controls End Crystal explosion damage to hanging entities. -
FIREBALL_DAMAGE_ARMOR_STAND
Controls Fireball explosion damage to armor stands. -
FIREBALL_DAMAGE_HANGING_ENTITY
Controls Fireball explosion damage to hanging entities. -
BED_EXPLODE
Controls bed explosions and their block damage. -
ANCHOR_EXPLODE
Controls respawn-anchor explosions and their block damage. -
BLOCK_EXPLODE
Deprecated.Former combined bed and respawn-anchor explosion flag retained for migration. -
DRAGON_BREAK_BLOCK
Controls Ender Dragon block breaking. -
FIRE_SPREAD
Controls fire spreading. -
BURN
Deprecated.Former combined burn flag from before block/entity burning was split. -
BURN_BLOCK
Controls blocks burning. -
BURN_ENTITY
Deprecated.Former combined fire/lava entity damage flag retained for migration. -
BURN_ENTITY_FIRE
Controls non-player entities taking fire damage. -
BURN_ENTITY_LAVA
Controls non-player entities taking lava or hot-floor damage. -
FLOW_IN_WATER
Controls external water flowing into the dominion. -
FLOW_IN_LAVA
Controls external lava flowing into the dominion. -
FLOW_IN_PROTECTION
Deprecated.Former combined water/lava flow flag retained for migration. -
GRAVITY_BLOCK
Controls gravity-affected blocks falling inside the dominion. -
ICE_MELT
Controls ice melting. -
ICE_FORM_NATURAL
Controls natural ice formation. -
ICE_FORM_FROST_WALKER
Controls ice formation caused by Frost Walker. -
ICE_FORM
Deprecated.Former combined natural and Frost Walker ice formation flag retained for migration. -
SNOW_ACCUMULATION
Controls snow accumulation. -
SNOW_MELT
Controls snow melting. -
TRAMPLE
Controls player trampling of farmland. -
MOB_TRAMPLE
Controls non-player entities trampling farmland. -
DECAY
Controls leaf decay. -
HOPPER_OUTSIDE
Controls an outside hopper pulling from containers in the dominion. -
PISTON_OUTSIDE
Controls pistons crossing the dominion boundary. -
TRIG_PRESSURE_PROJ
Controls projectile-triggered pressure plates. -
TRIG_PRESSURE_MOB
Controls mob-triggered pressure plates. -
TRIG_PRESSURE_DROP
Controls dropped-item-triggered pressure plates. -
ITEM_FRAME_PROJ_DAMAGE
Deprecated.The former coarse hanging-entity projectile flag. It is retained as a migration source for existing configuration and database columns, but is not registered as an active flag anymore. -
ARMOR_STAND_MOB_DAMAGE
Controls non-player entities damaging armor stands. -
HANGING_ENTITY_MOB_DAMAGE
Controls non-player entities damaging hanging entities. -
ARMOR_STAND_EXPLOSION_DAMAGE
Deprecated.Former source-agnostic explosion damage flag retained for migration. -
HANGING_ENTITY_EXPLOSION_DAMAGE
Deprecated.Former source-agnostic explosion damage flag retained for migration. -
MOB_DROP_ITEM
Controls whether mobs drop items when killed. -
SHOW_BORDER
Controls whether a dominion border is shown to entering players. -
ADMIN
Allows managing ordinary members and groups. -
RESIZE
Allows resizing a dominion. -
RENAME
Allows renaming a dominion. -
CREATE_SUB
Allows creating sub-dominions. -
DELETE_SUB
Allows deleting sub-dominions. -
RESIZE_SUB
Allows resizing sub-dominions. -
RENAME_SUB
Allows renaming sub-dominions. -
MOVE
Controls player movement inside a dominion. -
TELEPORT
Controls teleportation to the dominion. -
FLY
Controls creative-style flight; it does not control elytra flight. -
RIDING
Controls riding vehicles and rideable entities. -
ENDER_PEARL
Controls throwing ender pearls. -
RAID
Controls triggering raids. -
PLACE
Controls ordinary block placement. -
PLACE_FLOWER_POT_CONTENT
Controls placing contents into flower pots. -
PLACE_LIQUID
Controls placing water and lava. -
PLACE_ENTITY
Deprecated.Former coarse decorative-entity placement flag retained for migration. -
PLACE_ARMOR_STAND
Controls placing armor stands. -
PLACE_HANGING_ENTITY
Controls placing hanging entities. -
BREAK_BLOCK
Controls ordinary block breaking. -
BREAK_FLOWER_POT_CONTENT
Controls removing contents from flower pots. -
BREAK_LIQUID
Controls collecting water and lava. -
BREAK_ENTITY
Deprecated.Former coarse decorative-entity breaking flag retained for migration. -
ARMOR_STAND_DIRECT_BREAK
Controls directly breaking armor stands. -
ARMOR_STAND_PROJECTILE_BREAK
Controls player-fired projectiles breaking armor stands. -
HANGING_ENTITY_DIRECT_BREAK
Controls directly breaking hanging entities. -
HANGING_ENTITY_PROJECTILE_BREAK
Controls player-fired projectiles breaking hanging entities. -
ARMOR_STAND_PLAYER_DAMAGE
Deprecated.Former combined player damage flag retained for migration. -
HANGING_ENTITY_PLAYER_DAMAGE
Deprecated.Former combined player damage flag retained for migration. -
IGNITE
Controls igniting fire. -
PICK_UP
Controls picking up dropped items. -
DROP_ITEM
Controls dropping items. -
DOOR
Controls interaction with ordinary doors. -
TRAPDOOR
Controls interaction with trapdoors. -
FENCE_GATE
Controls interaction with fence gates. -
BUTTON
Controls clicking buttons. -
LEVER
Controls switching levers. -
PRESSURE
Controls player-triggered pressure plates. -
RED_STONE_POWDER
Controls interaction with redstone dust. -
REPEATER
Controls interaction with repeaters. -
COMPARER
Controls interaction with comparators. -
NOTE_BLOCK
Controls interaction with note blocks. -
CONTAINER
Deprecated.The former coarse container flag. It is retained as a migration source for existing configuration and database columns, but is not registered as an active flag anymore. -
CHEST
Controls opening chests. -
BARREL
Controls opening barrels. -
SHULKER_BOX
Controls opening shulker boxes. -
ARMOR_STAND_INTERACTIVE
Controls changing equipment on armor stands. -
ITEM_FRAME_CONTENT
Controls inserting and removing items in item frames. -
HOPPER
Controls opening hoppers. -
DROPPER
Controls opening droppers. -
DISPENSER
Controls opening dispensers. -
FURNACE
Controls opening furnaces. -
BLAST_FURNACE
Controls opening blast furnaces. -
SMOKER
Controls opening smokers. -
FLOWER_POT
Controls opening flower pots. -
COPPER_CHEST
Controls opening copper chests. -
SHELF
Controls opening shelves. -
CRAFT
Controls using crafting tables. -
CRAFTER
Controls interacting with crafters. -
ANVIL
Controls using anvils. -
ENCHANT
Controls using enchanting tables. -
BREW
Controls using brewing stands. -
BEACON
Controls interacting with beacons. -
JUKEBOX
Controls interacting with jukeboxes. -
LECTERN
Controls interacting with lecterns. -
BOOKSHELF
Controls interacting with chiseled bookshelves. -
DRAGON_EGG
Controls interacting with dragon eggs. -
ITEM_FRAME_INTERACTIVE
Controls rotating items in item frames. -
EDIT_SIGN
Controls editing signs. -
BED
Controls sleeping in beds and setting a spawn point. -
ANCHOR
Controls setting and using respawn anchors. -
VEHICLE_SPAWN
Controls spawning vehicles. -
VEHICLE_DESTROY
Controls destroying vehicles. -
HARVEST
Controls harvesting crops. -
SOWING
Controls planting crops. -
FERTILIZER
Controls using bone meal and other fertilizer. -
PLANT_TREE
Controls planting saplings and similar tree plants. -
FEED
Controls feeding animals. -
SHEAR
Controls shearing sheep. -
LEASH
Controls leashing entities. -
DYE
Controls dyeing animals and their accessories. -
HONEY
Controls collecting honey from hives. -
CAKE
Controls eating cake. -
TRADE
Controls trading with villagers. -
PROJECTILE_CHARGE
Controls charging bows and crossbows. -
ARROW_LAUNCH
Controls launching arrows. -
ARROW_HIT
Controls impacts caused by player-fired arrows. -
ARROW_DAMAGE
Controls damage caused by player-fired arrows. -
SHOOT
Deprecated.Former combined bow/crossbow and arrow flag retained for migration. -
TRIDENT_LAUNCH
Controls launching tridents. -
TRIDENT_HIT
Controls impacts caused by player-fired tridents. -
TRIDENT
Deprecated.Former combined trident launch and impact flag retained for migration. -
FIREBALL_LAUNCH
Controls launching fireballs. -
FIREBALL_HIT
Controls impacts caused by player-fired fireballs. -
FIREBALL
Deprecated.Former combined fireball launch and impact flag retained for migration. -
WIND_CHARGE_LAUNCH
Controls launching wind charges. -
WIND_CHARGE_HIT
Controls impacts caused by player-fired wind charges. -
WIND_CHARGE_EXPLODE
Controls explosions caused by player-fired wind charges. -
WIND_CHARGE
Deprecated.Former combined wind charge launch, impact and explosion flag retained for migration. -
EGG
Controls throwing eggs. -
HOOK
Controls using fishing rods. -
PVP
Controls player-versus-player damage. -
MONSTER_KILLING
Controls damaging monsters. -
ANIMAL_KILLING
Controls damaging animals. -
VILLAGER_KILLING
Controls damaging villagers.
-
-
Constructor Details
-
Flags
public Flags()
-
-
Method Details
-
getAllFlags
Returns all active flags, including both environment and privilege flags.- Returns:
- the active flag list; callers should treat it as read-only
-
getAllEnvFlags
Returns all active environment flags.- Returns:
- the active environment flag list; callers should treat it as read-only
-
getAllPriFlags
Returns all active privilege flags.- Returns:
- the active privilege flag list; callers should treat it as read-only
-
getAllEnvFlagsEnable
Returns all enabled environment flags.- Returns:
- a new list containing the enabled environment flags
-
getAllPriFlagsEnable
Returns all enabled privilege flags.- Returns:
- a new list containing the enabled privilege flags
-
getAllFlagsEnable
Returns all enabled environment and privilege flags.- Returns:
- a new list containing the enabled flags
-
getFlag
Finds an active flag by its stable name.- Parameters:
name- the name of the flag- Returns:
- the flag with the given name, or null if not found
-
getEnvFlag
Finds an active environment flag by its stable name.- Parameters:
name- the name of the environment flag- Returns:
- the environment flag with the given name, or null if not found
-
getPreFlag
Finds an active privilege flag by its stable name.- Parameters:
name- the name of the privilege flag- Returns:
- the privilege flag with the given name, or
nullif not found
-
registerEnvFlag
Registers a custom environment flag.Call
applyChanges()after registration so the new flag and its configured groups are applied asynchronously.- Parameters:
plugin- the plugin registering the flagflag- the environment flag to register- Returns:
trueif the flag was accepted by the registration event,falseif the event was cancelled
-
registerPriFlag
Registers a custom privilege flag.Call
applyChanges()after registration so the new flag and its configured groups are applied asynchronously.- Parameters:
plugin- the plugin registering the flagflag- the privilege flag to register- Returns:
trueif the flag was accepted by the registration event,falseif the event was cancelled
-
applyChanges
Queues pending custom flag and flag-group changes for application. Use the returned future to observe completion of the asynchronous pass. Calls made in the same server tick may be coalesced.- Returns:
- a future completed after the pending changes have been applied
-
applyNewCustomFlags
Deprecated.useapplyChanges()and observe the returned futureQueues registered flag and flag-group changes for application without exposing the completion future.- Throws:
Exception- retained for source compatibility; current implementations report asynchronous failures through the returned future ofapplyChanges()
-
getRevision
public static long getRevision()Gets the revision of the active custom-flag registry.- Returns:
- the current flag revision
-
getLegacySource
Returns the legacy flag whose value should seed a newly split flag.- Parameters:
flag- the active flag being migrated- Returns:
- the legacy source flag, or
nullwhen no source exists
-
getLegacySources
Returns all legacy flags whose values should seed a newly split flag. Most split flags have one source. The historicalburnflag is included as a fallback for installations that never had the intermediateburn_entitycolumn.- Parameters:
flag- the active flag being migrated- Returns:
- the legacy source flags, in fallback order
-
preserveAllowedSpawnEggValue
Checks whether migration should preserve a spawn-egg flag's existing allowed value instead of applying the normal legacy default.- Parameters:
flag- the flag being migrated- Returns:
truefor animal and monster spawn-egg flags
-
applyChanges()and observe the returned future