mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
More updates & fixes for party & admin chat.
This commit is contained in:
parent
a90e4e9c8d
commit
32422646e4
@ -55,6 +55,11 @@ public class ACommand implements CommandExecutor {
|
||||
aMessage = aMessage + " " + args[i];
|
||||
}
|
||||
|
||||
|
||||
Users.getProfile(player).toggleAdminChat();
|
||||
player.chat(aMessage);
|
||||
Users.getProfile(player).toggleAdminChat();
|
||||
|
||||
String name = player.getName();
|
||||
String aPrefix = ChatColor.AQUA + "{" + ChatColor.WHITE + name + ChatColor.AQUA + "} ";
|
||||
Bukkit.getLogger().info("[A]<" + name + "> " + aMessage);
|
||||
|
@ -11,7 +11,6 @@ import com.gmail.nossr50.Users;
|
||||
import com.gmail.nossr50.mcPermissions;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
import com.gmail.nossr50.party.Party;
|
||||
|
||||
public class PCommand implements CommandExecutor {
|
||||
public PCommand() {}
|
||||
@ -62,17 +61,10 @@ public class PCommand implements CommandExecutor {
|
||||
for (int i = 1; i <= args.length - 1; i++) {
|
||||
pMessage = pMessage + " " + args[i];
|
||||
}
|
||||
|
||||
String name = player.getName();
|
||||
String pPrefix = ChatColor.GREEN + "(" + ChatColor.WHITE + name + ChatColor.GREEN + ") ";
|
||||
Bukkit.getLogger().info("[P](" + PP.getParty() + ")<" + name + "> " + pMessage);
|
||||
|
||||
for (Player herp : Bukkit.getServer().getOnlinePlayers()) {
|
||||
if (Users.getProfile(herp).inParty()) {
|
||||
if (Party.getInstance().inSameParty(herp, player))
|
||||
herp.sendMessage(pPrefix + pMessage);
|
||||
}
|
||||
}
|
||||
|
||||
PP.togglePartyChat();
|
||||
player.chat(pMessage);
|
||||
PP.togglePartyChat();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -298,6 +298,7 @@ public class mcPlayerListener implements Listener {
|
||||
|
||||
Set<Player> intendedRecipients = new HashSet<Player>();
|
||||
String header = "";
|
||||
ChatColor color = null;
|
||||
|
||||
if (partyChat || adminChat) {
|
||||
|
||||
@ -308,7 +309,8 @@ public class mcPlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
header = ChatColor.GREEN + "[P] (" + PP.getParty() + ") ";
|
||||
color = ChatColor.GREEN;
|
||||
header = color + "[P] (" + PP.getParty() + ") ";
|
||||
|
||||
for (Player x : plugin.getServer().getOnlinePlayers()) {
|
||||
if (Party.getInstance().inSameParty(player, x)) {
|
||||
@ -319,7 +321,8 @@ public class mcPlayerListener implements Listener {
|
||||
}
|
||||
|
||||
if (adminChat) {
|
||||
header = ChatColor.AQUA + "[A] ";
|
||||
color = ChatColor.AQUA;
|
||||
header = color + "[A] ";
|
||||
|
||||
for (Player x : plugin.getServer().getOnlinePlayers()) {
|
||||
if (x.isOp() || mcPermissions.getInstance().adminChat(x)) {
|
||||
@ -329,7 +332,7 @@ public class mcPlayerListener implements Listener {
|
||||
}
|
||||
|
||||
recipients.retainAll(intendedRecipients);
|
||||
event.setFormat(header + "<%1$s> " + ChatColor.WHITE + "%2$s");
|
||||
event.setFormat(header + "<" + ChatColor.WHITE + "%1$s" + color + "> %2$s");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user