Interface EnchantmentLevelLangPatch.WithFallback

All Superinterfaces:
EnchantmentLevelLangPatch
Enclosing interface:
EnchantmentLevelLangPatch
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface EnchantmentLevelLangPatch.WithFallback extends EnchantmentLevelLangPatch

An EnchantmentLevelLangPatch that receives a fallback string.

This should be used when your patch is only applied in Minecraft 1.19.4+, as the patch will be ignored when the fallback string is absent.

Example:
    EnchantmentLevelLangPatch.registerPatch(
        key -> key.startsWith("example.prefix."),
        EnchantmentLevelLangPatch.withFallback((storage, key, fallback) -> Example.hook(key, fallback))
    )