Sort by name

This commit is contained in:
Andrew 2013-11-06 22:11:31 +13:00
parent b47d5e8b5f
commit a0f96778e9
4 changed files with 30 additions and 30 deletions

View File

@ -127,13 +127,6 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand {
return true; 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 * Send the player the information
*/ */
@ -153,4 +146,11 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand {
sender.sendMessage(ChatColor.RED + "/disguisehelp PotionEffect " + ChatColor.GREEN sender.sendMessage(ChatColor.RED + "/disguisehelp PotionEffect " + ChatColor.GREEN
+ "- View all the potion effects you can set"); + "- 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, "_");
}
} }

View File

@ -18,6 +18,10 @@ public class HorseWatcher extends AgeableWatcher {
return Color.values()[((Integer) getValue(20, 0) & 0xFF)]; return Color.values()[((Integer) getValue(20, 0) & 0xFF)];
} }
public String getOwnerName() {
return (String) getValue(21, "");
}
public Style getStyle() { public Style getStyle() {
return Style.values()[((Integer) getValue(20, 0) >>> 8)]; return Style.values()[((Integer) getValue(20, 0) >>> 8)];
} }
@ -62,15 +66,6 @@ public class HorseWatcher extends AgeableWatcher {
setFlag(8, true); 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) { public void setColor(Color color) {
setValue(20, color.ordinal() & 0xFF | getStyle().ordinal() << 8); setValue(20, color.ordinal() & 0xFF | getStyle().ordinal() << 8);
sendData(20); sendData(20);
@ -99,6 +94,11 @@ public class HorseWatcher extends AgeableWatcher {
setFlag(128, mouthOpen); setFlag(128, mouthOpen);
} }
public void setOwnerName(String name) {
setValue(21, name);
sendData(21);
}
public void setRearing(boolean rear) { public void setRearing(boolean rear) {
setFlag(64, true); setFlag(64, true);
} }

View File

@ -12,12 +12,21 @@ public class ItemFrameWatcher extends FlagWatcher {
super(disguise); super(disguise);
} }
public int getItemRotation() {
return (Integer) getValue(3, 0);
}
public ItemStack getItemStack() { public ItemStack getItemStack() {
if (getValue(2, null) == null) if (getValue(2, null) == null)
return new ItemStack(0); return new ItemStack(0);
return CraftItemStack.asBukkitCopy((net.minecraft.server.v1_6_R3.ItemStack) getValue(2, null)); 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) { public void setItemStack(ItemStack newItem) {
newItem = newItem.clone(); newItem = newItem.clone();
newItem.setAmount(1); newItem.setAmount(1);
@ -25,13 +34,4 @@ public class ItemFrameWatcher extends FlagWatcher {
sendData(2); sendData(2);
} }
public int getItemRotation() {
return (Integer) getValue(3, 0);
}
public void setItemRotation(int rotation) {
setValue(3, (byte) (rotation % 4));
sendData(3);
}
} }

View File

@ -21,11 +21,6 @@ public class WolfWatcher extends AgeableWatcher {
return (String) getValue(17, ""); return (String) getValue(17, "");
} }
public void setOwner(String owner) {
setValue(17, owner);
sendData(17);
}
public boolean isAngry() { public boolean isAngry() {
return isTrue(2); return isTrue(2);
} }
@ -68,6 +63,11 @@ public class WolfWatcher extends AgeableWatcher {
sendData(18); sendData(18);
} }
public void setOwner(String owner) {
setValue(17, owner);
sendData(17);
}
public void setSitting(boolean sitting) { public void setSitting(boolean sitting) {
setFlag(1, sitting); setFlag(1, sitting);
} }