Fix listeners removing each other (#2236)

This commit is contained in:
libraryaddict authored and GitHub committed 2023-03-16 16:52:10 -05:00
1 parent 4f0fe72add
commit bba534d694
1 file changed
+4
@@ -306,6 +306,10 @@ public class PacketFilterManager implements ListenerInvoker, InternalManager {
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());