Sophisticated Backpacks – MT Inventory Weight
Accurate MT Inventory Weight support for Sophisticated Backpacks (Unofficial Fabric port), reading real backpack contents via the SB wrapper API.
介绍
Sophisticated Backpacks InventoryWeight
Accurate MT Inventory Weight support for Sophisticated Backpacks (Unofficial Fabric port).
MT Inventory Weight ships a generic backpack calculator that reads container NBT, but Sophisticated Backpacks assigns each backpack a UUID and stores its real contents in world BackpackStorage (PersistentState) — not always in the item NBT. Generic NBT reading therefore under- or mis-counts SB backpacks. This add-on fixes that by reading the actual contents through the Sophisticated Backpacks API.
It registers an Inventory Weight item weight provider (via the inventoryweight entrypoint) at priority 8500 — above the built-in generic backpacks provider (8000) — so SB backpacks are handled by this accurate provider while everything else falls through to the defaults.
To read contents it uses the SB wrapper API. This resolves UUID-backed contents from BackpackStorage automatically, so equipped, held, and stored backpacks are all weighed correctly.
Weight model
Matches the built-in backpack model:
effectiveWeight = emptyBackpackWeight + (contentsWeight / 2)
contentsWeightis computed by recursing each inner stack through Inventory Weight’s own lookup (context.nested()), so datapack weights, nested containers, and other add-ons all apply.- The result’s base weight carries the full (undivided) contents weight for display.
Notes
- If Sophisticated Backpacks is not installed, the provider is inactive (a warning is logged) and Inventory Weight uses its default behavior.
nested()is used when recursing to avoid runaway depth with nested backpacks.- The empty-backpack base weight is a single constant (
SophisticatedBackpacksInventoryWeight#EMPTY_BACKPACK_WEIGHT); wire it to fzzy_config if you want it user-configurable.
常见问题
Sophisticated Backpacks – MT Inventory Weight 支持哪些 Minecraft 版本?
Sophisticated Backpacks – MT Inventory Weight 支持 Minecraft Java 版 1.20.1–1.21.1,共 3 个版本,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。
Sophisticated Backpacks – MT Inventory Weight 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端和服务端都要装。
MEGATREX4 的其他作品
查看全部 →
MT Created Applied Energistics
Changing AE2 blocks and items to Created-like
MT Random Block Placement
Simple placement of random blocks from hotbar
MT Random Block Placement
Simple placement of random blocks from hotbar
MT Inventory Weight
Weight mechanics! Manage your load, balance inventory, and enhance survival or RPG-like gameplay.
评论
登录后评论和评分