mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fixed /a
This commit is contained in:
parent
b2c33b779d
commit
acf1b5261d
@ -247,7 +247,11 @@ public class vMinecraftChat {
|
|||||||
String adminchat = Colors.DarkPurple + "{" + getName(player)
|
String adminchat = Colors.DarkPurple + "{" + getName(player)
|
||||||
+ Colors.DarkPurple +"}" + Colors.White + " ";
|
+ Colors.DarkPurple +"}" + Colors.White + " ";
|
||||||
|
|
||||||
String[] msg = wordWrap(adminchat + message.substring(1, message.length()));
|
//Cut off the @ prefix
|
||||||
|
if(message.startsWith("@"))
|
||||||
|
message = message.substring(1, message.length());
|
||||||
|
|
||||||
|
String[] msg = wordWrap(adminchat + message);
|
||||||
|
|
||||||
//Get the player from the playerlist to send the message to.
|
//Get the player from the playerlist to send the message to.
|
||||||
for (Player p: etc.getServer().getPlayerList()) {
|
for (Player p: etc.getServer().getPlayerList()) {
|
||||||
@ -272,26 +276,6 @@ public class vMinecraftChat {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean adminChatToggle(Player player, String message){
|
|
||||||
if(vMinecraftSettings.getInstance().isAdminToggled(player.getName())) {
|
|
||||||
String adminchat = Colors.DarkPurple + "{" + getName(player)
|
|
||||||
+ Colors.DarkPurple +"}" + Colors.White + " ";
|
|
||||||
String[] msg = wordWrap(adminchat + message.substring(1, message.length()));
|
|
||||||
for (Player p: etc.getServer().getPlayerList()) {
|
|
||||||
if (p != null) {
|
|
||||||
if (p.isAdmin() || p.canUseCommand("/adminchat")) {
|
|
||||||
for(String str: msg)
|
|
||||||
p.sendMessage(str);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
log.log(Level.INFO, "@" + "<" + getName(player)
|
|
||||||
+ Colors.White +"> " + message);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=====================================================================
|
//=====================================================================
|
||||||
//Function: quote
|
//Function: quote
|
||||||
|
@ -29,10 +29,9 @@ public class vMinecraftListener extends PluginListener {
|
|||||||
public boolean onChat(Player player, String message){
|
public boolean onChat(Player player, String message){
|
||||||
|
|
||||||
//Quote (Greentext)
|
//Quote (Greentext)
|
||||||
if (message.startsWith("@"))
|
if (message.startsWith("@") ||
|
||||||
|
vMinecraftSettings.getInstance().isAdminToggled(player.getName()))
|
||||||
return vMinecraftChat.adminChat(player, message);
|
return vMinecraftChat.adminChat(player, message);
|
||||||
if (vMinecraftSettings.getInstance().isAdminToggled(player.getName()))
|
|
||||||
return vMinecraftChat.adminChatToggle(player, message);
|
|
||||||
|
|
||||||
else if (message.startsWith(">"))
|
else if (message.startsWith(">"))
|
||||||
return vMinecraftChat.quote(player, message);
|
return vMinecraftChat.quote(player, message);
|
||||||
|
Loading…
Reference in New Issue
Block a user