public class TARDISWorldGuardUtils
extends java.lang.Object
Constructor and Description |
---|
TARDISWorldGuardUtils(TARDIS plugin)
Checks if WorldGuard is on the server.
|
Modifier and Type | Method and Description |
---|---|
void |
addMemberToRegion(org.bukkit.World w,
java.lang.String owner,
java.lang.String a)
Adds a player to a region's membership.
|
void |
addRechargerProtection(org.bukkit.entity.Player p,
java.lang.String name,
org.bukkit.Location one,
org.bukkit.Location two)
Adds a WorldGuard protected region to recharger location.
|
void |
addRendererProtection(java.lang.String name,
org.bukkit.Location one,
org.bukkit.Location two)
Adds a WorldGuard protected region to exterior renderer room.
|
void |
addWGProtection(org.bukkit.entity.Player p,
org.bukkit.Location one,
org.bukkit.Location two)
Adds a WorldGuard protected region to the inner TARDIS location.
|
void |
addWGProtection(java.lang.String p,
TARDISTIPSData data,
org.bukkit.World w)
Adds a WorldGuard protected region for a TIPS slot.
|
boolean |
canBreakBlock(org.bukkit.entity.Player p,
org.bukkit.block.Block b)
Checks whether a block can be broken
|
boolean |
canBuild(org.bukkit.entity.Player p,
org.bukkit.Location l)
Checks if a player can build (a Police Box) at this location.
|
boolean |
canLand(org.bukkit.entity.Player p,
org.bukkit.Location l)
Checks if a player can land (a Police Box) at this location.
|
com.sk89q.worldguard.protection.regions.ProtectedRegion |
getRegion(java.lang.String world,
java.lang.String p)
Gets a TARDIS WorldGuard region.
|
java.util.List<java.lang.String> |
getRegions(org.bukkit.World w)
Gets a List of all TARDIS regions in a world where the build flag is set.
|
java.util.List<java.lang.String> |
getTARDISRegions(org.bukkit.World w)
Gets a List of all TARDIS regions in a world.
|
boolean |
mobsCanSpawnAtLocation(org.bukkit.Location l)
Checks whether there is a protected region at a location and if so whether mobs can spawn.
|
void |
removeAllMembersFromRegion(org.bukkit.World w,
java.lang.String owner)
Removes all members from a region's membership.
|
void |
removeMemberFromRegion(org.bukkit.World w,
java.lang.String owner,
java.lang.String a)
Removes a player from a region's membership.
|
void |
removeRechargerRegion(java.lang.String name)
Removes the WorldGuard region when the recharger is removed.
|
void |
removeRegion(org.bukkit.Location l)
Removes the WorldGuard region when the TARDIS is deleted.
|
void |
removeRegion(org.bukkit.World w,
java.lang.String p)
Removes the WorldGuard region when the TARDIS is deleted.
|
void |
removeRoomRegion(org.bukkit.World w,
java.lang.String p,
java.lang.String r)
Removes the exterior rendering room region when the room is jettisoned or the TARDIS is deleted.
|
void |
setEntryExitFlags(java.lang.String world,
java.lang.String owner,
boolean allow)
Sets the entry and exit flags for a region.
|
void |
sponge(org.bukkit.block.Block b,
boolean clear)
Sets a block with the properties of a sponge
|
void |
updateRegionForClaim(org.bukkit.Location location,
java.util.UUID uuid)
Updates the TARDIS WorldGuard region when the TARDIS has been claimed by a new player.
|
void |
updateRegionForNameChange(org.bukkit.World w,
java.lang.String o,
java.util.UUID uuid,
java.lang.String which)
Updates the TARDIS WorldGuard region when the player name has changed.
|
public TARDISWorldGuardUtils(TARDIS plugin)
plugin
- an instance of the TARDIS pluginpublic boolean canBuild(org.bukkit.entity.Player p, org.bukkit.Location l)
p
- the player to checkl
- the location to checkpublic boolean canLand(org.bukkit.entity.Player p, org.bukkit.Location l)
p
- the player to checkl
- the location to checkpublic void addWGProtection(org.bukkit.entity.Player p, org.bukkit.Location one, org.bukkit.Location two)
p
- the player to assign as the owner of the regionone
- a start location of a cuboid regiontwo
- an end location of a cuboid regionpublic void addWGProtection(java.lang.String p, TARDISTIPSData data, org.bukkit.World w)
p
- the player to assign as the owner of the regiondata
- a TIPS Data containerw
- the world we are creating the region inpublic void addRechargerProtection(org.bukkit.entity.Player p, java.lang.String name, org.bukkit.Location one, org.bukkit.Location two)
p
- the player to assign as the owner of the regionname
- the name of the rechargerone
- a start location of a cuboid regiontwo
- an end location of a cuboid regionpublic void addRendererProtection(java.lang.String name, org.bukkit.Location one, org.bukkit.Location two)
name
- the name of the rechargerone
- a start location of a cuboid regiontwo
- an end location of a cuboid regionpublic void removeRegion(org.bukkit.World w, java.lang.String p)
w
- the world the region is located inp
- the player's namepublic void removeRegion(org.bukkit.Location l)
l
- the TARDIS interior locationpublic void removeRechargerRegion(java.lang.String name)
name
- the name of the recharger to removepublic void removeRoomRegion(org.bukkit.World w, java.lang.String p, java.lang.String r)
w
- the world the region is located inp
- the player's namer
- the room region to removepublic void addMemberToRegion(org.bukkit.World w, java.lang.String owner, java.lang.String a)
w
- the world the region is located inowner
- the player whose region it isa
- the player to addpublic void removeMemberFromRegion(org.bukkit.World w, java.lang.String owner, java.lang.String a)
w
- the world the region is located inowner
- the player whose region it isa
- the player to addpublic void removeAllMembersFromRegion(org.bukkit.World w, java.lang.String owner)
w
- the world the region is located inowner
- the player whose region it ispublic void updateRegionForNameChange(org.bukkit.World w, java.lang.String o, java.util.UUID uuid, java.lang.String which)
w
- the world the region is located ino
- the owner's nameuuid
- the UUID of the playerwhich
- the region type to updatepublic void updateRegionForClaim(org.bukkit.Location location, java.util.UUID uuid)
location
- the TARDIS interior locationuuid
- the UUID of the playerpublic void sponge(org.bukkit.block.Block b, boolean clear)
b
- the sponge blockclear
- whether to set the sponge area or remove itpublic boolean canBreakBlock(org.bukkit.entity.Player p, org.bukkit.block.Block b)
p
- the player trying to break the blockb
- the blockpublic com.sk89q.worldguard.protection.regions.ProtectedRegion getRegion(java.lang.String world, java.lang.String p)
world
- the world the region is inp
- the Time Lord whose region it ispublic java.util.List<java.lang.String> getRegions(org.bukkit.World w)
w
- the world to get the regions forpublic java.util.List<java.lang.String> getTARDISRegions(org.bukkit.World w)
w
- the world to get the regions forpublic boolean mobsCanSpawnAtLocation(org.bukkit.Location l)
l
- the location to checkpublic void setEntryExitFlags(java.lang.String world, java.lang.String owner, boolean allow)
world
- the world in which the region is locatedowner
- the player who owns the regionallow
- whether the flag state should be set to allow or deny