Search in sources :

Example 1 with EnumBloodType

use of com.teamwizardry.wizardry.api.capability.EnumBloodType in project Wizardry by TeamWizardry.

the class BloodRenderLayer method doRenderLayer.

@Override
public void doRenderLayer(@Nonnull AbstractClientPlayer entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    IWizardryCapability cap = WizardryCapabilityProvider.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);
        }
    }
}
Also used : EnumBloodType(com.teamwizardry.wizardry.api.capability.EnumBloodType) IWizardryCapability(com.teamwizardry.wizardry.api.capability.IWizardryCapability)

Aggregations

EnumBloodType (com.teamwizardry.wizardry.api.capability.EnumBloodType)1 IWizardryCapability (com.teamwizardry.wizardry.api.capability.IWizardryCapability)1