Class ItemEnchantments
java.lang.Object
net.minecraft.world.item.enchantment.ItemEnchantments
- All Implemented Interfaces:
TooltipProvider
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ItemEnchantments> static final ItemEnchantmentsprivate final it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Holder<Enchantment>> private static final com.mojang.serialization.Codec<Integer> static final StreamCodec<RegistryFriendlyByteBuf, ItemEnchantments> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateItemEnchantments(it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Holder<Enchantment>> enchantments) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToTooltip(Item.TooltipContext context, Consumer<Component> consumer, TooltipFlag flag, DataComponentGetter components) Set<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Holder<Enchantment>>> entrySet()booleanintgetLevel(Holder<Enchantment> enchantment) private static <T> HolderSet<T> getTagOrEmpty(@Nullable HolderLookup.Provider registries, ResourceKey<Registry<T>> registry, TagKey<T> tag) inthashCode()booleanisEmpty()keySet()intsize()toString()
-
Field Details
-
EMPTY
-
LEVEL_CODEC
-
CODEC
-
STREAM_CODEC
-
enchantments
-
-
Constructor Details
-
ItemEnchantments
private ItemEnchantments(it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Holder<Enchantment>> enchantments)
-
-
Method Details
-
getLevel
-
addToTooltip
public void addToTooltip(Item.TooltipContext context, Consumer<Component> consumer, TooltipFlag flag, DataComponentGetter components) - Specified by:
addToTooltipin interfaceTooltipProvider
-
getTagOrEmpty
private static <T> HolderSet<T> getTagOrEmpty(@Nullable HolderLookup.Provider registries, ResourceKey<Registry<T>> registry, TagKey<T> tag) -
keySet
-
entrySet
-
size
public int size() -
isEmpty
public boolean isEmpty() -
equals
-
hashCode
-
toString
-