Class ItemTranslator

java.lang.Object
org.geysermc.geyser.translator.item.ItemTranslator

public final class ItemTranslator extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NonNull org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition
    Given an item stack, determine the Bedrock item definition that should be applied to Bedrock players.
    static String
    getCustomName(GeyserSession session, org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, ItemMapping mapping, char translationColor, boolean customNameOnly, boolean includeAll)
     
    static String
    getPotionEffectInfo(org.geysermc.mcprotocollib.protocol.data.game.item.component.PotionContents contents, String language)
     
    static String
    getPotionName(org.geysermc.mcprotocollib.protocol.data.game.item.component.PotionContents contents, ItemMapping mapping, String language)
     
    static void
    translateCustomItem(GeyserSession session, int stackSize, org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.Builder builder, ItemMapping mapping)
    Translates the custom model data of an item
    static @NonNull org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.Builder
    translateToBedrock(GeyserSession session, int javaId, int count, org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components)
     
    static @NonNull org.cloudburstmc.protocol.bedrock.data.inventory.ItemData
     
    static @NonNull org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.Builder
    translateToBedrock(GeyserSession session, Item javaItem, ItemMapping bedrockItem, int count, @Nullable org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents customComponents)
     
    static @NonNull org.cloudburstmc.protocol.bedrock.data.inventory.ItemData
    translateToBedrock(GeyserSession session, org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack stack)
     
    static org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack
    translateToJava(GeyserSession session, org.cloudburstmc.protocol.bedrock.data.inventory.ItemData data)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • translateToJava

      public static org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack translateToJava(GeyserSession session, org.cloudburstmc.protocol.bedrock.data.inventory.ItemData data)
    • translateToBedrock

      public static @NonNull org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.Builder translateToBedrock(GeyserSession session, int javaId, int count, org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components)
    • translateToBedrock

      public static @NonNull org.cloudburstmc.protocol.bedrock.data.inventory.ItemData translateToBedrock(GeyserSession session, org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack stack)
    • translateToBedrock

      public static @NonNull org.cloudburstmc.protocol.bedrock.data.inventory.ItemData translateToBedrock(GeyserSession session, @NonNull GeyserItemStack stack)
    • translateToBedrock

      public static @NonNull org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.Builder translateToBedrock(GeyserSession session, Item javaItem, ItemMapping bedrockItem, int count, @Nullable org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents customComponents)
    • getPotionEffectInfo

      public static String getPotionEffectInfo(org.geysermc.mcprotocollib.protocol.data.game.item.component.PotionContents contents, String language)
    • getPotionName

      public static String getPotionName(org.geysermc.mcprotocollib.protocol.data.game.item.component.PotionContents contents, ItemMapping mapping, String language)
    • getBedrockItemDefinition

      public static @NonNull org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition getBedrockItemDefinition(GeyserSession session, @NonNull GeyserItemStack itemStack)
      Given an item stack, determine the Bedrock item definition that should be applied to Bedrock players.
    • getCustomName

      public static String getCustomName(GeyserSession session, org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, ItemMapping mapping, char translationColor, boolean customNameOnly, boolean includeAll)
      Parameters:
      translationColor - if this item is not available on Java, the color that the new name should be. Normally, this should just be white, but for shulker boxes this should be gray.
    • translateCustomItem

      public static void translateCustomItem(GeyserSession session, int stackSize, org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.Builder builder, ItemMapping mapping)
      Translates the custom model data of an item