Clone the packet, should resolve people hearing invisible disguises sounds

This commit is contained in:
libraryaddict 2014-03-06 05:13:17 +13:00
parent 143f72a20f
commit ae874392ab

View File

@ -486,8 +486,10 @@ public class PacketsManager {
PacketType.Play.Server.ENTITY_STATUS) { PacketType.Play.Server.ENTITY_STATUS) {
@Override @Override
public void onPacketSending(PacketEvent event) { public void onPacketSending(PacketEvent event) {
if (event.isCancelled()) if (event.isCancelled()) {
return; return;
}
event.setPacket(event.getPacket().deepClone());
StructureModifier<Object> mods = event.getPacket().getModifier(); StructureModifier<Object> mods = event.getPacket().getModifier();
Player observer = event.getPlayer(); Player observer = event.getPlayer();
if (event.getPacketType() == PacketType.Play.Server.NAMED_SOUND_EFFECT) { if (event.getPacketType() == PacketType.Play.Server.NAMED_SOUND_EFFECT) {