Class VaultBlockEntity
- All Implemented Interfaces:
DebugTrackable
- Mappings:
Namespace Name named net/minecraft/block/entity/VaultBlockEntityintermediary net/minecraft/class_9199official eis
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classNested classes/interfaces inherited from interface net.minecraft.world.debug.DebugTrackable
DebugTrackable.DebugDataSupplier<T>, DebugTrackable.Tracker -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final VaultClientDataprivate VaultConfigprivate final VaultServerDataprivate final VaultSharedDataFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidReads data fromnbt.voidsetConfig(VaultConfig config) toInitialChunkDataNbt(RegistryWrapper.WrapperLookup registries) 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 voidWrites data tonbt.Methods inherited from class net.minecraft.block.entity.BlockEntity
addComponents, cancelRemoval, createComponentlessNbt, createComponentMap, createFromNbt, createNbt, createNbtWithIdentifyingData, getCachedState, getComponents, getNameForReport, getPos, getReporterContext, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onBlockReplaced, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessData, readComponents, readComponents, readComponents, registerTracking, removeFromCopiedStackData, setCachedState, setComponents, setWorld, supports, tryParseCustomName, writeComponentlessData, writeDataWithId, writeDataWithoutId, writeFullData, writeId
-
Field Details
-
serverData
- Mappings:
Namespace Name Mixin selector named serverDataLnet/minecraft/block/entity/VaultBlockEntity;serverData:Lnet/minecraft/block/vault/VaultServerData;intermediary field_48866Lnet/minecraft/class_9199;field_48866:Lnet/minecraft/class_9204;official aLeis;a:Leiv;
-
clientData
- Mappings:
Namespace Name Mixin selector named clientDataLnet/minecraft/block/entity/VaultBlockEntity;clientData:Lnet/minecraft/block/vault/VaultClientData;intermediary field_48868Lnet/minecraft/class_9199;field_48868:Lnet/minecraft/class_9202;official cLeis;c:Leit;
-
config
- Mappings:
Namespace Name Mixin selector named configLnet/minecraft/block/entity/VaultBlockEntity;config:Lnet/minecraft/block/vault/VaultConfig;intermediary field_48869Lnet/minecraft/class_9199;field_48869:Lnet/minecraft/class_9203;official dLeis;d:Leiu;
-
-
Constructor Details
-
VaultBlockEntity
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/block/entity/VaultBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary <init>Lnet/minecraft/class_9199;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial <init>Leis;<init>(Lja;Lejm;)V
-
-
Method Details
-
toUpdatePacket
Returns 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 toon the client.invalid reference
#readNbt"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 named toUpdatePacketLnet/minecraft/block/entity/BlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/Packet;intermediary method_38235Lnet/minecraft/class_2586;method_38235()Lnet/minecraft/class_2596;official ax_Legg;ax_()Laao;
-
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
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 named toInitialChunkDataNbtLnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;intermediary method_16887Lnet/minecraft/class_2586;method_16887(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;official aLegg;a(Ljm$a;)Lup;
-
writeData
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:
writeDatain classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named writeDataLnet/minecraft/block/entity/BlockEntity;writeData(Lnet/minecraft/storage/WriteView;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_11372;)Vofficial aLegg;a(Lfir;)V
-
readData
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:
readDatain classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named readDataLnet/minecraft/block/entity/BlockEntity;readData(Lnet/minecraft/storage/ReadView;)Vintermediary method_11014Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_11368;)Vofficial aLegg;a(Lfip;)V
-
getServerData
- Mappings:
Namespace Name Mixin selector named getServerDataLnet/minecraft/block/entity/VaultBlockEntity;getServerData()Lnet/minecraft/block/vault/VaultServerData;intermediary method_56731Lnet/minecraft/class_9199;method_56731()Lnet/minecraft/class_9204;official aLeis;a()Leiv;
-
getClientData
- Mappings:
Namespace Name Mixin selector named getClientDataLnet/minecraft/block/entity/VaultBlockEntity;getClientData()Lnet/minecraft/block/vault/VaultClientData;intermediary method_56736Lnet/minecraft/class_9199;method_56736()Lnet/minecraft/class_9202;official dLeis;d()Leit;
-
getConfig
- Mappings:
Namespace Name Mixin selector named getConfigLnet/minecraft/block/entity/VaultBlockEntity;getConfig()Lnet/minecraft/block/vault/VaultConfig;intermediary method_56737Lnet/minecraft/class_9199;method_56737()Lnet/minecraft/class_9203;official fLeis;f()Leiu;
-
setConfig
- Mappings:
Namespace Name Mixin selector named setConfigLnet/minecraft/block/entity/VaultBlockEntity;setConfig(Lnet/minecraft/block/vault/VaultConfig;)Vintermediary method_56730Lnet/minecraft/class_9199;method_56730(Lnet/minecraft/class_9203;)Vofficial aLeis;a(Leiu;)V
-