mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-12 00:07:29 +00:00
Fix stacksize overflow when overlaying recipe (#167)
This commit is contained in:
1 parent
bd0e7fabca
commit
1efa92adad
4 files changed
+18
-10
No files matched your search
@@ -304,6 +304,18 @@ public final class Util {
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeItemStackToNBT(ItemStack itemStack, NBTTagCompound tag) {
|
||||
itemStack.writeToNBT(tag);
|
||||
tag.setInteger("Count", itemStack.stackSize);
|
||||
}
|
||||
|
||||
public static ItemStack loadItemStackFromNBT(NBTTagCompound tag) {
|
||||
ItemStack itemStack = ItemStack.loadItemStackFromNBT(tag);
|
||||
if (itemStack == null) return null;
|
||||
itemStack.stackSize = tag.getInteger("Count");
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public static IAEFluidStack loadFluidStackFromNBT(final NBTTagCompound i) {
|
||||
final FluidStack t = FluidRegistry.getFluidStack(i.getString("FluidName"), 1);
|
||||
if (t == null) return null;
|
||||
|
||||
Reference in new issue
Block a user