Don't send empty meta

This commit is contained in:
libraryaddict 2021-05-26 06:15:12 +12:00
parent 796ae26ed7
commit caa25296be

View File

@ -30,17 +30,18 @@ public class PacketHandlerMetadata implements IPacketHandler {
} }
@Override @Override
public void handle(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer, public void handle(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer, Entity entity) {
Entity entity) {
packets.clear(); packets.clear();
if (!DisguiseConfig.isMetaPacketsEnabled()) { if (!DisguiseConfig.isMetaPacketsEnabled()) {
return; return;
} }
List<WrappedWatchableObject> watchableObjects = disguise.getWatcher() List<WrappedWatchableObject> watchableObjects = disguise.getWatcher().convert(observer, sentPacket.getWatchableCollectionModifier().read(0));
.convert(observer, sentPacket.getWatchableCollectionModifier().read(0));
if (watchableObjects.isEmpty()) {
return;
}
PacketContainer metaPacket = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA); PacketContainer metaPacket = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA);