From ff6567ba2345048f7ccbae8c3e778d4c8c8756c5 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 21 Jan 2014 05:34:07 +1300 Subject: [PATCH] Why write the fake entity id if we don't use false in the send packet? --- .../disguise/disguisetypes/Disguise.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java index 2ed33647..88c45f19 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -1,6 +1,5 @@ package me.libraryaddict.disguise.disguisetypes; -import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.HashSet; @@ -183,7 +182,7 @@ public abstract class Disguise { public void run() { // If entity is no longer valid. Remove it. if (!getEntity().isValid()) { - removeDisguise(); + DisguiseAPI.undisguiseToAll(getEntity()); } else { // If the disguise type is tnt, we need to resend the entity packet else it will turn invisible if (getType() == DisguiseType.PRIMED_TNT || getType() == DisguiseType.FIREWORK) { @@ -202,7 +201,8 @@ public abstract class Disguise { // If this disguise has velocity sending enabled and the entity is flying. if (vectorY != 0 && isVelocitySent() && (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. + // If the entity doesn't have velocity changes already - You know. I really can't wrap my head about the + // if statement. // But it doesn't seem to do anything wrong.. if (vector.getY() != 0 && !(vector.getY() < 0 && alwaysSendVelocity && getEntity().isOnGround())) { return; @@ -248,17 +248,16 @@ public abstract class Disguise { } mods.write(2, (int) (8000D * (vectorY * ReflectionManager.getPing(player)) * 0.069D)); if (lookPacket != null) { - ProtocolLibrary.getProtocolManager().sendServerPacket(player, lookPacket); + ProtocolLibrary.getProtocolManager().sendServerPacket(player, lookPacket, false); } - ProtocolLibrary.getProtocolManager().sendServerPacket(player, velocityPacket); - velocityPacket = velocityPacket.shallowClone(); - mods = velocityPacket.getIntegers(); + ProtocolLibrary.getProtocolManager().sendServerPacket(player, velocityPacket.shallowClone(), + false); } } catch (Exception e) { e.printStackTrace(); } } - // If we need to send a packet to update the exp orbs 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. if (getType() == DisguiseType.EXPERIENCE_ORB) { PacketContainer packet = new PacketContainer(PacketType.Play.Server.REL_ENTITY_MOVE);