Exp packets shouldn't be in the velocity group

This commit is contained in:
libraryaddict 2014-05-24 05:02:17 +12:00
parent 999c80076d
commit 81854db3d0

View File

@ -217,7 +217,7 @@ public abstract class Disguise {
} }
// If the vectorY isn't 0. Cos if it is. Then it doesn't want to send any vectors. // If the vectorY isn't 0. Cos if it is. Then it doesn't want to send any vectors.
// If this disguise has velocity sending enabled and the entity is flying. // If this disguise has velocity sending enabled and the entity is flying.
if (vectorY != 0 && isVelocitySent() && (alwaysSendVelocity || !getEntity().isOnGround())) { if (isVelocitySent() && vectorY != 0 && (alwaysSendVelocity || !getEntity().isOnGround())) {
Vector vector = getEntity().getVelocity(); Vector vector = getEntity().getVelocity();
// If the entity doesn't have velocity changes already - You know. I really can't wrap my head about the // If the entity doesn't have velocity changes already - You know. I really can't wrap my head about the
// if statement. // if statement.
@ -277,6 +277,7 @@ public abstract class Disguise {
} }
// If we need to send a packet to update the exp position as it likes to gravitate client sided to // If we need to send a packet to update the exp position as it likes to gravitate client sided to
// players. // players.
}
if (getType() == DisguiseType.EXPERIENCE_ORB) { if (getType() == DisguiseType.EXPERIENCE_ORB) {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.REL_ENTITY_MOVE); PacketContainer packet = new PacketContainer(PacketType.Play.Server.REL_ENTITY_MOVE);
packet.getIntegers().write(0, getEntity().getEntityId()); packet.getIntegers().write(0, getEntity().getEntityId());
@ -288,8 +289,8 @@ public abstract class Disguise {
PacketContainer selfPacket = packet.shallowClone(); PacketContainer selfPacket = packet.shallowClone();
selfPacket.getModifier().write(0, DisguiseAPI.getFakeDisguise(getEntity().getUniqueId())); selfPacket.getModifier().write(0, DisguiseAPI.getFakeDisguise(getEntity().getUniqueId()));
try { try {
ProtocolLibrary.getProtocolManager().sendServerPacket((Player) getEntity(), ProtocolLibrary.getProtocolManager().sendServerPacket((Player) getEntity(), selfPacket,
selfPacket, false); false);
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -301,7 +302,6 @@ public abstract class Disguise {
} }
} }
} }
}
}; };
} }