Skip to content

Commit

Permalink
Fixed the WorldGuard region checking methods, they defaulted to false if
Browse files Browse the repository at this point in the history
WorldGuard wasn't available.
  • Loading branch information
Matthew authored and Matthew committed Feb 20, 2013
1 parent 6e2d618 commit 1dfb4db
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/sk89q/craftbook/bukkit/CraftBookPlugin.java
Expand Up @@ -846,7 +846,8 @@ public boolean canBuild(Player player, Block block) {
return !event.isCancelled() || event.canBuild();
}
if (!config.obeyWorldguard) return true;
return worldGuardPlugin != null && worldGuardPlugin.canBuild(player, block);
if (worldGuardPlugin == null) return true;
return worldGuardPlugin.canBuild(player, block);
}

/**
Expand All @@ -869,7 +870,8 @@ public boolean canUse(Player player, Location loc) {
return !event.isCancelled();
}
if (!config.obeyWorldguard) return true;
return worldGuardPlugin != null && worldGuardPlugin.getGlobalRegionManager().allows(DefaultFlag.USE, loc, worldGuardPlugin.wrapPlayer(player));
if (worldGuardPlugin == null) return true;
return worldGuardPlugin.getGlobalRegionManager().allows(DefaultFlag.USE, loc, worldGuardPlugin.wrapPlayer(player));
}

/**
Expand Down

0 comments on commit 1dfb4db

Please sign in to comment.