Fixed incorrect wording for failing to bind abilities (due to lack of elements) (#560)

This commit is contained in:
StrangeOne101 2016-08-26 11:25:50 +12:00 committed by OmniCypher
parent 32cc4f97d7
commit 5a351f3f25
2 changed files with 12 additions and 4 deletions

View file

@ -26,6 +26,7 @@ public class BindCommand extends PKCommand {
private String loadingInfo;
private String toggledElementOff;
private String noElement;
private String noElementAE;
private String noSubElement;
public BindCommand() {
@ -36,6 +37,7 @@ public class BindCommand extends PKCommand {
this.loadingInfo = ConfigManager.languageConfig.get().getString("Commands.Bind.LoadingInfo");
this.toggledElementOff = ConfigManager.languageConfig.get().getString("Commands.Bind.ToggledElementOff");
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");
}
@ -78,9 +80,14 @@ public class BindCommand extends PKCommand {
} else if (coreAbil == null || !bPlayer.canBind(coreAbil)) {
if (coreAbil != null && coreAbil.getElement() != Element.AVATAR && !bPlayer.hasElement(coreAbil.getElement())) {
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 {
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 {
sender.sendMessage(ChatColor.RED + super.noPermissionMessage);
@ -115,4 +122,4 @@ public class BindCommand extends PKCommand {
Collections.sort(abilities);
return abilities;
}
}
}

View file

@ -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.SuccessfullyBound", "Succesfully bound {ability} to slot {slot}.");
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.SuccessfullyAddedCFW", "You are now also a {element}.");