Class NoWorldGuard
java.lang.Object
me.deecaad.core.compatibility.worldguard.NoWorldGuard
- All Implemented Interfaces:
WorldGuardCompatibility
Used when WorldGuard is not installed
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.deecaad.core.compatibility.worldguard.WorldGuardCompatibility
WorldGuardCompatibility.FlagType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a keySet from theMapof register flags.Returns the value of a flag with the givenflagName.booleanReturnstrueif world guard is installed.voidregisterFlag(@NotNull String flag, @NotNull WorldGuardCompatibility.FlagType type) Registers a new flag with the given name and datatype.booleantestFlag(@NotNull org.bukkit.Location location, @Nullable org.bukkit.entity.Player player, @NotNull String flagName) Tests the state flag with the givenflagName.
-
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:WorldGuardCompatibilityTests the state flag with the givenflagName. This method will returntrueif that flag is enabled for the givenlocation.If the
playerargument is notnull, this method can also returntrueif they have permission to override a region's permission. For example, region owners can bypass most, if not all restrictions.- Specified by:
testFlagin interfaceWorldGuardCompatibility- Parameters:
location- The non-null coordinates to test for regions.player- The player involved, ornull.flagName- The non-null name of the flag.- Returns:
trueif the flag is enabled.
-
getValue
public Object getValue(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull String flagName) Description copied from interface:WorldGuardCompatibilityReturns the value of a flag with the givenflagName. The returned value depends on the region that contains thelocation.The datatype of the returned value depends on the
WorldGuardCompatibility.FlagType.- Specified by:
getValuein interfaceWorldGuardCompatibility- 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:WorldGuardCompatibilityRegisters a new flag with the given name and datatype.- Specified by:
registerFlagin interfaceWorldGuardCompatibility- Parameters:
flag- The non-null flag name.type- The non-null data type of the flag.
-
isInstalled
public boolean isInstalled()Description copied from interface:WorldGuardCompatibilityReturnstrueif world guard is installed. This is the same asPluginManager#getPlugin("WorldGuard") != null.- Specified by:
isInstalledin interfaceWorldGuardCompatibility- Returns:
trueif the server uses world guard.
-
getRegisteredFlags
Description copied from interface:WorldGuardCompatibilityReturns a keySet from theMapof register flags. Only flags added usingWorldGuardCompatibility.registerFlag(String, FlagType)are added to the backing map.- Specified by:
getRegisteredFlagsin interfaceWorldGuardCompatibility- Returns:
- The non-null set of flag names.
-