Fixed a coloring glitch with mentio
This commit is contained in:
@@ -28,7 +28,7 @@ import net.nemez.chatapi.click.Message;
|
|||||||
|
|
||||||
@Commands(CommandHolderType.String)
|
@Commands(CommandHolderType.String)
|
||||||
@AutoRegisterListener
|
@AutoRegisterListener
|
||||||
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
|
@Version(major = 4, minor = 0, revision = 1, compatible = 4)
|
||||||
public class Mentio implements Module, Listener
|
public class Mentio implements Module, Listener
|
||||||
{
|
{
|
||||||
private File mentioLocation = new File(Main.plugin.getDataFolder(), "mentio.json");
|
private File mentioLocation = new File(Main.plugin.getDataFolder(), "mentio.json");
|
||||||
@@ -100,7 +100,7 @@ public class Mentio implements Module, Listener
|
|||||||
@Command(hook = "listmentios")
|
@Command(hook = "listmentios")
|
||||||
public boolean listMentios(CommandSender sender)
|
public boolean listMentios(CommandSender sender)
|
||||||
{
|
{
|
||||||
ArrayList<String> message = new ArrayList<String>();
|
ArrayList<String> message = new ArrayList<>();
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
UUID uuid = player.getUniqueId();
|
UUID uuid = player.getUniqueId();
|
||||||
JSONArray playerMentios = (JSONArray) mentios.get(uuid.toString());
|
JSONArray playerMentios = (JSONArray) mentios.get(uuid.toString());
|
||||||
@@ -150,7 +150,7 @@ public class Mentio implements Module, Listener
|
|||||||
lastColorCodes += "§" + c;
|
lastColorCodes += "§" + c;
|
||||||
lastChar = c;
|
lastChar = c;
|
||||||
}
|
}
|
||||||
Message m = new Message(player, null);
|
Message m = new Message(player, event.getPlayer());
|
||||||
m.appendText(event.getFormat().replace("%1$s", event.getPlayer().getDisplayName()).replace("%2$s",
|
m.appendText(event.getFormat().replace("%1$s", event.getPlayer().getDisplayName()).replace("%2$s",
|
||||||
event.getMessage().replaceFirst("(?i)(" + Pattern.quote(mentio) + ")([^ ]*)",
|
event.getMessage().replaceFirst("(?i)(" + Pattern.quote(mentio) + ")([^ ]*)",
|
||||||
"§a§o$1$2" + lastColorCodes)));
|
"§a§o$1$2" + lastColorCodes)));
|
||||||
|
|||||||
Reference in New Issue
Block a user