File tree Expand file tree Collapse file tree
Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,10 +26,13 @@ class MishapInvalidIota(
2626
2727 override fun errorMessage (ctx : CastingEnvironment , errorCtx : Context ): Component ? {
2828 val perpKey = HexIotaTypes .REGISTRY .getKey(perpetrator.getType())
29- val perpDesc = Component .translatableWithFallback(
30- " hexcasting.iota.${perpKey} .desc" ,
31- " hexcasting.mishap.invalid_value.class.${perpKey?.getPath()} "
32- )
29+
30+ // this translation key is preferred because it includes the namespace
31+ var perpDesc = Component .translatableWithFallback(" hexcasting.iota.${perpKey} .desc" , " no desc found" )
32+ // for addons that don't implement the .desc key, grab the non-namespaced invalid_value key instead
33+ if (perpDesc.getString() == " no desc found" )
34+ perpDesc = Component .translatable(" hexcasting.mishap.invalid_value.class.${perpKey?.getPath()} " )
35+
3336 return error(
3437 " invalid_value" , expected, reverseIdx,
3538 perpDesc, perpetrator.display()
You can’t perform that action at this time.
0 commit comments