Search in sources :

Example 1 with RenderLiving

use of net.minecraft.client.renderer.entity.RenderLiving 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());
    Map<String, RenderPlayer> skinMap = Minecraft.getMinecraft().getRenderManager().getSkinMap();
    for (RenderPlayer render : skinMap.values()) {
        // render.addLayer(new BloodRenderLayer(render));
        render.addLayer(new RenderHaloEntity(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) RenderHaloEntity(com.teamwizardry.wizardry.client.render.item.RenderHaloEntity) ModelBase(net.minecraft.client.model.ModelBase) 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)

Aggregations

RenderHaloEntity (com.teamwizardry.wizardry.client.render.item.RenderHaloEntity)1 ModelBase (net.minecraft.client.model.ModelBase)1 ModelBiped (net.minecraft.client.model.ModelBiped)1 ModelRenderer (net.minecraft.client.model.ModelRenderer)1 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)1 Render (net.minecraft.client.renderer.entity.Render)1 RenderLiving (net.minecraft.client.renderer.entity.RenderLiving)1 RenderPlayer (net.minecraft.client.renderer.entity.RenderPlayer)1 Entity (net.minecraft.entity.Entity)1 ResourceLocation (net.minecraft.util.ResourceLocation)1