接口 EnchantmentLevelLangPatch
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
An API to patch the language file of Minecraft, resource packs and mods.
-
方法概要
修饰符和类型方法说明The function forEnchantmentLevelLangPatchstatic @Nullable StringintToRoman(@org.jetbrains.annotations.Range(from=1L, to=3998L) int num)Provides an algorithm for int-to-roman translation.static voidregisterEnchantmentPatch(@NotNull net.minecraft.util.Identifier id, @NotNull EnchantmentLevelLangPatch edition)Register an extra rendering syntax for enchantment levels.static voidregisterPatch(@NotNull Predicate<String> keyPredicate, @NotNull EnchantmentLevelLangPatch edition)Register language patch for any language item you want.static voidregisterPotionPatch(@NotNull net.minecraft.util.Identifier id, @NotNull EnchantmentLevelLangPatch edition)Register an extra rendering syntax for potion potency.static intromanToInt(@NotNull String s)Provides an algorithm for roman-to-int translation.
-
方法详细资料
-
registerPatch
static void registerPatch(@NotNull @NotNull Predicate<String> keyPredicate, @NotNull @NotNull EnchantmentLevelLangPatch edition)Register language patch for any language item you want.- 参数:
keyPredicate- Predicate for the language key. Iftrue, applyeditionto the corresponding language item.edition- The patch for the corresponding language item- 另请参阅:
registerEnchantmentPatch(Identifier, EnchantmentLevelLangPatch),registerPotionPatch(Identifier, EnchantmentLevelLangPatch)
-
intToRoman
@Nullable static @Nullable String intToRoman(@org.jetbrains.annotations.Range(from=1L, to=3998L) int num)Provides an algorithm for int-to-roman translation. Thanks youdiaodaxue16.- 返回:
nullifnumis out of range.
-
romanToInt
Provides an algorithm for roman-to-int translation. -
registerEnchantmentPatch
static void registerEnchantmentPatch(@NotNull @NotNull net.minecraft.util.Identifier id, @NotNull @NotNull EnchantmentLevelLangPatch edition)Register an extra rendering syntax for enchantment levels.
Won't be applied without an extension library that invokesEnchantmentLevelLangPatchConfig.setCurrentEnchantmentHooks(xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch), which modifies current enchantment level patch.- 另请参阅:
EnchantmentLevelLangPatchConfig.setCurrentEnchantmentHooks(xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch),registerPatch(java.util.function.Predicate<java.lang.String>, xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch),registerPotionPatch(net.minecraft.util.Identifier, xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch)
-
registerPotionPatch
static void registerPotionPatch(@NotNull @NotNull net.minecraft.util.Identifier id, @NotNull @NotNull EnchantmentLevelLangPatch edition)Register an extra rendering syntax for potion potency.
Won't be applied without an extension library that invokesEnchantmentLevelLangPatchConfig.setCurrentPotionHooks(xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch)which modifies current potion potency patch.- 另请参阅:
EnchantmentLevelLangPatchConfig.setCurrentPotionHooks(xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch),registerPatch(java.util.function.Predicate<java.lang.String>, xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch),registerEnchantmentPatch(net.minecraft.util.Identifier, xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch)
-
apply
String apply(com.google.common.collect.ImmutableMap<String,String> translationStorage, String key)The function forEnchantmentLevelLangPatch- 参数:
translationStorage- a copy of the current key-translation mapkey- the provided translation key when thispatchis applied.- 返回:
- the translation (value) you modify.
-