Don't send a meta data packet when list is empty. #288

This commit is contained in:
Myles 2016-04-01 18:13:23 +01:00
parent 5c84b3d8cc
commit 3602c5087b

View File

@ -201,6 +201,16 @@ public class EntityPackets {
tracker.handleMetadata(entityID, metadataList); tracker.handleMetadata(entityID, metadataList);
} }
}); });
// Cancel packet if list empty
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
List<Metadata> metadataList = wrapper.get(Protocol1_9TO1_8.METADATA_LIST, 0);
if(metadataList.size() == 0)
wrapper.cancel();
}
});
} }
}); });