Class VanillaPacketFilter
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToMessageEncoder<Packet<?>>
net.minecraftforge.network.filters.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<Packet<?>>
A filter for vanilla impl 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 Packet<?>>, BiConsumer<Packet<?>, List<? super Packet<?>>>> handlers) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected static <T extends Packet<?>>
Map.Entry<Class<? extends Packet<?>>,BiConsumer<Packet<?>, List<? super Packet<?>>>> Helper function for building the handler map.protected static <T extends Packet<?>>
Map.Entry<Class<? extends Packet<?>>,BiConsumer<Packet<?>, List<? super Packet<?>>>> Helper function for building the handler map.protected abstract boolean
isNecessary
(Connection 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
@NotNull protected static <T extends Packet<?>> Map.Entry<Class<? extends Packet<?>>,BiConsumer<Packet<?>, handlerList<? super Packet<?>>>> (Class<T> cls, Function<T, ? extends Packet<?>> function) Helper function for building the handler map. -
handler
@NotNull protected static <T extends Packet<?>> Map.Entry<Class<? extends Packet<?>>,BiConsumer<Packet<?>, handlerList<? super Packet<?>>>> (Class<T> cls, BiConsumer<Packet<?>, List<? super Packet<?>>> 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<Packet<?>>
-