Package org.geysermc.geyser.util
Class ItemUtils
java.lang.Object
org.geysermc.geyser.util.ItemUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic intgetCorrectBedrockDurability(Item item, int original) static @Nullable net.kyori.adventure.text.ComponentgetCustomName(org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components) static intgetEnchantmentLevel(GeyserSession session, @Nullable org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, BedrockEnchantment bedrockEnchantment) Deprecated.static booleanhasEffect(GeyserSession session, @Nullable org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack itemStack, EnchantmentComponent component)
-
Method Details
-
getEnchantmentLevel
@Deprecated public static int getEnchantmentLevel(GeyserSession session, @Nullable org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, BedrockEnchantment bedrockEnchantment) Deprecated.Cheap hack. Proper solution is to read the enchantment effects. -
hasEffect
public static boolean hasEffect(GeyserSession session, @Nullable org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack itemStack, EnchantmentComponent component) -
getCorrectBedrockDurability
- Returns:
- the correct Bedrock durability for this item.
-
getCustomName
public static @Nullable net.kyori.adventure.text.Component getCustomName(org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components) - Parameters:
components- the data components of the item- Returns:
- the custom name of the item
-