From d32a07735996f9e38209270e0bbd4664281a39b5 Mon Sep 17 00:00:00 2001 From: riking Date: Tue, 3 Jun 2014 18:18:43 -0700 Subject: [PATCH] StringBuilder, rename local, javadocs --- src/me/libraryaddict/disguise/LibsDisguises.java | 2 +- .../disguise/disguisetypes/FlagWatcher.java | 6 +++--- .../disguise/utilities/BaseDisguiseCommand.java | 1 - .../disguise/utilities/DisguiseUtilities.java | 13 ++++--------- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/me/libraryaddict/disguise/LibsDisguises.java b/src/me/libraryaddict/disguise/LibsDisguises.java index ed68812a..1ae3041f 100644 --- a/src/me/libraryaddict/disguise/LibsDisguises.java +++ b/src/me/libraryaddict/disguise/LibsDisguises.java @@ -290,7 +290,7 @@ public class LibsDisguises extends JavaPlugin { private String toReadable(String string) { StringBuilder builder = new StringBuilder(); for (String s : string.split("_")) { - builder.append(s.substring(0, 1) + s.substring(1).toLowerCase()); + builder.append(s.substring(0, 1)).append(s.substring(1).toLowerCase()); } return builder.toString(); } diff --git a/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java index 52519e1b..5af4ff0b 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java @@ -305,11 +305,11 @@ public class FlagWatcher { if (itemStack == null) { // Find the item to replace it with if (getDisguise().getEntity() instanceof LivingEntity) { - EntityEquipment enquipment = ((LivingEntity) getDisguise().getEntity()).getEquipment(); + EntityEquipment equipment = ((LivingEntity) getDisguise().getEntity()).getEquipment(); if (slot == 4) { - itemStack = enquipment.getItemInHand(); + itemStack = equipment.getItemInHand(); } else { - itemStack = enquipment.getArmorContents()[slot]; + itemStack = equipment.getArmorContents()[slot]; } if (itemStack != null && itemStack.getTypeId() == 0) { itemStack = null; diff --git a/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java b/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java index 483e6bc5..9c55f7bf 100644 --- a/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java +++ b/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java @@ -350,7 +350,6 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { // Parse to horse color } else if (param.getSimpleName().equals("Color")) { try { - value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase()); } catch (Exception ex) { throw parseToException("a horse color", valueString, methodName); diff --git a/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index 970936dd..70250d94 100644 --- a/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -30,7 +30,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.entity.Zombie; import org.bukkit.inventory.ItemStack; -import org.bukkit.potion.PotionEffect; import org.bukkit.util.Vector; import com.comphenix.protocol.PacketType; @@ -175,8 +174,7 @@ public class DisguiseUtilities { } /** - * @param Sends - * entity removal packets, as this disguise was removed + * Sends entity removal packets, as this disguise was removed */ public static void destroyEntity(TargetedDisguise disguise) { try { @@ -461,8 +459,7 @@ public class DisguiseUtilities { } /** - * @param Resends - * the entity to this specific player + * Resends the entity to this specific player */ public static void refreshTracker(TargetedDisguise disguise, String player) { if (disguise.getEntity() != null && disguise.getEntity().isValid()) { @@ -495,8 +492,7 @@ public class DisguiseUtilities { } /** - * @param A - * convidence method for me to refresh trackers in other plugins + * A convenience method for me to refresh trackers in other plugins */ public static void refreshTrackers(Entity entity) { if (entity.isValid()) { @@ -532,8 +528,7 @@ public class DisguiseUtilities { } /** - * @param Resends - * the entity to all the watching players, which is where the magic begins + * Resends the entity to all the watching players, which is where the magic begins */ public static void refreshTrackers(TargetedDisguise disguise) { try {