From 70085eabad74fabbe0d2ab57fbb9b060d99b65d6 Mon Sep 17 00:00:00 2001 From: yuanlu <2573580691@qq.com> Date: Tue, 16 Dec 2025 00:29:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E8=AF=91=20CustomModelDataComponent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuanlu <2573580691@qq.com> --- .../components/CustomModelDataComponent.java | 54 ++++++++++++++++--- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/BukkitApi/org/bukkit/inventory/meta/components/CustomModelDataComponent.java b/BukkitApi/org/bukkit/inventory/meta/components/CustomModelDataComponent.java index e8fc9771..ac888a33 100644 --- a/BukkitApi/org/bukkit/inventory/meta/components/CustomModelDataComponent.java +++ b/BukkitApi/org/bukkit/inventory/meta/components/CustomModelDataComponent.java @@ -7,68 +7,106 @@ import org.jetbrains.annotations.NotNull; /** + * 代表一个用于添加自定义模型数据的组件. + *

+ * 译注:该组件用于为物品指定更复杂的客户端模型替换规则,替代旧版简单的整数型 customModelData。 + * 它可以定义基于范围(range_dispatch)、条件(condition)、选择(select)等不同模型类型的参数。 + *

+ * 原文: * Represents a component which adds custom model data. */ @ApiStatus.Experimental public interface CustomModelDataComponent extends ConfigurationSerializable { /** + * 获取用于范围分发模型类型的浮点数列表. + *

+ * 译注:范围分发(range_dispatch)模型类型允许客户端根据浮点数值选择不同的模型,常用于如耐久度百分比等连续值。 + *

+ * 原文: * Gets a list of the floats for the range_dispatch model type. * - * @return unmodifiable list + * @return 不可修改的列表 */ @NotNull List getFloats(); /** + * 设置用于范围分发模型类型的浮点数列表. + *

+ * 原文: * Sets a list of the floats for the range_dispatch model type. * - * @param floats new list + * @param floats 新的浮点数列表 */ void setFloats(@NotNull List floats); /** + * 获取用于条件模型类型的布尔值列表. + *

+ * 译注:条件(condition)模型类型根据布尔值(true/false)来选择模型,例如物品是否被附魔、是否有特定NBT标签等。 + *

+ * 原文: * Gets a list of the booleans for the condition model type. * - * @return unmodifiable list + * @return 不可修改的列表 */ @NotNull List getFlags(); /** + * 设置用于条件模型类型的布尔值列表. + *

+ * 原文: * Sets a list of the booleans for the condition model type. * - * @param flags new list + * @param flags 新的布尔值列表 */ void setFlags(@NotNull List flags); /** + * 获取用于选择模型类型的字符串列表. + *

+ * 译注:选择(select)模型类型根据字符串键从一组预定义模型中选择,常用于如不同变体(颜色、材质)的物品。 + *

+ * 原文: * Gets a list of strings for the select model type. * - * @return unmodifiable list + * @return 不可修改的列表 */ @NotNull List getStrings(); /** + * 设置用于选择模型类型的字符串列表. + *

+ * 原文: * Sets a list of strings for the select model type. * - * @param strings new list + * @param strings 新的字符串列表 */ void setStrings(@NotNull List strings); /** + * 获取用于模型类型色调的颜色列表. + *

+ * 译注:此颜色列表用于对模型应用色调覆盖,例如为同一模型的不同实例染上不同颜色。 + *

+ * 原文: * Gets a list of colors for the model type's tints. * - * @return unmodifiable list + * @return 不可修改的列表 */ @NotNull List getColors(); /** + * 设置用于模型类型色调的颜色列表. + *

+ * 原文: * Sets a list of colors for the model type's tints. * - * @param colors new list + * @param colors 新的颜色列表 */ void setColors(@NotNull List colors); }