Search in sources :

Example 1 with EnumBloodType

use of com.teamwizardry.wizardry.api.capability.player.mana.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) {
    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);
        }
    }
}
Also used : EnumBloodType(com.teamwizardry.wizardry.api.capability.player.mana.EnumBloodType) IManaCapability(com.teamwizardry.wizardry.api.capability.player.mana.IManaCapability)

Aggregations

EnumBloodType (com.teamwizardry.wizardry.api.capability.player.mana.EnumBloodType)1 IManaCapability (com.teamwizardry.wizardry.api.capability.player.mana.IManaCapability)1