Search in sources :

Example 1 with BloodRenderLayer

use of com.teamwizardry.wizardry.client.render.BloodRenderLayer 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)

Aggregations

BloodRenderLayer (com.teamwizardry.wizardry.client.render.BloodRenderLayer)1 RenderHaloEntity (com.teamwizardry.wizardry.client.render.item.RenderHaloEntity)1 RenderHaloPlayer (com.teamwizardry.wizardry.client.render.item.RenderHaloPlayer)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