Skip to content

Commit

Permalink
chore: use getUUIDLists from ProtocolLib
Browse files Browse the repository at this point in the history
  • Loading branch information
derklaro committed Jan 11, 2023
1 parent a719750 commit 971d22b
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.reflect.EquivalentConverter;
import com.comphenix.protocol.utility.MinecraftReflection;
import com.comphenix.protocol.utility.MinecraftVersion;
import com.comphenix.protocol.wrappers.Converters;
import com.comphenix.protocol.wrappers.EnumWrappers;
import com.comphenix.protocol.wrappers.MinecraftKey;
import com.comphenix.protocol.wrappers.Pair;
Expand Down Expand Up @@ -108,9 +106,6 @@ final class ProtocolLibPacketAdapter implements PlatformPacketAdapter<World, Pla
// serializer converters for metadata
private static final Map<Type, BiFunction<PlatformVersionAccessor, Object, Map.Entry<Type, Object>>> SERIALIZER_CONVERTERS;

// converter for uuid lists
private static final EquivalentConverter<UUID> UUID_PASSTHROUGH_CONVERTER = Converters.passthrough(UUID.class);

// static actions we need to send out for all player updates (since 1.19.3)
private static final EnumSet<EnumWrappers.PlayerInfoAction> ADD_ACTIONS = EnumSet.of(
EnumWrappers.PlayerInfoAction.ADD_PLAYER,
Expand Down Expand Up @@ -312,7 +307,7 @@ final class ProtocolLibPacketAdapter implements PlatformPacketAdapter<World, Pla

// write the npc uuid to remove
List<UUID> uuidsToRemove = Collections.singletonList(profile.uniqueId());
container.getLists(UUID_PASSTHROUGH_CONVERTER).write(0, uuidsToRemove);
container.getUUIDLists().write(0, uuidsToRemove);

// send the packet without notifying any bound packet listeners
PROTOCOL_MANAGER.sendServerPacket(player, container, false);
Expand Down

0 comments on commit 971d22b

Please sign in to comment.