From a178fbace71c9de3738495919976564c605cd855 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 8 Dec 2013 15:32:57 +1300 Subject: [PATCH] Fix 1.7 self disguises sounds not playing properly --- .../disguise/utilities/PacketsManager.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/me/libraryaddict/disguise/utilities/PacketsManager.java b/src/me/libraryaddict/disguise/utilities/PacketsManager.java index 224dea7d..72e6b0f5 100644 --- a/src/me/libraryaddict/disguise/utilities/PacketsManager.java +++ b/src/me/libraryaddict/disguise/utilities/PacketsManager.java @@ -612,7 +612,7 @@ public class PacketsManager { } } } else if (event.getPacketType() == PacketType.Play.Server.ENTITY_STATUS) { - if ((Byte) mods.read(1) == 1) { + if ((Byte) mods.read(1) == 2) { // It made a damage animation Entity entity = event.getPacket().getEntityModifier(observer.getWorld()).read(0); Disguise disguise = DisguiseAPI.getDisguise(observer, entity); @@ -689,7 +689,7 @@ public class PacketsManager { PacketType.Play.Server.ENTITY_HEAD_ROTATION, PacketType.Play.Server.ENTITY_METADATA, PacketType.Play.Server.ENTITY_EQUIPMENT, PacketType.Play.Server.ANIMATION, PacketType.Play.Server.BED, PacketType.Play.Server.ENTITY_EFFECT, PacketType.Play.Server.ENTITY_VELOCITY, - PacketType.Play.Server.UPDATE_ATTRIBUTES) { + PacketType.Play.Server.UPDATE_ATTRIBUTES, PacketType.Play.Server.ENTITY_STATUS) { @Override public void onPacketSending(PacketEvent event) { final Player observer = event.getPlayer(); @@ -764,12 +764,12 @@ public class PacketsManager { event.setCancelled(true); } - /* case PacketType.Play.Server.ENTITY_STATUS: - if (DisguiseAPI.getDisguise(entity).canHearSelfDisguise() - && (Byte) event.getPacket().getModifier().read(1) == 1) { - event.setCancelled(true); - } - break;*/ + else if (event.getPacketType() == PacketType.Play.Server.ENTITY_STATUS) { + if (DisguiseAPI.getDisguise(event.getPlayer(), event.getPlayer()).isSelfDisguiseSoundsReplaced() + && (Byte) event.getPacket().getModifier().read(1) == 2) { + event.setCancelled(true); + } + } } } }