Read NBT tags combine and beSubstitute from ItemStack when converting them to FluidPattern (#268)

This commit is contained in:
Zoltán Szepesi authored and GitHub committed 2025-02-22 22:30:19 -06:00
1 parent e88af75f40
commit d78618d950
2 files changed
+4

No files matched your search

@@ -271,6 +271,7 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
pattern.setInputs(collectInventory(this.craftingSlots));
pattern.setOutputs(collectInventory(this.outputSlots));
pattern.setCanBeSubstitute(this.beSubstitute ? 1 : 0);
pattern.setCombine(this.combine ? 1 : 0);
patternSlotOUT.putStack(stampAuthor(pattern.writeToStack()));
}
@@ -187,6 +187,9 @@ public class FluidPatternDetails implements ICraftingPatternDetails, Comparable<
return false;
}
NBTTagCompound tag = Objects.requireNonNull(patternStack.getTagCompound());
setCanBeSubstitute(tag.getBoolean("beSubstitute") ? 1 : 0);
setCombine(tag.getInteger("combine"));
// may be possible to enter a partially-correct state if setInputs succeeds but setOutputs failed
// but outside code should treat it as completely incorrect and not attempt to make calls
return setInputs(readStackArray(tag.getTagList("in", Constants.NBT.TAG_COMPOUND)))