refactor of soulbinding stuff, added recipes for the t2 suit

This commit is contained in:
Pyritie 2025-09-08 15:28:15 +01:00
parent 5b2f62d612
commit 7759242baf
3 changed files with 30 additions and 25 deletions

View file

@ -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}`);
})
}

View file

@ -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)
})
}

View file

@ -1,6 +1,11 @@
global.SOULBINDABLE_ITEMS = [
'ad_astra:space_helmet',
'ad_astra:space_suit',
'ad_astra:space_pants',
'ad_astra:space_boots'
]
{ 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' },
]