Class VaultBlockEntity

java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.VaultBlockEntity

public class VaultBlockEntity extends BlockEntity
Mappings:
Namespace Name
named net/minecraft/block/entity/VaultBlockEntity
intermediary net/minecraft/class_9199
official dsk
  • Field Details

    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      named LOGGER Lnet/minecraft/block/entity/VaultBlockEntity;LOGGER:Lorg/slf4j/Logger;
      intermediary field_48865 Lnet/minecraft/class_9199;field_48865:Lorg/slf4j/Logger;
      official a Ldsk;a:Lorg/slf4j/Logger;
    • serverData

      private final VaultServerData serverData
      Mappings:
      Namespace Name Mixin selector
      named serverData Lnet/minecraft/block/entity/VaultBlockEntity;serverData:Lnet/minecraft/block/vault/VaultServerData;
      intermediary field_48866 Lnet/minecraft/class_9199;field_48866:Lnet/minecraft/class_9204;
      official b Ldsk;b:Ldsn;
    • sharedData

      private final VaultSharedData sharedData
      Mappings:
      Namespace Name Mixin selector
      named sharedData Lnet/minecraft/block/entity/VaultBlockEntity;sharedData:Lnet/minecraft/block/vault/VaultSharedData;
      intermediary field_48867 Lnet/minecraft/class_9199;field_48867:Lnet/minecraft/class_9205;
      official c Ldsk;c:Ldso;
    • clientData

      private final VaultClientData clientData
      Mappings:
      Namespace Name Mixin selector
      named clientData Lnet/minecraft/block/entity/VaultBlockEntity;clientData:Lnet/minecraft/block/vault/VaultClientData;
      intermediary field_48868 Lnet/minecraft/class_9199;field_48868:Lnet/minecraft/class_9202;
      official d Ldsk;d:Ldsl;
    • config

      private VaultConfig config
      Mappings:
      Namespace Name Mixin selector
      named config Lnet/minecraft/block/entity/VaultBlockEntity;config:Lnet/minecraft/block/vault/VaultConfig;
      intermediary field_48869 Lnet/minecraft/class_9199;field_48869:Lnet/minecraft/class_9203;
      official e Ldsk;e:Ldsm;
  • Constructor Details

    • VaultBlockEntity

      public VaultBlockEntity(BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/block/entity/VaultBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
      intermediary <init> Lnet/minecraft/class_9199;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      official <init> Ldsk;<init>(Ljd;Ldtc;)V
  • Method Details

    • toUpdatePacket

      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 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/BlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/Packet;
      intermediary method_38235 Lnet/minecraft/class_2586;method_38235()Lnet/minecraft/class_2596;
      official az_ Ldqh;az_()Lzg;
    • 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 Ldqh;a(Ljo$a;)Lub;
    • 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 Ldqh;b(Lub;Ljo$a;)V
    • encodeValue

      private static <T> NbtElement encodeValue(com.mojang.serialization.Codec<T> codec, T value, RegistryWrapper.WrapperLookup registries)
      Mappings:
      Namespace Name Mixin selector
      named encodeValue Lnet/minecraft/block/entity/VaultBlockEntity;encodeValue(Lcom/mojang/serialization/Codec;Ljava/lang/Object;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtElement;
      intermediary method_56729 Lnet/minecraft/class_9199;method_56729(Lcom/mojang/serialization/Codec;Ljava/lang/Object;Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2520;
      official a Ldsk;a(Lcom/mojang/serialization/Codec;Ljava/lang/Object;Ljo$a;)Luy;
    • 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 Ldqh;a(Lub;Ljo$a;)V
    • getServerData

      @Nullable public @Nullable VaultServerData getServerData()
      Mappings:
      Namespace Name Mixin selector
      named getServerData Lnet/minecraft/block/entity/VaultBlockEntity;getServerData()Lnet/minecraft/block/vault/VaultServerData;
      intermediary method_56731 Lnet/minecraft/class_9199;method_56731()Lnet/minecraft/class_9204;
      official b Ldsk;b()Ldsn;
    • getSharedData

      public VaultSharedData getSharedData()
      Mappings:
      Namespace Name Mixin selector
      named getSharedData Lnet/minecraft/block/entity/VaultBlockEntity;getSharedData()Lnet/minecraft/block/vault/VaultSharedData;
      intermediary method_56735 Lnet/minecraft/class_9199;method_56735()Lnet/minecraft/class_9205;
      official c Ldsk;c()Ldso;
    • getClientData

      public VaultClientData getClientData()
      Mappings:
      Namespace Name Mixin selector
      named getClientData Lnet/minecraft/block/entity/VaultBlockEntity;getClientData()Lnet/minecraft/block/vault/VaultClientData;
      intermediary method_56736 Lnet/minecraft/class_9199;method_56736()Lnet/minecraft/class_9202;
      official d Ldsk;d()Ldsl;
    • getConfig

      public VaultConfig getConfig()
      Mappings:
      Namespace Name Mixin selector
      named getConfig Lnet/minecraft/block/entity/VaultBlockEntity;getConfig()Lnet/minecraft/block/vault/VaultConfig;
      intermediary method_56737 Lnet/minecraft/class_9199;method_56737()Lnet/minecraft/class_9203;
      official f Ldsk;f()Ldsm;
    • setConfig

      public void setConfig(VaultConfig config)
      Mappings:
      Namespace Name Mixin selector
      named setConfig Lnet/minecraft/block/entity/VaultBlockEntity;setConfig(Lnet/minecraft/block/vault/VaultConfig;)V
      intermediary method_56730 Lnet/minecraft/class_9199;method_56730(Lnet/minecraft/class_9203;)V
      official a Ldsk;a(Ldsm;)V