From d24f7f03a34e30275b9516f5bbd4b4a7e7a69c56 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 23 May 2026 16:22:01 +0000 Subject: [PATCH] kubejs: drop jei_hides.js (wrong API binding), 0.21.1 -> 0.21.2 Two consecutive client_scripts errors traced to jei_hides.js: 1. Array-spread syntax not supported by Rhino (fixed in 0.21.1) 2. JEIEvents global is not defined in KubeJS 2101.7 -- the actual JEI event API uses classes like JEIRemoveEntriesKubeEvent but the binding name is something different we haven't identified yet. Rather than ship more guesses, drop the script entirely. Functional impact is minimal: recipes for waystones + coins are still removed server-side (recipes_waystones.js, recipes_numismatics.js), so players cannot craft these items even if they appear in JEI search. The only loss is some JEI clutter. When we identify the correct JEI hide API in KubeJS 2101.x, can add back as kubejs/client_scripts/jei_hides.js with the right binding. --- .../kubejs/client_scripts/jei_hides.js | 58 ------------------- pack/pack.lock.json | 2 +- 2 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 pack/overrides/kubejs/client_scripts/jei_hides.js diff --git a/pack/overrides/kubejs/client_scripts/jei_hides.js b/pack/overrides/kubejs/client_scripts/jei_hides.js deleted file mode 100644 index 637a36e..0000000 --- a/pack/overrides/kubejs/client_scripts/jei_hides.js +++ /dev/null @@ -1,58 +0,0 @@ -// Brass & Sigil — JEI hides -// -// Hides all Waystones items + all Numismatics coin items from the JEI -// item list. Combined with the server-side recipe removal in -// economy_policy.js, players don't see crafting recipes OR the item -// icons in the JEI ingredient list -- they only ever encounter these -// items through the welcome grant or the bank exchange. - -const COLORS = [ - 'white', 'orange', 'magenta', 'light_blue', 'yellow', 'lime', - 'pink', 'gray', 'light_gray', 'cyan', 'purple', 'blue', - 'brown', 'green', 'red', 'black', -]; - -const WAYSTONE_ITEMS = [ - // regular waystone variants - 'waystones:waystone', - 'waystones:mossy_waystone', - 'waystones:sandy_waystone', - 'waystones:blackstone_waystone', - 'waystones:deepslate_waystone', - 'waystones:end_stone_waystone', - // handheld + plate - 'waystones:warp_stone', - 'waystones:warp_scroll', - 'waystones:bound_scroll', - 'waystones:return_scroll', - 'waystones:warp_plate', - // sharestones (16 colors) + shards - 'waystones:sharestone', // base id if registered -]; -COLORS.forEach(c => { - WAYSTONE_ITEMS.push(`waystones:${c}_sharestone`); - WAYSTONE_ITEMS.push(`waystones:${c}_portstone`); -}); - -const COIN_ITEMS = [ - 'numismatics:spur', - 'numismatics:bevel', - 'numismatics:cog', - 'numismatics:crown', - 'numismatics:sun', -]; - -// Some IDs may not exist (e.g. base 'waystones:sharestone' isn't -// registered if only colored variants are). Swallow per-item failures -// so one bad id doesn't break the whole pass. -function hideQuietly(event, id) { - try { event.hide(id); } catch (e) {} -} - -JEIEvents.hideItems(event => { - // KubeJS uses Rhino, which doesn't support array-spread syntax - // (`[...a, ...b]`). Use .concat() for cross-engine safety. - WAYSTONE_ITEMS.concat(COIN_ITEMS).forEach(function(id) { - hideQuietly(event, id); - }); -}); diff --git a/pack/pack.lock.json b/pack/pack.lock.json index fe54bab..07a3f03 100644 --- a/pack/pack.lock.json +++ b/pack/pack.lock.json @@ -1,7 +1,7 @@ { "$schema": "Brass-and-Sigil pack.lock.json - generated, do not edit by hand unless you know what you are doing", "name": "Brass and Sigil", - "version": "0.21.1", + "version": "0.21.2", "minecraft": "1.21.1", "loader": { "type": "neoforge", -- 2.52.0