Jump to content

Recommended Posts

Posted
  On 6/7/2021 at 8:07 PM, 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.

Expand  

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
  On 6/7/2021 at 8:56 PM, 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

 

Expand  

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

Posted (edited)
  On 6/7/2021 at 9:01 PM, Skullblade said:

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

Expand  

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
  On 6/7/2021 at 9:03 PM, 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?

Expand  

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

Posted
  On 6/7/2021 at 9:05 PM, Skullblade said:

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

Expand  

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

Posted (edited)
  On 6/7/2021 at 9:28 PM, Skullblade said:

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

Expand  

Put 

package com.skullblade.planeswalkermod.common.models;

at the start of your class

Edited by aritod
Posted
  On 6/7/2021 at 9:31 PM, aritod said:

Put 

package com.skullblade.planeswalkermod.common.models;

at the start of your class

Expand  

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

Posted
  On 6/7/2021 at 9:33 PM, Skullblade said:

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

Expand  

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

Posted
  On 6/7/2021 at 9:51 PM, Skullblade said:

That just makes it a .json again.

Expand  

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
  On 6/7/2021 at 11:14 PM, 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.

Expand  

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
  On 6/7/2021 at 11:22 PM, 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'

Expand  

 

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

Your model constructor needs a float

Posted
  On 6/7/2021 at 11:32 PM, aritod said:

 

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

Your model constructor needs a float

Expand  

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
  On 6/7/2021 at 11:36 PM, 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'.

Expand  

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
  On 6/8/2021 at 12:12 AM, 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?

Expand  

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

Posted
  On 6/8/2021 at 2:14 AM, aritod said:

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

Expand  

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!

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.