Changed DisguiseType value fetching to EntityType as Itemframe isn't supported.
This commit is contained in:
parent
be3712ccd0
commit
ca913347ce
@ -23,6 +23,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.entity.Ageable;
|
import org.bukkit.entity.Ageable;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.ExperienceOrb;
|
import org.bukkit.entity.ExperienceOrb;
|
||||||
import org.bukkit.entity.Item;
|
import org.bukkit.entity.Item;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
@ -156,8 +157,7 @@ public class PacketsManager {
|
|||||||
spawnPackets[i + 2] = packets.get(i);
|
spawnPackets[i + 2] = packets.get(i);
|
||||||
}
|
}
|
||||||
Location loc = disguisedEntity.getLocation().clone().add(0, getYModifier(disguisedEntity, disguise.getType()), 0);
|
Location loc = disguisedEntity.getLocation().clone().add(0, getYModifier(disguisedEntity, disguise.getType()), 0);
|
||||||
byte yaw = getYaw(disguise.getType(), DisguiseType.getType(disguise.getEntity().getType()),
|
byte yaw = getYaw(disguise.getType(), disguise.getEntity().getType(), (byte) (int) (loc.getYaw() * 256.0F / 360.0F));
|
||||||
(byte) (int) (loc.getYaw() * 256.0F / 360.0F));
|
|
||||||
|
|
||||||
if (disguise.getType() == DisguiseType.EXPERIENCE_ORB) {
|
if (disguise.getType() == DisguiseType.EXPERIENCE_ORB) {
|
||||||
|
|
||||||
@ -345,7 +345,7 @@ public class PacketsManager {
|
|||||||
/**
|
/**
|
||||||
* Add the yaw for the disguises
|
* Add the yaw for the disguises
|
||||||
*/
|
*/
|
||||||
public static byte getYaw(DisguiseType disguiseType, DisguiseType entityType, byte value) {
|
public static byte getYaw(DisguiseType disguiseType, EntityType entityType, byte value) {
|
||||||
switch (disguiseType) {
|
switch (disguiseType) {
|
||||||
case MINECART:
|
case MINECART:
|
||||||
case MINECART_CHEST:
|
case MINECART_CHEST:
|
||||||
@ -393,7 +393,7 @@ public class PacketsManager {
|
|||||||
value = (byte) -(value - 128);
|
value = (byte) -(value - 128);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (entityType.isMisc()) {
|
if (!entityType.isAlive()) {
|
||||||
value += 64;
|
value += 64;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1172,7 +1172,7 @@ public class PacketsManager {
|
|||||||
packets[0] = sentPacket.shallowClone();
|
packets[0] = sentPacket.shallowClone();
|
||||||
StructureModifier<Object> mods = packets[0].getModifier();
|
StructureModifier<Object> mods = packets[0].getModifier();
|
||||||
byte yawValue = (Byte) mods.read(4);
|
byte yawValue = (Byte) mods.read(4);
|
||||||
mods.write(4, getYaw(disguise.getType(), DisguiseType.getType(entity.getType()), yawValue));
|
mods.write(4, getYaw(disguise.getType(), entity.getType(), yawValue));
|
||||||
byte pitchValue = (Byte) mods.read(5);
|
byte pitchValue = (Byte) mods.read(5);
|
||||||
mods.write(5, getPitch(disguise.getType(), DisguiseType.getType(entity.getType()), pitchValue));
|
mods.write(5, getPitch(disguise.getType(), DisguiseType.getType(entity.getType()), pitchValue));
|
||||||
if (sentPacket.getID() == Packets.Server.ENTITY_TELEPORT) {
|
if (sentPacket.getID() == Packets.Server.ENTITY_TELEPORT) {
|
||||||
|
Loading…
Reference in New Issue
Block a user