ModTweaker

ModTweaker

88M Downloads

Strange behavior when removing melting recipes within nested for loop

justinrusso opened this issue ยท 1 comments

commented

Issue Description:

I'm assuming this is CraftTweaker related, but reporting to ModTweaker since it is related to Tcon and I dont have something else to really test it with.

When using a nested for loop, the variables within the scope... act strangely, and appear as if they are not the "exact same" when it comes to matching. When passing the liquid from a variable I define into the Melting.removeRecipe(liquid, item), it outputs the correct liquid in the log being altered, but it does not remove the recipe. In the script I have examples of ones that work, and ones that don't.

What happens:

When using mods.tconstruct.Melting.removeRecipe(metalLiquid, metalPart);, the recipe is not removed.

What you expected to happen:

The recipe would be removed.

Script used (Please Pastebin or gist your script, posting an unpasted or ungist'd script will automatically close this issue):

https://gist.github.com/justinrusso/3f1ad6b74f2900c48b711d8aa98902fc

Minetweaker.log file (Please Pastebin or gist your file, posting an unpasted or ungist'd file will automatically close this issue):

Will run and add it soon, but it mentions it is altered properly and there are no errors. (Altering Melting recipes for liquid:iron)


Affected Versions (Do not use "latest"):

  • Minecraft: 1.12.2
  • Forge: 14.23.1.2587
  • Crafttweaker: 4.0.12
  • ModTweaker: 4.0.6
  • MTLib: 3.0.1

Your most recent log file where the issue was present:

[pastebin/gist/etc link here]

commented

Most likely something internal with how fluids are handled(probably a missing copy somewhere)

Simply add a * 1 or something similar to your method call so that a new ILiquidStack is being created.
https://gist.github.com/kindlich/78a518f20936091661830b1c2f2d3099

The commented-out code will work at a later release for CrT, which is what I originally tested with.
I recomment you iterating over metalPart.items, since that way you can also use IOreDictEntry objects in your Array!