From 8363b23debb0a95c6d145642eae53bbbe1ee8def Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 15 Jun 2014 21:04:22 +1200 Subject: [PATCH] I don't think I need to cancel riding packets. Might be 1.6.4 specific. Anyone care to test? --- src/me/libraryaddict/disguise/DisguiseConfig.java | 13 ------------- .../disguise/utilities/PacketsManager.java | 13 ++----------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/me/libraryaddict/disguise/DisguiseConfig.java b/src/me/libraryaddict/disguise/DisguiseConfig.java index 08975ff2..9aaf4011 100644 --- a/src/me/libraryaddict/disguise/DisguiseConfig.java +++ b/src/me/libraryaddict/disguise/DisguiseConfig.java @@ -28,7 +28,6 @@ public class DisguiseConfig { private static boolean miscDisguisesForLivingEnabled; private static boolean modifyBoundingBox; private static boolean movementEnabled; - private static boolean ridingEnabled; private static boolean sendsEntityMetadata; private static boolean sendVelocity; private static boolean showNameAboveHead; @@ -76,7 +75,6 @@ public class DisguiseConfig { setEquipmentPacketsEnabled(config.getBoolean("PacketsEnabled.Equipment")); setAnimationPacketsEnabled(config.getBoolean("PacketsEnabled.Animation")); setBedPacketsEnabled(config.getBoolean("PacketsEnabled.Bed")); - setRidingPacketsEnabled(config.getBoolean("PacketsEnabled.Riding")); setEntityStatusPacketsEnabled(config.getBoolean("PacketsEnabled.EntityStatus")); setCollectPacketsEnabled(config.getBoolean("PacketsEnabled.Collect")); setMetadataPacketsEnabled(config.getBoolean("PacketsEnabled.Metadata")); @@ -183,10 +181,6 @@ public class DisguiseConfig { return showNameAboveHead; } - public static boolean isRidingPacketsEnabled() { - return ridingEnabled; - } - public static boolean isSelfDisguisesSoundsReplaced() { return hearSelfDisguise; } @@ -371,13 +365,6 @@ public class DisguiseConfig { showNameAboveHead = showNames; } - public static void setRidingPacketsEnabled(boolean enabled) { - if (enabled != isRidingPacketsEnabled()) { - ridingEnabled = enabled; - PacketsManager.setupMainPacketsListener(); - } - } - public static void setSheepDyeable(boolean color) { colorizeSheep = color; } diff --git a/src/me/libraryaddict/disguise/utilities/PacketsManager.java b/src/me/libraryaddict/disguise/utilities/PacketsManager.java index 76c66676..74bc946f 100644 --- a/src/me/libraryaddict/disguise/utilities/PacketsManager.java +++ b/src/me/libraryaddict/disguise/utilities/PacketsManager.java @@ -1112,9 +1112,6 @@ public class PacketsManager { { packetsToListen.add(PacketType.Play.Server.ENTITY_METADATA); } - if (DisguiseConfig.isRidingPacketsEnabled()) { - packetsToListen.add(PacketType.Play.Server.ATTACH_ENTITY); - } if (DisguiseConfig.isCollectPacketsEnabled()) { packetsToListen.add(PacketType.Play.Server.COLLECT); } @@ -1150,8 +1147,8 @@ public class PacketsManager { final Player observer = event.getPlayer(); // First get the entity, the one sending this packet StructureModifier entityModifer = event.getPacket().getEntityModifier(observer.getWorld()); - org.bukkit.entity.Entity entity = entityModifer.read((PacketType.Play.Server.COLLECT == event.getPacketType() - || PacketType.Play.Server.ATTACH_ENTITY == event.getPacketType() ? 1 : 0)); + org.bukkit.entity.Entity entity = entityModifer + .read((PacketType.Play.Server.COLLECT == event.getPacketType() ? 1 : 0)); // If the entity is the same as the sender. Don't disguise! // Prevents problems and there is no advantage to be gained. if (entity == observer) @@ -1246,12 +1243,6 @@ public class PacketsManager { } } - else if (sentPacket.getType() == PacketType.Play.Server.ATTACH_ENTITY) { - if (disguise.getType().isMisc()) { - packets = new PacketContainer[0]; - } - } - // Else if the packet is sending entity metadata else if (sentPacket.getType() == PacketType.Play.Server.ENTITY_METADATA) { if (DisguiseConfig.isMetadataPacketsEnabled()) {