Added more disguising for horses

This commit is contained in:
Andrew 2013-07-09 15:01:24 +12:00
parent 0351974760
commit 9b0f7ba6c7
8 changed files with 82 additions and 7 deletions

View File

@ -99,6 +99,14 @@ public class Disguise {
name = "Skeleton";
} else if (disguiseType == DisguiseType.PRIMED_TNT) {
name = "TNTPrimed";
} else if (disguiseType == DisguiseType.DONKEY) {
name = "Horse";
} else if (disguiseType == DisguiseType.MULE) {
name = "Horse";
} else if (disguiseType == DisguiseType.ZOMBIE_HORSE) {
name = "Horse";
} else if (disguiseType == DisguiseType.SKELETON_HORSE) {
name = "Horse";
} else if (disguiseType == DisguiseType.MINECART_TNT) {
name = "MinecartTNT";
} else if (disguiseType == DisguiseType.SPLASH_POTION)

View File

@ -17,6 +17,8 @@ public enum DisguiseType {
CREEPER(EntityType.MOB),
DONKEY(EntityType.MOB),
DROPPED_ITEM(EntityType.MISC, 2, 1),
EGG(EntityType.MISC, 62),
@ -65,6 +67,8 @@ public enum DisguiseType {
MINECART_TNT(EntityType.MISC, 10, 3),
MULE(EntityType.MOB),
MUSHROOM_COW(EntityType.MOB),
OCELOT(EntityType.MOB),
@ -85,6 +89,8 @@ public enum DisguiseType {
SKELETON(EntityType.MOB),
SKELETON_HORSE(EntityType.MOB),
SLIME(EntityType.MOB),
SMALL_FIREBALL(EntityType.MISC, 64, 0),
@ -113,7 +119,9 @@ public enum DisguiseType {
WOLF(EntityType.MOB),
ZOMBIE(EntityType.MOB);
ZOMBIE(EntityType.MOB),
ZOMBIE_HORSE(EntityType.MOB);
public static enum EntityType {
MISC, MOB, PLAYER;

View File

@ -23,6 +23,8 @@ public enum WatcherValues {
CREEPER(16, (byte) 0, 17, (byte) 0),
DONKEY(12, 0, 16, 0, 19, (byte) 0, 20, 0, 21, "", 22, 0),
DROPPED_ITEM(10, CraftItemStack.asNMSCopy(new ItemStack(1))),
EGG(),
@ -71,6 +73,8 @@ public enum WatcherValues {
MINECART_TNT(16, (byte) 0, 17, 0, 18, 1, 19, 0, 20, 0, 21, 6, 22, (byte) 0),
MULE(12, 0, 16, 0, 19, (byte) 0, 20, 0, 21, "", 22, 0),
MUSHROOM_COW(12, 0),
OCELOT(12, 0, 16, (byte) 0, 17, "", 18, (byte) 0),
@ -91,6 +95,8 @@ public enum WatcherValues {
SKELETON(13, (byte) 0),
SKELETON_HORSE(12, 0, 16, 0, 19, (byte) 0, 20, 0, 21, "", 22, 0),
SLIME(16, (byte) 0, 18, (byte) 0),
SMALL_FIREBALL(),
@ -119,7 +125,9 @@ public enum WatcherValues {
WOLF(16, (byte) 0, 17, "", 18, 8F, 19, (byte) 0, 20, (byte) 14),
ZOMBIE(12, (byte) 0, 13, (byte) 0);
ZOMBIE(12, (byte) 0, 13, (byte) 0),
ZOMBIE_HORSE(12, 0, 16, 0, 19, (byte) 0, 20, 0, 21, "", 22, 0);
private HashMap<Integer, Object> values = new HashMap<Integer, Object>();
private WatcherValues(Object... obj) {

View File

@ -0,0 +1,10 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
public class DonkeyWatcher extends HorseWatcher {
public DonkeyWatcher(int entityId) {
super(entityId);
setHorseType(1);
}
}

View File

@ -1,5 +1,7 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import java.util.Random;
public class HorseWatcher extends AgeableWatcher {
public HorseWatcher(int entityId) {
@ -12,18 +14,27 @@ public class HorseWatcher extends AgeableWatcher {
// Zombie
// Skeleton
setValue(19, (byte) 0);
setValue(20, 0);
setValue(20, new Random().nextInt(9));
setValue(21, "");
setValue(22, 0);
}
public int getColoring() {
return (Integer) getValue(20);
}
public int getHorseType() {
return (int) (Byte) getValue(19);
}
public void setColoring(int color) {
setValue(20, color);
sendData(20);
}
public void setHorseType(int type) {
setValue(19, (byte) type);
sendData(19);
}
public int getHorseType() {
return (int) (Byte) getValue(19);
}
}

View File

@ -0,0 +1,10 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
public class MuleWatcher extends HorseWatcher {
public MuleWatcher(int entityId) {
super(entityId);
setHorseType(2);
}
}

View File

@ -0,0 +1,10 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
public class SkeletonHorseWatcher extends HorseWatcher {
public SkeletonHorseWatcher(int entityId) {
super(entityId);
setHorseType(4);
}
}

View File

@ -0,0 +1,10 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
public class ZombieHorseWatcher extends HorseWatcher {
public ZombieHorseWatcher(int entityId) {
super(entityId);
setHorseType(3);
}
}