Artisan Worktables 1.12

Artisan Worktables 1.12

3M Downloads

Another issue with Copy

Bulldog83 opened this issue ยท 4 comments

commented

Issue Description

I've created a zenClass for simplify coping recipes via RecipeBuilder and Copy.
Here is it: https://gist.github.com/Bulldog83/489b46c8ed0b39540b441a5652031357

What Happens

I have CraftTweaker errors on script load:

[INITIALIZATION][CLIENT][INFO] [crafttweaker | SIDE_CLIENT]: Loading Script: {[1100:crafttweaker]: globals\classes\ArtisanBuilder.class.zs}
[INITIALIZATION][CLIENT][ERROR] globals\classes\ArtisanBuilder.class.zs:78 > 2 methods available but none matches the parameters (ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[crafttweaker.item.IIngredient])
This is usually an error in your script, not in the mod replaceInput(ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[crafttweaker.item.IIngredient]) replaceInput(ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[int[]])
[INITIALIZATION][CLIENT][ERROR] globals\classes\ArtisanBuilder.class.zs:84 > 2 methods available but none matches the parameters (ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[crafttweaker.item.IIngredient])
This is usually an error in your script, not in the modreplaceInput(ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[crafttweaker.item.IIngredient])replaceInput(ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[int[]])
[INITIALIZATION][CLIENT][ERROR] globals\classes\ArtisanBuilder.class.zs:90 > 2 methods available but none matches the parameters (ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[int[]])
This is usually an error in your script, not in the modreplaceInput(ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[crafttweaker.item.IIngredient])replaceInput(ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[int[]])
[INITIALIZATION][CLIENT][ERROR] globals\classes\ArtisanBuilder.class.zs:96 > 2 methods available but none matches the parameters (ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[int[]])
This is usually an error in your script, not in the modreplaceInput(ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[crafttweaker.item.IIngredient])replaceInput(ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[int[]])

I.e.,

(ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[crafttweaker.item.IIngredient])

not equal

replaceInput(ZenTypeNative: mods.artisanworktables.builder.Copy, crafttweaker.item.IIngredient[crafttweaker.item.IIngredient])

So, Copy and Copy, returned by 'Copy.by...', are two different Copy?

Affected Versions

  • Minecraft: 1.12.2
  • Forge: 14.23.4.2747
  • CraftTweaker: 4.1.11
  • Artisan Worktables: 1.19.0
  • Athenaeum: 1.14.0
commented

Is there another way to take instance of Copy besides Copy.by...?

commented

Damn, no, problem not in bracket, I hurried to close issue...

commented

Gmmm. But, the problem not in the Copy too. I changed method to:

function replaceInput(item as IItemStack, replace as IIngredient[IIngredient]) as Copy {
		var copy = Copy.byOutput([item]);
		for ingredient, replacement in replace {
			copy = copy.replaceInput(ingredient, replacement);
		}		
		return copy;
	}

And taken error:

[INITIALIZATION][CLIENT][ERROR] globals\classes\ArtisanBuilder.class.zs:63 > 4 methods available but none matches the parameters (ZenTypeNative: crafttweaker.item.IItemStack, crafttweaker.item.IIngredient[crafttweaker.item.IIngredient])
This is usually an error in your script, not in the modreplaceInput(ZenTypeNative: crafttweaker.item.IItemStack, crafttweaker.item.IIngredient[crafttweaker.item.IIngredient])replaceInput(ZenTypeNative: crafttweaker.item.IItemStack, crafttweaker.item.IIngredient[int[]])replaceInput(string, crafttweaker.item.IIngredient[crafttweaker.item.IIngredient])replaceInput(string, crafttweaker.item.IIngredient[int[]])

Interesting....

commented

I figured it out.
For compiler and 'IIngredient[IIngredient]' and 'IIngredient[int[]]' is java.util.Map..