PacketFixer
A server-side Fabric mod (Minecraft 1.21.1, Java 21, v1.5.1, group com.packetfixer) that optimizes server→client network traffic.
介绍
A server-side Fabric mod (Minecraft 1.21.1, Java 21, v1.5.1, group com.packetfixer) that optimizes server→client network traffic. It’s a DedicatedServerModInitializer, so it only runs on the server. It does two things: prevents crashes/disconnects caused by other mods’ packets, and reduces bandwidth, latency, and network CPU.
The modules
-
Anti-disconnect for broken mod packets (ClientConnectionMixin) Inserts a handler into the Netty pipeline and intercepts exceptionCaught: if the error is an EncoderException containing custom_payload (i.e. a broken packet from some mod), it logs a warning and swallows it instead of kicking the player.
-
Custom payload throttling (PacketThrottler + Config → config/packetfixer.json) Max 50 custom payloads per tick per connection; the overflow goes into a queue (max 500, oldest dropped) and is resent at the start of the next tick using batched writes + a single Netty flush. It has adaptive congestion control: as the queue grows, the “live” budget scales down (back-pressure) while the flush budget scales up. Ping-critical packets (position, velocity, block update, inventory, health, sounds) always bypass the throttle, and the cobblemon namespace is excluded by default — clearly to avoid breaking battle packets.
-
Flush consolidation Adds a Netty FlushConsolidationHandler to merge multiple flushes into fewer syscalls, with an adaptive threshold based on player count (few players = low threshold = better ping; many = higher threshold = less CPU). A tick-end “flush pulse” makes sure nothing gets stuck sitting in the buffers.
-
Packet optimizers (PacketOptimizerConfig → config/packetoptimizer.properties)
- NBT stripper (EntityNbtMixin): removes server-only tags (Paper.Origin, Bukkit.updateLevel, etc.) and empty compounds
- Chunk optimizer (ChunkDataMixin): same cleanup for block entities in chunk data
- Lazy entity loader (LazyEntityTracker): entities beyond 16 bloy, but in batches of ~10 per tick
- Entity update throttle (EntityTrackerEntryMixin): entities more than 48 blocks from all players only send position updates every 3rd tick (~66% fewer packets)
- Compression tuning: forces the Deflater to level 1 via reflection (faster, slightly larger packets)
- Packet monitor (PacketEncoderMonitorMixin): logs warnings/erroMB — useful for finding which mod is sending huge packets
A couple of things worth knowing
ClientConnectionMixin uses reflection on the compressor’s Deflatgile part, and it fails silently (catch + debug log) if theNetty/MC internals change. And the swallowed exceptionCaught means that if a mod genuinely has a serialization bug, the packet vanishes without the client ever knowing — intended here, but it can mask real problems.
常见问题
PacketFixer 支持哪些 Minecraft 版本?
PacketFixer 支持 Minecraft Java 版 1.21.1,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。
PacketFixer 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
MarcoErCarrozza 的其他作品
查看全部 →Cobblemon:CRZMovesPokemon
这个模组通过从宝可梦中心Wiki(意大利宝可梦百科)获取准确的招式数据,为Cobblemon 1.7修复并扩展了宝可梦的招式学习表。
CobblemonOptimizer
CobbleOptimizer 是一款服务端 Fabric 模组,可减少 Cobblemon 宝可梦实体造成的卡顿。
Cobbleboost
CobbleBoost is a client-side Fabric mod for Minecraft 1.21.1 that optimizes performance when playing with Cobblemon 1.7.
CobblemonOptimizer
CobbleOptimizer A server-side Fabric mod for Minecraft 1.21.1 that optimizes Cobblemon (the Pokemon mod) entity performance based on server load (TPS).
评论
登录后评论和评分