Block polygonal regions for claiming for now.

volume() returns 0.
This commit is contained in:
sk89q 2014-08-31 19:05:59 -07:00
parent 669c0e9651
commit 722cc2e38c

View File

@ -57,6 +57,7 @@
import com.sk89q.worldguard.protection.managers.storage.DriverType; import com.sk89q.worldguard.protection.managers.storage.DriverType;
import com.sk89q.worldguard.protection.managers.storage.RegionDriver; import com.sk89q.worldguard.protection.managers.storage.RegionDriver;
import com.sk89q.worldguard.protection.regions.GlobalProtectedRegion; import com.sk89q.worldguard.protection.regions.GlobalProtectedRegion;
import com.sk89q.worldguard.protection.regions.ProtectedPolygonalRegion;
import com.sk89q.worldguard.protection.regions.ProtectedRegion; import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import com.sk89q.worldguard.protection.regions.ProtectedRegion.CircularInheritanceException; import com.sk89q.worldguard.protection.regions.ProtectedRegion.CircularInheritanceException;
import com.sk89q.worldguard.util.Enums; import com.sk89q.worldguard.util.Enums;
@ -266,6 +267,10 @@ public void claim(CommandContext args, CommandSender sender) throws CommandExcep
// Check claim volume // Check claim volume
if (!permModel.mayClaimRegionsUnbounded()) { if (!permModel.mayClaimRegionsUnbounded()) {
if (region instanceof ProtectedPolygonalRegion) {
throw new CommandException("Polygons are currently not supported for /rg claim.");
}
if (region.volume() > wcfg.maxClaimVolume) { if (region.volume() > wcfg.maxClaimVolume) {
player.sendMessage(ChatColor.RED + "This region is too large to claim."); player.sendMessage(ChatColor.RED + "This region is too large to claim.");
player.sendMessage(ChatColor.RED + player.sendMessage(ChatColor.RED +