Skip to content

Commit

Permalink
Bookmarks Recipe Chains: fluid cell
Browse files Browse the repository at this point in the history
  • Loading branch information
slprime committed Feb 3, 2024
1 parent 3d07a33 commit e0bdbf6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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 @@ -41,8 +41,8 @@ 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.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 e0bdbf6

Please sign in to comment.