Item Utils
基本信息
| 属性 | 值 |
|---|---|
| 类 | com.chaosthedude.naturescompass.util.ItemUtils |
行为
NBT 安全访问工具。所有 ItemNaturesCompass 的 getXxx / setXxx 都先调 ItemUtils.verifyNBT(stack) 确认 stack.getItem() == NaturesCompass.naturesCompass 且有 TagCompound(缺失则创建空 NBTTagCompound)。
数值
无显式数值。
限制
- 不校验 stack 数量(count == 0 也算合法)。
- 不做服务端/客户端校验,调用方需自行保证。