mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-18 15:17:36 +01:00
Added ability to change default values of region's flags in config.yml for: FLAG_LIGHTER, FLAG_TNT, FLAG_CREEPER_EXPLOSION, FLAG_MOB_DAMAGE
This commit is contained in:
parent
135d92303d
commit
c9c747693d
@ -76,6 +76,10 @@ regions:
|
||||
build: true
|
||||
chest-access: false
|
||||
pvp: true
|
||||
lighter: true
|
||||
tnt: true
|
||||
creeper: true
|
||||
mobdamage: true
|
||||
|
||||
blacklist:
|
||||
logging:
|
||||
|
@ -318,6 +318,10 @@ public void loadConfiguration() {
|
||||
globalFlags.canBuild = config.getBoolean("regions.default.build", true);
|
||||
globalFlags.canAccessChests = config.getBoolean("regions.default.chest-access", false);
|
||||
globalFlags.canPvP = config.getBoolean("regions.default.pvp", true);
|
||||
globalFlags.canLighter = config.getBoolean("regions.default.lighter", true);
|
||||
globalFlags.canTnt = config.getBoolean("regions.default.tnt", true);
|
||||
globalFlags.allowCreeper = config.getBoolean("regions.default.creeper", true);
|
||||
globalFlags.allowMobDamage = config.getBoolean("regions.default.mobdamage", true);
|
||||
|
||||
try {
|
||||
regionLoader.load();
|
||||
|
@ -74,7 +74,15 @@ public boolean allowsFlag(String flag) {
|
||||
def = global.canAccessChests;
|
||||
} else if (flag.equals(AreaFlags.FLAG_PVP)) {
|
||||
def = global.canPvP;
|
||||
}
|
||||
} else if (flag.equals(AreaFlags.FLAG_LIGHTER)) {
|
||||
def = global.canLighter;
|
||||
} else if (flag.equals(AreaFlags.FLAG_TNT)) {
|
||||
def = global.canTnt;
|
||||
} else if (flag.equals(AreaFlags.FLAG_CREEPER_EXPLOSION)) {
|
||||
def = global.allowCreeper;
|
||||
} else if (flag.equals(AreaFlags.FLAG_MOB_DAMAGE)) {
|
||||
def = global.allowMobDamage;
|
||||
}
|
||||
|
||||
return isFlagAllowed(flag, def, null);
|
||||
}
|
||||
|
@ -28,4 +28,8 @@ public class GlobalFlags {
|
||||
public boolean canBuild = true;
|
||||
public boolean canAccessChests = false;
|
||||
public boolean canPvP = true;
|
||||
public boolean canLighter = true;
|
||||
public boolean canTnt = true;
|
||||
public boolean allowCreeper = true;
|
||||
public boolean allowMobDamage = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user