mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-01 16:19:53 +01:00
Merge branch 'master' of github.com:mcMMO-Dev/mcMMO
This commit is contained in:
commit
163b3d19f9
@ -10,7 +10,6 @@ import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
|
||||
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.Party;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
|
||||
public final class ChatManager {
|
||||
public ChatManager () {}
|
||||
@ -30,14 +29,8 @@ public final class ChatManager {
|
||||
|
||||
String adminMessage = chatEvent.getMessage();
|
||||
|
||||
for (Player otherPlayer : mcMMO.p.getServer().getOnlinePlayers()) {
|
||||
if (Permissions.adminChat(otherPlayer) || otherPlayer.isOp()) {
|
||||
otherPlayer.sendMessage(LocaleLoader.getString("Commands.AdminChat.Prefix", displayName) + adminMessage);
|
||||
}
|
||||
}
|
||||
|
||||
displayName = ChatColor.stripColor(displayName);
|
||||
mcMMO.p.getLogger().info("[A]<" + displayName + "> " + adminMessage);
|
||||
mcMMO.p.getServer().broadcast(LocaleLoader.getString("Commands.AdminChat.Prefix", displayName) + adminMessage, "mcmmo.chat.admin");
|
||||
mcMMO.p.getLogger().info("[A]<" + ChatColor.stripColor(displayName) + "> " + adminMessage);
|
||||
}
|
||||
|
||||
public static void handleAdminChat(Plugin plugin, String senderName, String message) {
|
||||
@ -65,8 +58,7 @@ public final class ChatManager {
|
||||
member.sendMessage(LocaleLoader.getString("Commands.Party.Chat.Prefix", displayName) + partyMessage);
|
||||
}
|
||||
|
||||
displayName = ChatColor.stripColor(displayName);
|
||||
mcMMO.p.getLogger().info("[P](" + partyName + ")" + "<" + displayName + "> " + partyMessage);
|
||||
mcMMO.p.getLogger().info("[P](" + partyName + ")" + "<" + ChatColor.stripColor(displayName) + "> " + partyMessage);
|
||||
}
|
||||
|
||||
public static void handlePartyChat(Plugin plugin, Party party, String senderName, String message) {
|
||||
|
@ -29,26 +29,29 @@ public abstract class ChatCommand implements CommandExecutor {
|
||||
|
||||
if (chatMode.isEnabled(mcMMOPlayer)) {
|
||||
disableChatMode(sender);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
enableChatMode(sender);
|
||||
}
|
||||
|
||||
enableChatMode(sender);
|
||||
return true;
|
||||
|
||||
default:
|
||||
if (args.length == 1) {
|
||||
if (!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mcMMOPlayer = Users.getPlayer((Player) sender);
|
||||
|
||||
if (args[0].equalsIgnoreCase("on")) {
|
||||
if (!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
enableChatMode(sender);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("off")) {
|
||||
if (!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
disableChatMode(sender);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user