Class VanillaPacketFilter
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToMessageEncoder<Packet<?>>
net.neoforged.neoforge.network.filters.VanillaPacketFilter
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelOutboundHandler
,DynamicChannelHandler
- Direct Known Subclasses:
VanillaConnectionNetworkFilter
public abstract class VanillaPacketFilter
extends io.netty.handler.codec.MessageToMessageEncoder<Packet<?>>
implements DynamicChannelHandler
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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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.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
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
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.- Specified by:
isNecessary
in interfaceDynamicChannelHandler
-
encode
- Specified by:
encode
in classio.netty.handler.codec.MessageToMessageEncoder<Packet<?>>
-