Class BannerBlockEntity
- All Implemented Interfaces:
Nameable
- Mappings:
Namespace Name official dluintermediary net/minecraft/class_2573named net/minecraft/block/entity/BannerBlockEntity
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DyeColorprivate static final Loggerstatic final intprivate static final Stringprivate BannerPatternsComponentprivate BannerPatternsComponentFields 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 TypeMethodDescriptionvoidaddComponents(ComponentMap.Builder componentMapBuilder) Returns the custom name of this object, ornullif there is none.getName()Returns the name of this object.voidreadComponents(ComponentMap components) voidvoidreadNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) Reads data fromnbt.voidprivate voidsetPatterns(BannerPatternsComponent patternsComponent) toInitialChunkDataNbt(RegistryWrapper.WrapperLookup registryLookup) 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, RegistryWrapper.WrapperLookup registryLookup) Writes data tonbt.Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createComponentMap, 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
-
LOGGER
- Mappings:
Namespace Name Mixin selector official bLdlu;b:Lorg/slf4j/Logger;intermediary field_49402Lnet/minecraft/class_2573;field_49402:Lorg/slf4j/Logger;named LOGGERLnet/minecraft/block/entity/BannerBlockEntity;LOGGER:Lorg/slf4j/Logger;
-
MAX_PATTERN_COUNT
public static final int MAX_PATTERN_COUNT- See Also:
- Mappings:
Namespace Name Mixin selector official aLdlu;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 cLdlu;c: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;
-
customName
- Mappings:
Namespace Name Mixin selector official dLdlu;d:Lwg;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 eLdlu;e:Lcqc;intermediary field_11774Lnet/minecraft/class_2573;field_11774:Lnet/minecraft/class_1767;named baseColorLnet/minecraft/block/entity/BannerBlockEntity;baseColor:Lnet/minecraft/util/DyeColor;
-
patternsComponent
- Mappings:
Namespace Name Mixin selector official fLdlu;f:Ldlw;intermediary field_11773Lnet/minecraft/class_2573;field_11773:Lnet/minecraft/class_9307;named patternsComponentLnet/minecraft/block/entity/BannerBlockEntity;patternsComponent:Lnet/minecraft/component/type/BannerPatternsComponent;
-
patternsComponentWithBase
- Mappings:
Namespace Name Mixin selector official gLdlu;g:Ldlw;intermediary field_49403Lnet/minecraft/class_2573;field_49403:Lnet/minecraft/class_9307;named patternsComponentWithBaseLnet/minecraft/block/entity/BannerBlockEntity;patternsComponentWithBase:Lnet/minecraft/component/type/BannerPatternsComponent;
-
-
Constructor Details
-
BannerBlockEntity
- Mappings:
Namespace Name Mixin selector official <init>Ldlu;<init>(Lib;Ldoz;)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>Ldlu;<init>(Lib;Ldoz;Lcqc;)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
-
readFrom
- Mappings:
Namespace Name Mixin selector official aLdlu;a(Lcrj;Lcqc;)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
-
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 adLbof;ad()Lwg;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 afLbof;af()Lwg;intermediary method_5797Lnet/minecraft/class_1275;method_5797()Lnet/minecraft/class_2561;named getCustomNameLnet/minecraft/util/Nameable;getCustomName()Lnet/minecraft/text/Text;
-
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 bLdmf;b(Ltm;Lin$a;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Vnamed writeNbtLnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)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 aLdmf;a(Ltm;Lin$a;)Vintermediary method_11014Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Vnamed readNbtLnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)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, 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:
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 aLdlu;a()Labf;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(net.minecraft.registry.RegistryWrapper.WrapperLookup).- Overrides:
toInitialChunkDataNbtin classBlockEntity- Returns:
- the serialized state of this block entity that is observable by clients
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdmf;a(Lin$a;)Ltm;intermediary method_16887Lnet/minecraft/class_2586;method_16887(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;named toInitialChunkDataNbtLnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;
-
getPatterns
- Mappings:
Namespace Name Mixin selector official bLdlu;b()Ldlw;intermediary method_57570Lnet/minecraft/class_2573;method_57570()Lnet/minecraft/class_9307;named getPatternsLnet/minecraft/block/entity/BannerBlockEntity;getPatterns()Lnet/minecraft/component/type/BannerPatternsComponent;
-
getPickStack
- Mappings:
Namespace Name Mixin selector official cLdlu;c()Lcrj;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 fLdlu;f()Lcqc;intermediary method_10908Lnet/minecraft/class_2573;method_10908()Lnet/minecraft/class_1767;named getColorForStateLnet/minecraft/block/entity/BannerBlockEntity;getColorForState()Lnet/minecraft/util/DyeColor;
-
readComponents
- Overrides:
readComponentsin classBlockEntity- Mappings:
Namespace Name Mixin selector official aLdmf;a(Ljl;)Vintermediary method_57568Lnet/minecraft/class_2586;method_57568(Lnet/minecraft/class_9323;)Vnamed readComponentsLnet/minecraft/block/entity/BlockEntity;readComponents(Lnet/minecraft/component/ComponentMap;)V
-
addComponents
- Overrides:
addComponentsin classBlockEntity- Mappings:
Namespace Name Mixin selector official aLdmf;a(Ljl$a;)Vintermediary method_57567Lnet/minecraft/class_2586;method_57567(Lnet/minecraft/class_9323$class_9324;)Vnamed addComponentsLnet/minecraft/block/entity/BlockEntity;addComponents(Lnet/minecraft/component/ComponentMap$Builder;)V
-
removeFromCopiedStackNbt
- Overrides:
removeFromCopiedStackNbtin classBlockEntity- Mappings:
Namespace Name Mixin selector official aLdmf;a(Ltm;)Vintermediary method_57569Lnet/minecraft/class_2586;method_57569(Lnet/minecraft/class_2487;)Vnamed removeFromCopiedStackNbtLnet/minecraft/block/entity/BlockEntity;removeFromCopiedStackNbt(Lnet/minecraft/nbt/NbtCompound;)V
-
setPatterns
- Mappings:
Namespace Name Mixin selector official aLdlu;a(Ldlw;)Vintermediary method_57565Lnet/minecraft/class_2573;method_57565(Lnet/minecraft/class_9307;)Vnamed setPatternsLnet/minecraft/block/entity/BannerBlockEntity;setPatterns(Lnet/minecraft/component/type/BannerPatternsComponent;)V
-