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
named net/minecraft/block/entity/BannerBlockEntity
intermediary net/minecraft/class_2573
official dox
  • Field Details

    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      named LOGGER Lnet/minecraft/block/entity/BannerBlockEntity;LOGGER:Lorg/slf4j/Logger;
      intermediary field_49402 Lnet/minecraft/class_2573;field_49402:Lorg/slf4j/Logger;
      official b Ldox;b:Lorg/slf4j/Logger;
    • MAX_PATTERN_COUNT

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

      private static final String PATTERNS_KEY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named PATTERNS_KEY Lnet/minecraft/block/entity/BannerBlockEntity;PATTERNS_KEY:Ljava/lang/String;
      intermediary field_31297 Lnet/minecraft/class_2573;field_31297:Ljava/lang/String;
      official c Ldox;c:Ljava/lang/String;
    • customName

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

      private DyeColor baseColor
      Mappings:
      Namespace Name Mixin selector
      named baseColor Lnet/minecraft/block/entity/BannerBlockEntity;baseColor:Lnet/minecraft/util/DyeColor;
      intermediary field_11774 Lnet/minecraft/class_2573;field_11774:Lnet/minecraft/class_1767;
      official e Ldox;e:Lctj;
    • patterns

      private BannerPatternsComponent patterns
      Mappings:
      Namespace Name Mixin selector
      named patterns Lnet/minecraft/block/entity/BannerBlockEntity;patterns:Lnet/minecraft/component/type/BannerPatternsComponent;
      intermediary field_49756 Lnet/minecraft/class_2573;field_49756:Lnet/minecraft/class_9307;
      official f Ldox;f:Ldoz;
  • Constructor Details

    • BannerBlockEntity

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

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

    • readFrom

      public void readFrom(ItemStack stack, DyeColor baseColor)
      Mappings:
      Namespace Name Mixin selector
      named readFrom Lnet/minecraft/block/entity/BannerBlockEntity;readFrom(Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/DyeColor;)V
      intermediary method_10913 Lnet/minecraft/class_2573;method_10913(Lnet/minecraft/class_1799;Lnet/minecraft/class_1767;)V
      official a Ldox;a(Lcuq;Lctj;)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
      named getName Lnet/minecraft/util/Nameable;getName()Lnet/minecraft/text/Text;
      intermediary method_5477 Lnet/minecraft/class_1275;method_5477()Lnet/minecraft/class_2561;
      official af Lbra;af()Lxp;
    • 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
      named getCustomName Lnet/minecraft/util/Nameable;getCustomName()Lnet/minecraft/text/Text;
      intermediary method_5797 Lnet/minecraft/class_1275;method_5797()Lnet/minecraft/class_2561;
      official ah Lbra;ah()Lxp;
    • writeNbt

      protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup)
      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
      named writeNbt Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
      intermediary method_11007 Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
      official b Ldpi;b(Lus;Ljk$a;)V
    • readNbt

      protected void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup)
      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
      named readNbt Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
      intermediary method_11014 Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
      official a Ldpi;a(Lus;Ljk$a;)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, net.minecraft.registry.RegistryWrapper.WrapperLookup) 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
      named toUpdatePacket Lnet/minecraft/block/entity/BannerBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
      intermediary method_16886 Lnet/minecraft/class_2573;method_16886()Lnet/minecraft/class_2622;
      official a Ldox;a()Lacp;
    • toInitialChunkDataNbt

      public NbtCompound toInitialChunkDataNbt(RegistryWrapper.WrapperLookup registryLookup)
      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 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(net.minecraft.registry.RegistryWrapper.WrapperLookup).

      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
      named toInitialChunkDataNbt Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;
      intermediary method_16887 Lnet/minecraft/class_2586;method_16887(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;
      official a Ldpi;a(Ljk$a;)Lus;
    • getPatterns

      public BannerPatternsComponent getPatterns()
      Mappings:
      Namespace Name Mixin selector
      named getPatterns Lnet/minecraft/block/entity/BannerBlockEntity;getPatterns()Lnet/minecraft/component/type/BannerPatternsComponent;
      intermediary method_58122 Lnet/minecraft/class_2573;method_58122()Lnet/minecraft/class_9307;
      official b Ldox;b()Ldoz;
    • getPickStack

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

      public DyeColor getColorForState()
      Mappings:
      Namespace Name Mixin selector
      named getColorForState Lnet/minecraft/block/entity/BannerBlockEntity;getColorForState()Lnet/minecraft/util/DyeColor;
      intermediary method_10908 Lnet/minecraft/class_2573;method_10908()Lnet/minecraft/class_1767;
      official f Ldox;f()Lctj;
    • readComponents

      protected void readComponents(BlockEntity.ComponentsAccess components)
      Overrides:
      readComponents in class BlockEntity
      Mappings:
      Namespace Name Mixin selector
      named readComponents Lnet/minecraft/block/entity/BlockEntity;readComponents(Lnet/minecraft/block/entity/BlockEntity$ComponentsAccess;)V
      intermediary method_57568 Lnet/minecraft/class_2586;method_57568(Lnet/minecraft/class_2586$class_9473;)V
      official a Ldpi;a(Ldpi$b;)V
    • addComponents

      protected void addComponents(ComponentMap.Builder componentMapBuilder)
      Overrides:
      addComponents in class BlockEntity
      Mappings:
      Namespace Name Mixin selector
      named addComponents Lnet/minecraft/block/entity/BlockEntity;addComponents(Lnet/minecraft/component/ComponentMap$Builder;)V
      intermediary method_57567 Lnet/minecraft/class_2586;method_57567(Lnet/minecraft/class_9323$class_9324;)V
      official a Ldpi;a(Lki$a;)V
    • removeFromCopiedStackNbt

      public void removeFromCopiedStackNbt(NbtCompound nbt)
      Overrides:
      removeFromCopiedStackNbt in class BlockEntity
      Mappings:
      Namespace Name Mixin selector
      named removeFromCopiedStackNbt Lnet/minecraft/block/entity/BlockEntity;removeFromCopiedStackNbt(Lnet/minecraft/nbt/NbtCompound;)V
      intermediary method_57569 Lnet/minecraft/class_2586;method_57569(Lnet/minecraft/class_2487;)V
      official a Ldpi;a(Lus;)V