diff --git a/config.yml b/config.yml index 4b634300..66a8056c 100644 --- a/config.yml +++ b/config.yml @@ -76,6 +76,10 @@ regions: build: true chest-access: false pvp: true + lighter: true + tnt: true + creeper: true + mobdamage: true blacklist: logging: diff --git a/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java b/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java index 53f1aef5..96280ea3 100644 --- a/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java +++ b/src/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java @@ -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(); diff --git a/src/com/sk89q/worldguard/protection/ApplicableRegionSet.java b/src/com/sk89q/worldguard/protection/ApplicableRegionSet.java index 7475084a..d0594bf0 100644 --- a/src/com/sk89q/worldguard/protection/ApplicableRegionSet.java +++ b/src/com/sk89q/worldguard/protection/ApplicableRegionSet.java @@ -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); } diff --git a/src/com/sk89q/worldguard/protection/GlobalFlags.java b/src/com/sk89q/worldguard/protection/GlobalFlags.java index 219e4026..c6a8e5a5 100644 --- a/src/com/sk89q/worldguard/protection/GlobalFlags.java +++ b/src/com/sk89q/worldguard/protection/GlobalFlags.java @@ -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; }