mcMMO/src/main/java/com/gmail/nossr50/chat/commands/AdminChatCommand.java

29 lines
910 B
Java
Raw Normal View History

2013-02-02 06:09:47 +01:00
package com.gmail.nossr50.chat.commands;
2012-01-09 20:00:13 +01:00
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
2013-02-02 06:09:47 +01:00
import com.gmail.nossr50.chat.ChatManager;
2013-02-07 21:59:18 +01:00
import com.gmail.nossr50.chat.ChatMode;
2012-04-27 11:47:11 +02:00
import com.gmail.nossr50.locale.LocaleLoader;
2012-01-09 20:00:13 +01:00
2013-02-07 21:59:18 +01:00
public class AdminChatCommand extends ChatCommand {
public AdminChatCommand() {
super(ChatMode.ADMIN);
}
2013-02-07 21:59:18 +01:00
@Override
protected void handleChatSending(CommandSender sender, String[] args) {
String message = buildChatMessage(args, 0);
2012-04-22 08:55:58 +02:00
2013-02-07 21:59:18 +01:00
if (sender instanceof Player) {
Player player = (Player) sender;
ChatManager.handleAdminChat(mcMMO.p, player.getName(), player.getDisplayName(), message);
}
else {
ChatManager.handleAdminChat(mcMMO.p, LocaleLoader.getString("Commands.Chat.Console"), message);
2012-04-21 00:09:50 +02:00
}
}
2012-01-09 20:00:13 +01:00
}