/*
* Utility function to get the full inventory for a Double Chest in the World.
*/
public static IInventory GetChestInv(Object te)
{
TileEntityChest teA = (TileEntityChest) te;
TileEntity teB = null;
Block myBlockID = teA.getWorldObj().getBlock( teA.xCoord, teA.yCoord, teA.zCoord );
if ( teA.getWorldObj().getBlock( teA.xCoord + 1, teA.yCoord, teA.zCoord ) == myBlockID )
{
teB = teA.getWorldObj().getTileEntity( teA.xCoord + 1, teA.yCoord, teA.zCoord );
if ( !(teB instanceof TileEntityChest) )
teB = null;
}
if ( teB == null )
{
if ( teA.getWorldObj().getBlock( teA.xCoord - 1, teA.yCoord, teA.zCoord ) == myBlockID )
{
teB = teA.getWorldObj().getTileEntity( teA.xCoord - 1, teA.yCoord, teA.zCoord );
if ( !(teB instanceof TileEntityChest) )
teB = null;
else
{
TileEntityChest x = teA;
teA = (TileEntityChest) teB;
teB = x;
}
}
}
if ( teB == null )
{
if ( teA.getWorldObj().getBlock( teA.xCoord, teA.yCoord, teA.zCoord + 1 ) == myBlockID )
{
teB = teA.getWorldObj().getTileEntity( teA.xCoord, teA.yCoord, teA.zCoord + 1 );
if ( !(teB instanceof TileEntityChest) )
teB = null;
}
}
if ( teB == null )
{
if ( teA.getWorldObj().getBlock( teA.xCoord, teA.yCoord, teA.zCoord - 1 ) == myBlockID )
{
teB = teA.getWorldObj().getTileEntity( teA.xCoord, teA.yCoord, teA.zCoord - 1 );
if ( !(teB instanceof TileEntityChest) )
teB = null;
else
{
TileEntityChest x = teA;
teA = (TileEntityChest) teB;
teB = x;
}
}
}