public class MemberCommands extends Object
| Constructor and Description |
|---|
MemberCommands(WorldGuardPlugin plugin) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMember(com.sk89q.minecraft.util.commands.CommandContext args,
org.bukkit.command.CommandSender sender) |
void |
addOwner(com.sk89q.minecraft.util.commands.CommandContext args,
org.bukkit.command.CommandSender sender) |
protected static ProtectedRegion |
checkExistingRegion(RegionManager regionManager,
String id,
boolean allowGlobal)
Get a protected region by a given name, otherwise throw a
CommandException. |
protected static void |
checkRegionDoesNotExist(RegionManager manager,
String id,
boolean mayRedefine)
Check that a region with the given ID does not already exist.
|
protected static ProtectedRegion |
checkRegionFromSelection(org.bukkit.entity.Player player,
String id)
Create a
ProtectedRegion from the player's selection. |
protected static String |
checkRegionId(String id,
boolean allowGlobal)
Validate a region ID.
|
protected static RegionManager |
checkRegionManager(WorldGuardPlugin plugin,
org.bukkit.World world)
Check that the given region manager is not null.
|
protected static ProtectedRegion |
checkRegionStandingIn(RegionManager regionManager,
org.bukkit.entity.Player player)
Get the region at the player's location, if possible.
|
protected static ProtectedRegion |
checkRegionStandingIn(RegionManager regionManager,
org.bukkit.entity.Player player,
boolean allowGlobal)
Get the region at the player's location, if possible.
|
protected static com.sk89q.worldedit.bukkit.selections.Selection |
checkSelection(org.bukkit.entity.Player player)
Get a WorldEdit selection for a player, or emit an exception if there is none
available.
|
protected static org.bukkit.World |
checkWorld(com.sk89q.minecraft.util.commands.CommandContext args,
org.bukkit.command.CommandSender sender,
char flag)
Gets the world from the given flag, or falling back to the the current player
if the sender is a player, otherwise reporting an error.
|
protected static RegionPermissionModel |
getPermissionModel(org.bukkit.command.CommandSender sender)
Get the permission model to lookup permissions.
|
protected static void |
informNewUser(org.bukkit.command.CommandSender sender,
RegionManager manager,
ProtectedRegion region)
Inform a new user about automatic protection.
|
void |
removeMember(com.sk89q.minecraft.util.commands.CommandContext args,
org.bukkit.command.CommandSender sender) |
void |
removeOwner(com.sk89q.minecraft.util.commands.CommandContext args,
org.bukkit.command.CommandSender sender) |
protected static <V> void |
setFlag(ProtectedRegion region,
Flag<V> flag,
org.bukkit.command.CommandSender sender,
String value)
Utility method to set a flag.
|
protected static void |
setPlayerSelection(org.bukkit.entity.Player player,
ProtectedRegion region)
Set a player's selection to a given region.
|
protected static void |
warnAboutDimensions(org.bukkit.command.CommandSender sender,
ProtectedRegion region)
Warn the sender if the dimensions of the given region are worrying.
|
protected static void |
warnAboutSaveFailures(org.bukkit.command.CommandSender sender)
Warn the region saving is failing.
|
public MemberCommands(WorldGuardPlugin plugin)
public void addMember(com.sk89q.minecraft.util.commands.CommandContext args,
org.bukkit.command.CommandSender sender)
throws com.sk89q.minecraft.util.commands.CommandException
com.sk89q.minecraft.util.commands.CommandExceptionpublic void addOwner(com.sk89q.minecraft.util.commands.CommandContext args,
org.bukkit.command.CommandSender sender)
throws com.sk89q.minecraft.util.commands.CommandException
com.sk89q.minecraft.util.commands.CommandExceptionpublic void removeMember(com.sk89q.minecraft.util.commands.CommandContext args,
org.bukkit.command.CommandSender sender)
throws com.sk89q.minecraft.util.commands.CommandException
com.sk89q.minecraft.util.commands.CommandExceptionpublic void removeOwner(com.sk89q.minecraft.util.commands.CommandContext args,
org.bukkit.command.CommandSender sender)
throws com.sk89q.minecraft.util.commands.CommandException
com.sk89q.minecraft.util.commands.CommandExceptionprotected static RegionPermissionModel getPermissionModel(org.bukkit.command.CommandSender sender)
sender - the senderprotected static org.bukkit.World checkWorld(com.sk89q.minecraft.util.commands.CommandContext args,
org.bukkit.command.CommandSender sender,
char flag)
throws com.sk89q.minecraft.util.commands.CommandException
args - the argumentssender - the senderflag - the flag (such as 'w')com.sk89q.minecraft.util.commands.CommandException - on errorprotected static String checkRegionId(String id, boolean allowGlobal) throws com.sk89q.minecraft.util.commands.CommandException
id - the idallowGlobal - whether __global__ is allowedcom.sk89q.minecraft.util.commands.CommandException - thrown on an errorprotected static ProtectedRegion checkExistingRegion(RegionManager regionManager, String id, boolean allowGlobal) throws com.sk89q.minecraft.util.commands.CommandException
CommandException.
This also validates the region ID.
regionManager - the region managerid - the name to searchallowGlobal - true to allow selecting __global__com.sk89q.minecraft.util.commands.CommandException - thrown if no region is found by the given nameprotected static ProtectedRegion checkRegionStandingIn(RegionManager regionManager, org.bukkit.entity.Player player) throws com.sk89q.minecraft.util.commands.CommandException
If the player is standing in several regions, an error will be raised and a list of regions will be provided.
regionManager - the region managerplayer - the playercom.sk89q.minecraft.util.commands.CommandException - thrown if no region was foundprotected static ProtectedRegion checkRegionStandingIn(RegionManager regionManager, org.bukkit.entity.Player player, boolean allowGlobal) throws com.sk89q.minecraft.util.commands.CommandException
If the player is standing in several regions, an error will be raised and a list of regions will be provided.
If the player is not standing in any regions, the global region will returned if allowGlobal is true and it exists.
regionManager - the region managerplayer - the playerallowGlobal - whether to search for a global region if no others are foundcom.sk89q.minecraft.util.commands.CommandException - thrown if no region was foundprotected static com.sk89q.worldedit.bukkit.selections.Selection checkSelection(org.bukkit.entity.Player player)
throws com.sk89q.minecraft.util.commands.CommandException
player - the playercom.sk89q.minecraft.util.commands.CommandException - thrown on an errorprotected static void checkRegionDoesNotExist(RegionManager manager, String id, boolean mayRedefine) throws com.sk89q.minecraft.util.commands.CommandException
manager - the managerid - the IDcom.sk89q.minecraft.util.commands.CommandException - thrown if the ID already existsprotected static RegionManager checkRegionManager(WorldGuardPlugin plugin, org.bukkit.World world) throws com.sk89q.minecraft.util.commands.CommandException
plugin - the pluginworld - the worldcom.sk89q.minecraft.util.commands.CommandException - thrown if the manager is nullprotected static ProtectedRegion checkRegionFromSelection(org.bukkit.entity.Player player, String id) throws com.sk89q.minecraft.util.commands.CommandException
ProtectedRegion from the player's selection.player - the playerid - the ID of the new regioncom.sk89q.minecraft.util.commands.CommandException - thrown on an errorprotected static void warnAboutSaveFailures(org.bukkit.command.CommandSender sender)
sender - the sender to send the message toprotected static void warnAboutDimensions(org.bukkit.command.CommandSender sender,
ProtectedRegion region)
sender - the sender to send the message toregion - the regionprotected static void informNewUser(org.bukkit.command.CommandSender sender,
RegionManager manager,
ProtectedRegion region)
sender - the sender to send the message tomanager - the region managerregion - the regionprotected static void setPlayerSelection(org.bukkit.entity.Player player,
ProtectedRegion region)
throws com.sk89q.minecraft.util.commands.CommandException
player - the playerregion - the regioncom.sk89q.minecraft.util.commands.CommandException - thrown on a command errorprotected static <V> void setFlag(ProtectedRegion region, Flag<V> flag, org.bukkit.command.CommandSender sender, String value) throws InvalidFlagFormat
region - the regionflag - the flagsender - the sendervalue - the valueInvalidFlagFormat - thrown if the value is invalidCopyright © 2015. All Rights Reserved.