mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Better regex for this.
This commit is contained in:
parent
212137ec3e
commit
c151366952
@ -66,11 +66,11 @@ public class PlayerListener implements Listener {
|
|||||||
String deathMessage = event.getDeathMessage();
|
String deathMessage = event.getDeathMessage();
|
||||||
PlayerProfile profile = UserManager.getPlayer(event.getEntity()).getProfile();
|
PlayerProfile profile = UserManager.getPlayer(event.getEntity()).getProfile();
|
||||||
|
|
||||||
if (profile.getMobHealthbarType() == MobHealthbarType.HEARTS && deathMessage.contains("❤❤")) {
|
if (profile.getMobHealthbarType() == MobHealthbarType.HEARTS && deathMessage.contains("❤")) {
|
||||||
deathMessage.replaceFirst("❤+", ChatColor.RESET + "a mob");
|
deathMessage.replaceFirst("(?:\\u00A7(?:[1-9a-fklmnor]){1}(?:❤{1,10})){1,2}", ChatColor.RESET + "a mob");
|
||||||
}
|
}
|
||||||
else if (profile.getMobHealthbarType() == MobHealthbarType.BAR && deathMessage.contains("■■■■■■■■■■")) {
|
else if (profile.getMobHealthbarType() == MobHealthbarType.BAR && deathMessage.contains("■")) {
|
||||||
deathMessage.replace("■■■■■■■■■■", ChatColor.RESET + "a mob");
|
deathMessage.replaceFirst("(?:\\u00A7(?:[1-9a-fklmnor]){1}(?:■{1,10})){1,2}", ChatColor.RESET + "a mob");
|
||||||
}
|
}
|
||||||
|
|
||||||
event.setDeathMessage(deathMessage);
|
event.setDeathMessage(deathMessage);
|
||||||
|
Loading…
Reference in New Issue
Block a user