public class MemberCommands
extends java.lang.Object
| Constructor and Description |
|---|
MemberCommands(WorldGuard worldGuard) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMember(com.sk89q.minecraft.util.commands.CommandContext args,
com.sk89q.worldedit.extension.platform.Actor sender) |
void |
addOwner(com.sk89q.minecraft.util.commands.CommandContext args,
com.sk89q.worldedit.extension.platform.Actor sender) |
protected static ProtectedRegion |
checkExistingRegion(RegionManager regionManager,
java.lang.String id,
boolean allowGlobal)
Get a protected region by a given name, otherwise throw a
CommandException. |
protected static void |
checkRegionDoesNotExist(RegionManager manager,
java.lang.String id,
boolean mayRedefine)
Check that a region with the given ID does not already exist.
|
protected static ProtectedRegion |
checkRegionFromSelection(LocalPlayer player,
java.lang.String id)
Create a
ProtectedRegion from the player's selection. |
protected static java.lang.String |
checkRegionId(java.lang.String id,
boolean allowGlobal)
Validate a region ID.
|
protected static RegionManager |
checkRegionManager(com.sk89q.worldedit.world.World world)
Check that the given region manager is not null.
|
protected static ProtectedRegion |
checkRegionStandingIn(RegionManager regionManager,
LocalPlayer player,
boolean allowGlobal,
java.lang.String rgCmd)
Get the region at the player's location, if possible.
|
protected static ProtectedRegion |
checkRegionStandingIn(RegionManager regionManager,
LocalPlayer player,
java.lang.String rgCmd)
Get the region at the player's location, if possible.
|
protected static com.sk89q.worldedit.regions.Region |
checkSelection(LocalPlayer player)
Get a WorldEdit selection for a player, or emit an exception if there is none
available.
|
protected static com.sk89q.worldedit.world.World |
checkWorld(com.sk89q.minecraft.util.commands.CommandContext args,
com.sk89q.worldedit.extension.platform.Actor 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(com.sk89q.worldedit.extension.platform.Actor sender)
Get the permission model to lookup permissions.
|
protected static void |
informNewUser(com.sk89q.worldedit.extension.platform.Actor sender,
RegionManager manager,
ProtectedRegion region)
Inform a new user about automatic protection.
|
void |
removeMember(com.sk89q.minecraft.util.commands.CommandContext args,
com.sk89q.worldedit.extension.platform.Actor sender) |
void |
removeOwner(com.sk89q.minecraft.util.commands.CommandContext args,
com.sk89q.worldedit.extension.platform.Actor sender) |
protected static <V> void |
setFlag(ProtectedRegion region,
Flag<V> flag,
com.sk89q.worldedit.extension.platform.Actor sender,
java.lang.String value)
Utility method to set a flag.
|
protected static void |
setPlayerSelection(LocalPlayer player,
ProtectedRegion region)
Set a player's selection to a given region.
|
protected static void |
warnAboutDimensions(com.sk89q.worldedit.extension.platform.Actor sender,
ProtectedRegion region)
Warn the sender if the dimensions of the given region are worrying.
|
protected static void |
warnAboutSaveFailures(com.sk89q.worldedit.extension.platform.Actor sender)
Warn the region saving is failing.
|
public MemberCommands(WorldGuard worldGuard)
public void addMember(com.sk89q.minecraft.util.commands.CommandContext args,
com.sk89q.worldedit.extension.platform.Actor sender)
throws com.sk89q.minecraft.util.commands.CommandException
com.sk89q.minecraft.util.commands.CommandExceptionpublic void addOwner(com.sk89q.minecraft.util.commands.CommandContext args,
com.sk89q.worldedit.extension.platform.Actor sender)
throws com.sk89q.minecraft.util.commands.CommandException
com.sk89q.minecraft.util.commands.CommandExceptionpublic void removeMember(com.sk89q.minecraft.util.commands.CommandContext args,
com.sk89q.worldedit.extension.platform.Actor sender)
throws com.sk89q.minecraft.util.commands.CommandException
com.sk89q.minecraft.util.commands.CommandExceptionpublic void removeOwner(com.sk89q.minecraft.util.commands.CommandContext args,
com.sk89q.worldedit.extension.platform.Actor sender)
throws com.sk89q.minecraft.util.commands.CommandException
com.sk89q.minecraft.util.commands.CommandExceptionprotected static RegionPermissionModel getPermissionModel(com.sk89q.worldedit.extension.platform.Actor sender)
sender - the senderprotected static com.sk89q.worldedit.world.World checkWorld(com.sk89q.minecraft.util.commands.CommandContext args,
com.sk89q.worldedit.extension.platform.Actor 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 java.lang.String checkRegionId(java.lang.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, java.lang.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, LocalPlayer player, java.lang.String rgCmd) 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, LocalPlayer player, boolean allowGlobal, java.lang.String rgCmd) 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.regions.Region checkSelection(LocalPlayer 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, java.lang.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(com.sk89q.worldedit.world.World world) throws com.sk89q.minecraft.util.commands.CommandException
world - the worldcom.sk89q.minecraft.util.commands.CommandException - thrown if the manager is nullprotected static ProtectedRegion checkRegionFromSelection(LocalPlayer player, java.lang.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(com.sk89q.worldedit.extension.platform.Actor sender)
sender - the sender to send the message toprotected static void warnAboutDimensions(com.sk89q.worldedit.extension.platform.Actor sender,
ProtectedRegion region)
sender - the sender to send the message toregion - the regionprotected static void informNewUser(com.sk89q.worldedit.extension.platform.Actor sender,
RegionManager manager,
ProtectedRegion region)
sender - the sender to send the message tomanager - the region managerregion - the regionprotected static void setPlayerSelection(LocalPlayer 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, com.sk89q.worldedit.extension.platform.Actor sender, java.lang.String value) throws InvalidFlagFormat
region - the regionflag - the flagsender - the sendervalue - the valueInvalidFlagFormat - thrown if the value is invalid