Inventory Organizer — 完整描述
一个 Fabric 模组,可一键整理你的物品栏和储物空间,并提供服务器感知的多箱“仓库”系统、一系列可选自动化功能以及远程合成。支持 Minecraft 26.1 / 26.1.1 / 26.1.2。环境要求:"*" —— 这是一个客户端模组(客户端必需),并带有可选的服务器端支持以解锁多人共享功能。
第一部分 — 所有功能
排序
OI (Organize Inventory,整理物品栏):一键整理整个物品栏——相同物品合并为满堆叠,同类物品归类在一起。
OST (Organize STorage,整理储物):对当前打开的箱子执行相同的操作。
排序快捷键:打开箱子时执行 OST,否则执行 OI。“排序动作”设置可选择行为模式:智能(默认)、仅 OI、仅 OST 或两者。
堆叠合并:将分散的半满堆叠重新合并为完整的堆叠。
槽位配置编辑器
主屏幕(S 按钮或快捷键)。顶部标签页:Inv(物品栏)、Storage(储物)、Groups(组)。
Inv 标签页:显示你物品栏的实时视图。从右侧调色板中选择一条规则,然后左击槽位进行分配;右击将槽位重置为“任意”。
规则:any(接受任何物品)、empty(保持为空)、Groups(武器、工具、盔甲、方块、食物、贵重物品、药水、投掷类、箭矢、实用工具、其他)、子组(原木、船只等)或指定物品。搜索框可筛选 1600+ 种物品。
盔甲 + 副手:针对头盔/胸甲/护腿/靴子和盾牌/副手槽位的规则。
自动补充标记:中击快捷栏槽位,将其标记为绿色 R(参见自动化部分)。
底部行:Save(保存)、Clear(清除)、Kits(套装)、Names(名称)、Ranks(优先级顺序)、Back(返回),以及可用时的 Warehouse(仓库)。
帮助:Guide 按钮(完整手册)和 ? 快速提示覆盖层(点击外部关闭)。
每个箱子的配置文件
每个箱子都可以记住自己的排序布局。打开箱子 → 出现 New profile?(新建配置?)提示 → 选择 Yes(是)。
身份识别按以下顺序解析:铁砝自定义名称 → 精确方块坐标(双层箱的两半均适用)→ 相邻告示牌文本。箱子旁的告示牌也可为其命名配置文件。
携带模式:配置文件仅在打开其对应箱子时处于“激活”状态;Pr 按钮可将携带的配置文件重新绑定到当前打开的箱子。没有标记表示该箱子非储物用途(在地图中隐藏)。
配置文件是私有且本地的——绝不共享。
组与优先级顺序(Ranks)
Groups 标签页/编辑器:编辑内置的物品组或创建自定义组,使规则完全符合你的意图。
Tier Order(优先级顺序/Ranks):在同一类型内,设置优先级顺序以确保排序确定性(例如,下界合金高于钻石)。双击槽位可直接跳转至其中。
Kits(套装)
将整个槽位配置布局保存为命名的 Kit,以便日后加载。Cycle slot preset(循环槽位预设)快捷键可在已保存的 Kit 之间快速切换。
Warehouses(链接箱子)
Warehouse 地图(Wh 按钮/快捷键)是你箱子的俯视视图。
将 2 个或以上邻近(在范围内且相连)的箱子链接为一个仓库;在任何成员箱上执行 OST,或在地图上执行 Sort,即可对整个组进行整理。取消链接则解散该组。
在服务器上,链接默认为私有;只有当其他玩家打开其中一个箱子后,才会向其显示该链接(随后整个仓库会出现在他们的地图上)。
权限与防盗(服务器端)
每位玩家的 OST 权限:选择你自己的链接 → OST 按钮 → 已知玩家选择器,可逐个开关权限。默认关闭——被揭示的链接可见但不可排序,除非获得授权。
防盗机制(服务器强制执行):你不能将他人仓库中的箱子链接进去,不能从他人的链接中远程提取物品,也不能在未获授权的情况下对链接进行排序。
Automations(自由模式)
Auto‑refill(自动补充,绿色 R):被标记的快捷栏槽位在空时会从你的物品栏中自动补充,使用槽位规则或上次存放的物品。
Chest refill(箱子补充,Rf):一次按键从当前打开的箱子中补充所有被标记的快捷栏槽位。
Deposit‑all(全部存入,Dep):将所有物品栏中已有物品存在于箱子内的堆叠返还至箱子。
Scroll(滚动):普通滚轮滚动可快速移动槽位内容;Shift+滚轮每滚一格排序一种物品。
Trash / Void(垃圾桶/虚空,位于 Storage 下方):规则网格;匹配的物品在拾取时被丢弃。Trash mode 切换键可在 Drop‑all(全部丢弃)和 Keep‑1‑stack(保留一组)之间切换。
远程合成
物品栏和合成台旁边的材料面板列出了附近箱子的合并内容(图标 + 名称 + 数量),支持搜索和数量输入框;点击即可将物品拉取到你的物品栏中。范围:单人模式下在合成台旁为 60 格,其他位置为 15 格。
服务器友好性与安全性
Quick switch(快速切换,主模式):一个按钮在所有模式间切换为 Server‑Friendly(服务器友好)或 Free(自由)。
Free gating(自由模式限制):自动化功能仅在私有/白名单环境(单人游戏、局域网、Realms、Aternos、白名单服务器)中运行;在普通公共服务器上关闭。
Whitelist(白名单,可选加入):添加受信任的服务器(需经过确认)以在其上启用 Free 功能。
Fight mode(战斗模式):真实 PvP 会强制切换到 Server‑Friendly 约 20 秒(带有一个小型 HUD 计时器);在公共服务器上始终保持开启,因此该模组绝不会给予战斗优势。
Death auto‑sort(死亡后自动排序):可选地在回收装备后重新排序。
Keybinds(Controls → Inventory Organizer,控制 → Inventory Organizer)
默认全部未绑定:Sort(排序)、Open Kits(打开套装)、Open Settings(打开设置)、Open Warehouse map(打开仓库地图)、Chest refill(箱子补充)、Cycle slot preset(循环槽位预设)。Keybind mode 设置(仅限物品栏 / 自由 / 关闭)控制这些快捷键可以在何处触发。
帮助与语言
一份完整的、自动换行的游戏内指南(首次进入设置时自动打开)以及每个屏幕的 ? 快速帮助。
9 种语言:English, Magyar, Deutsch, Español, Français, 中文, 日本語, Русский, Português,按钮标签已调整大小,以防止翻译文本溢出。
第二部分 — 构建方式(架构)
端侧与入口点
Environment "*" — 在两端加载。主入口点注册网络载荷类型(通用部分)和服务端接收器;客户端入口点注册按键绑定、屏幕钩子(Fabric ScreenEvents)、HUD 元素和客户端刻钟逻辑。
核心拆分:客户端拥有所有 UI/排序/配置功能;服务端仅拥有共享仓库链接存储 + 排序引擎 + 远程合成聚合。
配置(客户端,本地)
OrganizerConfig — 一个 JSON 配置文件,包含槽位规则、存储预设、自定义组、仓库组(本地链接)、已知箱子、工具箱、按键/排序设置、白名单、垃圾桶规则等。
StoragePreset — 单个箱子的布局(槽位规则、尺寸、身份标识:名称/位置/告示牌)。SlotRule、WarehouseGroup — 支持性数据。
排序
InventorySorter / SortLogic — 物品栏排序 + 规则匹配 + 堆叠合并。
StorageSorter — 使用当前 StoragePreset 进行箱子排序。
ChestIdentifier(客户端)— 确定打开的箱子当前激活的是哪个本地配置(名称 → 坐标 → 告示牌),以及该箱子是否属于外部链接(仅排序用)。
仓库子系统
WarehouseClient — 客户端状态:握手标志、可见链接缓存(自身 + 已揭示的外部)、远程合成库存、OST 成员列表缓存以及所有发送辅助函数。
WarehouseNet — 注册载荷和服务端接收器;服务端线程执行所有工作。
WarehouseLinks — 服务端的链接存储(所有者、维度、位置、所有者的单箱规则、OST 允许列表)+ 加入玩家名单;持久化保存到 inventory-organizer-warehouse-links.json。
WarehouseEngine — 排序引擎:从组中提取所有物品到池中,然后将每个堆叠重新放置到规则匹配度最高的箱子中(支持双箱感知,距离防护)。
RemoteStock — 服务端远程合成功能:聚合附近箱子的内容并提取物品(跳过外部链接箱子)。
WarehouseMapScreen, OstPermScreen — 地图 UI 和 OST 权限选择器。
网络通信(握手门控)
加入服务器时,服务器发送 WarehouseHelloPayload;客户端设置可用标志。在此之前,客户端不发送任何数据,因此在原版服务器上该模组完全静默。
客户端→服务端:仓库地图查询、上传/删除链接、排序链接、排序组、请求 OST 名单、设置 OST 权限、合成库存查询、合成提取。
服务端→客户端:你好、链接地图数据、OST 名单、合成库存。
每个服务端操作都会重新验证距离和所有权/权限,绝不信任客户端;防垃圾邮件冷却机制保护排序和提取操作。
客户端集成与健壮性
Mixins: CreativeInventoryScreenMixin(创意模式物品栏中的按钮)、InventoryScreenMixin、ContainerScreenAccessor(leftPos/topPos/hovered slot)、ContainerScrollMixin(容器屏幕上的滚动)。
FightModeTracker(防篡改 PvP 检测 + HUD)、ServerEnvironment(自由模式门控)、DeathSortTracker。
UI 具备自适应大小能力:布局在 init() 中重建(调整大小时重新运行);一个通用守卫会在屏幕缓存尺寸与窗口尺寸不同时强制重新初始化;leftPos 监听器会在配方书改变 GUI 时重新排列游戏内覆盖层。
构建与发布
单一 Java 源代码库;按版本的项目(26.1 / 26.1.1 / 26.1.2)共享相同代码,但带有特定版本的 Fabric 元数据。每个 Minecraft 版本分发为一个 jar 文件。
Inventory Organizer — Full description
A Fabric mod for organising your inventory and your storage with one click, plus a server‑aware multi‑chest "warehouse" system, a set of optional automations, and remote crafting. Runs on Minecraft 26.1 / 26.1.1 / 26.1.2. environment: "*" — it's a client‑side mod (required on the client) with optional server‑side support that unlocks the shared multiplayer features.
Part 1 — Every feature
Sorting
OI (Organize Inventory): one click sorts your whole inventory — identical items merge into full stacks, the same types group together.
OST (Organize STorage): does the same to the chest you have open.
Sort keybind: OST when a chest is open, otherwise OI. A Sort action setting picks the behaviour: Smart (default), OI‑only, OST‑only, or Both.
Stack consolidation: scattered partial stacks of one item are merged back into full stacks.
The Slot Config editor
The central screen (the S button or a keybind). Tabs across the top: Inv, Storage, Groups.
Inv tab: a live picture of your inventory. Pick a rule from the right‑hand palette, then left‑click a slot to assign it; right‑click resets a slot to any.
Rules: any (accepts anything), empty (kept empty), Groups (Weapons, Tools, Armor, Blocks, Food, Valuables, Potions, Splash, Arrows, Utility, Misc), Sub‑groups (Logs, Boats, …), or a specific item. A search box filters 1600+ items.
Armor + offhand: rules for helmet / chestplate / leggings / boots and the shield/offhand slot.
Auto‑refill marker: middle‑click a hotbar slot to flag it with a green R (see Automations).
Bottom row: Save, Clear, Kits, Names, Ranks (Tier Order), Back, and Warehouse when available.
Help: a Guide button (full manual) and a ? quick‑tip overlay (click outside to close).
Per‑chest profiles
Each chest can remember its own sort layout. Open a chest → New profile? → Yes.
Identity is resolved by, in order: anvil custom name → exact block coordinates (both halves of a double chest) → adjacent‑sign text. A sign next to a chest also names its profile.
Carrying mode: a profile becomes "active" only while its chest is open; the Pr button re‑binds a carried profile to the open chest. Nothing marks a chest as non‑storage (hidden from the map).
Profiles are private and local — never shared.
Groups & Tier Order (Ranks)
Groups tab / editor: edit the built‑in item groups or create custom groups so rules match exactly what you mean.
Tier Order (Ranks): within a type, set the priority order so sorting is deterministic (e.g. netherite above diamond). Double‑click a slot to jump straight into it.
Kits
Save a whole slot‑config layout as a named Kit and load it later. A Cycle slot preset keybind flips between saved Kits on the fly.
Warehouses (linked chests)
The Warehouse map (Wh button / keybind) is a top‑down view of your chests.
Link 2+ nearby chests (within range, connected) into one warehouse; OST at any member — or Sort on the map — organises the whole group together. Unlink breaks it up.
On servers, links are private by default; a foreign link is revealed to another player only after they open one of its chests (then the whole warehouse shows on their map).
Permissions & anti‑theft (servers)
Per‑player OST permission: select your own link → OST button → a picker of known players, each toggled on/off. Default off — a revealed link is visible but not sortable until granted.
Anti‑theft (server‑enforced): you can't link a chest that's in someone else's warehouse, can't remote‑withdraw from a foreign link, and can't sort a link without permission.
Automations (Free mode)
Auto‑refill (green R): a marked hotbar slot refills itself from your inventory when it empties, using the slot's rule or the last item that was there.
Chest refill (Rf): top up every marked hotbar slot from the open chest in one press.
Deposit‑all (Dep): send back every inventory stack whose item is already in the chest.
Scroll: plain‑scroll a slot to quick‑move it; Shift+scroll sorts one item per notch.
Trash / Void (under Storage): a rule grid; matching items are dropped on pickup. A Trash mode toggle switches Drop‑all vs Keep‑1‑stack.
Remote crafting
A materials panel by the inventory and crafting table lists the combined contents of nearby chests (icon + name + count) with search and a quantity box; click to pull items to your inventory. Range: 60 blocks at a table in single‑player, 15 elsewhere.
Server‑friendliness & safety
Quick switch (master mode): one button flips everything between Server‑Friendly and Free.
Free gating: automations only run in private/whitelisted environments (single‑player, LAN, Realms, Aternos, whitelisted servers); off on normal public servers.
Whitelist (opt‑in): add a trusted server (behind a confirmation) to enable Free features there.
Fight mode: real PvP forces Server‑Friendly for ~20s (with a small HUD timer); kept on at all times on public servers, so the mod never gives a combat edge.
Death auto‑sort: optionally re‑sorts after you recover your gear.
Keybinds (Controls → Inventory Organizer)
All unbound by default: Sort, Open Kits, Open Settings, Open Warehouse map, Chest refill, Cycle slot preset. A Keybind mode setting (Inventory‑only / Free / Off) controls where they're allowed to fire.
Help & languages
A full, word‑wrapped in‑game Guide (auto‑opens on first settings entry) and a per‑screen ? quick help.
9 languages: English, Magyar, Deutsch, Español, Français, 中文, 日本語, Русский, Português, with button labels sized so translations don't overflow.
Part 2 — How it's built (architecture)
Sides & entry points
Environment "*" — loads on both sides. The main entrypoint registers the networking payload types (common) and the server‑side receivers; the client entrypoint registers keybinds, screen hooks (Fabric ScreenEvents), the HUD element, and the client tick.
Core split: the client owns all UI/sorting/config; the server owns only the shared warehouse link store + sort engine + remote‑craft aggregation.
Configuration (client, local)
OrganizerConfig — a JSON config holding slot rules, storage presets, custom groups, warehouse groups (local links), known chests, Kits, keybind/sort settings, whitelist, trash rules, etc.
StoragePreset — one chest's layout (slot rules, size, identity: name/positions/sign). SlotRule, WarehouseGroup — supporting data.
Sorting
InventorySorter / SortLogic — inventory sort + rule matching + stack consolidation.
StorageSorter — chest sort using the active StoragePreset.
ChestIdentifier (client) — resolves which local profile is active for the open chest (name → coordinates → sign), and whether the chest belongs to a foreign link (sort‑only).
Warehouse subsystem
WarehouseClient — client‑side state: the handshake flag, the visible‑links cache (own + revealed foreign), the remote‑craft stock, the OST‑roster cache, and all the send helpers.
WarehouseNet — registers payloads and the server receivers; the server thread does all the work.
WarehouseLinks — server‑side store of links (owner, dimension, positions, the owner's per‑chest rules, OST allow‑list) + a joined‑player roster; persisted to inventory-organizer-warehouse-links.json.
WarehouseEngine — the sort engine: pulls all items from a group into a pool, then re‑places each stack into the chest whose rule matches best (double‑chest aware, distance‑guarded).
RemoteStock — server‑side remote‑craft: aggregates nearby chest contents and withdraws items (skips foreign‑link chests).
WarehouseMapScreen, OstPermScreen — the map UI and the OST permission picker.
Networking (handshake‑gated)
On join the server sends WarehouseHelloPayload; the client sets an available flag. Until then the client sends nothing, so on a vanilla server the mod is completely silent.
Client→server: warehouse map query, upload/delete link, sort link, sort group, request OST roster, set OST permission, craft stock query, craft withdraw.
Server→client: hello, link map data, OST roster, craft stock.
Every server action re‑validates distance and ownership/permission and never trusts the client; anti‑spam cooldowns guard sorting and withdrawing.
Client integration & robustness
Mixins: CreativeInventoryScreenMixin (buttons in the creative inventory), InventoryScreenMixin, ContainerScreenAccessor (leftPos/topPos/hovered slot), ContainerScrollMixin (scroll on container screens).
FightModeTracker (tamper‑resistant PvP detection + HUD), ServerEnvironment (Free‑mode gating), DeathSortTracker.
UI is resize‑safe: layout is rebuilt in init() (re‑run on resize); a universal guard forces a re‑init when the screen's cached size differs from the window, and a leftPos watcher re‑lays‑out the in‑game overlays when the recipe book shifts the GUI.
Build & releases
Single Java source base; per‑version projects (26.1 / 26.1.1 / 26.1.2) share the same code with version‑specific Fabric metadata. Distributed as one jar per Minecraft version.
评论 0
登录后参与评分
还没有评论,来抢沙发吧