Merge pull request 'jei_hides: Rhino-compatible (no array spread)' (#26) from fix/jei-hides-rhino-spread into main

This commit was merged in pull request #26.
This commit is contained in:
2026-05-23 16:18:51 +00:00
2 changed files with 12 additions and 7 deletions
@@ -42,12 +42,17 @@ const COIN_ITEMS = [
'numismatics:sun', '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 => { JEIEvents.hideItems(event => {
[...WAYSTONE_ITEMS, ...COIN_ITEMS].forEach(id => { // KubeJS uses Rhino, which doesn't support array-spread syntax
try { event.hide(id); } catch (e) { // (`[...a, ...b]`). Use .concat() for cross-engine safety.
// Some IDs may not exist (e.g. base 'waystones:sharestone' isn't WAYSTONE_ITEMS.concat(COIN_ITEMS).forEach(function(id) {
// registered if only colored variants are). Swallow per-item hideQuietly(event, id);
// failures so one bad id doesn't break the whole pass.
}
}); });
}); });
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"$schema": "Brass-and-Sigil pack.lock.json - generated, do not edit by hand unless you know what you are doing", "$schema": "Brass-and-Sigil pack.lock.json - generated, do not edit by hand unless you know what you are doing",
"name": "Brass and Sigil", "name": "Brass and Sigil",
"version": "0.21.0", "version": "0.21.1",
"minecraft": "1.21.1", "minecraft": "1.21.1",
"loader": { "loader": {
"type": "neoforge", "type": "neoforge",