Class ItemEnchantments
java.lang.Object
net.minecraft.world.item.enchantment.ItemEnchantments
- All Implemented Interfaces:
TooltipProvider
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<ItemEnchantments> static final ItemEnchantments
(package private) final it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap
<Holder<Enchantment>> private static final com.mojang.serialization.Codec
<ItemEnchantments> private static final com.mojang.serialization.Codec
<Integer> private static final com.mojang.serialization.Codec
<it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Holder<Enchantment>>> static final int
(package private) final boolean
static final StreamCodec
<RegistryFriendlyByteBuf, ItemEnchantments> -
Constructor Summary
ConstructorDescriptionItemEnchantments
(it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Holder<Enchantment>> p_341287_, boolean p_330219_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToTooltip
(Item.TooltipContext p_341290_, Consumer<Component> p_331119_, TooltipFlag p_330400_) Set
<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Holder<Enchantment>>> entrySet()
boolean
int
getLevel
(Enchantment p_330552_) private static <T> HolderSet
<T> getTagOrEmpty
(HolderLookup.Provider p_341186_, ResourceKey<Registry<T>> p_341113_, TagKey<T> p_341409_) int
hashCode()
boolean
isEmpty()
keySet()
int
size()
toString()
withTooltip
(boolean p_335616_)
-
Field Details
-
EMPTY
-
MAX_LEVEL
public static final int MAX_LEVEL- See Also:
-
LEVEL_CODEC
-
LEVELS_CODEC
private static final com.mojang.serialization.Codec<it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Holder<Enchantment>>> LEVELS_CODEC -
FULL_CODEC
-
CODEC
-
STREAM_CODEC
-
enchantments
-
showInTooltip
final boolean showInTooltip
-
-
Constructor Details
-
ItemEnchantments
ItemEnchantments(it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Holder<Enchantment>> p_341287_, boolean p_330219_)
-
-
Method Details
-
getLevel
-
addToTooltip
public void addToTooltip(Item.TooltipContext p_341290_, Consumer<Component> p_331119_, TooltipFlag p_330400_) - Specified by:
addToTooltip
in interfaceTooltipProvider
-
getTagOrEmpty
private static <T> HolderSet<T> getTagOrEmpty(@Nullable HolderLookup.Provider p_341186_, ResourceKey<Registry<T>> p_341113_, TagKey<T> p_341409_) -
withTooltip
-
keySet
-
entrySet
-
size
public int size() -
isEmpty
public boolean isEmpty() -
equals
-
hashCode
public int hashCode() -
toString
-