From 3868f997987b534ea4269392653582506667cdcb Mon Sep 17 00:00:00 2001 From: Vladimir Kalinin Date: Sat, 6 Apr 2019 20:25:42 +0300 Subject: [PATCH] https://github.com/MightyPirates/OpenComputers/issues/2928 AE2 Cells don't have extra information they should --- .../oc/integration/appeng/ConverterCellInventory.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/scala/li/cil/oc/integration/appeng/ConverterCellInventory.java b/src/main/scala/li/cil/oc/integration/appeng/ConverterCellInventory.java index 594a5cd47..413685308 100644 --- a/src/main/scala/li/cil/oc/integration/appeng/ConverterCellInventory.java +++ b/src/main/scala/li/cil/oc/integration/appeng/ConverterCellInventory.java @@ -3,6 +3,10 @@ package li.cil.oc.integration.appeng; import appeng.api.AEApi; import appeng.api.storage.ICellInventory; import appeng.api.storage.ICellInventoryHandler; +import appeng.api.implementations.items.IStorageCell; +import appeng.api.storage.IMEInventoryHandler; +import appeng.api.storage.StorageChannel; +import net.minecraft.item.ItemStack; import li.cil.oc.api.driver.Converter; import java.util.Map; @@ -31,6 +35,11 @@ public final class ConverterCellInventory implements Converter { output.put("name", cell.getItemStack().getDisplayName()); } else if (value instanceof ICellInventoryHandler) { convert(((ICellInventoryHandler) value).getCellInv(), output); + } else if ((value instanceof ItemStack) && (((ItemStack)value).getItem() instanceof IStorageCell)) { + IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory((ItemStack) value, null, StorageChannel.ITEMS); + if (inventory instanceof ICellInventoryHandler) + convert(((ICellInventoryHandler) inventory).getCellInv(), output); } + } }