Jump to content

Kahel

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by Kahel

  1. 4 minutes ago, Azaka7 said:

    You can force the model to skip normal rendering by canceling the event with event.setCanceled(true). The plus side is you'll be able to do exactly what you want with the model. The down side is you'll have to write the entire rendering method, including rendering sleeping/sneaking conditions as well as nameplates.

    I tough of this solution but imagine the render method changes in future versions or is used in other mods. It's kind the same problem as overriding the model. 

  2. Hello, I've been looking all day to a way to animate any BidepModel (player, zombie, squelleton, any other biped, vanilla or not...) with the same animation/pose (all biped having the same "structure" arms, legs...).

    My first approach was to use the render event hook that way:

        @SubscribeEvent 
        public void onRenderBiped(RenderLivingEvent.Pre event){
        	/*ICaster caster = CasterHandler.getCaster(event.getEntity());
        	if(caster!=null) {
        		ModelPlayer modelplayer = event.getRenderer().getMainModel();
        		modelplayer.bipedRightArm.
        	}*/
        	if(event.getRenderer().getMainModel() instanceof ModelBiped) {
        		event.setCanceled(true);
        		ModelBiped model = (ModelBiped)event.getRenderer().getMainModel();
        		model.bipedRightArm.rotateAngleX = 5f;
        	}
        }

    but it does'nt work (because the rotate angle values are overrided by the model render method, and of course if I use RenderLivingEvent.Post the model is already rendered so it's too late).

     

    I found some answers saying to create a custom BipedModel but it would mean to create as many Renderer as biped entity to override the vanilla BipedModel (and is it even possible?), plus would'nt it be a compatibility-killer?

     

    Is there a better maintenable solution?

  3. Hey, I'm trying to make an item not slowing down the player when it's used.

    For the moment I made a function in my Item extended class

    	@Override
        public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn)
        {
    		playerIn.setActiveHand(handIn);
          	//...
            return new ActionResult<ItemStack>(EnumActionResult.PASS, playerIn.getHeldItem(handIn));
        }

     

    I can't even find where in the code the speed is changing when an item is used.

    Thanks for your help.

×
×
  • Create New...

Important Information

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