Create

Create

86M Downloads

fluid recipes have wrong quantities when transfered from JEI

jonatjano opened this issue ยท 2 comments

commented

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

commented

There are 2 solutions that I see :

  • remove the improvedVisibility and let JEI manage it's own visibility
  • see if JEI allows to change edit the value again when the player click on the button to set it back to the true value either by having it stored somewhere or using (x-250)*4/3 which could reduce the precision of the value
commented

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.