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