From 7759242bafaa98fa4d13f59aaa145ce9df6a4ffb Mon Sep 17 00:00:00 2001 From: Pyritie Date: Mon, 8 Sep 2025 15:28:15 +0100 Subject: [PATCH] refactor of soulbinding stuff, added recipes for the t2 suit --- kubejs/server_scripts/soulbound/recipes.js | 36 ++++++++++---------- kubejs/server_scripts/soulbound/tags.js | 4 +-- kubejs/startup_scripts/soulbind/constants.js | 15 +++++--- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/kubejs/server_scripts/soulbound/recipes.js b/kubejs/server_scripts/soulbound/recipes.js index 261449a88..19f67affa 100644 --- a/kubejs/server_scripts/soulbound/recipes.js +++ b/kubejs/server_scripts/soulbound/recipes.js @@ -2,24 +2,24 @@ "use strict"; const registerSoulboundRecipes = (event) => { - - global.SOULBINDABLE_ITEMS.forEach(item => { - event.shapeless(Item.of(item, '{soulbindingSoulboundItems:1b}'), ['endermanoverhaul:soul_pearl', item]) - .modifyResult((craftingGrid, result) => { - let orig = craftingGrid.find(Ingredient.of(item)) - - result.nbt.put("Damage", orig.nbt.getInt("Damage")); - if(item === 'ad_astra:space_suit') { - try { - result.nbt.put('BotariumData', orig.nbt.get('BotariumData')) - } catch (exception) { - console.error(exception); + + global.SOULBINDABLE_ITEMS.forEach(x => { + event.shapeless(Item.of(x.equipment, '{soulbindingSoulboundItems:1b}'), [x.item, x.equipment]) + .modifyResult((craftingGrid, result) => { + let orig = craftingGrid.find(Ingredient.of(x.equipment)) + + result.nbt.put("Damage", orig.nbt.getInt("Damage")); + if (x.equipment === 'ad_astra:space_suit' || x.equipment === 'ad_astra:netherite_space_suit') { + try { + result.nbt.put('BotariumData', orig.nbt.get('BotariumData')) + } catch (exception) { + console.error(exception); + } } - } - result.nbt.put('soulbindingSoulboundItems', true) - return result; - }).id(`tfg:soulbind_${item}`); - + result.nbt.put('soulbindingSoulboundItems', true) + return result; + }).id(`tfg:soulbind_${x.equipment}`); + }) - + } \ No newline at end of file diff --git a/kubejs/server_scripts/soulbound/tags.js b/kubejs/server_scripts/soulbound/tags.js index 56a7ae883..eae933e2f 100644 --- a/kubejs/server_scripts/soulbound/tags.js +++ b/kubejs/server_scripts/soulbound/tags.js @@ -4,7 +4,7 @@ const registerSoulboundItemTags = (event) => { - global.SOULBINDABLE_ITEMS.forEach(item => { - event.add('tfg:soulbindable_items', item) + global.SOULBINDABLE_ITEMS.forEach(x => { + event.add('tfg:soulbindable_items', x.equipment) }) } diff --git a/kubejs/startup_scripts/soulbind/constants.js b/kubejs/startup_scripts/soulbind/constants.js index 4aaa76a8b..b332e784c 100644 --- a/kubejs/startup_scripts/soulbind/constants.js +++ b/kubejs/startup_scripts/soulbind/constants.js @@ -1,6 +1,11 @@ global.SOULBINDABLE_ITEMS = [ - 'ad_astra:space_helmet', - 'ad_astra:space_suit', - 'ad_astra:space_pants', - 'ad_astra:space_boots' - ] \ No newline at end of file + { equipment: 'ad_astra:space_helmet', item: 'endermanoverhaul:soul_pearl' }, + { equipment: 'ad_astra:space_suit', item: 'endermanoverhaul:soul_pearl' }, + { equipment: 'ad_astra:space_pants', item: 'endermanoverhaul:soul_pearl' }, + { equipment: 'ad_astra:space_boots', item: 'endermanoverhaul:soul_pearl' }, + + { equipment: 'ad_astra:netherite_space_helmet', item: 'sandworm_mod:sandworm_tooth' }, + { equipment: 'ad_astra:netherite_space_suit', item: 'sandworm_mod:sandworm_tooth' }, + { equipment: 'ad_astra:netherite_space_pants', item: 'sandworm_mod:sandworm_tooth' }, + { equipment: 'ad_astra:netherite_space_boots', item: 'sandworm_mod:sandworm_tooth' }, +] \ No newline at end of file