1.12.2 Model 3D 1.12.2



  • Bonjour je suis actuellement en train de développer un mod minecraft en 1.12.2 et les graphistes ont fais les models des armures en .java. Je ne sais pas comment les intégrer, merci d'avance (j'espère que je me suis pas trompé d'endroit cette fois).

    import org.lwjgl.opengl.GL11;
    import net.minecraft.client.model.ModelBase;
    import net.minecraft.client.model.ModelBox;
    import net.minecraft.client.model.ModelRenderer;
    import net.minecraft.client.renderer.GlStateManager;
    import net.minecraft.entity.Entity;
    
    public class geometry.humanoid extends ModelBase {
    	private final ModelRenderer bone;
    	private final ModelRenderer head;
    	private final ModelRenderer rightLeg;
    	private final ModelRenderer leftLeg;
    	private final ModelRenderer rightArm;
    	private final ModelRenderer leftArm;
    	private final ModelRenderer body;
    	private final ModelRenderer bone2;
    	private final ModelRenderer bone31;
    	private final ModelRenderer bone32;
    	private final ModelRenderer bone27;
    	private final ModelRenderer bone28;
    	private final ModelRenderer bone29;
    	private final ModelRenderer bone30;
    	private final ModelRenderer bone11;
    	private final ModelRenderer bone10;
    	private final ModelRenderer bone9;
    	private final ModelRenderer bone7;
    	private final ModelRenderer bone8;
    	private final ModelRenderer bone3;
    	private final ModelRenderer bone4;
    	private final ModelRenderer bone5;
    	private final ModelRenderer bone6;
    	private final ModelRenderer bone33;
    	private final ModelRenderer bone34;
    	private final ModelRenderer bone12;
    	private final ModelRenderer bone13;
    	private final ModelRenderer bone14;
    	private final ModelRenderer bone15;
    	private final ModelRenderer bone16;
    	private final ModelRenderer bone17;
    	private final ModelRenderer bone18;
    	private final ModelRenderer bone19;
    	private final ModelRenderer bone20;
    	private final ModelRenderer bone21;
    	private final ModelRenderer bone22;
    	private final ModelRenderer bone23;
    	private final ModelRenderer bone24;
    	private final ModelRenderer bone25;
    	private final ModelRenderer bone26;
    
    	public geometry.humanoid() {
    		textureWidth = 64;
    		textureHeight = 32;
    		
    		bone = new ModelRenderer(this);
    		bone.setRotationPoint(0.0F, 24.0F, 0.0F);
    
    		head = new ModelRenderer(this);
    		head.setRotationPoint(0.0F, -24.0F, 0.0F);
    		bone.addChild(head);
    		head.cubeList.add(new ModelBox(head, 0, 0, -4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F, true));
    
    		rightLeg = new ModelRenderer(this);
    		rightLeg.setRotationPoint(1.9F, -12.0F, 0.0F);
    		bone.addChild(rightLeg);
    		rightLeg.cubeList.add(new ModelBox(rightLeg, 0, 16, -2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F, true));
    
    		leftLeg = new ModelRenderer(this);
    		leftLeg.setRotationPoint(-1.9F, -12.0F, 0.0F);
    		bone.addChild(leftLeg);
    		leftLeg.cubeList.add(new ModelBox(leftLeg, 0, 16, -2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F, false));
    
    		rightArm = new ModelRenderer(this);
    		rightArm.setRotationPoint(5.0F, -22.0F, 0.0F);
    		bone.addChild(rightArm);
    		rightArm.cubeList.add(new ModelBox(rightArm, 40, 16, -1.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F, true));
    
    		leftArm = new ModelRenderer(this);
    		leftArm.setRotationPoint(-5.0F, -22.0F, 0.0F);
    		bone.addChild(leftArm);
    		leftArm.cubeList.add(new ModelBox(leftArm, 40, 16, -3.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F, false));
    
    		body = new ModelRenderer(this);
    		body.setRotationPoint(0.0F, -24.0F, 0.0F);
    		bone.addChild(body);
    		body.cubeList.add(new ModelBox(body, 16, 16, -4.0F, 0.0F, -2.0F, 8, 12, 4, 0.0F, true));
    
    		bone2 = new ModelRenderer(this);
    		bone2.setRotationPoint(0.0F, 24.0F, 0.0F);
    		bone2.cubeList.add(new ModelBox(bone2, 0, 0, -5.0F, -33.0F, -5.0F, 10, 4, 10, 0.0F, false));
    
    		bone31 = new ModelRenderer(this);
    		bone31.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone2.addChild(bone31);
    		bone31.cubeList.add(new ModelBox(bone31, 0, 0, -1.5F, -34.0F, -1.25F, 3, 3, 3, 0.0F, false));
    
    		bone32 = new ModelRenderer(this);
    		bone32.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone31.addChild(bone32);
    		bone32.cubeList.add(new ModelBox(bone32, 0, 0, -1.0F, -34.5F, -0.75F, 2, 3, 2, 0.0F, false));
    
    		bone27 = new ModelRenderer(this);
    		bone27.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone2.addChild(bone27);
    		bone27.cubeList.add(new ModelBox(bone27, 0, 0, -5.0F, -33.25F, -0.25F, 10, 1, 1, 0.0F, false));
    
    		bone28 = new ModelRenderer(this);
    		bone28.setRotationPoint(0.0F, 0.0F, 0.0F);
    		setRotationAngle(bone28, 0.0F, 1.5708F, 0.0F);
    		bone27.addChild(bone28);
    		bone28.cubeList.add(new ModelBox(bone28, 0, 0, -5.0F, -33.25F, -0.5F, 10, 1, 1, 0.0F, false));
    
    		bone29 = new ModelRenderer(this);
    		bone29.setRotationPoint(0.0F, 0.0F, 0.0F);
    		setRotationAngle(bone29, 0.0F, 2.3562F, 0.0F);
    		bone28.addChild(bone29);
    		bone29.cubeList.add(new ModelBox(bone29, 0, 0, -5.5F, -33.25F, -0.75F, 11, 1, 1, 0.0F, false));
    
    		bone30 = new ModelRenderer(this);
    		bone30.setRotationPoint(0.0F, 0.0F, 0.0F);
    		setRotationAngle(bone30, 0.0F, 1.6581F, 0.0F);
    		bone29.addChild(bone30);
    		bone30.cubeList.add(new ModelBox(bone30, 0, 0, -5.5F, -33.25F, -0.5F, 11, 1, 1, 0.0F, false));
    
    		bone11 = new ModelRenderer(this);
    		bone11.setRotationPoint(0.0F, 0.0F, 0.0F);
    		setRotationAngle(bone11, 1.0472F, 0.0F, 1.309F);
    		bone2.addChild(bone11);
    		bone11.cubeList.add(new ModelBox(bone11, 0, 0, -27.25F, -12.75F, 7.5F, 4, 3, 1, 0.0F, false));
    
    		bone10 = new ModelRenderer(this);
    		bone10.setRotationPoint(0.0F, 0.0F, 0.0F);
    		setRotationAngle(bone10, 0.0F, 2.2689F, 0.2618F);
    		bone2.addChild(bone10);
    		bone10.cubeList.add(new ModelBox(bone10, 0, 0, 10.75F, -27.25F, -6.5F, 3, 4, 1, 0.0F, false));
    
    		bone9 = new ModelRenderer(this);
    		bone9.setRotationPoint(0.0F, 0.0F, 0.0F);
    		setRotationAngle(bone9, 1.1345F, 0.0F, 0.0F);
    		bone2.addChild(bone9);
    		bone9.cubeList.add(new ModelBox(bone9, 0, 0, -5.0F, -20.75F, 24.0F, 10, 4, 1, 0.0F, false));
    
    		bone7 = new ModelRenderer(this);
    		bone7.setRotationPoint(0.0F, 0.0F, 0.0F);
    		setRotationAngle(bone7, 0.2618F, 0.0F, 0.0F);
    		bone2.addChild(bone7);
    		bone7.cubeList.add(new ModelBox(bone7, 0, 0, -5.0F, -27.25F, 11.5F, 10, 4, 1, 0.0F, false));
    
    		bone8 = new ModelRenderer(this);
    		bone8.setRotationPoint(0.0F, 0.0F, 0.0F);
    		setRotationAngle(bone8, -0.0873F, 0.0F, 0.0F);
    		bone7.addChild(bone8);
    		bone8.cubeList.add(new ModelBox(bone8, 0, 0, -5.0F, -27.0F, 8.75F, 10, 4, 1, 0.0F, false));
    
    		bone3 = new ModelRenderer(this);
    		bone3.setRotationPoint(0.0F, 0.0F, 0.0F);
    		setRotationAngle(bone3, 0.0F, 0.0F, 0.2618F);
    		bone2.addChild(bone3);
    		bone3.cubeList.add(new ModelBox(bone3, 0, 0, -12.5F, -27.25F, -5.0F, 1, 4, 10, 0.0F, false));
    
    		bone4 = new ModelRenderer(this);
    		bone4.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone3.addChild(bone4);
    		bone4.cubeList.add(new ModelBox(bone4, 0, 0, -12.0F, -26.0F, -5.0F, 1, 4, 10, 0.0F, false));
    
    		bone5 = new ModelRenderer(this);
    		bone5.setRotationPoint(0.0F, 0.0F, 0.0F);
    		setRotationAngle(bone5, 0.0F, 3.1416F, -0.5236F);
    		bone3.addChild(bone5);
    		bone5.cubeList.add(new ModelBox(bone5, 0, 0, -12.5F, -27.25F, -5.0F, 1, 4, 10, 0.0F, false));
    
    		bone6 = new ModelRenderer(this);
    		bone6.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone5.addChild(bone6);
    		bone6.cubeList.add(new ModelBox(bone6, 0, 0, -12.0F, -26.0F, -5.0F, 1, 4, 10, 0.0F, false));
    
    		bone33 = new ModelRenderer(this);
    		bone33.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone6.addChild(bone33);
    		bone33.cubeList.add(new ModelBox(bone33, 0, 0, -12.75F, -28.75F, -5.0F, 1, 4, 10, 0.0F, false));
    
    		bone34 = new ModelRenderer(this);
    		bone34.setRotationPoint(0.0F, 0.0F, 0.0F);
    		setRotationAngle(bone34, 0.0F, 3.1416F, -0.6109F);
    		bone33.addChild(bone34);
    		bone34.cubeList.add(new ModelBox(bone34, 0, 0, -14.75F, -27.5F, -5.0F, 1, 4, 10, 0.0F, false));
    
    		bone12 = new ModelRenderer(this);
    		bone12.setRotationPoint(0.0F, 24.0F, 0.0F);
    		bone12.cubeList.add(new ModelBox(bone12, 0, 0, -2.0F, -33.25F, -5.5F, 4, 1, 1, 0.0F, false));
    
    		bone13 = new ModelRenderer(this);
    		bone13.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone12.addChild(bone13);
    		bone13.cubeList.add(new ModelBox(bone13, 0, 0, -3.5F, -32.25F, -5.25F, 3, 1, 1, 0.0F, false));
    
    		bone14 = new ModelRenderer(this);
    		bone14.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone13.addChild(bone14);
    		bone14.cubeList.add(new ModelBox(bone14, 0, 0, 0.5F, -32.25F, -5.25F, 3, 1, 1, 0.0F, false));
    
    		bone15 = new ModelRenderer(this);
    		bone15.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone14.addChild(bone15);
    		bone15.cubeList.add(new ModelBox(bone15, 0, 0, -3.25F, -34.25F, -5.25F, 2, 1, 1, 0.0F, false));
    
    		bone16 = new ModelRenderer(this);
    		bone16.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone15.addChild(bone16);
    		bone16.cubeList.add(new ModelBox(bone16, 0, 0, 1.0F, -34.25F, -5.25F, 2, 1, 1, 0.0F, false));
    
    		bone17 = new ModelRenderer(this);
    		bone17.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone16.addChild(bone17);
    		bone17.cubeList.add(new ModelBox(bone17, 0, 0, 2.0F, -35.25F, -5.25F, 2, 1, 1, 0.0F, false));
    
    		bone18 = new ModelRenderer(this);
    		bone18.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone17.addChild(bone18);
    		bone18.cubeList.add(new ModelBox(bone18, 0, 0, -4.25F, -35.25F, -5.25F, 2, 1, 1, 0.0F, false));
    
    		bone19 = new ModelRenderer(this);
    		bone19.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone18.addChild(bone19);
    		bone19.cubeList.add(new ModelBox(bone19, 0, 0, -5.25F, -36.25F, -5.25F, 2, 1, 1, 0.0F, false));
    
    		bone20 = new ModelRenderer(this);
    		bone20.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone19.addChild(bone20);
    		bone20.cubeList.add(new ModelBox(bone20, 0, 0, 2.75F, -36.25F, -5.25F, 2, 1, 1, 0.0F, false));
    
    		bone21 = new ModelRenderer(this);
    		bone21.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone20.addChild(bone21);
    		bone21.cubeList.add(new ModelBox(bone21, 0, 0, -1.25F, -37.25F, -5.25F, 2, 1, 1, 0.0F, false));
    
    		bone22 = new ModelRenderer(this);
    		bone22.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone21.addChild(bone22);
    		bone22.cubeList.add(new ModelBox(bone22, 0, 0, -1.25F, -35.25F, -5.25F, 1, 1, 1, 0.0F, false));
    
    		bone23 = new ModelRenderer(this);
    		bone23.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone22.addChild(bone23);
    		bone23.cubeList.add(new ModelBox(bone23, 0, 0, 0.0F, -35.25F, -5.25F, 1, 1, 1, 0.0F, false));
    
    		bone24 = new ModelRenderer(this);
    		bone24.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone23.addChild(bone24);
    		bone24.cubeList.add(new ModelBox(bone24, 0, 0, 0.5F, -36.25F, -5.25F, 1, 1, 1, 0.0F, false));
    
    		bone25 = new ModelRenderer(this);
    		bone25.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone24.addChild(bone25);
    		bone25.cubeList.add(new ModelBox(bone25, 0, 0, -1.75F, -36.25F, -5.25F, 1, 1, 1, 0.0F, false));
    
    		bone26 = new ModelRenderer(this);
    		bone26.setRotationPoint(0.0F, 0.0F, 0.0F);
    		bone25.addChild(bone26);
    		bone26.cubeList.add(new ModelBox(bone26, 0, 0, -0.75F, -38.25F, -5.25F, 1, 1, 1, 0.0F, false));
    	}
    
    	@Override
    	public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
    		bone.render(f5);
    		bone2.render(f5);
    		bone12.render(f5);
    	}
    	public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
    		modelRenderer.rotateAngleX = x;
    		modelRenderer.rotateAngleY = y;
    		modelRenderer.rotateAngleZ = z;
    	}
    }
    

    le model

    package fr.prutix.shoguns.armors;
    
    import fr.prutix.shoguns.MainMod;
    import fr.prutix.shoguns.init.ItemsMods;
    import fr.prutix.shoguns.utils.ClientProxy;
    import net.minecraft.client.model.ModelBiped;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.inventory.EntityEquipmentSlot;
    import net.minecraft.item.EnumAction;
    import net.minecraft.item.ItemArmor;
    import net.minecraft.item.ItemStack;
    import net.minecraftforge.fml.relauncher.Side;
    import net.minecraftforge.fml.relauncher.SideOnly;
    
    public class DoMaru extends ItemArmor {
    
    	public DoMaru(String name, ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn) {
    		super(materialIn, renderIndexIn, equipmentSlotIn);
    		setUnlocalizedName(name);
    		setRegistryName(name);
    		setCreativeTab(MainMod.tab);
    		ItemsMods.INSTANCE.getITEMS();
    	}
    }
    

    ma class de l'armure


  • Moddeurs confirmés Rédacteurs Administrateurs

    Bonsoir,
    Regardes dans la classe ItemArmor ou dans Item, il y a une fonction getArmorModel.
    Il faut override cette fonction dans la classe de ton armure et renvoyer le modèle en question.



  • Ok, merci beaucoup.


Log in to reply