gt:                     if (this.adjacentChestXPos != p_145978_1_)
context: package net.minecraft.tileentity;
  
  import cpw.mods.fml.relauncher.Side;
  import cpw.mods.fml.relauncher.SideOnly;
  import java.util.Iterator;
  import java.util.List;
  import net.minecraft.block.Block;
  import net.minecraft.block.BlockChest;
  import net.minecraft.entity.player.EntityPlayer;
  import net.minecraft.inventory.ContainerChest;
  import net.minecraft.inventory.IInventory;
  import net.minecraft.inventory.InventoryLargeChest;
  import net.minecraft.item.ItemStack;
  import net.minecraft.nbt.NBTTagCompound;
  import net.minecraft.nbt.NBTTagList;
  import net.minecraft.util.AxisAlignedBB;
  
  public class TileEntityChest extends TileEntity implements IInventory
  {
      private ItemStack[] chestContents = new ItemStack[36];
      public boolean adjacentChestChecked;
      public TileEntityChest adjacentChestZNeg;
      public TileEntityChest adjacentChestXPos;
      public TileEntityChest adjacentChestXNeg;
      public TileEntityChest adjacentChestZPos;
      public float lidAngle;
      public float prevLidAngle;
      public int numPlayersUsing;
      private int ticksSinceSync;
      private int cachedChestType;
      private String customName;
      private static final String __OBFID = "CL_00000346";
  
      public TileEntityChest()
      {
          this.cachedChestType = -1;
      }
  
      @SideOnly(Side.CLIENT)
      public TileEntityChest(int p_i2350_1_)
      {
          this.cachedChestType = p_i2350_1_;
      }
  
      public int getSizeInventory()
      {
          return 27;
      }
  
      public ItemStack getStackInSlot(int p_70301_1_)
      {
          return this.chestContents[p_70301_1_];
      }
  
      public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_)
      {
          if (this.chestContents[p_70298_1_] != null)
          {
              ItemStack itemstack;
  
              if (this.chestContents[p_70298_1_].stackSize <= p_70298_2_)
              {
                  itemstack = this.chestContents[p_70298_1_];
                  this.chestContents[p_70298_1_] = null;
                  this.markDirty();
                  return itemstack;
              }
              else
              {
                  itemstack = this.chestContents[p_70298_1_].splitStack(p_70298_2_);
  
                  if (this.chestContents[p_70298_1_].stackSize == 0)
                  {
                      this.chestContents[p_70298_1_] = null;
                  }
  
                  this.markDirty();
                  return itemstack;
              }
          }
          else
          {
              return null;
          }
      }
  
      public ItemStack getStackInSlotOnClosing(int p_70304_1_)
      {
          if (this.chestContents[p_70304_1_] != null)
          {
              ItemStack itemstack = this.chestContents[p_70304_1_];
              this.chestContents[p_70304_1_] = null;
              return itemstack;
          }
          else
          {
              return null;
          }
      }
  
      public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_)
      {
          this.chestContents[p_70299_1_] = p_70299_2_;
  
          if (p_70299_2_ != null && p_70299_2_.stackSize > this.getInventoryStackLimit())
          {
              p_70299_2_.stackSize = this.getInventoryStackLimit();
          }
  
          this.markDirty();
      }
  
      public String getInventoryName()
      {
          return this.hasCustomInventoryName() ? this.customName : "container.chest";
      }
  
      public boolean hasCustomInventoryName()
      {
          return this.customName != null && this.customName.length() > 0;
      }
  
      public void func_145976_a(String p_145976_1_)
      {
          this.customName = p_145976_1_;
      }
  
      public void readFromNBT(NBTTagCompound p_145839_1_)
      {
          super.readFromNBT(p_145839_1_);
          NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10);
          this.chestContents = new ItemStack[this.getSizeInventory()];
  
          if (p_145839_1_.hasKey("CustomName", 8))
          {
              this.customName = p_145839_1_.getString("CustomName");
          }
  
          for (int i = 0; i < nbttaglist.tagCount(); ++i)
          {
              NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
              int j = nbttagcompound1.getByte("Slot") & 255;
  
              if (j >= 0 && j < this.chestContents.length)
              {
                  this.chestContents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
              }
          }
      }
  
      public void writeToNBT(NBTTagCompound p_145841_1_)
      {
          super.writeToNBT(p_145841_1_);
          NBTTagList nbttaglist = new NBTTagList();
  
          for (int i = 0; i < this.chestContents.length; ++i)
          {
              if (this.chestContents[i] != null)
              {
                  NBTTagCompound nbttagcompound1 = new NBTTagCompound();
                  nbttagcompound1.setByte("Slot", (byte)i);
                  this.chestContents[i].writeToNBT(nbttagcompound1);
                  nbttaglist.appendTag(nbttagcompound1);
              }
          }
  
          p_145841_1_.setTag("Items", nbttaglist);
  
          if (this.hasCustomInventoryName())
          {
              p_145841_1_.setString("CustomName", this.customName);
          }
      }
  
      public int getInventoryStackLimit()
      {
          return 64;
      }
  
      public boolean isUseableByPlayer(EntityPlayer p_70300_1_)
      {
          return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : p_70300_1_.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
      }
  
      public void updateContainingBlockInfo()
      {
          super.updateContainingBlockInfo();
          this.adjacentChestChecked = false;
      }
  
      private void func_145978_a(TileEntityChest p_145978_1_, int p_145978_2_)
      {
          if (p_145978_1_.isInvalid())
          {
              this.adjacentChestChecked = false;
          }
          else if (this.adjacentChestChecked)
          {
              switch (p_145978_2_)
              {
                  case 0:
                      if (this.adjacentChestZPos != p_145978_1_)
                      {
                          this.adjacentChestChecked = false;
                      }
  
                      break;
                  case 1:
                      if (this.adjacentChestXNeg != p_145978_1_)
                      {
                          this.adjacentChestChecked = false;
                      }
  
                      break;
                  case 2:
                      if (this.adjacentChestZNeg != p_145978_1_)
                      {
                          this.adjacentChestChecked = false;
                      }
  
                      break;
                  case 3:
  