Class FlagValue

java.lang.Object
de.z0rdak.yawp.core.flag.FlagValue
All Implemented Interfaces:
IFlag, Comparable<IFlag>
Direct Known Subclasses:
BooleanFlag

public abstract class FlagValue extends Object implements IFlag
  • Field Details

    • CODEC

      public static com.mojang.serialization.Codec<IFlag> CODEC
    • name

      protected String name
    • type

      protected FlagType type
    • state

      protected FlagState state
    • doesOverride

      protected boolean doesOverride
    • msg

      protected FlagMessage msg
  • Constructor Details

  • Method Details

    • getType

      public FlagType getType()
      Description copied from interface: IFlag
      Returns the flag type of the flag. *
      Specified by:
      getType in interface IFlag
      Returns:
      the flag type enum value of the flag.
      See Also:
    • getName

      public String getName()
      Description copied from interface: IFlag
      Get the unique identifier for the flag.
      The valid flags are currently stored as an enum.
      Mod:Name -> ResourceLocation in the future.
      Specified by:
      getName in interface IFlag
      Returns:
      unique name for flag.
      See Also:
    • isActive

      public boolean isActive()
      Description copied from interface: IFlag
      Returns whether the flag is active in the region.
      This means the flag state is either ALLOWED or DENIED.
      Disabled flags are not considered for flag checks.
      Specified by:
      isActive in interface IFlag
      Returns:
      true if flag is active, false otherwise.
    • getState

      public FlagState getState()
      Specified by:
      getState in interface IFlag
    • setState

      public void setState(FlagState state)
      Specified by:
      setState in interface IFlag
    • doesOverride

      public boolean doesOverride()
      Description copied from interface: IFlag
      Returns whether the flag does override the same flag defined in child regions.
      Specified by:
      doesOverride in interface IFlag
      Returns:
      true if the flag overrides the same flag in child regions
    • setOverride

      public void setOverride(boolean override)
      Description copied from interface: IFlag
      Set the override state of the flag.
      When true, it overrides the same flag in child regions.
      Specified by:
      setOverride in interface IFlag
      Parameters:
      override - overrides the same flag in child regions if set to true
    • getFlagMsg

      public FlagMessage getFlagMsg()
      Specified by:
      getFlagMsg in interface IFlag
    • setFlagMsg

      public void setFlagMsg(FlagMessage msg)
      Specified by:
      setFlagMsg in interface IFlag
    • compareTo

      public int compareTo(IFlag o)
      Specified by:
      compareTo in interface Comparable<IFlag>