Posted August 29, 20205 yr I am making a custom armor material for my armor but it seems to break no matter what i do. If I enter func_230304f() as a class method, it complains about the lack of getKnockbackResistence(), and vice versa. The error message is also confusing, saying ABTier is not abstract and does not override abstract method getKnockbackResistance() in IArmorMaterial To my knowledge, IArmorMaterial has no method called getKnockbackResistence(). If I include both, It throws a ClassFormatError for duplicate methods on startup. What should I do? Here is the code for my armor item tier: public enum ABTier implements IArmorMaterial { BOMBSHIRT("bombshirt", 80, new int[] {2, 2, 2, 2}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F, 0.5F, null); private static final int[] MAX_DAMAGE_ARRAY = new int[]{9, 10, 12, 13}; private final String name; private final int maxDamageFactor; private final int[] damageReductionAmountArray; private final int enchantability; private final SoundEvent soundEvent; private final float toughness; private final float knockbackResistance; private final Lazy<Ingredient> repairMaterialLazy; private ABTier(String nameIn, int maxDamageFactorIn, int[] damageReductionAmountArrayIn, int enchantabilityIn, SoundEvent soundEventIn, float toughnessIn, float knockbackResistanceIn, Supplier<Ingredient> repairMaterialSupplier) { this.name = Main.MODID + ":" + nameIn; this.maxDamageFactor = maxDamageFactorIn; this.damageReductionAmountArray = damageReductionAmountArrayIn; this.enchantability = enchantabilityIn; this.soundEvent = soundEventIn; this.toughness = toughnessIn; this.knockbackResistance = knockbackResistanceIn; this.repairMaterialLazy = Lazy.concurrentOf(repairMaterialSupplier); } @Override public int getDurability(EquipmentSlotType slotIn) { return 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.repairMaterialLazy.get(); } @OnlyIn(Dist.CLIENT) public String getName() { return this.name; } @Override public float getToughness() { return this.toughness; } public float func_230304_f_() { return this.knockbackResistance; } public float getKnockbackResistance() { return this.knockbackResistance; } }
August 29, 20205 yr What's your current mappings version? Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
August 30, 20205 yr With the current mappings you have, the function is called getKnockbackResistance() ...you just need to add that one, and override it (@Override) Edited August 30, 20205 yr by Beethoven92 Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
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.