Skip to content

Conversation

Robotgiggle
Copy link
Contributor

@Robotgiggle Robotgiggle commented Oct 10, 2025

image image

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Hex Casting Oct 10, 2025
@object-Object object-Object linked an issue Oct 10, 2025 that may be closed by this pull request
override fun errorMessage(ctx: CastingEnvironment, errorCtx: Context) =
error(
override fun errorMessage(ctx: CastingEnvironment, errorCtx: Context): Component? {
val typeStr = HexIotaTypes.REGISTRY.getKey(perpetrator.getType())?.getPath();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a huge fan of this; what if two mods add iota types with the same path?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's currently set up this way because the hexcasting.mishap.invalid_value.class.<type> lang keys already exist (for use in the old version of MishapInvalidIota) with exactly the string that's needed for this part of the message, and are already used by basically every addon. The alternative would be to make a completely new set of lang keys for this based on the full ResourceLocation, but that would A) require writing out effectively the exact same strings twice for every iota type and B) require every addon to update their lang to do so as well in order to support this version of the base mod.

I agree that it's not a perfect solution, but I can't really think of a better one that doesn't introduce other issues as described above. If you have one in mind though, please let me know!

On another note, two addons that use the same path will likely run into issues regardless of this change, since using the MishapInvalidIota.ofType() method requires defining a hexcasting.mishap.invalid_value.class.<type> lang key for your iota type, and those will conflict with each other anyway unless one of them uses a type name in the lang that isn't the same as the identifier path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋 Backlog

Development

Successfully merging this pull request may close these issues.

Add small type blurb to iota expected mishaps

2 participants