Add config option to deny region bypass by default

This commit is contained in:
JOO200 2020-09-11 20:26:04 +02:00 committed by wizjany
parent 8dee2ad3b8
commit af67f1dd6a
3 changed files with 4 additions and 0 deletions

View File

@ -280,6 +280,7 @@ public class BukkitWorldConfiguration extends YamlWorldConfiguration {
maxClaimVolume = getInt("regions.max-claim-volume", 30000);
claimOnlyInsideExistingRegions = getBoolean("regions.claim-only-inside-existing-regions", false);
boundedLocationFlags = getBoolean("regions.location-flags-only-inside-regions", false);
disableDefaultBypass = getBoolean("regions.disable-default-bypass", false);
maxRegionCountPerPlayer = getInt("regions.max-region-count-per-player.default", 7);
maxRegionCounts = new HashMap<>();

View File

@ -174,6 +174,7 @@ public abstract class WorldConfiguration {
public boolean ignoreHopperMoveEvents;
public boolean breakDeniedHoppers;
public boolean useMaxPriorityAssociation;
public boolean disableDefaultBypass;
protected Map<String, Integer> maxRegionCounts;
/**

View File

@ -103,6 +103,8 @@ public class Session {
lastValid = location;
lastRegionSet = set.getRegions();
disableBypass = WorldGuard.getInstance().getPlatform().getGlobalStateManager()
.get(player.getWorld()).disableDefaultBypass;
for (Handler handler : handlers.values()) {
handler.initialize(player, location, set);