PlayerListener cleanup

This commit is contained in:
GJ
2013-01-24 14:19:26 -05:00
parent 9dac898c1c
commit 76a987e1e0
13 changed files with 209 additions and 132 deletions

View File

@ -14,10 +14,11 @@ import com.gmail.nossr50.util.Misc;
public class XprateCommand implements CommandExecutor {
private final mcMMO plugin;
private static double oldRate = Config.getInstance().xpGainMultiplier;
private static boolean xpEvent = false;
private boolean xpEvent;
public XprateCommand (mcMMO plugin) {
this.plugin = plugin;
this.xpEvent = plugin.isXPEventEnabled();
}
@Override
@ -39,6 +40,7 @@ public class XprateCommand implements CommandExecutor {
}
xpEvent = !xpEvent;
plugin.setXPEventEnabled(xpEvent);
Config.getInstance().xpGainMultiplier = oldRate;
}
else {
@ -60,6 +62,7 @@ public class XprateCommand implements CommandExecutor {
if (args[1].equalsIgnoreCase("true") || args[1].equalsIgnoreCase("false")) {
xpEvent = Boolean.valueOf(args[1]);
plugin.setXPEventEnabled(xpEvent);
}
else {
sender.sendMessage(usage3);
@ -90,8 +93,4 @@ public class XprateCommand implements CommandExecutor {
return true;
}
}
public static boolean isXpEventRunning() {
return xpEvent;
}
}