Skip to content

Commit 709bc55

Browse files
authored
Clear tag if empty so machines stack (#5133)
1 parent 6a8bc85 commit 709bc55

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/com/gregtechceu/gtceu/api/block/MetaMachineBlock.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,11 @@ public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
239239
machine.modifyDrops(drops);
240240
for (ItemStack drop : drops) {
241241
if (drop.getItem() instanceof MetaMachineItem item && item.getBlock() == this) {
242-
machine.saveToItem(drop.getOrCreateTag(), false);
242+
CompoundTag tag = drop.getOrCreateTag();
243+
machine.saveToItem(tag, false);
244+
if (tag.isEmpty()) {
245+
drop.setTag(null);
246+
}
243247
// break here to not dupe contents if a machine drops multiple of itself for whatever reason.
244248
break;
245249
}

0 commit comments

Comments
 (0)