From 8f298b4eb70a59f49d0f5dc608ddd25f559fb520 Mon Sep 17 00:00:00 2001 From: SirSengir Date: Sun, 9 Sep 2012 09:59:17 +0200 Subject: [PATCH] Fixed double chests not being recognized by pipes. --- common/buildcraft/core/inventory/Transactor.java | 3 ++- common/buildcraft/core/utils/Utils.java | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/common/buildcraft/core/inventory/Transactor.java b/common/buildcraft/core/inventory/Transactor.java index bb63d5d5..0a169556 100644 --- a/common/buildcraft/core/inventory/Transactor.java +++ b/common/buildcraft/core/inventory/Transactor.java @@ -2,6 +2,7 @@ package buildcraft.core.inventory; import buildcraft.api.core.Orientations; import buildcraft.api.inventory.ISpecialInventory; +import buildcraft.core.utils.Utils; import net.minecraft.src.IInventory; import net.minecraft.src.ItemStack; import net.minecraftforge.common.ISidedInventory; @@ -26,7 +27,7 @@ public abstract class Transactor implements ITransactor { return new TransactorSided((ISidedInventory)object); else if(object instanceof IInventory) - return new TransactorSimple((IInventory)object); + return new TransactorSimple(Utils.getInventory((IInventory)object)); return null; } diff --git a/common/buildcraft/core/utils/Utils.java b/common/buildcraft/core/utils/Utils.java index d4bf61d4..1873a2a2 100644 --- a/common/buildcraft/core/utils/Utils.java +++ b/common/buildcraft/core/utils/Utils.java @@ -208,6 +208,11 @@ public class Utils { return world.getBlockTileEntity((int) tmp.x, (int) tmp.y, (int) tmp.z); } + /** + * Ensures that the given inventory is the full inventory, i.e. takes double chests into account. + * @param inv + * @return Modified inventory if double chest, unmodified otherwise. + */ public static IInventory getInventory(IInventory inv) { if (inv instanceof TileEntityChest) { TileEntityChest chest = (TileEntityChest) inv;