Class WorldGuardUtils
java.lang.Object
nl.mtvehicles.core.infrastructure.dependencies.WorldGuardUtils
Methods for WorldGuard soft-dependency.
- Beware!
- Do not initialise this class directly. Use
DependencyModule.worldGuard
instead.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic HashMap
<WGFlag, org.codemc.worldguardwrapper.flag.IWrappedFlag<org.codemc.worldguardwrapper.flag.WrappedState>> HashMap which contains custom flagsstatic org.codemc.worldguardwrapper.WorldGuardWrapper
WorldGuardWrapper instance (supports both WG v6 and v7 API) -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor which registers flags - do not use this.
UseDependencyModule.worldGuard
instead. -
Method Summary
Modifier and TypeMethodDescriptiongetRegionNames
(org.bukkit.Location loc) boolean
isInRegionWithFlag
(org.bukkit.entity.Player player, org.bukkit.Location loc, WGFlag customFlag, boolean flagState) Check whether a location is in a region with a (custom) flag of a specified state.boolean
isInRegionWithFlag
(org.bukkit.entity.Player player, org.bukkit.Location loc, WGFlag customFlag, org.codemc.worldguardwrapper.flag.WrappedState flagState) Check whether a location is in a region with a (custom) flag of a specified state.boolean
isInsideGasStation
(org.bukkit.entity.Player player, org.bukkit.Location loc) Check whether the given location is inside a gas stationboolean
isInsideRegion
(org.bukkit.Location loc, String regionName) Check whether a location is inside a region with a specified name.
-
Field Details
-
instance
public static org.codemc.worldguardwrapper.WorldGuardWrapper instanceWorldGuardWrapper instance (supports both WG v6 and v7 API) -
flags
public static HashMap<WGFlag,org.codemc.worldguardwrapper.flag.IWrappedFlag<org.codemc.worldguardwrapper.flag.WrappedState>> flagsHashMap which contains custom flags- See Also:
-
-
Constructor Details
-
WorldGuardUtils
public WorldGuardUtils()Default constructor which registers flags - do not use this.
UseDependencyModule.worldGuard
instead.
-
-
Method Details
-
isInsideGasStation
public boolean isInsideGasStation(org.bukkit.entity.Player player, org.bukkit.Location loc) Check whether the given location is inside a gas station -
getRegionNames
-
isInsideRegion
Check whether a location is inside a region with a specified name.- Parameters:
loc
- Location which may be inside a regionregionName
- Name of the region- Returns:
- True if location is in at least 1 region with the specified name.
-
isInRegionWithFlag
public boolean isInRegionWithFlag(org.bukkit.entity.Player player, org.bukkit.Location loc, WGFlag customFlag, org.codemc.worldguardwrapper.flag.WrappedState flagState) Check whether a location is in a region with a (custom) flag of a specified state.- Parameters:
player
- Player (may change the flag depending on who the player is)loc
- Location which may be inside a regioncustomFlag
- Custom WorldGuard flag (seeWGFlag
)flagState
- State of the flag (ALLOW/DENY)- Returns:
- True if location is in at least 1 region with the flag with the specified state.
-
isInRegionWithFlag
public boolean isInRegionWithFlag(org.bukkit.entity.Player player, org.bukkit.Location loc, WGFlag customFlag, boolean flagState) Check whether a location is in a region with a (custom) flag of a specified state.- Parameters:
player
- (may change the flag depending on who the player is)loc
- Location which may be inside a regioncustomFlag
- Custom WorldGuard flag (seeWGFlag
)flagState
- State of the flag - specified by a boolean (true = ALLOW / false = DENY)- Returns:
- True if location is in at least 1 region with the flag with the specified state.
-