Add specific Msg value for /ma addreward.

This commit introduces a new announcement value for the `addreward`
command. This allows server owners to completely remove the message by
setting it to the empty string while retaining wave reward messages.

In general, we shouldn't reuse announcements unless the actions that
send them are identical, because it makes everything a lot more tangled
than it has to be.
This commit is contained in:
Andreas Troelsen 2020-09-19 10:57:17 +02:00
parent dafae0cf07
commit efc66820c6
2 changed files with 2 additions and 1 deletions

View File

@ -78,6 +78,7 @@ public enum Msg {
WAVE_BOSS_KILLED("&a%&r killed the boss!"),
WAVE_BOSS_REWARD_EARNED("You earned: &e%"),
WAVE_REWARD("You just earned a reward: &e%&r"),
MISC_REWARD_ADDED("You were just given a reward: &e%&r"),
MISC_LIST_PLAYERS("Live players: &a%&r"),
MISC_LIST_ARENAS("Available arenas: %"),
MISC_COMMAND_NOT_ALLOWED("You can't use that command in the arena!"),

View File

@ -64,7 +64,7 @@ public class AddRewardCommand implements Command {
}
arena.getRewardManager().addReward(player, thing);
arena.getMessenger().tell(player, Msg.WAVE_REWARD, thing.toString());
arena.getMessenger().tell(player, Msg.MISC_REWARD_ADDED, thing.toString());
String msg = "Added " + ChatColor.YELLOW + thing + ChatColor.RESET + " to " + ChatColor.YELLOW + player.getName() + "'s" + ChatColor.RESET + " rewards.";
am.getGlobalMessenger().tell(sender, msg);