From 381682c1883ddc001b19047b32c8497645d9fb35 Mon Sep 17 00:00:00 2001 From: Pepich Date: Thu, 2 Mar 2017 21:00:41 +0100 Subject: [PATCH] Made mentio search greedy --- src/com/redstoner/modules/mentio/Mentio.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/redstoner/modules/mentio/Mentio.java b/src/com/redstoner/modules/mentio/Mentio.java index 968f372..ea2598d 100644 --- a/src/com/redstoner/modules/mentio/Mentio.java +++ b/src/com/redstoner/modules/mentio/Mentio.java @@ -23,7 +23,7 @@ import com.redstoner.misc.Utils; import com.redstoner.modules.Module; @AutoRegisterListener -@Version(major = 2, minor = 0, revision = 1, compatible = 2) +@Version(major = 2, minor = 0, revision = 2, compatible = 2) public class Mentio implements Module, Listener { private File mentioLocation = new File(Main.plugin.getDataFolder(), "mentio.json"); @@ -146,7 +146,7 @@ public class Mentio implements Module, Listener } Utils.sendMessage(player, "", 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))); player.playSound(player.getLocation(), Sound.ENTITY_CHICKEN_EGG, 1, 1); return;