#Ingots into gear (thermal press)

265 messages · Page 1 of 1 (latest)

gray knotBOT
#

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

red smelt
#

ups sry for pic spam mb

mellow haven
#

What's the issue/

red smelt
#

its not working

mellow haven
#

how's it not working? You haven't shared an error, log, expected and real outcome

red smelt
#

Im having some issues with it. Could u help me out pls?`


ServerEvents.recipes(event => { 

    let ResourceTypes = [
        `compressed_iron`,
        `dark_steel`,
        `energetic_alloy`,
        `vibrant_alloy`,
        `unobtainium`,
        `vibranium`,
        `allthemodium`,
        `brass`,
        `zinc`,
        `uranium`,
        `platinum`,
        `osmium`,
        `iridium`,
        `aluminum`,
        ] 
        ResourceTypes.forEach(material => {    
        let ingotTag = Ingredient.of(`#forge:ingots/${material}`)
    event.custom({
        type: `thermal:press`,
        ingredients: [
          ingotTag.withCount(4).toJson(),
          Ingredient.of(`thermal:press_gear_die`).toJson(),
        ],
        result: [#forge:${material}_gear.toJson()],
      }).id(`kubejs:thermal/machines/press/press_${material}_ingot_to_gear`)

        })
    })
#

wtf

jovial orchidBOT
#

Paste version of message.txt from @red smelt

mellow haven
#

Duplicate recipe for id

red smelt
#

ye but there are no recipes
something went wrong with the script

#

there were none befor the script

mellow haven
#

That's not valid code

#

You don't have quotes where needed

red smelt
#

could u help me fix it, please?

mellow haven
#

Where did that code come from?

red smelt
#

my friend and i did it

mellow haven
#

Also, a result can't be a tag

#

has to be an item

red smelt
#

hmmm maybe thats the error

mellow haven
#

No

#

that's maybe part of it

#

but the rest was fucked

red smelt
#

damn

mellow haven
#
ServerEvents.recipes(event => {

    let ResourceTypes = [
        compressed_iron,
        dark_steel,
        energetic_alloy,
        vibrant_alloy,
        unobtainium,
        vibranium,
        allthemodium,
        brass,
        zinc,
        uranium,
        platinum,
        osmium,
        iridium,
        aluminum,
    ];

    ResourceTypes.forEach(material => {
        let ingotTag = Ingredient.of(`#forge:ingots/${material}`);
        event.custom({
            type: "thermal:press",
            ingredients: [
                ingotTag.withCount(4).toJson(),
                Ingredient.of("thermal:press_gear_die").toJson(),
            ],
            result: [Item.of(`${material}_gear`).toJson()],
        }).id(`kubejs:thermal/machines/press/press_${material}_ingot_to_gear`);

    });
});```
#

But cleaner and no syntax errors

red smelt
jovial orchidBOT
#

Paste version of message.txt from @red smelt

mellow haven
#

Like I said, untested, just cleaned up your code. Variables aren't usually handled like that which is why I asked where you got this code from?

#

If you wish to use the ${variable} replace the double quotes with a backtic

#

` vs "

red smelt
#

A friend of mine and i did it together
he sended me the file and told me to fill it up with the name of the items

mellow haven
#

Otherwise you can do "Text " + variable

#
  • is used in javascript to concat two strings, variables or both
red smelt
#

noob friendlier pls :C

mellow haven
#

That is noob friendly

red smelt
#

damn

#

oh
replace " with `

mellow haven
#

There, updated

red smelt
#

nvm i got it now

#

testing

mellow haven
#

${variable} works for inlining variables in text strings but has to be wrapped with a ` backtick

red smelt
#

oh, okay ty

mellow haven
#

Did it work?

red smelt
#

restarting

#

joining soon

mellow haven
#

You can just /reload

red smelt
jovial orchidBOT
#

Paste version of message.txt from @red smelt

red smelt
#

no errors only warnings

red smelt
mellow haven
#

I can only imagine what your other scripts look like qq

#

Do the gears work now?

red smelt
#

nope

#

do i need set an amout of energy cost?

mellow haven
#

No

#

Paste this in and /reload

#
ServerEvents.recipes(event => {

    let ResourceTypes = [
        "compressed_iron",
        "dark_steel",
        "energetic_alloy",
        "vibrant_alloy",
        "unobtainium",
        "vibranium",
        "allthemodium",
        "brass",
        "zinc",
        "uranium",
        "platinum",
        "osmium",
        "iridium",
        "aluminum",
    ];

    ResourceTypes.forEach(material => {
        event.custom({
            type: "thermal:press",
            ingredients: [
                Ingredient.of(`#forge:ingots/${material}`, 4).toJson(),
                Item.of("thermal:press_gear_die").toJson(),
            ],
            result: [Item.of(`${material}_gear`).toJson()],
        }).id(`kubejs:thermal/machines/press/press_${material}_ingot_to_gear`);

    });
});```
red smelt
#

testing

mellow haven
#

Try what I just set

#

I updated it

red smelt
#

ye i had a }) to much

#

reloading again

mellow haven
#

What mods are providing the ingots?

red smelt
#

alltheores

mellow haven
#

Ok

#

All of them?

#

Enderio too?

red smelt
#

pneumaticcraft = compressed iron
Enderio = dark stee, vibrant alloy and energetic alloy

mellow haven
#

Ok

red smelt
#

rest alltheores

mellow haven
#

So you can't call an Item.of('dark_steel_gear');

#

Kubejs has no idea what mod that is from

#

it has to be Item.of('enderio:dark_steel_gear');

#

So you need to be specific about items

#

Ingredients are tags, so #forge:ingots/dark_steel works because anything that's tagged with that tag will work as an ingredient but not an output or result

red smelt
#

hmmmm

mellow haven
#

Make sense?

red smelt
#

yess

mellow haven
#

So that code will not work as is

#

Do you have KubeJS Thermal installed?

#

as a mod?

red smelt
#

no

#

only kubejs no addons

mellow haven
#

Ok

#

pneumaticcraft too?

red smelt
#

yes

mellow haven
#

for compressed_iron

red smelt
#

compressed iron

#

yep

#

no

#

i used the tag for it

#

but there is no alltheores thing for it

mellow haven
#

yeah great, but what about the gear?

red smelt
#

its from pneumaticcraft

mellow haven
#

I'll give you an example for a couple of items and you can figure out the rest

red smelt
#
{
  "type": "thermal:press",
  "ingredients": [
    {
      "tag": "forge:ingots/gold",
      "count": 4
    },
    {
      "item": "thermal:press_gear_die"
    }
  ],
  "result": [
    {
      "item": "thermal:gold_gear"
    }
  ]
}

cant i just override the data and use it as a datapack in kubejs?

by changing gold into $(material)?

mellow haven
#

hold on

red smelt
#

[18:01:06] [WARN] Error parsing recipe kubejs:thermal/machines/press/press_quartz_ingot_to_gear[thermal:press]: {"type":"thermal:press","ingredients":[{"count":4,"ingredient":{"tag":"forge:ingots/quartz"}},{"item":"thermal:press_gear_die","count":1}],"result":{"item":"minecraft:air","count":0}}: com.google.gson.JsonSyntaxException: Invalid Thermal Series recipe: kubejs:thermal/machines/press/press_quartz_ingot_to_gear
Refer to the recipe's ResourceLocation to find the mod responsible and let them know!

this error appears

#

thats what u meant i guess

mellow haven
#

Yep, it will convert to air as the output if invalid

red smelt
#

okay okay i got it

mellow haven
#

let me see if I can fix this up for you, give me a few minutes

red smelt
#
ServerEvents.recipes(event => { 

    let ResourceTypes = [
        `unobtainium`,
        `vibranium`,
        `allthemodium`,
        `brass`,
        `zinc`,
        `uranium`,
        `platinum`,
        `osmium`,
        `iridium`,
        `aluminum`,
        ] 
        ResourceTypes.forEach(ato => {
            event.custom({
                type: "thermal:press",
                ingredients: [
                    Ingredient.of(`#forge:ingots/${ato}`, 4).toJson(),
                    Item.of("thermal:press_gear_die").toJson(),
                ],
                result: Item.of(`alltheores:${ato}_gear`).toJson(),
            }).id(`kubejs:thermal/machines/press/press_${ato}_ingot_to_gear`);
        })

    let Enderio = [
                `dark_steel`,
                `energetic_alloy`,
                `vibrant_alloy`,
                ] 
                Enderio.forEach(eio => {
                    event.custom({
                        type: "thermal:press",
                        ingredients: [
                            Ingredient.of(`#forge:ingots/${eio}`, 4).toJson(),
                            Item.of("thermal:press_gear_die").toJson(),
                        ],
                        result: Item.of(`alltheores:${eio}_gear`).toJson(),
                    }).id(`kubejs:thermal/machines/press/press_${eio}_ingot_to_gear`);

                

                    event.custom({
                        type: "thermal:press",
                        ingredients: [
                            Ingredient.of(`#forge:ingots/compressed_iron`, 4).toJson(),
                            Item.of("thermal:press_gear_die").toJson(),
                        ],
                        result: Item.of(`alltheores:compressed_iron,_gear`).toJson(),
                    }).id(`kubejs:thermal/machines/press/press_compressed_iron,_ingot_to_gear`);
                })
            })
red smelt
mellow haven
#

not really

#

hold on, I have an idea

red smelt
#

kk

mellow haven
#

Do you have the enderio metals tagged as #forge:ingots/XXX ?

red smelt
#

yes

#

#forge:ingots/vibrant_alloy

#

energetic_alloy
dark_steel

mellow haven
#

ok

#

and compressed_iron?

#

also tagged that way and alltheores:compressed_iron_gear exists?

red smelt
#

no

#

pneumaticcraft:compressed_iron_gear

#

i think i did it

#

no warnings no errors

jovial orchidBOT
#

Paste version of message.txt from @red smelt

red smelt
#

damn to big to send xd

#

nvm :C

mellow haven
#

?

red smelt
#

result still empty

#

didnt work

mellow haven
#

hold on

#
ServerEvents.recipes(event => {

    let makeGear = (input, output, material) => {
        event.remove({output: output});
        event.custom({
            type: "thermal:press",
            ingredient: [
                Ingredient.of(input, 4),
                Item.of('thermal:press_gear_die')
            ],
            result: [Item.of(output)],
        }).id('kubejs:thermal/machines/press/press_' + material + '_ingot_to_gear');
    };

    makeGear('#forge:ingots/iron','alltheores:iron_gear', 'iron');
});

Try this for me. It works for me in 1.20.1 but fails in 1.19.2

red smelt
#

can i test it with osmium?

#

instead of iron

mellow haven
#

just try it with iron

#

it's just a test

red smelt
#

theres is a recipe

#

allready

mellow haven
#

it will remove it

red smelt
#

kk

mellow haven
#

it's only a test

#

I'll know in a min, testing myself

#

Fails for me

#

works in a different pack, WTF

#
makeGear('forge:ingots/iron','alltheores:iron_gear', 'iron');
``` Should work
#

You can see where I'm going with this

red smelt
#

i guess

mellow haven
#

lol

red smelt
#

like forge:ingots/osmium, alltheores:osmium_gear, osmium

mellow haven
#

derp

#

You can't use a quantity with Ingredient.of

red smelt
mellow haven
#

yeah, it's empty

red smelt
#

yep

mellow haven
#

got it

red smelt
#

yeyyy

mellow haven
#
ServerEvents.recipes(event => {

    let makeGear = (input, output, material) => {
        event.remove({ output: output });
        event.custom({
            type: "thermal:press",
            ingredient: [
                input,
                Item.of('thermal:press_gear_die')
            ],
            result: [output],
        }).id('kubejs:thermal/machines/press/press_' + material + '_ingot_to_gear');
    };

    let allTheMetals = [
        'aluminum', 'iridium', 'lead', 'nickel', 'osmium', 'platinum', 'silver', 'tin',
        'uranium', 'zinc', 'steel', 'invar', 'electrum', 'bronze', 'enderium', 'lumium',
        'signalum', 'constantan', 'brass', 'iron', 'gold', 'copper'
    ];

    allTheMetals.forEach(material => {
        makeGear(Item.of("#forge:ingots/" + material).withCount(4), Item.of('alltheores:' + material + '_gear'), material);
    });

    // 'dark_steel', 'energetic_alloy', 'vibrant_alloy'
});```
#

Still need to do the Enderio and Pneumaticcraft ones

red smelt
#

damn

#

that looks sick

mellow haven
#

Make sure it works before you stroke my ego 😛

#

You can apply the same logic to the EnderIO ones but the default recipes are more complex than 4 ingots to a gear

red smelt
#

testing

mellow haven
#

alltheores doesn't have enderio gears FYI

red smelt
#

nope

#

yeyyyy

#

the scripts works

#

now its time for enderio and pneumaticcraft xd

mellow haven
#

sweet

red smelt
#

ty very much for taking so much time!

mellow haven
#

For those, I would do them manually.

makeGear(Item.of('pneumaticcraft:compressed_iron_ingot').withCount(4), Item.of('pneumaticcraft:compressed_iron_gear'), 'compressed_iron');
#

Do the same for EnderIO but replace the item names

red smelt
#

just this? and its done?

#

aight

mellow haven
#
ServerEvents.recipes(event => {

    let makeGear = (input, output, material) => {
        event.remove({ output: output });
        event.custom({
            type: "thermal:press",
            ingredient: [
                input,
                Item.of('thermal:press_gear_die')
            ],
            result: [output],
        }).id('kubejs:thermal/machines/press/press_' + material + '_ingot_to_gear');
    };

    // All The Ores / Vanilla
    let allTheMetals = [
        'aluminum', 'iridium', 'lead', 'nickel', 'osmium', 'platinum', 'silver', 'tin',
        'uranium', 'zinc', 'steel', 'invar', 'electrum', 'bronze', 'enderium', 'lumium',
        'signalum', 'constantan', 'brass', 'iron', 'gold', 'copper'
    ];

    allTheMetals.forEach(material => {
        makeGear(Item.of("#forge:ingots/" + material).withCount(4), Item.of('alltheores:' + material + '_gear'), material);
    });

    // Pneumaticcraft
    makeGear(Item.of('pneumaticcraft:compressed_iron_ingot').withCount(4), Item.of('pneumaticcraft:compressed_iron_gear'), 'compressed_iron');

    // EnderIO
    makeGear(Item.of('enderio:dark_steel_ingot').withCount(4), Item.of('enderio:dark_bimetal_gear'), 'dark_steel');
    makeGear(Item.of('enderio:energetic_alloy_ingot').withCount(4), Item.of('enderio:energized_gear'), 'energetic_alloy');
    makeGear(Item.of('enderio:vibrant_alloy_ingot').withCount(4), Item.of('enderio:vibrant_gear'), 'vibrant_alloy');
});```
#

Final

#

Assuming pneumaticcraft:compressed_iron_gear is valid

#

I have no idea without adding it to my test env

red smelt
#

yes

#

it is

#

like i said
ty very much

#

testing it out real quick

mellow haven
#

You can remove iron from the allTheMetals array if you don't want the new recipe

red smelt
#

kk

mellow haven
#

seems to work

red smelt
#

tyyy

#

!!!!!

jovial orchidBOT
#

Please close your ticket (with </ticket close:1054771505520717835> or the button atop this thread) once you resolved your issue! This also helps others that would like to help out, as they don't have to look into this thread to check if it has been resolved by now.

Do you have any other questions regarding your issue? Feel free to ask!
Note: You generally should create a new post for unrelated issues.

gray knotBOT
#

Ticket closed!

red smelt
#

yooo eh xD

red smelt
mellow haven
#

You can do it, I know you can

red smelt
#

i am just going to use the same script but kinda failed by the "type"

mellow haven
#
{
  "type": "immersiveengineering:metal_press",
  "conditions": [
    {
      "type": "forge:not",
      "value": {
        "type": "forge:tag_empty",
        "tag": "forge:gears/aluminum"
      }
    }
  ],
  "energy": 2400,
  "input": {
    "base_ingredient": {
      "tag": "forge:ingots/aluminum"
    },
    "count": 4
  },
  "mold": "immersiveengineering:mold_gear",
  "result": {
    "tag": "forge:gears/aluminum"
  }
}```
red smelt
#

ty!

red smelt
#

thats more then enough

mellow haven
#

Try it and if you get errors, I'll help you

red smelt
#

ty!

mellow haven
#

Surprisingly easy

red smelt
#

almost done i guess

#

testing it out now

#

no errors yet

mellow haven
#

Enderio will be different because of item names

red smelt
#

ServerEvents.recipes(event => {
   let makeGear = (input, output, material) => {
    event.remove({ output: output });
    event.custom({
        type: "immersiveengineering:metal_press",

        mold: `immersiveengineering:mold_gear`,
        result: [output],
    }).id('immersiveengineering:metalpress/gear_' + material);
};

// All The Ores / Vanilla
let allTheMetals = [
    'dark_steel', 'energetic_alloy', 'vibrant_alloy'
];

allTheMetals.forEach(material => {
    makeGear(Item.of("#forge:ingots/" + material).withCount(4), Item.of('enderio:' + material + '_gear'), material);
 });
})


#

cant test it out atm server wont let me in
restarting it

mellow haven
#

Ok wait, you don't want to redefine the same function, just add to it

#
ServerEvents.recipes(event => {

    let makeGear = (input, output, material) => {
        event.remove({ output: output });
        event.custom({
            type: "thermal:press",
            ingredient: [
                input,
                Item.of('thermal:press_gear_die')
            ],
            result: [output],
        }).id('kubejs:thermal/machines/press/press_' + material + '_ingot_to_gear');

        event.custom({
            "type": "immersiveengineering:metal_press",
            "conditions": [
              {
                "type": "forge:not",
                "value": {
                  "type": "forge:tag_empty",
                  "tag": "forge:gears/" + material
                }
              }
            ],
            "energy": 2400,
            "input": {
              "base_ingredient": {
                "tag": "forge:ingots/" + material
              },
              "count": 4
            },
            "mold": "immersiveengineering:mold_gear",
            "result": output.toJson()
          }).id('kubejs:immersiveengineering/press/press_' + material + '_ingot_to_gear');
    };

    // All The Ores / Vanilla
    let allTheMetals = [
        'aluminum', 'iridium', 'lead', 'nickel', 'osmium', 'platinum', 'silver', 'tin',
        'uranium', 'zinc', 'steel', 'invar', 'electrum', 'bronze', 'enderium', 'lumium',
        'signalum', 'constantan', 'brass', 'iron', 'gold', 'copper'
    ];

    allTheMetals.forEach(material => {
        makeGear(Item.of("#forge:ingots/" + material).withCount(4), Item.of('alltheores:' + material + '_gear'), material);
    });

    // Pneumaticcraft
    makeGear(Item.of('pneumaticcraft:compressed_iron_ingot').withCount(4), Item.of('pneumaticcraft:compressed_iron_gear'), 'compressed_iron');

    // EnderIO
    makeGear(Item.of('enderio:dark_steel_ingot').withCount(4), Item.of('enderio:dark_bimetal_gear'), 'dark_steel');
    makeGear(Item.of('enderio:energetic_alloy_ingot').withCount(4), Item.of('enderio:energized_gear'), 'energetic_alloy');
    makeGear(Item.of('enderio:vibrant_alloy_ingot').withCount(4), Item.of('enderio:vibrant_gear'), 'vibrant_alloy');
});```
Doesn't do IE press for energetic or vibrant gear, also not sure about PNC compressed
red smelt
#

its another file

mellow haven
#

The problem is the event.remove for the recipe output

#

you'll have a conflict eventually

#

this is better, make one function that creates gears

red smelt
#

kk

#

do u know why this happens ?

#

i cant even kick my self out if i have this screen

#

dark steel works, but vibrant and energetic alloy doenst

#

weird

mellow haven
#

they don't because their tag name is different

red smelt
#

hmmm

#

okay

mellow haven
#

I'll look into it, also sucks the way the IE recipe differs from Thermal

#

Any other pressing recipes you need before I change things up?

red smelt
#

allthemodium onces
i did them for the servo press
but could need help for metal press

mellow haven
#

So the Thermal and IE press? No Create Press or anything else?

#

methods of pressing, not items to press

red smelt
#

minecraft:quartz -> thermal:gear
and
redstone_aresenal:flux_ingot ->redstone:arsenal:flux_gear

red smelt
#

would appreciate it

#

Thermal IE and Create would be great

mellow haven
#

Not sure how Create would work actually for a gear

#

but here's Thermal and IE:

ServerEvents.tags('item', event => {
    event.get('forge:ingots/energized').add('#forge:ingots/energetic_alloy');
    event.get('forge:ingots/vibrant').add('#forge:ingots/vibrant_alloy');
});

ServerEvents.recipes(event => {

    let makeGear = (input, output, material) => {
        event.remove({ output: output });
        event.custom({
            type: "thermal:press",
            ingredient: [
                input,
                Item.of('thermal:press_gear_die')
            ],
            result: [output],
        }).id('kubejs:thermal/machines/press/press_' + material + '_ingot_to_gear');

        event.custom({
            "type": "immersiveengineering:metal_press",
            "conditions": [
              {
                "type": "forge:not",
                "value": {
                  "type": "forge:tag_empty",
                  "tag": "forge:gears/" + material
                }
              }
            ],
            "energy": 2400,
            "input": {
              "base_ingredient": {
                "tag": "forge:ingots/" + material
              },
              "count": 4
            },
            "mold": "immersiveengineering:mold_gear",
            "result": output.toJson()
          }).id('kubejs:immersiveengineering/press/press_' + material + '_ingot_to_gear');
    };

    // All The Ores / Vanilla
    let allTheMetals = [
        'aluminum', 'iridium', 'lead', 'nickel', 'osmium', 'platinum', 'silver', 'tin',
        'uranium', 'zinc', 'steel', 'invar', 'electrum', 'bronze', 'enderium', 'lumium',
        'signalum', 'constantan', 'brass', 'iron', 'gold', 'copper'
    ];

    allTheMetals.forEach(material => {
        makeGear(Item.of("#forge:ingots/" + material).withCount(4), Item.of('alltheores:' + material + '_gear'), material);
    });

    // Pneumaticcraft
    makeGear(Item.of('pneumaticcraft:compressed_iron_ingot').withCount(4), Item.of('pneumaticcraft:compressed_iron_gear'), 'compressed_iron');

    // EnderIO
    makeGear(Item.of('enderio:dark_steel_ingot').withCount(4), Item.of('enderio:dark_bimetal_gear'), 'dark_steel');
    makeGear(Item.of('enderio:energetic_alloy_ingot').withCount(4), Item.of('enderio:energized_gear'), 'energized');
    makeGear(Item.of('enderio:vibrant_alloy_ingot').withCount(4), Item.of('enderio:vibrant_gear'), 'vibrant');
});```
red smelt
#

ty testing it

mellow haven
#

That sets a new tag for EnderIO ingots to simplify these recipes

red smelt
#

very smart

#

Allthemodium, vibranium and unobtainium, are only working on the thermal press

#

not on IE

#

i added them right under enderio

  // Allthemodium
  makeGear(Item.of('allthemodium:allthemodium_ingot').withCount(4), Item.of('allthemodium:allthemodium_gear'), 'allthemodium_ingot');
  makeGear(Item.of('allthemodium:vibranium_ingot').withCount(4), Item.of('allthemodium:vibranium_gear'), 'vibranium_ingot');
  makeGear(Item.of('allthemodium:unobtainium_ingot').withCount(4), Item.of('allthemodium:unobtainium_gear'), 'unobtainium_ingot');
mellow haven
#

Ahh, didn't check them

#

they just need a new tag too probably

red smelt
#

just copy paste the enderio thing but change it with allthemodium?

mellow haven
#

no

red smelt
#

😦

mellow haven
#

not necessarily

#

The tag has to work for it

#

I didn't install allthemodium, hold on

red smelt
#

kk

mellow haven
#
    // All The Modium
    makeGear(Item.of('allthemodium:allthemodium_ingot').withCount(4), Item.of('allthemodium:allthemodium_gear'), 'allthemodium');
    makeGear(Item.of('allthemodium:unobtainium_ingot').withCount(4), Item.of('allthemodium:unobtainium_gear'), 'unobtainium');
    makeGear(Item.of('allthemodium:vibranium_ingot').withCount(4), Item.of('allthemodium:vibranium_gear'), 'vibranium');```
#

so yeah, I guess it was similar

#

I just didn't have the mod installed

red smelt
#

ty testing!

mellow haven
#

well that was fun

red smelt
#

yep it was

#

couldnt test it yet xD

red smelt
mellow haven
#

Could be anything, try doing dev on a single player world

#

dev on a server is just torture

red smelt
#

kk ty

#

it workes

#

ty very much!

gray knotBOT
#

Ticket closed!