Creators-of-Create / Create

[Forge Mod] Building Tools and Aesthetic Technology
MIT License
2.97k stars 914 forks source link

fluid recipes have wrong quantities when transfered from JEI #6409

Open jonatjano opened 7 months ago

jonatjano commented 7 months ago

Describe the Bug

When transfering a create recipe from JEI to a machine, the liquid quantity is off.

This is due to that method from com.simibubi.create.compat.jei.category.CreateRecipeCategory

public static FluidStack withImprovedVisibility(FluidStack stack) {
  FluidStack display = stack.copy();
  int displayedAmount = (int) (stack.getAmount() * .75f) + 250;
  display.setAmount(displayedAmount);
  return display;
}

The goal of the method is to make small liquid quantities more visible in JEI

Reproduction Steps

  1. create an instance with Create, JEI and Refined Storage
  2. place a refined storage pattern grid with a controller
  3. open JEI in a mixing recipe with liquids, for example Builder's tea
  4. click the + at the bottom right of the recipe to tranfert it to the pattern grid
  5. see that the liquid amounts are off in the pattern grid

Expected Result

The liquid amount should be the same in the pattern grid than in JEI

Screenshots and Videos

image image (The water is not visibly affected because 1000*0.75+250 = 1000)

Crash Report or Log

No response

Operating System

Linux (bug is system independant)

Mod Version

0.5.1f

Minecraft Version

1.20.1

Forge Version

neoforge 47.1.104

Other Mods

No response

Additional Context

That function was implemented 4 years back in this commit which means that a lot of create versions are impacted

prog-pog commented 7 months ago

This happens with all numbers except 1000, plug any number besides 1000 into x*0.75+250 and you get a different number that you put in. A = Amount of fluid related to one bucket 1000mb image an easy solution could be to change it to the equations above.

jonatjano commented 6 months ago

There are 2 solutions that I see :