mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-19 08:45:54 +01:00
fixed default build if there was no region at location.
This commit is contained in:
parent
774d013cd0
commit
909f605343
@ -75,7 +75,10 @@ public class Worldguard
|
||||
ApplicableRegionSet set = regionManager.getApplicableRegions(pt);
|
||||
return set.allows(DefaultFlag.PVP);
|
||||
}
|
||||
|
||||
// Check if player can build at location by worldguards rules.
|
||||
// Returns:
|
||||
// True: Player can build in the region.
|
||||
// False: Player can not build in the region.
|
||||
public static boolean playerCanBuild(Player player, Location loc)
|
||||
{
|
||||
if( ! enabled)
|
||||
@ -83,7 +86,13 @@ public class Worldguard
|
||||
// No WG hooks so we'll always bypass this check.
|
||||
return false;
|
||||
}
|
||||
|
||||
World world = loc.getWorld();
|
||||
Vector pt = toVector(loc);
|
||||
|
||||
if (wg.getRegionManager(world).getApplicableRegions(pt).size() > 0)
|
||||
return wg.canBuild(player, loc);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check for Regions in chunk the chunk
|
||||
|
Loading…
Reference in New Issue
Block a user