AutoSell
一个客户端侧的 Fabric 模组,当你的物品栏已满时,它会自动为你运行服务器上的出售命令,并将你拾取的物品移入商店。
依赖项
- Minecraft 26.2
- Fabric Loader 0.18.5 或更高版本
- Fabric API
- Java 25
该模组仅在支持通过命令打开商店容器(例如 /sell)的服务器上有效。在单人游戏中,由于没有可交互的对象,它将毫无作用。
使用方法
按 K 键打开菜单。该按键可以在原版控制设置界面的 AutoSell 分类下重新绑定。
在菜单中你可以:
- 选择要出售的物品。点击网格中的物品会添加或移除它,最多可选 32 种。搜索框支持匹配显示名称和注册表 ID,旁边的复选按钮可将网格筛选为你已选择的物品。
- 设置物品栏阈值。当你的 36 个物品栏格子占用率达到设定百分比,且其中至少包含一种你已选择的物品时,AutoSell 就会触发。
- 设置命令。默认为
sell。前导斜杠会被自动去除,因此 sell 和 /sell 均可使用。
- 通过阈值滑块旁的小按钮选择 HUD 显示角。
按下启动并关闭菜单。当 AutoSell 运行时,所选角落会出现一个小方框,显示即将出售的物品。其边框颜色随当前状态变化:监视物品栏时为绿色,等待商店打开时为橙色,移动物品时为青色。
触发后,AutoSell 会发送命令,等待容器打开,迅速将你物品栏中所有匹配的物品堆移出,然后再次关闭容器。商店自身格子里的物品永远不会被触碰。
如果连续三次尝试都无法成功打开商店,AutoSell 会自动停止,并在聊天栏中提示你。当你离开服务器或在未选择任何物品的情况下关闭菜单时,它也会停止运行。
配置
设置保存在 config/autosell.json 中,每次你在菜单中更改内容时都会写入文件。
{
"selectedItemIds": ["minecraft:cobblestone"],
"inventoryThreshold": 90,
"sellCommand": "sell",
"hudCorner": "TOP_RIGHT"
}
hudCorner 接受 TOP_LEFT、TOP_RIGHT、BOTTOM_LEFT 和 BOTTOM_RIGHT 四个值。inventoryThreshold 的值会被限制在 1 到 100 之间。无法解析的物品 ID 会被跳过而非从文件中删除,因此缺失的模组不会导致你的选择被清空。
构建
./gradlew build
生成的 jar 包位于 build/libs 目录下。使用 ./gradlew runClient 可以启动开发环境客户端。
贡献代码
欢迎提交拉取请求。请 Fork 仓库,在分支上进行修改,并描述你做了哪些更改以及原因。请保持与现有代码风格一致,并在提交请求前确保 ./gradlew build 构建通过。
问题与功能请求
请在 GitHub 上开启 Issue。对于 Bug,请提供复现步骤、你的 Minecraft 和模组版本,以及相关日志片段。对于新功能请求,请描述你想要实现的功能,以及当前行为是如何造成阻碍的。
AutoSell
A client side Fabric mod that runs your server's sell command for you once your
inventory fills up, and moves the items you picked into the shop.
Requirements
- Minecraft 26.2
- Fabric Loader 0.18.5 or newer
- Fabric API
- Java 25
The mod only does something useful on servers where a command opens a shop
container, for example /sell. In singleplayer there is nothing for it to talk
to.
Usage
Press K to open the menu. The key can be rebound in the vanilla controls
screen under the AutoSell category.
In the menu you can:
- Pick the items to sell. Clicking an item in the grid adds or removes it, and
you can select up to 32. The search box matches display names and registry
IDs, and the check button next to it narrows the grid down to what you already
picked.
- Set the inventory threshold. AutoSell triggers once that percentage of your
36 inventory slots is occupied and at least one of your selected items is in
there.
- Set the command. Default is
sell. A leading slash is stripped, so both
sell and /sell work.
- Choose the HUD corner with the small button next to the threshold slider.
Press start and close the menu. While AutoSell runs, a small box in the chosen
corner shows the items it will sell. Its border colour follows the current
state: green while watching the inventory, orange while waiting for the shop,
cyan while moving items.
When it triggers, AutoSell sends the command, waits for the container to open,
quick moves every matching stack out of your own inventory, and closes the
container again. Items sitting in the shop's own slots are never touched.
AutoSell stops on its own if the command fails to open a shop three times in a
row, and tells you so in chat. It also stops when you leave the server, or when
you close the menu with nothing selected.
Configuration
Settings are stored in config/autosell.json and are written whenever you
change something in the menu.
{
"selectedItemIds": ["minecraft:cobblestone"],
"inventoryThreshold": 90,
"sellCommand": "sell",
"hudCorner": "TOP_RIGHT"
}
hudCorner accepts TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT and BOTTOM_RIGHT.
inventoryThreshold is clamped to 1 through 100. Item IDs that no longer
resolve are skipped instead of being dropped from the file, so a missing mod
does not wipe your selection.
Building
./gradlew build
The jar ends up in build/libs. Use ./gradlew runClient for a development
client.
Contributing
Pull requests are welcome. Fork the repository, work on a branch, and describe
what you changed and why. Please match the existing code style and make sure
./gradlew build passes before you open the request.
Issues and feature requests
Open an issue on GitHub. For bugs, include the steps to reproduce, your
Minecraft and mod versions, and the relevant part of your log. For features,
describe what you want to do and why the current behaviour gets in the way.
评论 0
登录后参与评分
还没有评论,来抢沙发吧