Class Flags

java.lang.Object
cn.lunadeer.dominion.api.dtos.flag.Flags

public class Flags extends Object
  • Field Details

    • ANIMAL_SPAWN

      public static final EnvFlag ANIMAL_SPAWN
    • ANIMAL_MOVE

      public static final EnvFlag ANIMAL_MOVE
    • VILLAGER_SPAWN

      public static final EnvFlag VILLAGER_SPAWN
    • MONSTER_SPAWN

      public static final EnvFlag MONSTER_SPAWN
    • MONSTER_MOVE

      public static final EnvFlag MONSTER_MOVE
    • MONSTER_DAMAGE

      public static final EnvFlag MONSTER_DAMAGE
    • ENDER_MAN

      public static final EnvFlag ENDER_MAN
    • TNT_EXPLODE

      public static final EnvFlag TNT_EXPLODE
    • WITHER_SPAWN

      public static final EnvFlag WITHER_SPAWN
    • CREEPER_EXPLODE

      public static final EnvFlag CREEPER_EXPLODE
    • DRAGON_BREAK_BLOCK

      public static final EnvFlag DRAGON_BREAK_BLOCK
    • FIRE_SPREAD

      public static final EnvFlag FIRE_SPREAD
    • FLOW_IN_PROTECTION

      public static final EnvFlag FLOW_IN_PROTECTION
    • GRAVITY_BLOCK

      public static final EnvFlag GRAVITY_BLOCK
    • ICE_MELT

      public static final EnvFlag ICE_MELT
    • ICE_FORM

      public static final EnvFlag ICE_FORM
    • SNOW_ACCUMULATION

      public static final EnvFlag SNOW_ACCUMULATION
    • SNOW_MELT

      public static final EnvFlag SNOW_MELT
    • TRAMPLE

      public static final EnvFlag TRAMPLE
    • DECAY

      public static final EnvFlag DECAY
    • HOPPER_OUTSIDE

      public static final EnvFlag HOPPER_OUTSIDE
    • PISTON_OUTSIDE

      public static final EnvFlag PISTON_OUTSIDE
    • TRIG_PRESSURE_PROJ

      public static final EnvFlag TRIG_PRESSURE_PROJ
    • TRIG_PRESSURE_MOB

      public static final EnvFlag TRIG_PRESSURE_MOB
    • TRIG_PRESSURE_DROP

      public static final EnvFlag TRIG_PRESSURE_DROP
    • ITEM_FRAME_PROJ_DAMAGE

      public static final EnvFlag ITEM_FRAME_PROJ_DAMAGE
    • MOB_DROP_ITEM

      public static final EnvFlag MOB_DROP_ITEM
    • SHOW_BORDER

      public static final EnvFlag SHOW_BORDER
    • ADMIN

      public static final PriFlag ADMIN
    • MOVE

      public static final PriFlag MOVE
    • TELEPORT

      public static final PriFlag TELEPORT
    • FLY

      public static final PriFlag FLY
    • RIDING

      public static final PriFlag RIDING
    • ENDER_PEARL

      public static final PriFlag ENDER_PEARL
    • PLACE

      public static final PriFlag PLACE
    • BREAK_BLOCK

      public static final PriFlag BREAK_BLOCK
    • IGNITE

      public static final PriFlag IGNITE
    • PICK_UP

      public static final PriFlag PICK_UP
    • DROP_ITEM

      public static final PriFlag DROP_ITEM
    • DOOR

      public static final PriFlag DOOR
    • BUTTON

      public static final PriFlag BUTTON
    • LEVER

      public static final PriFlag LEVER
    • PRESSURE

      public static final PriFlag PRESSURE
    • REPEATER

      public static final PriFlag REPEATER
    • COMPARER

      public static final PriFlag COMPARER
    • NOTE_BLOCK

      public static final PriFlag NOTE_BLOCK
    • CONTAINER

      public static final PriFlag CONTAINER
    • HOPPER

      public static final PriFlag HOPPER
    • CRAFT

      public static final PriFlag CRAFT
    • CRAFTER

      public static final PriFlag CRAFTER
    • ANVIL

      public static final PriFlag ANVIL
    • ENCHANT

      public static final PriFlag ENCHANT
    • BREW

      public static final PriFlag BREW
    • BEACON

      public static final PriFlag BEACON
    • JUKEBOX

      public static final PriFlag JUKEBOX
    • LECTERN

      public static final PriFlag LECTERN
    • DRAGON_EGG

      public static final PriFlag DRAGON_EGG
    • ITEM_FRAME_INTERACTIVE

      public static final PriFlag ITEM_FRAME_INTERACTIVE
    • EDIT_SIGN

      public static final PriFlag EDIT_SIGN
    • BED

      public static final PriFlag BED
    • ANCHOR

      public static final PriFlag ANCHOR
    • VEHICLE_SPAWN

      public static final PriFlag VEHICLE_SPAWN
    • VEHICLE_DESTROY

      public static final PriFlag VEHICLE_DESTROY
    • HARVEST

      public static final PriFlag HARVEST
    • SOWING

      public static final PriFlag SOWING
    • FEED

      public static final PriFlag FEED
    • SHEAR

      public static final PriFlag SHEAR
    • LEASH

      public static final PriFlag LEASH
    • DYE

      public static final PriFlag DYE
    • HONEY

      public static final PriFlag HONEY
    • CAKE

      public static final PriFlag CAKE
    • TRADE

      public static final PriFlag TRADE
    • SHOOT

      public static final PriFlag SHOOT
    • EGG

      public static final PriFlag EGG
    • HOOK

      public static final PriFlag HOOK
    • PVP

      public static final PriFlag PVP
    • MONSTER_KILLING

      public static final PriFlag MONSTER_KILLING
    • ANIMAL_KILLING

      public static final PriFlag ANIMAL_KILLING
    • VILLAGER_KILLING

      public static final PriFlag VILLAGER_KILLING
    • GLOW

      public static final PriFlag GLOW
  • Constructor Details

    • Flags

      public Flags()
  • Method Details

    • getAllFlags

      public static List<Flag> getAllFlags()
      Returns a list of all flags.
      Returns:
      a list of all flags
    • getAllEnvFlags

      public static List<EnvFlag> getAllEnvFlags()
      Returns a list of all environment flags.
      Returns:
      a list of all environment flags
    • getAllPriFlags

      public static List<PriFlag> getAllPriFlags()
      Returns a list of all privilege flags.
      Returns:
      a list of all privilege flags
    • getAllEnvFlagsEnable

      public static List<EnvFlag> getAllEnvFlagsEnable()
      Returns a list of all enabled environment flags.
      Returns:
      a list of all enabled environment flags
    • getAllPriFlagsEnable

      public static List<PriFlag> getAllPriFlagsEnable()
      Returns a list of all enabled privilege flags.
      Returns:
      a list of all enabled privilege flags
    • getAllFlagsEnable

      public static List<Flag> getAllFlagsEnable()
      Returns a list of all enabled flags.
      Returns:
      a list of all enabled flags
    • getFlag

      public static Flag getFlag(String name)
      Returns a flag by its name from all flags.
      Parameters:
      name - the name of the flag
      Returns:
      the flag with the given name, or null if not found
    • getEnvFlag

      public static EnvFlag getEnvFlag(String name)
      Returns an environment flag by its name.
      Parameters:
      name - the name of the environment flag
      Returns:
      the environment flag with the given name, or null if not found
    • getPreFlag

      public static PriFlag getPreFlag(String name)
      Returns a privilege flag by its name.
      Parameters:
      name - the name of the privilege flag
      Returns:
      the privilege flag with the given name, or null if not found
    • registerEnvFlag

      public static boolean registerEnvFlag(org.bukkit.plugin.java.JavaPlugin plugin, EnvFlag flag)
      Registers an environment flag.

      Need to run applyNewCustomFlags() to make the new flag work.

      Parameters:
      plugin - the plugin registering the flag
      flag - the environment flag to register
      Returns:
      true if the flag was successfully registered, false otherwise
    • registerPriFlag

      public static boolean registerPriFlag(org.bukkit.plugin.java.JavaPlugin plugin, PriFlag flag)
      Registers a privilege flag.

      Need to run applyNewCustomFlags() to make the new flag work.

      Parameters:
      plugin - the plugin registering the flag
      flag - the privilege flag to register
      Returns:
      true if the flag was successfully registered, false otherwise
    • applyNewCustomFlags

      public static void applyNewCustomFlags() throws Exception
      Applies new custom flags by reloading the configuration and cache. This should be called after registering new flags to ensure they take effect.
      Throws:
      Exception - if reloading the config or cache fails