Class AbstractRegionSet

java.lang.Object
com.sk89q.worldguard.protection.AbstractRegionSet
All Implemented Interfaces:
ApplicableRegionSet, Iterable<ProtectedRegion>
Direct Known Subclasses:
FailedLoadRegionSet, PermissiveRegionSet, RegionResultSet

public abstract class AbstractRegionSet extends Object implements ApplicableRegionSet
  • Constructor Details

    • AbstractRegionSet

      public AbstractRegionSet()
  • Method Details

    • testState

      public boolean testState(@Nullable RegionAssociable subject, StateFlag... flags)
      Description copied from interface: ApplicableRegionSet
      Test whether the (effective) value for a list of state flags equals ALLOW.

      subject can be non-null to satisfy region group requirements, otherwise it will be assumed that the caller that is not a member of any regions. (Flags on a region can be changed so that they only apply to certain users.) The subject argument is required if the Flags.BUILD flag is in the list of flags.

      Specified by:
      testState in interface ApplicableRegionSet
      Parameters:
      subject - an optional subject, which would be used to determine the region groups that apply
      flags - a list of flags to check
      Returns:
      true if the result was ALLOW
      See Also:
    • queryState

      @Nullable public StateFlag.State queryState(@Nullable RegionAssociable subject, StateFlag... flags)
      Description copied from interface: ApplicableRegionSet
      Get the (effective) value for a list of state flags. The rules of states is observed here; that is, DENY overrides ALLOW, and ALLOW overrides NONE. One flag may override another.

      subject can be non-null to satisfy region group requirements, otherwise it will be assumed that the caller that is not a member of any regions. (Flags on a region can be changed so that they only apply to certain users.) The subject argument is required if the Flags.BUILD flag is in the list of flags.

      Specified by:
      queryState in interface ApplicableRegionSet
      Parameters:
      subject - an optional subject, which would be used to determine the region groups that apply
      flags - a list of flags to check
      Returns:
      a state