Search in sources :

Example 1 with ModelBiped

use of net.minecraft.client.model.ModelBiped in project Wizardry by TeamWizardry.

the class ClientProxy method init.

@Override
public void init(FMLInitializationEvent event) {
    super.init(event);
    MinecraftForge.EVENT_BUS.register(CapeHandler.instance());
    Minecraft.getMinecraft().getRenderManager().getSkinMap().values().forEach(render -> render.addLayer(new BloodRenderLayer(render)));
    Map<String, RenderPlayer> skinMap = Minecraft.getMinecraft().getRenderManager().getSkinMap();
    RenderPlayer render = skinMap.get("default");
    render.addLayer(new RenderHaloPlayer(render.getMainModel().bipedHead));
    render = skinMap.get("slim");
    render.addLayer(new RenderHaloPlayer(render.getMainModel().bipedHead));
    Map<Class<? extends Entity>, Render<? extends Entity>> map = Minecraft.getMinecraft().getRenderManager().entityRenderMap;
    for (ResourceLocation entity : EntityList.getEntityNameList()) {
        Class<? extends Entity> clazz = EntityList.getClass(entity);
        Render<? extends Entity> entityRenderer = map.get(clazz);
        if (entityRenderer instanceof RenderLiving<?>) {
            ModelBase main = ((RenderLiving<?>) entityRenderer).getMainModel();
            ModelRenderer renderer = null;
            if (main instanceof ModelBiped)
                renderer = ((ModelBiped) main).bipedHead;
            ((RenderLiving<?>) entityRenderer).addLayer(new RenderHaloEntity(renderer));
        }
    }
}
Also used : RenderHaloEntity(com.teamwizardry.wizardry.client.render.item.RenderHaloEntity) Entity(net.minecraft.entity.Entity) Render(net.minecraft.client.renderer.entity.Render) RenderLiving(net.minecraft.client.renderer.entity.RenderLiving) ModelBase(net.minecraft.client.model.ModelBase) RenderHaloEntity(com.teamwizardry.wizardry.client.render.item.RenderHaloEntity) RenderHaloPlayer(com.teamwizardry.wizardry.client.render.item.RenderHaloPlayer) ModelBiped(net.minecraft.client.model.ModelBiped) ModelRenderer(net.minecraft.client.model.ModelRenderer) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) RenderPlayer(net.minecraft.client.renderer.entity.RenderPlayer) BloodRenderLayer(com.teamwizardry.wizardry.client.render.BloodRenderLayer)

Example 2 with ModelBiped

use of net.minecraft.client.model.ModelBiped in project Tropicraft by Tropicraft.

the class ItemScubaGear method getArmorModel.

/**
 * Override this method to have an item handle its own armor rendering.
 *
 * @param  entityLiving  The entity wearing the armor
 * @param  itemStack  The itemStack to render the model of
 * @param  armorSlot  The slot the armor is in
 * @param _default Original armor model. Will have attributes set.
 * @return  A ModelBiped to render instead of the default
 */
@Override
@SideOnly(Side.CLIENT)
public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemstack, EntityEquipmentSlot armorSlot, net.minecraft.client.model.ModelBiped _default) {
    if (itemstack.isEmpty()) {
        return null;
    }
    ModelBiped armorModel = EntityRenderRegistry.getScubaModel(armorSlot);
    if (armorModel != null) {
        armorModel.isSneak = entityLiving.isSneaking();
        armorModel.isRiding = entityLiving.isRiding();
        armorModel.isChild = entityLiving.isChild();
        armorModel.rightArmPose = entityLiving.getHeldItemMainhand() != null ? ModelBiped.ArmPose.BLOCK : ModelBiped.ArmPose.EMPTY;
        return armorModel;
    }
    return null;
}
Also used : ModelBiped(net.minecraft.client.model.ModelBiped) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 3 with ModelBiped

use of net.minecraft.client.model.ModelBiped in project Minestuck by mraof.

the class ClientProxy method preInit.

@Override
public void preInit() {
    RenderingRegistry.registerEntityRenderingHandler(EntityNakagator.class, RenderEntityMinestuck.getFactory(new ModelNakagator(), 0.5F));
    RenderingRegistry.registerEntityRenderingHandler(EntitySalamander.class, RenderEntityMinestuck.getFactory(new ModelSalamander(), 0.5F));
    RenderingRegistry.registerEntityRenderingHandler(EntityIguana.class, RenderEntityMinestuck.getFactory(new ModelIguana(), 0.5F));
    RenderingRegistry.registerEntityRenderingHandler(EntityTurtle.class, RenderEntityMinestuck.getFactory(new ModelTurtle(), 0.5F));
    RenderingRegistry.registerEntityRenderingHandler(EntityImp.class, RenderEntityMinestuck.getFactory(new ModelImp(), 0.5F));
    RenderingRegistry.registerEntityRenderingHandler(EntityOgre.class, RenderEntityMinestuck.getFactory(new ModelOgre(), 2.8F));
    RenderingRegistry.registerEntityRenderingHandler(EntityBasilisk.class, RenderEntityMinestuck.getFactory(new ModelBasilisk(), 2.8F));
    RenderingRegistry.registerEntityRenderingHandler(EntityLich.class, RenderEntityMinestuck.getFactory(new ModelLich(), 0.5F));
    RenderingRegistry.registerEntityRenderingHandler(EntityGiclops.class, RenderEntityMinestuck.getFactory(new ModelGiclops(), 7.6F));
    RenderingRegistry.registerEntityRenderingHandler(EntityBishop.class, RenderEntityMinestuck.getFactory(new ModelBishop(), 1.8F));
    RenderingRegistry.registerEntityRenderingHandler(EntityRook.class, RenderEntityMinestuck.getFactory(new ModelRook(), 2.5F));
    RenderingRegistry.registerEntityRenderingHandler(EntityUnderlingPart.class, new IRenderFactory<EntityUnderlingPart>() {

        @Override
        public Render<EntityUnderlingPart> createRenderFor(RenderManager manager) {
            return new RenderShadow(manager, 2.8F);
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntityBigPart.class, new IRenderFactory<EntityBigPart>() {

        @Override
        public Render<EntityBigPart> createRenderFor(RenderManager manager) {
            return new RenderShadow(manager, 0F);
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntityPawn.class, new IRenderFactory<EntityPawn>() {

        @Override
        public Render<EntityPawn> createRenderFor(RenderManager manager) {
            return new RenderPawn(manager, new ModelBiped(), 0.5F);
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntityGrist.class, new IRenderFactory<EntityGrist>() {

        @Override
        public Render<EntityGrist> createRenderFor(RenderManager manager) {
            return new RenderGrist(manager);
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntityVitalityGel.class, new IRenderFactory<EntityVitalityGel>() {

        @Override
        public Render<EntityVitalityGel> createRenderFor(RenderManager manager) {
            return new RenderVitalityGel(manager);
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntityDecoy.class, new IRenderFactory<EntityDecoy>() {

        @Override
        public Render<EntityDecoy> createRenderFor(RenderManager manager) {
            return new RenderDecoy(manager);
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntityMetalBoat.class, new IRenderFactory<EntityBoat>() {

        @Override
        public Render<EntityBoat> createRenderFor(RenderManager manager) {
            return new RenderMetalBoat(manager);
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntityCrewPoster.class, new IRenderFactory<EntityCrewPoster>() {

        @Override
        public Render<EntityCrewPoster> createRenderFor(RenderManager manager) {
            return new RenderHangingArt<>(manager, "midnight_poster");
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntitySbahjPoster.class, new IRenderFactory<EntitySbahjPoster>() {

        @Override
        public Render<EntitySbahjPoster> createRenderFor(RenderManager manager) {
            return new RenderHangingArt<>(manager, "sbahj_poster");
        }
    });
    MinecraftForge.EVENT_BUS.register(new MinestuckKeyHandler());
    MinecraftForge.EVENT_BUS.register(new ClientEventHandler());
    MinecraftForge.EVENT_BUS.register(MinestuckModelManager.class);
}
Also used : EntityPawn(com.mraof.minestuck.entity.carapacian.EntityPawn) MinestuckKeyHandler(com.mraof.minestuck.client.settings.MinestuckKeyHandler) Render(net.minecraft.client.renderer.entity.Render) EntityBoat(net.minecraft.entity.item.EntityBoat) RenderManager(net.minecraft.client.renderer.entity.RenderManager) EntityBigPart(com.mraof.minestuck.entity.EntityBigPart) EntityDecoy(com.mraof.minestuck.entity.EntityDecoy) ModelBiped(net.minecraft.client.model.ModelBiped) ClientEventHandler(com.mraof.minestuck.event.ClientEventHandler)

Example 4 with ModelBiped

use of net.minecraft.client.model.ModelBiped in project ClaySoldiersMod by SanAndreasP.

the class SoldierModelRenderHandler method renderHideArmor.

private void renderHideArmor(EntityClayMan clayMan, RenderClayMan clayManRender, float partTicks, String armorUpgrade) {
    ModelBiped model = clayManRender.modelBipedMain;
    this.armorBody.rotateAngleX = model.bipedBody.rotateAngleX;
    this.armorBody.rotateAngleY = model.bipedBody.rotateAngleY;
    this.armorBody.rotateAngleZ = model.bipedBody.rotateAngleZ;
    this.armorLeftArm.rotateAngleX = model.bipedLeftArm.rotateAngleX;
    this.armorLeftArm.rotateAngleY = model.bipedLeftArm.rotateAngleY;
    this.armorLeftArm.rotateAngleZ = model.bipedLeftArm.rotateAngleZ;
    this.armorRightArm.rotateAngleX = model.bipedRightArm.rotateAngleX;
    this.armorRightArm.rotateAngleY = model.bipedRightArm.rotateAngleY;
    this.armorRightArm.rotateAngleZ = model.bipedRightArm.rotateAngleZ;
    switch(armorUpgrade) {
        case SoldierUpgrades.UPG_LEATHER:
            clayManRender.bindTexture(Textures.CLAYMAN_LEATHER_ARMOR);
            break;
        case // todo: implement rabbit hide texture when 1.8 arrives
        "not_implemented_rabbit_hide":
            clayManRender.bindTexture(Textures.CLAYMAN_LEATHER_ARMOR);
            break;
        default:
            return;
    }
    GL11.glPushMatrix();
    GL11.glScalef(1.2F, 1.2F, 1.2F);
    this.armorBody.render(partTicks);
    this.armorLeftArm.render(partTicks);
    this.armorRightArm.render(partTicks);
    if (clayMan.hasUpgrade(SoldierUpgrades.UPG_IRON_INGOT)) {
        this.buffedBody.render(partTicks);
    }
    GL11.glPopMatrix();
    if (clayMan.hasUpgrade(SoldierUpgrades.UPG_WOOL)) {
        float[] color = getSplittedColor(clayMan.getMiscColor());
        clayManRender.bindTexture(Textures.CLAYMAN_PADDING);
        GL11.glPushMatrix();
        GL11.glScalef(1.1F, 1.1F, 1.1F);
        GL11.glColor3f(color[0], color[1], color[2]);
        this.armorBody.render(partTicks);
        this.armorLeftArm.render(partTicks);
        this.armorRightArm.render(partTicks);
        GL11.glPopMatrix();
    }
}
Also used : ModelBiped(net.minecraft.client.model.ModelBiped)

Example 5 with ModelBiped

use of net.minecraft.client.model.ModelBiped in project ClaySoldiersMod by SanAndreasP.

the class SoldierModelRenderHandler method renderSlimefeet.

private void renderSlimefeet(RenderClayMan clayManRender, float partTicks) {
    ModelBiped model = clayManRender.modelBipedMain;
    this.slimeLeftLeg.rotateAngleX = model.bipedLeftLeg.rotateAngleX;
    this.slimeLeftLeg.rotateAngleY = model.bipedLeftLeg.rotateAngleY;
    this.slimeLeftLeg.rotateAngleZ = model.bipedLeftLeg.rotateAngleZ;
    this.slimeRightLeg.rotateAngleX = model.bipedRightLeg.rotateAngleX;
    this.slimeRightLeg.rotateAngleY = model.bipedRightLeg.rotateAngleY;
    this.slimeRightLeg.rotateAngleZ = model.bipedRightLeg.rotateAngleZ;
    clayManRender.bindTexture(Textures.CLAYMAN_SLIMEFEET);
    GL11.glPushMatrix();
    GL11.glScalef(1.2F, 1.2F, 1.2F);
    GL11.glTranslatef(0.0F, -0.2F, 0.0F);
    this.slimeLeftLeg.render(partTicks);
    this.slimeRightLeg.render(partTicks);
    GL11.glPopMatrix();
}
Also used : ModelBiped(net.minecraft.client.model.ModelBiped)

Aggregations

ModelBiped (net.minecraft.client.model.ModelBiped)28 ItemStack (net.minecraft.item.ItemStack)7 Item (net.minecraft.item.Item)6 ItemArmor (net.minecraft.item.ItemArmor)5 Color (java.awt.Color)4 SideOnly (cpw.mods.fml.relauncher.SideOnly)3 Render (net.minecraft.client.renderer.entity.Render)3 EntityPlayer (net.minecraft.entity.player.EntityPlayer)3 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)2 ModelBase (net.minecraft.client.model.ModelBase)2 ModelRenderer (net.minecraft.client.model.ModelRenderer)2 RenderPlayer (net.minecraft.client.renderer.entity.RenderPlayer)2 ItemBlock (net.minecraft.item.ItemBlock)2 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)2 IColouredItem (blusunrize.immersiveengineering.common.items.IEItemInterfaces.IColouredItem)1 IMixinModelBiped (cc.hyperium.mixinsimp.client.model.IMixinModelBiped)1 MinestuckKeyHandler (com.mraof.minestuck.client.settings.MinestuckKeyHandler)1 EntityBigPart (com.mraof.minestuck.entity.EntityBigPart)1 EntityDecoy (com.mraof.minestuck.entity.EntityDecoy)1 EntityPawn (com.mraof.minestuck.entity.carapacian.EntityPawn)1