Class VanillaConnectionNetworkFilter

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToMessageEncoder<IPacket<?>>
net.minecraftforge.network.VanillaPacketFilter
net.minecraftforge.network.VanillaConnectionNetworkFilter
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelOutboundHandler

@Sharable public class VanillaConnectionNetworkFilter extends VanillaPacketFilter
A filter for network packets, used to filter/modify parts of vanilla network messages that will cause errors or warnings on vanilla clients, for example entity attributes that are added by Forge or mods.
  • 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
    private static final org.apache.logging.log4j.Logger
     

    Fields inherited from class net.minecraftforge.network.VanillaPacketFilter

    handlers
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static SCommandListPacket
    Filter for SCommandListPacket.
    Filter for SEntityPropertiesPacket.
    protected boolean
    Whether this filter is necessary on the given connection.

    Methods inherited from class net.minecraftforge.network.VanillaPacketFilter

    encode, handler, handler

    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

    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
  • Constructor Details

    • VanillaConnectionNetworkFilter

      public VanillaConnectionNetworkFilter()
  • Method Details

    • isNecessary

      protected boolean isNecessary(NetworkManager manager)
      Description copied from class: VanillaPacketFilter
      Whether this filter is necessary on the given connection.
      Specified by:
      isNecessary in class VanillaPacketFilter
    • filterEntityProperties

      @Nonnull private static SEntityPropertiesPacket filterEntityProperties(SEntityPropertiesPacket msg)
      Filter for SEntityPropertiesPacket. Filters out any entity attributes that are not in the "minecraft" namespace. A vanilla client would ignore these with an error log.
    • filterCommandList

      @Nonnull private static SCommandListPacket filterCommandList(SCommandListPacket packet)
      Filter for SCommandListPacket. Uses CommandTreeCleaner to filter out any ArgumentTypes that are not in the "minecraft" or "brigadier" namespace. A vanilla client would fail to deserialize the packet and disconnect with an error message if these were sent.