Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Armor Model not working


Adam1223
 Share

Recommended Posts

Recently i decided to make some armor and after a long time i finally got it in the game but the model is not loading... can anybody help?

 

Here is my code for making the ruby armor material, i believe at the top where it says ":ruby" is telling minecraft where to pull the model from, not sure tho. 

public enum ModArmorMaterial implements IArmorMaterial {

    rubyMaterial(Zenox.Mod_ID + ":ruby", 5, new int[] { 7, 9, 11, 7 }, 420, SoundEvents.field_226124_Y_, 6.9F, () -> {
        return Ingredient.fromItems(RegistryHandler.testitem);  });


    private static final int[] MAX_DAMAGE_ARRAY = new int[] { 16, 16, 16, 16 };
    String name;
    int maxDamageFactor;
    int[] damageReductionAmountArray;
    int enchantability;
    SoundEvent soundEvent;
    float toughness;
    LazyValue<Ingredient> repairMaterial;

   private ModArmorMaterial(String nameIn, int maxDamageFactorIn, int[] damageReductionAmountIn,
                     int enchantabilityIn, SoundEvent soundEventIn, float toughnessIn,
                     Supplier<Ingredient> repairMaterialIn) {
        this.name = nameIn;
        this.maxDamageFactor = maxDamageFactorIn;
        this.damageReductionAmountArray = damageReductionAmountIn;
        this.enchantability = enchantabilityIn;
        this.soundEvent = soundEventIn;
        this.toughness = toughnessIn;
        this.repairMaterial = new LazyValue<>(repairMaterialIn);
    }

    @Override
    public int getDurability(EquipmentSlotType slotIn) {
        return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor;
    }

    @Override
    public int getDamageReductionAmount(EquipmentSlotType slotIn) {
        return this.damageReductionAmountArray[slotIn.getIndex()];
    }

    @Override
    public int getEnchantability() {
        return this.enchantability;
    }

    @Override
    public SoundEvent getSoundEvent() {
        return this.soundEvent;
    }

    @Override
    public Ingredient getRepairMaterial() {
        return this.repairMaterial.getValue();
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public float getToughness() {
        return this.toughness;
    }
}

 

 

And here is me making all the specific armor pieces (not sure if its needed but might as well add it.


        event.getRegistry().register(new ArmorItem(ModArmorMaterial.rubyMaterial, EquipmentSlotType.HEAD,
                new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName("ruby_helmet"));

        event.getRegistry().register(new ArmorItem(ModArmorMaterial.rubyMaterial, EquipmentSlotType.CHEST,
                new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName("ruby_chest_plate"));

        event.getRegistry().register(new ArmorItem(ModArmorMaterial.rubyMaterial, EquipmentSlotType.LEGS,
                new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName("ruby_leggings"));

        event.getRegistry().register(new ArmorItem(ModArmorMaterial.rubyMaterial, EquipmentSlotType.FEET,
                new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName("ruby_boots"));

 

 

and finally as you can see the files are tehre...

image.thumb.png.719710835d5911c023e57056ce882ff1.png

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.

Guest
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.