Adds 1 mixin for ProjectileHelper and an additional injection (w/ shadow method) to LivingEntity.
Bow/Crossbow-using mobs use ProjectileHelper.getHandWith(Item) and LivingEntity.canEquip(Item), which isn't ideal if you want them to use a modded ranged weapon. This PR converts those hardcoded item checks into checking if an item is assignable from the class of the item passed in, serving as the equivalent of an instanceof check.
Forge already added field-to-instanceof transformers for the various other hardcoded item checks as needed so these are the only two changes required.
I also plan to submit a PR that adds the equivalent of this to Forge, so use this Mixin as a temporary fix until it possibly gets merged.
Adds 1 mixin for ProjectileHelper and an additional injection (w/ shadow method) to LivingEntity.
Bow/Crossbow-using mobs use ProjectileHelper.getHandWith(Item) and LivingEntity.canEquip(Item), which isn't ideal if you want them to use a modded ranged weapon. This PR converts those hardcoded item checks into checking if an item is assignable from the class of the item passed in, serving as the equivalent of an instanceof check.
Forge already added field-to-instanceof transformers for the various other hardcoded item checks as needed so these are the only two changes required.
I also plan to submit a PR that adds the equivalent of this to Forge, so use this Mixin as a temporary fix until it possibly gets merged.