Java Code Examples for net.minecraft.client.renderer.GlStateManager#depthFunc()

The following examples show how to use net.minecraft.client.renderer.GlStateManager#depthFunc() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlayerDisplay.java    From Hyperium with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void draw(int x, double y, boolean config) {
    GlStateManager.pushMatrix();
    GlStateManager.color(1, 1, 1);

    GlStateManager.translate(x, y, 0);
    RenderHelper.enableStandardItemLighting();
    GlStateManager.enableAlpha();

    GlStateManager.shadeModel(GL11.GL_FLAT);
    GlStateManager.enableAlpha();
    GlStateManager.enableDepth();

    GlStateManager.rotate(30, 0, 1.0F, 0);
    GuiInventory.drawEntityOnScreen(0, 100, 50, 0, 0, Minecraft.getMinecraft().thePlayer);
    GlStateManager.depthFunc(GL11.GL_LEQUAL);
    GlStateManager.resetColor();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.disableDepth();
    GlStateManager.popMatrix();
}
 
Example 2
Source File: RenderItemHook.java    From SkyblockAddons with MIT License 5 votes vote down vote up
public static void renderToxicArrowPoisonEffect(IBakedModel model, ItemStack stack) {
    SkyblockAddons main = SkyblockAddons.getInstance();

    if (main.getUtils().isOnSkyblock() && main.getConfigValues().isEnabled(Feature.TURN_BOW_GREEN_WHEN_USING_TOXIC_ARROW_POISON)
            && main.getInventoryUtils().isUsingToxicArrowPoison() && Items.bow.equals(stack.getItem()) && main.getUtils().itemIsInHotbar(stack)) {
        TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();

        GlStateManager.depthMask(false);
        GlStateManager.depthFunc(514);
        GlStateManager.disableLighting();
        GlStateManager.blendFunc(768, 1);
        textureManager.bindTexture(BLANK);
        GlStateManager.matrixMode(5890);

        GlStateManager.pushMatrix();

        Minecraft.getMinecraft().getRenderItem().renderModel(model, 0x201cba41);
        GlStateManager.popMatrix();

        GlStateManager.matrixMode(5888);
        GlStateManager.blendFunc(770, 771);
        GlStateManager.enableLighting();
        GlStateManager.depthFunc(515);
        GlStateManager.depthMask(true);
        textureManager.bindTexture(TextureMap.locationBlocksTexture);
    }
}
 
Example 3
Source File: RenderTileEntityStoneMortar.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public void render(TileEntityStoneMortar te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    GlStateManager.enableDepth();
    GlStateManager.depthFunc(515);
    GlStateManager.depthMask(true);
    GlStateManager.disableCull();

    if (destroyStage >= 0) {
        this.bindTexture(DESTROY_STAGES[destroyStage]);
        GlStateManager.matrixMode(5890);
        GlStateManager.pushMatrix();
        GlStateManager.scale(4.0F, 4.0F, 1.0F);
        GlStateManager.translate(0.0625F, 0.0625F, 0.0625F);
        GlStateManager.matrixMode(5888);
    } else {
        this.bindTexture(TEXTURES);
    }

    GlStateManager.pushMatrix();
    GlStateManager.enableRescaleNormal();

    if (destroyStage < 0) {
        GlStateManager.color(1.0F, 1.0F, 1.0F, alpha);
    }

    GlStateManager.translate((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    GlStateManager.scale(1.0F, -1.0F, -1.0F);
    GlStateManager.translate(0.0F, 1.0F, 0.0F);
    GlStateManager.scale(0.9995F, 0.9995F, 0.9995F);
    GlStateManager.translate(0.0F, -1.0F, 0.0F);

    this.model.block1.render(0.0625F);

    if(te.getUpdateTag().getInteger("processTimer")!=0){
        float rot = te.getWorld().getTotalWorldTime() % 360;
        rot = rot * 2;
        GlStateManager.rotate(rot, 0.0F, 1.0F, 0.0F);
    }

    this.model.block2.render(0.0625F);
    this.model.handle.render(0.0625F);
    GlStateManager.enableCull();
    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

    if (destroyStage >= 0) {
        GlStateManager.matrixMode(5890);
        GlStateManager.popMatrix();
        GlStateManager.matrixMode(5888);
    }
}
 
Example 4
Source File: WrapperGlStateManager.java    From ClientBase with MIT License 4 votes vote down vote up
public static void depthFunc(int var0) {
    GlStateManager.depthFunc(var0);
}
 
Example 5
Source File: RendererBackpack.java    From WearableBackpacks with MIT License 4 votes vote down vote up
private static void renderEnchanted(IBackpack backpack, BlockModelRenderer renderer,
                                    float ticks, boolean renderStraps) {
	
	Minecraft mc = Minecraft.getMinecraft();
	float glintStrength = WearableBackpacks.CONFIG.cosmetic.enchantEffectOpacity.get().floatValue();
	if (glintStrength <= 0) return;
	float glintScale   = 1.5F;
	float animProgress = ticks / 10;
	
	int color = IntermodUtils.getRuneColor(backpack.getStack());
	float r = (color >> 16 & 0xFF) / 255.0F * glintStrength;
	float g = (color >>  8 & 0xFF) / 255.0F * glintStrength;
	float b = (color       & 0xFF) / 255.0F * glintStrength;
	
	mc.getTextureManager().bindTexture(ENCHANTED_ITEM_GLINT);
	mc.entityRenderer.setupFogColor(true);
	
	GlStateManager.disableLighting();
	GlStateManager.depthMask(false);
	GlStateManager.depthFunc(GL11.GL_EQUAL);
	GlStateManager.enableBlend();
	GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_COLOR, GlStateManager.DestFactor.ONE);
	
	for (int i = 0; i < 2; ++i) {
		GlStateManager.matrixMode(GL11.GL_TEXTURE);
		GlStateManager.loadIdentity();
		GlStateManager.scale(glintScale, glintScale, glintScale);
		GlStateManager.rotate(30.0F - i * 60.0F, 0.0F, 0.0F, 1.0F);
		GlStateManager.translate(0.0F, animProgress * (0.001F + i * 0.003F) * 20.0F, 0.0F);
		GlStateManager.matrixMode(GL11.GL_MODELVIEW);
		renderModel(backpack, renderer, ticks, renderStraps, r, g, b, true);
	}
	
	GlStateManager.matrixMode(GL11.GL_TEXTURE);
	GlStateManager.loadIdentity();
	GlStateManager.matrixMode(GL11.GL_MODELVIEW);
	
	GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
	GlStateManager.disableBlend();
	GlStateManager.depthFunc(GL11.GL_LEQUAL);
	GlStateManager.depthMask(true);
	GlStateManager.enableLighting();
	
	mc.entityRenderer.setupFogColor(false);
	
}