mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-15 17:54:50 +00:00
Show Handler Icon in Bookmarks (#747)
This commit is contained in:
1 parent
f7f0596fda
commit
2ea9ae1eb9
5 files changed
+77
-14
No files matched your search
@@ -185,22 +185,24 @@ public class BookmarkPanel extends PanelWidget<BookmarkGrid> {
|
||||
&& this.grid.existsRecipe(recipeId, BookmarkGrid.DEFAULT_GROUP_ID);
|
||||
final NBTTagCompound nbTag = StackInfo.itemStackToNBT(itemStack);
|
||||
long factor = nbTag.getInteger("Count");
|
||||
long count = factor;
|
||||
|
||||
if (existsRecipe) {
|
||||
|
||||
for (int i = 0; i < this.grid.size(); i++) {
|
||||
if (this.grid.getBookmarkItem(i).equalsRecipe(recipeId, groupId)) {
|
||||
final long multiplier = this.grid.getBookmarkItem(i).getMultiplier();
|
||||
factor *= multiplier;
|
||||
count *= this.grid.getBookmarkItem(i).getMultiplier();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (factor == 0) {
|
||||
factor = nbTag.hasKey("gtFluidName") ? Math.min(144, nbTag.getInteger("Count")) : 1;
|
||||
}
|
||||
|
||||
this.grid.addItem(BookmarkItem.of(groupId, itemStack, factor, recipeId, false), true);
|
||||
this.grid.addItem(
|
||||
BookmarkItem.of(groupId, StackInfo.withAmount(itemStack, count), factor, recipeId, false),
|
||||
true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user