Class VanillaPacketFilter

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToMessageEncoder<Packet<?>>
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<Packet<?>>
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

    Fields
    Modifier and Type
    Field
    Description
    protected Map<Class<? extends Packet<?>>,​BiConsumer<Packet<?>,​List<? super Packet<?>>>>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    VanillaPacketFilter​(Map<Class<? extends Packet<?>>,​BiConsumer<Packet<?>,​List<? super Packet<?>>>> handlers)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    encode​(io.netty.channel.ChannelHandlerContext ctx, Packet<?> msg, List<Object> out)
     
    protected static <T extends Packet<?>>
    Map.Entry<Class<? extends Packet<?>>,​BiConsumer<Packet<?>,​List<? super Packet<?>>>>
    handler​(Class<T> cls, BiConsumer<Packet<?>,​List<? super Packet<?>>> consumer)
    Helper function for building the handler map.
    protected static <T extends Packet<?>>
    Map.Entry<Class<? extends Packet<?>>,​BiConsumer<Packet<?>,​List<? super Packet<?>>>>
    handler​(Class<T> cls, Function<T,​? extends Packet<?>> function)
    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