IGuiItemStackGroup#init() uses 18x18 slots instead of 16x16
rlnt opened this issue ยท 2 comments
When I tried to implement the JEI plugin for my mod, I got confusing results when I tried to add the slots for my machine category.
In the IGuiItemStackGroup
interface init()
is documented as using position x and y relative to the background texture.
When doing it like it was mentioned there, my slot was always 1 pixel off on x and y.
This is the code I am using when setting the values as actual positions. You can check the texture at the bottom:
@Override
public void setRecipe(IRecipeLayout recipeLayout, EnergizerRecipe recipe, IIngredients ingredients) {
IGuiItemStackGroup itemStackGroup = recipeLayout.getItemStacks();
// output slot
itemStackGroup.init(1, false, 65, 9);
// input slot
itemStackGroup.init(2, true, 5, 9);
// set ingredients defined in setIngredients()
itemStackGroup.set(ingredients);
}
After looking through my code, there was no other value which could modify that so I realized JEI probably assumes slots are 18x18 pixels instead of 16x16 because it also counts the gray borders.. So I have one pixel less on each axis.
And now this works:
I don't see anything which could affect these positions besides this so I am sure this is the case.
In case you wanna check out the background texture I am using, here it is:
Minecraft: 1.16.5
Forge: 36.1.23
JEI & JEI API: 7.7.0.99
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Thanks for the report!
This is a legacy behavior, clarified with a workaround in 9086768