mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 19:50:37 +00:00
Add support for avatar abilities.
This commit is contained in:
parent
f79557c71d
commit
8a16bbed68
1 changed files with 10 additions and 1 deletions
|
@ -911,8 +911,13 @@ public class PKListener implements Listener {
|
||||||
String ability = bendingDeathPlayer.get(event.getEntity());
|
String ability = bendingDeathPlayer.get(event.getEntity());
|
||||||
String tempAbility = ChatColor.stripColor(ability).replaceAll(" ", "");
|
String tempAbility = ChatColor.stripColor(ability).replaceAll(" ", "");
|
||||||
Element element = null;
|
Element element = null;
|
||||||
|
boolean isAvatarAbility = false;
|
||||||
if (GeneralMethods.abilityExists(tempAbility)) {
|
if (GeneralMethods.abilityExists(tempAbility)) {
|
||||||
element = GeneralMethods.getAbilityElement(tempAbility);
|
element = GeneralMethods.getAbilityElement(tempAbility);
|
||||||
|
if (element == null) {
|
||||||
|
isAvatarAbility = true;
|
||||||
|
ability = GeneralMethods.getAvatarColor() + tempAbility;
|
||||||
|
}
|
||||||
} else if (ChatColor.getByChar(ability.substring(1, 2)) != null) {
|
} else if (ChatColor.getByChar(ability.substring(1, 2)) != null) {
|
||||||
element = Element.getFromChatColor(ChatColor.getByChar(ability.substring(1, 2)));
|
element = Element.getFromChatColor(ChatColor.getByChar(ability.substring(1, 2)));
|
||||||
}
|
}
|
||||||
|
@ -942,7 +947,11 @@ public class PKListener implements Listener {
|
||||||
message = ConfigManager.deathMsgConfig.get().getString("Combo." + tempAbility);
|
message = ConfigManager.deathMsgConfig.get().getString("Combo." + tempAbility);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ConfigManager.deathMsgConfig.get().contains("Combo." + tempAbility)) {
|
if (isAvatarAbility) {
|
||||||
|
if (ConfigManager.deathMsgConfig.get().contains("Avatar." + tempAbility)) {
|
||||||
|
message = ConfigManager.deathMsgConfig.get().getString("Avatar." + tempAbility);
|
||||||
|
}
|
||||||
|
} else if (ConfigManager.deathMsgConfig.get().contains("Combo." + tempAbility)) {
|
||||||
message = ConfigManager.deathMsgConfig.get().getString("Combo." + tempAbility);
|
message = ConfigManager.deathMsgConfig.get().getString("Combo." + tempAbility);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue