Generalize checks for EquipmentType
Jackiecrazy opened this issue ยท 4 comments
as isShield is a vanilla function, it may be desirable for some mods to not extend ShieldItem for their shields, simply returning true for isShield(). These items are usable as shields in virtually every shape and form, but cannot receive shield affixes. Attempting to add them as entries has Apotheosis complain of an invalid item type. The new version appears to also randomly freeze my world, could invalid or nonexistent entries do that? I registered items from some mods that were eventually removed. What about technically valid combinations such as registering a stick or a sword that doesn't extend SwordItem as a sword?
The way it currently is implemented that check can be changed to isShield from instanceof (though that's a forge patch, not a vanilla function).
The checks for axe/pickaxe/shovel can probably also be changed from instanceof to a tooltype check. The check for armor has to be an instanceof, as ArmorItem holds the information about the slot type. Every bow/crossbow should be at least extending ShootableItem.
Technically anything can be a sword, so at the very least things maybe should default to swords.
Sounds about fair to me, it'll help with failed registration attempts as well.
Still having trouble with "swords" that aren't swords, like Greek Fantasy's spears, a large number of Dungeons Gear weapons, and Mowzie's Mobs' naga fang dagger.