Class BannerBlockEntity

java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.BannerBlockEntity
All Implemented Interfaces:
Nameable

public class BannerBlockEntity extends BlockEntity implements Nameable
Mappings:
Namespace Name
official dgl
intermediary net/minecraft/class_2573
named net/minecraft/block/entity/BannerBlockEntity
  • Field Details

    • MAX_PATTERN_COUNT

      public static final int MAX_PATTERN_COUNT
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Ldgl;a:I
      intermediary field_31296 Lnet/minecraft/class_2573;field_31296:I
      named MAX_PATTERN_COUNT Lnet/minecraft/block/entity/BannerBlockEntity;MAX_PATTERN_COUNT:I
    • PATTERNS_KEY

      public static final String PATTERNS_KEY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Ldgl;b:Ljava/lang/String;
      intermediary field_31297 Lnet/minecraft/class_2573;field_31297:Ljava/lang/String;
      named PATTERNS_KEY Lnet/minecraft/block/entity/BannerBlockEntity;PATTERNS_KEY:Ljava/lang/String;
    • PATTERN_KEY

      public static final String PATTERN_KEY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official c Ldgl;c:Ljava/lang/String;
      intermediary field_31298 Lnet/minecraft/class_2573;field_31298:Ljava/lang/String;
      named PATTERN_KEY Lnet/minecraft/block/entity/BannerBlockEntity;PATTERN_KEY:Ljava/lang/String;
    • COLOR_KEY

      public static final String COLOR_KEY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official d Ldgl;d:Ljava/lang/String;
      intermediary field_31299 Lnet/minecraft/class_2573;field_31299:Ljava/lang/String;
      named COLOR_KEY Lnet/minecraft/block/entity/BannerBlockEntity;COLOR_KEY:Ljava/lang/String;
    • customName

      @Nullable private @Nullable Text customName
      Mappings:
      Namespace Name Mixin selector
      official e Ldgl;e:Lvf;
      intermediary field_11772 Lnet/minecraft/class_2573;field_11772:Lnet/minecraft/class_2561;
      named customName Lnet/minecraft/block/entity/BannerBlockEntity;customName:Lnet/minecraft/text/Text;
    • baseColor

      private DyeColor baseColor
      Mappings:
      Namespace Name Mixin selector
      official f Ldgl;f:Lclm;
      intermediary field_11774 Lnet/minecraft/class_2573;field_11774:Lnet/minecraft/class_1767;
      named baseColor Lnet/minecraft/block/entity/BannerBlockEntity;baseColor:Lnet/minecraft/util/DyeColor;
    • patternListNbt

      @Nullable private @Nullable NbtList patternListNbt
      Mappings:
      Namespace Name Mixin selector
      official g Ldgl;g:Lst;
      intermediary field_11773 Lnet/minecraft/class_2573;field_11773:Lnet/minecraft/class_2499;
      named patternListNbt Lnet/minecraft/block/entity/BannerBlockEntity;patternListNbt:Lnet/minecraft/nbt/NbtList;
    • patterns

      @Nullable private @Nullable List<com.mojang.datafixers.util.Pair<RegistryEntry<BannerPattern>,DyeColor>> patterns
      Mappings:
      Namespace Name Mixin selector
      official h Ldgl;h:Ljava/util/List;
      intermediary field_11769 Lnet/minecraft/class_2573;field_11769:Ljava/util/List;
      named patterns Lnet/minecraft/block/entity/BannerBlockEntity;patterns:Ljava/util/List;
  • Constructor Details

    • BannerBlockEntity

      public BannerBlockEntity(BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official <init> Ldgl;<init>(Lhx;Ldjh;)V
      intermediary <init> Lnet/minecraft/class_2573;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named <init> Lnet/minecraft/block/entity/BannerBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • BannerBlockEntity

      public BannerBlockEntity(BlockPos pos, BlockState state, DyeColor baseColor)
      Mappings:
      Namespace Name Mixin selector
      official <init> Ldgl;<init>(Lhx;Ldjh;Lclm;)V
      intermediary <init> Lnet/minecraft/class_2573;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_1767;)V
      named <init> Lnet/minecraft/block/entity/BannerBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/DyeColor;)V
  • Method Details

    • getPatternListNbt

      @Nullable public static @Nullable NbtList getPatternListNbt(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official a Ldgl;a(Lcmy;)Lst;
      intermediary method_24281 Lnet/minecraft/class_2573;method_24281(Lnet/minecraft/class_1799;)Lnet/minecraft/class_2499;
      named getPatternListNbt Lnet/minecraft/block/entity/BannerBlockEntity;getPatternListNbt(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/nbt/NbtList;
    • readFrom

      public void readFrom(ItemStack stack, DyeColor baseColor)
      Mappings:
      Namespace Name Mixin selector
      official a Ldgl;a(Lcmy;Lclm;)V
      intermediary method_10913 Lnet/minecraft/class_2573;method_10913(Lnet/minecraft/class_1799;Lnet/minecraft/class_1767;)V
      named readFrom Lnet/minecraft/block/entity/BannerBlockEntity;readFrom(Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/DyeColor;)V
    • readFrom

      public void readFrom(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official b Ldgl;b(Lcmy;)V
      intermediary method_38992 Lnet/minecraft/class_2573;method_38992(Lnet/minecraft/class_1799;)V
      named readFrom Lnet/minecraft/block/entity/BannerBlockEntity;readFrom(Lnet/minecraft/item/ItemStack;)V
    • getName

      public Text getName()
      Returns the name of this object.

      This should return the custom name if it exists, otherwise the default name. This should not have styling applied.

      Specified by:
      getName in interface Nameable
      Returns:
      the name of this object
      Mappings:
      Namespace Name Mixin selector
      official ad Lbkf;ad()Lvf;
      intermediary method_5477 Lnet/minecraft/class_1275;method_5477()Lnet/minecraft/class_2561;
      named getName Lnet/minecraft/util/Nameable;getName()Lnet/minecraft/text/Text;
    • getCustomName

      @Nullable public @Nullable Text getCustomName()
      Returns the custom name of this object, or null if there is none.
      Specified by:
      getCustomName in interface Nameable
      Returns:
      the custom name of this object, or null if there is none
      Mappings:
      Namespace Name Mixin selector
      official af Lbkf;af()Lvf;
      intermediary method_5797 Lnet/minecraft/class_1275;method_5797()Lnet/minecraft/class_2561;
      named getCustomName Lnet/minecraft/util/Nameable;getCustomName()Lnet/minecraft/text/Text;
    • setCustomName

      public void setCustomName(Text customName)
      Mappings:
      Namespace Name Mixin selector
      official a Ldgl;a(Lvf;)V
      intermediary method_16842 Lnet/minecraft/class_2573;method_16842(Lnet/minecraft/class_2561;)V
      named setCustomName Lnet/minecraft/block/entity/BannerBlockEntity;setCustomName(Lnet/minecraft/text/Text;)V
    • writeNbt

      protected void writeNbt(NbtCompound nbt)
      Writes data to nbt. Subclasses should override this if they store a persistent data.

      NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.

      Overrides:
      writeNbt in class BlockEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Ldgv;b(Lsn;)V
      intermediary method_11007 Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;)V
      named writeNbt Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;)V
    • readNbt

      public void readNbt(NbtCompound nbt)
      Reads data from nbt. Subclasses should override this if they store a persistent data.

      NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.

      nbt might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.

      Overrides:
      readNbt in class BlockEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Ldgv;a(Lsn;)V
      intermediary method_11014 Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;)V
      named readNbt Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;)V
    • toUpdatePacket

      public BlockEntityUpdateS2CPacket toUpdatePacket()
      Description copied from class: BlockEntity
      Returns the packet to send to nearby players when the block entity's observable state changes, or null to not send the packet.

      If the data returned by initial chunk data is suitable for updates, the following shortcut can be used to create an update packet: BlockEntityUpdateS2CPacket.create(this). The NBT will be passed to BlockEntity.readNbt(net.minecraft.nbt.NbtCompound) on the client.

      "Observable state" is a state that clients can observe without specific interaction. For example, CampfireBlockEntity's cooked items are observable states, but chests' inventories are not observable states, since the player must first open that chest before they can see the contents.

      To sync block entity data using this method, use serverWorld.getChunkManager().markForUpdate(this.getPos());.

      Overrides:
      toUpdatePacket in class BlockEntity
      Returns:
      the packet to send to nearby players when the block entity's observable state changes, or null to not send the packet
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Ldgl;a()Lzh;
      intermediary method_16886 Lnet/minecraft/class_2573;method_16886()Lnet/minecraft/class_2622;
      named toUpdatePacket Lnet/minecraft/block/entity/BannerBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
    • toInitialChunkDataNbt

      public NbtCompound toInitialChunkDataNbt()
      Returns the serialized state of this block entity that is observable by clients.

      This is sent alongside the initial chunk data, as well as when the block entity implements BlockEntity.toUpdatePacket() and decides to use the default BlockEntityUpdateS2CPacket.

      "Observable state" is a state that clients can observe without specific interaction. For example, CampfireBlockEntity's cooked items are observable states, but chests' inventories are not observable states, since the player must first open that chest before they can see the contents.

      To send all NBT data of this block entity saved to disk, return BlockEntity.createNbt().

      Overrides:
      toInitialChunkDataNbt in class BlockEntity
      Returns:
      the serialized state of this block entity that is observable by clients
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official ax_ Ldgv;ax_()Lsn;
      intermediary method_16887 Lnet/minecraft/class_2586;method_16887()Lnet/minecraft/class_2487;
      named toInitialChunkDataNbt Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt()Lnet/minecraft/nbt/NbtCompound;
    • getPatternCount

      public static int getPatternCount(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official c Ldgl;c(Lcmy;)I
      intermediary method_10910 Lnet/minecraft/class_2573;method_10910(Lnet/minecraft/class_1799;)I
      named getPatternCount Lnet/minecraft/block/entity/BannerBlockEntity;getPatternCount(Lnet/minecraft/item/ItemStack;)I
    • getPatterns

      public List<com.mojang.datafixers.util.Pair<RegistryEntry<BannerPattern>,DyeColor>> getPatterns()
      Mappings:
      Namespace Name Mixin selector
      official c Ldgl;c()Ljava/util/List;
      intermediary method_10911 Lnet/minecraft/class_2573;method_10911()Ljava/util/List;
      named getPatterns Lnet/minecraft/block/entity/BannerBlockEntity;getPatterns()Ljava/util/List;
    • getPatternsFromNbt

      public static List<com.mojang.datafixers.util.Pair<RegistryEntry<BannerPattern>,DyeColor>> getPatternsFromNbt(DyeColor baseColor, @Nullable @Nullable NbtList patternListNbt)
      Mappings:
      Namespace Name Mixin selector
      official a Ldgl;a(Lclm;Lst;)Ljava/util/List;
      intermediary method_24280 Lnet/minecraft/class_2573;method_24280(Lnet/minecraft/class_1767;Lnet/minecraft/class_2499;)Ljava/util/List;
      named getPatternsFromNbt Lnet/minecraft/block/entity/BannerBlockEntity;getPatternsFromNbt(Lnet/minecraft/util/DyeColor;Lnet/minecraft/nbt/NbtList;)Ljava/util/List;
    • loadFromItemStack

      public static void loadFromItemStack(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official d Ldgl;d(Lcmy;)V
      intermediary method_10905 Lnet/minecraft/class_2573;method_10905(Lnet/minecraft/class_1799;)V
      named loadFromItemStack Lnet/minecraft/block/entity/BannerBlockEntity;loadFromItemStack(Lnet/minecraft/item/ItemStack;)V
    • getPickStack

      public ItemStack getPickStack()
      Mappings:
      Namespace Name Mixin selector
      official f Ldgl;f()Lcmy;
      intermediary method_10907 Lnet/minecraft/class_2573;method_10907()Lnet/minecraft/class_1799;
      named getPickStack Lnet/minecraft/block/entity/BannerBlockEntity;getPickStack()Lnet/minecraft/item/ItemStack;
    • getColorForState

      public DyeColor getColorForState()
      Mappings:
      Namespace Name Mixin selector
      official g Ldgl;g()Lclm;
      intermediary method_10908 Lnet/minecraft/class_2573;method_10908()Lnet/minecraft/class_1767;
      named getColorForState Lnet/minecraft/block/entity/BannerBlockEntity;getColorForState()Lnet/minecraft/util/DyeColor;