I don't think I need to cancel riding packets. Might be 1.6.4 specific. Anyone care to test?
This commit is contained in:
		| @@ -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; | ||||
|     } | ||||
|   | ||||
| @@ -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<Entity> 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()) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user