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
FieldsModifier and TypeFieldDescriptionprivate final ConnectionType
private static final org.slf4j.Logger
Fields inherited from class net.neoforged.neoforge.network.filters.VanillaPacketFilter
handlers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static ClientboundCommandsPacket
Filter for SCommandListPacket.private static ClientboundUpdateTagsPacket
Filters out custom tag types that the vanilla client won't recognize.private static ClientboundUpdateAttributesPacket
Filter for SEntityPropertiesPacket.boolean
isNecessary
(Connection manager) Whether this filter is necessary on the given connection.private static boolean
isVanillaRegistry
(ResourceLocation location) Methods inherited from class net.neoforged.neoforge.network.filters.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.slf4j.Logger LOGGER -
connectionType
-
-
Constructor Details
-
VanillaConnectionNetworkFilter
-
-
Method Details
-
isNecessary
Description copied from class:VanillaPacketFilter
Whether this filter is necessary on the given connection.- Specified by:
isNecessary
in interfaceDynamicChannelHandler
- Specified by:
isNecessary
in 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. UsesCommandTreeCleaner
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. -
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
-