Jump to content

Recommended Posts

Posted

Okay so here's the problem:

I changed the player's model with a cutom model and texture with the method in the bottom of the post, but the problem is pumpkin helmet, infact pumpkin helmet is not in player's model but in renderPlayer;

 

Is there a way in GL11 to complitely scale the player (with pumpkin) so that i can then re-scale it just for the model?

 

public static class PlayerRendererEvent
    {
	public Field mainRenderer;
	public Field mainTexture;
	public Field globalMc;

	public PlayerRendererEvent()
	{
		try {
			mainRenderer = RendererLivingEntity.class.getDeclaredField("mainModel");
			mainRenderer.setAccessible(true);
			mainTexture = AbstractClientPlayer.class.getDeclaredField("locationSkin");
			mainTexture.setAccessible(true);
			globalMc = RenderGlobal.class.getDeclaredField("mc");
			globalMc.setAccessible(true);
		} 
		catch (NoSuchFieldException e) 
		{
			e.printStackTrace();
		}
	}

	@SubscribeEvent
	public void onPlayerRenderThirdPerson(RenderPlayerEvent.Pre event) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
	{
		mainRenderer.set(event.renderer, new ModelPlayerSnowMan(0));
		event.renderer.modelBipedMain = (ModelBiped)mainRenderer.get(event.renderer);
		mainTexture.set((EntityPlayerSP)event.entityPlayer, new ResourceLocation("textures/entity/player/Glacia/snowman.png"));

		event.renderer.modelArmor = new ModelPlayerSnowMan(1);
		event.renderer.modelArmorChestplate = new ModelPlayerSnowMan(2);
	}

	@SubscribeEvent
	public void onPlayerRenderFirstPerson(RenderHandEvent event) throws IllegalArgumentException, IllegalAccessException
	{
		Minecraft mc = (Minecraft) globalMc.get(event.context);
		RenderPlayer renderplayer = (RenderPlayer) RenderManager.instance.getEntityRenderObject(mc.thePlayer);

		mainRenderer.set(renderplayer, new ModelPlayerSnowMan(0));
		renderplayer.modelBipedMain = (ModelBiped)mainRenderer.get(renderplayer);
		mainTexture.set(mc.thePlayer, new ResourceLocation("textures/entity/player/Glacia/snowman.png"));
	}
    }

Actually i don't know what to write in this signature soooo.... anyway

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.