Enum Class WorldFlag

java.lang.Object
java.lang.Enum<WorldFlag>
me.tayebyassine.homestead.flags.WorldFlag
All Implemented Interfaces:
Serializable, Comparable<WorldFlag>, Constable

public enum WorldFlag extends Enum<WorldFlag>
Enum representing world flags that control world-level mechanics within a region.

World flags govern environmental and entity behavior such as mob spawning, fire spread, liquid flow, explosions, and other world mechanics. These flags are applied at the region level and affect all players and entities within the region boundaries. Each flag is represented as a unique bit in a 64-bit integer.

See Also:
  • Enum Constant Details

    • PASSIVE_ENTITY_SPAWN

      public static final WorldFlag PASSIVE_ENTITY_SPAWN
      Allows passive entities (animals, villagers) to spawn naturally in the region.
    • HOSTILE_ENTITY_SPAWN

      public static final WorldFlag HOSTILE_ENTITY_SPAWN
      Allows hostile entities (mobs, monsters) to spawn naturally in the region.
    • ENTITY_GRIEFING

      public static final WorldFlag ENTITY_GRIEFING
      Allows entities to grief blocks (e.g., creeper explosions, enderman picking up blocks).
    • ENTITY_DAMAGE

      public static final WorldFlag ENTITY_DAMAGE
      Allows entities to take damage from environmental sources in the region.
    • LEAVES_DECAY

      public static final WorldFlag LEAVES_DECAY
      Allows leaves to decay naturally when their logs are removed.
    • FIRE_SPREAD

      public static final WorldFlag FIRE_SPREAD
      Allows fire to spread to adjacent flammable blocks.
    • LIQUID_FLOW

      public static final WorldFlag LIQUID_FLOW
      Allows liquids (water, lava) to flow naturally.
    • EXPLOSION_DAMAGE

      public static final WorldFlag EXPLOSION_DAMAGE
      Allows explosions to damage blocks in the region.
    • WITHER_DAMAGE

      public static final WorldFlag WITHER_DAMAGE
      Allows the Wither boss to damage blocks in the region.
    • WILDERNESS_PISTONS

      public static final WorldFlag WILDERNESS_PISTONS
      Allows pistons to function in wilderness areas.
    • WILDERNESS_DISPENSERS

      public static final WorldFlag WILDERNESS_DISPENSERS
      Allows dispensers to function in wilderness areas.
    • WILDERNESS_MINECARTS

      public static final WorldFlag WILDERNESS_MINECARTS
      Allows minecarts to function in wilderness areas.
    • PLANT_GROWTH

      public static final WorldFlag PLANT_GROWTH
      Allows plants (crops, saplings) to grow naturally.
    • GRASS_GROWTH

      public static final WorldFlag GRASS_GROWTH
      Allows grass and mycelium to spread to dirt blocks.
    • SCULK_SPREAD

      public static final WorldFlag SCULK_SPREAD
      Allows sculk blocks to spread in the region.
    • PLAYER_GLOWING

      public static final WorldFlag PLAYER_GLOWING
      Makes players in the region glow (visible through walls).
    • SNOW_MELTING

      public static final WorldFlag SNOW_MELTING
      Allows snow layers to melt near light sources.
    • ICE_MELTING

      public static final WorldFlag ICE_MELTING
      Allows ice to melt near light sources.
    • SNOWMAN_TRAILS

      public static final WorldFlag SNOWMAN_TRAILS
      Allows snowmen to leave snow trails as they move.
    • WINDCHARGE_BURST

      public static final WorldFlag WINDCHARGE_BURST
      Allows wind charge burst effects in the region.
    • COPPER_GOLEMS_INTERACTION

      @Deprecated public static final WorldFlag COPPER_GOLEMS_INTERACTION
      Deprecated.
      Use ENTITY_GRIEFING instead.
      Allows copper golems to interact.
    • WARS

      public static final WorldFlag WARS
      Allows war mechanics (region vs region combat) in the region.
    • PROJECTILES

      public static final WorldFlag PROJECTILES
      Allows projectiles (arrows, fireballs, etc.) to damage blocks or entities in the region.
    • WEATHER_SNOW

      public static final WorldFlag WEATHER_SNOW
      Allows snow weather in the region.
  • Method Details

    • values

      public static WorldFlag[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static WorldFlag valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getFlags

      public static List<String> getFlags()
      Returns a sorted list of all world flag config names.
      Returns:
      list of flag names
    • parse

      public static long parse(String name)
      Parses a flag name and returns its bitmask value.
      Parameters:
      name - the config name of the flag (case-insensitive)
      Returns:
      the bitmask value, or 0 if not found
    • from

      public static String from(long flag)
      Returns the config name of a flag given its bitmask value.
      Parameters:
      flag - the bitmask value
      Returns:
      the config name, or null if not found
    • getSet

      public static List<String> getSet(long flags)
      Returns a list of flag names that are set (enabled) in the given bitmask.
      Parameters:
      flags - the combined bitmask of flags
      Returns:
      list of enabled flag names
    • getUnset

      public static List<String> getUnset(long flags)
      Returns a list of flag names that are not set (disabled) in the given bitmask.
      Parameters:
      flags - the combined bitmask of flags
      Returns:
      list of disabled flag names
    • getBitmask

      public long getBitmask()
      Returns the bitmask value of this flag.
      Returns:
      the bitmask as a long value
    • getName

      public String getName()
      Returns the configuration name of this flag (lowercase with hyphens).
      Returns:
      the config name