From 81854db3d0b6b857df8384015da08c90e6d4b8a0 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 24 May 2014 05:02:17 +1200 Subject: [PATCH] Exp packets shouldn't be in the velocity group --- .../disguise/disguisetypes/Disguise.java | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java index b06907e6..3121b1f0 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -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 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(); // If the entity doesn't have velocity changes already - You know. I really can't wrap my head about the // if statement. @@ -277,27 +277,27 @@ public abstract class Disguise { } // If we need to send a packet to update the exp position as it likes to gravitate client sided to // players. - if (getType() == DisguiseType.EXPERIENCE_ORB) { - PacketContainer packet = new PacketContainer(PacketType.Play.Server.REL_ENTITY_MOVE); - packet.getIntegers().write(0, getEntity().getEntityId()); - try { - for (Player player : DisguiseUtilities.getPerverts(disguise)) { - if (getEntity() != player) { - ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet, false); - } else if (isSelfDisguiseVisible()) { - PacketContainer selfPacket = packet.shallowClone(); - selfPacket.getModifier().write(0, DisguiseAPI.getFakeDisguise(getEntity().getUniqueId())); - try { - ProtocolLibrary.getProtocolManager().sendServerPacket((Player) getEntity(), - selfPacket, false); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } + } + if (getType() == DisguiseType.EXPERIENCE_ORB) { + PacketContainer packet = new PacketContainer(PacketType.Play.Server.REL_ENTITY_MOVE); + packet.getIntegers().write(0, getEntity().getEntityId()); + try { + for (Player player : DisguiseUtilities.getPerverts(disguise)) { + if (getEntity() != player) { + ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet, false); + } else if (isSelfDisguiseVisible()) { + PacketContainer selfPacket = packet.shallowClone(); + selfPacket.getModifier().write(0, DisguiseAPI.getFakeDisguise(getEntity().getUniqueId())); + try { + ProtocolLibrary.getProtocolManager().sendServerPacket((Player) getEntity(), selfPacket, + false); + } catch (InvocationTargetException e) { + e.printStackTrace(); } } - } catch (InvocationTargetException e) { - e.printStackTrace(); } + } catch (InvocationTargetException e) { + e.printStackTrace(); } } }