Class BannerTranslator

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

public class BannerTranslator extends ItemTranslator
  • Field Details

    • OMINOUS_BANNER_PATTERN

      public static final com.github.steveice10.opennbt.tag.builtin.ListTag OMINOUS_BANNER_PATTERN
      Holds 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 class ItemTranslator
    • 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 class ItemTranslator
    • getAppliedItems

      public List<ItemMapping> getAppliedItems()
      Specified by:
      getAppliedItems in class ItemTranslator