mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-12-12 08:41:00 -05:00
Update entity types.
This commit is contained in:
parent
447fb16447
commit
ea99836709
5 changed files with 20 additions and 17 deletions
|
@ -282,6 +282,8 @@ public class MagicValues {
|
|||
register(GlobalEntityType.LIGHTNING_BOLT, 1);
|
||||
|
||||
register(MobType.ARMOR_STAND, 30);
|
||||
register(MobType.MOB, 48);
|
||||
register(MobType.MONSTER, 49);
|
||||
register(MobType.CREEPER, 50);
|
||||
register(MobType.SKELETON, 51);
|
||||
register(MobType.SPIDER, 52);
|
||||
|
@ -301,6 +303,7 @@ public class MagicValues {
|
|||
register(MobType.WITCH, 66);
|
||||
register(MobType.ENDERMITE, 67);
|
||||
register(MobType.GUARDIAN, 68);
|
||||
register(MobType.SHULKER, 69);
|
||||
register(MobType.PIG, 90);
|
||||
register(MobType.SHEEP, 91);
|
||||
register(MobType.COW, 92);
|
||||
|
@ -317,6 +320,7 @@ public class MagicValues {
|
|||
|
||||
register(ObjectType.BOAT, 1);
|
||||
register(ObjectType.ITEM, 2);
|
||||
register(ObjectType.AREA_EFFECT_CLOUD, 3);
|
||||
register(ObjectType.MINECART, 10);
|
||||
register(ObjectType.PRIMED_TNT, 50);
|
||||
register(ObjectType.ENDER_CRYSTAL, 51);
|
||||
|
@ -327,6 +331,7 @@ public class MagicValues {
|
|||
register(ObjectType.BLAZE_FIREBALL, 64);
|
||||
register(ObjectType.ENDER_PEARL, 65);
|
||||
register(ObjectType.WITHER_HEAD_PROJECTILE, 66);
|
||||
register(ObjectType.SHULKER_BULLET, 67);
|
||||
register(ObjectType.FALLING_BLOCK, 70);
|
||||
register(ObjectType.ITEM_FRAME, 71);
|
||||
register(ObjectType.EYE_OF_ENDER, 72);
|
||||
|
@ -337,6 +342,9 @@ public class MagicValues {
|
|||
register(ObjectType.LEASH_KNOT, 77);
|
||||
register(ObjectType.ARMOR_STAND, 78);
|
||||
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.CHEST, 1);
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package org.spacehq.mc.protocol.data.game.values.entity;
|
||||
|
||||
public enum MobType {
|
||||
|
||||
ARMOR_STAND,
|
||||
MOB,
|
||||
MONSTER,
|
||||
CREEPER,
|
||||
SKELETON,
|
||||
SPIDER,
|
||||
|
@ -22,6 +23,7 @@ public enum MobType {
|
|||
WITCH,
|
||||
ENDERMITE,
|
||||
GUARDIAN,
|
||||
SHULKER,
|
||||
PIG,
|
||||
SHEEP,
|
||||
COW,
|
||||
|
@ -35,5 +37,4 @@ public enum MobType {
|
|||
HORSE,
|
||||
RABBIT,
|
||||
VILLAGER;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package org.spacehq.mc.protocol.data.game.values.entity;
|
||||
|
||||
public enum ObjectType {
|
||||
|
||||
BOAT,
|
||||
ITEM,
|
||||
AREA_EFFECT_CLOUD,
|
||||
MINECART,
|
||||
PRIMED_TNT,
|
||||
ENDER_CRYSTAL,
|
||||
|
@ -14,6 +14,7 @@ public enum ObjectType {
|
|||
BLAZE_FIREBALL,
|
||||
ENDER_PEARL,
|
||||
WITHER_HEAD_PROJECTILE,
|
||||
SHULKER_BULLET,
|
||||
FALLING_BLOCK,
|
||||
ITEM_FRAME,
|
||||
EYE_OF_ENDER,
|
||||
|
@ -23,6 +24,8 @@ public enum ObjectType {
|
|||
FIREWORK_ROCKET,
|
||||
LEASH_KNOT,
|
||||
ARMOR_STAND,
|
||||
FISH_HOOK;
|
||||
|
||||
FISH_HOOK,
|
||||
SPECTRAL_ARROW,
|
||||
TIPPED_ARROW,
|
||||
DRAGON_FIREBALL;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.spacehq.mc.protocol.data.game.values.entity;
|
||||
|
||||
public class ProjectileData implements ObjectData {
|
||||
|
||||
private int ownerId;
|
||||
|
||||
public ProjectileData(int ownerId) {
|
||||
|
@ -14,19 +13,11 @@ public class ProjectileData implements ObjectData {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if(this == o) return true;
|
||||
if(o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
ProjectileData that = (ProjectileData) o;
|
||||
|
||||
if(ownerId != that.ownerId) return false;
|
||||
|
||||
return true;
|
||||
return this == o || (o instanceof ProjectileData && this.ownerId == ((ProjectileData) o).ownerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ownerId;
|
||||
return this.ownerId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ public class ServerSpawnObjectPacket implements Packet {
|
|||
this.data = new FallingBlockData(data & 65535, data >> 16);
|
||||
} else if(this.type == ObjectType.POTION) {
|
||||
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);
|
||||
} else {
|
||||
this.data = new ObjectData() {
|
||||
|
|
Loading…
Reference in a new issue