BarchamMal / MC-Extended

A Fabric Minecraft mod that aims to extend Minecraft in a way so as to keep the vanilla feel.
MIT License
2 stars 0 forks source link

[1.21] Tools and weapons don't show default modifiers #17

Closed kwpugh closed 1 month ago

kwpugh commented 1 month ago

Normally weapons and tools show modifiers Screenshot 2024-07-26 at 8 37 04 AM

Yours do not Screenshot 2024-07-26 at 8 36 40 AM

BarchamMal commented 1 month ago

Huh! with this many bugs... I should have made it ALPHA I'll try to find what on earth causes this!

kwpugh commented 1 month ago

They changed the way tools and weapons are registered.

I tweaked yours to look like this Screenshot 2024-07-26 at 11 58 07 AM

I added baseAttackDamage of 3 since your sword was only giving attack damage of 4 on ruby sword.

example code: public static final Item RUBY_SWORD = new SwordItem(INSTANCE, (new Item.Settings()).attributeModifiers(SwordItem.createAttributeModifiers(INSTANCE, 3, -2.4F)));

kwpugh commented 1 month ago

Attack damage of 7 comes from:

1 (builtin by Minecraft) + 3 (from the material) + 3 (baseAttackDamage at register) = 7

BarchamMal commented 1 month ago

Thanks for this solution and all your help. Also, if you would like to speed things up, you could fork the repo and make a PR.

kwpugh commented 1 month ago

Some other thoughts.

it is not recommended to instantiate utility class public static final ArFoMiToVi AR_FO_MI_TO_VI = new ArFoMiToVi();

or to register items from an instance object AR_FO_MI_TO_VI.RegisterAll();

you can call you register methods directly from onInitialize() Minerals.RegisterAll(); Foods.RegisterAll(); Misc.RegisterAll(); ArmorMaterials.RegisterAll(); ToolMaterials.RegisterAll(); Villagers.RegisterAll(); Entities.RegisterAll();

Lastly, it is not a good idea to name classes the same as vanilla, such as ArmorMaterials and ToolMaterials

Keep up the hard work.

kwpugh commented 1 month ago

oh, one more thing.

Don't do this: public static final String NAMESPACE = "mc-extended";

do this: public static final String MC_EXTENDED = "mc-extended";

your mod id gets used throughout the game and messages get put into logs with the id. It should be unique to your mod, not generic.

BarchamMal commented 1 month ago

Yeah, if you did a thing or two (A PR or so) you'd be in the contributors... which I'd like, cause you've been very helpful.

BarchamMal commented 1 month ago

Per your suggestions I'll change those... I thought I had a long time ago.

kwpugh commented 1 month ago

I'll let you manage your own code, I have 32 mods of my own to manage.