Create Ore Excavation

Create Ore Excavation

10M Downloads

KubeJS Added resource veins not working

NowakAdmin opened this issue ยท 9 comments

commented
[Render thread/ERROR][KubeJS Server/]: server_scripts:mekanism.js#5: 
Failed to create a 'createoreexcavation:vein' recipe from args [{"text": "raw uranium"}, mekanism:raw_uranium]: 
Constructor for createoreexcavation:vein with 2 arguments not found!

[Render thread/ERROR][KubeJS Server/]: mekanism.js#5: Error in 'ServerEvents.recipes': dev.latvian.mods.rhino.EcmaError: TypeError: Cannot find function placement in object createoreexcavation:kjs/3kkgyrgdo34mqk3sfjq4b8a1p[createoreexcavation:vein].

Looks like this code is executed prior to Create-Ore-Excavation.

i created a folder /kubejs/server_scripts and pua a mekanism.js file inside (code below)

ServerEvents.recipes(event => {
	event.recipes.createoreexcavation.vein('{"text": "raw uranium"}', 'mekanism:raw_uranium') 
		.placement(10, 10, 12482984)
		.id("kubejs:mekanism_uranium_vein")	
		.biomeWhitelist('forge:is_overworld');
	event.recipes.createoreexcavation.drilling('mekanism:raw_uranium', 'kubejs:mekanism_uranium_vein', 100)
		.id("kubejs:mekanism_uranium_drill");
	console.log('createoreexcavation.vein: Hello! The recipe event mekanism:raw_uranium has fired!');
});

I followed code as mentioned in some other issue threads. Is this a bug with current version or I'm doing something wrong?
Info

Minecraft 1.21.1
KubeJS: 2101.7.1-build.181
Create: 6.0.2
Create-Ore-Excavation: 1.6.1

The error is not showing up if I do /kubejs reload server_scripts logged in to the world.

[Server thread/INFO][KubeJS Server/]: Loaded script server_scripts:mekanism.js in 0.001 s
[Server thread/INFO][KubeJS Server/]: Loaded 1/1 KubeJS server scripts in 0.009 s with 0 errors and 0 warnings

After that i spend like 20 minutes just teleporting to not previously loaded chunks and using Vein tool trying to find my Uranium Vein, but this not happened :(

In this point I suggest to add sub-comand like "/locate vein uranium" or so to check nearest chunk with that vein - for debug purposes.

Is there an option to see more than one vein threads at one scan?

Good Job with the mod!

commented

Also i see that sample drill do not accept netherite backpack, only copper one, this should be like that ?

commented

I know i need to put theese files in data folder, but which one?
1)

download sources add my uranium.jsons to:
Create-Ore-Excavation/blob/main/NeoForge/src/generated/resources/data/createoreexcavation/recipe/ore_vein_type/uranium,json
and
Create-Ore-Excavation/blob/main/NeoForge/src/generated/resources/data/createoreexcavation/recipe/drilling/uranium.json

and compile it using gradle ? (I'm kind of fresh in this :P )
Or just put theese jsons in other directory like .minecraft/kubejs/data 

or
3)

or .minecraft/saves/(my-world)/data/createoreexcavation/recipe/(ore_vein_type/)\(drilling/)? 

Can You guide me please?

I work on Windows 11 if this is needed info.

commented

Put it in the kubejs data directory .minecraft/kubejs/data/<your pack name>/recipe/<ore_vein_type, drilling, extracting>.
It does work with the netherite backtank.

commented

Thank you very much for your help! I successfully finished adding a custom vein!

commented

When you say the .minecraft folder, how does that work for a curseforge pack?
I have the following setup and I am unable to successfully add an ore_vein_type:

C:\Program Files (Manual Install)\CurseForge Minecraft\Instances\Moving is Tuff 2 0.1.6\kubejs\data\mit\recipe\ore_vein_type\alluvial_sift.json

{
    "type": "createoreexcavation:vein",
    "amountMultiplierMax": 30.0,
    "amountMultiplierMin": 10.0,
    "biomeWhitelist": "minecraft:is_river",
    "finite": "default",
    "icon": {
        "count": 1,
        "id": "minecraft:clay"
    },
    "name": "{\"translate\":\"block.minecraft.clay\"}",
    "placement": {
        "salt": 459746278,
        "separation": 8,
        "spacing": 128
    },
    "priority": 0
}

Also, does the name have to be pointed to a translated item/block name or can we enter any old string in there?

commented

The name must be a valid text component.
Please post your log, it probably has an error message why it didn't load.

commented
commented

So I got it to work by renaming the folder I had called "mit" for my to "createoreexcavation"

C:\Program Files (Manual Install)\CurseForge Minecraft\Instances\Moving is Tuff 2 0.1.6\kubejs\data\createoreexcavation\recipe\ore_vein_type\alluvial_sift.json

Image

I was also able to rename by using

"name": "{\"text\":\"<TEXT YOU WANT GOES HERE>\"}",