CraftTweaker

CraftTweaker

151M Downloads

.transformReplace() does not return the amount specified.

ZeroLevels opened this issue ยท 3 comments

commented

What happens:

The amount returned was not correct. Regardless of what number I used in transformReplace (ranging from 3 to 8), it always returned twice that minus 2. However, this ONLY occurs when you craft with a single item. For instance, if you place a single item (an Item Stack of 1) in the crafting grid to be replaced with another after completing the recipe, it will replace said item in the crafting grid with the wrong amount.

If, however, you place a stack higher than one in the crafting grid and complete the recipe, the specified amount of the item you expected will be placed in your inventory. It only occurs when the last item crafted is replaced inside the crafting grid.

EXTRA: Upon further testing for workarounds, there are several other odd behaviors. I tried making the recipe output the 8x items while transforming the item in the grid one-to-one. In THIS way, if I place a full stack (64) of the item into the grid, and shift-click to craft all, it returns 8 stacks of the item as expected (if there is inventory space), but deletes the rest, and also only returns 63 of what should have been a one-to-one conversion. One simply disappears when you craft all at once.

What you expected to happen:

The recipes in question were expected to return 8 of the specified block/item.

Script used:

https://pastebin.com/fqHDYWnR

Minetweaker.log file:

https://pastebin.com/hrGMQ8uZ


Affected Versions (Do not use "latest"):

  • Minecraft: 1.9 & 1.11.2
  • Forge: 12.17.2051 & 13.20.2282
  • Crafttweaker: 1.9-2.3.2 & 1.11.2-3.0.24

Your most recent log file where the issue was present:

https://pastebin.com/f3nwnQ59

commented

You sure? The number of items returned is now double that which is entered. For example, when I want 8 of an item to be returned from a transformReplace, I get 16. To compensate, I entered 4. However, this doesn't work when operating on a full stack. Instead of getting 8 stacks back, I get 4 stacks, plus 4.

What you expected to happen:

The recipes in question were expected to return 8 of the specified block/item.

Script used:

https://pastebin.com/GhvqHh4c

Minetweaker.log file:

https://pastebin.com/v71306vn


Affected Versions (Do not use "latest"):

  • Minecraft: 1.12.2
  • Forge: 14.23.1.2607
  • Crafttweaker: 1.12.2-4.1.0

Your most recent log file where the issue was present:

https://pastebin.com/U4dpV9Em

commented

I'm seeing similar behavior on 1.10

commented

Fixed in later versions (aka 1.12)