mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +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();
|
||||
PlayerProfile profile = UserManager.getPlayer(event.getEntity()).getProfile();
|
||||
|
||||
if (profile.getMobHealthbarType() == MobHealthbarType.HEARTS && deathMessage.contains("❤❤")) {
|
||||
deathMessage.replaceFirst("❤+", ChatColor.RESET + "a mob");
|
||||
if (profile.getMobHealthbarType() == MobHealthbarType.HEARTS && deathMessage.contains("❤")) {
|
||||
deathMessage.replaceFirst("(?:\\u00A7(?:[1-9a-fklmnor]){1}(?:❤{1,10})){1,2}", ChatColor.RESET + "a mob");
|
||||
}
|
||||
else if (profile.getMobHealthbarType() == MobHealthbarType.BAR && deathMessage.contains("■■■■■■■■■■")) {
|
||||
deathMessage.replace("■■■■■■■■■■", ChatColor.RESET + "a mob");
|
||||
else if (profile.getMobHealthbarType() == MobHealthbarType.BAR && deathMessage.contains("■")) {
|
||||
deathMessage.replaceFirst("(?:\\u00A7(?:[1-9a-fklmnor]){1}(?:■{1,10})){1,2}", ChatColor.RESET + "a mob");
|
||||
}
|
||||
|
||||
event.setDeathMessage(deathMessage);
|
||||
|
Loading…
Reference in New Issue
Block a user