Ejemplo n.º 1
0
  public static EnumFacing getFacingFromEntity(BlockPos clickedBlock, EntityLivingBase entityIn) {
    if (MathHelper.abs((float) entityIn.posX - clickedBlock.getX()) < 2.0F
        && MathHelper.abs((float) entityIn.posZ - clickedBlock.getZ()) < 2.0F) {
      double d0 = entityIn.posY + entityIn.getEyeHeight();

      if (d0 - clickedBlock.getY() > 2.0D) {
        return EnumFacing.UP;
      }

      if (clickedBlock.getY() - d0 > 0.0D) {
        return EnumFacing.DOWN;
      }
    }

    return entityIn.getHorizontalFacing().getOpposite();
  }
Ejemplo n.º 2
0
  public static int determineOrientation(World world, int x, int y, int z, EntityLivingBase elb) {
    if (MathHelper.abs((float) elb.posX - (float) x) < 2.0F
        && MathHelper.abs((float) elb.posZ - (float) z) < 2.0F) {
      double d0 = elb.posY + 1.82D - (double) elb.yOffset;

      if (d0 - (double) y > 2.0D) {
        return 1;
      }

      if ((double) y - d0 > 0.0D) {
        return 0;
      }
    }

    int l = MathHelper.floor_double((double) (elb.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
    return l == 0 ? 2 : (l == 1 ? 5 : (l == 2 ? 3 : (l == 3 ? 4 : 0)));
  }
  public static ForgeDirection determineOrientation(
      int x, int y, int z, EntityLivingBase entityLivingBase) {
    if (MathHelper.abs((float) entityLivingBase.posX - x) < 2.0F
        && MathHelper.abs((float) entityLivingBase.posZ - z) < 2.0F) {
      double d0 = entityLivingBase.posY + 1.82D - entityLivingBase.yOffset;

      if (d0 - y > 2.0D) {
        return ForgeDirection.UP;
      }

      if (y - d0 > 0.0D) {
        return ForgeDirection.DOWN;
      }
    }
    int l = MathHelper.floor_double((entityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
    return l == 0
        ? ForgeDirection.NORTH
        : (l == 1
            ? ForgeDirection.EAST
            : (l == 2
                ? ForgeDirection.SOUTH
                : (l == 3 ? ForgeDirection.WEST : ForgeDirection.DOWN)));
  }
Ejemplo n.º 4
0
  /** Draws the screen and all the components in it. */
  public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) {
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    this.renderSkybox(p_73863_1_, p_73863_2_, p_73863_3_);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    Tessellator var4 = Tessellator.instance;
    short var5 = 274;
    int var6 = this.width / 2 - var5 / 2;
    byte var7 = 30;
    this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215);
    this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE);
    this.mc.getTextureManager().bindTexture(minecraftTitleTextures);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    if ((double) this.updateCounter < 1.0E-4D) {
      this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 99, 44);
      this.drawTexturedModalRect(var6 + 99, var7 + 0, 129, 0, 27, 44);
      this.drawTexturedModalRect(var6 + 99 + 26, var7 + 0, 126, 0, 3, 44);
      this.drawTexturedModalRect(var6 + 99 + 26 + 3, var7 + 0, 99, 0, 26, 44);
      this.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44);
    } else {
      this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 155, 44);
      this.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44);
    }

    var4.setColorOpaque_I(-1);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) (this.width / 2 + 90), 70.0F, 0.0F);
    GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F);
    float var8 =
        1.8F
            - MathHelper.abs(
                MathHelper.sin(
                        (float) (Minecraft.getSystemTime() % 1000L)
                            / 1000.0F
                            * (float) Math.PI
                            * 2.0F)
                    * 0.1F);
    var8 = var8 * 100.0F / (float) (this.fontRendererObj.getStringWidth(this.splashText) + 32);
    GL11.glScalef(var8, var8, var8);
    this.drawCenteredString(this.fontRendererObj, this.splashText, 0, -8, -256);
    GL11.glPopMatrix();
    String var9 = "Minecraft 1.7.10 (InstanceClient)";

    if (this.mc.isDemo()) {
      var9 = var9 + " Demo";
    }

    this.drawString(this.fontRendererObj, var9, 2, this.height - 10, -1);
    String var10 = "Copyright Mojang AB. Do not distribute!";
    this.drawString(
        this.fontRendererObj,
        var10,
        this.width - this.fontRendererObj.getStringWidth(var10) - 2,
        this.height - 10,
        -1);

    if (this.field_92025_p != null && this.field_92025_p.length() > 0) {
      drawRect(
          this.field_92022_t - 2,
          this.field_92021_u - 2,
          this.field_92020_v + 2,
          this.field_92019_w - 1,
          1428160512);
      this.drawString(
          this.fontRendererObj, this.field_92025_p, this.field_92022_t, this.field_92021_u, -1);
      this.drawString(
          this.fontRendererObj,
          this.field_146972_A,
          (this.width - this.field_92024_r) / 2,
          ((GuiButton) this.buttonList.get(0)).field_146129_i - 12,
          -1);
    }

    super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
  }
  /** Draws the screen and all the components in it. */
  public void drawScreen(int par1, int par2, float par3) {
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    this.renderSkybox(par1, par2, par3);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    Tessellator tessellator = Tessellator.instance;
    short short1 = 274;
    int k = this.width / 2 - short1 / 2;
    byte b0 = 30;
    this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215);
    this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE);
    this.mc.getTextureManager().bindTexture(minecraftTitleTextures);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    if ((double) this.updateCounter < 1.0E-4D) {
      this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 99, 44);
      this.drawTexturedModalRect(k + 99, b0 + 0, 129, 0, 27, 44);
      this.drawTexturedModalRect(k + 99 + 26, b0 + 0, 126, 0, 3, 44);
      this.drawTexturedModalRect(k + 99 + 26 + 3, b0 + 0, 99, 0, 26, 44);
      this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44);
    } else {
      this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 155, 44);
      this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44);
    }

    tessellator.setColorOpaque_I(-1);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) (this.width / 2 + 90), 70.0F, 0.0F);
    GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F);
    float f1 =
        1.8F
            - MathHelper.abs(
                MathHelper.sin(
                        (float) (Minecraft.getSystemTime() % 1000L)
                            / 1000.0F
                            * (float) Math.PI
                            * 2.0F)
                    * 0.1F);
    f1 = f1 * 100.0F / (float) (this.fontRendererObj.getStringWidth(this.splashText) + 32);
    GL11.glScalef(f1, f1, f1);
    this.drawCenteredString(this.fontRendererObj, this.splashText, 0, -8, -256);
    GL11.glPopMatrix();
    String s = "Minecraft 1.7.2";

    if (this.mc.isDemo()) {
      s = s + " Demo";
    }

    List<String> brandings = Lists.reverse(FMLCommonHandler.instance().getBrandings(true));
    for (int i = 0; i < brandings.size(); i++) {
      String brd = brandings.get(i);
      if (!Strings.isNullOrEmpty(brd)) {
        this.drawString(
            this.fontRendererObj,
            brd,
            2,
            this.height - (10 + i * (this.fontRendererObj.FONT_HEIGHT + 1)),
            16777215);
      }
    }
    ForgeHooksClient.renderMainMenu(this, fontRendererObj, width, height);
    String s1 = "Copyright Mojang AB. Do not distribute!";
    this.drawString(
        this.fontRendererObj,
        s1,
        this.width - this.fontRendererObj.getStringWidth(s1) - 2,
        this.height - 10,
        -1);

    if (this.field_92025_p != null && this.field_92025_p.length() > 0) {
      drawRect(
          this.field_92022_t - 2,
          this.field_92021_u - 2,
          this.field_92020_v + 2,
          this.field_92019_w - 1,
          1428160512);
      this.drawString(
          this.fontRendererObj, this.field_92025_p, this.field_92022_t, this.field_92021_u, -1);
      this.drawString(
          this.fontRendererObj,
          this.field_146972_A,
          (this.width - this.field_92024_r) / 2,
          ((GuiButton) this.buttonList.get(0)).yPosition - 12,
          -1);
    }

    super.drawScreen(par1, par2, par3);
  }
Ejemplo n.º 6
0
  /**
   * Renders the active item in the player's hand when in first person mode. Args: partialTickTime
   */
  public void renderItemInFirstPerson(float par1) {
    float f1 =
        this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * par1;
    EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer;
    float f2 =
        entityclientplayermp.prevRotationPitch
            + (entityclientplayermp.rotationPitch - entityclientplayermp.prevRotationPitch) * par1;
    GL11.glPushMatrix();
    GL11.glRotatef(f2, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(
        entityclientplayermp.prevRotationYaw
            + (entityclientplayermp.rotationYaw - entityclientplayermp.prevRotationYaw) * par1,
        0.0F,
        1.0F,
        0.0F);
    RenderHelper.enableStandardItemLighting();
    GL11.glPopMatrix();
    float f3;
    float f4;

    if (entityclientplayermp instanceof EntityPlayerSP) {
      EntityPlayerSP entityplayersp = (EntityPlayerSP) entityclientplayermp;
      f3 =
          entityplayersp.prevRenderArmPitch
              + (entityplayersp.renderArmPitch - entityplayersp.prevRenderArmPitch) * par1;
      f4 =
          entityplayersp.prevRenderArmYaw
              + (entityplayersp.renderArmYaw - entityplayersp.prevRenderArmYaw) * par1;
      GL11.glRotatef((entityclientplayermp.rotationPitch - f3) * 0.1F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef((entityclientplayermp.rotationYaw - f4) * 0.1F, 0.0F, 1.0F, 0.0F);
    }

    ItemStack itemstack = this.itemToRender;
    f3 =
        this.mc.theWorld.getLightBrightness(
            MathHelper.floor_double(entityclientplayermp.posX),
            MathHelper.floor_double(entityclientplayermp.posY),
            MathHelper.floor_double(entityclientplayermp.posZ));
    f3 = 1.0F;
    int i =
        this.mc.theWorld.getLightBrightnessForSkyBlocks(
            MathHelper.floor_double(entityclientplayermp.posX),
            MathHelper.floor_double(entityclientplayermp.posY),
            MathHelper.floor_double(entityclientplayermp.posZ),
            0);
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(
        OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    float f5;
    float f6;
    float f7;

    if (itemstack != null) {
      i = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0);
      f7 = (float) (i >> 16 & 255) / 255.0F;
      f6 = (float) (i >> 8 & 255) / 255.0F;
      f5 = (float) (i & 255) / 255.0F;
      GL11.glColor4f(f3 * f7, f3 * f6, f3 * f5, 1.0F);
    } else {
      GL11.glColor4f(f3, f3, f3, 1.0F);
    }

    float f8;
    float f9;
    float f10;
    Render render;
    RenderPlayer renderplayer;

    if (itemstack != null && itemstack.getItem() instanceof ItemMap) {
      GL11.glPushMatrix();
      f4 = 0.8F;
      f7 = entityclientplayermp.getSwingProgress(par1);
      f6 = MathHelper.sin(f7 * (float) Math.PI);
      f5 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI);
      GL11.glTranslatef(
          -f5 * 0.4F,
          MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI * 2.0F) * 0.2F,
          -f6 * 0.2F);
      f7 = 1.0F - f2 / 45.0F + 0.1F;

      if (f7 < 0.0F) {
        f7 = 0.0F;
      }

      if (f7 > 1.0F) {
        f7 = 1.0F;
      }

      f7 = -MathHelper.cos(f7 * (float) Math.PI) * 0.5F + 0.5F;
      GL11.glTranslatef(0.0F, 0.0F * f4 - (1.0F - f1) * 1.2F - f7 * 0.5F + 0.04F, -0.9F * f4);
      GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(f7 * -85.0F, 0.0F, 0.0F, 1.0F);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glBindTexture(
          GL11.GL_TEXTURE_2D,
          this.mc.renderEngine.getTextureForDownloadableImage(
              this.mc.thePlayer.skinUrl, this.mc.thePlayer.getTexture()));
      this.mc.renderEngine.resetBoundTexture();

      for (k = 0; k < 2; ++k) {
        int l = k * 2 - 1;
        GL11.glPushMatrix();
        GL11.glTranslatef(-0.0F, -0.6F, 1.1F * (float) l);
        GL11.glRotatef((float) (-45 * l), 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(59.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef((float) (-65 * l), 0.0F, 1.0F, 0.0F);
        render = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer);
        renderplayer = (RenderPlayer) render;
        f10 = 1.0F;
        GL11.glScalef(f10, f10, f10);
        renderplayer.renderFirstPersonArm(this.mc.thePlayer);
        GL11.glPopMatrix();
      }

      f6 = entityclientplayermp.getSwingProgress(par1);
      f5 = MathHelper.sin(f6 * f6 * (float) Math.PI);
      f8 = MathHelper.sin(MathHelper.sqrt_float(f6) * (float) Math.PI);
      GL11.glRotatef(-f5 * 20.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-f8 * 20.0F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(-f8 * 80.0F, 1.0F, 0.0F, 0.0F);
      f9 = 0.38F;
      GL11.glScalef(f9, f9, f9);
      GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
      GL11.glTranslatef(-1.0F, -1.0F, 0.0F);
      f10 = 0.015625F;
      GL11.glScalef(f10, f10, f10);
      this.mc.renderEngine.bindTexture("/misc/mapbg.png");
      Tessellator tessellator = Tessellator.instance;
      GL11.glNormal3f(0.0F, 0.0F, -1.0F);
      tessellator.startDrawingQuads();
      byte b0 = 7;
      tessellator.addVertexWithUV((double) (0 - b0), (double) (128 + b0), 0.0D, 0.0D, 1.0D);
      tessellator.addVertexWithUV((double) (128 + b0), (double) (128 + b0), 0.0D, 1.0D, 1.0D);
      tessellator.addVertexWithUV((double) (128 + b0), (double) (0 - b0), 0.0D, 1.0D, 0.0D);
      tessellator.addVertexWithUV((double) (0 - b0), (double) (0 - b0), 0.0D, 0.0D, 0.0D);
      tessellator.draw();

      IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP);
      MapData mapdata = ((ItemMap) itemstack.getItem()).getMapData(itemstack, this.mc.theWorld);

      if (custom == null) {
        if (mapdata != null) {
          this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, mapdata);
        }
      } else {
        custom.renderItem(FIRST_PERSON_MAP, itemstack, mc.thePlayer, mc.renderEngine, mapdata);
      }

      GL11.glPopMatrix();
    } else if (itemstack != null) {
      GL11.glPushMatrix();
      f4 = 0.8F;

      if (entityclientplayermp.getItemInUseCount() > 0) {
        EnumAction enumaction = itemstack.getItemUseAction();

        if (enumaction == EnumAction.eat || enumaction == EnumAction.drink) {
          f6 = (float) entityclientplayermp.getItemInUseCount() - par1 + 1.0F;
          f5 = 1.0F - f6 / (float) itemstack.getMaxItemUseDuration();
          f8 = 1.0F - f5;
          f8 = f8 * f8 * f8;
          f8 = f8 * f8 * f8;
          f8 = f8 * f8 * f8;
          f9 = 1.0F - f8;
          GL11.glTranslatef(
              0.0F,
              MathHelper.abs(MathHelper.cos(f6 / 4.0F * (float) Math.PI) * 0.1F)
                  * (float) ((double) f5 > 0.2D ? 1 : 0),
              0.0F);
          GL11.glTranslatef(f9 * 0.6F, -f9 * 0.5F, 0.0F);
          GL11.glRotatef(f9 * 90.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(f9 * 10.0F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(f9 * 30.0F, 0.0F, 0.0F, 1.0F);
        }
      } else {
        f7 = entityclientplayermp.getSwingProgress(par1);
        f6 = MathHelper.sin(f7 * (float) Math.PI);
        f5 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI);
        GL11.glTranslatef(
            -f5 * 0.4F,
            MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI * 2.0F) * 0.2F,
            -f6 * 0.2F);
      }

      GL11.glTranslatef(0.7F * f4, -0.65F * f4 - (1.0F - f1) * 0.6F, -0.9F * f4);
      GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      f7 = entityclientplayermp.getSwingProgress(par1);
      f6 = MathHelper.sin(f7 * f7 * (float) Math.PI);
      f5 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI);
      GL11.glRotatef(-f6 * 20.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-f5 * 20.0F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(-f5 * 80.0F, 1.0F, 0.0F, 0.0F);
      f8 = 0.4F;
      GL11.glScalef(f8, f8, f8);
      float f11;
      float f12;

      if (entityclientplayermp.getItemInUseCount() > 0) {
        EnumAction enumaction1 = itemstack.getItemUseAction();

        if (enumaction1 == EnumAction.block) {
          GL11.glTranslatef(-0.5F, 0.2F, 0.0F);
          GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F);
        } else if (enumaction1 == EnumAction.bow) {
          GL11.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(-12.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-8.0F, 1.0F, 0.0F, 0.0F);
          GL11.glTranslatef(-0.9F, 0.2F, 0.0F);
          f10 =
              (float) itemstack.getMaxItemUseDuration()
                  - ((float) entityclientplayermp.getItemInUseCount() - par1 + 1.0F);
          f11 = f10 / 20.0F;
          f11 = (f11 * f11 + f11 * 2.0F) / 3.0F;

          if (f11 > 1.0F) {
            f11 = 1.0F;
          }

          if (f11 > 0.1F) {
            GL11.glTranslatef(
                0.0F, MathHelper.sin((f10 - 0.1F) * 1.3F) * 0.01F * (f11 - 0.1F), 0.0F);
          }

          GL11.glTranslatef(0.0F, 0.0F, f11 * 0.1F);
          GL11.glRotatef(-335.0F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F);
          GL11.glTranslatef(0.0F, 0.5F, 0.0F);
          f12 = 1.0F + f11 * 0.2F;
          GL11.glScalef(1.0F, 1.0F, f12);
          GL11.glTranslatef(0.0F, -0.5F, 0.0F);
          GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
        }
      }

      if (itemstack.getItem().shouldRotateAroundWhenRendering()) {
        GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
      }

      if (itemstack.getItem().requiresMultipleRenderPasses()) {
        this.renderItem(entityclientplayermp, itemstack, 0);
        for (int x = 1; x < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); x++) {
          int i1 = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, x);
          f10 = (float) (i1 >> 16 & 255) / 255.0F;
          f11 = (float) (i1 >> 8 & 255) / 255.0F;
          f12 = (float) (i1 & 255) / 255.0F;
          GL11.glColor4f(f3 * f10, f3 * f11, f3 * f12, 1.0F);
          this.renderItem(entityclientplayermp, itemstack, x);
        }
      } else {
        this.renderItem(entityclientplayermp, itemstack, 0);
      }

      GL11.glPopMatrix();
    } else if (!entityclientplayermp.getHasActivePotion()) {
      GL11.glPushMatrix();
      f4 = 0.8F;
      f7 = entityclientplayermp.getSwingProgress(par1);
      f6 = MathHelper.sin(f7 * (float) Math.PI);
      f5 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI);
      GL11.glTranslatef(
          -f5 * 0.3F,
          MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI * 2.0F) * 0.4F,
          -f6 * 0.4F);
      GL11.glTranslatef(0.8F * f4, -0.75F * f4 - (1.0F - f1) * 0.6F, -0.9F * f4);
      GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      f7 = entityclientplayermp.getSwingProgress(par1);
      f6 = MathHelper.sin(f7 * f7 * (float) Math.PI);
      f5 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float) Math.PI);
      GL11.glRotatef(f5 * 70.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-f6 * 20.0F, 0.0F, 0.0F, 1.0F);
      GL11.glBindTexture(
          GL11.GL_TEXTURE_2D,
          this.mc.renderEngine.getTextureForDownloadableImage(
              this.mc.thePlayer.skinUrl, this.mc.thePlayer.getTexture()));
      this.mc.renderEngine.resetBoundTexture();
      GL11.glTranslatef(-1.0F, 3.6F, 3.5F);
      GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
      GL11.glScalef(1.0F, 1.0F, 1.0F);
      GL11.glTranslatef(5.6F, 0.0F, 0.0F);
      render = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer);
      renderplayer = (RenderPlayer) render;
      f10 = 1.0F;
      GL11.glScalef(f10, f10, f10);
      renderplayer.renderFirstPersonArm(this.mc.thePlayer);
      GL11.glPopMatrix();
    }

    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    RenderHelper.disableStandardItemLighting();
  }
  public static boolean findAndActivateElevator(World world, int i, int j, int k, int depth) {
    if (depth > 32) {
      return false;
    }

    if (depth == 0) {
      checkedCallers.clear();
      checkedBlocks.clear();
      elvs.clear();
    }

    checkedCallers.add(new ChunkPosition(i, j, k));

    // Look for adjacent elevator caller blocks - if any are found, activate
    // them.
    // Also, if any are found, do not search at this location
    boolean foundOtherCallerBlock = false;
    for (int iter = 0; iter < 6; iter++) {
      int tempX = i;
      int tempY = j;
      int tempZ = k;
      if (iter == 0) {
        tempY--;
      } else if (iter == 1) {
        tempY++;
      } else if (iter == 2) {
        tempZ--;
      } else if (iter == 3) {
        tempZ++;
      } else if (iter == 4) {
        tempX--;
      } else if (iter == 5) {
        tempX++;
      }
      if (world.getBlockId(tempX, tempY, tempZ) == DECore.ElevatorCaller.blockID
          && !checkedCallers.contains(new ChunkPosition(tempX, tempY, tempZ))) {
        findAndActivateElevator(world, tempX, tempY, tempZ, depth + 1);
        foundOtherCallerBlock = true;
      }
    }
    clearSets(depth);

    if (foundOtherCallerBlock) {
      return true;
    }
    // No uncalled elevator callers were found, so search for elevators here
    checkForElevators(world, new ChunkPosition(i, j, k), 0);
    DECore.say("ElevatorCaller activated at: " + i + ", " + j + ", " + k);
    DECore.say(
        (new StringBuilder())
            .append("Checked ")
            .append(checkedBlocks.size())
            .append(" blocks")
            .toString());
    DECore.say(
        (new StringBuilder()).append("Found ").append(elvs.size()).append(" elevators").toString());
    int dist = 500;
    int destY = -1;
    ChunkPosition newPos = null;
    if (!elvs.isEmpty()) {
      Iterator<ChunkPosition> iter = elvs.iterator();
      while (iter.hasNext()) {
        ChunkPosition curPos = iter.next();
        BlockElevator.refreshAndCombineAllAdjacentElevators(world, curPos);
        TileEntityElevator curTile =
            BlockElevator.getTileEntity(world, curPos.x, curPos.y, curPos.z);
        if (curTile != null) {
          int suggestedY = curTile.getClosestYFromYCoor(j);
          if (MathHelper.abs(suggestedY - curPos.y) < dist) {
            dist = (int) MathHelper.abs(suggestedY - curPos.y);
            newPos = curPos;
            destY = suggestedY;
          }
        }
      }
    }
    if (newPos != null) {
      DECore.elevator_demandY(world, newPos, j);
      clearSets(depth);
      return true;
    }
    return false;
  }