Condensentrator arrows are wrong in JEI when showing multiple recipes
josephcsible opened this issue ยท 2 comments
Issue description:
When viewing recipes for the rotary condensentrator with JEI, all arrows on each page will point the same way, even if some of the recipes are condensentrating and some are decondensentrating. (This bug does not occur if only one recipe per page is visible.)
Steps to reproduce:
- Right-click a rotary condensentrator
- Click the arrow with tooltip "Show Recipes"
- Make sure your screen is big enough, or your GUI size small enough, to see at least two recipes per page
Version (make sure you are on the latest version before reporting):
Forge: 14.23.0.2503
Mekanism: 9.4.1.326
Other relevant version: JEI 4.8.0.105
Looked a bit at this issue, it seems a misunderstanding of how JEI works. Some technical explanation will follow:
JEI uses IRecipeCategory
(RotaryCondensentratorRecipeCategory) classes to render the recipes. It has a method drawExtras(Minecraft)
which in our case renders the arrow for the condensentrating & decondensentrating. This uses the by JEI provided IRecipeWrapper
(RotaryCondensentratorRecipeWrapper). The problem is, that (what it seems) the recipes is only set once when stuff changes. This together with JEI only using one object of the IRecipeCategory
causes the recipe we save is being overwritten with the one on the bottom of the screen as that is set directly after it, causing it to always render as decondensentrating.
A tldr:
The method setRecipe
is not intended to store data in the IRecipeCategory
, only update the IRecipeLayout
we receive with the stuff from IRecipeWrapper
.
--Edit--
Missed the important part: I don't know how to solve this. I might make an issue over at JEI to see if they know how to solve it.