Fixed double chests not being recognized by pipes.
This commit is contained in:
parent
5303b5a5de
commit
8f298b4eb7
2 changed files with 7 additions and 1 deletions
|
@ -2,6 +2,7 @@ package buildcraft.core.inventory;
|
||||||
|
|
||||||
import buildcraft.api.core.Orientations;
|
import buildcraft.api.core.Orientations;
|
||||||
import buildcraft.api.inventory.ISpecialInventory;
|
import buildcraft.api.inventory.ISpecialInventory;
|
||||||
|
import buildcraft.core.utils.Utils;
|
||||||
import net.minecraft.src.IInventory;
|
import net.minecraft.src.IInventory;
|
||||||
import net.minecraft.src.ItemStack;
|
import net.minecraft.src.ItemStack;
|
||||||
import net.minecraftforge.common.ISidedInventory;
|
import net.minecraftforge.common.ISidedInventory;
|
||||||
|
@ -26,7 +27,7 @@ public abstract class Transactor implements ITransactor {
|
||||||
return new TransactorSided((ISidedInventory)object);
|
return new TransactorSided((ISidedInventory)object);
|
||||||
|
|
||||||
else if(object instanceof IInventory)
|
else if(object instanceof IInventory)
|
||||||
return new TransactorSimple((IInventory)object);
|
return new TransactorSimple(Utils.getInventory((IInventory)object));
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,6 +208,11 @@ public class Utils {
|
||||||
return world.getBlockTileEntity((int) tmp.x, (int) tmp.y, (int) tmp.z);
|
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) {
|
public static IInventory getInventory(IInventory inv) {
|
||||||
if (inv instanceof TileEntityChest) {
|
if (inv instanceof TileEntityChest) {
|
||||||
TileEntityChest chest = (TileEntityChest) inv;
|
TileEntityChest chest = (TileEntityChest) inv;
|
||||||
|
|
Loading…
Reference in a new issue