Program: 30621
Project: 30621
Buggy source:
/** 
 * Mostly from dimentional doors.. which mostly got it form X-Comp.
 * @param world
 * @param entity
 * @param link
 * @return
 */
public Entity teleportEntity(Entity entity,TelDestination link){
  WorldServer oldWorld, newWorld;
  EntityPlayerMP player;
  try {
    oldWorld=(WorldServer)entity.worldObj;
    newWorld=(WorldServer)link.dim;
    player=(entity instanceof EntityPlayerMP) ? (EntityPlayerMP)entity : null;
  }
 catch (  Throwable e) {
    return entity;
  }
  if (oldWorld == null)   return entity;
  if (newWorld == null)   return entity;
  if (entity.riddenByEntity != null) {
    return teleportEntity(entity.riddenByEntity,link);
  }
  Entity cart=entity.ridingEntity;
  if (cart != null) {
    entity.mountEntity(null);
    cart=teleportEntity(cart,link);
  }
  boolean difDest=newWorld != oldWorld;
  if (difDest) {
    if (player != null) {
      player.mcServer.getConfigurationManager().transferPlayerToDimension(player,link.dim.provider.dimensionId,new METeleporter(newWorld,link));
    }
 else {
      int entX=entity.chunkCoordX;
      int entZ=entity.chunkCoordZ;
      if ((entity.addedToChunk) && (oldWorld.getChunkProvider().chunkExists(entX,entZ))) {
        oldWorld.getChunkFromChunkCoords(entX,entZ).removeEntity(entity);
        oldWorld.getChunkFromChunkCoords(entX,entZ).isModified=true;
      }
      if (onEntityRemoved == null) {
        onEntityRemoved=ReflectionHelper.findMethod(WorldServer.class,oldWorld,new String[]{"String_Node_Str","String_Node_Str"},Entity.class);
      }
      if (onEntityRemoved != null) {
        try {
          onEntityRemoved.invoke(oldWorld,entity);
        }
 catch (        Throwable t) {
          AELog.error(t);
        }
      }
      if (player == null) {
        NBTTagCompound entityNBT=new NBTTagCompound();
        entity.posX=link.x;
        entity.posY=link.y;
        entity.posZ=link.z;
        entity.prevPosX=link.x;
        entity.prevPosY=link.y;
        entity.prevPosZ=link.z;
        entity.isDead=false;
        entity.writeToNBTOptional(entityNBT);
        entity.isDead=true;
        entity=EntityList.createEntityFromNBT(entityNBT,newWorld);
      }
      if (entity == null)       return entity;
      newWorld.spawnEntityInWorld(entity);
      entity.setWorld(newWorld);
    }
  }
  entity.worldObj.updateEntityWithOptionalForce(entity,false);
  if (cart != null) {
    if (player != null)     entity.worldObj.updateEntityWithOptionalForce(entity,true);
    entity.mountEntity(cart);
  }
  if (player != null) {
    WorldServer.class.cast(newWorld).getChunkProvider().loadChunk(MathHelper.floor_double(entity.posX) >> 4,MathHelper.floor_double(entity.posZ) >> 4);
  }
  return entity;
}

Fixed version (ground truth):
/** 
 * Mostly from dimentional doors.. which mostly got it form X-Comp.
 * @param world
 * @param entity
 * @param link
 * @return
 */
public Entity teleportEntity(Entity entity,TelDestination link){
  WorldServer oldWorld, newWorld;
  EntityPlayerMP player;
  try {
    oldWorld=(WorldServer)entity.worldObj;
    newWorld=(WorldServer)link.dim;
    player=(entity instanceof EntityPlayerMP) ? (EntityPlayerMP)entity : null;
  }
 catch (  Throwable e) {
    return entity;
  }
  if (oldWorld == null)   return entity;
  if (newWorld == null)   return entity;
  if (entity.riddenByEntity != null) {
    return teleportEntity(entity.riddenByEntity,link);
  }
  Entity cart=entity.ridingEntity;
  if (cart != null) {
    entity.mountEntity(null);
    cart=teleportEntity(cart,link);
  }
  Chunk myChunk=WorldServer.class.cast(newWorld).getChunkProvider().loadChunk(MathHelper.floor_double(link.x) >> 4,MathHelper.floor_double(link.z) >> 4);
  boolean difDest=newWorld != oldWorld;
  if (difDest) {
    if (player != null) {
      player.mcServer.getConfigurationManager().transferPlayerToDimension(player,link.dim.provider.dimensionId,new METeleporter(newWorld,link));
    }
 else {
      int entX=entity.chunkCoordX;
      int entZ=entity.chunkCoordZ;
      if ((entity.addedToChunk) && (oldWorld.getChunkProvider().chunkExists(entX,entZ))) {
        oldWorld.getChunkFromChunkCoords(entX,entZ).removeEntity(entity);
        oldWorld.getChunkFromChunkCoords(entX,entZ).isModified=true;
      }
      Entity newEntity=EntityList.createEntityByName(EntityList.getEntityString(entity),newWorld);
      if (newEntity != null) {
        entity.lastTickPosX=entity.prevPosX=entity.posX=link.x;
        entity.lastTickPosY=entity.prevPosY=entity.posY=link.y;
        entity.lastTickPosZ=entity.prevPosZ=entity.posZ=link.z;
        if (entity instanceof EntityHanging) {
          EntityHanging h=(EntityHanging)entity;
          h.field_146063_b+=link.xOff;
          h.field_146064_c+=link.yOff;
          h.field_146062_d+=link.zOff;
        }
        newEntity.copyDataFrom(entity,true);
        newEntity.dimension=newWorld.provider.dimensionId;
        newEntity.forceSpawn=true;
        entity.isDead=true;
        entity=newEntity;
      }
 else       return null;
      newWorld.spawnEntityInWorld(entity);
    }
  }
  entity.worldObj.updateEntityWithOptionalForce(entity,false);
  if (cart != null) {
    if (player != null)     entity.worldObj.updateEntityWithOptionalForce(entity,true);
    entity.mountEntity(cart);
  }
  return entity;
}