Thaumcraft Research Patcher

Thaumcraft Research Patcher

1M Downloads

Pathes...

Kisuny opened this issue ยท 16 comments

commented

well... Hello again... I want to replace recipes in stages, but I absolutely can't understand how it works.. I do everything on the wiki, but I catch constant errors, such as:
image
in the script, everything looks like this, here is the remove operator, because it is easier to work with it.
image
I tried different variations, but everything leads to this error in the log..

commented

Arrays are zero-indexed, meaning that the first index is 0 and the last will be (size - 1). I think the First Steps research has 3 recipes, so removing the last one should use index 2. I do have to say though that I really should have a better (more user-friendly) error message for that.

commented

image
image
Hmmm

commented

You might be able to do something like this:

[
    {
        "key": "FIRSTSTEPS",
        "ops": [
            {
                "op": "remove",
                "path": "stages/2/recipes"
            },
            {
                "op": "add",
                "path": "stages/2/recipes",
                "value": []
            }
        ]
    }
]

Your recipes would go in the value of the add operation (or you can add them later). This is untested so there might be syntax errors but that's the general idea.

commented

image
image
Still the same problem..

commented

instead of "minecraft:chest" put:

[
    "minecraft:chest"
]

(Notice that it's an array, even though it only has a single element)

commented

image
image
Yes, the items are removed, but the chest still doesnt show up :(

commented

image
and log

commented

That one might be a bug, I have to check the json patch spec to see if what I suggested is allowed and if so why its breaking. In the meantime, the following should work:

[
    {
        "key": "FIRSTSTEPS",
        "ops": [
            {
                "op": "remove",
                "path": "stages/2/recipes"
            },
            {
                "op": "add",
                "path": "stages/2/recipes",
                "value": []
            },
            {
                "op": "add",
                "path": "stages/2/recipes/-",
                "value": "minecraft:chest"
            }
        ]
    }
]
commented

image
image
image
And This:
image
image
image

commented

Last suggestion I have is to try removing / fixing that invalid entry the log is complaining about, other than that I have to check later for a possible bug

commented

image
image
no :(

commented

Oh that first 3 should also be a 2 for the same reason, sorry for not noticing that! So this should work: stages/2/recipes/2

commented

yeah, its worked, but, can I delete everything at once in one line?

commented

So this is a bit odd but this works for me:

{
    "key": "FIRSTSTEPS",
    "ops": [
	{
		"op": "remove",
		"path": "stages/2/recipes"
	},
	{
		"op": "add",
		"path": "stages/2/recipes",
		"value": ["minecraft:chest"]
	}
    ]
}

Did you edit the chest recipe in CraftTweaker or something? The only thing I can think of is that the chest recipe is not found...

commented

image
yeah, but the chests are in stages, does it matter?...

commented

Its worked:
image
image
but, thaumcraft will also be in the stages.. I think it might break crafting again.. Anyway, thank you so much, again..