Example #1
0
  public void drawTopLayer(int centerX, int centerY) {
    for (int as = lowerBound; as < upperBound; as++) {
      int pX = as;
      for (int aa = lowerBound; aa < upperBound; aa++) {
        if (aa * aa + as * as > upperBound * upperBound) {
          continue; // confine radar to a circle using pythagorean theorem
        }
        int pZ = aa;

        int bX = (int) (mc.thePlayer.posX + pX); // block posX
        int bZ = (int) (mc.thePlayer.posZ + pZ); // block posZ
        int bY =
            mc.theWorld.getHeightValue(bX, bZ) - 1; // formatted block posY (-1 for compensation)

        int bI = mc.theWorld.getBlockId(bX, bY, bZ); // block id

        double d =
            MathHelper.clamp_float(
                mc.theWorld.getWorldChunkManager().getBiomeGenAt(bX, bY).getFloatTemperature(),
                0.0F,
                1.0F); // biome info
        double d1 =
            MathHelper.clamp_float(
                mc.theWorld.getWorldChunkManager().getBiomeGenAt(bX, bY).getFloatRainfall(),
                0.0F,
                1.0F); // biome info

        int k8 = Block.blocksList[bI].blockIndexInTexture; // block position in texture

        mc.renderEngine.bindTexture(
            mc.renderEngine.getTexture("/terrain.png")); // binding terrain texture

        GL11.glTranslatef(
            0.5F, 0.5F, 0F); // compensating for integer restrictions of Minecraft methods
        if (bI == 2) {
          // g.drawRect(-pX - 1,-pZ - 1,-pX,-pZ, ColorizerGrass.getGrassColor(d, d1));

          colorBasedOnMultiplier(ColorizerGrass.getGrassColor(d, d1));
          g.drawTexturedModalRect(-pX - 1, -pZ - 1, k8 % 16 << 4, (k8 >> 4) << 4, 1, 1);
        } else if (bI == 18) {
          // g.drawRect(-pX - 1,-pZ - 1,-pX,-pZ, ColorizerFoliage.getFoliageColor(d, d1));

          colorBasedOnMultiplier(ColorizerFoliage.getFoliageColor(d, d1));
          g.drawTexturedModalRect(-pX - 1, -pZ - 1, k8 % 16 << 4, (k8 >> 4) << 4, 1, 1);
        } else if (bI == 8 || bI == 9) {
          // g.drawRect(-pX - 1,-pZ - 1,-pX,-pZ,
          // mc.theWorld.getWorldChunkManager().getBiomeGenAt(bX, bZ).waterColorMultiplier *
          // 0xffffffff);
          // g.drawRect(-pX - 1,-pZ - 1,-pX,-pZ, 0xff000fff);

          colorBasedOnMultiplier(0xff000fff);
          g.drawTexturedModalRect(-pX - 1, -pZ - 1, k8 % 16 << 4, (k8 >> 4) << 4, 1, 1);
        } else {
          GL11.glColor4f(255, 255, 255, 255);
          g.drawTexturedModalRect(-pX - 1, -pZ - 1, k8 % 16 << 4, (k8 >> 4) << 4, 1, 1);
        }
        GL11.glTranslatef(-0.5F, -0.5F, 0F);
      }
    }
  }
Example #2
0
 @SideOnly(Side.CLIENT)
 public int func_76737_k() {
   double var1 = (double) MathHelper.func_76131_a(this.func_76743_j(), 0.0F, 1.0F);
   double var3 = (double) MathHelper.func_76131_a(this.func_76727_i(), 0.0F, 1.0F);
   return ColorizerGrass.func_77480_a(var1, var3);
 }
 @Override
 @SideOnly(Side.CLIENT)
 public int getBiomeGrassColor() {
   return ColorizerGrass.getGrassColor(1.0F, 1.0F);
 }
Example #4
0
 @SideOnly(Side.CLIENT)
 public int func_76737_k() {
   double var1 = (double) this.func_76743_j();
   double var3 = (double) this.func_76727_i();
   return ((ColorizerGrass.func_77480_a(var1, var3) & 16711422) + 5115470) / 2;
 }
Example #5
0
 public void startGame() throws LWJGLException {
   if (mcCanvas != null) {
     Graphics g = mcCanvas.getGraphics();
     if (g != null) {
       g.setColor(Color.BLACK);
       g.fillRect(0, 0, displayWidth, displayHeight);
       g.dispose();
     }
     Display.setParent(mcCanvas);
   } else if (fullscreen) {
     Display.setFullscreen(true);
     displayWidth = Display.getDisplayMode().getWidth();
     displayHeight = Display.getDisplayMode().getHeight();
     if (displayWidth <= 0) {
       displayWidth = 1;
     }
     if (displayHeight <= 0) {
       displayHeight = 1;
     }
   } else {
     Display.setDisplayMode(new DisplayMode(displayWidth, displayHeight));
   }
   Display.setTitle("Minecraft Minecraft Beta 1.7.3");
   try {
     Display.create();
   } catch (LWJGLException lwjglexception) {
     lwjglexception.printStackTrace();
     try {
       Thread.sleep(1000L);
     } catch (InterruptedException interruptedexception) {
     }
     Display.create();
   }
   mcDataDir = getMinecraftDir();
   saveLoader = new SaveConverterMcRegion(new File(mcDataDir, "saves"));
   gameSettings = new GameSettings(this, mcDataDir);
   texturePackList = new TexturePackList(this, mcDataDir);
   renderEngine = new RenderEngine(texturePackList, gameSettings);
   fontRenderer = new FontRenderer(gameSettings, "/font/default.png", renderEngine);
   ColorizerWater.func_28182_a(renderEngine.func_28149_a("/misc/watercolor.png"));
   ColorizerGrass.func_28181_a(renderEngine.func_28149_a("/misc/grasscolor.png"));
   ColorizerFoliage.func_28152_a(renderEngine.func_28149_a("/misc/foliagecolor.png"));
   entityRenderer = new EntityRenderer(this);
   RenderManager.instance.itemRenderer = new ItemRenderer(this);
   statFileWriter = new StatFileWriter(session, mcDataDir);
   AchievementList.openInventory.setStatStringFormatter(new StatStringFormatKeyInv(this));
   loadScreen();
   Keyboard.create();
   Mouse.create();
   mouseHelper = new MouseHelper(mcCanvas);
   try {
     Controllers.create();
   } catch (Exception exception) {
     exception.printStackTrace();
   }
   checkGLError("Pre startup");
   GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
   GL11.glShadeModel(7425 /*GL_SMOOTH*/);
   GL11.glClearDepth(1.0D);
   GL11.glEnable(2929 /*GL_DEPTH_TEST*/);
   GL11.glDepthFunc(515);
   GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
   GL11.glAlphaFunc(516, 0.1F);
   GL11.glCullFace(1029 /*GL_BACK*/);
   GL11.glMatrixMode(5889 /*GL_PROJECTION*/);
   GL11.glLoadIdentity();
   GL11.glMatrixMode(5888 /*GL_MODELVIEW0_ARB*/);
   checkGLError("Startup");
   glCapabilities = new OpenGlCapsChecker();
   sndManager.loadSoundSettings(gameSettings);
   renderEngine.registerTextureFX(textureLavaFX);
   renderEngine.registerTextureFX(textureWaterFX);
   renderEngine.registerTextureFX(new TexturePortalFX());
   renderEngine.registerTextureFX(new TextureCompassFX(this));
   renderEngine.registerTextureFX(new TextureWatchFX(this));
   renderEngine.registerTextureFX(new TextureWaterFlowFX());
   renderEngine.registerTextureFX(new TextureLavaFlowFX());
   renderEngine.registerTextureFX(new TextureFlamesFX(0));
   renderEngine.registerTextureFX(new TextureFlamesFX(1));
   renderGlobal = new RenderGlobal(this, renderEngine);
   GL11.glViewport(0, 0, displayWidth, displayHeight);
   effectRenderer = new EffectRenderer(theWorld, renderEngine);
   try {
     downloadResourcesThread = new ThreadDownloadResources(mcDataDir, this);
     downloadResourcesThread.start();
   } catch (Exception exception1) {
   }
   checkGLError("Post startup");
   ingameGUI = new GuiIngame(this);
   if (serverName != null) {
     displayGuiScreen(new GuiConnecting(this, serverName, serverPort));
   } else {
     displayGuiScreen(new GuiMainMenu());
   }
 }