Class NoWorldGuard

java.lang.Object
me.deecaad.core.compatibility.worldguard.NoWorldGuard
All Implemented Interfaces:
WorldGuardCompatibility

public class NoWorldGuard extends Object implements WorldGuardCompatibility
Used when WorldGuard is not installed
  • Constructor Details

    • NoWorldGuard

      public NoWorldGuard()
  • Method Details

    • testFlag

      public boolean testFlag(@NotNull @NotNull org.bukkit.Location location, @Nullable @Nullable org.bukkit.entity.Player player, @NotNull @NotNull String flagName)
      Description copied from interface: WorldGuardCompatibility
      Tests the state flag with the given flagName. This method will return true if that flag is enabled for the given location.

      If the player argument is not null, this method can also return true if they have permission to override a region's permission. For example, region owners can bypass most, if not all restrictions.

      Specified by:
      testFlag in interface WorldGuardCompatibility
      Parameters:
      location - The non-null coordinates to test for regions.
      player - The player involved, or null.
      flagName - The non-null name of the flag.
      Returns:
      true if the flag is enabled.
    • getValue

      public Object getValue(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull String flagName)
      Description copied from interface: WorldGuardCompatibility
      Returns the value of a flag with the given flagName. The returned value depends on the region that contains the location.

      The datatype of the returned value depends on the WorldGuardCompatibility.FlagType.

      Specified by:
      getValue in interface WorldGuardCompatibility
      Parameters:
      location - The non-null coordinates to test for regions.
      flagName - The non-null name of the flag.
      Returns:
      The value of the flag for that region, or null.
    • registerFlag

      public void registerFlag(@NotNull @NotNull String flag, @NotNull @NotNull WorldGuardCompatibility.FlagType type)
      Description copied from interface: WorldGuardCompatibility
      Registers a new flag with the given name and datatype.
      Specified by:
      registerFlag in interface WorldGuardCompatibility
      Parameters:
      flag - The non-null flag name.
      type - The non-null data type of the flag.
    • isInstalled

      public boolean isInstalled()
      Description copied from interface: WorldGuardCompatibility
      Returns true if world guard is installed. This is the same as PluginManager#getPlugin("WorldGuard") != null.
      Specified by:
      isInstalled in interface WorldGuardCompatibility
      Returns:
      true if the server uses world guard.
    • getRegisteredFlags

      @NotNull public @NotNull Set<String> getRegisteredFlags()
      Description copied from interface: WorldGuardCompatibility
      Returns a keySet from the Map of register flags. Only flags added using WorldGuardCompatibility.registerFlag(String, FlagType) are added to the backing map.
      Specified by:
      getRegisteredFlags in interface WorldGuardCompatibility
      Returns:
      The non-null set of flag names.