Merge remote-tracking branch 'refs/remotes/ProjectKorra/master'

This commit is contained in:
Benford 2016-03-28 15:12:12 -04:00
commit a09d1aab73
12 changed files with 48 additions and 35 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"));
} else if (element != null) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes." + element.getName());
color = element.getColor();
prefix = Element.AVATAR.getPrefix();
} else if (element != null){
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

@ -1,16 +1,8 @@
package com.projectkorra.projectkorra.ability;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.earthbending.EarthPassive;
import com.projectkorra.projectkorra.earthbending.LavaFlow;
import com.projectkorra.projectkorra.earthbending.RaiseEarth;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.Information;
import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.TempBlock;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.ChatColor;
import org.bukkit.Effect;
@ -25,9 +17,17 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.earthbending.EarthPassive;
import com.projectkorra.projectkorra.earthbending.LavaFlow;
import com.projectkorra.projectkorra.earthbending.RaiseEarth;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.Information;
import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.TempBlock;
public abstract class EarthAbility extends ElementalAbility {
@ -240,15 +240,20 @@ public abstract class EarthAbility extends ElementalAbility {
*
* @param block The block to use as a base
*/
@SuppressWarnings("deprecation")
public static void addTempAirBlock(Block block) {
Information info;
if (MOVED_EARTH.containsKey(block)) {
info = MOVED_EARTH.get(block);
MOVED_EARTH.remove(block);
} else {
info = new Information();
info.setBlock(block);
info.setState(block.getState());
info.setData(block.getData());
}
block.setType(Material.AIR);
info.setTime(System.currentTimeMillis());

View file

@ -249,7 +249,7 @@ public abstract class WaterAbility extends ElementalAbility {
}
public static boolean isLeaves(Material material) {
return material == Material.LEAVES || material == Material.LEAVES;
return material == Material.LEAVES || material == Material.LEAVES_2;
}
public static boolean isSnow(Block 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");