mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-01-03 13:38:20 +00:00
Fixed incorrect wording for failing to bind abilities (due to lack of elements) (#560)
This commit is contained in:
parent
32cc4f97d7
commit
5a351f3f25
2 changed files with 12 additions and 4 deletions
|
@ -26,6 +26,7 @@ public class BindCommand extends PKCommand {
|
||||||
private String loadingInfo;
|
private String loadingInfo;
|
||||||
private String toggledElementOff;
|
private String toggledElementOff;
|
||||||
private String noElement;
|
private String noElement;
|
||||||
|
private String noElementAE;
|
||||||
private String noSubElement;
|
private String noSubElement;
|
||||||
|
|
||||||
public BindCommand() {
|
public BindCommand() {
|
||||||
|
@ -36,6 +37,7 @@ public class BindCommand extends PKCommand {
|
||||||
this.loadingInfo = ConfigManager.languageConfig.get().getString("Commands.Bind.LoadingInfo");
|
this.loadingInfo = ConfigManager.languageConfig.get().getString("Commands.Bind.LoadingInfo");
|
||||||
this.toggledElementOff = ConfigManager.languageConfig.get().getString("Commands.Bind.ToggledElementOff");
|
this.toggledElementOff = ConfigManager.languageConfig.get().getString("Commands.Bind.ToggledElementOff");
|
||||||
this.noElement = ConfigManager.languageConfig.get().getString("Commands.Bind.NoElement");
|
this.noElement = ConfigManager.languageConfig.get().getString("Commands.Bind.NoElement");
|
||||||
|
this.noElementAE = ConfigManager.languageConfig.get().getString("Commands.Bind.NoElementAE");
|
||||||
this.noSubElement = ConfigManager.languageConfig.get().getString("Commands.Bind.NoSubElement");
|
this.noSubElement = ConfigManager.languageConfig.get().getString("Commands.Bind.NoSubElement");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,9 +80,14 @@ public class BindCommand extends PKCommand {
|
||||||
} else if (coreAbil == null || !bPlayer.canBind(coreAbil)) {
|
} else if (coreAbil == null || !bPlayer.canBind(coreAbil)) {
|
||||||
if (coreAbil != null && coreAbil.getElement() != Element.AVATAR && !bPlayer.hasElement(coreAbil.getElement())) {
|
if (coreAbil != null && coreAbil.getElement() != Element.AVATAR && !bPlayer.hasElement(coreAbil.getElement())) {
|
||||||
if (coreAbil.getElement() instanceof SubElement) {
|
if (coreAbil.getElement() instanceof SubElement) {
|
||||||
sender.sendMessage(ChatColor.RED + this.noSubElement.replace("{subelement}", coreAbil.getElement().getName() + coreAbil.getElement().getType().getBender()));
|
SubElement sub = (SubElement) coreAbil.getElement();
|
||||||
|
if (!bPlayer.hasElement(sub.getParentElement())) {
|
||||||
|
sender.sendMessage(ChatColor.RED + ("AEIOUaeiou".indexOf(sub.getParentElement().getName().charAt(0)) > -1 ? this.noElementAE : this.noElement).replace("{element}", sub.getParentElement().getName() + sub.getParentElement().getType().getBender()));
|
||||||
|
} else {
|
||||||
|
sender.sendMessage(ChatColor.RED + this.noSubElement.replace("{subelement}", coreAbil.getElement().getName() + coreAbil.getElement().getType().getBending()));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(ChatColor.RED + this.noElement.replace("{element}", coreAbil.getElement().getName() + coreAbil.getElement().getType().getBender()));
|
sender.sendMessage(ChatColor.RED + ("AEIOUaeiou".indexOf(coreAbil.getElement().getName().charAt(0)) > -1 ? this.noElementAE : this.noElement).replace("{element}", coreAbil.getElement().getName() + coreAbil.getElement().getType().getBender()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(ChatColor.RED + super.noPermissionMessage);
|
sender.sendMessage(ChatColor.RED + super.noPermissionMessage);
|
||||||
|
@ -115,4 +122,4 @@ public class BindCommand extends PKCommand {
|
||||||
Collections.sort(abilities);
|
Collections.sort(abilities);
|
||||||
return abilities;
|
return abilities;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -199,7 +199,8 @@ public class ConfigManager {
|
||||||
config.addDefault("Commands.Bind.ElementToggledOff", "You have that ability's element toggled off currently.");
|
config.addDefault("Commands.Bind.ElementToggledOff", "You have that ability's element toggled off currently.");
|
||||||
config.addDefault("Commands.Bind.SuccessfullyBound", "Succesfully bound {ability} to slot {slot}.");
|
config.addDefault("Commands.Bind.SuccessfullyBound", "Succesfully bound {ability} to slot {slot}.");
|
||||||
config.addDefault("Commands.Bind.NoElement", "You are not a {element}!");
|
config.addDefault("Commands.Bind.NoElement", "You are not a {element}!");
|
||||||
config.addDefault("Commands.Bind.NoSubElement", "You are not a {subelement}!");
|
config.addDefault("Commands.Bind.NoElementAE", "You are not an {element}!");
|
||||||
|
config.addDefault("Commands.Bind.NoSubElement", "You don't have access to {subelement}!");
|
||||||
|
|
||||||
config.addDefault("Commands.Add.Description", "This command will allow the user to add an element to the targeted <Player>, or themselves if the target is not specified. This command is typically reserved for server administrators.");
|
config.addDefault("Commands.Add.Description", "This command will allow the user to add an element to the targeted <Player>, or themselves if the target is not specified. This command is typically reserved for server administrators.");
|
||||||
config.addDefault("Commands.Add.SuccessfullyAddedCFW", "You are now also a {element}.");
|
config.addDefault("Commands.Add.SuccessfullyAddedCFW", "You are now also a {element}.");
|
||||||
|
|
Loading…
Reference in a new issue