Hex Casting

Hex Casting

7M Downloads

Certain addons cause casting item names to break

Robotgiggle opened this issue ยท 2 comments

commented

Minecraft version

1.20.1

Hex Casting version

0.11.2-pre-729

Issue description

When certain addons are installed, something in the lang breaks and Cyphers, Trinkets, and Artifacts all get the name item.minecraft.air.

Image

They still function perfectly fine, and no other items (including Ancient Cyphers) seem to be affected.

Addons known to cause this issue include:

  • Caduceus
  • Complex Hex
  • Hexcassettes
  • Hex Machina

Addons known to not cause this issue include:

  • Hexcellular
  • Hexical
  • Hexportation
  • Hexpose
  • Hextended staves
  • Hierophantics
  • MoreIotas
  • Slate works

Steps to reproduce

  1. Install one of the addons in the list above alongside the latest dev build of hex
  2. Observe that cyphers, trinkets, and artifacts are now incorrectly named
commented

We can probably fix this by just making OpMakePackagedSpell take Supplier<Component> instead of Component.

commented

UPDATE: this problem was introduced in bff340d

The cause is as follows:

  • That commit reworks the functionality of OpMakePackagedSpell a little
  • The new version gets the description of what casting item you're trying to make (ie for use in the expected X in your offhand but got nothing error message) by calling the getDescription() method on the relevant casting item type as defined in HexItems
  • However, this code itself is located in HexActions
  • Base hex initializes HexItems before HexActions, so there's normally no issues, but if an addon's initializer tries to access HexActions before HexItems, then the getDescription() method gets called on an unitialized item
  • Which, apparently, results in that item's lang blowing up
  • The reason it only happens with a few addons is that to trigger the issue, the addon needs to be initialized before base hex - so it needs to be alphabetically before hexcasting