Make sure to update CommandBook installed status in onEnable

This commit is contained in:
zml2008 2012-04-07 13:46:25 -07:00
parent fe1e09289f
commit ad5b1cdcba
2 changed files with 8 additions and 5 deletions

View File

@ -90,14 +90,14 @@ public class ConfigurationManager {
* List of people who can breathe underwater.
*/
private Set<String> hasAmphibious = new HashSet<String>();
private boolean hasCommandBookGodMode = false;
public boolean useRegionsScheduler;
public boolean activityHaltToggle = false;
public boolean autoGodMode;
public boolean usePlayerMove;
/**
* Region Storage Configuration method, and config values
*/
@ -131,12 +131,13 @@ public void load() {
plugin.getLogger().severe("Error reading configuration for global config: ");
e.printStackTrace();
}
config.removeProperty("suppress-tick-sync-warnings");
useRegionsScheduler = config.getBoolean(
"regions.use-scheduler", true);
autoGodMode = config.getBoolean(
"auto-invincible", config.getBoolean("auto-invincible-permission", false));
config.removeProperty("auto-invincible-permission");
usePlayerMove = config.getBoolean(
"use-player-move-event", true);
@ -211,6 +212,7 @@ public void forgetPlayer(LocalPlayer player) {
*/
@Deprecated
public void enableGodMode(Player player) {
hasGodMode.add(player.getName());
}
@ -267,7 +269,7 @@ public void disableAmphibiousMode(Player player) {
public boolean hasAmphibiousMode(Player player) {
return hasAmphibious.contains(player.getName());
}
public void updateCommandBookGodMode() {
try {
if (plugin.getServer().getPluginManager().isPluginEnabled("CommandBook")) {
@ -278,7 +280,7 @@ public void updateCommandBookGodMode() {
} catch (ClassNotFoundException ignore) {}
hasCommandBookGodMode = false;
}
public boolean hasCommandBookGodMode() {
return hasCommandBookGodMode;
}

View File

@ -160,6 +160,7 @@ public void run() {
(new WorldGuardWeatherListener(this)).registerEvents();
(new WorldGuardVehicleListener(this)).registerEvents();
(new WorldGuardServerListener(this)).registerEvents();
configuration.updateCommandBookGodMode();
if (getServer().getPluginManager().isPluginEnabled("CommandBook")) {
getServer().getPluginManager().registerEvents(new WorldGuardCommandBookListener(this), this);