Skip to content

Commit

Permalink
Fix listeners removing each other (#2236)
Browse files Browse the repository at this point in the history
  • Loading branch information
libraryaddict authored Mar 16, 2023
1 parent 4f0fe72 commit bba534d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ public void addPacketListener(PacketListener listener) {
ListeningWhitelist outbound = listener.getSendingWhitelist();
ListeningWhitelist inbound = listener.getReceivingWhitelist();

// Remove packets from the lists if they are not supposed to be in those lists
inbound.getTypes().removeIf(type -> !type.isClient());
outbound.getTypes().removeIf(type -> !type.isServer());

// verify plugin if needed
if (this.shouldVerifyPlugin(outbound, inbound)) {
this.printPluginWarnings(listener.getPlugin());
Expand Down

0 comments on commit bba534d

Please sign in to comment.