Class BannerTranslator
java.lang.Object
org.geysermc.geyser.translator.inventory.item.ItemTranslator
org.geysermc.geyser.translator.inventory.item.BannerTranslator
-
Field Summary
Modifier and TypeFieldDescriptionstatic com.github.steveice10.opennbt.tag.builtin.ListTag
Holds what a Java ominous banner pattern looks like.Fields inherited from class org.geysermc.geyser.translator.inventory.item.ItemTranslator
ITEM_STACK_TRANSLATORS, NBT_TRANSLATORS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.nukkitx.nbt.NbtList<com.nukkitx.nbt.NbtMap>
convertBannerPattern(com.github.steveice10.opennbt.tag.builtin.ListTag patterns)
Convert a list of patterns from Java nbt to Bedrock nbtstatic com.github.steveice10.opennbt.tag.builtin.ListTag
convertBannerPattern(List<com.nukkitx.nbt.NbtMap> patterns)
Convert a list of patterns from Bedrock nbt to Java nbtstatic com.nukkitx.nbt.NbtMap
getBedrockBannerPattern(com.github.steveice10.opennbt.tag.builtin.CompoundTag pattern)
Convert the Java edition banner pattern nbt to Bedrock edition, null if the pattern doesn't existstatic com.github.steveice10.opennbt.tag.builtin.CompoundTag
getJavaBannerPattern(com.nukkitx.nbt.NbtMap pattern)
Convert the Bedrock edition banner pattern nbt to Java editioncom.nukkitx.protocol.bedrock.data.inventory.ItemData.Builder
translateToBedrock(com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack itemStack, ItemMapping mapping, ItemMappings mappings)
com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack
translateToJava(com.nukkitx.protocol.bedrock.data.inventory.ItemData itemData, ItemMapping mapping, ItemMappings mappings)
Methods inherited from class org.geysermc.geyser.translator.inventory.item.ItemTranslator
equals, init, translateDisplayProperties, translateDisplayProperties, translateNbtToBedrock, translateToBedrock, translateToJava, translateToJavaNBT
-
Field Details
-
OMINOUS_BANNER_PATTERN
public static final com.github.steveice10.opennbt.tag.builtin.ListTag OMINOUS_BANNER_PATTERNHolds what a Java ominous banner pattern looks like. Translating the patterns over to Bedrock does not work effectively, but Bedrock has a dedicated type for ominous banners that we set instead. This variable is used to detect Java ominous banner patterns, and apply the correct ominous banner pattern if Bedrock pulls the item from creative.
-
-
Constructor Details
-
BannerTranslator
public BannerTranslator()
-
-
Method Details
-
convertBannerPattern
public static com.nukkitx.nbt.NbtList<com.nukkitx.nbt.NbtMap> convertBannerPattern(com.github.steveice10.opennbt.tag.builtin.ListTag patterns)Convert a list of patterns from Java nbt to Bedrock nbt- Parameters:
patterns
- The patterns to convert- Returns:
- The new converted patterns
-
getBedrockBannerPattern
public static com.nukkitx.nbt.NbtMap getBedrockBannerPattern(com.github.steveice10.opennbt.tag.builtin.CompoundTag pattern)Convert the Java edition banner pattern nbt to Bedrock edition, null if the pattern doesn't exist- Parameters:
pattern
- Java edition pattern nbt- Returns:
- The Bedrock edition format pattern nbt
-
convertBannerPattern
public static com.github.steveice10.opennbt.tag.builtin.ListTag convertBannerPattern(List<com.nukkitx.nbt.NbtMap> patterns)Convert a list of patterns from Bedrock nbt to Java nbt- Parameters:
patterns
- The patterns to convert- Returns:
- The new converted patterns
-
getJavaBannerPattern
public static com.github.steveice10.opennbt.tag.builtin.CompoundTag getJavaBannerPattern(com.nukkitx.nbt.NbtMap pattern)Convert the Bedrock edition banner pattern nbt to Java edition- Parameters:
pattern
- Bedrock edition pattern nbt- Returns:
- The Java edition format pattern nbt
-
translateToBedrock
public com.nukkitx.protocol.bedrock.data.inventory.ItemData.Builder translateToBedrock(com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack itemStack, ItemMapping mapping, ItemMappings mappings)- Overrides:
translateToBedrock
in classItemTranslator
-
translateToJava
public com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack translateToJava(com.nukkitx.protocol.bedrock.data.inventory.ItemData itemData, ItemMapping mapping, ItemMappings mappings)- Overrides:
translateToJava
in classItemTranslator
-
getAppliedItems
- Specified by:
getAppliedItems
in classItemTranslator
-