move gurman recipes to the nicer syntax, make the food helper methods globals

This commit is contained in:
Pyritie 2026-01-02 23:26:27 +00:00
parent 35214065a6
commit c156605375
3 changed files with 569 additions and 912 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -3,15 +3,31 @@
TFCEvents.registerItemStackModifier(event => {
// for adding bowls to dynamic_bowl-type foods
event.withInput('tfg:add_bowl', (output, input) => {
TFC.misc.getFood(output).setBowl(input)
return output;
});
// for adding bowls to foods that are not dynamic_bowls
event.withInput('tfg:force_add_bowl', (output, input) => {
if (input.nbt) {
output.orCreateTag.merge(input.nbt)
}
if (output.nbt) {
output.nbt.put('bowl', { Count: 1, id: 'minecraft:bowl' });
}
else {
output.nbt = { bowl: { Count: true, id: 'minecraft:bowl' }};
}
return output;
});
// if you're doing any sort of recipe where you need the nbt copied from input to output
event.withInput('tfg:copy_nbt', (output, input) => {
let { nbt } = input
if (nbt) {
output.orCreateTag.merge(nbt)
if (input.nbt) {
output.orCreateTag.merge(input.nbt)
}
return output
})