Fix replace method
This commit is contained in:
parent
d4122eb5e5
commit
d47f37557c
@ -22,17 +22,16 @@ public class CommandAlert extends Command
|
||||
} else
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (!args[0].contains("&h")) //They want to hide the alert prefix
|
||||
if (!args[0].startsWith("&h"))
|
||||
{
|
||||
builder.append(ChatColor.DARK_PURPLE);
|
||||
builder.append("[Alert] "); //No space at start.
|
||||
builder.append("[Alert] ");
|
||||
}
|
||||
|
||||
|
||||
for (String s : args)
|
||||
{
|
||||
s = s.replaceAll("&h", ""); //Fix replace
|
||||
builder.append(ChatColor.translateAlternateColorCodes('&', s)); //Allow custom colours
|
||||
s = s.replace("&h", "");
|
||||
builder.append(ChatColor.translateAlternateColorCodes('&', s));
|
||||
builder.append(" ");
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,12 @@
|
||||
package net.md_5.bungee.command;
|
||||
|
||||
import net.md_5.bungee.BungeeCord;
|
||||
import net.md_5.bungee.ChatColor;
|
||||
import net.md_5.bungee.Permission;
|
||||
|
||||
/**
|
||||
* Command to set a temp copy of the motd in real-time without stopping the proxy
|
||||
* Command to set a temp copy of the motd in real-time without stopping the
|
||||
* proxy.
|
||||
*/
|
||||
public class CommandMotd extends Command
|
||||
{
|
||||
@ -18,11 +20,11 @@ public class CommandMotd extends Command
|
||||
} else
|
||||
{
|
||||
String newMOTD = "";
|
||||
for (String s: args)
|
||||
for (String s : args)
|
||||
{
|
||||
newMOTD = newMOTD + s + " ";
|
||||
}
|
||||
newMOTD = newMOTD.substring(0, newMOTD.length()-1);
|
||||
newMOTD = newMOTD.substring(0, newMOTD.length() - 1);
|
||||
BungeeCord.instance.config.motd = newMOTD;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user