Jump to content

[1.8] make custome LayerHeldItem.class to mach your model <SOLVED>


perromercenary00

Recommended Posts

good days

 

this little thing puzless me coz i alredy solve some thing more complex and now im stuck here dont see where to go

 

anyway i create a customeModel for mi female entityes extending model biped, way i could set the size of the entity soo i could create little people or big, thets works but armor and weapons/items  dont mach the size of the entity, so i create a custom LayerHeldItemM.class but i been having troubles seting the rigth hand item position.

 

http://s27.postimg.org/o33sa9phv/Pantallazo_27.png

width=657 height=471http://s27.postimg.org/o33sa9phv/Pantallazo_27.png[/img]

 

to ovious step would be to change the translation values in the line 55 of mi layerItem to match the model

but this generates a second gun in the right position, but the first gun remains in the default position

 

http://s27.postimg.org/sh32umlar/Pantallazo_28.png

width=489 height=411http://s27.postimg.org/sh32umlar/Pantallazo_28.png[/img]

 

can tell mi where is this first gun coming how i delete it or at least move it to mach the other position

 

once i done whith this one i gona make a custome LayerBipedArmor(this)

 

thanks for reading

 

 

 

 

 

package mercenarymod.entidades;

import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.entity.RendererLivingEntity;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class LayerHeldItemM implements LayerRenderer
{
    private final RendererLivingEntity field_177206_a;
    private static final String __OBFID = "CL_00002416";
    private float alt = 0.0F;

    public LayerHeldItemM(RendererLivingEntity p_i46115_1_)
    {
        this.field_177206_a = p_i46115_1_;
    }

    public void doRenderLayer(EntityLivingBase p_177141_1_, float p_177141_2_, float p_177141_3_, float p_177141_4_, float p_177141_5_, float p_177141_6_, float p_177141_7_, float p_177141_8_)
    {
        ItemStack itemstack = p_177141_1_.getHeldItem();
        alt = 0.5F;
        
        

        if (itemstack != null)
        {
            GlStateManager.pushMatrix();

            if (this.field_177206_a.getMainModel().isChild)
            {
                float f7 = 0.5F;
                GlStateManager.translate(0.0F, 0.625F, 0.0F);
                GlStateManager.rotate(-20.0F, -1.0F, 0.0F, 0.0F);
                GlStateManager.scale(f7, f7, f7);
            }

            
          
            
            
            ((ModelBipedWoman)this.field_177206_a.getMainModel()).postRenderArm(0.0625F);
            GlStateManager.translate(-0.0625F + (alt / 4) , 0.4375F, 0.0625F + alt );//<<<     linea 55    >>>
            //GlStateManager.translate(-0.0625F, 0.4375F, 0.0625F );//<<<

            if (p_177141_1_ instanceof EntityPlayer && ((EntityPlayer)p_177141_1_).fishEntity != null)
            {
                itemstack = new ItemStack(Items.fishing_rod, 0);
            }

            Item item = itemstack.getItem();
            Minecraft minecraft = Minecraft.getMinecraft();

            if (item instanceof ItemBlock && Block.getBlockFromItem(item).getRenderType() == 2)
            {
                GlStateManager.translate(0.0F, 0.1875F, -0.3125F);
                GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
                GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
                float f8 = 0.375F;
                GlStateManager.scale(-f8, -f8, f8);
            }

            
            
            minecraft.getItemRenderer().renderItem(p_177141_1_, itemstack, ItemCameraTransforms.TransformType.THIRD_PERSON);
            GlStateManager.popMatrix();
        }
        
        //GlStateManager.translate(0, 0, 0.0 + 0.5F  );
        
    }

    public boolean shouldCombineTextures()
    {
        return false;
    }
}

 

 

package mercenarymod.entidades;


import mercenarymod.entidades.hostiles.zombieMercenario;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.DataWatcher;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class ModelBipedWoman extends ModelBiped
{


//tenctacles
public ModelRenderer biPhalous_A00;
public ModelRenderer biPhalous_A01;
public ModelRenderer biPhalous_A02;

public ModelRenderer biPhalous_B00;
public ModelRenderer biPhalous_B01;
public ModelRenderer biPhalous_B02;

public ModelRenderer biPhalous_C00;
public ModelRenderer biPhalous_C01;
public ModelRenderer biPhalous_C02;

public ModelRenderer biPhalous_D00;
public ModelRenderer biPhalous_D01;
public ModelRenderer biPhalous_D02;




    public ModelRenderer bipedHead;
    /** The Biped's Headwear. Used for the outer layer of player skins. */
    public ModelRenderer bipedHeadwear;
    public ModelRenderer bipedBody;
    
    //public ModelRenderer bipedBoobs;
    
    /** The Biped's Right Arm */
    public ModelRenderer bipedRightArm;
    /** The Biped's Left Arm */
    public ModelRenderer bipedLeftArm;
    
    /** The arms of the VillagerModel */
    public ModelRenderer villagerArms;
    
    /** The arms of the el simbolo de exclamacion */
    public ModelRenderer exclamacion;

    
    
        
    /** The Biped's Right Leg */
    public ModelRenderer bipedRightLeg;
    /** The Biped's Left Leg */
    public ModelRenderer bipedLeftLeg;
    /** Records whether the model should be rendered holding an item in the left hand, and if that item is a block. */
    public int heldItemLeft = 0;
    /** Records whether the model should be rendered holding an item in the right hand, and if that item is a block. */
    public int heldItemRight = 0;
    
    public int offset = 0;
        
    public boolean isSneak;
    /** Records whether the model should be rendered aiming a bow. */
    public boolean aimedBow;
    
    public boolean isVillagin = false; //villagerArms
    public boolean isZombye = false; //zombyeArms
    public boolean isRiding = false;
    public boolean hasTentacules = false;
    
    public boolean exclamacionIcono = true;
    
    private int tamaño = 4;
    private float alt = 0.0F;
    
   // private float swingProgress = -10000.0F;
    private float swingProgress = -10000.0F;
    
    private final String __OBFID = "CL_00000840";

    public ModelBipedWoman()
    {
        this(0.0F);
    }

    public ModelBipedWoman(float p_i1148_1_)
    {
        this(p_i1148_1_, 0.0F, 64, 32);
    }

    public ModelBipedWoman(float p_i1149_1_, float p_i1149_2_, int p_i1149_3_, int p_i1149_4_)
    {
        this.textureWidth = 64;//p_i1149_3_
        this.textureHeight = 64;//p_i1149_4_
        this.bipedHead = new ModelRenderer(this, 0, 0);
        this.bipedHead.setTextureOffset(0, 0).addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_);
        this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
        
        
        this.bipedHeadwear = new ModelRenderer(this, 32, 0);
        this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_ + 0.5F);
        this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
       
        
        this.bipedBody = new ModelRenderer(this, 16, 16);
        this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i1149_1_);
        this.bipedBody.setTextureOffset(44, 58).addBox(-3.5F, 1.0F, -3.0F, 7, 3, 3, p_i1149_1_);
        this.bipedBody.setTextureOffset( 0, 32).addBox(-4.5F, 10.0F, -2.5F, 9, 10, 5, p_i1149_1_);
              
   
        
        this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
        
        
        this.bipedRightArm = new ModelRenderer(this, 40, 16);
        this.bipedRightArm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, p_i1149_1_);
        this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + p_i1149_2_, 0.0F);
                
        this.bipedLeftArm = new ModelRenderer(this, 40, 16);
        
        this.bipedLeftArm.mirror = true;
        
        this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, p_i1149_1_);
        this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + p_i1149_2_, 0.0F);
        
        
        
        
        
        this.villagerArms =  new ModelRenderer(this, 0, 0);
        this.villagerArms.setRotationPoint(0.0F, 0.0F + p_i1149_2_ + 2.0F, 0.0F);
        
        this.villagerArms.setTextureOffset(40, 16).addBox(-7.0F, -2.0F, -2.0F, 3, 8, 4, p_i1149_1_);
        this.villagerArms.setTextureOffset(40, 16).addBox( 4.0F, -2.0F, -2.0F, 3, 8, 4, p_i1149_1_);
        this.villagerArms.setTextureOffset( 0, 56).addBox(-4.0F,  3.0F, -2.0F, 8, 3, 4, p_i1149_1_);
        
        
        
        this.exclamacion =  new ModelRenderer(this, 0, 0);
        this.exclamacion.setTextureOffset(32, 34).addBox(-4.0F, -18.0F, 0.0F, 8, 8, 1, p_i1149_1_);
        this.exclamacion.setRotationPoint(0.0F, 0.0F, 0.0F);
        
        //this.bipedHead.addChild(exclamacion);
        
        
        
//########## tentaculos         //(40, 16)
        this.biPhalous_A00 = new ModelRenderer(this, 0, 0);
        this.biPhalous_A00.setTextureOffset(56, 16).addBox(-0.5F, -15.0F,  0.5F, 1, 16, 1, p_i1149_1_);
        this.biPhalous_A00.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
        
        this.biPhalous_A01 = new ModelRenderer(this, 0, 0);
        this.biPhalous_A01.setTextureOffset(56, 16).addBox(-0.5F, -15.0F, 0.5F, 1, 16, 1, p_i1149_1_);
        this.biPhalous_A01.setRotationPoint(0.0F, -15.0F , 0.0F);
        
        this.biPhalous_A02 = new ModelRenderer(this, 0, 0);
        this.biPhalous_A02.setTextureOffset(56, 16).addBox(-0.5F, -15.0F, 0.5F, 1, 16, 1, p_i1149_1_);
        this.biPhalous_A02.setRotationPoint(0.0F, -15.0F, 0.0F);
        
        this.bipedHead.addChild(biPhalous_A00);
        this.biPhalous_A00.addChild(biPhalous_A01);
        this.biPhalous_A01.addChild(biPhalous_A02);
        
        
        
        this.biPhalous_B00 = new ModelRenderer(this, 0, 0);
        this.biPhalous_B00.setTextureOffset(56, 16).addBox(-2.5F, -15.0F,  0.0F, 1, 16, 1, p_i1149_1_);
        this.biPhalous_B00.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
        
        this.biPhalous_B01 = new ModelRenderer(this, 0, 0);
        this.biPhalous_B01.setTextureOffset(56, 16).addBox(-2.5F, -15.0F, 0.0F, 1, 16, 1, p_i1149_1_);
        this.biPhalous_B01.setRotationPoint(0.0F, -15.0F , 0.0F);
        
        this.biPhalous_B02 = new ModelRenderer(this, 0, 0);
        this.biPhalous_B02.setTextureOffset(56, 16).addBox(-2.5F, -15.0F, 0.0F, 1, 16, 1, p_i1149_1_);
        this.biPhalous_B02.setRotationPoint(0.0F, -15.0F, 0.0F);
        
        this.bipedHead.addChild(biPhalous_B00);
        this.biPhalous_B00.addChild(biPhalous_B01);
        this.biPhalous_B01.addChild(biPhalous_B02);


        this.biPhalous_C00 = new ModelRenderer(this, 0, 0);
        this.biPhalous_C00.setTextureOffset(56, 16).addBox(2.0F, -15.0F,  0.0F, 1, 16, 1, p_i1149_1_);
        this.biPhalous_C00.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
        
        this.biPhalous_C01 = new ModelRenderer(this, 0, 0);
        this.biPhalous_C01.setTextureOffset(56, 16).addBox(2.0F, -15.0F, 0.0F, 1, 16, 1, p_i1149_1_);
        this.biPhalous_C01.setRotationPoint(0.0F, -15.0F , 0.0F);
        
        this.biPhalous_C02 = new ModelRenderer(this, 0, 0);
        this.biPhalous_C02.setTextureOffset(56, 16).addBox(2.0F, -15.0F, 0.0F, 1, 16, 1, p_i1149_1_);
        this.biPhalous_C02.setRotationPoint(0.0F, -15.0F, 0.0F);
        
        this.bipedHead.addChild(biPhalous_C00);
        this.biPhalous_C00.addChild(biPhalous_C01);
        this.biPhalous_C01.addChild(biPhalous_C02);


        this.biPhalous_D00 = new ModelRenderer(this, 0, 0);
        this.biPhalous_D00.setTextureOffset(56, 16).addBox( 0.5F, -15.0F,  -0.5F, 1, 16, 1, p_i1149_1_);
        this.biPhalous_D00.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
        
        this.biPhalous_D01 = new ModelRenderer(this, 0, 0);
        this.biPhalous_D01.setTextureOffset(56, 16).addBox( 0.5F, -15.0F, -0.5F, 1, 16, 1, p_i1149_1_);
        this.biPhalous_D01.setRotationPoint(0.0F, -15.0F , 0.0F);
        
        this.biPhalous_D02 = new ModelRenderer(this, 0, 0);
        this.biPhalous_D02.setTextureOffset(56, 16).addBox( 0.5F, -15.0F, -0.5F, 1, 16, 1, p_i1149_1_);
        this.biPhalous_D02.setRotationPoint(0.0F, -15.0F, 0.0F);
        
        this.bipedHead.addChild(biPhalous_D00);
        this.biPhalous_D00.addChild(biPhalous_D01);
        this.biPhalous_D01.addChild(biPhalous_D02);
        
        this.bipedRightLeg = new ModelRenderer(this, 0, 16);
        this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1149_1_);
        this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + p_i1149_2_, 0.0F);
        this.bipedLeftLeg = new ModelRenderer(this, 0, 16);
        this.bipedLeftLeg.mirror = true;
        this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1149_1_);
        this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + p_i1149_2_, 0.0F);
    }

    /**
     * Sets the models various rotation angles then renders the model.
     */
    @Override
    public void render(Entity merEntity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_)
    {
    	
    	//System.out.println("render()");
        this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, merEntity);
        GlStateManager.pushMatrix();

        if (this.isChild)

        {
            float f6 = 2.0F;
            GlStateManager.scale(1.5F / f6, 1.5F / f6, 1.5F / f6);
                        
            GlStateManager.translate(0.0F, 16.0F * p_78088_7_, 0.0F);
            this.bipedHead.render(p_78088_7_);
            GlStateManager.popMatrix();
            GlStateManager.pushMatrix();
            GlStateManager.scale(1.0F / f6, 1.0F / f6, 1.0F / f6);
            GlStateManager.translate(0.0F, 24.0F * p_78088_7_, 0.0F);
            
            this.exclamacion.render(p_78088_7_);
            this.bipedBody.render(p_78088_7_);
            this.bipedRightArm.render(p_78088_7_);
            this.bipedLeftArm.render(p_78088_7_);
            this.bipedRightLeg.render(p_78088_7_);
            this.bipedLeftLeg.render(p_78088_7_);
            this.bipedHeadwear.render(p_78088_7_);
            
            this.biPhalous_A00.render(p_78088_7_);
            this.biPhalous_B00.render(p_78088_7_);
            this.biPhalous_C00.render(p_78088_7_);
            this.biPhalous_D00.render(p_78088_7_);
        }
        
        else
        {        
        	
        if (merEntity instanceof mobMercenario  ){
            
        mobMercenario merc = (mobMercenario) merEntity;
        
        this.aimedBow = merc.getAimedBow(); 
           
        //this.tamaño = merc.getTamaño();
        
         }
        
        if (merEntity instanceof zombieMercenario  ){
            
        	zombieMercenario merc = (zombieMercenario) merEntity;
   
        this.isRiding = merc.getIsRiding();
        
        this.tamaño = merc.getTamaño();
        
         }
        	
        	
            float f6 = 0.0F ;//tamaño/10 ;
            alt = 0.0F;
                 
            
            switch(tamaño)
            {
                       
            //1.5M
            case 1:{ f6 = 0.75F  ; alt = 0.5F  ;  };break; 
            
            //1.624M
            case 2:{ f6 = 0.812F ; alt = 0.4F  ;  };break; 

            //1.75M
            case 3:{ f6 = 0.875F ; alt = 0.2F  ;  };break; 
            
            //1.87M
            case 4:{ f6 = 0.9375F; alt = 0.05F ;  };break; 

            //2.00M
            default:{ f6 = 1.0F  ; alt = 0.00F ;  };break; 
            
            //2.25M
            case 6:{ f6 = 1.125F ; alt = -0.15F;  };break; 

            //2.5M
            case 7:{ f6 = 1.25F  ; alt = -0.3F ;  };break; 
            
            //3.0M
            case 8:{ f6 = 1.5F  ; alt = -0.5F  ;  };break; 
            
            //4.M
            case 9:{ f6 = 2.00F  ; alt = -0.75F;  };break; 
   
            //7M
            case 10:{ f6 = 3.5F   ; alt = -1.00F;  };break; 
            }
            
            GlStateManager.scale(1.0F * f6, 1.0F * f6, 1.0F * f6);
            
            GlStateManager.translate(0.0F, alt , 0.0F); 
             
        	if (merEntity.isSneaking())
            {
                GlStateManager.translate(0.0F, alt + 0.2F, 0.0F);
            }

        	this.exclamacion.render(p_78088_7_);
            this.bipedHead.render(p_78088_7_);
            this.bipedBody.render(p_78088_7_);
            //this.bipedBoobs.render(p_78088_7_);
            
            
            this.bipedRightArm.render(p_78088_7_);
            this.bipedLeftArm.render(p_78088_7_);
            
            this.villagerArms.render(p_78088_7_);
            this.bipedRightLeg.render(p_78088_7_);
            this.bipedLeftLeg.render(p_78088_7_);
            this.bipedHeadwear.render(p_78088_7_);
            
            this.biPhalous_A00.render(p_78088_7_);
            this.biPhalous_B00.render(p_78088_7_);
            this.biPhalous_C00.render(p_78088_7_);
            this.biPhalous_D00.render(p_78088_7_);
        }
       
        GlStateManager.popMatrix();
        
        


        
        
        

        
    }

    /**
     * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
     * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
     * "far" arms and legs can swing at most.
     */
    public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity merEntity)
    {
        if (merEntity instanceof mobMercenario  ){
            
        mobMercenario merc = (mobMercenario) merEntity;
        
        this.aimedBow = merc.getAimedBow(); 
        this.isSneak = merc.getIsSneak();
        this.isVillagin = merc.getIsVillagin();
        this.isZombye = merc.getIsZombye();
        
        this.heldItemRight = merc.getHeldItemRight();
        this.heldItemLeft = merc.getHeldItemLeft();
        this.swingProgress = merc.getSwingProgress();
        this.isRiding = merc.getIsRiding();
        
        this.hasTentacules = merc.hasTentacules();
        
         }
        
        if (merEntity instanceof zombieMercenario  ){
            
        zombieMercenario merc = (zombieMercenario) merEntity;
        
        this.aimedBow = merc.getAimedBow(); 
        this.isSneak = merc.getIsSneak();
        this.isVillagin = merc.getIsVillagin();
        this.isZombye = merc.getIsZombye();
        
        this.heldItemRight = merc.getHeldItemRight();
        this.heldItemLeft = merc.getHeldItemLeft();
        this.swingProgress = merc.getSwingProgress();
        this.isRiding = merc.getIsRiding();
        
        this.hasTentacules = merc.hasTentacules();
        
    	
    	this.exclamacionIcono = merc.getExclamacion() ;
        
        
        
         }
    	
        if (this.exclamacionIcono){
        	this.exclamacion.showModel = true;
        	
        	float g1 = (( (p_78087_3_ % 20) / 3) )  ;
        	
        	this.exclamacion.rotateAngleX = 0.0F;
        	this.exclamacion.rotateAngleY = g1 ;
        	this.exclamacion.rotateAngleZ = 0.0F;
        	
        }
        else
        {
        	this.exclamacion.showModel = false;
        }
        
        
//Villager Arms        
        if (this.isVillagin){
        
        //this.bipedHead.showModel = invisible;
        //this.bipedHeadwear.showModel = invisible;
       
        	
        	this.bipedRightArm.showModel = false;
        	this.bipedLeftArm.showModel = false;
        	this.villagerArms.showModel = true;
   
        }
        else
        {
            this.bipedRightArm.showModel = true;
            this.bipedLeftArm.showModel = true;
            this.villagerArms.showModel = false;
        }
        
        this.villagerArms.rotationPointY = 3.0F;
        this.villagerArms.rotationPointZ = -1.0F;
        this.villagerArms.rotateAngleX = -0.75F;
       	
        
        
        this.bipedHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI);
        this.bipedHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI);
        this.bipedRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_;
        this.bipedLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_;
        this.bipedRightLeg.rotateAngleY = 0.0F;
        this.bipedLeftLeg.rotateAngleY = 0.0F;

        
        
        
        
     // tentaculos      
        if (this.hasTentacules){
        	
        	this.heldItemLeft = 0;
        	this.heldItemRight = 0;
        	
        	float g1 = 0.0F;
        	float g2 = 0.0F;
        	float g3 = 0.0F;
        	
        	
        	float x = 0.0F;
        	float cx = 0.0F;        	
        	
        	
        	float z = 0.0F;
        	float amplitud = 0.75F;
        	
        	 g1 = (( (p_78087_3_ % 20) ) )  ;
        	 
        	 /*
        	 g1 = g1 + offset;
        	 
        	 if (g1 > 20)
        	 {
        		 g1 = g1 - 20;
        	 }
        	 */
        	 
        	 g3 = (( (p_78087_3_ % 60) / 10 ) - 3.0F )  ;
        	 
        	 
        	 
        	 if ((p_78087_3_ % 20) == 0) 
        	 {
////System.out.println( "Cos="+ MathHelper.cos(g1) );
        	 }
        	 
        	 
        	 if (g1 < 11)
        	 {
        		 g1 =  ((g1 - 5) * 2) / 10;
        	 }
        	 else
        	 {
        		 g1 =  ((g1 - 15) * -2) / 10;
        	 }	 
        	 
        	         	 
        	 if (this.swingProgress > -1)
        	 {
        		 g2 =( this.swingProgress * 10);
        	 }
        	 
        	 ////System.out.println( "g1="+g1 );
        	 
        	
        	 
        	 x = g1 * (amplitud);
        	 cx = MathHelper.cos(g1) * (amplitud);
        	 
        	 z = (g1 * (amplitud)) / 2;
        	 
      	 
        
            this.bipedHead.showModel = false;
            this.bipedHeadwear.showModel = false;
            //this.villagerArms.showModel = false;
            
            
        	this.biPhalous_A00.showModel = true;
        	//this.biPhalous_A01.showModel = true;
        	//this.biPhalous_A02.showModel = true;
            
          	this.biPhalous_B00.showModel = true;
            //this.biPhalous_B01.showModel = true;
            //this.biPhalous_B02.showModel = true;
            
            
          	this.biPhalous_C00.showModel = true;
            //this.biPhalous_C01.showModel = true;
            //this.biPhalous_C02.showModel = true;
        	
          	this.biPhalous_D00.showModel = true;
            //this.biPhalous_D01.showModel = true;
            //this.biPhalous_D02.showModel = true;
            
        
        this.biPhalous_A00.rotateAngleX = x;
        this.biPhalous_A00.rotateAngleY = g3 ;
        this.biPhalous_A00.rotateAngleZ = z;
        
        this.biPhalous_A01.rotateAngleX = x;
        this.biPhalous_A01.rotateAngleY = 0.0F;
        this.biPhalous_A01.rotateAngleZ = z;
        
        this.biPhalous_A02.rotateAngleX = x;
        this.biPhalous_A02.rotateAngleY = 0.0F;
        this.biPhalous_A02.rotateAngleZ = z;

        
        this.biPhalous_B00.rotateAngleX = x - 0.2F;
        this.biPhalous_B00.rotateAngleY = g3 + 0.33F;
        this.biPhalous_B00.rotateAngleZ = z - 0.2F;
        
        this.biPhalous_B01.rotateAngleX = x - 0.2F;
        this.biPhalous_B01.rotateAngleY = 0.0F;
        this.biPhalous_B01.rotateAngleZ = z - 0.2F;
        
        this.biPhalous_B02.rotateAngleX = x - 0.2F;
        this.biPhalous_B02.rotateAngleY = 0.0F;
        this.biPhalous_B02.rotateAngleZ = z - 0.2F;

        
        this.biPhalous_C00.rotateAngleX = cx + 0.1F;
        this.biPhalous_C00.rotateAngleY = g3 - 0.33F;
        this.biPhalous_C00.rotateAngleZ = z + 0.1F;
        
        this.biPhalous_C01.rotateAngleX = cx + 0.1F;
        this.biPhalous_C01.rotateAngleY = 0.0F;
        this.biPhalous_C01.rotateAngleZ = z + 0.1F;
        
        this.biPhalous_C02.rotateAngleX = cx + 0.1F;
        this.biPhalous_C02.rotateAngleY = 0.0F;
        this.biPhalous_C02.rotateAngleZ = z + 0.1F;
      
        
        this.biPhalous_D00.rotateAngleX = cx * -1;
        this.biPhalous_D00.rotateAngleY = g3 * 2;
        this.biPhalous_D00.rotateAngleZ = z * -1;
        
        this.biPhalous_D01.rotateAngleX = cx * -1;
        this.biPhalous_D01.rotateAngleY = 0.0F;
        this.biPhalous_D01.rotateAngleZ = z * -1;
        
        this.biPhalous_D02.rotateAngleX = cx * -1;
        this.biPhalous_D02.rotateAngleY = 0.0F;
        this.biPhalous_D02.rotateAngleZ = z * -1;
        
        
   	 if (this.swingProgress > -1)
   	 {
   		 g2 =( this.swingProgress + 1);
   		 
         this.biPhalous_A00.rotateAngleX = x + g2;
         this.biPhalous_A00.rotateAngleY = g3 / 10;
         this.biPhalous_A00.rotateAngleZ = z;
   		 
         this.biPhalous_B00.rotateAngleX = (x - 0.2F) + g2;
         this.biPhalous_B00.rotateAngleY = ( g3 + 0.33F )  / 10;
         this.biPhalous_B00.rotateAngleZ = z - 0.2F;
   		 
         this.biPhalous_C00.rotateAngleX = (cx + 0.1F) + g2;
         this.biPhalous_C00.rotateAngleY = ( g3 - 0.33F )  / 10;
         this.biPhalous_C00.rotateAngleZ = z + 0.1F;
   		 
   		 
         this.biPhalous_D00.rotateAngleX = (cx * -1) + g2;
         this.biPhalous_D00.rotateAngleY = ( g3 * 2 )  / 10;
         this.biPhalous_D00.rotateAngleZ = z * -1;
   	 }
        
        
        //////System.out.println("\n\n");
        
        //////System.out.println("X="+this.bipedHead.rotateAngleX);
        //////System.out.println("Y="+this.bipedHead.rotateAngleY);
       //////System.out.println("\n\n");
        

       
       
        }
        else
        {
        	this.biPhalous_A00.showModel = false;
        	this.biPhalous_B00.showModel = false;
        	this.biPhalous_C00.showModel = false;
        	this.biPhalous_D00.showModel = false;
        	
            this.bipedHead.showModel = true;
            this.bipedHeadwear.showModel = true;

        }	
        

        
        
//Zombye arms       
        if (this.isZombye){
        	
        	this.heldItemLeft = 0;
        	this.heldItemRight = 0;
        	
        	
        float f6 = MathHelper.sin(this.swingProgress * (float)Math.PI);
        float f7 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
        this.bipedRightArm.rotateAngleZ = 0.0F;
        this.bipedLeftArm.rotateAngleZ = 0.0F;
        this.bipedRightArm.rotateAngleY = -(0.1F - f6 * 0.6F);
        this.bipedLeftArm.rotateAngleY = 0.1F - f6 * 0.6F;
        this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F);
        this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F);
        this.bipedRightArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
        this.bipedLeftArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
        this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
        this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
        this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
        this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
        }
        else
        {
        this.bipedRightArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 2.0F * p_78087_2_ * 0.5F;
        this.bipedLeftArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 2.0F * p_78087_2_ * 0.5F;
        this.bipedRightArm.rotateAngleZ = 0.0F;
        this.bipedLeftArm.rotateAngleZ = 0.0F;
            
        }   
        
        
        
        
        
        
        
        if (this.isRiding)
        {
            this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F);
            this.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F);
            this.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2F / 5F);
            this.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2F / 5F);
            this.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F);
            this.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F);
        }

        if (this.heldItemLeft != 0)
        {
            this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft;
        }

        this.bipedRightArm.rotateAngleY = 0.0F;
        this.bipedRightArm.rotateAngleZ = 0.0F;

        switch (this.heldItemRight)
        {
            case 0:
            case 2:
            default:
                break;
            case 1:
                this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight;
                break;
            case 3:
                this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight;
                this.bipedRightArm.rotateAngleY = -0.5235988F;
        }

        this.bipedLeftArm.rotateAngleY = 0.0F;
        float f6;
        float f7;

        if (this.swingProgress > -9990.0F & (!this.hasTentacules) )
        {
        	
            f6 = this.swingProgress;
            this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f6) * (float)Math.PI * 2.0F) * 0.2F;
            this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
            this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
            this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
            this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
            this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY;
            this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY;
            this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY;
            f6 = 1.0F - this.swingProgress;
            f6 *= f6;
            f6 *= f6;
            f6 = 1.0F - f6;
            f7 = MathHelper.sin(f6 * (float)Math.PI);
            float f8 = MathHelper.sin(this.swingProgress * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F;
            this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX - ((double)f7 * 1.2D + (double)f8));
            this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
            this.bipedRightArm.rotateAngleZ += MathHelper.sin(this.swingProgress * (float)Math.PI) * -0.4F;
        }
        
        
        

        if (this.isSneak)
        {
            this.bipedBody.rotateAngleX = 0.5F;
            this.bipedRightArm.rotateAngleX += 0.4F;
            this.bipedLeftArm.rotateAngleX += 0.4F;
            this.bipedRightLeg.rotationPointZ = 4.0F;
            this.bipedLeftLeg.rotationPointZ = 4.0F;
            this.bipedRightLeg.rotationPointY = 9.0F;
            this.bipedLeftLeg.rotationPointY = 9.0F;
            this.bipedHead.rotationPointY = 1.0F;
        }
        else
        {
            this.bipedBody.rotateAngleX = 0.0F;
            this.bipedRightLeg.rotationPointZ = 0.1F;
            this.bipedLeftLeg.rotationPointZ = 0.1F;
            this.bipedRightLeg.rotationPointY = 12.0F;
            this.bipedLeftLeg.rotationPointY = 12.0F;
            this.bipedHead.rotationPointY = 0.0F;
        }

        
        
        
        this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
        this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
        this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
        this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;

        if (this.aimedBow)
        {
            f6 = 0.0F;
            f7 = 0.0F;
            this.bipedRightArm.rotateAngleZ = 0.0F;
            this.bipedLeftArm.rotateAngleZ = 0.0F;
            this.bipedRightArm.rotateAngleY = -(0.1F - f6 * 0.6F) + this.bipedHead.rotateAngleY;
            this.bipedLeftArm.rotateAngleY = 0.1F - f6 * 0.6F + this.bipedHead.rotateAngleY + 0.4F;
            this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
            this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
            this.bipedRightArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
            this.bipedLeftArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
            this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
            this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
            this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
            this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
        }

        copyModelAngles(this.bipedHead, this.bipedHeadwear);
    }

    public void setModelAttributes(ModelBase p_178686_1_)
    {
        super.setModelAttributes(p_178686_1_);

        if (p_178686_1_ instanceof ModelBipedWoman)
        {
            ModelBipedWoman modelbiped = (ModelBipedWoman)p_178686_1_;
            this.heldItemLeft = modelbiped.heldItemLeft;
            this.heldItemRight = modelbiped.heldItemRight;
            this.isSneak = modelbiped.isSneak;
            this.aimedBow = modelbiped.aimedBow;
            
        }
    }

    
    
    
    public void setInvisible(boolean invisible)
    {
    	
    	this.biPhalous_A00.showModel = invisible;
    	this.biPhalous_A01.showModel = invisible;
    	this.biPhalous_A02.showModel = invisible;
    	
        this.bipedHead.showModel = invisible;
        this.bipedHeadwear.showModel = invisible;
        this.bipedBody.showModel = invisible;
        this.bipedRightArm.showModel = invisible;
        this.bipedLeftArm.showModel = invisible;
        this.bipedRightLeg.showModel = invisible;
        this.bipedLeftLeg.showModel = invisible;
        this.villagerArms.showModel = invisible;
        
    }

    @Override
    public void postRenderArm(float p_178718_1_)
    {
        this.bipedRightArm.postRender(p_178718_1_);
    }
    
    public float getAlt(){
    	return alt;
    }
    
}

 

Link to comment
Share on other sites

well

i never before play whith iterators and this seem to be not working

coz i dont have any output in the console even there is any errors

 

public zombieMercenario_render(RenderManager rm) { //, ModelBipedMercenary model, float shadowSize
//super( rm , new ModelBipedGreen(), 0.5F  );
super( rm , new ModelBipedWoman(), 0.5F  );


Iterator iterator = this.layerRenderers.iterator();

System.out.println("###  iterator="+iterator.toString() );


while (iterator.hasNext())
{
    LayerRenderer layerrenderer = (LayerRenderer)iterator.next();
    
    System.out.println("###  LS="+layerrenderer.toString() );
    
}

List lista = this.layerRenderers;
int ls = lista.size();
System.out.println("### ls ="+ls);



//this.addLayer(new LayerHeldItemM(this));
//this.addLayer(new LayerBipedArmor(this)   );
//this.addLayer(new LayerHeldItem(this));
//this.addLayer(new LayerArrow(this));

}

 

anyway soo there is another this.addLayer(new LayerHeldItem(this)) was not aware of

 

i founded in one of the RenderBiped constructors, so i create an custome RenderBipedM whithout this ands done there is no more two guns render only the mine

 

well it gona take me some time to make all the changes to send the values i need in every case to this custome LayerHeldItemM soo thanks is fixed

 

 

 

 

Link to comment
Share on other sites

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Whether you are a fan of Hypixel Bedwars, SkyWars and PvP gamemodes like that, well you would enjoy this server! We have a very fun and unique style of PvP that a lot of our players really enjoy and we want to bring this server to more players like you! Yes you reading this post haha. Introducing, the Minezone Network, home of SUPER CRAFT BLOCKS. We've been working on this server for over 4 years now. Here is what we have to offer: SUPER CRAFT BLOCKS: This has 3 different gamemodes you can play, Classic, Duels and Frenzy. Each mode offers over 60 kits to choose from, along with a total of over 60 maps, allowing for various different playstyles on each map. There are also random powerups that spawn on the map which can include Health Pots, Bazookas, Nukes, Extra Lives and way way more! There is also double jump in this gamemode as well, which makes PvP a lot more fun & unique. You only need a minimum of 2 players to start any mode! Classic: Choose a kit, 5 lives for each player, fight it out and claim the #1 spot! Look out for lightning as they can spawn powerups to really give you an advantage in the game! Duels: Fight against another random player or one of your friends and see who is the best! Frenzy: Your kit is randomly selected for you, each life you will have a different kit. You can fight with up to 100 players in this mode and lets see who will be the best out of that 100! All the other stuff from Classic/Duels apply to this mode as well like powerups. We have 2 ranks on this server too, VIP and CAPTAIN which has a bunch of different perks for SCB and other things like Cosmetics and more.   SERVER IP: If this server has caught your interest in any way, please consider joining and you will NOT regret it! Bring some of your friends online for an even better experience and join in on the fun at: IP: minezone.club Hope to see you online!   SERVER TRAILER: https://www.youtube.com/watch?v=0phpMgu1mH0
    • The mod give new blocks  
    • I will a Mode for 1.21 in this Mod give new block, items and dimensions   
    • Remove Optifine For shader support and similar, use Embeddium + Oculus
  • Topics

×
×
  • Create New...

Important Information

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