mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-02-18 02:51:19 +01:00
Fix players being allowed to build outside regions (Fixes #278)
Basically players were allowed to build shops outside regions in the case where no region manager was available.
This commit is contained in:
parent
4067427650
commit
37b7669acb
@ -29,10 +29,12 @@ public class WorldGuardBuilding implements Listener {
|
|||||||
public void canBuild(BuildPermissionEvent event) {
|
public void canBuild(BuildPermissionEvent event) {
|
||||||
ApplicableRegionSet regions = getApplicableRegions(event.getSign().getBlock().getLocation());
|
ApplicableRegionSet regions = getApplicableRegions(event.getSign().getBlock().getLocation());
|
||||||
|
|
||||||
if (regions != null && Properties.WORLDGUARD_USE_FLAG) {
|
if (regions == null) {
|
||||||
|
event.allow(false);
|
||||||
|
} else if (Properties.WORLDGUARD_USE_FLAG) {
|
||||||
event.allow(regions.queryState(worldGuard.wrapPlayer(event.getPlayer()), WorldGuardFlags.ENABLE_SHOP) == StateFlag.State.ALLOW);
|
event.allow(regions.queryState(worldGuard.wrapPlayer(event.getPlayer()), WorldGuardFlags.ENABLE_SHOP) == StateFlag.State.ALLOW);
|
||||||
} else {
|
} else {
|
||||||
event.allow(regions == null || regions.size() != 0);
|
event.allow(regions.size() > 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user