Class FlagRegister

java.lang.Object
de.z0rdak.yawp.api.FlagRegister

public class FlagRegister extends Object
  • Field Details

    • PLAYER_BREED_ANIMAL

      public static final Flag PLAYER_BREED_ANIMAL
    • PLAYER_MOUNT

      public static final Flag PLAYER_MOUNT
    • PLAYER_TAME_ANIMAL

      public static final Flag PLAYER_TAME_ANIMAL
    • PLAYER_UNMOUNTING

      public static final Flag PLAYER_UNMOUNTING
    • PLAYER_STRIP_WOOD

      public static final Flag PLAYER_STRIP_WOOD
    • PLAYER_BREAK_BLOCKS

      public static final Flag PLAYER_BREAK_BLOCKS
    • PLAYER_USE_CONTAINER

      public static final Flag PLAYER_USE_CONTAINER
    • PLAYER_GAIN_LOOT

      public static final Flag PLAYER_GAIN_LOOT
    • PLAYER_USE_CHEST_ACCESS

      public static final Flag PLAYER_USE_CHEST_ACCESS
    • PLAYER_ENTER_LEVEL

      public static final Flag PLAYER_ENTER_LEVEL
    • PLAYER_USE_COMMANDS

      public static final Flag PLAYER_USE_COMMANDS
    • PLAYER_TILL

      public static final Flag PLAYER_TILL
    • PLAYER_IGNITE_EXPLOSIVES

      public static final Flag PLAYER_IGNITE_EXPLOSIVES
    • PLAYER_HURT

      public static final Flag PLAYER_HURT
    • PLAYER_DROP_ITEM

      public static final Flag PLAYER_DROP_ITEM
    • PLAYER_PICKUP_ITEM

      public static final Flag PLAYER_PICKUP_ITEM
    • PLAYER_APPLY_KNOCKBACK

      public static final Flag PLAYER_APPLY_KNOCKBACK
    • PLAYER_KNOCKBACK

      public static final Flag PLAYER_KNOCKBACK
    • PLAYER_GAIN_LEVEL

      public static final Flag PLAYER_GAIN_LEVEL
    • PLAYER_WALKER_FREEZE

      public static final Flag PLAYER_WALKER_FREEZE
    • PLAYER_FALL_DAMAGE

      public static final Flag PLAYER_FALL_DAMAGE
    • PLAYER_FIRE_BOW

      public static final Flag PLAYER_FIRE_BOW
    • PLAYER_MELEE_ANIMALS

      public static final Flag PLAYER_MELEE_ANIMALS
    • PLAYER_MELEE_MONSTERS

      public static final Flag PLAYER_MELEE_MONSTERS
    • PLAYER_MELEE_PLAYERS

      public static final Flag PLAYER_MELEE_PLAYERS
    • PLAYER_MELEE_VILLAGERS

      public static final Flag PLAYER_MELEE_VILLAGERS
    • PLAYER_MELEE_WANDERING_TRADER

      public static final Flag PLAYER_MELEE_WANDERING_TRADER
    • PLAYER_FLIGHT

      public static final Flag PLAYER_FLIGHT
    • PLAYER_PVP

      public static final Flag PLAYER_PVP
    • PLAYER_EDIT_SIGNS

      public static final Flag PLAYER_EDIT_SIGNS
    • PLAYER_PLACE_BLOCKS

      public static final Flag PLAYER_PLACE_BLOCKS
    • PLAYER_PLACE_FLUIDS

      public static final Flag PLAYER_PLACE_FLUIDS
    • PLAYER_SCOOP_FLUIDS

      public static final Flag PLAYER_SCOOP_FLUIDS
    • PLAYER_CHAT

      public static final Flag PLAYER_CHAT
    • PLAYER_SET_SPAWN

      public static final Flag PLAYER_SET_SPAWN
    • PLAYER_SHOVEL_PATH

      public static final Flag PLAYER_SHOVEL_PATH
    • PLAYER_CREATE_PORTAL

      public static final Flag PLAYER_CREATE_PORTAL
    • PLAYER_TOOL_SECONDARY

      public static final Flag PLAYER_TOOL_SECONDARY
    • PLAYER_TRAMPLE_FARMLAND

      public static final Flag PLAYER_TRAMPLE_FARMLAND
    • PLAYER_USE_BLOCKS

      public static final Flag PLAYER_USE_BLOCKS
    • PLAYER_USE_BONEMEAL

      public static final Flag PLAYER_USE_BONEMEAL
    • PLAYER_USE_ELYTRA

      public static final Flag PLAYER_USE_ELYTRA
    • PLAYER_USE_ENDERPEARL

      public static final Flag PLAYER_USE_ENDERPEARL
    • PLAYER_ENDERPEARL_AWAY

      public static final Flag PLAYER_ENDERPEARL_AWAY
    • PLAYER_INTERACT

      public static final Flag PLAYER_INTERACT
    • PLAYER_USE_ITEMS

      public static final Flag PLAYER_USE_ITEMS
    • PLAYER_SLEEP

      public static final Flag PLAYER_SLEEP
    • PLAYER_ENTER_PORTAL

      public static final Flag PLAYER_ENTER_PORTAL
    • PLAYER_KEEP_XP

      public static final Flag PLAYER_KEEP_XP
    • PLAYER_KEEP_INV

      public static final Flag PLAYER_KEEP_INV
    • PLAYER_APPLY_HUNGER

      public static final Flag PLAYER_APPLY_HUNGER
    • PLAYER_DROP_XP

      public static final Flag PLAYER_DROP_XP
    • PLAYER_GAIN_XP

      public static final Flag PLAYER_GAIN_XP
    • PLAYER_PICKUP_XP

      public static final Flag PLAYER_PICKUP_XP
    • DRAGON_BLOCK_PROT

      public static final Flag DRAGON_BLOCK_PROT
    • DROP_LOOT_ALL

      public static final Flag DROP_LOOT_ALL
    • ENDERMAN_GRIEFING

      public static final Flag ENDERMAN_GRIEFING
    • ENDERMAN_TELEPORT

      public static final Flag ENDERMAN_TELEPORT
    • EXPLOSION_BLOCK

      public static final Flag EXPLOSION_BLOCK
    • EXPLOSION_ENTITY

      public static final Flag EXPLOSION_ENTITY
    • EXPLOSION_CREEPER_BLOCK

      public static final Flag EXPLOSION_CREEPER_BLOCK
    • EXPLOSION_CREEPER_ENTITY

      public static final Flag EXPLOSION_CREEPER_ENTITY
    • TRAMPLE_FARMLAND

      public static final Flag TRAMPLE_FARMLAND
    • FALL_DAMAGE

      public static final Flag FALL_DAMAGE
    • FALL_DAMAGE_ANIMALS

      public static final Flag FALL_DAMAGE_ANIMALS
    • FALL_DAMAGE_MONSTERS

      public static final Flag FALL_DAMAGE_MONSTERS
    • SHULKER_TELEPORT

      public static final Flag SHULKER_TELEPORT
    • FALL_DAMAGE_VILLAGERS

      public static final Flag FALL_DAMAGE_VILLAGERS
    • LAVA_FLOW

      public static final Flag LAVA_FLOW
    • LIGHTNING_PROT

      public static final Flag LIGHTNING_PROT
    • FLUID_FLOW

      public static final Flag FLUID_FLOW
    • LEAF_DECAY

      public static final Flag LEAF_DECAY
    • FIRE_TICK

      public static final Flag FIRE_TICK
    • NO_ITEM_DESPAWN

      public static final Flag NO_ITEM_DESPAWN
    • MOB_GRIEFING

      public static final Flag MOB_GRIEFING
    • SNOW_FALL

      public static final Flag SNOW_FALL
    • SNOW_MELTING

      public static final Flag SNOW_MELTING
    • SPAWNING_ALL

      public static final Flag SPAWNING_ALL
    • SPAWNING_ANIMAL

      public static final Flag SPAWNING_ANIMAL
    • SPAWNING_GOLEM

      public static final Flag SPAWNING_GOLEM
    • SPAWNING_MONSTER

      public static final Flag SPAWNING_MONSTER
    • SPAWNING_SLIME

      public static final Flag SPAWNING_SLIME
    • SPAWNING_TRADER

      public static final Flag SPAWNING_TRADER
    • SPAWNING_VILLAGER

      public static final Flag SPAWNING_VILLAGER
    • SPAWNING_XP

      public static final Flag SPAWNING_XP
    • USE_PORTAL

      public static final Flag USE_PORTAL
    • USE_PORTAL_ANIMALS

      public static final Flag USE_PORTAL_ANIMALS
    • USE_PORTAL_ITEMS

      public static final Flag USE_PORTAL_ITEMS
    • USE_PORTAL_MINECARTS

      public static final Flag USE_PORTAL_MINECARTS
    • USE_PORTAL_MONSTERS

      public static final Flag USE_PORTAL_MONSTERS
    • USE_PORTAL_VILLAGERS

      public static final Flag USE_PORTAL_VILLAGERS
    • WATER_FLOW

      public static final Flag WATER_FLOW
    • WITHER_BLOCK_PROT

      public static final Flag WITHER_BLOCK_PROT
    • XP_DROP_ALL

      public static final Flag XP_DROP_ALL
    • XP_DROP_MONSTER

      public static final Flag XP_DROP_MONSTER
    • ZOMBIE_DOOR_PROT

      public static final Flag ZOMBIE_DOOR_PROT
  • Method Details

    • isSame

      public static boolean isSame(String flagId, Flag flag)
      Checks if the given flag ID matches the specified Flag.
      Parameters:
      flagId - The string representation of the flag ID.
      flag - The flag to compare against.
      Returns:
      True if the flag ID matches the flag's ResourceLocation, false otherwise.
    • isSame

      public static boolean isSame(Flag left, Flag right)
      Checks if two Flag instances represent the same flag.
      Parameters:
      left - The first flag.
      right - The second flag.
      Returns:
      True if both flags have the same ResourceLocation, false otherwise.
    • isSame

      public static boolean isSame(net.minecraft.resources.ResourceLocation flagId, Flag flag)
      Checks if the given ResourceLocation matches the specified Flag.
      Parameters:
      flagId - The ResourceLocation of the flag.
      flag - The flag to compare against.
      Returns:
      True if the ResourceLocation matches the flag's ResourceLocation, false otherwise.
    • registerFlag

      public static boolean registerFlag(@NotNull @NotNull net.minecraft.resources.ResourceLocation flagRl, @NotNull @NotNull FlagMetaInfo flagMetaInfo)
      Registers a flag in the internal flag registry using a ResourceLocation and FlagMetaInfo. If a flag with the same resource location already exists, registration is skipped.
      Parameters:
      flagRl - The unique resource location of the flag.
      flagMetaInfo - The metadata associated with the flag.
      Returns:
      true if the flag was successfully registered, false if it was already registered.
    • registerFlag

      public static boolean registerFlag(@NotNull @NotNull String modId, @NotNull @NotNull String flagId, @NotNull @NotNull FlagMetaInfo flagMetaInfo)
      Registers a flag in the internal flag registry using the modId of the registering mod and a flagId. If a flag with the same resource location already exists, registration is skipped.
      Parameters:
      modId - The namespace of the mod defining the flag.
      flagId - The unique identifier of the flag within the mod's namespace.
      flagMetaInfo - The metadata associated with the flag.
      Returns:
      true if the flag was successfully registered, false if it was already registered.
    • getFlagsByFrequency

      public static Set<Flag> getFlagsByFrequency(FlagFrequency frequency)
      Retrieves all registered flags that match a given frequency.
      Parameters:
      frequency - The frequency to filter flags by.
      Returns:
      A set of flags that have the specified frequency.
    • isFlagRegistered

      public static boolean isFlagRegistered(net.minecraft.resources.ResourceLocation rl)
      Checks if a flag is registered based on its ResourceLocation.
      Parameters:
      rl - The ResourceLocation of the flag.
      Returns:
      True if the flag is registered, false otherwise.
    • isRegistered

      public static boolean isRegistered(String flagIdentifier)
      Checks if a flag is registered based on its string identifier.
      Parameters:
      flagIdentifier - The string representation of the flag.
      Returns:
      True if the flag is registered, false otherwise.
    • byId

      public static Flag byId(String flagIdentifier) throws IllegalArgumentException
      Retrieves a Flag by its string identifier.
      Parameters:
      flagIdentifier - The string representation of the flag.
      Returns:
      The corresponding Flag.
      Throws:
      IllegalArgumentException - If the flag is not registered.
    • getFlagOptional

      public static Optional<Flag> getFlagOptional(net.minecraft.resources.ResourceLocation rl)
      Retrieves an Optional containing the Flag if it exists.
      Parameters:
      rl - The ResourceLocation of the flag.
      Returns:
      An Optional containing the flag if registered, otherwise empty.
    • getFlag

      @Nullable public static @Nullable Flag getFlag(net.minecraft.resources.ResourceLocation rl)
      Retrieves a Flag by its ResourceLocation, or null if not found.
      Parameters:
      rl - The ResourceLocation of the flag.
      Returns:
      The corresponding Flag if registered, otherwise null.
    • getFlagNames

      public static List<String> getFlagNames()
      Gets a list of all registered flag names as strings.
      Returns:
      A list of flag names.
    • getFlags

      public static Set<Flag> getFlags()
      Retrieves a set of all registered Flags.
      Returns:
      A set containing all registered Flags.
    • getFlagsMatchingTag

      public static Set<Flag> getFlagsMatchingTag(FlagTag tag)
      Retrieves all flags that match a given category tag.
      Parameters:
      tag - The category tag to filter flags by.
      Returns:
      A set of flags that match the given tag.
    • hasPlayerTag

      public static boolean hasPlayerTag(IFlag flag)
      Checks if a given flag has the PLAYER tag based on its identifier.
      Parameters:
      flag - The flag to check.
      Returns:
      True if the flag has the PLAYER tag, false otherwise.
    • hasPlayerTag

      public static boolean hasPlayerTag(Flag flag)
      Checks if a given flag has the PLAYER tag.
      Parameters:
      flag - The flag to check.
      Returns:
      True if the flag has the PLAYER tag, false otherwise.
    • matchesCategory

      public static boolean matchesCategory(Flag flag, Set<String> tags)
      Determines if a flag belongs to a given set of category tags.
      Parameters:
      flag - The flag to check.
      tags - The set of category tags.
      Returns:
      True if the flag has at least one of the given tags, false otherwise.