net.minecraft.client.renderer.entity.RenderLiving Java Examples

The following examples show how to use net.minecraft.client.renderer.entity.RenderLiving. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClientProxy.java    From Wizardry with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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));
		}
	}
}
 
Example #2
Source File: LayerGlowEye.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public LayerGlowEye(RenderLiving<T> renderIn, String string) {
    this.render = renderIn;
    EYE_TEXTURE = new ResourceLocation(TofuMain.MODID, string);
}