#3207: Rework the plugin message relaying system to allow unregistering channels

This commit is contained in:
PSNRigner
2021-11-12 19:37:58 +11:00
committed by md_5
parent c0c9b28582
commit c7b0c3cd48
6 changed files with 46 additions and 149 deletions

View File

@@ -2,7 +2,6 @@ package net.md_5.bungee.protocol.packet;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import io.netty.buffer.ByteBuf;
import java.io.ByteArrayInputStream;
import java.io.DataInput;
@@ -48,14 +47,6 @@ public class PluginMessage extends DefinedPacket
return "legacy:" + tag.toLowerCase( Locale.ROOT );
}
};
public static final Predicate<PluginMessage> SHOULD_RELAY = new Predicate<PluginMessage>()
{
@Override
public boolean apply(PluginMessage input)
{
return ( input.getTag().equals( "REGISTER" ) || input.getTag().equals( "minecraft:register" ) || input.getTag().equals( "MC|Brand" ) || input.getTag().equals( "minecraft:brand" ) ) && input.getData().length < Byte.MAX_VALUE;
}
};
//
private String tag;
private byte[] data;