mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-20 04:09:49 +00:00
Fix custom drawers not stacking if crafted from different material "stack sizes"
This commit is contained in:
1 parent
c7a9c76e7e
commit
d3dc2bd455
1 file changed
+16
-15
@@ -39,23 +39,14 @@ public class ItemCustomDrawers extends ItemDrawers
|
||||
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
|
||||
if (matSide != null) {
|
||||
NBTTagCompound itag = new NBTTagCompound();
|
||||
matSide.writeToNBT(itag);
|
||||
tag.setTag("MatS", itag);
|
||||
}
|
||||
if (matSide != null)
|
||||
tag.setTag("MatS", getMaterialTag(matSide));
|
||||
|
||||
if (matTrim != null) {
|
||||
NBTTagCompound itag = new NBTTagCompound();
|
||||
matTrim.writeToNBT(itag);
|
||||
tag.setTag("MatT", itag);
|
||||
}
|
||||
if (matTrim != null)
|
||||
tag.setTag("MatT", getMaterialTag(matTrim));
|
||||
|
||||
if (matFront != null) {
|
||||
NBTTagCompound itag = new NBTTagCompound();
|
||||
matFront.writeToNBT(itag);
|
||||
tag.setTag("MatF", itag);
|
||||
}
|
||||
if (matFront != null)
|
||||
tag.setTag("MatF", getMaterialTag(matFront));
|
||||
|
||||
ItemStack stack = new ItemStack(item, count, 0);
|
||||
if (!tag.hasNoTags())
|
||||
@@ -63,4 +54,14 @@ public class ItemCustomDrawers extends ItemDrawers
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
private static NBTTagCompound getMaterialTag (ItemStack mat) {
|
||||
mat = mat.copy();
|
||||
mat.stackSize = 1;
|
||||
|
||||
NBTTagCompound itag = new NBTTagCompound();
|
||||
mat.writeToNBT(itag);
|
||||
|
||||
return itag;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user