Search in sources :

Example 1 with RenderZombie

use of net.minecraft.client.renderer.entity.RenderZombie in project Armourers-Workshop by RiskyKen.

the class SkinnableEntityZombieRenderer method renderEquipmentType.

private void renderEquipmentType(EntityLivingBase entity, RendererLivingEntity renderer, ISkinType skinType, IEntityEquipment equipmentData) {
    float scale = 0.0625F;
    if (renderer instanceof RenderZombie) {
        RenderZombie rz = (RenderZombie) renderer;
        boolean isZombieVillager = false;
        isZombieVillager = rz.modelBipedMain instanceof ModelZombieVillager;
        if (!equipmentData.haveEquipment(skinType, 0)) {
            return;
        }
        ISkinPointer skinPointer = equipmentData.getSkinPointer(skinType, 0);
        Skin skin = ClientSkinCache.INSTANCE.getSkin(skinPointer);
        if (skin == null) {
            return;
        }
        AbstractModelSkin model = SkinModelRenderer.INSTANCE.getModelForEquipmentType(skinType);
        GL11.glPushMatrix();
        if (isZombieVillager & skinType == SkinTypeRegistry.skinHead) {
            GL11.glTranslated(0, -2.0F * scale, 0);
        }
        if (skinType == SkinTypeRegistry.skinLegs | skinType == SkinTypeRegistry.skinFeet) {
            GL11.glTranslated(0, 0, 0.1F * scale);
        }
        // GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
        // GL11.glPolygonOffset(-1F, -1F);
        model.render(entity, rz.modelBipedMain, skin, false, skinPointer.getSkinDye(), null, false, 0, false);
        // GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
        GL11.glPopMatrix();
    }
}
Also used : RenderZombie(net.minecraft.client.renderer.entity.RenderZombie) AbstractModelSkin(riskyken.armourersWorkshop.client.model.skin.AbstractModelSkin) Skin(riskyken.armourersWorkshop.common.skin.data.Skin) AbstractModelSkin(riskyken.armourersWorkshop.client.model.skin.AbstractModelSkin) ModelZombieVillager(net.minecraft.client.model.ModelZombieVillager) ISkinPointer(riskyken.armourersWorkshop.api.common.skin.data.ISkinPointer)

Aggregations

ModelZombieVillager (net.minecraft.client.model.ModelZombieVillager)1 RenderZombie (net.minecraft.client.renderer.entity.RenderZombie)1 ISkinPointer (riskyken.armourersWorkshop.api.common.skin.data.ISkinPointer)1 AbstractModelSkin (riskyken.armourersWorkshop.client.model.skin.AbstractModelSkin)1 Skin (riskyken.armourersWorkshop.common.skin.data.Skin)1