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

The following examples show how to use net.minecraft.client.renderer.GlStateManager#enableBlendProfile() . 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: BloodRenderLayer.java    From Wizardry with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void doRenderLayer(@Nonnull AbstractClientPlayer entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
	if (Minecraft.getMinecraft().player == null || Minecraft.getMinecraft().world == null) return;

	IManaCapability cap = ManaCapabilityProvider.getCap(entity);
	if (cap != null) {
		EnumBloodType type = cap.getBloodType();
		if (type != null && type != EnumBloodType.NONE) {
			render.bindTexture(EnumBloodType.getResourceLocation(type));
			ClientUtilMethods.glColor(type.color);
			setModelVisibilities(entity);
			GlStateManager.enableBlendProfile(Profile.PLAYER_SKIN);

			GlStateManager.disableLighting();
			ShaderHelper.INSTANCE.useShader(Shaders.rawColor);

			render.getMainModel().render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);

			GlStateManager.enableLighting();
			ShaderHelper.INSTANCE.releaseShader();

			GlStateManager.disableBlendProfile(Profile.PLAYER_SKIN);
			GlStateManager.color(1.0F, 1.0F, 1.0F);
		}
	}
}
 
Example 2
Source File: RenderPlayerCyberware.java    From Cyberware with MIT License 6 votes vote down vote up
public void doRender(AbstractClientPlayer entity, double x, double y, double z, float entityYaw, float partialTicks)
{
	if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(entity, this, partialTicks, x, y, z))) return;
	if (!entity.isUser() || this.renderManager.renderViewEntity == entity)
	{
		double d0 = y;

		if (entity.isSneaking() && !(entity instanceof EntityPlayerSP))
		{
			d0 = y - 0.125D;
		}

		this.setModelVisibilities(entity);
		GlStateManager.enableBlendProfile(GlStateManager.Profile.PLAYER_SKIN);
		doRenderELB(entity, x, d0, z, entityYaw, partialTicks);
		GlStateManager.disableBlendProfile(GlStateManager.Profile.PLAYER_SKIN);
	}
	net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(entity, this, partialTicks, x, y, z));
}