Ejemplo n.º 1
0
  private void compileDisplayList(float f) {
    displayList = GLAllocation.generateDisplayLists(1);
    GL11.glNewList(displayList, 4864 /*GL_COMPILE*/);
    Tessellator tessellator = Tessellator.getInstance(); // Tessellator.instance;
    for (int i = 0; i < faces.length; i++) {
      faces[i].func_808_a(tessellator, f);
    }

    GL11.glEndList();
    compiled = true;
  }
Ejemplo n.º 2
0
  private static void initialize() {
    if (!initialized) {
      initialized = true;

      starGLCallList = GLAllocation.generateDisplayLists(3);
      GL11.glPushMatrix();
      GL11.glNewList(starGLCallList, GL11.GL_COMPILE);
      renderStars();
      GL11.glEndList();
      GL11.glPopMatrix();
      Tessellator tessellator = Tessellator.instance;
      glSkyList = starGLCallList + 1;
      GL11.glNewList(glSkyList, GL11.GL_COMPILE);
      byte b2 = 64;
      int i = 256 / b2 + 2;
      float f = 16.0F;
      int j;
      int k;

      for (j = -b2 * i; j <= b2 * i; j += b2) {
        for (k = -b2 * i; k <= b2 * i; k += b2) {
          tessellator.startDrawingQuads();
          tessellator.addVertex((j + 0), f, (k + 0));
          tessellator.addVertex((j + b2), f, (k + 0));
          tessellator.addVertex((j + b2), f, (k + b2));
          tessellator.addVertex((j + 0), f, (k + b2));
          tessellator.draw();
        }
      }

      GL11.glEndList();
      glSkyList2 = starGLCallList + 2;
      GL11.glNewList(glSkyList2, GL11.GL_COMPILE);
      f = -16.0F;
      tessellator.startDrawingQuads();

      for (j = -b2 * i; j <= b2 * i; j += b2) {
        for (k = -b2 * i; k <= b2 * i; k += b2) {
          tessellator.addVertex((j + b2), f, (k + 0));
          tessellator.addVertex((j + 0), f, (k + 0));
          tessellator.addVertex((j + 0), f, (k + b2));
          tessellator.addVertex((j + b2), f, (k + b2));
        }
      }

      tessellator.draw();
      GL11.glEndList();
    }
  }
public class GCPlutoSkyProvider extends IRenderHandler {
  private static final ResourceLocation neptuneTexture =
      new ResourceLocation(GCPluto.TEXTURE_DOMAIN, "textures/gui/planets/neptune.png");
  private static final ResourceLocation sunTexture =
      new ResourceLocation(GCPluto.TEXTURE_DOMAIN, "textures/gui/planets/sun.png");

  public int starGLCallList = GLAllocation.generateDisplayLists(3);
  public int glSkyList;
  public int glSkyList2;

  public GCPlutoSkyProvider() {
    GL11.glPushMatrix();
    GL11.glNewList(this.starGLCallList, GL11.GL_COMPILE);
    this.renderStars();
    GL11.glEndList();
    GL11.glPopMatrix();
    final Tessellator tessellator = Tessellator.instance;
    this.glSkyList = this.starGLCallList + 1;
    GL11.glNewList(this.glSkyList, GL11.GL_COMPILE);
    final byte byte2 = 64;
    final int i = 256 / byte2 + 2;
    float f = 16F;

    for (int j = -byte2 * i; j <= byte2 * i; j += byte2) {
      for (int l = -byte2 * i; l <= byte2 * i; l += byte2) {
        tessellator.startDrawingQuads();
        tessellator.addVertex(j + 0, f, l + 0);
        tessellator.addVertex(j + byte2, f, l + 0);
        tessellator.addVertex(j + byte2, f, l + byte2);
        tessellator.addVertex(j + 0, f, l + byte2);
        tessellator.draw();
      }
    }

    GL11.glEndList();
    this.glSkyList2 = this.starGLCallList + 2;
    GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE);
    f = -16F;
    tessellator.startDrawingQuads();

    for (int k = -byte2 * i; k <= byte2 * i; k += byte2) {
      for (int i1 = -byte2 * i; i1 <= byte2 * i; i1 += byte2) {
        tessellator.addVertex(k + byte2, f, i1 + 0);
        tessellator.addVertex(k + 0, f, i1 + 0);
        tessellator.addVertex(k + 0, f, i1 + byte2);
        tessellator.addVertex(k + byte2, f, i1 + byte2);
      }
    }

    tessellator.draw();
    GL11.glEndList();
  }

  @Override
  public void render(float partialTicks, WorldClient world, Minecraft mc) {
    GCPlutoWorldProvider gcProvider = null;

    if (world.provider instanceof GCPlutoWorldProvider) {
      gcProvider = (GCPlutoWorldProvider) world.provider;
    }

    float var10;
    float var11;
    float var12;
    final Tessellator var23 = Tessellator.instance;

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    final Vec3 var2 = this.getCustomSkyColor();
    float var3 = (float) var2.xCoord * (1 - world.getStarBrightness(partialTicks) * 2);
    float var4 = (float) var2.yCoord * (1 - world.getStarBrightness(partialTicks) * 2);
    float var5 = (float) var2.zCoord * (1 - world.getStarBrightness(partialTicks) * 2);
    float var8;

    if (mc.gameSettings.anaglyph) {
      final float var6 = (var3 * 30.0F + var4 * 59.0F + var5 * 11.0F) / 100.0F;
      final float var7 = (var3 * 30.0F + var4 * 70.0F) / 100.0F;
      var8 = (var3 * 30.0F + var5 * 70.0F) / 100.0F;
      var3 = var6;
      var4 = var7;
      var5 = var8;
    }

    GL11.glColor3f(1, 1, 1);
    GL11.glDepthMask(false);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glColor3f(0, 0, 0);
    GL11.glCallList(this.glSkyList);
    GL11.glDisable(GL11.GL_FOG);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    RenderHelper.disableStandardItemLighting();

    float var20 = 0;

    if (gcProvider != null) {
      var20 = gcProvider.getStarBrightness(partialTicks);
    }

    GL11.glPushMatrix();

    GL11.glDisable(GL11.GL_BLEND);

    GL11.glEnable(GL11.GL_TEXTURE_2D);

    // STARS:
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glPopMatrix();

    if (var20 > 0.0F) {
      GL11.glDisable(GL11.GL_TEXTURE_2D);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, var20);
      GL11.glCallList(this.starGLCallList);
      GL11.glEnable(GL11.GL_TEXTURE_2D);
    }

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);

    GL11.glPushMatrix();

    // Sun:
    GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
    var12 = 30.0F;
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(GCPlutoSkyProvider.sunTexture);
    var23.startDrawingQuads();
    var23.addVertexWithUV(-var12, 150.0D, -var12, 0.0D, 0.0D);
    var23.addVertexWithUV(var12, 150.0D, -var12, 1.0D, 0.0D);
    var23.addVertexWithUV(var12, 150.0D, var12, 1.0D, 1.0D);
    var23.addVertexWithUV(-var12, 150.0D, var12, 0.0D, 1.0D);
    var23.draw();

    GL11.glPopMatrix();

    GL11.glPushMatrix();

    GL11.glDisable(GL11.GL_BLEND);

    // NEPTUNE:
    var12 = 0.5F;
    GL11.glScalef(0.6F, 0.6F, 0.6F);
    GL11.glRotatef(40.0F, 0.0F, 0.0F, 1.0F);
    GL11.glRotatef(200F, 1.0F, 0.0F, 0.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F);
    FMLClientHandler.instance()
        .getClient()
        .renderEngine
        .bindTexture(GCPlutoSkyProvider.neptuneTexture);
    var23.startDrawingQuads();
    var23.addVertexWithUV(-var12, -100.0D, var12, 0, 1);
    var23.addVertexWithUV(var12, -100.0D, var12, 1, 1);
    var23.addVertexWithUV(var12, -100.0D, -var12, 1, 0);
    var23.addVertexWithUV(-var12, -100.0D, -var12, 0, 0);
    var23.draw();

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glPopMatrix();

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glColor3f(0.0F, 0.0F, 0.0F);
    final double var25 = mc.thePlayer.getPosition(partialTicks).yCoord - world.getHorizon();

    if (var25 < 0.0D) {
      GL11.glPushMatrix();
      GL11.glTranslatef(0.0F, 12.0F, 0.0F);
      GL11.glCallList(this.glSkyList2);
      GL11.glPopMatrix();
      var10 = 1.0F;
      var11 = -((float) (var25 + 65.0D));
      var12 = -var10;
      var23.startDrawingQuads();
      var23.setColorRGBA_I(0, 255);
      var23.addVertex(-var10, var11, var10);
      var23.addVertex(var10, var11, var10);
      var23.addVertex(var10, var12, var10);
      var23.addVertex(-var10, var12, var10);
      var23.addVertex(-var10, var12, -var10);
      var23.addVertex(var10, var12, -var10);
      var23.addVertex(var10, var11, -var10);
      var23.addVertex(-var10, var11, -var10);
      var23.addVertex(var10, var12, -var10);
      var23.addVertex(var10, var12, var10);
      var23.addVertex(var10, var11, var10);
      var23.addVertex(var10, var11, -var10);
      var23.addVertex(-var10, var11, -var10);
      var23.addVertex(-var10, var11, var10);
      var23.addVertex(-var10, var12, var10);
      var23.addVertex(-var10, var12, -var10);
      var23.addVertex(-var10, var12, -var10);
      var23.addVertex(-var10, var12, var10);
      var23.addVertex(var10, var12, var10);
      var23.addVertex(var10, var12, -var10);
      var23.draw();
    }

    GL11.glColor3f(70F / 256F, 70F / 256F, 70F / 256F);

    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, -((float) (var25 - 16.0D)), 0.0F);
    GL11.glCallList(this.glSkyList2);
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDepthMask(true);
  }

  private void renderStars() {
    final Random var1 = new Random(10842L);
    final Tessellator var2 = Tessellator.instance;
    var2.startDrawingQuads();

    for (int var3 = 0; var3 < (GCCoreConfigManager.moreStars ? 35000 : 6000); ++var3) {
      double var4 = var1.nextFloat() * 2.0F - 1.0F;
      double var6 = var1.nextFloat() * 2.0F - 1.0F;
      double var8 = var1.nextFloat() * 2.0F - 1.0F;
      final double var10 = 0.15F + var1.nextFloat() * 0.1F;
      double var12 = var4 * var4 + var6 * var6 + var8 * var8;

      if (var12 < 1.0D && var12 > 0.01D) {
        var12 = 1.0D / Math.sqrt(var12);
        var4 *= var12;
        var6 *= var12;
        var8 *= var12;
        final double var14 =
            var4 * (GCCoreConfigManager.moreStars ? var1.nextDouble() * 150D + 130D : 100.0D);
        final double var16 =
            var6 * (GCCoreConfigManager.moreStars ? var1.nextDouble() * 150D + 130D : 100.0D);
        final double var18 =
            var8 * (GCCoreConfigManager.moreStars ? var1.nextDouble() * 150D + 130D : 100.0D);
        final double var20 = Math.atan2(var4, var8);
        final double var22 = Math.sin(var20);
        final double var24 = Math.cos(var20);
        final double var26 = Math.atan2(Math.sqrt(var4 * var4 + var8 * var8), var6);
        final double var28 = Math.sin(var26);
        final double var30 = Math.cos(var26);
        final double var32 = var1.nextDouble() * Math.PI * 2.0D;
        final double var34 = Math.sin(var32);
        final double var36 = Math.cos(var32);

        for (int var38 = 0; var38 < 4; ++var38) {
          final double var39 = 0.0D;
          final double var41 = ((var38 & 2) - 1) * var10;
          final double var43 = ((var38 + 1 & 2) - 1) * var10;
          final double var47 = var41 * var36 - var43 * var34;
          final double var49 = var43 * var36 + var41 * var34;
          final double var53 = var47 * var28 + var39 * var30;
          final double var55 = var39 * var28 - var47 * var30;
          final double var57 = var55 * var22 - var49 * var24;
          final double var61 = var49 * var22 + var55 * var24;
          var2.addVertex(var14 + var57, var16 + var53, var18 + var61);
        }
      }
    }

    var2.draw();
  }

  private Vec3 getCustomSkyColor() {
    return Vec3.fakePool.getVecFromPool(0.26796875D, 0.1796875D, 0.0D);
  }

  public float getSkyBrightness(float par1) {
    final float var2 = FMLClientHandler.instance().getClient().theWorld.getCelestialAngle(par1);
    float var3 = 1.0F - (MathHelper.sin(var2 * (float) Math.PI * 2.0F) * 2.0F + 0.25F);

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

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

    return var3 * var3 * 1F;
  }
}
Ejemplo n.º 4
0
  private DisplayFluidList getDisplayFluidLists(int liquidId, World world) {
    if (displayFluidLists.containsKey(liquidId)) {
      return displayFluidLists.get(liquidId);
    }

    DisplayFluidList d = new DisplayFluidList();
    displayFluidLists.put(liquidId, d);

    BlockInterface block = new BlockInterface();

    Fluid fluid = FluidRegistry.getFluid(liquidId);
    if (fluid.getBlockID() > 0) {
      block.baseBlock = Block.blocksList[fluid.getBlockID()];
    } else {
      block.baseBlock = Block.waterStill;
    }
    block.texture = fluid.getStillIcon();

    float size = Utils.pipeMaxPos - Utils.pipeMinPos;

    // render size

    for (int s = 0; s < LIQUID_STAGES; ++s) {
      float ratio = (float) s / (float) LIQUID_STAGES;

      // SIDE HORIZONTAL

      d.sideHorizontal[s] = GLAllocation.generateDisplayLists(1);
      GL11.glNewList(d.sideHorizontal[s], 4864 /* GL_COMPILE */);

      block.minX = 0.0F;
      block.minZ = Utils.pipeMinPos + 0.01F;

      block.maxX = block.minX + size / 2F + 0.01F;
      block.maxZ = block.minZ + size - 0.02F;

      block.minY = Utils.pipeMinPos + 0.01F;
      block.maxY = block.minY + (size - 0.02F) * ratio;

      RenderEntityBlock.INSTANCE.renderBlock(block, world, 0, 0, 0, false, true);

      GL11.glEndList();

      // SIDE VERTICAL

      d.sideVertical[s] = GLAllocation.generateDisplayLists(1);
      GL11.glNewList(d.sideVertical[s], 4864 /* GL_COMPILE */);

      block.minY = Utils.pipeMaxPos - 0.01;
      block.maxY = 1;

      block.minX = 0.5 - (size / 2 - 0.01) * ratio;
      block.maxX = 0.5 + (size / 2 - 0.01) * ratio;

      block.minZ = 0.5 - (size / 2 - 0.01) * ratio;
      block.maxZ = 0.5 + (size / 2 - 0.01) * ratio;

      RenderEntityBlock.INSTANCE.renderBlock(block, world, 0, 0, 0, false, true);

      GL11.glEndList();

      // CENTER HORIZONTAL

      d.centerHorizontal[s] = GLAllocation.generateDisplayLists(1);
      GL11.glNewList(d.centerHorizontal[s], 4864 /* GL_COMPILE */);

      block.minX = Utils.pipeMinPos + 0.01;
      block.minZ = Utils.pipeMinPos + 0.01;

      block.maxX = block.minX + size - 0.02;
      block.maxZ = block.minZ + size - 0.02;

      block.minY = Utils.pipeMinPos + 0.01;
      block.maxY = block.minY + (size - 0.02F) * ratio;

      RenderEntityBlock.INSTANCE.renderBlock(block, world, 0, 0, 0, false, true);

      GL11.glEndList();

      // CENTER VERTICAL

      d.centerVertical[s] = GLAllocation.generateDisplayLists(1);
      GL11.glNewList(d.centerVertical[s], 4864 /* GL_COMPILE */);

      block.minY = Utils.pipeMinPos + 0.01;
      block.maxY = Utils.pipeMaxPos - 0.01;

      block.minX = 0.5 - (size / 2 - 0.02) * ratio;
      block.maxX = 0.5 + (size / 2 - 0.02) * ratio;

      block.minZ = 0.5 - (size / 2 - 0.02) * ratio;
      block.maxZ = 0.5 + (size / 2 - 0.02) * ratio;

      RenderEntityBlock.INSTANCE.renderBlock(block, world, 0, 0, 0, false, true);

      GL11.glEndList();
    }

    return d;
  }
Ejemplo n.º 5
0
  private void initializeDisplayPowerList(World world) {
    if (initialized) return;

    initialized = true;

    BlockInterface block = new BlockInterface();
    block.texture =
        BuildCraftTransport.instance.pipeIconProvider.getIcon(
            PipeIconProvider.TYPE.Power_Normal.ordinal());

    float size = Utils.pipeMaxPos - Utils.pipeMinPos;

    for (int s = 0; s < POWER_STAGES; ++s) {
      displayPowerList[s] = GLAllocation.generateDisplayLists(1);
      GL11.glNewList(displayPowerList[s], 4864 /* GL_COMPILE */);

      float minSize = 0.005F;

      float unit = (size - minSize) / 2F / POWER_STAGES;

      block.minY = 0.5 - (minSize / 2F) - unit * s;
      block.maxY = 0.5 + (minSize / 2F) + unit * s;

      block.minZ = 0.5 - (minSize / 2F) - unit * s;
      block.maxZ = 0.5 + (minSize / 2F) + unit * s;

      block.minX = 0;
      block.maxX = 0.5 + (minSize / 2F) + unit * s;

      RenderEntityBlock.INSTANCE.renderBlock(block, world, 0, 0, 0, false, true);

      GL11.glEndList();
    }

    block.texture =
        BuildCraftTransport.instance.pipeIconProvider.getIcon(
            PipeIconProvider.TYPE.Power_Overload.ordinal());

    size = Utils.pipeMaxPos - Utils.pipeMinPos;

    for (int s = 0; s < POWER_STAGES; ++s) {
      displayPowerListOverload[s] = GLAllocation.generateDisplayLists(1);
      GL11.glNewList(displayPowerListOverload[s], 4864 /* GL_COMPILE */);

      float minSize = 0.005F;

      float unit = (size - minSize) / 2F / POWER_STAGES;

      block.minY = 0.5 - (minSize / 2F) - unit * s;
      block.maxY = 0.5 + (minSize / 2F) + unit * s;

      block.minZ = 0.5 - (minSize / 2F) - unit * s;
      block.maxZ = 0.5 + (minSize / 2F) + unit * s;

      block.minX = 0;
      block.maxX = 0.5 + (minSize / 2F) + unit * s;

      RenderEntityBlock.INSTANCE.renderBlock(block, world, 0, 0, 0, false, true);

      GL11.glEndList();
    }
  }
public class GCCoreSkyProviderOverworld extends IRenderHandler {
  public int starGLCallList = GLAllocation.generateDisplayLists(3);
  public int glSkyList;
  public int glSkyList2;

  public GCCoreSkyProviderOverworld() {
    GL11.glPushMatrix();
    GL11.glNewList(this.starGLCallList, GL11.GL_COMPILE);
    this.renderStars();
    GL11.glEndList();
    GL11.glPopMatrix();
    final Tessellator tessellator = Tessellator.instance;
    this.glSkyList = this.starGLCallList + 1;
    GL11.glNewList(this.glSkyList, GL11.GL_COMPILE);
    final byte byte2 = 64;
    final int i = 256 / byte2 + 2;
    float f = 16F;

    for (int j = -byte2 * i; j <= byte2 * i; j += byte2) {
      for (int l = -byte2 * i; l <= byte2 * i; l += byte2) {
        tessellator.startDrawingQuads();
        tessellator.addVertex(j + 0, f, l + 0);
        tessellator.addVertex(j + byte2, f, l + 0);
        tessellator.addVertex(j + byte2, f, l + byte2);
        tessellator.addVertex(j + 0, f, l + byte2);
        tessellator.draw();
      }
    }

    GL11.glEndList();
    this.glSkyList2 = this.starGLCallList + 2;
    GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE);
    f = -16F;
    tessellator.startDrawingQuads();

    for (int k = -byte2 * i; k <= byte2 * i; k += byte2) {
      for (int i1 = -byte2 * i; i1 <= byte2 * i; i1 += byte2) {
        tessellator.addVertex(k + byte2, f, i1 + 0);
        tessellator.addVertex(k + 0, f, i1 + 0);
        tessellator.addVertex(k + 0, f, i1 + byte2);
        tessellator.addVertex(k + byte2, f, i1 + byte2);
      }
    }

    tessellator.draw();
    GL11.glEndList();
  }

  private Minecraft minecraft = FMLClientHandler.instance().getClient();

  @Override
  public void render(float partialTicks, WorldClient world, Minecraft mc) {
    float var20 = 0.0F;

    if (this.minecraft.thePlayer.ridingEntity != null) {
      var20 = (float) (this.minecraft.thePlayer.ridingEntity.posY - 200.0F);
    }

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    Vec3 var2 = this.minecraft.theWorld.getSkyColor(this.minecraft.renderViewEntity, partialTicks);
    float var3 = (float) var2.xCoord;
    float var4 = (float) var2.yCoord;
    float var5 = (float) var2.zCoord;
    float var8;

    if (this.minecraft.gameSettings.anaglyph) {
      float var6 = (var3 * 30.0F + var4 * 59.0F + var5 * 11.0F) / 100.0F;
      float var7 = (var3 * 30.0F + var4 * 70.0F) / 100.0F;
      var8 = (var3 * 30.0F + var5 * 70.0F) / 100.0F;
      var3 = var6;
      var4 = var7;
      var5 = var8;
    }

    GL11.glColor3f(var3, var4, var5);
    Tessellator var23 = Tessellator.instance;
    GL11.glDepthMask(false);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glColor3f(var3, var4, var5);
    GL11.glCallList(this.glSkyList);
    GL11.glDisable(GL11.GL_FOG);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    RenderHelper.disableStandardItemLighting();
    float[] var24 =
        this.minecraft.theWorld.provider.calcSunriseSunsetColors(
            this.minecraft.theWorld.getCelestialAngle(partialTicks), partialTicks);
    float var9;
    float var10;
    float var11;
    float var12;

    if (var24 != null) {
      GL11.glDisable(GL11.GL_TEXTURE_2D);
      GL11.glShadeModel(GL11.GL_SMOOTH);
      GL11.glPushMatrix();
      GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(
          MathHelper.sin(this.minecraft.theWorld.getCelestialAngleRadians(partialTicks)) < 0.0F
              ? 180.0F
              : 0.0F,
          0.0F,
          0.0F,
          1.0F);
      GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
      var8 = var24[0];
      var9 = var24[1];
      var10 = var24[2];
      float var13;

      if (this.minecraft.gameSettings.anaglyph) {
        var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F;
        var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F;
        var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F;
        var8 = var11;
        var9 = var12;
        var10 = var13;
      }

      var23.startDrawing(6);
      var23.setColorRGBA_F(var8, var9, var10, var24[3]);
      var23.addVertex(0.0D, 100.0D, 0.0D);
      byte var26 = 16;
      var23.setColorRGBA_F(var24[0], var24[1], var24[2], 0.0F);

      for (int var27 = 0; var27 <= var26; ++var27) {
        var13 = (float) var27 * (float) Math.PI * 2.0F / (float) var26;
        float var14 = MathHelper.sin(var13);
        float var15 = MathHelper.cos(var13);
        var23.addVertex(
            (double) (var14 * 120.0F),
            (double) (var15 * 120.0F),
            (double) (-var15 * 40.0F * var24[3]));
      }

      var23.draw();
      GL11.glPopMatrix();
      GL11.glShadeModel(GL11.GL_FLAT);
    }

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
    GL11.glPushMatrix();
    var8 = 1.0F - this.minecraft.theWorld.getRainStrength(partialTicks);
    var9 = 0.0F;
    var10 = 0.0F;
    var11 = 0.0F;
    GL11.glColor4f(1.0F, 1.0F, 1.0F, var8);
    GL11.glTranslatef(var9, var10, var11);
    GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(
        this.minecraft.theWorld.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
    var12 = 30.0F;
    GL11.glBindTexture(
        GL11.GL_TEXTURE_2D, this.minecraft.renderEngine.getTexture("/terrain/sun.png"));
    var23.startDrawingQuads();
    var23.addVertexWithUV((double) (-var12), 100.0D, (double) (-var12), 0.0D, 0.0D);
    var23.addVertexWithUV((double) var12, 100.0D, (double) (-var12), 1.0D, 0.0D);
    var23.addVertexWithUV((double) var12, 100.0D, (double) var12, 1.0D, 1.0D);
    var23.addVertexWithUV((double) (-var12), 100.0D, (double) var12, 0.0D, 1.0D);
    var23.draw();
    var12 = 20.0F;
    GL11.glBindTexture(
        GL11.GL_TEXTURE_2D, this.minecraft.renderEngine.getTexture("/terrain/moon_phases.png"));
    int var28 = this.minecraft.theWorld.getMoonPhase(partialTicks);
    int var30 = var28 % 4;
    int var29 = var28 / 4 % 2;
    float var16 = (float) (var30 + 0) / 4.0F;
    float var17 = (float) (var29 + 0) / 2.0F;
    float var18 = (float) (var30 + 1) / 4.0F;
    float var19 = (float) (var29 + 1) / 2.0F;
    var23.startDrawingQuads();
    var23.addVertexWithUV(
        (double) (-var12), -100.0D, (double) var12, (double) var18, (double) var19);
    var23.addVertexWithUV((double) var12, -100.0D, (double) var12, (double) var16, (double) var19);
    var23.addVertexWithUV(
        (double) var12, -100.0D, (double) (-var12), (double) var16, (double) var17);
    var23.addVertexWithUV(
        (double) (-var12), -100.0D, (double) (-var12), (double) var18, (double) var17);
    var23.draw();
    GL11.glDisable(GL11.GL_TEXTURE_2D);

    if (var20 > 0.0F) {
      GL11.glColor4f(var20, var20, var20, var20 / 100F);
      GL11.glCallList(this.starGLCallList);
    }

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glPopMatrix();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glColor3f(0.0F, 0.0F, 0.0F);

    double var25 = 0.0D;

    if (this.minecraft.thePlayer.ridingEntity != null) {
      var25 = this.minecraft.thePlayer.ridingEntity.posY - this.minecraft.theWorld.getHorizon();

      if (var25 < 0.0D) {
        GL11.glPushMatrix();
        GL11.glTranslatef(0.0F, 12.0F, 0.0F);
        GL11.glCallList(this.glSkyList2);
        GL11.glPopMatrix();
        var10 = 1.0F;
        var11 = -((float) (var25 + 65.0D));
        var12 = -var10;
        var23.startDrawingQuads();
        var23.setColorRGBA_I(0, 255);
        var23.addVertex((double) (-var10), (double) var11, (double) var10);
        var23.addVertex((double) var10, (double) var11, (double) var10);
        var23.addVertex((double) var10, (double) var12, (double) var10);
        var23.addVertex((double) (-var10), (double) var12, (double) var10);
        var23.addVertex((double) (-var10), (double) var12, (double) (-var10));
        var23.addVertex((double) var10, (double) var12, (double) (-var10));
        var23.addVertex((double) var10, (double) var11, (double) (-var10));
        var23.addVertex((double) (-var10), (double) var11, (double) (-var10));
        var23.addVertex((double) var10, (double) var12, (double) (-var10));
        var23.addVertex((double) var10, (double) var12, (double) var10);
        var23.addVertex((double) var10, (double) var11, (double) var10);
        var23.addVertex((double) var10, (double) var11, (double) (-var10));
        var23.addVertex((double) (-var10), (double) var11, (double) (-var10));
        var23.addVertex((double) (-var10), (double) var11, (double) var10);
        var23.addVertex((double) (-var10), (double) var12, (double) var10);
        var23.addVertex((double) (-var10), (double) var12, (double) (-var10));
        var23.addVertex((double) (-var10), (double) var12, (double) (-var10));
        var23.addVertex((double) (-var10), (double) var12, (double) var10);
        var23.addVertex((double) var10, (double) var12, (double) var10);
        var23.addVertex((double) var10, (double) var12, (double) (-var10));
        var23.draw();
      }

      if (var20 > 0.0F) {
        GL11.glPushMatrix();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glTranslatef(0.0F, (-var20 / 10), 0.0F);
        float scale = 45 * (0.25F - (var20 / 10000.0F));
        scale = Math.max(scale, 0.2F);
        GL11.glScalef(scale, 0.0F, scale);
        GL11.glTranslatef(0.0F, -var20, 0.0F);
        this.minecraft.renderEngine.bindTexture(
            this.minecraft.renderEngine.getTexture(
                "/micdoodle8/mods/galacticraft/core/client/planets/overworld.png"));

        var10 = 1.0F;
        var12 = -1.0F;

        float alpha = ((var20 - 200) / 400.0F);
        alpha = (float) Math.pow(alpha, 2);
        GL11.glColor4f(
            Math.min(alpha, 1.0F),
            Math.min(alpha, 1.0F),
            Math.min(alpha, 1.0F),
            Math.min(alpha, 1.0F));
        var23.startDrawingQuads();
        var23.addVertexWithUV((double) (-var10), (double) 0, (double) var10, 0.0F, 1.0F);
        var23.addVertexWithUV((double) var10, (double) 0, (double) var10, 1.0F, 1.0F);
        var23.addVertexWithUV((double) var10, (double) 0, (double) (-var10), 1.0F, 0.0F);
        var23.addVertexWithUV((double) (-var10), (double) 0, (double) (-var10), 0.0F, 0.0F);
        var23.addVertexWithUV((double) (-var10), (double) 0, (double) var10, 0.0F, 1.0F);
        var23.addVertexWithUV((double) var10, (double) 0, (double) var10, 1.0F, 1.0F);
        var23.addVertexWithUV((double) var10, (double) 0, (double) (-var10), 1.0F, 0.0F);
        var23.addVertexWithUV((double) (-var10), (double) 0, (double) (-var10), 0.0F, 0.0F);
        var23.addVertexWithUV((double) (-var10), (double) -50, (double) (-var10), 0.0F, 0.0F);
        var23.draw();
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glPopMatrix();
      }
    }

    if (this.minecraft.theWorld.provider.isSkyColored()) {
      GL11.glColor3f(0.0f, 0.0f, 0.0f);
    } else {
      GL11.glColor3f(var3, var4, var5);
    }
    GL11.glColor3f(0.0f, 0.0f, 0.0f);

    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, -((float) (var25 - 16.0D)), 0.0F);
    GL11.glCallList(this.glSkyList2);
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDepthMask(true);
  }

  private void renderStars() {
    final Random var1 = new Random(10842L);
    final Tessellator var2 = Tessellator.instance;
    var2.startDrawingQuads();

    for (int var3 = 0; var3 < (GCCoreConfigManager.moreStars ? 20000 : 6000); ++var3) {
      double var4 = var1.nextFloat() * 2.0F - 1.0F;
      double var6 = var1.nextFloat() * 2.0F - 1.0F;
      double var8 = var1.nextFloat() * 2.0F - 1.0F;
      final double var10 = 0.15F + var1.nextFloat() * 0.1F;
      double var12 = var4 * var4 + var6 * var6 + var8 * var8;

      if (var12 < 1.0D && var12 > 0.01D) {
        var12 = 1.0D / Math.sqrt(var12);
        var4 *= var12;
        var6 *= var12;
        var8 *= var12;
        final double var14 =
            var4 * (GCCoreConfigManager.moreStars ? var1.nextDouble() * 100D + 150D : 100.0D);
        final double var16 =
            var6 * (GCCoreConfigManager.moreStars ? var1.nextDouble() * 100D + 150D : 100.0D);
        final double var18 =
            var8 * (GCCoreConfigManager.moreStars ? var1.nextDouble() * 100D + 150D : 100.0D);
        final double var20 = Math.atan2(var4, var8);
        final double var22 = Math.sin(var20);
        final double var24 = Math.cos(var20);
        final double var26 = Math.atan2(Math.sqrt(var4 * var4 + var8 * var8), var6);
        final double var28 = Math.sin(var26);
        final double var30 = Math.cos(var26);
        final double var32 = var1.nextDouble() * Math.PI * 2.0D;
        final double var34 = Math.sin(var32);
        final double var36 = Math.cos(var32);

        for (int var38 = 0; var38 < 4; ++var38) {
          final double var39 = 0.0D;
          final double var41 = ((var38 & 2) - 1) * var10;
          final double var43 = ((var38 + 1 & 2) - 1) * var10;
          final double var47 = var41 * var36 - var43 * var34;
          final double var49 = var43 * var36 + var41 * var34;
          final double var53 = var47 * var28 + var39 * var30;
          final double var55 = var39 * var28 - var47 * var30;
          final double var57 = var55 * var22 - var49 * var24;
          final double var61 = var49 * var22 + var55 * var24;
          var2.addVertex(var14 + var57, var16 + var53, var18 + var61);
        }
      }
    }

    var2.draw();
  }
}