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_329796_, boolean p_331323_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToTooltip
(Item.TooltipContext p_332503_, Consumer<Component> p_333731_, TooltipFlag p_332196_) Set
<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Holder<Enchantment>>> entrySet()
boolean
int
getLevel
(Enchantment p_334964_) private static <T> HolderSet
<T> getTagOrEmpty
(HolderLookup.Provider p_327799_, ResourceKey<Registry<T>> p_330565_, TagKey<T> p_327764_) int
hashCode()
boolean
isEmpty()
keySet()
int
size()
toString()
withTooltip
(boolean p_333031_)
-
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_329796_, boolean p_331323_)
-
-
Method Details
-
getLevel
-
addToTooltip
public void addToTooltip(Item.TooltipContext p_332503_, Consumer<Component> p_333731_, TooltipFlag p_332196_) - Specified by:
addToTooltip
in interfaceTooltipProvider
-
getTagOrEmpty
private static <T> HolderSet<T> getTagOrEmpty(@Nullable HolderLookup.Provider p_327799_, ResourceKey<Registry<T>> p_330565_, TagKey<T> p_327764_) -
withTooltip
-
keySet
-
entrySet
-
size
public int size() -
isEmpty
public boolean isEmpty() -
equals
-
hashCode
public int hashCode() -
toString
-