Botania Tweaks

Botania Tweaks

3M Downloads

Agglomeration Plate custom recipe problems

MightyBidoof opened this issue · 6 comments

commented

I managed to find a small problem with the CraftTweaker Agglomeration Plate scripting method.

Most (all if the "replacement blocks" are excluded) of the optional variables don't actually default, causing an error.

pretty much anything that does conform to;

IItemstack, IIngredient[], int, int, int, IIngredient, IIngredient, IIngredient

will not work due to this, and the problem is compounded by the fact that the error spewed out will also label them as optional, despite them being required.

commented

Here's the requested error output and script;

//Example script, because the method is broken

import mods.botaniatweaks.Agglomeration;

///The recipe

mods.botaniatweaks.Agglomeration.addRecipe(<minecraft:cake>, [<minecraft:apple>, <minecraft:potato>]);

The recipe itself is copied from the examples given in the documentation.
And the error it outputs;

First half
Second Half

And here's the script with the defaults put in manually

//Functional Script
import mods.botaniatweaks.Agglomeration;
///The recipe
mods.botaniatweaks.Agglomeration.addRecipe(<minecraft:cake>, [<minecraft:apple>, <minecraft:potato>], 500000, 0x0000FF, 0x00FF00, <botania:livingrock>, <minecraft:lapis_block>, <botania:livingrock>);

This does infact work,
Another, minor thing I noticed is that it ignores NBT when replacing blocks, so if you attempt to have it replace a block with shulker boxes containing items, it'll instead replace said blocks with empty shulker boxes.
Another example would be Astral Sorcery crystals, which will disappear after around a second of being in-world if they lack sufficient NBT data, will do exactly that if one replaces anything.

Annoyingly none of the recipes show up in JEI either, which could just be fixed by adding a custom tab for it.

commented

Weird, but I ran your test script exactly as provided in my dev enviroment and the result is:
obraz

I only really have two ideas. First is that your version of CT has some zenscript parser bug that is not present here (this is why you should always provide as much info as possible in the initial report, now I have to ask you for a CraftTweaker version... while you are at it, might as well post the full crafttweaker log and Forge versions too).

Second idea is that casting the input array to IItemStack[] might solve this.

commented

CraftTweaker Version is 4.1.11, which seems to be the latest. Forge is 14.23.5.2768, which is the recommended version. And yes i guess i should've included both in the initial report.

crafttweaker.log

RemovedRecipes.zs can be ignored, as it doesn't actually have anything in it as of yet.

I'm not entirely sure how i'd properly cast the array, but i'd assume it's something like this;

import crafttweaker.item.IItemStack;
//Functional Script
import mods.botaniatweaks.Agglomeration;
//Crafttweaker ver = 4.1.1, Forge ver = 14.23.5.2768
///Attempt at casting to IItemstack to fix this
val IArray = [<minecraft:carrot>, <minecraft:potato>] as IItemStack[];
///Recipe
mods.botaniatweaks.Agglomeration.addRecipe(<minecraft:cake>, IArray);

If so, that doesn't work. If not, how would i properly cast it to IItemStack[]?
since it seems to display fine in JEI for you i'm honestly confused on why it won't for me, as i do have functioning recipes using the syntax i've found being run aswell.

commented

I made the function that ends with CTAgglomerationMultiblock not take optional parameters in the latest update which resolves the name conflict, if this error is still happening on the latest version let me know

Another, minor thing I noticed is that it ignores NBT when replacing blocks

Known, the code is already hacky enough and I'd rather not make it even worse :p and I doubt most will need the feature anyways

commented

Can you post a sample script and the error message?

commented

I thought I fixed this in 1.7.1: bcdccff

But maybe it's not working 🤔

I am pushing the Zenscript parser quite hard with these triple-overloaded-lotsa-optional-params method names, i might just give up and give the functions different names if I can't get it working. This could also just be a zenscript bug