XGN Create Mounted Stacks
如果你在使用 Create 模组时安装了增大堆叠数量的模组,你可能遇到过这个问题:普通箱子中的物品堆叠数远超 64,但一旦打开安装在机械结构(如列车、移动建筑)上的箱子、桶或保险箱,你在菜单中触碰的任何东西都会重新分裂回 64。Shift+点击一个数量为 500 的堆叠,你会得到八个整齐的数量为 64 的小堆叠。
这是因为 Create 的机械结构存储菜单对“一个槽位能容纳多少”的回答是硬编码的 64。此模组移除了这个数字,让菜单使用容器真正的上限,因此每个槽位的限制变为物品本身允许的最大值。就像普通箱子一样。
如果你不使用增大堆叠数量的模组,则没有任何变化。物品本身的最高堆叠数就是 64,所以你获得的是原版行为。
功能说明
在 Create 的机械结构存储菜单包装器上应用单个 mixin。它将硬编码的 64 替换为 Container 接口中的默认值,即原版为 99,安装 Stack Size Tweaks 后为 1,000,000,000。游戏随后取容器上限和物品最大堆叠数中的较小值,结果即为物品自身的最大值。
这就是该模组的全部内容。没有添加任何方块、物品、配方、配置或命令,也不会向你的存档写入任何数据。
依赖要求
- Minecraft 1.21.1
- NeoForge 21.1.236 或更高版本
- Create 6.0 或更高版本。基于 6.0.10 构建并测试。
- 一个增大堆叠数量的模组(如果你确实想要超过 64 的堆叠)。我使用的是 Stack Size Tweaks 0.3.4。
安装方法
将 jar 文件放入与 Create 相同的 mods/ 目录中,客户端和服务端都需要放置。两边都会模拟菜单行为:服务端决定 Shift+点击实际移动多少物品,客户端决定拖动时你看到的内容。如果客户端没有安装此模组,即使服务端已安装,GUI 中仍会在 64 处分裂。
无需进行任何配置。
工作原理
Create 被声明为可选依赖项,且 mixin 未标记为必需,因此如果未安装 Create,该模组会加载但不执行任何操作。它不包含任何 Create 代码,也不是针对 Create 编译的。它在运行时通过名称修补一个方法,这也意味着只要该方法存在,它就能在 Create 更新后继续正常工作。
兼容性
任何提升堆叠数量的模组都与本模组兼容。本模组不关心你使用哪一个,它只是阻止 Create 的菜单覆盖答案。
为特定物品添加堆叠数量组件的数据包仍然会将这些物品的堆叠数限制为其设定的值,本模组无法更改这一点。如果某个特定物品在机械结构菜单中仍分裂为 64,请首先检查是否存在此类数据包。
另一个修改相同方法的模组应与此模组链式调用而非冲突。使用 Mixin 返回值修饰符时,最后应用的处理器决定最终值。
使用 Create 自身挂载存储 API 的 Create 扩展插件会打开相同的菜单包装器,因此它们也会获得相同的修复。
致谢与许可
Create 由 The Create Team 制作。其代码采用 MIT 许可证,其艺术资源保留所有权利。本模组不包含任何 Create 文件或 Create 代码。
保留所有权利。你可以使用此模组,但请勿重新分发此模组或其文件。
XGN Create Mounted Stacks
If you play Create with a stack size mod, you have probably run into this: items in a normal chest stack way past 64, but as soon as you open a chest, barrel or vault that is mounted on a contraption (a train, a moving structure), everything you touch in that menu splits back down to 64. Shift-click a stack of 500 and you get eight neat stacks of 64.
That happens because Create's contraption storage menu answers "how much fits in one slot" with a hard-coded 64. This mod removes that number and lets the menu use the container's real limit, so the per-slot cap becomes whatever the item itself allows. Same as an ordinary chest.
If you don't use a stack size mod, nothing changes. The item's maximum is 64 anyway, so you get plain vanilla behaviour.
What it does
A single mixin on Create's contraption storage menu wrapper. It swaps the hard-coded 64 for the default from the Container interface, which is 99 in vanilla and 1,000,000,000 with Stack Size Tweaks installed. The game then takes the smaller of the container limit and the item's max stack size, which works out to the item's own maximum.
That's the whole mod. No blocks, items, recipes, config, commands, and nothing written to your save.
Requirements
- Minecraft 1.21.1
- NeoForge 21.1.236 or newer
- Create 6.0 or newer. Built and tested against 6.0.10.
- A stack size mod if you actually want stacks above 64. I run it with Stack Size Tweaks 0.3.4.
Install
Put the jar in mods/ next to Create, on the client and on the server. Both sides simulate the menu: the server decides what a shift-click really moves, the client decides what you see while dragging. A client without the mod would still split at 64 in the GUI even if the server has it.
There is nothing to configure.
How it works
Create is declared as an optional dependency and the mixin is not marked required, so the mod should load and do nothing if Create isn't there. It contains no Create code and isn't compiled against Create. It patches one method by name at runtime, which also means it keeps working across Create updates for as long as that method exists.
Compatibility
Any mod that raises stack sizes works with this one. The mod doesn't care which one you use, it only stops Create's menu from overriding the answer.
Datapacks that put a stack size component on specific items will still cap those items at whatever they set, and this mod can't change that. If one particular item keeps splitting at 64 in a contraption menu, check for that first.
Another mod touching the same method should chain with this one rather than conflict. With Mixin return value modifiers the last handler applied decides the value.
Create add-ons that use Create's own mounted storage API open the same menu wrapper, so they get the same fix.
Credits and licence
Create is made by The Create Team. Its code is MIT licensed and its art is all rights reserved. This mod contains no Create files and no Create code.
All rights reserved. You may use this mod, but please don't redistribute it or its files.
评论 0
登录后参与评分
还没有评论,来抢沙发吧