From 091166f090fcffc0c5f37b7019b5748206fcbbbf Mon Sep 17 00:00:00 2001 From: CoderTim Date: Tue, 27 May 2014 17:49:45 -0400 Subject: [PATCH] Refactored disguises to use EntityType --- .../disguise/disguises/DisguiseAgeable.java | 6 ++-- .../disguise/disguises/DisguiseAnimal.java | 6 ++-- .../core/disguise/disguises/DisguiseBat.java | 10 ++---- .../disguise/disguises/DisguiseBlaze.java | 10 ++---- .../core/disguise/disguises/DisguiseCat.java | 10 ++---- .../disguise/disguises/DisguiseChicken.java | 10 ++---- .../core/disguise/disguises/DisguiseCow.java | 10 ++---- .../disguise/disguises/DisguiseCreature.java | 17 +++++++--- .../disguise/disguises/DisguiseCreeper.java | 10 ++---- .../disguise/disguises/DisguiseEnderman.java | 9 ++--- .../disguise/disguises/DisguiseGolem.java | 6 ++-- .../disguise/disguises/DisguiseHorse.java | 10 ++---- .../disguise/disguises/DisguiseIronGolem.java | 10 ++---- .../disguise/disguises/DisguiseMonster.java | 6 ++-- .../core/disguise/disguises/DisguisePig.java | 10 ++---- .../disguise/disguises/DisguisePigZombie.java | 10 ++---- .../disguise/disguises/DisguiseSheep.java | 9 ++--- .../disguise/disguises/DisguiseSkeleton.java | 9 ++--- .../disguise/disguises/DisguiseSnowman.java | 10 ++---- .../disguise/disguises/DisguiseSpider.java | 34 ++++++++----------- .../disguise/disguises/DisguiseSquid.java | 10 ++---- .../disguises/DisguiseTameableAnimal.java | 6 ++-- .../disguise/disguises/DisguiseWitch.java | 10 ++---- .../core/disguise/disguises/DisguiseWolf.java | 9 ++--- .../disguise/disguises/DisguiseZombie.java | 15 ++++---- 25 files changed, 101 insertions(+), 161 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAgeable.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAgeable.java index a048acf9d..0fe8c7811 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAgeable.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAgeable.java @@ -1,10 +1,12 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public abstract class DisguiseAgeable extends DisguiseCreature { - public DisguiseAgeable(org.bukkit.entity.Entity entity) + public DisguiseAgeable(EntityType disguiseType, org.bukkit.entity.Entity entity) { - super(entity); + super(disguiseType, entity); DataWatcher.a(12, new Integer(0)); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimal.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimal.java index 75c0b2770..e65ff3d5f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimal.java @@ -1,9 +1,11 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public abstract class DisguiseAnimal extends DisguiseAgeable { - public DisguiseAnimal(org.bukkit.entity.Entity entity) + public DisguiseAnimal(EntityType disguiseType, org.bukkit.entity.Entity entity) { - super(entity); + super(disguiseType, entity); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBat.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBat.java index 8788d0702..05e41c469 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBat.java @@ -1,10 +1,12 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguiseBat extends DisguiseAnimal { public DisguiseBat(org.bukkit.entity.Entity entity) { - super(entity); + super(EntityType.BAT, entity); DataWatcher.a(16, new Byte((byte)0)); } @@ -23,12 +25,6 @@ public class DisguiseBat extends DisguiseAnimal DataWatcher.watch(16, Byte.valueOf((byte)(i & 0xFFFFFFFE))); } - @Override - protected int GetEntityTypeId() - { - return 65; - } - public String getHurtSound() { return "mob.bat.hurt"; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlaze.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlaze.java index a27b023a7..19e57b290 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlaze.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlaze.java @@ -1,19 +1,15 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguiseBlaze extends DisguiseMonster { public DisguiseBlaze(org.bukkit.entity.Entity entity) { - super(entity); + super(EntityType.BLAZE, entity); DataWatcher.a(16, new Byte((byte)0)); } - - @Override - protected int GetEntityTypeId() - { - return 61; - } public boolean bT() { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCat.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCat.java index ea7ffcfb5..e21a4ffc8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCat.java @@ -1,10 +1,12 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguiseCat extends DisguiseTameableAnimal { public DisguiseCat(org.bukkit.entity.Entity entity) { - super(entity); + super(EntityType.OCELOT, entity); DataWatcher.a(18, Byte.valueOf((byte)0)); } @@ -19,12 +21,6 @@ public class DisguiseCat extends DisguiseTameableAnimal DataWatcher.watch(18, Byte.valueOf((byte)i)); } - @Override - protected int GetEntityTypeId() - { - return 98; - } - protected String getHurtSound() { return "mob.cat.hitt"; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseChicken.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseChicken.java index fbebe6472..f55c6d707 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseChicken.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseChicken.java @@ -1,16 +1,12 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguiseChicken extends DisguiseAnimal { public DisguiseChicken(org.bukkit.entity.Entity entity) { - super(entity); - } - - @Override - protected int GetEntityTypeId() - { - return 93; + super(EntityType.CHICKEN, entity); } public String getHurtSound() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCow.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCow.java index 41c5c7168..86b1dc192 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCow.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCow.java @@ -1,16 +1,12 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguiseCow extends DisguiseAnimal { public DisguiseCow(org.bukkit.entity.Entity entity) { - super(entity); - } - - @Override - protected int GetEntityTypeId() - { - return 92; + super(EntityType.COW, entity); } public String getHurtSound() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreature.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreature.java index 6bdffc7d0..6c9feade2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreature.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreature.java @@ -4,21 +4,30 @@ import net.minecraft.server.v1_7_R3.EnumEntitySize; import net.minecraft.server.v1_7_R3.MathHelper; import net.minecraft.server.v1_7_R3.Packet; import net.minecraft.server.v1_7_R3.PacketPlayOutSpawnEntityLiving; +import org.bukkit.entity.*; public abstract class DisguiseCreature extends DisguiseInsentient { - public DisguiseCreature(org.bukkit.entity.Entity entity) + private final EntityType _disguiseType; + + public DisguiseCreature(EntityType disguiseType, org.bukkit.entity.Entity entity) { super(entity); + + _disguiseType = disguiseType; } - protected abstract int GetEntityTypeId(); - + public EntityType getDisguiseType() + { + return _disguiseType; + } + + @SuppressWarnings("deprecation") public Packet GetSpawnPacket() { PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(); packet.a = Entity.getId(); - packet.b = (byte) GetEntityTypeId(); + packet.b = (byte) getDisguiseType().getTypeId(); packet.c = (int)EnumEntitySize.SIZE_2.a(Entity.locX); packet.d = (int)MathHelper.floor(Entity.locY * 32.0D); packet.e = (int)EnumEntitySize.SIZE_2.a(Entity.locZ); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreeper.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreeper.java index 1d71e8f7a..2eaf7b2ef 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreeper.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreeper.java @@ -1,20 +1,16 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguiseCreeper extends DisguiseMonster { public DisguiseCreeper(org.bukkit.entity.Entity entity) { - super(entity); + super(EntityType.CREEPER, entity); DataWatcher.a(16, Byte.valueOf((byte)-1)); DataWatcher.a(17, Byte.valueOf((byte)0)); } - - @Override - protected int GetEntityTypeId() - { - return 50; - } public boolean IsPowered() { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseEnderman.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseEnderman.java index 90e083f9d..a6e0374b9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseEnderman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseEnderman.java @@ -5,12 +5,13 @@ import java.util.Arrays; import net.minecraft.server.v1_7_R3.MobEffect; import net.minecraft.server.v1_7_R3.MobEffectList; import net.minecraft.server.v1_7_R3.PotionBrewer; +import org.bukkit.entity.*; public class DisguiseEnderman extends DisguiseMonster { public DisguiseEnderman(org.bukkit.entity.Entity entity) { - super(entity); + super(EntityType.ENDERMAN, entity); DataWatcher.a(16, new Byte((byte)0)); DataWatcher.a(17, new Byte((byte)0)); @@ -51,12 +52,6 @@ public class DisguiseEnderman extends DisguiseMonster DataWatcher.watch(18, Byte.valueOf((byte)(flag ? 1 : 0))); } - @Override - protected int GetEntityTypeId() - { - return 58; - } - protected String getHurtSound() { return "mob.endermen.hit"; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseGolem.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseGolem.java index 65e0ce28f..de5a8b1fd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseGolem.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseGolem.java @@ -1,9 +1,11 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public abstract class DisguiseGolem extends DisguiseCreature { - public DisguiseGolem(org.bukkit.entity.Entity entity) + public DisguiseGolem(EntityType disguiseType, org.bukkit.entity.Entity entity) { - super(entity); + super(disguiseType, entity); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHorse.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHorse.java index d5193697c..a5526300d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHorse.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHorse.java @@ -1,12 +1,12 @@ package mineplex.core.disguise.disguises; -import org.bukkit.entity.Horse; +import org.bukkit.entity.*; public class DisguiseHorse extends DisguiseAnimal { public DisguiseHorse(org.bukkit.entity.Entity entity) { - super(entity); + super(EntityType.HORSE, entity); DataWatcher.a(16, Integer.valueOf(0)); DataWatcher.a(19, Byte.valueOf((byte) 0)); @@ -15,12 +15,6 @@ public class DisguiseHorse extends DisguiseAnimal DataWatcher.a(22, Integer.valueOf(0)); } - @Override - protected int GetEntityTypeId() - { - return 100; - } - public void setType(Horse.Variant horseType) { DataWatcher.watch(19, Byte.valueOf((byte) horseType.ordinal())); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseIronGolem.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseIronGolem.java index 8fbb0a554..e063ef70b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseIronGolem.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseIronGolem.java @@ -1,19 +1,15 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguiseIronGolem extends DisguiseGolem { public DisguiseIronGolem(org.bukkit.entity.Entity entity) { - super(entity); + super(EntityType.IRON_GOLEM, entity); DataWatcher.a(16, Byte.valueOf((byte)0)); } - - @Override - protected int GetEntityTypeId() - { - return 99; - } public boolean bW() { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMonster.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMonster.java index 35a4974a7..d64c04a7d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMonster.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMonster.java @@ -1,9 +1,11 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public abstract class DisguiseMonster extends DisguiseCreature { - public DisguiseMonster(org.bukkit.entity.Entity entity) + public DisguiseMonster(EntityType disguiseType, org.bukkit.entity.Entity entity) { - super(entity); + super(disguiseType, entity); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePig.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePig.java index 281450a83..b2ce16dc1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePig.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePig.java @@ -1,16 +1,12 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguisePig extends DisguiseAnimal { public DisguisePig(org.bukkit.entity.Entity entity) { - super(entity); - } - - @Override - protected int GetEntityTypeId() - { - return 90; + super(EntityType.PIG, entity); } public String getHurtSound() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePigZombie.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePigZombie.java index cc36af9a4..259dfb163 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePigZombie.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePigZombie.java @@ -1,16 +1,12 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguisePigZombie extends DisguiseZombie { public DisguisePigZombie(org.bukkit.entity.Entity entity) { - super(entity); - } - - @Override - public int GetEntityTypeId() - { - return 57; + super(EntityType.PIG_ZOMBIE, entity); } protected String getHurtSound() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSheep.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSheep.java index ca8dd987f..c6d4cdb7d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSheep.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSheep.java @@ -1,21 +1,16 @@ package mineplex.core.disguise.disguises; import org.bukkit.DyeColor; +import org.bukkit.entity.*; public class DisguiseSheep extends DisguiseAnimal { public DisguiseSheep(org.bukkit.entity.Entity entity) { - super(entity); + super(EntityType.SHEEP, entity); DataWatcher.a(16, new Byte((byte)0)); } - - @Override - protected int GetEntityTypeId() - { - return 91; - } public boolean isSheared() { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSkeleton.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSkeleton.java index 47e794979..ca059118d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSkeleton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSkeleton.java @@ -1,21 +1,16 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; import org.bukkit.entity.Skeleton.SkeletonType; public class DisguiseSkeleton extends DisguiseMonster { public DisguiseSkeleton(org.bukkit.entity.Entity entity) { - super(entity); + super(EntityType.SKELETON, entity); DataWatcher.a(13, Byte.valueOf((byte)0)); } - - @Override - protected int GetEntityTypeId() - { - return 51; - } public void SetSkeletonType(SkeletonType skeletonType) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSnowman.java index 2238a6923..0c643e94d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSnowman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSnowman.java @@ -1,15 +1,11 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguiseSnowman extends DisguiseGolem { public DisguiseSnowman(org.bukkit.entity.Entity entity) { - super(entity); - } - - @Override - protected int GetEntityTypeId() - { - return 97; + super(EntityType.SNOWMAN, entity); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSpider.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSpider.java index 84afbfae7..6b56f55e0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSpider.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSpider.java @@ -1,15 +1,17 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguiseSpider extends DisguiseMonster { public DisguiseSpider(org.bukkit.entity.Entity entity) { - super(entity); - - DataWatcher.a(16, new Byte((byte)0)); + super(EntityType.SPIDER, entity); + + DataWatcher.a(16, new Byte((byte) 0)); } - - public boolean bT() + + public boolean bT() { return (DataWatcher.getByte(16) & 0x01) != 0; } @@ -17,23 +19,17 @@ public class DisguiseSpider extends DisguiseMonster public void a(boolean flag) { byte b0 = DataWatcher.getByte(16); - - if (flag) - b0 = (byte)(b0 | 0x1); + + if(flag) + b0 = (byte) (b0 | 0x1); else - b0 = (byte)(b0 & 0xFFFFFFFE); - + b0 = (byte) (b0 & 0xFFFFFFFE); + DataWatcher.watch(16, Byte.valueOf(b0)); } - - @Override - protected int GetEntityTypeId() + + protected String getHurtSound() { - return 52; + return "mob.spider.say"; } - - protected String getHurtSound() - { - return "mob.spider.say"; - } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSquid.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSquid.java index 2408f6d6f..68f6d6dbb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSquid.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSquid.java @@ -1,10 +1,12 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguiseSquid extends DisguiseMonster { public DisguiseSquid(org.bukkit.entity.Entity entity) { - super(entity); + super(EntityType.SQUID, entity); DataWatcher.a(16, new Byte((byte)0)); } @@ -26,12 +28,6 @@ public class DisguiseSquid extends DisguiseMonster DataWatcher.watch(16, Byte.valueOf(b0)); } - @Override - protected int GetEntityTypeId() - { - return 94; - } - protected String getHurtSound() { return "damage.hit"; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseTameableAnimal.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseTameableAnimal.java index 97b976210..015fc3b38 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseTameableAnimal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseTameableAnimal.java @@ -1,10 +1,12 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public abstract class DisguiseTameableAnimal extends DisguiseAnimal { - public DisguiseTameableAnimal(org.bukkit.entity.Entity entity) + public DisguiseTameableAnimal(EntityType disguiseType, org.bukkit.entity.Entity entity) { - super(entity); + super(disguiseType, entity); DataWatcher.a(16, Byte.valueOf((byte)0)); DataWatcher.a(17, ""); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWitch.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWitch.java index 642a47c80..1de832596 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWitch.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWitch.java @@ -1,19 +1,15 @@ package mineplex.core.disguise.disguises; +import org.bukkit.entity.*; + public class DisguiseWitch extends DisguiseMonster { public DisguiseWitch(org.bukkit.entity.Entity entity) { - super(entity); + super(EntityType.WITCH, entity); DataWatcher.a(21, Byte.valueOf((byte)0)); } - - @Override - protected int GetEntityTypeId() - { - return 66; - } public String getHurtSound() { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWolf.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWolf.java index 7d575f44e..cb46cf24e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWolf.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWolf.java @@ -1,12 +1,13 @@ package mineplex.core.disguise.disguises; import net.minecraft.server.v1_7_R3.BlockCloth; +import org.bukkit.entity.*; public class DisguiseWolf extends DisguiseTameableAnimal { public DisguiseWolf(org.bukkit.entity.Entity entity) { - super(entity); + super(EntityType.WOLF, entity); DataWatcher.a(18, new Float(20F)); DataWatcher.a(19, new Byte((byte)0)); @@ -51,12 +52,6 @@ public class DisguiseWolf extends DisguiseTameableAnimal return DataWatcher.getByte(19) == 1; } - @Override - protected int GetEntityTypeId() - { - return 95; - } - protected String getHurtSound() { return "mob.wolf.hurt"; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseZombie.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseZombie.java index ba0ad9a54..ca8f9355e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseZombie.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseZombie.java @@ -1,23 +1,22 @@ package mineplex.core.disguise.disguises; -import org.bukkit.entity.Entity; +import org.bukkit.entity.*; public class DisguiseZombie extends DisguiseMonster { public DisguiseZombie(Entity entity) { - super(entity); + this(EntityType.ZOMBIE, entity); + } + + public DisguiseZombie(EntityType disguiseType, Entity entity) + { + super(disguiseType, entity); DataWatcher.a(12, Byte.valueOf((byte)0)); DataWatcher.a(13, Byte.valueOf((byte)0)); DataWatcher.a(14, Byte.valueOf((byte)0)); } - - @Override - protected int GetEntityTypeId() - { - return 54; - } public boolean IsBaby() {