Update entity types.

This commit is contained in:
Steven Smith 2015-08-22 16:55:29 -07:00
parent 447fb16447
commit ea99836709
5 changed files with 20 additions and 17 deletions

View file

@ -282,6 +282,8 @@ public class MagicValues {
register(GlobalEntityType.LIGHTNING_BOLT, 1); register(GlobalEntityType.LIGHTNING_BOLT, 1);
register(MobType.ARMOR_STAND, 30); register(MobType.ARMOR_STAND, 30);
register(MobType.MOB, 48);
register(MobType.MONSTER, 49);
register(MobType.CREEPER, 50); register(MobType.CREEPER, 50);
register(MobType.SKELETON, 51); register(MobType.SKELETON, 51);
register(MobType.SPIDER, 52); register(MobType.SPIDER, 52);
@ -301,6 +303,7 @@ public class MagicValues {
register(MobType.WITCH, 66); register(MobType.WITCH, 66);
register(MobType.ENDERMITE, 67); register(MobType.ENDERMITE, 67);
register(MobType.GUARDIAN, 68); register(MobType.GUARDIAN, 68);
register(MobType.SHULKER, 69);
register(MobType.PIG, 90); register(MobType.PIG, 90);
register(MobType.SHEEP, 91); register(MobType.SHEEP, 91);
register(MobType.COW, 92); register(MobType.COW, 92);
@ -317,6 +320,7 @@ public class MagicValues {
register(ObjectType.BOAT, 1); register(ObjectType.BOAT, 1);
register(ObjectType.ITEM, 2); register(ObjectType.ITEM, 2);
register(ObjectType.AREA_EFFECT_CLOUD, 3);
register(ObjectType.MINECART, 10); register(ObjectType.MINECART, 10);
register(ObjectType.PRIMED_TNT, 50); register(ObjectType.PRIMED_TNT, 50);
register(ObjectType.ENDER_CRYSTAL, 51); register(ObjectType.ENDER_CRYSTAL, 51);
@ -327,6 +331,7 @@ public class MagicValues {
register(ObjectType.BLAZE_FIREBALL, 64); register(ObjectType.BLAZE_FIREBALL, 64);
register(ObjectType.ENDER_PEARL, 65); register(ObjectType.ENDER_PEARL, 65);
register(ObjectType.WITHER_HEAD_PROJECTILE, 66); register(ObjectType.WITHER_HEAD_PROJECTILE, 66);
register(ObjectType.SHULKER_BULLET, 67);
register(ObjectType.FALLING_BLOCK, 70); register(ObjectType.FALLING_BLOCK, 70);
register(ObjectType.ITEM_FRAME, 71); register(ObjectType.ITEM_FRAME, 71);
register(ObjectType.EYE_OF_ENDER, 72); register(ObjectType.EYE_OF_ENDER, 72);
@ -337,6 +342,9 @@ public class MagicValues {
register(ObjectType.LEASH_KNOT, 77); register(ObjectType.LEASH_KNOT, 77);
register(ObjectType.ARMOR_STAND, 78); register(ObjectType.ARMOR_STAND, 78);
register(ObjectType.FISH_HOOK, 90); register(ObjectType.FISH_HOOK, 90);
register(ObjectType.SPECTRAL_ARROW, 91);
register(ObjectType.TIPPED_ARROW, 92);
register(ObjectType.DRAGON_FIREBALL, 93);
register(MinecartType.NORMAL, 0); register(MinecartType.NORMAL, 0);
register(MinecartType.CHEST, 1); register(MinecartType.CHEST, 1);

View file

@ -1,8 +1,9 @@
package org.spacehq.mc.protocol.data.game.values.entity; package org.spacehq.mc.protocol.data.game.values.entity;
public enum MobType { public enum MobType {
ARMOR_STAND, ARMOR_STAND,
MOB,
MONSTER,
CREEPER, CREEPER,
SKELETON, SKELETON,
SPIDER, SPIDER,
@ -22,6 +23,7 @@ public enum MobType {
WITCH, WITCH,
ENDERMITE, ENDERMITE,
GUARDIAN, GUARDIAN,
SHULKER,
PIG, PIG,
SHEEP, SHEEP,
COW, COW,
@ -35,5 +37,4 @@ public enum MobType {
HORSE, HORSE,
RABBIT, RABBIT,
VILLAGER; VILLAGER;
} }

View file

@ -1,9 +1,9 @@
package org.spacehq.mc.protocol.data.game.values.entity; package org.spacehq.mc.protocol.data.game.values.entity;
public enum ObjectType { public enum ObjectType {
BOAT, BOAT,
ITEM, ITEM,
AREA_EFFECT_CLOUD,
MINECART, MINECART,
PRIMED_TNT, PRIMED_TNT,
ENDER_CRYSTAL, ENDER_CRYSTAL,
@ -14,6 +14,7 @@ public enum ObjectType {
BLAZE_FIREBALL, BLAZE_FIREBALL,
ENDER_PEARL, ENDER_PEARL,
WITHER_HEAD_PROJECTILE, WITHER_HEAD_PROJECTILE,
SHULKER_BULLET,
FALLING_BLOCK, FALLING_BLOCK,
ITEM_FRAME, ITEM_FRAME,
EYE_OF_ENDER, EYE_OF_ENDER,
@ -23,6 +24,8 @@ public enum ObjectType {
FIREWORK_ROCKET, FIREWORK_ROCKET,
LEASH_KNOT, LEASH_KNOT,
ARMOR_STAND, ARMOR_STAND,
FISH_HOOK; FISH_HOOK,
SPECTRAL_ARROW,
TIPPED_ARROW,
DRAGON_FIREBALL;
} }

View file

@ -1,7 +1,6 @@
package org.spacehq.mc.protocol.data.game.values.entity; package org.spacehq.mc.protocol.data.game.values.entity;
public class ProjectileData implements ObjectData { public class ProjectileData implements ObjectData {
private int ownerId; private int ownerId;
public ProjectileData(int ownerId) { public ProjectileData(int ownerId) {
@ -14,19 +13,11 @@ public class ProjectileData implements ObjectData {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if(this == o) return true; return this == o || (o instanceof ProjectileData && this.ownerId == ((ProjectileData) o).ownerId);
if(o == null || getClass() != o.getClass()) return false;
ProjectileData that = (ProjectileData) o;
if(ownerId != that.ownerId) return false;
return true;
} }
@Override @Override
public int hashCode() { public int hashCode() {
return ownerId; return this.ownerId;
} }
} }

View file

@ -130,7 +130,7 @@ public class ServerSpawnObjectPacket implements Packet {
this.data = new FallingBlockData(data & 65535, data >> 16); this.data = new FallingBlockData(data & 65535, data >> 16);
} else if(this.type == ObjectType.POTION) { } else if(this.type == ObjectType.POTION) {
this.data = new SplashPotionData(data); this.data = new SplashPotionData(data);
} else if(this.type == ObjectType.ARROW || this.type == ObjectType.BLAZE_FIREBALL || this.type == ObjectType.FISH_HOOK || this.type == ObjectType.GHAST_FIREBALL || this.type == ObjectType.WITHER_HEAD_PROJECTILE) { } else if(this.type == ObjectType.ARROW || this.type == ObjectType.SPECTRAL_ARROW || this.type == ObjectType.TIPPED_ARROW || this.type == ObjectType.GHAST_FIREBALL || this.type == ObjectType.BLAZE_FIREBALL || this.type == ObjectType.DRAGON_FIREBALL || this.type == ObjectType.WITHER_HEAD_PROJECTILE || this.type == ObjectType.FISH_HOOK) {
this.data = new ProjectileData(data); this.data = new ProjectileData(data);
} else { } else {
this.data = new ObjectData() { this.data = new ObjectData() {