# AmmoToBox
**Tired of manually clicking hundreds of loose bullets into your ammo boxes? Let AmmoToBox handle it for you!**
AmmoToBox is a lightweight utility mod designed for [Timeless and Classics Zero (TaCZ)](https://www.curseforge.com/minecraft/mc-mods/timeless-and-classics-zero). It allows you to instantly pack loose ammo and auto-craft missing rounds directly into your ammo boxes.
## ✨ Features
* **⚡ One-Click Packing**: Scans your main inventory and even **Shulker Boxes** to pull out loose ammo instantly.
* **⚙️ Smart Auto-Crafting**: Automatically reads TaCZ Gun Smith Table recipes. If you have the materials, it will auto-craft the bullets and put them directly into the box.
* **🖥️ Interactive Settings GUI**: Press the `V` key to open a visual UI. Players can toggle auto-crafting and freely exclude specific containers (like Shulker Boxes) from being scanned to protect their resources.
* **🛡️ Snapshot & Verify Safety**: Uses a "scan first, verify, then deduct" architecture with overflow protection. It 100% prevents item duplication or swallowing bugs. If a server owner misconfigures the deduction order, the mod will safely abort instead of consuming items.
* **🔧 Dynamic Config Updates**: Server owners can tweak settings in the `.toml` file on the fly. No server restart required!
## 🎮 How to Use
1. **Set the Ammo Type**: Manually put at least ONE bullet into an empty ammo box.
2. **One-Click Pack**: Hold the ammo box in your main hand, **Sneak (Shift) + Right-Click**.
3. **Player Settings**: Press the **`V`** key (configurable in controls) to open the settings panel to toggle auto-crafting or exclude containers.
## 🔧 Commands & Configs
For Server Owners, the config file is located in `serverconfig/ammotobox-server.toml`:
- `enableAutoCraft`: Globally enable/disable auto-crafting.
- `autoCraftDefault`: Default auto-craft state for new players.
- `maxCraftsPerOperation`: Max crafting batches per operation.
- `ammoBoxMaxCount`: Maximum capacity per ammo box.
- `deductionOrder`: The order to deduct items (e.g., `["vanilla", "shulker"]`).
- `compatShulkerBox`: Allow extracting from Shulker Boxes.
## 📌 Dependencies
- **Requires**: [Timeless and Classics Zero (TaCZ)](https://www.curseforge.com/minecraft/mc-mods/timeless-and-classics-zero)
- **Minecraft Version**: 1.20.1
- **Mod Loader**: Forge
---
---
# 弹药打包机 (AmmoToBox)
**厌倦了手动把几百发零散子弹一发发塞进弹药箱?让弹药打包机来帮你!**
这是一个为 [永恒枪械工坊:零 (TaCZ)](https://www.curseforge.com/minecraft/mc-mods/timeless-and-classics-zero) 量身定制的轻量级实用模组。它可以让你一键将背包里的散装子弹打包进弹药箱,并在材料充足时自动为你现场合成子弹并装箱。
## ✨ 核心特性
* **⚡ 一键打包**:自动扫描主背包及**潜影盒内部**,瞬间提取所有同型号的散装弹药。
* **⚙️ 智能自动合成**:自动读取 TaCZ 枪械工作台配方。材料足够时,自动扣除材料并合成弹药直接装箱,完美支持物品标签。
* **🖥️ 交互式设置面板**:按下 **`V`** 键即可呼出可视化 UI。玩家可直观地开关自动合成,并自由选择排除不想被检索的容器(如潜影盒),防止误用珍贵材料。
* **🛡️ 快照校验,绝对安全**:采用“快照-校验-扣除”的严格事务机制与 long 防溢出保护,彻底杜绝刷物品/吞物品的 Bug。若服主写错扣除顺序,模组会安全拦截并提示,防患于未然。
* **🔧 极速热重载**:服主修改 `.toml` 配置文件并保存后,设置即刻生效,**完全不需要重启服务器**!
## 🎮 如何使用
1. **确定型号**:先手动往弹药箱里装入至少一发子弹。
2. **一键装填**:手持弹药箱,**潜行 (Shift) + 右键**。
3. **玩家设置**:按 **`V`** 键呼出面板,可直观管理自动合成状态与容器检索白名单。
## 🔧 服主配置说明
配置文件位于 `serverconfig/ammotobox-server.toml`:
- `enableAutoCraft`:全局启用/禁用自动合成。
- `autoCraftDefault`:新玩家的默认自动合成状态。
- `maxCraftsPerOperation`:单次打包允许的最大合成批次。
- `ammoBoxMaxCount`:单个弹药箱的最大容量。
- `deductionOrder`:扣除物品的顺序(如 `["vanilla", "shulker"]`)。
- `compatShulkerBox`:是否允许从潜影盒中提取弹药/材料。
## 📌 前置依赖
- **必须安装**:[永恒枪械工坊:零 (TaCZ)](https://www.curseforge.com/minecraft/mc-mods/timeless-and-classics-zero)
- **游戏版本**:1.20.1
- **加载器**:Forge

