gt:                 else if (enumfacing == enumfacing1.getOpposite())
context: package net.minecraft.world;
  
  import com.google.common.collect.Lists;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Random;
  import net.minecraft.block.BlockPortal;
  import net.minecraft.block.state.IBlockState;
  import net.minecraft.entity.Entity;
  import net.minecraft.init.Blocks;
  import net.minecraft.util.BlockPos;
  import net.minecraft.util.EnumFacing;
  import net.minecraft.util.LongHashMap;
  import net.minecraft.util.MathHelper;
  
  public class Teleporter
  {
      private final WorldServer worldServerInstance;
      /** A private Random() function in Teleporter */
      private final Random random;
      /** Stores successful portal placement locations for rapid lookup. */
      private final LongHashMap destinationCoordinateCache = new LongHashMap();
      /**
       * A list of valid keys for the destinationCoordainteCache. These are based on the X & Z of the players initial
       * location.
       */
      private final List destinationCoordinateKeys = Lists.newArrayList();
      private static final String __OBFID = "CL_00000153";
  
      public Teleporter(WorldServer worldIn)
      {
          this.worldServerInstance = worldIn;
          this.random = new Random(worldIn.getSeed());
      }
  
      public void placeInPortal(Entity entityIn, float rotationYaw)
      {
          if (this.worldServerInstance.provider.getDimensionId() != 1)
          {
              if (!this.placeInExistingPortal(entityIn, rotationYaw))
              {
                  this.makePortal(entityIn);
                  this.placeInExistingPortal(entityIn, rotationYaw);
              }
          }
          else
          {
              int i = MathHelper.floor_double(entityIn.posX);
              int j = MathHelper.floor_double(entityIn.posY) - 1;
              int k = MathHelper.floor_double(entityIn.posZ);
              byte b0 = 1;
              byte b1 = 0;
  
              for (int l = -2; l <= 2; ++l)
              {
                  for (int i1 = -2; i1 <= 2; ++i1)
                  {
                      for (int j1 = -1; j1 < 3; ++j1)
                      {
                          int k1 = i + i1 * b0 + l * b1;
                          int l1 = j + j1;
                          int i2 = k + i1 * b1 - l * b0;
                          boolean flag = j1 < 0;
                          this.worldServerInstance.setBlockState(new BlockPos(k1, l1, i2), flag ? Blocks.obsidian.getDefaultState() : Blocks.air.getDefaultState());
                      }
                  }
              }
  
              entityIn.setLocationAndAngles((double)i, (double)j, (double)k, entityIn.rotationYaw, 0.0F);
              entityIn.motionX = entityIn.motionY = entityIn.motionZ = 0.0D;
          }
      }
  
      public boolean placeInExistingPortal(Entity entityIn, float p_180620_2_)
      {
          boolean flag = true;
          double d0 = -1.0D;
          int i = MathHelper.floor_double(entityIn.posX);
          int j = MathHelper.floor_double(entityIn.posZ);
          boolean flag1 = true;
          Object object = BlockPos.ORIGIN;
          long k = ChunkCoordIntPair.chunkXZ2Int(i, j);
  
          if (this.destinationCoordinateCache.containsItem(k))
          {
              Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(k);
              d0 = 0.0D;
              object = portalposition;
              portalposition.lastUpdateTime = this.worldServerInstance.getTotalWorldTime();
              flag1 = false;
          }
          else
          {
              BlockPos blockpos4 = new BlockPos(entityIn);
  
              for (int l = -128; l <= 128; ++l)
              {
                  BlockPos blockpos1;
  
                  for (int i1 = -128; i1 <= 128; ++i1)
                  {
                      for (BlockPos blockpos = blockpos4.add(l, this.worldServerInstance.getActualHeight() - 1 - blockpos4.getY(), i1); blockpos.getY() >= 0; blockpos = blockpos1)
                      {
                          blockpos1 = blockpos.down();
  
                          if (this.worldServerInstance.getBlockState(blockpos).getBlock() == Blocks.portal)
                          {
                              while (this.worldServerInstance.getBlockState(blockpos1 = blockpos.down()).getBlock() == Blocks.portal)
                              {
                                  blockpos = blockpos1;
                              }
  
                              double d1 = blockpos.distanceSq(blockpos4);
  
                              if (d0 < 0.0D || d1 < d0)
                              {
                                  d0 = d1;
                                  object = blockpos;
                              }
                          }
                      }
                  }
              }
          }
  
          if (d0 >= 0.0D)
          {
              if (flag1)
              {
                  this.destinationCoordinateCache.add(k, new Teleporter.PortalPosition((BlockPos)object, this.worldServerInstance.getTotalWorldTime()));
                  this.destinationCoordinateKeys.add(Long.valueOf(k));
              }
  
              double d4 = (double)((BlockPos)object).getX() + 0.5D;
              double d5 = (double)((BlockPos)object).getY() + 0.5D;
              double d6 = (double)((BlockPos)object).getZ() + 0.5D;
              EnumFacing enumfacing = null;
  
              if (this.worldServerInstance.getBlockState(((BlockPos)object).west()).getBlock() == Blocks.portal)
              {
                  enumfacing = EnumFacing.NORTH;
              }
  
              if (this.worldServerInstance.getBlockState(((BlockPos)object).east()).getBlock() == Blocks.portal)
              {
                  enumfacing = EnumFacing.SOUTH;
              }
  
              if (this.worldServerInstance.getBlockState(((BlockPos)object).north()).getBlock() == Blocks.portal)
              {
                  enumfacing = EnumFacing.EAST;
              }
  
              if (this.worldServerInstance.getBlockState(((BlockPos)object).south()).getBlock() == Blocks.portal)
              {
                  enumfacing = EnumFacing.WEST;
              }
  
              EnumFacing enumfacing1 = EnumFacing.getHorizontal(entityIn.getTeleportDirection());
  
              if (enumfacing != null)
              {
                  EnumFacing enumfacing2 = enumfacing.rotateYCCW();
                  BlockPos blockpos2 = ((BlockPos)object).offset(enumfacing);
                  boolean flag2 = this.func_180265_a(blockpos2);
                  boolean flag3 = this.func_180265_a(blockpos2.offset(enumfacing2));
  
                  if (flag3 && flag2)
                  {
                      object = ((BlockPos)object).offset(enumfacing2);
                      enumfacing = enumfacing.getOpposite();
                      enumfacing2 = enumfacing2.getOpposite();
                      BlockPos blockpos3 = ((BlockPos)object).offset(enumfacing);
                      flag2 = this.func_180265_a(blockpos3);
                      flag3 = this.func_180265_a(blockpos3.offset(enumfacing2));
                  }
  
                  float f6 = 0.5F;
                  float f1 = 0.5F;
  
                  if (!flag3 && flag2)
                  {
                      f6 = 1.0F;
                  }
                  else if (flag3 && !flag2)
                  {
                      f6 = 0.0F;
                  }
                  else if (flag3)
                  {
                      f1 = 0.0F;
                  }
  
                  d4 = (double)((BlockPos)object).getX() + 0.5D;
                  d5 = (double)((BlockPos)object).getY() + 0.5D;
                  d6 = (double)((BlockPos)object).getZ() + 0.5D;
                  d4 += (double)((float)enumfacing2.getFrontOffsetX() * f6 + (float)enumfacing.getFrontOffsetX() * f1);
                  d6 += (double)((float)enumfacing2.getFrontOffsetZ() * f6 + (float)enumfacing.getFrontOffsetZ() * f1);
                  float f2 = 0.0F;
                  float f3 = 0.0F;
                  float f4 = 0.0F;
                  float f5 = 0.0F;
  
                  if (enumfacing == enumfacing1)
                  {
                      f2 = 1.0F;
                      f3 = 1.0F;
                  }
  