Skip to content

Commit

Permalink
chore: more debug in passenger listener
Browse files Browse the repository at this point in the history
  • Loading branch information
LoJoSho committed Dec 16, 2024
1 parent 1f94192 commit e4c4933
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -644,18 +644,19 @@ private void registerPassengerSetListener() {
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(HMCCosmeticsPlugin.getInstance(), ListenerPriority.NORMAL, PacketType.Play.Server.MOUNT) {
@Override
public void onPacketSending(PacketEvent event) {
MessagesUtil.sendDebugMessages("Mount Packet Sent - Begin");
CosmeticUser viewerUser = CosmeticUsers.getUser(event.getPlayer().getUniqueId());
if (viewerUser == null) return;
if (viewerUser.isInWardrobe()) return;

int ownerId = event.getPacket().getIntegers().read(0);
MessagesUtil.sendDebugMessages("Mount Packet Sent - " + ownerId);
MessagesUtil.sendDebugMessages("Mount Packet Sent - Read - EntityID: " + ownerId);
Entity entity = HMCCServerUtils.getEntity(ownerId);
if (entity == null) return;

CosmeticUser user = CosmeticUsers.getUser(entity.getUniqueId());
if (user == null) return;
MessagesUtil.sendDebugMessages("Mount Packet Sent - " + user.getUniqueId());

if (user.isInWardrobe()) return;
if (!user.hasCosmeticInSlot(CosmeticSlot.BACKPACK)) return;
if (user.getUserBackpackManager() == null) return;

Expand Down

0 comments on commit e4c4933

Please sign in to comment.