枚举 Enchantment.Rarity

  • 所有已实现的接口:
    Serializable, Comparable<Enchantment.Rarity>
    封闭类:
    Enchantment

    public static enum Enchantment.Rarity
    extends Enum<Enchantment.Rarity>
    The rarity is an attribute of an enchantment.

    It affects the chance of getting an enchantment from enchanting or loots as well as the combination cost in anvil.

    Mappings:
    Namespace Name
    official btl$a
    intermediary net/minecraft/class_1887$class_1888
    named net/minecraft/enchantment/Enchantment$Rarity
    • 枚举常量详细资料

      • COMMON

        public static final Enchantment.Rarity COMMON
        Mappings:
        Namespace Name Mixin selector
        official a Lbtl$a;a:Lbtl$a;
        intermediary field_9087 Lnet/minecraft/class_1887$class_1888;field_9087:Lnet/minecraft/class_1887$class_1888;
        named COMMON Lnet/minecraft/enchantment/Enchantment$Rarity;COMMON:Lnet/minecraft/enchantment/Enchantment$Rarity;
      • UNCOMMON

        public static final Enchantment.Rarity UNCOMMON
        Mappings:
        Namespace Name Mixin selector
        official b Lbtl$a;b:Lbtl$a;
        intermediary field_9090 Lnet/minecraft/class_1887$class_1888;field_9090:Lnet/minecraft/class_1887$class_1888;
        named UNCOMMON Lnet/minecraft/enchantment/Enchantment$Rarity;UNCOMMON:Lnet/minecraft/enchantment/Enchantment$Rarity;
      • RARE

        public static final Enchantment.Rarity RARE
        Mappings:
        Namespace Name Mixin selector
        official c Lbtl$a;c:Lbtl$a;
        intermediary field_9088 Lnet/minecraft/class_1887$class_1888;field_9088:Lnet/minecraft/class_1887$class_1888;
        named RARE Lnet/minecraft/enchantment/Enchantment$Rarity;RARE:Lnet/minecraft/enchantment/Enchantment$Rarity;
      • VERY_RARE

        public static final Enchantment.Rarity VERY_RARE
        Mappings:
        Namespace Name Mixin selector
        official d Lbtl$a;d:Lbtl$a;
        intermediary field_9091 Lnet/minecraft/class_1887$class_1888;field_9091:Lnet/minecraft/class_1887$class_1888;
        named VERY_RARE Lnet/minecraft/enchantment/Enchantment$Rarity;VERY_RARE:Lnet/minecraft/enchantment/Enchantment$Rarity;
    • 字段详细资料

      • weight

        private final int weight
        Mappings:
        Namespace Name Mixin selector
        official e Lbtl$a;e:I
        intermediary field_9089 Lnet/minecraft/class_1887$class_1888;field_9089:I
        named weight Lnet/minecraft/enchantment/Enchantment$Rarity;weight:I
    • 构造器详细资料

      • Rarity

        private Rarity​(int weight)
        Mappings:
        Namespace Name Mixin selector
        official <init> Lbtl$a;<init>(Ljava/lang/String;II)V
        intermediary <init> Lnet/minecraft/class_1887$class_1888;<init>(Ljava/lang/String;II)V
        named <init> Lnet/minecraft/enchantment/Enchantment$Rarity;<init>(Ljava/lang/String;II)V
    • 方法详细资料

      • values

        public static Enchantment.Rarity[] values()
        按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:
        for (Enchantment.Rarity c : Enchantment.Rarity.values())
            System.out.println(c);
        
        返回:
        按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
      • valueOf

        public static Enchantment.Rarity valueOf​(String name)
        返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)
        参数:
        name - 要返回的枚举常量的名称。
        返回:
        返回带有指定名称的枚举常量
        抛出:
        IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量
        NullPointerException - 如果参数为空值
      • getWeight

        public int getWeight()
        Returns the weight of an enchantment in weighted pickers.
        Mappings:
        Namespace Name Mixin selector
        official a Lbtl$a;a()I
        intermediary method_8197 Lnet/minecraft/class_1887$class_1888;method_8197()I
        named getWeight Lnet/minecraft/enchantment/Enchantment$Rarity;getWeight()I