跳到正文

Thirst Was Taken : Mixin Server Fix

Universal NBT ItemStack null safety patch. Fixes EncoderException crashes during server-client sync in any mod. Uses Mixins to prevent null references without modifying source code. Initial developed for TWT (Thirst Was Taken)

收藏

截图

介绍

中文介绍正在准备中,下面暂时显示原文。

Thirst Was Taken: Server Fix

🔧 What is this mod?

A critical patch mod that fixes NBT tag synchronization crashes affecting ItemStack serialization during server-client communication. Originally discovered and solved for Thirst Was Taken and Thirst-No-More mods, this fix is universally applicable to any mod suffering from null ItemStack crashes during Netty packet encoding.

🐛 The Problem

Several mods (particularly water/drinking container mods) use ItemStack.getOrCreateTag() patterns that can inadvertently create NBT tags containing null ItemStack references. When these items are synced from server to client, the Netty encoder attempts to serialize null ItemStack objects, resulting in:

EncoderException: Cannot invoke net.minecraft.world.item.ItemStack.m_41619_() 
because p_130056_ is null

This crash prevents players from joining the server entirely.

✅ The Solution

This mod uses Forge Mixins to inject protective patches at the network layer without modifying the original mods:

  • FriendlyByteBufItemStackMixin: Intercepts all ItemStack writes to network packets and safely replaces null ItemStack references with ItemStack.EMPTY, maintaining packet protocol integrity
  • ItemStackNullSafetyMixin: Protects critical ItemStack serialization methods (save(), getMaxStackSize(), isEmpty(), getItem())

🎯 Why This Mod?

  • No source modification needed – Mixins patch at runtime
  • Universal solution – Works with any mod that has null ItemStack issues
  • Safe – Replaces nulls with valid empty stacks, maintaining server stability
  • Transparent – Zero configuration needed, works immediately on install

📋 Compatibility

  • Minecraft: Actually only in 1.20.1
  • Works with: Thirst Was Taken, Thirst-No-More, and any mod with ItemStack NBT sync issues

🔍 Origin

This fix was developed to solve critical join crashes in servers using Thirst Was Taken and Thirst-No-More mods. The underlying issue (null ItemStack in NBT serialization) can occur in any mod, so this solution is provided as a universal patch.


Issues? Report them along with your latest.log if you encounter any problems.

常见问题

Thirst Was Taken : Mixin Server Fix 支持哪些 Minecraft 版本?

Thirst Was Taken : Mixin Server Fix 支持 Minecraft Java 版 1.20.1,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。

Thirst Was Taken : Mixin Server Fix 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

ItHurtsLikeHell_ 的其他作品

查看全部 →