From 5010d35ff3e54ecea59835df32dcc88bebb1a6a2 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 2 Apr 2011 16:26:35 -0700 Subject: [PATCH] Added a basic API. --- .../worldguard/bukkit/WorldGuardPlugin.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java b/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java index aefb17d4..0da9e506 100644 --- a/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java +++ b/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java @@ -20,8 +20,10 @@ package com.sk89q.worldguard.bukkit; import org.bukkit.ChatColor; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.World.Environment; +import org.bukkit.block.Block; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; @@ -650,4 +652,28 @@ public static void createDefaultConfiguration(File actual, } } } + + /** + * Checks to see if a player can build at a location. This will return + * true if region protection is disabled. + * + * @param player + * @param loc + * @return + */ + public boolean canBuild(Player player, Location loc) { + return getGlobalRegionManager().canBuild(player, loc); + } + + /** + * Checks to see if a player can build at a location. This will return + * true if region protection is disabled. + * + * @param player + * @param block + * @return + */ + public boolean canBuild(Player player, Block block) { + return getGlobalRegionManager().canBuild(player, block); + } }