Skip to content

Commit

Permalink
Merge remote-tracking branch 'slprime/bookmarks_groups_and_filter' in…
Browse files Browse the repository at this point in the history
…to dev
  • Loading branch information
Dream-Master committed Feb 3, 2024
2 parents 12da0ba + d64c270 commit 5576f1b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/codechicken/nei/BookmarkCraftingChain.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected static class CraftingChainItem {
public int factor = 0;
public int count = 0;
public boolean ingredient = false;
public boolean fluidCell = false;
public int fluidCellAmount = 1;
public ItemStack stack = null;

public CraftingChainItem(ItemStack stack, ItemStackMetadata stackMetadata) {
Expand All @@ -40,9 +40,9 @@ public CraftingChainItem(ItemStack stack, ItemStackMetadata stackMetadata) {

if (fluid != null) {
this.stackIndex = getStackIndex(fluid);
this.count = fluid.amount * Math.max(1, stack.stackSize);
this.fluidCell = StackInfo.isFluidContainer(stack);
this.factor = this.fluidCell ? fluid.amount : stackMetadata.factor;
this.count = fluid.amount * Math.max(0, stack.stackSize);
this.fluidCellAmount = StackInfo.isFluidContainer(stack) ? fluid.amount : 1;
this.factor = this.fluidCellAmount * stackMetadata.factor;
} else {
this.stackIndex = getStackIndex(stack);
this.count = StackInfo.itemStackToNBT(stack).getInteger("Count");
Expand All @@ -55,7 +55,7 @@ public CraftingChainItem(ItemStack stack, ItemStackMetadata stackMetadata) {
public ItemStack getItemStack(long count) {
return StackInfo.loadFromNBT(
StackInfo.itemStackToNBT(this.stack),
this.factor > 0 ? (this.fluidCell ? (count / this.factor) : count) : 0);
this.factor > 0 ? (count / this.fluidCellAmount) : 0);
}

public static void clearStatic() {
Expand Down

0 comments on commit 5576f1b

Please sign in to comment.