Merge pull request #456 from OmniCypher-/master

Various Changes/Fixes
This commit is contained in:
OmniCypher 2016-03-26 12:19:06 -07:00
commit 5f2d5c06f7
11 changed files with 29 additions and 21 deletions

BIN
lib/ProjectKorraItems.jar Normal file

Binary file not shown.

View file

@ -101,6 +101,11 @@ public class Element {
ALL_ELEMENTS.put(name.toLowerCase(), this);
}
public String getPrefix() {
String prefix = this.plugin.getName().equalsIgnoreCase("ProjectKorra") ? this.getColor() + ConfigManager.languageConfig.get().getString("Chat.Prefixes." + name) + " " : ChatColor.WHITE + "[Nonbender] ";
return prefix;
}
public ChatColor getColor() {
String color = this.plugin.getName().equalsIgnoreCase("ProjectKorra") ? ConfigManager.languageConfig.get().getString("Chat.Colors." + name) : plugin.getConfig().getString("Chat.Colors." + name);
return color != null ? ChatColor.valueOf(color) : ChatColor.WHITE;

View file

@ -383,28 +383,24 @@ public class PKListener implements Listener {
Player player = event.getTarget();
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
Element element = event.getElement();
String append = "";
ChatColor color = null;
String prefix = "";
if (bPlayer == null) {
return;
}
boolean chatEnabled = ProjectKorra.plugin.getConfig().getBoolean("Properties.Chat.Enable");
boolean chatEnabled = ConfigManager.languageConfig.get().getBoolean("Chat.Enable");
if (bPlayer.getElements().size() > 1) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Avatar");
color = ChatColor.valueOf(plugin.getConfig().getString("Properties.Chat.Colors.Avatar"));
prefix = Element.AVATAR.getPrefix();
} else if (element != null){
append = plugin.getConfig().getString("Properties.Chat.Prefixes." + element.getName());
color = element.getColor();
prefix = element.getPrefix();
} else {
append = "[Nonbender]";
color = ChatColor.WHITE;
prefix = ChatColor.WHITE + "[Nonbender] ";
}
if (chatEnabled) {
player.setDisplayName(player.getName());
player.setDisplayName(color + append + ChatColor.RESET + player.getDisplayName());
player.setDisplayName(prefix + ChatColor.RESET + player.getDisplayName());
}
}

View file

@ -536,7 +536,7 @@ public abstract class EarthAbility extends ElementalAbility {
}
Information info = TEMP_AIR_LOCATIONS.get(i);
Block block = info.getState().getBlock();
Block block = info.getBlock();
if (block.getType() != Material.AIR && !block.isLiquid()) {
if (force || !MOVED_EARTH.containsKey(block)) {

View file

@ -22,7 +22,7 @@ public class BindCommand extends PKCommand {
private String toggledElementOff;
public BindCommand() {
super("bind", "/bending bind [Ability] <#>", ConfigManager.languageConfig.get().getString("Commands.Bind.Description"), new String[]{ "bind", "b" });
super("bind", "/bending bind <Ability> [Slot]", ConfigManager.languageConfig.get().getString("Commands.Bind.Description"), new String[]{ "bind", "b" });
this.abilityDoesntExist = ConfigManager.languageConfig.get().getString("Commands.Bind.AbilityDoesntExist");
this.wrongNumber = ConfigManager.languageConfig.get().getString("Commands.Bind.WrongNumber");

View file

@ -1,5 +1,6 @@
package com.projectkorra.projectkorra.command;
import com.projectkorra.items.command.PKICommand;
import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.ComboAbility;
@ -34,7 +35,7 @@ public class HelpCommand extends PKCommand {
private String usage;
public HelpCommand() {
super("help", "/bending help [Topic/Page]", ConfigManager.languageConfig.get().getString("Commands.Help.Description"), new String[] { "help", "h" });
super("help", "/bending help <Page/Topic>", ConfigManager.languageConfig.get().getString("Commands.Help.Description"), new String[] { "help", "h" });
this.required = ConfigManager.languageConfig.get().getString("Commands.Help.Required");
this.optional = ConfigManager.languageConfig.get().getString("Commands.Help.Optional");
@ -61,7 +62,10 @@ public class HelpCommand extends PKCommand {
}
}
if (GeneralMethods.hasItems()) {
//items commands being added
for (PKICommand command : PKICommand.instances.values()) {
if (sender.hasPermission("bendingitems.command." + command.getName()))
strings.add(command.getProperUse());
}
}
if (GeneralMethods.hasRPG()) {
for (RPGCommand command : RPGCommand.instances.values()) {
@ -89,7 +93,10 @@ public class HelpCommand extends PKCommand {
strings.add(command.getProperUse());
}
if (GeneralMethods.hasItems()) {
//items commands being added
for (PKICommand command : PKICommand.instances.values()) {
if (sender.hasPermission("bendingitems.command." + command.getName()))
strings.add(command.getProperUse());
}
}
if (GeneralMethods.hasRPG()) {
for (RPGCommand command : RPGCommand.instances.values()) {

View file

@ -25,7 +25,7 @@ public class PermaremoveCommand extends PKCommand {
private String removedConfirm;
public PermaremoveCommand() {
super("permaremove", "/bending permaremove [Player]", ConfigManager.languageConfig.get().getString("Commands.PermaRemove.Description"), new String[] { "permaremove", "premove", "permremove", "pr" });
super("permaremove", "/bending permaremove <Player>", ConfigManager.languageConfig.get().getString("Commands.PermaRemove.Description"), new String[] { "permaremove", "premove", "permremove", "pr" });
this.playerIsOffline = ConfigManager.languageConfig.get().getString("Commands.PermaRemove.PlayerOffline");
this.restored = ConfigManager.languageConfig.get().getString("Commands.PermaRemove.Restored");

View file

@ -42,7 +42,7 @@ public class PresetCommand extends PKCommand {
private String cantEditBinds;
public PresetCommand() {
super("preset", "/bending preset create|bind|list|delete [name]", ConfigManager.languageConfig.get().getString("Commands.Preset.Description"), new String[] { "preset", "presets", "pre", "set", "p" });
super("preset", "/bending preset <Bind/Create/Delete/List> [Preset]", ConfigManager.languageConfig.get().getString("Commands.Preset.Description"), new String[] { "preset", "presets", "pre", "set", "p" });
this.noPresets = ConfigManager.languageConfig.get().getString("Commands.Preset.NoPresets");
this.noPresetName = ConfigManager.languageConfig.get().getString("Commands.Preset.NoPresetName");

View file

@ -28,7 +28,7 @@ public class ToggleCommand extends PKCommand {
//config.addDefault("Commands.Toggle.Other.ToggledOffElementConfirm", "Your {element} has been toggled off by {sender}.");
public ToggleCommand() {
super("toggle", "/bending toggle <all | (element) <player>>", ConfigManager.languageConfig.get().getString("Commands.Toggle.Description"), new String[] { "toggle", "t" });
super("toggle", "/bending toggle <All/Element/Player> [Player]", ConfigManager.languageConfig.get().getString("Commands.Toggle.Description"), new String[] { "toggle", "t" });
FileConfiguration c = ConfigManager.languageConfig.get();

View file

@ -37,7 +37,7 @@ public class WhoCommand extends PKCommand {
private String databaseOverload, noPlayersOnline, playerOffline;
public WhoCommand() {
super("who", "/bending who [Player/Page]", ConfigManager.languageConfig.get().getString("Commands.Who.Description"), new String[] { "who", "w" });
super("who", "/bending who [Page/Player]", ConfigManager.languageConfig.get().getString("Commands.Who.Description"), new String[] { "who", "w" });
databaseOverload = ConfigManager.languageConfig.get().getString("Commands.Who.DatabaseOverload");
noPlayersOnline = ConfigManager.languageConfig.get().getString("Commands.Who.NoPlayersOnline");