mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-19 23:57:43 +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
|
build: true
|
||||||
chest-access: false
|
chest-access: false
|
||||||
pvp: true
|
pvp: true
|
||||||
|
lighter: true
|
||||||
|
tnt: true
|
||||||
|
creeper: true
|
||||||
|
mobdamage: true
|
||||||
|
|
||||||
blacklist:
|
blacklist:
|
||||||
logging:
|
logging:
|
||||||
|
@ -318,6 +318,10 @@ public void loadConfiguration() {
|
|||||||
globalFlags.canBuild = config.getBoolean("regions.default.build", true);
|
globalFlags.canBuild = config.getBoolean("regions.default.build", true);
|
||||||
globalFlags.canAccessChests = config.getBoolean("regions.default.chest-access", false);
|
globalFlags.canAccessChests = config.getBoolean("regions.default.chest-access", false);
|
||||||
globalFlags.canPvP = config.getBoolean("regions.default.pvp", true);
|
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 {
|
try {
|
||||||
regionLoader.load();
|
regionLoader.load();
|
||||||
|
@ -74,6 +74,14 @@ public boolean allowsFlag(String flag) {
|
|||||||
def = global.canAccessChests;
|
def = global.canAccessChests;
|
||||||
} else if (flag.equals(AreaFlags.FLAG_PVP)) {
|
} else if (flag.equals(AreaFlags.FLAG_PVP)) {
|
||||||
def = global.canPvP;
|
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);
|
return isFlagAllowed(flag, def, null);
|
||||||
|
@ -28,4 +28,8 @@ public class GlobalFlags {
|
|||||||
public boolean canBuild = true;
|
public boolean canBuild = true;
|
||||||
public boolean canAccessChests = false;
|
public boolean canAccessChests = false;
|
||||||
public boolean canPvP = true;
|
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