mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean xpEventEnabled = mcMMO.p.isXPEventEnabled();
|
|
||||||
|
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
case 1:
|
case 1:
|
||||||
if (args[0].equalsIgnoreCase("reset")) {
|
if (args[0].equalsIgnoreCase("reset")) {
|
||||||
@ -33,12 +31,12 @@ public class XprateCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xpEventEnabled) {
|
if (mcMMO.p.isXPEventEnabled()) {
|
||||||
for (Player x : mcMMO.p.getServer().getOnlinePlayers()) {
|
for (Player x : mcMMO.p.getServer().getOnlinePlayers()) {
|
||||||
x.sendMessage(LocaleLoader.getString("Commands.xprate.over"));
|
x.sendMessage(LocaleLoader.getString("Commands.xprate.over"));
|
||||||
}
|
}
|
||||||
|
|
||||||
mcMMO.p.setXPEventEnabled(!xpEventEnabled);
|
mcMMO.p.toggleXpEventEnabled();
|
||||||
Config.getInstance().setExperienceGainsGlobalMultiplier(originalRate);
|
Config.getInstance().setExperienceGainsGlobalMultiplier(originalRate);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -69,7 +67,7 @@ public class XprateCommand implements CommandExecutor {
|
|||||||
int newRate = Misc.getInt(args[0]);
|
int newRate = Misc.getInt(args[0]);
|
||||||
Config.getInstance().setExperienceGainsGlobalMultiplier(newRate);
|
Config.getInstance().setExperienceGainsGlobalMultiplier(newRate);
|
||||||
|
|
||||||
if (xpEventEnabled) {
|
if (mcMMO.p.isXPEventEnabled()) {
|
||||||
for (Player x : mcMMO.p.getServer().getOnlinePlayers()) {
|
for (Player x : mcMMO.p.getServer().getOnlinePlayers()) {
|
||||||
x.sendMessage(LocaleLoader.getString("Commands.xprate.started.0"));
|
x.sendMessage(LocaleLoader.getString("Commands.xprate.started.0"));
|
||||||
x.sendMessage(LocaleLoader.getString("Commands.xprate.started.1", newRate));
|
x.sendMessage(LocaleLoader.getString("Commands.xprate.started.1", newRate));
|
||||||
|
@ -540,5 +540,9 @@ public class mcMMO extends JavaPlugin {
|
|||||||
public void setXPEventEnabled(boolean enabled) {
|
public void setXPEventEnabled(boolean enabled) {
|
||||||
this.xpEventEnabled = enabled;
|
this.xpEventEnabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void toggleXpEventEnabled() {
|
||||||
|
xpEventEnabled = !xpEventEnabled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user