From 4ffb4a4489d39fcbd57b3e6e8357b5193c457423 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 30 May 2013 08:11:41 +1200 Subject: [PATCH] Fixed pig zombie crash --- .../disguise/DisguiseTypes/WatcherValues.java | 18 +++++++++--------- .../Watchers/PigZombieWatcher.java | 16 +++++++++++++++- .../DisguiseTypes/Watchers/ZombieWatcher.java | 16 +--------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/WatcherValues.java b/src/me/libraryaddict/disguise/DisguiseTypes/WatcherValues.java index a2301ba4..b04a7b19 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/WatcherValues.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/WatcherValues.java @@ -6,15 +6,15 @@ import java.util.Set; public enum WatcherValues { ARROW(16, (byte) 0), BAT(16, (byte) 0), BLAZE(16, (byte) 0), BOAT(19, 40, 17, 10, 18, 0), CAVE_SPIDER(), CHICKEN(12, 0), COW( 12, 0), CREEPER(16, (byte) 0, 17, (byte) 0), DROPPED_ITEM(), EGG(), ENDER_CRYSTAL(), ENDER_DRAGON(16, 300), ENDER_PEARL(), ENDER_SIGNAL(), ENDERMAN( - 16, (byte) 0, 17, (byte) 1, 18, (byte) 0), EXPERIENCE_ORB(), FALLING_BLOCK(), FIREBALL(), FIREWORKS(), FISHING_HOOK(), GHAST(16, - (byte) 0), GIANT(), IRON_GOLEM(), ITEM_FRAME(2, 5, 3, (byte) 0), MAGMA_CUBE(16, (byte) 0, - 18, (byte) 0), MINECART_CHEST(16, (byte) 0, 17, 0, 18, 1, 19, 0, 20, 0, 21, 6, 22, (byte) 0), MINECART_FURNACE(16, - (byte) 0, 17, 0, 18, 1, 19, 0, 20, 0, 21, 6, 22, (byte) 0), MINECART_HOPPER(16, (byte) 0, 17, 0, 18, 1, 19, 0, 20, 0, - 21, 6, 22, (byte) 0), MINECART_MOB_SPAWNER(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, 0), PLAYER(8, 0, 9, (byte) 0, 10, (byte) 0, 13, 0), PRIMED_TNT(), SHEEP( - 12, (byte) 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, (byte) 0, 17, (byte) 1, 18, (byte) 0), EXPERIENCE_ORB(), FALLING_BLOCK(), FIREBALL(), FIREWORKS(), FISHING_HOOK(), GHAST( + 16, (byte) 0), GIANT(), IRON_GOLEM(), ITEM_FRAME(2, 5, 3, (byte) 0), MAGMA_CUBE(16, (byte) 0, 18, (byte) 0), MINECART_CHEST( + 16, (byte) 0, 17, 0, 18, 1, 19, 0, 20, 0, 21, 6, 22, (byte) 0), MINECART_FURNACE(16, (byte) 0, 17, 0, 18, 1, 19, 0, + 20, 0, 21, 6, 22, (byte) 0), MINECART_HOPPER(16, (byte) 0, 17, 0, 18, 1, 19, 0, 20, 0, 21, 6, 22, (byte) 0), MINECART_MOB_SPAWNER( + 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, (byte) 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, 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/PigZombieWatcher.java b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/PigZombieWatcher.java index 3a55bb27..56cb314f 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/PigZombieWatcher.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/PigZombieWatcher.java @@ -1,9 +1,23 @@ package me.libraryaddict.disguise.DisguiseTypes.Watchers; -public class PigZombieWatcher extends AgeableWatcher { +import me.libraryaddict.disguise.DisguiseTypes.FlagWatcher; + +public class PigZombieWatcher extends FlagWatcher { public PigZombieWatcher(int entityId) { super(entityId); + setValue(12, (byte) 0); + } + + public boolean isBaby() { + return (Byte) getValue(12) == 1; + } + + public void setBaby(boolean baby) { + if (isBaby() != baby) { + setValue(12, (byte) (baby ? 1 : 0)); + sendData(12); + } } } diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/ZombieWatcher.java b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/ZombieWatcher.java index d6379e49..ed742a55 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/ZombieWatcher.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/ZombieWatcher.java @@ -1,30 +1,16 @@ package me.libraryaddict.disguise.DisguiseTypes.Watchers; -import me.libraryaddict.disguise.DisguiseTypes.FlagWatcher; - -public class ZombieWatcher extends FlagWatcher { +public class ZombieWatcher extends PigZombieWatcher { public ZombieWatcher(int entityId) { super(entityId); - setValue(12, (byte) 0); setValue(13, (byte) 0); } - public boolean isBaby() { - return (Byte) getValue(12) == 1; - } - public boolean isVillager() { return (Byte) getValue(13) == 1; } - public void setBaby(boolean baby) { - if (isBaby() != baby) { - setValue(12, (byte) (baby ? 1 : 0)); - sendData(12); - } - } - public void setVillager(boolean villager) { if (isVillager() != villager) { setValue(13, (byte) (villager ? 1 : 0));