Fix 1.7 self disguises sounds not playing properly

This commit is contained in:
libraryaddict 2013-12-08 15:32:57 +13:00
parent 95e28757b7
commit a178fbace7

View File

@ -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) {
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);
}
break;*/
}
}
}
}