commit
5a3c83882a
3 changed files with 10 additions and 2 deletions
|
@ -307,7 +307,12 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
|
||||||
|
|
||||||
// Use chesteplate property for 1.14 and above
|
// Use chesteplate property for 1.14 and above
|
||||||
if (ver.isOlderThan(ServerVersion.V_1_14)) {
|
if (ver.isOlderThan(ServerVersion.V_1_14)) {
|
||||||
register(new EncodedIntegerProperty<>("horse_armor", HorseArmor.NONE, horseVariantIndex + 2, Enum::ordinal));
|
int horseArmorIndex;
|
||||||
|
if (ver.isNewerThanOrEquals(ServerVersion.V_1_11)) horseArmorIndex = 16;
|
||||||
|
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_10)) horseArmorIndex = 17;
|
||||||
|
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_9)) horseArmorIndex = 16;
|
||||||
|
else horseArmorIndex = 22;
|
||||||
|
register(new EncodedIntegerProperty<>("horse_armor", HorseArmor.NONE, horseArmorIndex, Enum::ordinal));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chested Horse
|
// Chested Horse
|
||||||
|
|
|
@ -132,6 +132,9 @@ public class NpcTypeImpl implements NpcType {
|
||||||
if (EntityTypes.isTypeInstanceOf(type, EntityTypes.ABSTRACT_HORSE)) {
|
if (EntityTypes.isTypeInstanceOf(type, EntityTypes.ABSTRACT_HORSE)) {
|
||||||
addProperties("is_saddled", "is_eating", "is_rearing", "has_mouth_open");
|
addProperties("is_saddled", "is_eating", "is_rearing", "has_mouth_open");
|
||||||
}
|
}
|
||||||
|
if (type.equals(EntityTypes.HORSE) && version.isOlderThan(ServerVersion.V_1_14)) {
|
||||||
|
addProperties("horse_armor");
|
||||||
|
}
|
||||||
if (EntityTypes.isTypeInstanceOf(type, EntityTypes.CHESTED_HORSE)) {
|
if (EntityTypes.isTypeInstanceOf(type, EntityTypes.CHESTED_HORSE)) {
|
||||||
addProperties("has_chest");
|
addProperties("has_chest");
|
||||||
} else if (version.isOlderThan(ServerVersion.V_1_11) && type.equals(EntityTypes.HORSE)) {
|
} else if (version.isOlderThan(ServerVersion.V_1_11) && type.equals(EntityTypes.HORSE)) {
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class V1_8PacketFactory implements PacketFactory {
|
||||||
ClientVersion clientVersion = packetEvents.getServerManager().getVersion().toClientVersion();
|
ClientVersion clientVersion = packetEvents.getServerManager().getVersion().toClientVersion();
|
||||||
sendPacket(player, type.getLegacyId(clientVersion) == -1 ?
|
sendPacket(player, type.getLegacyId(clientVersion) == -1 ?
|
||||||
new WrapperPlayServerSpawnLivingEntity(entity.getEntityId(), entity.getUuid(), type, npcLocationToVector(location),
|
new WrapperPlayServerSpawnLivingEntity(entity.getEntityId(), entity.getUuid(), type, npcLocationToVector(location),
|
||||||
location.getYaw(), location.getPitch(), location.getPitch(), new Vector3d(), Collections.emptyList()) :
|
location.getYaw(), location.getPitch(), location.getYaw(), new Vector3d(), Collections.emptyList()) :
|
||||||
new WrapperPlayServerSpawnEntity(entity.getEntityId(), Optional.of(entity.getUuid()), entity.getType(), npcLocationToVector(location),
|
new WrapperPlayServerSpawnEntity(entity.getEntityId(), Optional.of(entity.getUuid()), entity.getType(), npcLocationToVector(location),
|
||||||
location.getPitch(), location.getYaw(), location.getYaw(), 0, Optional.empty()));
|
location.getPitch(), location.getYaw(), location.getYaw(), 0, Optional.empty()));
|
||||||
sendAllMetadata(player, entity, properties);
|
sendAllMetadata(player, entity, properties);
|
||||||
|
|
Loading…
Reference in a new issue