修正readme

This commit is contained in:
1820982382
2026-08-08 03:14:17 +08:00
parent 0c72822f40
commit 2c1aabe78a
3 changed files with 21 additions and 14 deletions
+10 -7
View File
@@ -1,5 +1,7 @@
# TC KubeJS Bridge (tckubejsbridge)
> **English** | [中文](README.md)
Bridges the **Thaumcraft 4 (port)** recipe system to **KubeJS**, allowing modpack authors and
server admins to register TC infusion, crucible, arcane crafting recipes and item aspect tags
directly from KubeJS scripts — including **replacing existing recipes**.
@@ -39,7 +41,7 @@ Compile dependencies (local jars, paths editable in `build.gradle`):
## Script Usage
Put scripts into `kubejs/server_scripts/` and **restart the game** (see Note #1).
Put scripts into `kubejs/server_scripts/`, then **restart the game or run `/reload`** (see Note #1).
### 1. Infusion Recipe
@@ -154,12 +156,13 @@ ServerEvents.recipes(event => {
## Notes
1. **Restart after editing scripts — `/reload` does NOT work**:
- TC recipes live in the `ThaumcraftApi.getCraftingRecipes()` in-memory list, which KubeJS
`/reload` never clears.
- This mod's dedup set (keyed by research) is also not cleared on `/reload`.
- If you need `/reload` support later, call `thaumcraft.clearRegistered()` in the script
to reset the dedup set.
1. **Hot-reload supported**: after editing scripts, run `/reload` — no game restart needed.
- KubeJS re-runs `ServerEvents.recipes` on every `/reload`, so scripts execute again.
- With the "remove-then-register" pattern (`thaumcraft.removeInfusion(...)` followed by
`infusion(...)`), the removal step clears this mod's dedup key and drops the old recipe
from TC's in-memory list, so the new recipe registers correctly.
- Scripts that only add recipes (without removing first) will be dedup-skipped on repeated
`/reload`; call `thaumcraft.clearRegistered()` at the top of the script to reset the set.
2. **Research keys are globally unique**: duplicate keys are skipped (prevents double
registration). Use a different key for same-name recipes.
3. **Recipes do NOT go into the vanilla RecipeManager**: TC infusion/crucible/arcane recipes