Class BannerBlockEntity
- All Implemented Interfaces:
Nameable
- Mappings:
Namespace Name official czaintermediary net/minecraft/class_2573named net/minecraft/block/entity/BannerBlockEntity
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DyeColorstatic final Stringstatic final intstatic final Stringprivate @Nullable List<com.mojang.datafixers.util.Pair<RegistryEntry<BannerPattern>,DyeColor>> static final StringFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
ConstructorsConstructorDescriptionBannerBlockEntity(BlockPos pos, BlockState state) BannerBlockEntity(BlockPos pos, BlockState state, DyeColor baseColor) -
Method Summary
Modifier and TypeMethodDescriptionReturns the custom name of this object, ornullif there is none.getName()Returns the name of this object.static intgetPatternCount(ItemStack stack) getPatternListNbt(ItemStack stack) List<com.mojang.datafixers.util.Pair<RegistryEntry<BannerPattern>,DyeColor>> static List<com.mojang.datafixers.util.Pair<RegistryEntry<BannerPattern>,DyeColor>> getPatternsFromNbt(DyeColor baseColor, @Nullable NbtList patternListNbt) static voidloadFromItemStack(ItemStack stack) voidvoidvoidreadNbt(NbtCompound nbt) Reads data fromnbt.voidsetCustomName(Text customName) Returns the serialized state of this block entity that is observable by clients.Returns the packet to send to nearby players when the block entity's observable state changes, ornullto not send the packet.protected voidwriteNbt(NbtCompound nbt) Writes data tonbt.Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, setCachedState, setStackNbt, setWorld, writeIdToNbtMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.util.Nameable
getDisplayName, hasCustomName
-
Field Details
-
MAX_PATTERN_COUNT
public static final int MAX_PATTERN_COUNT- See Also:
- Mappings:
Namespace Name Mixin selector official aLcza;a:Iintermediary field_31296Lnet/minecraft/class_2573;field_31296:Inamed MAX_PATTERN_COUNTLnet/minecraft/block/entity/BannerBlockEntity;MAX_PATTERN_COUNT:I
-
PATTERNS_KEY
- See Also:
- Mappings:
Namespace Name Mixin selector official bLcza;b:Ljava/lang/String;intermediary field_31297Lnet/minecraft/class_2573;field_31297:Ljava/lang/String;named PATTERNS_KEYLnet/minecraft/block/entity/BannerBlockEntity;PATTERNS_KEY:Ljava/lang/String;
-
PATTERN_KEY
- See Also:
- Mappings:
Namespace Name Mixin selector official cLcza;c:Ljava/lang/String;intermediary field_31298Lnet/minecraft/class_2573;field_31298:Ljava/lang/String;named PATTERN_KEYLnet/minecraft/block/entity/BannerBlockEntity;PATTERN_KEY:Ljava/lang/String;
-
COLOR_KEY
- See Also:
- Mappings:
Namespace Name Mixin selector official dLcza;d:Ljava/lang/String;intermediary field_31299Lnet/minecraft/class_2573;field_31299:Ljava/lang/String;named COLOR_KEYLnet/minecraft/block/entity/BannerBlockEntity;COLOR_KEY:Ljava/lang/String;
-
customName
- Mappings:
Namespace Name Mixin selector official eLcza;e:Lsw;intermediary field_11772Lnet/minecraft/class_2573;field_11772:Lnet/minecraft/class_2561;named customNameLnet/minecraft/block/entity/BannerBlockEntity;customName:Lnet/minecraft/text/Text;
-
baseColor
- Mappings:
Namespace Name Mixin selector official fLcza;f:Lcel;intermediary field_11774Lnet/minecraft/class_2573;field_11774:Lnet/minecraft/class_1767;named baseColorLnet/minecraft/block/entity/BannerBlockEntity;baseColor:Lnet/minecraft/util/DyeColor;
-
patternListNbt
- Mappings:
Namespace Name Mixin selector official gLcza;g:Lqx;intermediary field_11773Lnet/minecraft/class_2573;field_11773:Lnet/minecraft/class_2499;named patternListNbtLnet/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 hLcza;h:Ljava/util/List;intermediary field_11769Lnet/minecraft/class_2573;field_11769:Ljava/util/List;named patternsLnet/minecraft/block/entity/BannerBlockEntity;patterns:Ljava/util/List;
-
-
Constructor Details
-
BannerBlockEntity
- Mappings:
Namespace Name Mixin selector official <init>Lcza;<init>(Lgu;Ldby;)Vintermediary <init>Lnet/minecraft/class_2573;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vnamed <init>Lnet/minecraft/block/entity/BannerBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
-
BannerBlockEntity
- Mappings:
Namespace Name Mixin selector official <init>Lcza;<init>(Lgu;Ldby;Lcel;)Vintermediary <init>Lnet/minecraft/class_2573;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_1767;)Vnamed <init>Lnet/minecraft/block/entity/BannerBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/DyeColor;)V
-
-
Method Details
-
getPatternListNbt
- Mappings:
Namespace Name Mixin selector official aLcza;a(Lcfx;)Lqx;intermediary method_24281Lnet/minecraft/class_2573;method_24281(Lnet/minecraft/class_1799;)Lnet/minecraft/class_2499;named getPatternListNbtLnet/minecraft/block/entity/BannerBlockEntity;getPatternListNbt(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/nbt/NbtList;
-
readFrom
- Mappings:
Namespace Name Mixin selector official aLcza;a(Lcfx;Lcel;)Vintermediary method_10913Lnet/minecraft/class_2573;method_10913(Lnet/minecraft/class_1799;Lnet/minecraft/class_1767;)Vnamed readFromLnet/minecraft/block/entity/BannerBlockEntity;readFrom(Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/DyeColor;)V
-
readFrom
- Mappings:
Namespace Name Mixin selector official bLcza;b(Lcfx;)Vintermediary method_38992Lnet/minecraft/class_2573;method_38992(Lnet/minecraft/class_1799;)Vnamed readFromLnet/minecraft/block/entity/BannerBlockEntity;readFrom(Lnet/minecraft/item/ItemStack;)V
-
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:
getNamein interfaceNameable- Returns:
- the name of this object
- Mappings:
Namespace Name Mixin selector official YLbea;Y()Lsw;intermediary method_5477Lnet/minecraft/class_1275;method_5477()Lnet/minecraft/class_2561;named getNameLnet/minecraft/util/Nameable;getName()Lnet/minecraft/text/Text;
-
getCustomName
Returns the custom name of this object, ornullif there is none.- Specified by:
getCustomNamein interfaceNameable- Returns:
- the custom name of this object, or
nullif there is none - Mappings:
Namespace Name Mixin selector official aaLbea;aa()Lsw;intermediary method_5797Lnet/minecraft/class_1275;method_5797()Lnet/minecraft/class_2561;named getCustomNameLnet/minecraft/util/Nameable;getCustomName()Lnet/minecraft/text/Text;
-
setCustomName
- Mappings:
Namespace Name Mixin selector official aLcza;a(Lsw;)Vintermediary method_16842Lnet/minecraft/class_2573;method_16842(Lnet/minecraft/class_2561;)Vnamed setCustomNameLnet/minecraft/block/entity/BannerBlockEntity;setCustomName(Lnet/minecraft/text/Text;)V
-
writeNbt
Writes data tonbt. 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:
writeNbtin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector official bLczk;b(Lqr;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;)Vnamed writeNbtLnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;)V
-
readNbt
Reads data fromnbt. 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.
nbtmight 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:
readNbtin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector official aLczk;a(Lqr;)Vintermediary method_11014Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;)Vnamed readNbtLnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;)V
-
toUpdatePacket
Description copied from class:BlockEntityReturns the packet to send to nearby players when the block entity's observable state changes, ornullto not send the packet.If the data returned by
initial chunk datais suitable for updates, the following shortcut can be used to create an update packet:BlockEntityUpdateS2CPacket.create(this). The NBT will be passed toBlockEntity.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:
toUpdatePacketin classBlockEntity- Returns:
- the packet to send to nearby players when the block entity's observable
state changes, or
nullto not send the packet - See Also:
- Mappings:
Namespace Name Mixin selector official aLcza;a()Luz;intermediary method_16886Lnet/minecraft/class_2573;method_16886()Lnet/minecraft/class_2622;named toUpdatePacketLnet/minecraft/block/entity/BannerBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
-
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 defaultBlockEntityUpdateS2CPacket."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:
toInitialChunkDataNbtin classBlockEntity- Returns:
- the serialized state of this block entity that is observable by clients
- See Also:
- Mappings:
Namespace Name Mixin selector official ao_Lczk;ao_()Lqr;intermediary method_16887Lnet/minecraft/class_2586;method_16887()Lnet/minecraft/class_2487;named toInitialChunkDataNbtLnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt()Lnet/minecraft/nbt/NbtCompound;
-
getPatternCount
- Mappings:
Namespace Name Mixin selector official cLcza;c(Lcfx;)Iintermediary method_10910Lnet/minecraft/class_2573;method_10910(Lnet/minecraft/class_1799;)Inamed getPatternCountLnet/minecraft/block/entity/BannerBlockEntity;getPatternCount(Lnet/minecraft/item/ItemStack;)I
-
getPatterns
- Mappings:
Namespace Name Mixin selector official cLcza;c()Ljava/util/List;intermediary method_10911Lnet/minecraft/class_2573;method_10911()Ljava/util/List;named getPatternsLnet/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 aLcza;a(Lcel;Lqx;)Ljava/util/List;intermediary method_24280Lnet/minecraft/class_2573;method_24280(Lnet/minecraft/class_1767;Lnet/minecraft/class_2499;)Ljava/util/List;named getPatternsFromNbtLnet/minecraft/block/entity/BannerBlockEntity;getPatternsFromNbt(Lnet/minecraft/util/DyeColor;Lnet/minecraft/nbt/NbtList;)Ljava/util/List;
-
loadFromItemStack
- Mappings:
Namespace Name Mixin selector official dLcza;d(Lcfx;)Vintermediary method_10905Lnet/minecraft/class_2573;method_10905(Lnet/minecraft/class_1799;)Vnamed loadFromItemStackLnet/minecraft/block/entity/BannerBlockEntity;loadFromItemStack(Lnet/minecraft/item/ItemStack;)V
-
getPickStack
- Mappings:
Namespace Name Mixin selector official fLcza;f()Lcfx;intermediary method_10907Lnet/minecraft/class_2573;method_10907()Lnet/minecraft/class_1799;named getPickStackLnet/minecraft/block/entity/BannerBlockEntity;getPickStack()Lnet/minecraft/item/ItemStack;
-
getColorForState
- Mappings:
Namespace Name Mixin selector official gLcza;g()Lcel;intermediary method_10908Lnet/minecraft/class_2573;method_10908()Lnet/minecraft/class_1767;named getColorForStateLnet/minecraft/block/entity/BannerBlockEntity;getColorForState()Lnet/minecraft/util/DyeColor;
-