mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-31 14:49:35 +01:00
Return party chat to ye olden method
This commit is contained in:
parent
5765504796
commit
75b287771a
@ -30,7 +30,6 @@ public class PCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
case 0:
|
case 0:
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
@ -71,13 +70,20 @@ public class PCommand implements CommandExecutor {
|
|||||||
message = message + " " + args [i];
|
message = message + " " + args [i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PP.getPartyChatMode()) {
|
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(player.getName(), PP.getParty(), message);
|
||||||
player.chat(message);
|
plugin.getServer().getPluginManager().callEvent(chatEvent);
|
||||||
|
|
||||||
|
if (chatEvent.isCancelled()) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
PP.togglePartyChat();
|
message = chatEvent.getMessage();
|
||||||
player.chat(message);
|
String prefix = ChatColor.GREEN + "(" + ChatColor.WHITE + player.getName() + ChatColor.GREEN + ") ";
|
||||||
PP.togglePartyChat();
|
|
||||||
|
plugin.getLogger().info("[P](" + PP.getParty() + ")" + "<" + player.getName() + "> " + message);
|
||||||
|
|
||||||
|
for (Player p : Party.getInstance().getOnlineMembers(PP.getParty())) {
|
||||||
|
p.sendMessage(prefix + message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -329,18 +329,15 @@ public class PlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.setMessage(chatEvent.getMessage());
|
String prefix = ChatColor.GREEN + "(" + ChatColor.WHITE + player.getName() + ChatColor.GREEN + ") ";
|
||||||
|
|
||||||
Set<Player> intendedRecipients = new HashSet<Player>();
|
plugin.getLogger().info("[P](" + PP.getParty() + ")" + "<" + player.getName() + "> " + chatEvent.getMessage());
|
||||||
|
|
||||||
for (Player x : Party.getInstance().getOnlineMembers(player)) {
|
for (Player p : Party.getInstance().getOnlineMembers(PP.getParty())) {
|
||||||
intendedRecipients.add(x);
|
p.sendMessage(prefix + chatEvent.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatColor bracketColor = ChatColor.GREEN;
|
event.setCancelled(true);
|
||||||
|
|
||||||
event.setFormat(bracketColor + "(" + ChatColor.WHITE + "%1$s" + bracketColor + ") %2$s");
|
|
||||||
event.getRecipients().retainAll(intendedRecipients);
|
|
||||||
}
|
}
|
||||||
else if (PP.getAdminChatMode()) {
|
else if (PP.getAdminChatMode()) {
|
||||||
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(player.getName(), event.getMessage());
|
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(player.getName(), event.getMessage());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user