mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-26 02:28:03 +01:00
Fix /xprate not properly sending "Event started" messages. Fixes #624
This commit is contained in:
parent
284bab397a
commit
458f7f5f5b
@ -24,8 +24,6 @@ public class XprateCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean xpEventEnabled = mcMMO.p.isXPEventEnabled();
|
||||
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (args[0].equalsIgnoreCase("reset")) {
|
||||
@ -33,12 +31,12 @@ public class XprateCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (xpEventEnabled) {
|
||||
if (mcMMO.p.isXPEventEnabled()) {
|
||||
for (Player x : mcMMO.p.getServer().getOnlinePlayers()) {
|
||||
x.sendMessage(LocaleLoader.getString("Commands.xprate.over"));
|
||||
}
|
||||
|
||||
mcMMO.p.setXPEventEnabled(!xpEventEnabled);
|
||||
mcMMO.p.toggleXpEventEnabled();
|
||||
Config.getInstance().setExperienceGainsGlobalMultiplier(originalRate);
|
||||
}
|
||||
else {
|
||||
@ -69,7 +67,7 @@ public class XprateCommand implements CommandExecutor {
|
||||
int newRate = Misc.getInt(args[0]);
|
||||
Config.getInstance().setExperienceGainsGlobalMultiplier(newRate);
|
||||
|
||||
if (xpEventEnabled) {
|
||||
if (mcMMO.p.isXPEventEnabled()) {
|
||||
for (Player x : mcMMO.p.getServer().getOnlinePlayers()) {
|
||||
x.sendMessage(LocaleLoader.getString("Commands.xprate.started.0"));
|
||||
x.sendMessage(LocaleLoader.getString("Commands.xprate.started.1", newRate));
|
||||
|
@ -540,5 +540,9 @@ public class mcMMO extends JavaPlugin {
|
||||
public void setXPEventEnabled(boolean enabled) {
|
||||
this.xpEventEnabled = enabled;
|
||||
}
|
||||
|
||||
public void toggleXpEventEnabled() {
|
||||
xpEventEnabled = !xpEventEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user