Class ItemTranslator
java.lang.Object
org.geysermc.geyser.translator.inventory.item.ItemTranslator
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinitiongetBedrockItemDefinition(GeyserSession session, GeyserItemStack itemStack)Given an item stack, determine the Bedrock item definition that should be applied to Bedrock players.static voidtranslateCustomItem(com.github.steveice10.opennbt.tag.builtin.CompoundTag nbt, org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.Builder builder, ItemMapping mapping)Translates the custom model data of an itemstatic com.github.steveice10.opennbt.tag.builtin.CompoundTagtranslateDisplayProperties(GeyserSession session, com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, ItemMapping mapping)Translates the display name of the itemstatic com.github.steveice10.opennbt.tag.builtin.CompoundTagtranslateDisplayProperties(GeyserSession session, com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, ItemMapping mapping, char translationColor)static org.cloudburstmc.nbt.NbtMaptranslateNbtToBedrock(com.github.steveice10.opennbt.tag.builtin.CompoundTag tag)static org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.BuildertranslateToBedrock(GeyserSession session, int javaId, int count, com.github.steveice10.opennbt.tag.builtin.CompoundTag tag)static org.cloudburstmc.protocol.bedrock.data.inventory.ItemDatatranslateToBedrock(GeyserSession session, com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack stack)static com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStacktranslateToJava(org.cloudburstmc.protocol.bedrock.data.inventory.ItemData data, ItemMappings mappings)static com.github.steveice10.opennbt.tag.builtin.CompoundTagtranslateToJavaNBT(String name, org.cloudburstmc.nbt.NbtMap tag)
-
Method Details
-
translateToJava
public static com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack translateToJava(org.cloudburstmc.protocol.bedrock.data.inventory.ItemData data, ItemMappings mappings)- Parameters:
mappings- item mappings to use while translating. This can't just be a Geyser session as this method is used when loading recipes.
-
translateToBedrock
@Nonnull public static org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.Builder translateToBedrock(GeyserSession session, int javaId, int count, com.github.steveice10.opennbt.tag.builtin.CompoundTag tag) -
translateToBedrock
@Nonnull public static org.cloudburstmc.protocol.bedrock.data.inventory.ItemData translateToBedrock(GeyserSession session, com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack stack) -
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. -
translateNbtToBedrock
public static org.cloudburstmc.nbt.NbtMap translateNbtToBedrock(com.github.steveice10.opennbt.tag.builtin.CompoundTag tag) -
translateToJavaNBT
public static com.github.steveice10.opennbt.tag.builtin.CompoundTag translateToJavaNBT(String name, org.cloudburstmc.nbt.NbtMap tag) -
translateDisplayProperties
public static com.github.steveice10.opennbt.tag.builtin.CompoundTag translateDisplayProperties(GeyserSession session, com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, ItemMapping mapping)Translates the display name of the item- Parameters:
session- the Bedrock client's sessiontag- the tag to translatemapping- the item entry, in case it requires translation- Returns:
- the new tag to use, should the current one be null
-
translateDisplayProperties
public static com.github.steveice10.opennbt.tag.builtin.CompoundTag translateDisplayProperties(GeyserSession session, com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, ItemMapping mapping, char translationColor)- 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(com.github.steveice10.opennbt.tag.builtin.CompoundTag nbt, org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.Builder builder, ItemMapping mapping)Translates the custom model data of an item
-