#Giving tag to Gas/Fluid

29 messages · Page 1 of 1 (latest)

placid bluff
#

Hey wanted to be able to use different mods oxygens in recipe. sadly these are not tagged by any means. So i want to hear how fluids are tagged. if diffrent at all.

//attempted way

const oxygen_ids = [ 'ad_astra:oxygen', 'chemlib:oxygen_fluid', 'gtceu:oxygen' ];
const oxygen_bucket_ids = [ 'ad_astra:oxygen_bucket', 'chemlib:oxygen_bucket', 'gtceu:oxygen_bucket' ];

ServerEvents.tags('fluid', event => {
    event.add('forge:gases/oxygen', oxygen_ids);
    event.add('forge:gases/oxygen', oxygen_bucket_ids);
})
// Bucket version is working.
ServerEvents.tags('item', event => {
    event.add('forge:gases/oxygen', oxygen_bucket_ids);
})

ServerEvents.recipes(event => {
    oxygen_ids.forEach(id => event.replaceInput({input: id}, id, '#forge:gases/oxygen'));
    oxygen_bucket_ids.forEach(id => {
        event.replaceInput({input: id}, id, '#forge:gases/oxygen')
        event.replaceOutput({output: id}, id, '#forge:gases/oxygen')
    });
    event.replaceInput({input: '#ad_astra_platform:oxygen'}, '#ad_astra_platform:oxygen', '#forge:gases/oxygen');
});

// Discalimer: Not my code trying to help out about it. Tho I'm seemingly no better myself. :(
paper relicBOT
#

Paste version of server.log from @placid bluff

feral latchBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

quasi forum
#

replaceinput doesnt work for fluids

#

much less for recipe types in mods that dont have addons

placid bluff
quasi forum
#

overwrite the recipes instead

placid bluff
#

event.overwrite?

quasi forum
#

no

#

event.custom

#

and give it the same recipe id with .id('recipe id here')

placid bluff
quasi forum
#

no

#

you need to have the full recipe json

paper relicBOT
#

You can add, remove, and modify recipes with KubeJS. The wiki has a page on that!
If you want to learn how to add recipes to any mod, click the Custom button.

placid bluff
# quasi forum no

Unsure what u talking about. Trying to unify. Not re-coding 50 crafting recipes.

quasi forum
#

kubejs needs to understand a mods recipe json to be able to use unifcation functions such as replaceInput.
It needs an addon for that mod, or built in support, to be able to understand a mods recipe json.

If it does not understand a mods json, you cannot use the unifcation functions for that mods recipes and have to overwrite stuff

#

if the recipes already use a tag you could add the tag you want to work to the tag they use, and remove stuff you dont want to use

placid bluff
#

believe that is include in the pack already. Kinda un sure.

quasi forum
#

there is no addon for ad astra

placid bluff
#

that i know

#

do u have any code exsamples by chance ?

quasi forum
#

i do not. i havent used ad astra

placid bluff
#

Them and I are trying to make it possible to use the fluid types listed: [ 'ad_astra:oxygen', 'chemlib:oxygen_fluid', 'gtceu:oxygen' ]; to be usable in any location those fluid would original be used. Instead of 1 all of the 3 can be used between.

#

Which i think u knew already.

placid bluff
# placid bluff So all ```event.replaceInput``` --> ```event.custom``` ?

So this wrong?

ServerEvents.recipes(event => {
    oxygen_ids.forEach(id => event.custom({input: id}, id, '#forge:gases/oxygen'));
    oxygen_bucket_ids.forEach(id => {
        event.custom({input: id}, id, '#forge:gases/oxygen')
        event.replaceOutput({output: id}, id, '#forge:gases/oxygen')
    });
    event.custom({input: '#ad_astra_platform:oxygen'}, '#ad_astra_platform:oxygen', '#forge:gases/oxygen');
});
quasi forum
#

completely

#

custom takes one argument, the recipe json

#

read the wiki page