Remove use of GlobalRegionManager in RegionProtectionListener.

This commit is contained in:
sk89q 2014-08-14 02:39:12 -07:00
parent dc2652f87b
commit 19b87b628a

View File

@ -87,10 +87,10 @@ public void onBreakBlock(BreakBlockEvent event) {
Location target = event.getTarget(); Location target = event.getTarget();
if (player != null) { if (player != null) {
if (!getPlugin().getGlobalRegionManager().canBuild(player, target)) { RegionQuery query = getPlugin().getRegionContainer().createQuery(player);
tellErrorMessage(player, target); boolean canBreak = query.testPermission(target);
event.setCancelled(true);
} else if (!getPlugin().getGlobalRegionManager().canConstruct(player, target)) { if (!canBreak) {
tellErrorMessage(player, target); tellErrorMessage(player, target);
event.setCancelled(true); event.setCancelled(true);
} }