use of com.sk89q.worldguard.protection.managers.RegionManager in project EliteMobs by MagmaGuy.
the class WorldGuardCompatibility method protectMinidungeonArea.
public static boolean protectMinidungeonArea(String regionName, Location location) {
try {
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
RegionManager regions = container.get(BukkitAdapter.adapt(location.getWorld()));
ProtectedRegion protectedRegion = regions.getRegion(regionName);
if (protectedRegion == null) {
new WarningMessage("The region name picked did not exist!");
return false;
}
protectMinidungeonArea(protectedRegion);
return true;
} catch (Exception ex) {
new WarningMessage("Failed to protect region " + regionName + " !");
return false;
}
}
Aggregations