Jump to content

[1.15.2] [SOLVED] Custom Armor Model


Obeeron

Recommended Posts

Hello,
I have the .java models for all armor parts but I don't understand how to insert it within my mod considering I use deferred registries.
The different models have been made with Blockbench

Edited by Obeeron
Link to comment
Share on other sites

I got the armor to render but it does not rotate with the arms/legs/head movement. It also does not change when sneaking or when sitting. However it does rotate all at once with when I turn.
Here are the 2 classes :
 

public class BronzeArmorModel extends BipedModel<LivingEntity> {
	public final ModelRenderer helmet;
	public final ModelRenderer chestplate;
	private final ModelRenderer bone2;
	private final ModelRenderer bone3;
	public final ModelRenderer leftBoot;
	private final ModelRenderer bone5;
	public final ModelRenderer rightBoot;
	private final ModelRenderer bone8;

	public BronzeArmorModel(float size) {
		super(size);
		textureWidth = 64;
		textureHeight = 64;

		helmet = new ModelRenderer(this);
		helmet.setRotationPoint(0.0F, 0.0F, 0.0F);
		helmet.setTextureOffset(0, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.51F, false);
		helmet.setTextureOffset(0, 16).addBox(-4.0F, -8.5F, -4.0F, 8.0F, 1.0F, 8.0F, 0.45F, false);

		chestplate = new ModelRenderer(this);
		chestplate.setRotationPoint(0.0F, 5.3625F, 0.0F);
		chestplate.setTextureOffset(32, 0).addBox(-4.0F, -5.3625F, -2.0F, 8.0F, 11.0F, 4.0F, 0.28F, true);
		chestplate.setTextureOffset(40, 20).addBox(-2.0F, 6.0875F, -2.0F, 4.0F, 1.0F, 4.0F, 0.29F, false);

		bone2 = new ModelRenderer(this);
		bone2.setRotationPoint(-1.5F, 4.6375F, 0.0F);
		chestplate.addChild(bone2);
		setRotationAngle(bone2, 0.0F, 0.0F, 0.2618F);
		bone2.setTextureOffset(12, 41).addBox(-2.3F, 1.55F, -2.0F, 2.0F, 1.0F, 4.0F, 0.29F, false);

		bone3 = new ModelRenderer(this);
		bone3.setRotationPoint(1.5F, 4.6375F, 0.0F);
		chestplate.addChild(bone3);
		setRotationAngle(bone3, 0.0F, 0.0F, -0.2618F);
		bone3.setTextureOffset(0, 41).addBox(0.3F, 1.55F, -2.0F, 2.0F, 1.0F, 4.0F, 0.29F, false);

		leftBoot = new ModelRenderer(this);
		leftBoot.setRotationPoint(-2.0F, 21.0F, 0.0F);
		leftBoot.setTextureOffset(28, 15).addBox(-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, false);
		leftBoot.setTextureOffset(24, 41).addBox(-2.0F, -2.0F, -2.5F, 4.0F, 4.0F, 1.0F, 0.0F, false);

		bone5 = new ModelRenderer(this);
		bone5.setRotationPoint(0.0F, -1.5F, -1.5F);
		leftBoot.addChild(bone5);
		setRotationAngle(bone5, 0.1745F, 0.0F, 0.0F);
		bone5.setTextureOffset(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 2.0F, 1.0F, 0.0F, false);

		rightBoot = new ModelRenderer(this);
		rightBoot.setRotationPoint(2.0F, 21.0F, 0.0F);
		rightBoot.setTextureOffset(28, 15).addBox(-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, true);
		rightBoot.setTextureOffset(24, 41).addBox(-2.0F, -2.0F, -2.5F, 4.0F, 4.0F, 1.0F, 0.0F, true);

		bone8 = new ModelRenderer(this);
		bone8.setRotationPoint(0.0F, -1.5F, -1.5F);
		rightBoot.addChild(bone8);
		setRotationAngle(bone8, 0.1745F, 0.0F, 0.0F);
		bone8.setTextureOffset(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 2.0F, 1.0F, 0.0F, true);
		
		this.bipedHead.addChild(helmet);
		this.bipedBody.addChild(chestplate);
		this.bipedLeftLeg.addChild(leftBoot);
		this.bipedRightLeg.addChild(rightBoot);
	}
	
	@Override
	public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
		helmet.render(matrixStack, buffer, packedLight, packedOverlay);
		chestplate.render(matrixStack, buffer, packedLight, packedOverlay);
		leftBoot.render(matrixStack, buffer, packedLight, packedOverlay);
		rightBoot.render(matrixStack, buffer, packedLight, packedOverlay);
	}

	public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
		modelRenderer.rotateAngleX = x;
		modelRenderer.rotateAngleY = y;
		modelRenderer.rotateAngleZ = z;
	}
}

 

public class BronzeArmor extends ArmorItem
{

	public BronzeArmor(IArmorMaterial materialIn, EquipmentSlotType slot) {
		super(materialIn, slot, new Item.Properties().group(ModSetup.MELTEM_GROUP));
		// TODO Auto-generated constructor stub
	}
	
	@SuppressWarnings("unchecked")
    @Nullable
    @Override
    public <A extends BipedModel<?>> A getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, A _default)
	{
		if(itemStack != ItemStack.EMPTY && itemStack.getItem() instanceof ArmorItem) {	
			BronzeArmorModel model = new BronzeArmorModel(1.0F);
       
            model.helmet.showModel = armorSlot == EquipmentSlotType.HEAD;
            model.chestplate.showModel = armorSlot == EquipmentSlotType.CHEST;
            model.rightBoot.showModel = armorSlot == EquipmentSlotType.FEET;
            model.leftBoot.showModel = armorSlot == EquipmentSlotType.FEET;
           
            model.isChild = _default.isChild;
            model.isSitting = _default.isSitting;
            model.isSneak = _default.isSneak;
            model.rightArmPose = _default.rightArmPose;
            model.leftArmPose = _default.leftArmPose;
           
            return (A) model;
		}
		return null;
	}
	
    @Nullable
    @Override
    public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) {
        return "######:textures/models/armor/bronze_armor.png";
    }

}

 

Link to comment
Share on other sites

Mhm.. I replaced the functions in the model class as in your code but it now seems to render twice (at least for the head) and not in a.. let's say 'coherent' way
image.thumb.png.8bb4e700a6fa5dc2ab0f62dd68d8f17d.png

 

Here is what it used to look like:
unknown.png

Edited by Obeeron
Link to comment
Share on other sites

Okay so I managed to make it match the head and legs rotation + sneak but as you can see the models are too high. The boots are at the start of the legs and the chestplate starts at the middle of the body
image.png.7b30adab95168aadb1b4435aaf60726d.png
Here is the code
 

public class BronzeArmorModel extends BipedModel<LivingEntity> {
	public final ModelRenderer helmet;
	public final ModelRenderer chestplate;
	private final ModelRenderer bone2;
	private final ModelRenderer bone3;
	public final ModelRenderer leftBoot;
	private final ModelRenderer bone5;
	public final ModelRenderer rightBoot;
	private final ModelRenderer bone8;

	public BronzeArmorModel(float size) {
		super(size, 0, 64, 64);
		textureWidth = 64;
		textureHeight = 64;

		helmet = new ModelRenderer(this);
		helmet.setRotationPoint(0.0F, 0.0F, 0.0F);
		helmet.setTextureOffset(0, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.51F, false);
		helmet.setTextureOffset(0, 16).addBox(-4.0F, -8.5F, -4.0F, 8.0F, 1.0F, 8.0F, 0.45F, false);

		chestplate = new ModelRenderer(this);
		chestplate.setRotationPoint(0.0F, 5.3625F, 0.0F);
		chestplate.setTextureOffset(32, 0).addBox(-4.0F, -5.3625F, -2.0F, 8.0F, 11.0F, 4.0F, 0.28F, true);
		chestplate.setTextureOffset(40, 20).addBox(-2.0F, 6.0875F, -2.0F, 4.0F, 1.0F, 4.0F, 0.29F, false);

		bone2 = new ModelRenderer(this);
		bone2.setRotationPoint(-1.5F, 4.6375F, 0.0F);
		chestplate.addChild(bone2);
		setRotationAngle(bone2, 0.0F, 0.0F, 0.2618F);
		bone2.setTextureOffset(12, 41).addBox(-2.3F, 1.55F, -2.0F, 2.0F, 1.0F, 4.0F, 0.29F, false);

		bone3 = new ModelRenderer(this);
		bone3.setRotationPoint(1.5F, 4.6375F, 0.0F);
		chestplate.addChild(bone3);
		setRotationAngle(bone3, 0.0F, 0.0F, -0.2618F);
		bone3.setTextureOffset(0, 41).addBox(0.3F, 1.55F, -2.0F, 2.0F, 1.0F, 4.0F, 0.29F, false);

		leftBoot = new ModelRenderer(this);
		leftBoot.setRotationPoint(-2.0F, 21.0F, 0.0F);
		leftBoot.setTextureOffset(28, 15).addBox(-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, false);
		leftBoot.setTextureOffset(24, 41).addBox(-2.0F, -2.0F, -2.5F, 4.0F, 4.0F, 1.0F, 0.0F, false);

		bone5 = new ModelRenderer(this);
		bone5.setRotationPoint(0.0F, -1.5F, -1.5F);
		leftBoot.addChild(bone5);
		setRotationAngle(bone5, 0.1745F, 0.0F, 0.0F);
		bone5.setTextureOffset(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 2.0F, 1.0F, 0.0F, false);

		rightBoot = new ModelRenderer(this);
		rightBoot.setRotationPoint(2.0F, 21.0F, 0.0F);
		rightBoot.setTextureOffset(28, 15).addBox(-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, true);
		rightBoot.setTextureOffset(24, 41).addBox(-2.0F, -2.0F, -2.5F, 4.0F, 4.0F, 1.0F, 0.0F, true);

		bone8 = new ModelRenderer(this);
		bone8.setRotationPoint(0.0F, -1.5F, -1.5F);
		rightBoot.addChild(bone8);
		setRotationAngle(bone8, 0.1745F, 0.0F, 0.0F);
		bone8.setTextureOffset(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 2.0F, 1.0F, 0.0F, true);
		
		this.bipedHead.addChild(helmet);
		this.bipedBody.addChild(chestplate);
		this.bipedLeftLeg.addChild(leftBoot);
		this.bipedRightLeg.addChild(rightBoot);
	}
	
	@Override
    public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha)
	{
       // super.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
		
        helmet.render(matrixStack, buffer, packedLight, packedOverlay);
		chestplate.render(matrixStack, buffer, packedLight, packedOverlay);
		leftBoot.render(matrixStack, buffer, packedLight, packedOverlay);
		rightBoot.render(matrixStack, buffer, packedLight, packedOverlay);
    }
 
    @Override
    public void setRotationAngles(LivingEntity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch)
    {
        super.setRotationAngles(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch);
        this.helmet.copyModelAngles(this.bipedHead);
        this.chestplate.copyModelAngles(this.bipedBody);
        this.leftBoot.copyModelAngles(this.bipedLeftLeg);
        this.rightBoot.copyModelAngles(this.bipedRightLeg);
    }

    
    public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z)
    {
        modelRenderer.rotateAngleX = x;
        modelRenderer.rotateAngleY = y;
        modelRenderer.rotateAngleZ = z;
    }
}

 

Link to comment
Share on other sites

Just to make sure, does it animate correctly?

If it does, then the way I fixed the problem you are having was by going in to tabula(what I used instead of blockbench) and opening up the player model. Then, make all of your parts childs of the player model. e.g. make helmet a child of the head. Once it is like that you should re align all of your parts so they are in the right place before removing them as children (even if it looks wrong) and deleting the player model from it and then exporting the model and doing the rest again.

Link to comment
Share on other sites

Quote

Fun fact about global and local ModelRenderers: If you make a global ModelRenderer a child of some other model, it will render twice! So, for every ModelRenderer you add, you need to make them local variables within your constructor to prevent that. Also, you shouldn't need to copyModelAngles if they are a child of the parent ModelRenderer.

 

Okay so if I understand correctly, this.bipedHead is the global ModelRenderer and helmet is the child, but you said I was suppose to make the local ModelRenderer local variables within the constructor. However I need to access them for the rendering part. What did I get wrong ?

Link to comment
Share on other sites

Okay so basically, if I get the render function like this :

@Override
	public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
		helmet.render(matrixStack, buffer, packedLight, packedOverlay);
		chestplate.render(matrixStack, buffer, packedLight, packedOverlay);
		rightBoot.render(matrixStack, buffer, packedLight, packedOverlay);
		leftBoot.render(matrixStack, buffer, packedLight, packedOverlay);
	}

then it does render properly but the animations do not work.

And if I get the render function like this :

@Override
public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
	super.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
}

then the animations work but the the texture are totally mixed (see screenshot below)


image.png.c2e0967fdc0cc3f854a7ab509a58901d.png

 

 

 

42 minutes ago, ChampionAsh5357 said:

You shouldn't need to call them from the render part. If they are attached to a child, they get added via super.render(); There should be no reason to access a child anywhere outside the constructor.

In all the 'tutorials' I've seen, people enable / disable the models within getArmorModel function in the armor class like this:

model.helmet.showModel = armorSlot == EquipmentSlotType.HEAD;
model.chestplate.showModel = armorSlot == EquipmentSlotType.CHEST;
model.rightSleeve.showModel = armorSlot == EquipmentSlotType.CHEST;
model.leftSleeve.showModel = armorSlot == EquipmentSlotType.CHEST;
model.rightLegging.showModel = armorSlot == EquipmentSlotType.LEGS;
model.leftLegging.showModel = armorSlot == EquipmentSlotType.LEGS;
model.rightBoot.showModel = armorSlot == EquipmentSlotType.FEET;
model.leftBoot.showModel = armorSlot == EquipmentSlotType.FEET;

Should I not do it like that ?

Link to comment
Share on other sites

Hmm. Well then here's a thing. With the current system you have, it doesn't really support the method of local ModelRenderers. There are two ways to do it. Either remove the addChild tags and correct the model locations yourself with what you had before my previous message or redo the entire thing.

 

I'm going to assume you're just gonna remove the addChild tags. From there you just need to fix the box locations which is easy enough to do.

Link to comment
Share on other sites

To be honest moving them manually is way too hard, some of the pieces are tilted and it seems that they move according to their local rotation so.. I forfeit on that.
I'm willing to redo the entire thing because I prefer having something clean rather than twiking some values to cheat on the render.

Could you explain how to implement your local ModelRenderers method regarding 'setRotationAngles', 'render' and the constructor ?
If I get it right, I should only have the ModelRenderer variables declared within the constructor (otherwise they would magicaly be detected and rendered twice if I understood correctly) but then I have to change the .showModel boolean also in the constructor ?
Thank you!

Link to comment
Share on other sites

So here is what I get now (on an armorstand)
image.thumb.png.5368ab5453f1e84c504903641639d698.png


As you can see the textures seem heavily shifted.

 

image.thumb.png.2d789288aae420520d0e3378ad325bb1.png

 

Here is the corresponding code :

 

public class BronzeArmorModel extends BipedModel<LivingEntity> {
	
	public BronzeArmorModel(float size) {
		super(size, 0, 64, 64);
		
		ModelRenderer helmet;
		ModelRenderer chestplate;
		ModelRenderer ChestBtmPiece_R;
		ModelRenderer ChestBtmPiece_L;
		ModelRenderer rightBoot;
		ModelRenderer rightBootTop;
		ModelRenderer leftBoot;
		ModelRenderer leftBootTop;
		
		helmet = new ModelRenderer(this);
		helmet.setRotationPoint(0.0F, 0.0F, 0.0F);
		helmet.setTextureOffset(0, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.51F, false);
		helmet.setTextureOffset(0, 16).addBox(-4.0F, -8.5F, -4.0F, 8.0F, 1.0F, 8.0F, 0.45F, false);

		chestplate = new ModelRenderer(this);
		chestplate.setRotationPoint(0.0F, 5.3625F, 0.0F);
		chestplate.setTextureOffset(32, 0).addBox(-4.0F, -5.3625F, -2.0F, 8.0F, 11.0F, 4.0F, 0.28F, true);
		chestplate.setTextureOffset(40, 20).addBox(-2.0F, 6.0875F, -2.0F, 4.0F, 1.0F, 4.0F, 0.29F, false);

		ChestBtmPiece_R = new ModelRenderer(this);
		ChestBtmPiece_R.setRotationPoint(-1.5F, 4.6375F, 0.0F);
		chestplate.addChild(ChestBtmPiece_R);
		setRotationAngle(ChestBtmPiece_R, 0.0F, 0.0F, 0.2618F);
		ChestBtmPiece_R.setTextureOffset(12, 41).addBox(-2.3F, 1.55F, -2.0F, 2.0F, 1.0F, 4.0F, 0.29F, false);

		ChestBtmPiece_L = new ModelRenderer(this);
		ChestBtmPiece_L.setRotationPoint(1.5F, 4.6375F, 0.0F);
		chestplate.addChild(ChestBtmPiece_L);
		setRotationAngle(ChestBtmPiece_L, 0.0F, 0.0F, -0.2618F);
		ChestBtmPiece_L.setTextureOffset(0, 41).addBox(0.3F, 1.55F, -2.0F, 2.0F, 1.0F, 4.0F, 0.29F, false);

		rightBoot = new ModelRenderer(this);
		rightBoot.setRotationPoint(-2.0F, 21.0F, 0.0F);
		rightBoot.setTextureOffset(28, 15).addBox(-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, false);
		rightBoot.setTextureOffset(24, 41).addBox(-2.0F, -2.0F, -2.5F, 4.0F, 4.0F, 1.0F, 0.0F, false);

		rightBootTop = new ModelRenderer(this);
		rightBootTop.setRotationPoint(0.0F, -1.5F, -1.5F);
		rightBoot.addChild(rightBootTop);
		setRotationAngle(rightBootTop, 0.1745F, 0.0F, 0.0F);
		rightBootTop.setTextureOffset(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 2.0F, 1.0F, 0.0F, false);

		leftBoot = new ModelRenderer(this);
		leftBoot.setRotationPoint(2.0F, 21.0F, 0.0F);
		leftBoot.setTextureOffset(28, 15).addBox(-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, true);
		leftBoot.setTextureOffset(24, 41).addBox(-2.0F, -2.0F, -2.5F, 4.0F, 4.0F, 1.0F, 0.0F, true);

		leftBootTop = new ModelRenderer(this);
		leftBootTop.setRotationPoint(0.0F, -1.5F, -1.5F);
		leftBoot.addChild(leftBootTop);
		setRotationAngle(leftBootTop, 0.1745F, 0.0F, 0.0F);
		leftBootTop.setTextureOffset(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 2.0F, 1.0F, 0.0F, true);

		bipedHead.addChild(helmet);
		bipedBody.addChild(chestplate);
		bipedLeftLeg.addChild(leftBoot);
		bipedRightLeg.addChild(rightBoot);
	}

	@Override
	public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
		super.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
	}

	public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
		modelRenderer.rotateAngleX = x;
		modelRenderer.rotateAngleY = y;
		modelRenderer.rotateAngleZ = z;
	}
}

 

public class BronzeArmor extends ArmorItem
{

	public BronzeArmor(IArmorMaterial materialIn, EquipmentSlotType slot) {
		super(materialIn, slot, new Item.Properties().group(ModSetup.######_GROUP));
	}
	
	@SuppressWarnings("unchecked")
    @Nullable
    @Override
    public <A extends BipedModel<?>> A getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, A _default)
	{
		BronzeArmorModel model = new BronzeArmorModel(1.0F);
		
		model.bipedHead.showModel = armorSlot == EquipmentSlotType.HEAD;
		model.bipedHeadwear.showModel = false;
		model.bipedBody.showModel = armorSlot == EquipmentSlotType.CHEST;
		model.bipedLeftArm.showModel = false;
		model.bipedRightArm.showModel = false;
		model.bipedRightLeg.showModel = armorSlot == EquipmentSlotType.FEET;
		model.bipedLeftLeg.showModel = armorSlot == EquipmentSlotType.FEET;
		
        model.isChild = _default.isChild;
        model.isSitting = _default.isSitting;
        model.isSneak = _default.isSneak;
        model.rightArmPose = _default.rightArmPose;
        model.leftArmPose = _default.leftArmPose;
       
        return (A) model;
	}
	
    @Nullable
    @Override
    public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) {
        return "######:textures/models/armor/bronze_armor.png";
    }
}

 

Edited by Obeeron
Link to comment
Share on other sites

The armor in the top 64x32 will be rendered automatically since that is where the original overlay is. The only thing you should be rendering is anything not already in the 64x32 biped model space. I also just opened up your texture file. The mapping is going to be very wrong. A file size of 841x326 does not scale down to 64x32. It differs by a factor of .5 resulting in the half texture offset you see before you.

Link to comment
Share on other sites

2 hours ago, ChampionAsh5357 said:

The armor in the top 64x32 will be rendered automatically since that is where the original overlay is. The only thing you should be rendering is anything not already in the 64x32 biped model space. I also just opened up your texture file. The mapping is going to be very wrong. A file size of 841x326 does not scale down to 64x32. It differs by a factor of .5 resulting in the half texture offset you see before you.

This isn't the texture, it's a screenshot of the texture oppened in Photoshop.
The original texture is 64*64 as I mentionned in the model constructor 

super(size, 0, 64, 64);


Here is the real texture :
bronze_armor.png.d010a341ba252a4055ead81562753cca.png

So should I move the custom model texture outside the 64*32 ?
 

Edited by Obeeron
Link to comment
Share on other sites

But it's the same issue as before? The top half of the texture is 64x25, 7 pixels short of the default 64x32. The default biped model renders the 64x32 area as its texture. Anything you add "must" be below that 64x32 area if you dont want it interfering in the default model. (I put must in quotations because there is some empty space throughout the model you could use).

Link to comment
Share on other sites

Yup it's the same, it's because the one from my previous message was a screenshot for making it bigger on the screen.
Okay so correct me if I'm wrong, the top half 64*32 part of the texture is a default area used by the bipedModel. If I want to make an armorModel texture I should get into consideration some kind of template to avoid interfering with it (what template should I use ? an armor one ?). The parts of my armor that align with this basic template could have their texture on it. However the different armor parts that differ from a vanilla armor model should have their texture outside the 64*32 (or within the few empty space).

Also, why does the boots render correctly and below the player ._.  

Link to comment
Share on other sites

57 minutes ago, Obeeron said:

(what template should I use ? an armor one ?)

Yeah. The default armor model uses that 64x32 area. If you are constructing a texture that doesn't specific change the default model of the armor, then it would be applied just like any other armor texture.

 

57 minutes ago, Obeeron said:

Also, why does the boots render correctly and below the player ._.  

I believe that has to do with the double child model and a case of lucky mistakes.

 

9 hours ago, Obeeron said:

-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, true

When declaring the width, height, or depth of your model, it adjusts the scale of the texture needed to be wrapped. In the example I took from you, a width and height of 5.0 and 4.0 are fine. However, .26 is not so much. Even though in the tabula it will look normal, Minecraft will actually take your image, scale it up, and reference it as if it was literally 0.26 instead of what tabula outputs. So in your case, to have a correctly mapped texture, it would need to be scaled up to 6400x3200 to correctly map those decimal values.

 

Also, a model with a size of 0.0 will not render anything. I believe it needs at least a 0.005 thickness to stop flickering.

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • The future of Bitcoin recovery is a topic of great interest and excitement, particularly with the emergence of innovative companies like Dexdert Net Pro Recovery leading the charge. As the cryptocurrency market continues to evolve and face new challenges, the need for effective solutions to help users recover lost or stolen Bitcoin has become increasingly critical. Dexdert Net Pro, a specialized firm dedicated to this very purpose, has positioned itself at the forefront of this emerging field. Through their proprietary techniques and deep expertise in blockchain technology, Dexdert Net Pro has developed a comprehensive approach to tracking down and retrieving misplaced or compromised Bitcoin, providing a lifeline to individuals and businesses who have fallen victim to the inherent risks of the digital currency landscape. Their team of seasoned investigators and cryptography experts employ a meticulous, multi-pronged strategy, leveraging advanced data analysis, forensic techniques, and collaborative partnerships with law enforcement to painstakingly trace the movement of lost or stolen coins, often recovering funds that would otherwise be considered irrecoverable. This pioneering work not only restores financial assets but also helps to bolster confidence and trust in the long-term viability of Bitcoin, cementing Dexdert Net Pro role as a crucial player in shaping the future of cryptocurrency recovery and security. As the digital finance ecosystem continues to evolve, the importance of innovative solutions like those offered by Dexdert Net Pro will only grow, ensuring that users can navigate the complexities of Bitcoin with greater peace of mind and protection. Call Dexdert Net Pro now     
    • I'm developing a dimension, but it's kinda resource intensive so some times during player teleporting it lags behind making the player phase down into the void, so im trying to implement some kind of pregeneration to force the game loading a small set of chunks in the are the player will teleport to. Some of the things i've tried like using ServerLevel and ServerChunkCache methods like getChunk() dont actually trigger chunk generation if the chunk isn't already on persistent storage (already generated) or placing tickets, but that doesn't work either. Ideally i should be able to check when the task has ended too. I've peeked around some pregen engines, but they're too complex for my current understanding of the system of which I have just a basic understanding (how ServerLevel ,ServerChunkCache  and ChunkMap work) of. Any tips or other classes I should be looking into to understand how to do this correctly?
    • https://mclo.gs/4UC49Ao
    • Way back in the Forge 1.17 days, work started for adding JPMS (Java Platform Module Support) to ModLauncher and ForgeModLoader. This has been used internally by Forge and some libraries for a while now, but mods (those with mods.toml specifically) have not been able to take advantage of it. As of Forge 1.21.1 and 1.21.3, this is now possible!   What is JPMS and what does it mean for modders? JPMS is the Java Platform Module System, introduced in Java 9. It allows you to define modules, which are collections of packages and resources that can be exported or hidden from other modules. This allows for much more fine-tuned control over visibility, cleaner syntax for service declarations and support for sealed types across packages. For example, you might have a mod with a module called `com.example.mod` that exports `com.example.mod.api` and `com.example.mod.impl` to other mods, but hides `com.example.mod.internal` from them. This would allow you to have a clean API for other mods to use, while keeping your internal implementation details hidden from IDE hints, helping prevent accidental usage of internals that might break without prior notice. This is particularly useful if you'd like to use public records with module-private constructors or partially module-private record components, as you can create a sealed interface that only your record implements, having the interface be exported and the record hidden. It's also nice for declaring and using services, as you'll get compile-time errors from the Java compiler for typos and the like, rather than deferring to runtime errors. In more advanced cases, you can also have public methods that are only accessible to specific other modules -- handy if you want internal interactions between multiple of your own mods.   How do I bypass it? We understand there may be drama in implementing a system that prevents mods from accessing each other's internals when necessary (like when a mod is abandoned or you need to fix a compat issue) -- after all, we are already modding a game that doesn't have explicit support for Java mods yet. We have already thought of this and are offering APIs from day one to selectively bypass module restrictions. Let me be clear: Forge mods are not required to use JPMS. If you don't want to use it, you don't have to. The default behaviour is to have fully open, fully exported automatic modules. In Java, you can use the `Add-Opens` and `Add-Exports` manifest attributes to selectively bypass module restrictions of other mods at launch time, and we've added explicit support for these when loading your Forge mods. At compile-time, you can use existing solutions such as the extra-java-module-info Gradle plugin to deal with non-modular dependencies and add extra opens and exports to other modules. Here's an example on how to make the internal package `com.example.examplemod.internal` open to your mod in your build.gradle: tasks.named('jar', Jar) { manifest { attributes([ 'Add-Opens' : 'com.example.examplemod/com.example.examplemod.internal' 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors // (...) ]) } } With the above in your mod's jar manifest, you can now reflectively access the classes inside that internal package. Multiple entries are separated with a space, as per Java's official spec. You can also use Add-Exports to directly call without reflection, however you'd need to use the Gradle plugin mentioned earlier to be able to compile. The syntax for Add-Exports is the same as Add-Opens, and instructions for the compile-time step with the Gradle plugin are detailed later in this post. Remember to prefer the opens and exports keywords inside module-info.java for sources you control. The Add-Opens/Add-Exports attributes are only intended for forcing open other mods.   What else is new with module support? Previously, the runtime module name was always forced to the first mod ID in your `mods.toml` file and all packages were forced fully open and exported. Module names are now distinguished from mod IDs, meaning the module name in your module-info.java can be different from the mod ID in your `mods.toml`. This allows you to have a more descriptive module name that doesn't have to be the same as your mod ID, however we strongly recommend including your mod ID as part of your module name to aid troubleshooting. The `Automatic-Module-Name` manifest attribute is now also honoured, allowing you to specify a module name for your mod without needing to create a `module-info.java` file. This is particularly useful for mods that don't care about JPMS features but want to have a more descriptive module name and easier integration with other mods that do use JPMS.   How do I use it? The first step is to create a `module-info.java` file in your mod's source directory. This file should be in the same package as your main mod class, and should look something like this: open module com.example.examplemod { requires net.minecraftforge.eventbus; requires net.minecraftforge.fmlcore; requires net.minecraftforge.forge; requires net.minecraftforge.javafmlmod; requires net.minecraftforge.mergetool.api; requires org.slf4j; requires logging; } For now, we're leaving the whole module open to reflection, which is a good starting point. When we know we want to close something off, we can remove the open modifier from the module and open or export individual packages instead. Remember that you need to be open to Forge (module name net.minecraftforge.forge), otherwise it can't call your mod's constructor. Next is fixing modules in Gradle. While Forge and Java support modules properly, Gradle does not put automatic modules on the module path by default, meaning that the logging module (from com.mojang:logging) is not found. To fix this, add the Gradle plugin and add a compile-time module definition for that Mojang library: plugins { // (...) id 'org.gradlex.extra-java-module-info' version "1.9" } // (...) extraJavaModuleInfo { failOnMissingModuleInfo = false automaticModule("com.mojang:logging", "logging") } The automatic module override specified in your build.gradle should match the runtime one to avoid errors. You can do the same for any library or mod dependency that is missing either a module-info or explicit Automatic-Module-Name, however be aware that you may need to update your mod once said library adds one. That's all you need to get started with module support in your mods. You can learn more about modules and how to use them at dev.java.
    • Faire la mise à jour grâce à ce lien m'a aider personnellement, merci à @Paint_Ninja. https://www.amd.com/en/support 
  • Topics

×
×
  • Create New...

Important Information

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