Java tutorial
/* Additional permission is granted, as an exception allowed under section 7 of the GNU GPLv3 to allow the inclusion of modified versions of source code derived from the decompilation of Minecraft as if they were covered by the licence. You are completely free to remove this exception, however, it will mean you are unable to convey the modifications to Minecraft files (the modifications are under the GNU GPLv3) within the files they modify unless you use a similar exception yourself. NovaCraft - Minecraft client side modding API Copyright (C) 2012 korikisulda This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ package info.plugmania.novacraft.event.gui; import net.minecraft.client.Minecraft; import org.lwjgl.opengl.GL11; /** * Exactly the same as the overlay event, except this will be obscured by blocks */ public class Render3DUnderlayEvent extends Render3DOverlayEvent { public void enable() { GL11.glPushMatrix(); GL11.glDepthMask(true); //GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); GL11.glEnable(GL11.GL_LINE_SMOOTH); Minecraft.getMinecraft().entityRenderer.disableLightmap(1.0D); } public void disable() { Minecraft.getMinecraft().entityRenderer.enableLightmap(1.0D); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_LINE_SMOOTH); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glPopMatrix(); } }