Package dev.espi.protectionstones.utils
Class WGUtils
java.lang.Object
dev.espi.protectionstones.utils.WGUtils
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canMergeRegionTypes(PSProtectBlock current, PSRegion mergeInto)
static String
createPSID(double bx, double by, double bz)
static String
createPSID(org.bukkit.Location l)
static Set<com.sk89q.worldguard.protection.regions.ProtectedRegion>
findOverlapOrAdjacentRegions(com.sk89q.worldguard.protection.regions.ProtectedRegion r, com.sk89q.worldguard.protection.managers.RegionManager rgm, org.bukkit.World w)
Find regions that are overlapping or adjacent to the region given.static Set<com.sk89q.worldguard.protection.regions.ProtectedRegion>
findOverlapOrAdjacentRegions(com.sk89q.worldguard.protection.regions.ProtectedRegion r, List<com.sk89q.worldguard.protection.regions.ProtectedRegion> regionsToCheck, org.bukkit.World w)
Find regions that are overlapping or adjacent to the region given.static HashMap<org.bukkit.World,com.sk89q.worldguard.protection.managers.RegionManager>
Get all region managers for all worlds.static com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion
static com.sk89q.worldguard.protection.flags.registry.FlagRegistry
static com.sk89q.worldedit.math.BlockVector3
getMaxChunkVector(double bx, double by, double bz, long chunkRadius, long yRadius)
static com.sk89q.worldedit.math.BlockVector3
getMaxVector(double bx, double by, double bz, long xRadius, long yRadius, long zRadius)
static com.sk89q.worldedit.math.BlockVector3
getMinChunkVector(double bx, double by, double bz, long chunkRadius, long yRadius)
static com.sk89q.worldedit.math.BlockVector3
getMinVector(double bx, double by, double bz, long xRadius, long yRadius, long zRadius)
getPlayerAdjacentRegionGroups(org.bukkit.entity.Player p, com.sk89q.worldguard.protection.managers.RegionManager rm)
static List<com.sk89q.worldedit.math.BlockVector2>
static com.sk89q.worldguard.protection.managers.RegionManager
getRegionManagerWithPlayer(org.bukkit.entity.Player p)
static com.sk89q.worldguard.protection.managers.RegionManager
getRegionManagerWithWorld(org.bukkit.World w)
Get a RegionManager from a world.static List<com.sk89q.worldguard.protection.regions.ProtectedRegion>
getTransientEdgeRegions(org.bukkit.World w, com.sk89q.worldguard.protection.regions.ProtectedRegion r)
Find the list of regions that border `r` (adjacent to the edge), but do not include the corners.static boolean
hasNoAccess(com.sk89q.worldguard.protection.regions.ProtectedRegion region, org.bukkit.entity.Player p, com.sk89q.worldguard.LocalPlayer lp, boolean canBeMember)
static String
matchLocationToPSID(org.bukkit.Location l)
static boolean
overlapsStrongerRegion(org.bukkit.World w, com.sk89q.worldguard.protection.regions.ProtectedRegion r, com.sk89q.worldguard.LocalPlayer lp)
static PSLocation
parsePSRegionToLocation(String regionId)
static <T extends com.sk89q.worldguard.protection.flags.Flag<String>>
voidsetFlagIfNeeded(com.sk89q.worldguard.protection.regions.ProtectedRegion region, T flag, String value)
static <T extends com.sk89q.worldguard.protection.flags.Flag<List<V>>, V>
voidsetFlagIfNeeded(com.sk89q.worldguard.protection.regions.ProtectedRegion region, T flag, List<V> value)
static <T extends com.sk89q.worldguard.protection.flags.Flag<Set<V>>, V>
voidsetFlagIfNeeded(com.sk89q.worldguard.protection.regions.ProtectedRegion region, T flag, Set<V> value)
-
Field Details
-
MAX_BUILD_HEIGHT
public static final int MAX_BUILD_HEIGHT- See Also:
- Constant Field Values
-
MIN_BUILD_HEIGHT
public static final int MIN_BUILD_HEIGHT- See Also:
- Constant Field Values
-
-
Constructor Details
-
WGUtils
public WGUtils()
-
-
Method Details
-
getFlagRegistry
public static com.sk89q.worldguard.protection.flags.registry.FlagRegistry getFlagRegistry() -
getRegionManagerWithPlayer
public static com.sk89q.worldguard.protection.managers.RegionManager getRegionManagerWithPlayer(org.bukkit.entity.Player p) -
getRegionManagerWithWorld
public static com.sk89q.worldguard.protection.managers.RegionManager getRegionManagerWithWorld(org.bukkit.World w)Get a RegionManager from a world.- Parameters:
w
- the world- Returns:
- the region manager, or null if it is not found
-
getAllRegionManagers
public static HashMap<org.bukkit.World,com.sk89q.worldguard.protection.managers.RegionManager> getAllRegionManagers()Get all region managers for all worlds. Use this instead of looping worlds manually because some worlds may not have a region manager.- Returns:
- returns all region managers from all worlds
-
parsePSRegionToLocation
-
findOverlapOrAdjacentRegions
public static Set<com.sk89q.worldguard.protection.regions.ProtectedRegion> findOverlapOrAdjacentRegions(com.sk89q.worldguard.protection.regions.ProtectedRegion r, com.sk89q.worldguard.protection.managers.RegionManager rgm, org.bukkit.World w)Find regions that are overlapping or adjacent to the region given.- Parameters:
r
-rgm
-w
-- Returns:
- the list of regions
-
findOverlapOrAdjacentRegions
public static Set<com.sk89q.worldguard.protection.regions.ProtectedRegion> findOverlapOrAdjacentRegions(com.sk89q.worldguard.protection.regions.ProtectedRegion r, List<com.sk89q.worldguard.protection.regions.ProtectedRegion> regionsToCheck, org.bukkit.World w)Find regions that are overlapping or adjacent to the region given.- Parameters:
r
-regionsToCheck
-w
-- Returns:
- the list of regions
-
getTransientEdgeRegions
public static List<com.sk89q.worldguard.protection.regions.ProtectedRegion> getTransientEdgeRegions(org.bukkit.World w, com.sk89q.worldguard.protection.regions.ProtectedRegion r)Find the list of regions that border `r` (adjacent to the edge), but do not include the corners.- Parameters:
r
- region- Returns:
- the list of regions
-
overlapsStrongerRegion
public static boolean overlapsStrongerRegion(org.bukkit.World w, com.sk89q.worldguard.protection.regions.ProtectedRegion r, com.sk89q.worldguard.LocalPlayer lp) -
matchLocationToPSID
-
getMinVector
public static com.sk89q.worldedit.math.BlockVector3 getMinVector(double bx, double by, double bz, long xRadius, long yRadius, long zRadius) -
getMaxVector
public static com.sk89q.worldedit.math.BlockVector3 getMaxVector(double bx, double by, double bz, long xRadius, long yRadius, long zRadius) -
getMinChunkVector
public static com.sk89q.worldedit.math.BlockVector3 getMinChunkVector(double bx, double by, double bz, long chunkRadius, long yRadius) -
getMaxChunkVector
public static com.sk89q.worldedit.math.BlockVector3 getMaxChunkVector(double bx, double by, double bz, long chunkRadius, long yRadius) -
createPSID
-
createPSID
-
hasNoAccess
public static boolean hasNoAccess(com.sk89q.worldguard.protection.regions.ProtectedRegion region, org.bukkit.entity.Player p, com.sk89q.worldguard.LocalPlayer lp, boolean canBeMember) -
getPlayerAdjacentRegionGroups
-
getDefaultProtectedRegion
public static com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion getDefaultProtectedRegion(PSProtectBlock b, PSLocation v) -
getPointsFromDecomposedRegion
-
canMergeRegionTypes
-
setFlagIfNeeded
-
setFlagIfNeeded
-
setFlagIfNeeded
-