CraftTweaker

CraftTweaker

151M Downloads

[1.12.2] Fluid/Liquid ingredient dupe on stackable fluid containers ("Any container with %s")

Krutoy242 opened this issue ยท 6 comments

commented

Issue description

When <fluid:anything> * 1000 used as IIngredient in Crafting Table recipes, stack of fluid containers gonna be duped.
Stack size gonna be reduced by 1 and liquid inside containers would be reduced (by weird amount).

Steps to reproduce

  1. Install CraftTweaker2-1.12-4.1.20.695 and OpenBlocks-1.12.2-1.8.1 (this mod have stackable fluid container. Any othermod with stackable containers work)
  2. Add recipe using fluid ingredient:
recipes.addShapeless(<minecraft:dirt>, [<fluid:water> * 1000]);
  1. Load game, craft, dupe

javaw_B5XHnNNdyO

Script used

https://pastebin.com/4Vedaxw0

The crafttweaker.log file

https://github.com/CraftTweaker/CraftTweaker/files/13374266/crafttweaker.log

Minecraft version

1.12

Modloader

Forge

Modloader version

14.23.5.2860

CraftTweaker version

4.1.20.695

Other relevant information

No response

The latest.log file

https://github.com/CraftTweaker/CraftTweaker/files/13374293/latest.log

commented

Item Transformers produce dupe bug for stackable items. Not only the fluid container ingredients, but also transformConsume function.

Edit: I remember 1.16+ have the same bug.

commented

For now, you can use a custom item condition to deny stackable items.

(<fluid:water> * 1000).only(function(item) {
    return !item.isStackable;
}
commented

For now, you can use a custom item condition to deny stackable items.

(<fluid:water> * 1000).only(function(item) {
    return !item.isStackable;
}

This is impossible, showing error:

[ERROR] [crafttweaker]: Error executing {[0:crafttweaker]: mods\deepmoblearning.zs}: Liquid stack can't have conditions
java.lang.UnsupportedOperationException: Liquid stack can't have conditions
	at crafttweaker.mc1120.liquid.MCLiquidStack.only(MCLiquidStack.java:170)
	at CrafttweakerReloadableCrafttweakerReloadablecraft\Craft_utils2935.accept(craft\craft_utils.zs:47)
	at mods\Deepmoblearning.__script__(mods\deepmoblearning.zs:35)
commented

You may be able to use a recipe function to achieve the same effect as the only call.
https://docs.blamejared.com/1.12/en/Vanilla/Recipes/Crafting/Recipe_Functions

The issue with stacked transformations is very unlikely to be fixed at this point, as 1.12 is an ancient version.

commented

Try oring an invalid ingredient first?

val invalidIngredient as IIngredient = <*>.only(function(item) {
    return false;
});

val notStackableWaterContainer as IIngredient = (<fluid:water> * 1000).or(invalidIngredient).only(function(item) {
    return !item.isStackable;
});
commented

Try oring an invalid ingredient first?

Its actually working now! Thanks for the idea!

image
image