mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-02-20 02:33:15 +01:00
Added admin chat toggle, also added shortcut for clearinvetory to be /ci
This commit is contained in:
@@ -79,7 +79,7 @@ public class vminecraftChat {
|
||||
//and their following color codes
|
||||
for(int x = 0; x<str.length(); x++)
|
||||
{
|
||||
if(str.charAt(x) == '§')
|
||||
if(str.charAt(x) == '<EFBFBD>')
|
||||
x++;
|
||||
else if("i;,.:|!".indexOf(str.charAt(x)) != -1)
|
||||
length+=2;
|
||||
@@ -272,6 +272,25 @@ public class vminecraftChat {
|
||||
}
|
||||
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
|
||||
@@ -381,8 +400,8 @@ public class vminecraftChat {
|
||||
//Loop through looking for a color code
|
||||
for(int x = 0; x< msg.length(); x++)
|
||||
{
|
||||
//If the char is a ^ or §
|
||||
if(msg.charAt(x) == '^' || msg.charAt(x) == '§')
|
||||
//If the char is a ^ or <EFBFBD>
|
||||
if(msg.charAt(x) == '^' || msg.charAt(x) == '<EFBFBD>')
|
||||
{
|
||||
if(x != msg.length() - 1)
|
||||
{
|
||||
@@ -445,8 +464,8 @@ public class vminecraftChat {
|
||||
//Loop through looking for a color code
|
||||
for(int x = 0; x< message.length(); x++)
|
||||
{
|
||||
//If the char is a ^ or §
|
||||
if(message.charAt(x) == '^' || message.charAt(x) == '§')
|
||||
//If the char is a ^ or <EFBFBD>
|
||||
if(message.charAt(x) == '^' || message.charAt(x) == '<EFBFBD>')
|
||||
{
|
||||
if(x != message.length() - 1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user