mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-26 02:28:03 +01:00
Merge pull request #194 from bm01/experimental
Alert lone players trying to speak in party chat
This commit is contained in:
commit
358c333c70
@ -61,6 +61,11 @@ public class PCommand implements CommandExecutor {
|
|||||||
// Not a toggle, a message
|
// Not a toggle, a message
|
||||||
|
|
||||||
if (args.length >= 1) {
|
if (args.length >= 1) {
|
||||||
|
if(!PP.inParty()) {
|
||||||
|
player.sendMessage("You're not in a party."); //TODO: Use mcLocale
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
String pMessage = args[0];
|
String pMessage = args[0];
|
||||||
for (int i = 1; i <= args.length - 1; i++) {
|
for (int i = 1; i <= args.length - 1; i++) {
|
||||||
pMessage = pMessage + " " + args[i];
|
pMessage = pMessage + " " + args[i];
|
||||||
|
@ -304,6 +304,12 @@ public class mcPlayerListener implements Listener
|
|||||||
if(PP.getPartyChatMode())
|
if(PP.getPartyChatMode())
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
|
if(!PP.inParty()) {
|
||||||
|
player.sendMessage("You're not in a party, type /p to leave party chat mode."); //TODO: Use mcLocale
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String name = (LoadProperties.pDisplayNames) ? player.getDisplayName() : player.getName();
|
String name = (LoadProperties.pDisplayNames) ? player.getDisplayName() : player.getName();
|
||||||
String format = ChatColor.GREEN + "(" + ChatColor.WHITE + name + ChatColor.GREEN + ") "+event.getMessage();
|
String format = ChatColor.GREEN + "(" + ChatColor.WHITE + name + ChatColor.GREEN + ") "+event.getMessage();
|
||||||
for(Player x : Bukkit.getServer().getOnlinePlayers())
|
for(Player x : Bukkit.getServer().getOnlinePlayers())
|
||||||
|
Loading…
Reference in New Issue
Block a user