public class WorldGuardPlugin
extends org.bukkit.plugin.java.JavaPlugin
| Constructor and Description |
|---|
WorldGuardPlugin()
Construct objects.
|
| Modifier and Type | Method and Description |
|---|---|
void |
broadcastNotification(String msg)
Notifies all with the worldguard.notify permission.
|
boolean |
canBuild(org.bukkit.entity.Player player,
org.bukkit.block.Block block)
Checks to see if a player can build at a location.
|
boolean |
canBuild(org.bukkit.entity.Player player,
org.bukkit.Location loc)
Checks to see if a player can build at a location.
|
void |
checkPermission(org.bukkit.command.CommandSender sender,
String perm)
Checks permissions and throws an exception if permission is not met.
|
org.bukkit.entity.Player |
checkPlayer(org.bukkit.command.CommandSender sender)
Checks to see if the sender is a player, otherwise throw an exception.
|
protected Iterable<? extends org.bukkit.entity.Player> |
checkPlayerMatch(List<? extends org.bukkit.entity.Player> players)
Checks if the given list of players is greater than size 0, otherwise
throw an exception.
|
String |
convertThrowable(Throwable throwable)
Convert the throwable into a somewhat friendly message.
|
void |
createDefaultConfiguration(File actual,
String defaultName)
Create a default configuration file from the .jar.
|
ProtectionQuery |
createProtectionQuery()
Return a protection query helper object that can be used by another
plugin to test whether WorldGuard permits an action at a particular
place.
|
com.google.common.util.concurrent.ListeningExecutorService |
getExecutorService()
Get the global executor service for internal usage (please use your
own executor service).
|
ConfigurationManager |
getGlobalConfiguration()
Deprecated.
Use
getGlobalStateManager() instead |
GlobalRegionManager |
getGlobalRegionManager()
Deprecated.
|
ConfigurationManager |
getGlobalStateManager()
Get the global ConfigurationManager.
|
String[] |
getGroups(org.bukkit.entity.Player player)
Get the groups of a player.
|
PlayerMoveListener |
getPlayerMoveListener() |
com.sk89q.squirrelid.cache.ProfileCache |
getProfileCache()
Get the profile cache.
|
com.sk89q.squirrelid.resolver.ProfileService |
getProfileService()
Get the profile lookup service.
|
RegionContainer |
getRegionContainer()
Get the object that manages region data.
|
RegionManager |
getRegionManager(org.bukkit.World world)
Gets the region manager for a world.
|
SessionManager |
getSessionManager()
Gets the flag state manager.
|
Supervisor |
getSupervisor()
Get the supervisor.
|
com.sk89q.worldedit.bukkit.WorldEditPlugin |
getWorldEdit()
Gets a copy of the WorldEdit plugin.
|
boolean |
hasPermission(org.bukkit.command.CommandSender sender,
String perm)
Checks permissions.
|
boolean |
inGroup(org.bukkit.entity.Player player,
String group)
Check whether a player is in a group.
|
static WorldGuardPlugin |
inst()
Get the current instance of WorldGuard
|
List<org.bukkit.entity.Player> |
matchPlayerNames(String filter)
Match player names.
|
org.bukkit.command.CommandSender |
matchPlayerOrConsole(org.bukkit.command.CommandSender sender,
String filter)
Match only a single player or console.
|
Iterable<? extends org.bukkit.entity.Player> |
matchPlayers(org.bukkit.command.CommandSender source,
String filter)
Matches players based on the specified filter string
The filter string format is as follows:
* returns all the players currently online
If
sender is a Player:
#world returns all players in the world that sender is in
#near reaturns all players within 30 blocks of sender's location
Otherwise, the format is as specified in matchPlayerNames(String) |
Iterable<org.bukkit.entity.Player> |
matchPlayers(org.bukkit.entity.Player player)
Get a single player as an iterator for players.
|
org.bukkit.entity.Player |
matchSinglePlayer(org.bukkit.command.CommandSender sender,
String filter)
Match only a single player.
|
org.bukkit.World |
matchWorld(org.bukkit.command.CommandSender sender,
String filter)
Match a world.
|
boolean |
onCommand(org.bukkit.command.CommandSender sender,
org.bukkit.command.Command cmd,
String label,
String[] args) |
void |
onDisable() |
void |
onEnable()
Called on plugin enable.
|
String |
replaceMacros(org.bukkit.command.CommandSender sender,
String message)
Replace macros in the text.
|
String |
toName(org.bukkit.command.CommandSender sender)
Gets the name of a command sender.
|
String |
toUniqueName(org.bukkit.command.CommandSender sender)
Gets the name of a command sender.
|
LocalPlayer |
wrapOfflinePlayer(org.bukkit.OfflinePlayer player)
Wrap a player as a LocalPlayer.
|
LocalPlayer |
wrapPlayer(org.bukkit.entity.Player player)
Wrap a player as a LocalPlayer.
|
LocalPlayer |
wrapPlayer(org.bukkit.entity.Player player,
boolean silenced)
Wrap a player as a LocalPlayer.
|
getClassLoader, getCommand, getConfig, getDatabase, getDatabaseClasses, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, initialize, installDDL, isEnabled, isInitialized, isNaggable, onLoad, onTabComplete, reloadConfig, removeDDL, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringpublic WorldGuardPlugin()
public static WorldGuardPlugin inst()
public void onEnable()
onEnable in interface org.bukkit.plugin.PluginonEnable in class org.bukkit.plugin.java.JavaPluginpublic void onDisable()
onDisable in interface org.bukkit.plugin.PluginonDisable in class org.bukkit.plugin.java.JavaPluginpublic boolean onCommand(org.bukkit.command.CommandSender sender,
org.bukkit.command.Command cmd,
String label,
String[] args)
onCommand in interface org.bukkit.command.CommandExecutoronCommand in class org.bukkit.plugin.java.JavaPluginpublic String convertThrowable(@Nullable Throwable throwable)
throwable - the throwable@Deprecated public GlobalRegionManager getGlobalRegionManager()
getRegionContainer()public RegionContainer getRegionContainer()
@Deprecated public ConfigurationManager getGlobalConfiguration()
getGlobalStateManager() insteadpublic SessionManager getSessionManager()
public ConfigurationManager getGlobalStateManager()
public Supervisor getSupervisor()
public com.google.common.util.concurrent.ListeningExecutorService getExecutorService()
public com.sk89q.squirrelid.resolver.ProfileService getProfileService()
public com.sk89q.squirrelid.cache.ProfileCache getProfileCache()
public boolean inGroup(org.bukkit.entity.Player player,
String group)
player - The player to checkgroup - The groupplayer is in grouppublic String[] getGroups(org.bukkit.entity.Player player)
player - The player to checkpublic String toUniqueName(org.bukkit.command.CommandSender sender)
sender - The sender to get the name ofpublic String toName(org.bukkit.command.CommandSender sender)
sender - The CommandSender to get the name of.public boolean hasPermission(org.bukkit.command.CommandSender sender,
String perm)
sender - The sender to check the permission on.perm - The permission to check the permission on.sender has permpublic void checkPermission(org.bukkit.command.CommandSender sender,
String perm)
throws com.sk89q.minecraft.util.commands.CommandPermissionsException
sender - The sender to check the permission on.perm - The permission to check the permission on.com.sk89q.minecraft.util.commands.CommandPermissionsException - if sender doesn't have permpublic org.bukkit.entity.Player checkPlayer(org.bukkit.command.CommandSender sender)
throws com.sk89q.minecraft.util.commands.CommandException
sender - The CommandSender to checksender casted to a playercom.sk89q.minecraft.util.commands.CommandException - if sender isn't a Playerpublic List<org.bukkit.entity.Player> matchPlayerNames(String filter)
filter - The filter string to check.List of players who match filterprotected Iterable<? extends org.bukkit.entity.Player> checkPlayerMatch(List<? extends org.bukkit.entity.Player> players) throws com.sk89q.minecraft.util.commands.CommandException
public Iterable<? extends org.bukkit.entity.Player> matchPlayers(org.bukkit.command.CommandSender source, String filter) throws com.sk89q.minecraft.util.commands.CommandException
sender is a Player:
#world returns all players in the world that sender is in
#near reaturns all players within 30 blocks of sender's location
Otherwise, the format is as specified in matchPlayerNames(String)source - The CommandSender who is trying to find a playerfilter - The filter string for playerscom.sk89q.minecraft.util.commands.CommandException - if no matches are foundpublic org.bukkit.entity.Player matchSinglePlayer(org.bukkit.command.CommandSender sender,
String filter)
throws com.sk89q.minecraft.util.commands.CommandException
sender - The CommandSender who is requesting a player matchfilter - The filter string.com.sk89q.minecraft.util.commands.CommandException - If more than one player match was foundfor filter string syntaxpublic org.bukkit.command.CommandSender matchPlayerOrConsole(org.bukkit.command.CommandSender sender,
String filter)
throws com.sk89q.minecraft.util.commands.CommandException
matchSinglePlayer(org.bukkit.command.CommandSender, String)sender - The sender trying to match a CommandSenderfilter - The filter stringcom.sk89q.minecraft.util.commands.CommandException - if either zero or more than one player matched.public Iterable<org.bukkit.entity.Player> matchPlayers(org.bukkit.entity.Player player)
player - The player to return in an Iterablepublic org.bukkit.World matchWorld(org.bukkit.command.CommandSender sender,
String filter)
throws com.sk89q.minecraft.util.commands.CommandException
name is located in, if the player is online.
[name] A world with the name namesender - The sender requesting a matchfilter - The filter stringcom.sk89q.minecraft.util.commands.CommandException - if no world matchespublic com.sk89q.worldedit.bukkit.WorldEditPlugin getWorldEdit()
throws com.sk89q.minecraft.util.commands.CommandException
com.sk89q.minecraft.util.commands.CommandException - If there is no WorldEditPlugin availablepublic LocalPlayer wrapPlayer(org.bukkit.entity.Player player)
player - The player to wrappublic LocalPlayer wrapPlayer(org.bukkit.entity.Player player, boolean silenced)
player - The player to wrapsilenced - True to silence messagespublic LocalPlayer wrapOfflinePlayer(org.bukkit.OfflinePlayer player)
This implementation is incomplete -- permissions cannot be checked.
player - The player to wrappublic ProtectionQuery createProtectionQuery()
public void createDefaultConfiguration(File actual, String defaultName)
actual - The destination filedefaultName - The name of the file inside the jar's defaults folderpublic void broadcastNotification(String msg)
msg - The notification to broadcastpublic boolean canBuild(org.bukkit.entity.Player player,
org.bukkit.Location loc)
player - The player to check.loc - The location to check at.player can build at locGlobalRegionManager.canBuild(org.bukkit.entity.Player, org.bukkit.Location)public boolean canBuild(org.bukkit.entity.Player player,
org.bukkit.block.Block block)
player - The player to checkblock - The block to check at.player can build at block's locationGlobalRegionManager.canBuild(org.bukkit.entity.Player, org.bukkit.block.Block)public RegionManager getRegionManager(org.bukkit.World world)
world - world to get the region manager forpublic PlayerMoveListener getPlayerMoveListener()
public String replaceMacros(org.bukkit.command.CommandSender sender, String message)
sender. See toName(org.bukkit.command.CommandSender)
%id%: The unique name of the sender. See toUniqueName(org.bukkit.command.CommandSender)
%online%: The number of players currently online on the server
If sender is a Player:
%world%: The name of the world sender is located in
%health%: The health of sender. See Damageable.getHealth()sender - The sender to checkmessage - The message to replace macros inCopyright © 2015. All Rights Reserved.