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

The following examples show how to use net.minecraft.client.renderer.entity.RenderPlayer. 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: RenderCyberlimbHand.java    From Cyberware with MIT License 6 votes vote down vote up
private void renderArm(EnumHandSide p_187455_1_)
{
	this.mc.getTextureManager().bindTexture(this.mc.thePlayer.getLocationSkin());
	Render<AbstractClientPlayer> render = getEntityRenderObject(this.mc.thePlayer, p_187455_1_);
	RenderPlayer renderplayer = (RenderPlayer)render;
	GlStateManager.pushMatrix();
	float f = p_187455_1_ == EnumHandSide.RIGHT ? 1.0F : -1.0F;
	GlStateManager.rotate(92.0F, 0.0F, 1.0F, 0.0F);
	GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
	GlStateManager.rotate(f * -41.0F, 0.0F, 0.0F, 1.0F);
	GlStateManager.translate(f * 0.3F, -1.1F, 0.45F);

	if (p_187455_1_ == EnumHandSide.RIGHT)
	{
		renderplayer.renderRightArm(this.mc.thePlayer);
	}
	else
	{
		renderplayer.renderLeftArm(this.mc.thePlayer);
	}

	GlStateManager.popMatrix();
}
 
Example #3
Source File: RenderCyberlimbHand.java    From Cyberware with MIT License 6 votes vote down vote up
private RenderPlayer getEntityRenderObject(AbstractClientPlayer p, EnumHandSide side)
{
	if (side == EnumHandSide.RIGHT)
	{
		if (rightRobot)
		{
			return EssentialsMissingHandlerClient.renderF;
		}
	}
	else
	{
		if (leftRobot)
		{
			return EssentialsMissingHandlerClient.renderF;
		}
	}
	
	return (RenderPlayer) this.renderManager.<AbstractClientPlayer>getEntityRenderObject(p);

}
 
Example #4
Source File: ProxyClient.java    From WearableBackpacks with MIT License 6 votes vote down vote up
@Override
public void init() {
	super.init();
	Minecraft mc = Minecraft.getMinecraft();
	
	if (BackpacksContent.BACKPACK != null) {
		mc.getBlockColors().registerBlockColorHandler(BLOCK_COLOR, MiscUtils.getBlockFromItem(BackpacksContent.BACKPACK));
		mc.getItemColors().registerItemColorHandler(ITEM_COLOR, BackpacksContent.BACKPACK);
		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBackpack.class, new RendererBackpack.TileEntity());
	}
	
	RenderManager manager = mc.getRenderManager();
	Map<String, RenderPlayer> skinMap = manager.getSkinMap();
	for (RenderPlayer renderer : skinMap.values()) {
		renderer.addLayer(new RendererBackpack.Layer(renderer));
	}
}
 
Example #5
Source File: RenderCyberlimbHand.java    From Cyberware with MIT License 5 votes vote down vote up
private void renderArmFirstPerson(float p_187456_1_, float p_187456_2_, EnumHandSide p_187456_3_)
{
	boolean flag = p_187456_3_ != EnumHandSide.LEFT;
	float f = flag ? 1.0F : -1.0F;
	float f1 = MathHelper.sqrt_float(p_187456_2_);
	float f2 = -0.3F * MathHelper.sin(f1 * (float)Math.PI);
	float f3 = 0.4F * MathHelper.sin(f1 * ((float)Math.PI * 2F));
	float f4 = -0.4F * MathHelper.sin(p_187456_2_ * (float)Math.PI);
	GlStateManager.translate(f * (f2 + 0.64000005F), f3 + -0.6F + p_187456_1_ * -0.6F, f4 + -0.71999997F);
	GlStateManager.rotate(f * 45.0F, 0.0F, 1.0F, 0.0F);
	float f5 = MathHelper.sin(p_187456_2_ * p_187456_2_ * (float)Math.PI);
	float f6 = MathHelper.sin(f1 * (float)Math.PI);
	GlStateManager.rotate(f * f6 * 70.0F, 0.0F, 1.0F, 0.0F);
	GlStateManager.rotate(f * f5 * -20.0F, 0.0F, 0.0F, 1.0F);
	AbstractClientPlayer abstractclientplayer = this.mc.thePlayer;
	this.mc.getTextureManager().bindTexture(abstractclientplayer.getLocationSkin());
	GlStateManager.translate(f * -1.0F, 3.6F, 3.5F);
	GlStateManager.rotate(f * 120.0F, 0.0F, 0.0F, 1.0F);
	GlStateManager.rotate(200.0F, 1.0F, 0.0F, 0.0F);
	GlStateManager.rotate(f * -135.0F, 0.0F, 1.0F, 0.0F);
	GlStateManager.translate(f * 5.6F, 0.0F, 0.0F);
	RenderPlayer renderplayer = getEntityRenderObject(this.mc.thePlayer, p_187456_3_);
	GlStateManager.disableCull();

	if (flag)
	{
		renderplayer.renderRightArm(abstractclientplayer);
	}
	else
	{
		renderplayer.renderLeftArm(abstractclientplayer);
	}

	GlStateManager.enableCull();
}
 
Example #6
Source File: HyperiumRenderPlayer.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
public HyperiumRenderPlayer(RenderPlayer parent) {
    this.parent = parent;
}
 
Example #7
Source File: MixinRenderManger.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Map<String, RenderPlayer> getSkinMap() {
    return skinMap;
}
 
Example #8
Source File: BloodRenderLayer.java    From Wizardry with GNU Lesser General Public License v3.0 4 votes vote down vote up
public BloodRenderLayer(RenderPlayer renderIn) {
	render = renderIn;
}
 
Example #9
Source File: IMixinRenderManager.java    From Hyperium with GNU Lesser General Public License v3.0 votes vote down vote up
Map<String, RenderPlayer> getSkinMap();