Class VanillaConnectionNetworkFilter
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToMessageEncoder<Packet<?>>
net.neoforged.neoforge.network.filters.VanillaPacketFilter
net.neoforged.neoforge.network.filters.VanillaConnectionNetworkFilter
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelOutboundHandler,DynamicChannelHandler
A filter for impl packets, used to filter/modify parts of vanilla impl 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
FieldsFields inherited from class net.neoforged.neoforge.network.filters.VanillaPacketFilter
handlers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static ClientboundCommandsPacketFilter for SCommandListPacket.private static ClientboundUpdateTagsPacketFilters out custom tag types that the vanilla client won't recognize.private static ClientboundUpdateAttributesPacketFilter for SEntityPropertiesPacket.booleanisNecessary(Connection manager) Whether this filter is necessary on the given connection.private static booleanisVanillaRegistry(ResourceLocation location) Methods inherited from class net.neoforged.neoforge.network.filters.VanillaPacketFilter
encode, handler, handlerMethods 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
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
VanillaConnectionNetworkFilter
public VanillaConnectionNetworkFilter()
-
-
Method Details
-
isNecessary
Description copied from class:VanillaPacketFilterWhether this filter is necessary on the given connection.- Specified by:
isNecessaryin interfaceDynamicChannelHandler- Specified by:
isNecessaryin classVanillaPacketFilter
-
filterEntityProperties
private static ClientboundUpdateAttributesPacket filterEntityProperties(ClientboundUpdateAttributesPacket 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
Filter for SCommandListPacket. UsesCommandTreeCleanerto 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. -
filterCustomTagTypes
Filters out custom tag types that the vanilla client won't recognize. It prevents a rare error from logging and reduces the packet size -
isVanillaRegistry
-