From a0f96778e96657c204ac782f34f6ba506950a68c Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 6 Nov 2013 22:11:31 +1300 Subject: [PATCH] Sort by name --- .../disguise/commands/DisguiseHelpCommand.java | 14 +++++++------- .../disguisetypes/watchers/HorseWatcher.java | 18 +++++++++--------- .../watchers/ItemFrameWatcher.java | 18 +++++++++--------- .../disguisetypes/watchers/WolfWatcher.java | 10 +++++----- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java b/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java index 375eaddc..192b00b9 100644 --- a/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java +++ b/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java @@ -127,13 +127,6 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand { return true; } - public String toReadable(String string) { - String[] split = string.split("_"); - for (int i = 0; i < split.length; i++) - split[i] = split[i].substring(0, 1) + split[i].substring(1).toLowerCase(); - return StringUtils.join(split, "_"); - } - /** * Send the player the information */ @@ -153,4 +146,11 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand { sender.sendMessage(ChatColor.RED + "/disguisehelp PotionEffect " + ChatColor.GREEN + "- View all the potion effects you can set"); } + + public String toReadable(String string) { + String[] split = string.split("_"); + for (int i = 0; i < split.length; i++) + split[i] = split[i].substring(0, 1) + split[i].substring(1).toLowerCase(); + return StringUtils.join(split, "_"); + } } diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/HorseWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/HorseWatcher.java index 69785129..dbb92fc6 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/HorseWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/HorseWatcher.java @@ -18,6 +18,10 @@ public class HorseWatcher extends AgeableWatcher { return Color.values()[((Integer) getValue(20, 0) & 0xFF)]; } + public String getOwnerName() { + return (String) getValue(21, ""); + } + public Style getStyle() { return Style.values()[((Integer) getValue(20, 0) >>> 8)]; } @@ -62,15 +66,6 @@ public class HorseWatcher extends AgeableWatcher { setFlag(8, true); } - public String getOwnerName() { - return (String) getValue(21, ""); - } - - public void setOwnerName(String name) { - setValue(21, name); - sendData(21); - } - public void setColor(Color color) { setValue(20, color.ordinal() & 0xFF | getStyle().ordinal() << 8); sendData(20); @@ -99,6 +94,11 @@ public class HorseWatcher extends AgeableWatcher { setFlag(128, mouthOpen); } + public void setOwnerName(String name) { + setValue(21, name); + sendData(21); + } + public void setRearing(boolean rear) { setFlag(64, true); } diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/ItemFrameWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/ItemFrameWatcher.java index 935bbd78..74957f30 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/ItemFrameWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/ItemFrameWatcher.java @@ -12,12 +12,21 @@ public class ItemFrameWatcher extends FlagWatcher { super(disguise); } + public int getItemRotation() { + return (Integer) getValue(3, 0); + } + public ItemStack getItemStack() { if (getValue(2, null) == null) return new ItemStack(0); return CraftItemStack.asBukkitCopy((net.minecraft.server.v1_6_R3.ItemStack) getValue(2, null)); } + public void setItemRotation(int rotation) { + setValue(3, (byte) (rotation % 4)); + sendData(3); + } + public void setItemStack(ItemStack newItem) { newItem = newItem.clone(); newItem.setAmount(1); @@ -25,13 +34,4 @@ public class ItemFrameWatcher extends FlagWatcher { sendData(2); } - public int getItemRotation() { - return (Integer) getValue(3, 0); - } - - public void setItemRotation(int rotation) { - setValue(3, (byte) (rotation % 4)); - sendData(3); - } - } diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/WolfWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/WolfWatcher.java index da020598..f746b80b 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/WolfWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/WolfWatcher.java @@ -21,11 +21,6 @@ public class WolfWatcher extends AgeableWatcher { return (String) getValue(17, ""); } - public void setOwner(String owner) { - setValue(17, owner); - sendData(17); - } - public boolean isAngry() { return isTrue(2); } @@ -68,6 +63,11 @@ public class WolfWatcher extends AgeableWatcher { sendData(18); } + public void setOwner(String owner) { + setValue(17, owner); + sendData(17); + } + public void setSitting(boolean sitting) { setFlag(1, sitting); }