From 447e5cf553d9a8d7ecaad142760eaebfc426369f Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 4 Jul 2013 00:39:36 +1200 Subject: [PATCH] Updated datawatcher values for 1.6.1 --- .../disguise/DisguiseTypes/WatcherValues.java | 4 +- .../DisguiseTypes/Watchers/BoatWatcher.java | 2 +- .../DisguiseTypes/Watchers/LivingWatcher.java | 37 +++++++------------ .../DisguiseTypes/Watchers/PlayerWatcher.java | 22 +++++++++++ .../DisguiseTypes/Watchers/WolfWatcher.java | 11 ++++-- 5 files changed, 46 insertions(+), 30 deletions(-) create mode 100644 src/me/libraryaddict/disguise/DisguiseTypes/Watchers/PlayerWatcher.java diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/WatcherValues.java b/src/me/libraryaddict/disguise/DisguiseTypes/WatcherValues.java index 167c8c68..bd0ff9c5 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/WatcherValues.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/WatcherValues.java @@ -16,9 +16,9 @@ public enum WatcherValues { 16, (byte) 0, 17, 0, 18, 1, 19, 0, 20, 0, 21, 6, 22, (byte) 0), MINECART_RIDEABLE(16, (byte) 0, 17, 0, 18, 1, 19, 0, 20, 0, 21, 6, 22, (byte) 0), MINECART_TNT(16, (byte) 0, 17, 0, 18, 1, 19, 0, 20, 0, 21, 6, 22, (byte) 0), MUSHROOM_COW( 12, 0), OCELOT(12, 0, 16, (byte) 0, 17, "", 18, (byte) 0), PAINTING(), PIG(12, 0, 16, (byte) 0), PIG_ZOMBIE(12, - (byte) 0), PLAYER(8, 0, 9, (byte) 0, 10, (byte) 0, 13, 0), PRIMED_TNT(), SHEEP(12, 0, 16, (byte) 0), SILVERFISH(), SKELETON( + (byte) 0), PLAYER(8, 0, 9, (byte) 0, 10, (byte) 0, 13, 0, 18, 0), PRIMED_TNT(), SHEEP(12, 0, 16, (byte) 0), SILVERFISH(), SKELETON( 13, (byte) 0), SLIME(16, (byte) 0, 18, (byte) 0), SMALL_FIREBALL(), SNOWBALL(), SNOWMAN(), SPIDER(), SPLASH_POTION(), SQUID(), THROWN_EXP_BOTTLE(), VILLAGER( - 16, 0), WITCH(), WITHER(16, 300), WITHER_SKELETON(13, (byte) 1), WITHER_SKULL(), WOLF(16, (byte) 0, 17, "", 18, 8, + 16, 0), WITCH(), WITHER(16, 300), WITHER_SKELETON(13, (byte) 1), WITHER_SKULL(), WOLF(16, (byte) 0, 17, "", 18, 8F, 19, (byte) 0, 20, (byte) 14), ZOMBIE(12, (byte) 0, 13, (byte) 0); private HashMap values = new HashMap(); diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/BoatWatcher.java b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/BoatWatcher.java index 46a0c33e..eafaf82d 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/BoatWatcher.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/BoatWatcher.java @@ -6,9 +6,9 @@ public class BoatWatcher extends FlagWatcher { public BoatWatcher(int entityId) { super(entityId); - setValue(19, 40); setValue(17, 10); setValue(18, 0); + setValue(19, 40); } public void setDamage(int dmg) { diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/LivingWatcher.java b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/LivingWatcher.java index 459a6494..73741992 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/LivingWatcher.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/LivingWatcher.java @@ -16,8 +16,8 @@ public class LivingWatcher extends FlagWatcher { public LivingWatcher(int entityId) { super(entityId); - setValue(5, ""); - setValue(6, (byte) 0); + setValue(10, ""); + setValue(11, (byte) 0); } public void addPotionEffect(PotionEffect potionEffect) { @@ -27,16 +27,12 @@ public class LivingWatcher extends FlagWatcher { sendPotionEffects(); } - public int getArrowsSticking() { - return (Byte) getValue(10); - } - public String getCustomName() { - return (String) getValue(5); + return (String) getValue(10); } public boolean getPotionParticlesRemoved() { - return (Byte) getValue(9) == 1; + return (Byte) getValue(8) == 1; } public boolean hasCustomName() { @@ -64,34 +60,27 @@ public class LivingWatcher extends FlagWatcher { public void removePotionParticles(boolean particles) { if (particles != getPotionParticlesRemoved()) { - setValue(9, (byte) (particles ? 1 : 0)); - sendData(9); + setValue(8, (byte) (particles ? 1 : 0)); + sendData(8); } } private void sendPotionEffects() { - setValue(8, PotionBrewer.a(potionEffects)); - sendData(8); - } - - public void setArrowsSticking(int arrowsNo) { - if (arrowsNo != getArrowsSticking()) { - setValue(10, (byte) arrowsNo); - sendData(10); - } + setValue(7, PotionBrewer.a(potionEffects)); + sendData(7); } public void setCustomName(String name) { if (!getCustomName().equals(name)) { - setValue(5, name); - sendData(5); + setValue(10, name); + sendData(10); } } public void setCustomNameVisible(boolean display) { - if ((Byte) getValue(6) != (display ? 1 : 0)) { - setValue(6, (byte) (display ? 1 : 0)); - sendData(6); + if ((Byte) getValue(11) != (display ? 1 : 0)) { + setValue(11, (byte) (display ? 1 : 0)); + sendData(11); } } diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/PlayerWatcher.java b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/PlayerWatcher.java new file mode 100644 index 00000000..4e29daae --- /dev/null +++ b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/PlayerWatcher.java @@ -0,0 +1,22 @@ +package me.libraryaddict.disguise.DisguiseTypes.Watchers; + +public class PlayerWatcher extends LivingWatcher { + + public PlayerWatcher(int entityId) { + super(entityId); + setValue(9, (byte) 0); + setValue(18, 0); + } + + public int getArrowsSticking() { + return (Byte) getValue(9); + } + + public void setArrowsSticking(int arrowsNo) { + if (arrowsNo != getArrowsSticking()) { + setValue(9, (byte) arrowsNo); + sendData(9); + } + } + +} diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/WolfWatcher.java b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/WolfWatcher.java index a5c45c5e..33c61e60 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/WolfWatcher.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/WolfWatcher.java @@ -12,7 +12,7 @@ public class WolfWatcher extends AgeableWatcher { super(entityId); setValue(16, (byte) 0); setValue(17, ""); - setValue(18, 8); + setValue(18, 8F); setValue(19, (byte) 0); setValue(20, (byte) collarColor.getId()); } @@ -21,8 +21,8 @@ public class WolfWatcher extends AgeableWatcher { return collarColor; } - public int getHealth() { - return (Integer) getValue(18); + public float getHealth() { + return (Float) getValue(18); } public String getName() { @@ -69,6 +69,11 @@ public class WolfWatcher extends AgeableWatcher { updateStatus(); } } + + public void setHealth(float newHealth) { + setValue(18, newHealth); + sendData(18); + } private void updateStatus() { setValue(16, (byte) ((isTamed ? 4 : 0) + (isSitting ? 1 : 0) + (isAgressive ? 2 : 0)));