Jump to content

Recommended Posts

Posted
44 minutes ago, aritod said:

Ok. I was doing something wrong. Sorry. What you actually need to do is the following (PS: Delete the .json file):

1. Create a custom armor class for each piece of armor that extends ArmorItem 


public class ArgentumHelmet extends ArmorItem

2. Override getArmorModel and getArmorTexture


    @Nullable
    @Override
    public <A extends BipedModel<?>> A getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, A _default) {
        return null;
    }

    @Nullable
    @Override
    public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) {
        return null;
    }

3. Export your armor model as a Java class and put it in your project

4. Return an instance of your Model Class to getArmorModel()


                YourModelObject model = new YourModelObject();
                model.bipedHeadwear.showModel = armorSlot == EquipmentSlotType.HEAD;

                model.isChild = _default.isChild;
                model.isSneak = _default.isSneak;
                model.isSitting = _default.isSitting;
                model.rightArmPose = _default.rightArmPose;
                model.leftArmPose = _default.leftArmPose;

                return (A) model;

5. Return texture in getArmorTexture()


return "modid:textures/models/armor/texture.png";

6. Instantiate your custom model class instead of ArmorItem when creating your armor piece


...new ArmorItem(...);

To

...new ArgentumHelmet(...);

Repeat for all other pieces

 

Got this from this thread:

If this doesn't work then I suggest doing your own research.

Part of the problem is that the thread you looked at is outdated. Minecraft swapped the names of a majority of their methods in 1.16, which is why I specified the specific update in this thread's title. All of the steps worked except for #4, and I believe that's because the methods are mcp, and not Mojang. The Linkie bot in the Linkie server couldn't even translate the methods.

Attached is the broken part of ArgentumChestplate's code.

image.thumb.png.cc5398c85225975581d2ed81cbb1d41f.png

 

Posted
1 minute ago, Skullblade said:

Part of the problem is that the thread you looked at is outdated. Minecraft swapped the names of a majority of their methods in 1.16, which is why I specified the specific update in this thread's title. All of the steps worked except for #4, and I believe that's because the methods are mcp, and not Mojang. The Linkie bot in the Linkie server couldn't even translate the methods.

Attached is the broken part of ArgentumChestplate's code.

image.thumb.png.cc5398c85225975581d2ed81cbb1d41f.png

 

This might be the case but you are instantiating the ArgentumChestplate class, instead of ArgentumChestplateModel class.

Posted
2 minutes ago, aritod said:

This might be the case but you are instantiating the ArgentumChestplate class, instead of ArgentumChestplateModel class.

It won't even let me import the ArgentumChestplateModel class.

Posted (edited)
3 minutes ago, Skullblade said:

It won't even let me import the ArgentumChestplateModel class.

Uhh I'm not exactly sure what you are doing. Did you export your model as a java class and put in under src/main/java/...? Is the name of your model class ArgentumChestplateModel? You are supposed to instantiate your model class.

Edited by aritod
Posted
Just now, aritod said:

Uhh I'm not exactly sure what you are doing. Did you export your model as a java class and put in under src/main/java/...? Is the name of your model class ArgentumChestplateModel?

The model class is named ArgentumChestplateModel.java, and it's located in src/main/java/com/skullblade/planeswalkermod/common/models.

Posted
1 minute ago, Skullblade said:

The model class is named ArgentumChestplateModel.java, and it's located in src/main/java/com/skullblade/planeswalkermod/common/models.

Then I'm not sure why you wouldn't be able to import it. Can you show the class?

Posted
1 minute ago, aritod said:

Then I'm not sure why you wouldn't be able to import it. Can you show the class?

Sure. I'm not sure why, but ArgentumChestplateModel is riddled with errors.

image.thumb.png.7558c67cf2522c3ad4e5085d45ed303f.png

image.thumb.png.15c2eb3d6861f920ed248320d4c1a667.png

 

Posted
8 minutes ago, Skullblade said:

Sure. I'm not sure why, but ArgentumChestplateModel is riddled with errors.

image.thumb.png.7558c67cf2522c3ad4e5085d45ed303f.png

image.thumb.png.15c2eb3d6861f920ed248320d4c1a667.png

 

And what does it say when you hover over the class name which is underlined red...

Posted
2 minutes ago, aritod said:

And what does it say when you hover over the class name which is underlined red...

Missing package statement: 'com.skullblade.planeswalkermod.common.models'

Posted (edited)
4 minutes ago, Skullblade said:

Missing package statement: 'com.skullblade.planeswalkermod.common.models'

Put 

package com.skullblade.planeswalkermod.common.models;

at the start of your class

Edited by aritod
Posted
1 minute ago, aritod said:

Put 


package com.skullblade.planeswalkermod.common.models;

at the start of your class

Well, the class name ArgentumChestplateModel is no longer underlined in red, but everything else is brighter than a fire engine.

Posted
11 minutes ago, Skullblade said:

Well, the class name ArgentumChestplateModel is no longer underlined in red, but everything else is brighter than a fire engine.

I think you exported the model as an entity from blockbench, as your model class should extend BipedModel. Pick Block/Item this time.

Posted
1 minute ago, aritod said:

I think you exported the model as an entity from blockbench, as your model class should extend BipedModel. Pick Block/Item this time.

That just makes it a .json again.

Posted
1 hour ago, Skullblade said:

That just makes it a .json again.

Oh. Then extend BipedModel in your Model class and replace setTextureOffset() with texOffs(), textureWidth with texWidth, textureHeight with texHeight. Not sure about body.setRotationPoint() though.

Posted
6 minutes ago, aritod said:

Oh. Then extend BipedModel in your Model class and replace setTextureOffset() with texOffs(), textureWidth with texWidth, textureHeight with texHeight. Not sure about body.setRotationPoint() though.

I took a guess and it's .setPos for .setRotationPoint. The only issue left is this error from public ArgentumChestplateModel();

There is no default constructor available in 'net.minecraft.client.renderer.entity.model.BipedModel'

Posted
8 minutes ago, Skullblade said:

I took a guess and it's .setPos for .setRotationPoint. The only issue left is this error from public ArgentumChestplateModel();

There is no default constructor available in 'net.minecraft.client.renderer.entity.model.BipedModel'

 

    public ExampleConstructor(float i) {
        super(i);
	/.../
}

Your model constructor needs a float

Posted
1 minute ago, aritod said:

 


    public ExampleConstructor(float i) {
        super(i);
	/.../
}

Your model constructor needs a float

Sweet, now that's all fixed. In ArgentumChestplate.java, I'm able to replace ArgentumChestplate with ArgentumChestplateModel, but there's still a problem with the model.blank stuff. Each one except for model.rightArmPose and model.leftArmPose says 'can't resolve symbol'.

Posted
33 minutes ago, Skullblade said:

Sweet, now that's all fixed. In ArgentumChestplate.java, I'm able to replace ArgentumChestplate with ArgentumChestplateModel, but there's still a problem with the model.blank stuff. Each one except for model.rightArmPose and model.leftArmPose says 'can't resolve symbol'.

Hmm. I've been trying to look for a replacement for those but I'm not sure. Seems like there was a big change from 1.15 to 1.16. Try doing your own research maybe. Also, just curious. What exactly happens if you remove all the lines that have that error? Does the armor model partially work? Is there an error?

Posted
11 minutes ago, aritod said:

Hmm. I've been trying to look for a replacement for those but I'm not sure. Seems like there was a big change from 1.15 to 1.16. Try doing your own research maybe. Also, just curious. What exactly happens if you remove all the lines that have that error? Does the armor model partially work? Is there an error?

Deleting parts that are errored leads to more errors in other parts.

Posted
3 minutes ago, aritod said:

Delete line 23 to 27. When instantiating your ArgentumChestplateModel class, give it 1.0F as a parameter.

The armor works! I think I may have screwed up the model in blockbench, but now that I know how this stuff works, it'll be an easy fix. Thank you so much!

Posted
10 hours ago, Skullblade said:

The armor works! I think I may have screwed up the model in blockbench, but now that I know how this stuff works, it'll be an easy fix. Thank you so much!

No problem

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.