CraftTweaker

CraftTweaker

151M Downloads

Cannot OR ingredients when the first is a <tag:*>

Kage-Yami opened this issue · 4 comments

commented

Issue Description:

It seems to not be possible to OR together ingredients when the start of an OR chain is a <tag:*>, as it results in an invalid script.

What happens:

An error pointing to the offending line is printed after a /reload, saying "this type has no | operator".

What you expected to happen:

The script would be reloaded without issues.

Script used:

https://gist.github.com/Kage-Yami/ed583d56f7e2ce03724ddb1fc47d4518

crafttweaker.log file:

https://gist.github.com/Kage-Yami/bc10acc791505fab99684a2b15db799d


Environment:

  • Minecraft Version: 1.16.5
  • Forge Version: 36.1.23
  • CraftTweaker Version: 7.1.0.294
  • Are you using a server: No
  • If yes, does the client have the exact same scripts?

Game log:

https://gist.github.com/Kage-Yami/2f8975e84246b4b3a86c35d5c182a84c


Workaround:

I was able to workaround the issue by creating a custom tag and adding tags to be OR'd to it:

// Tags needed to emulate tag-only ingredient ORs
<tag:items:yami:enriching_coals>.add(<tag:items:minecraft:coals>);
<tag:items:yami:enriching_coals>.add(<tag:items:forge:dusts/coal>);

<recipetype:create:mixing>.addRecipe("mix_enriched_iron", "heated", <item:mekanism:enriched_iron>, [
    <item:create:crushed_iron_ore> | <tag:items:forge:ingots/iron> | <tag:items:forge:dusts/iron>,
    <tag:items:yami:enriching_coals>
]);
commented

Yeah, tags aren't all IIngredient, so they don't get the operator from there.
You can however use <tag:items:forge:ingots/iron>.asIngredient() | ...

commented

Yeah, tags aren't all IIngredient, so they don't get the operator from there.
You can however use <tag:items:forge:ingots/iron>.asIngredient() | ...

Aha! That was the cast I was assuming I could use instead, but couldn't find easily. :) Thanks!

commented

Yeah, tags aren't all IIngredient, so they don't get the operator from there.
You can however use <tag:items:forge:ingots/iron>.asIngredient() | ...

Actually, is that supposed to be <tag:items:forge:ingots/iron>.asIIngredient() | ...? asIngredient() gave me a "no such member" error, but asIIngredient() worked.

commented

it is meant to be <tag:items:forge:ingots/iron>.asIIngredient().

If this is resolved (Which it appears to be), I'm going to be closing this issue.