Sophisticated Backpacks - MT Inventory Weight 图标

Sophisticated Backpacks - MT Inventory Weight

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 1.0.0
本资源为搬运资源,原资源地址: https://modrinth.com/mod/sb-inventoryweight
资源信息

Minecraft 版本: 1.21.1

平台: fabric

标签: management storage utility

资源介绍

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)
  • contentsWeight is 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.
下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
The Witcher - An Origins Addon

价格:0 墨喵币
下载量:0

查看详情
In Ink we Rise (Defile)

价格:0 墨喵币
下载量:1

查看详情
Strong crops

价格:0 墨喵币
下载量:0

查看详情
Penguin Totem

价格:0 墨喵币
下载量:0

查看详情