Broadcast setnexts to admin chat

This commit is contained in:
Austin Mayes 2019-04-23 21:48:59 -05:00
parent dab61936b4
commit 7ed61a0984
No known key found for this signature in database
GPG Key ID: 72C78ABE045D34F6
1 changed files with 5 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import java.time.Duration;
import tc.oc.api.docs.virtual.ServerDoc;
import tc.oc.commons.bukkit.channels.admin.AdminChannel;
import tc.oc.commons.core.commands.Commands;
import tc.oc.commons.core.commands.TranslatableCommandException;
import tc.oc.commons.core.restart.RestartManager;
@ -36,10 +37,12 @@ public class AdminCommands implements Commands {
private final RestartManager restartManager;
private final RestartListener restartListener;
private final AdminChannel adminChannel;
@Inject AdminCommands(RestartManager restartManager, RestartListener restartListener) {
@Inject AdminCommands(RestartManager restartManager, RestartListener restartListener, AdminChannel adminChannel) {
this.restartManager = restartManager;
this.restartListener = restartListener;
this.adminChannel = adminChannel;
}
@Command(
@ -146,6 +149,7 @@ public class AdminCommands implements Commands {
sender.sendMessage(ChatColor.GREEN + PGMTranslations.get().t("command.admin.cancelRestart.restartUnqueued", sender));
}
sender.sendMessage(ChatColor.DARK_PURPLE + PGMTranslations.get().t("command.admin.set.success", sender, ChatColor.GOLD + mm.getNextMap().getInfo().name + ChatColor.DARK_PURPLE));
adminChannel.sendMessage(sender.getName() + ChatColor.RESET + " set the next map to " + ChatColor.YELLOW + mm.getNextMap().getInfo().name);
return null;
}