Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void renderNightvisionOverlay(Minecraft minecraft)
- {
- ItemStack itemstack = minecraft.thePlayer.inventory.armorItemInSlot(3);
- if(!minecraft.gameSettings.thirdPersonView && itemstack != null)
- {
- if(itemstack.itemID == itemNightvisionGoggles.shiftedIndex && nightvisionEnabled)
- {
- renderTextureOverlay(minecraft, "%blur%/misc/nightvision.png", 1F);
- }
- }
- }
- private void renderTextureOverlay(Minecraft mc, String texturePath, float alpha)
- {
- ScaledResolution scaledresolution = new ScaledResolution(mc.displayWidth, mc.displayHeight);
- int width = scaledresolution.getScaledWidth();
- int height = scaledresolution.getScaledHeight();
- GL11.glEnable(3042 /*GL_BLEND*/);
- GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
- GL11.glDepthMask(false);
- GL11.glBlendFunc(770, 771);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, alpha);
- GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
- GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture(texturePath));
- Tessellator tessellator = Tessellator.instance;
- tessellator.startDrawingQuads();
- tessellator.addVertexWithUV(0.0D, height, -90D, 0.0D, 1.0D);
- tessellator.addVertexWithUV(width, height, -90D, 1.0D, 1.0D);
- tessellator.addVertexWithUV(width, 0.0D, -90D, 1.0D, 0.0D);
- tessellator.addVertexWithUV(0.0D, 0.0D, -90D, 0.0D, 0.0D);
- tessellator.draw();
- GL11.glDepthMask(true);
- GL11.glEnable(2929 /*GL_DEPTH_TEST*/);
- GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, alpha);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement