Added auto-invincible-permission setting, which lets you use the permission 'worldguard.auto-invincible' to become invincible.

This commit is contained in:
sk89q 2011-06-26 19:08:52 -07:00
parent f5c6a9f507
commit 342cfc0801
2 changed files with 5 additions and 1 deletions

View File

@ -82,6 +82,7 @@ public class ConfigurationManager {
public boolean suppressTickSyncWarnings;
public boolean useRegionsScheduler;
public boolean activityHaltToggle = false;
public boolean autoGodMode;
/**
* Construct the object.
@ -108,6 +109,8 @@ public void load() {
"suppress-tick-sync-warnings", false);
useRegionsScheduler = config.getBoolean(
"regions.use-scheduler", true);
autoGodMode = config.getBoolean(
"auto-invincible-permission", false);
// Load configurations for each world
for (World world : plugin.getServer().getWorlds()) {

View File

@ -165,7 +165,8 @@ public void onPlayerJoin(PlayerJoinEvent event) {
+ "Fire spread is currently globally disabled for this world.");
}
if (plugin.inGroup(player, "wg-invincible")) {
if (plugin.inGroup(player, "wg-invincible")
|| (cfg.autoGodMode && plugin.hasPermission(player, "worldguard.auto-invincible"))) {
cfg.enableGodMode(player);
}