Balkon's WeaponMod: Legacy

Balkon's WeaponMod: Legacy

103k Downloads

No Ignore Armor attribute outside of vanilla weapons

IcarussOne opened this issue ยท 1 comments

commented

Every vanilla battle axe has a +1 Ignore Armor attribute except this is not applied to extra battleaxes that are added using the same item builder, all other attributes are applied to the weapons as normal. Changing attributes like knockback, reach, reload time, etc more easily without making new classes would also be appreciated! :)

commented

Every vanilla battle axe has a +1 Ignore Armor attribute except this is not applied to extra battleaxes that are added using the same item builder

You are right. This was something I wanted to remove, but apparently forgot... It's a limitation that was already present in the original BWM, actually. Will fix in the next minor update!

Changing attributes like knockback, reach, reload time, etc more easily without making new classes would also be appreciated! :)

This on the other hand is not as easy to fix, sadly. Especially in 1.21, the attributes must be known before the item is constructed. Hence, I added this weird AbstractWeaponComponent#setAttributes function, which can be overridden for such cases.
Instead of creating new classes explicitly, you could also just create an anonymous class - still ugly and still another class, but at least it can be constructed rather inline.
I don't see another way to provide a better API yet - of course apart from creating 1000 constructors and/or factory functions, which would make BWM: Legacy's codebase ugly instead.
If you have some idea, let me know maybe (or even create a PR) and I will reconsider my choices :)