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
ConstructorsModifierConstructorDescriptionprotectedVanillaPacketFilter(Map<Class<? extends Packet<?>>, BiConsumer<Packet<?>, List<? super Packet<?>>>> handlers) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected 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 booleanisNecessary(Connection manager) Whether this filter is necessary on the given connection.Methods inherited from class io.netty.handler.codec.MessageToMessageEncoder
acceptOutboundMessage, writeMethods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
isNecessaryin interfaceDynamicChannelHandler
-
encode
- Specified by:
encodein classio.netty.handler.codec.MessageToMessageEncoder<Packet<?>>
-