Correctly find the recipeId under mouse when using the search (#465)

* Correctly find the recipeId under mouse when using the search

* optimize

---------

Co-authored-by: slprime <[email protected]>
This commit is contained in:
slprimeandslprime authored and GitHub committed 2024-03-01 19:36:15 +01:00
1 parent 94676e0934
commit ea03cfa17d
3 files changed
+14 -10

No files matched your search

@@ -39,8 +39,7 @@ public class ItemHistoryPanel extends Widget {
public void addItem(ItemStack stack) {
if (stack != null) {
ItemStack is = stack.copy();
is.stackSize = 1;
ItemStack is = StackInfo.loadFromNBT(StackInfo.itemStackToNBT(stack), 0);
grid.realItems.removeIf(historyStack -> StackInfo.equalItemAndNBT(historyStack, stack, true));
grid.realItems.add(0, is);