Package net.minecraftforge.network
Class VanillaPacketFilter
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToMessageEncoder<IPacket<?>>
net.minecraftforge.network.VanillaPacketFilter
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelOutboundHandler
- Direct Known Subclasses:
ForgeConnectionNetworkFilter
,VanillaConnectionNetworkFilter
public abstract class VanillaPacketFilter
extends io.netty.handler.codec.MessageToMessageEncoder<IPacket<?>>
A filter for vanilla network packets.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
VanillaPacketFilter
(Map<Class<? extends IPacket<?>>, BiConsumer<IPacket<?>, List<? super IPacket<?>>>> handlers) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected static <T extends IPacket<?>>
Map.Entry<Class<? extends IPacket<?>>,BiConsumer<IPacket<?>, List<? super IPacket<?>>>> Helper function for building the handler map.protected static <T extends IPacket<?>>
Map.Entry<Class<? extends IPacket<?>>,BiConsumer<IPacket<?>, List<? super IPacket<?>>>> Helper function for building the handler map.protected abstract boolean
isNecessary
(NetworkManager manager) Whether this filter is necessary on the given connection.Methods inherited from class io.netty.handler.codec.MessageToMessageEncoder
acceptOutboundMessage, write
Methods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, read
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.channel.ChannelHandler
exceptionCaught, handlerAdded, handlerRemoved
-
Field Details
-
handlers
-
-
Constructor Details
-
VanillaPacketFilter
-
-
Method Details
-
handler
@Nonnull protected static <T extends IPacket<?>> Map.Entry<Class<? extends IPacket<?>>,BiConsumer<IPacket<?>, handlerList<? super IPacket<?>>>> (Class<T> cls, Function<T, ? extends IPacket<?>> function) Helper function for building the handler map. -
handler
@Nonnull protected static <T extends IPacket<?>> Map.Entry<Class<? extends IPacket<?>>,BiConsumer<IPacket<?>, handlerList<? super IPacket<?>>>> (Class<T> cls, BiConsumer<IPacket<?>, List<? super IPacket<?>>> consumer) Helper function for building the handler map. -
isNecessary
Whether this filter is necessary on the given connection. -
encode
- Specified by:
encode
in classio.netty.handler.codec.MessageToMessageEncoder<IPacket<?>>
-