接口 EnchantmentLevelLangPatch
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
An API to patch the language file of Minecraft, resource packs and mods.
- 另请参阅:
-
方法概要
修饰符和类型方法说明static @Nullable StringintToRoman(@org.jetbrains.annotations.Range(from=1L, to=3998L) int num) Provides an algorithm for int-to-roman translation.static voidregisterEnchantmentPatch(@NotNull String 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 String id, @NotNull EnchantmentLevelLangPatch edition) Register an extra rendering syntax for potion potency.static intromanToInt(@NotNull String s) 已过时。this method won't be used, and it does not have a regex check, which would cause unknown error.
-
方法详细资料
-
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- 另请参阅:
-
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.- 参数:
num- the number you want to convert to roman format- 返回:
nullifnumis out of range.
-
romanToInt
已过时。this method won't be used, and it does not have a regex check, which would cause unknown error.Provides an algorithm for roman-to-int translation.- 参数:
s- the roman number that you want to convert toint.- 返回:
- the corresponding
intvalue. Ifsis invalid, then a wrong thing will be returned.
-
registerEnchantmentPatch
static void registerEnchantmentPatch(@NotNull @NotNull String 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.- 参数:
id- aResourceLocationof your patch. Must match the standard of aResourceLocation:^([0-9a-z_\-]+:)?[0-9a-z_\-/]+$edition- the patch- 另请参阅:
-
EnchantmentLevelLangPatchConfig.setCurrentEnchantmentHooks(xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch)registerPatch(java.util.function.Predicate<java.lang.String>, xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch)registerPotionPatch(java.lang.String, xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch)
-
registerPotionPatch
static void registerPotionPatch(@NotNull @NotNull String 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.- 参数:
id- aResourceLocationof your patch. Must match the standard of aResourceLocation:^([0-9a-z_\-]+:)?[0-9a-z_\-/]+$edition- the patch- 另请参阅:
-
EnchantmentLevelLangPatchConfig.setCurrentPotionHooks(xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch)registerPatch(java.util.function.Predicate<java.lang.String>, xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch)registerEnchantmentPatch(java.lang.String, xland.mcmod.enchlevellangpatch.api.EnchantmentLevelLangPatch)
-
apply
The function forEnchantmentLevelLangPatch
API Note: param 1 isMap, notImmutableMap. We use aggressive way to prevent memory issues, which may cause compatibility issues with 1.0-mods.- 参数:
translationStorage- an unmodifiable wrapping of the current key-translation mapkey- the provided translation key when thispatchis applied.- 返回:
- the translation (value) you modify.
-