Apotheosis

Apotheosis

70M Downloads

Generalize checks for EquipmentType

Jackiecrazy opened this issue ยท 4 comments

commented

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?

commented

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.

commented

Sounds about fair to me, it'll help with failed registration attempts as well.

commented

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.

commented

Plan is thus far to change swords to the last check, and just support anything with an attack damage bonus on it as a sword.