ZsoltMolnarrr / Jewelry

💍 Find precious gems deep down, and craft them into powerful jewelry!
Other
3 stars 6 forks source link

AttributesResolver may run before all attributes are registered #9

Closed Partonetrain closed 6 months ago

Partonetrain commented 6 months ago

I can't use Zenith Attributes attributes for Jewelry. Example is below:

    "jewelry:netherite_ruby_ring": {
      "attributes": [
        {
          "id": "minecraft:generic.attack_damage",
          "value": 0.08,
          "operation": "MULTIPLY_BASE"
        },
        {
          "id": "zenith_attributes:crit_chance",
          "value": 0.08,
          "operation": "ADDITION"
        }
      ]
    },

Zenith Attributes registers its attributes on its ModInitializer, but trying to use its attributes in Items.json puts STDERR]: Failed to resolve EntityAttribute with id: zenith_attributes:[...] in the log.

AdditionalEntityAttributes does the same, but its attributes can be used just fine.

Spell Engine has an identical AttributesResolver so this is probably a problem there too

ZsoltMolnarrr commented 6 months ago

Currently there is no way to support third party attributes in a generic way, hence this issue is non actionable.

Anyone seeking compatibility, needs to implement it. The method for doing so is by mixin injecting to the bottom of AttributeResolver.setup https://github.com/ZsoltMolnarrr/Jewelry/blob/9103472e18e93cc039e3ac409a5f9dcaa072f4d4/src/main/java/net/jewelry/api/AttributeResolver.java#L35