Class DecoratedPotBlockEntity

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

public class DecoratedPotBlockEntity extends BlockEntity
Mappings:
Namespace Name
official czr
intermediary net/minecraft/class_8172
named net/minecraft/block/entity/DecoratedPotBlockEntity
  • Field Details

    • SHARDS_NBT_KEY

      private static final String SHARDS_NBT_KEY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lczr;a:Ljava/lang/String;
      intermediary field_42782 Lnet/minecraft/class_8172;field_42782:Ljava/lang/String;
      named SHARDS_NBT_KEY Lnet/minecraft/block/entity/DecoratedPotBlockEntity;SHARDS_NBT_KEY:Ljava/lang/String;
    • field_42783

      private static final int field_42783
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lczr;b:I
      intermediary field_42783 Lnet/minecraft/class_8172;field_42783:I
      named field_42783 Lnet/minecraft/block/entity/DecoratedPotBlockEntity;field_42783:I
    • dropNothing

      private boolean dropNothing
      Mappings:
      Namespace Name Mixin selector
      official c Lczr;c:Z
      intermediary field_42784 Lnet/minecraft/class_8172;field_42784:Z
      named dropNothing Lnet/minecraft/block/entity/DecoratedPotBlockEntity;dropNothing:Z
    • shards

      private final List<Item> shards
      Mappings:
      Namespace Name Mixin selector
      official d Lczr;d:Ljava/util/List;
      intermediary field_42785 Lnet/minecraft/class_8172;field_42785:Ljava/util/List;
      named shards Lnet/minecraft/block/entity/DecoratedPotBlockEntity;shards:Ljava/util/List;
  • Constructor Details

    • DecoratedPotBlockEntity

      public DecoratedPotBlockEntity(BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lczr;<init>(Lgt;Ldbq;)V
      intermediary <init> Lnet/minecraft/class_8172;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named <init> Lnet/minecraft/block/entity/DecoratedPotBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
  • Method Details

    • writeNbt

      protected void writeNbt(NbtCompound nbt)
      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
      official b Lcze;b(Lre;)V
      intermediary method_11007 Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;)V
      named writeNbt Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;)V
    • readNbt

      public void readNbt(NbtCompound nbt)
      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
      official a Lcze;a(Lre;)V
      intermediary method_11014 Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;)V
      named readNbt Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;)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) 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
      official c Lczr;c()Lvm;
      intermediary method_49200 Lnet/minecraft/class_8172;method_49200()Lnet/minecraft/class_2622;
      named toUpdatePacket Lnet/minecraft/block/entity/DecoratedPotBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
    • toInitialChunkDataNbt

      public NbtCompound 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 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().

      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
      official aq_ Lcze;aq_()Lre;
      intermediary method_16887 Lnet/minecraft/class_2586;method_16887()Lnet/minecraft/class_2487;
      named toInitialChunkDataNbt Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt()Lnet/minecraft/nbt/NbtCompound;
    • writeShardsToNbt

      public static void writeShardsToNbt(List<Item> shards, NbtCompound nbt)
      Mappings:
      Namespace Name Mixin selector
      official a Lczr;a(Ljava/util/List;Lre;)V
      intermediary method_49199 Lnet/minecraft/class_8172;method_49199(Ljava/util/List;Lnet/minecraft/class_2487;)V
      named writeShardsToNbt Lnet/minecraft/block/entity/DecoratedPotBlockEntity;writeShardsToNbt(Ljava/util/List;Lnet/minecraft/nbt/NbtCompound;)V
    • asStack

      public ItemStack asStack()
      Mappings:
      Namespace Name Mixin selector
      official d Lczr;d()Lcfv;
      intermediary method_49201 Lnet/minecraft/class_8172;method_49201()Lnet/minecraft/class_1799;
      named asStack Lnet/minecraft/block/entity/DecoratedPotBlockEntity;asStack()Lnet/minecraft/item/ItemStack;
    • getShards

      public List<Item> getShards()
      Mappings:
      Namespace Name Mixin selector
      official f Lczr;f()Ljava/util/List;
      intermediary method_49202 Lnet/minecraft/class_8172;method_49202()Ljava/util/List;
      named getShards Lnet/minecraft/block/entity/DecoratedPotBlockEntity;getShards()Ljava/util/List;
    • onBreak

      public void onBreak(World world, BlockPos pos, ItemStack tool, PlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      official a Lczr;a(Lcmi;Lgt;Lcfv;Lbym;)V
      intermediary method_49197 Lnet/minecraft/class_8172;method_49197(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1799;Lnet/minecraft/class_1657;)V
      named onBreak Lnet/minecraft/block/entity/DecoratedPotBlockEntity;onBreak(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;)V
    • shouldDropNothing

      public boolean shouldDropNothing()
      Mappings:
      Namespace Name Mixin selector
      official g Lczr;g()Z
      intermediary method_49203 Lnet/minecraft/class_8172;method_49203()Z
      named shouldDropNothing Lnet/minecraft/block/entity/DecoratedPotBlockEntity;shouldDropNothing()Z
    • getHorizontalFacing

      public Direction getHorizontalFacing()
      Mappings:
      Namespace Name Mixin selector
      official i Lczr;i()Lgz;
      intermediary method_49204 Lnet/minecraft/class_8172;method_49204()Lnet/minecraft/class_2350;
      named getHorizontalFacing Lnet/minecraft/block/entity/DecoratedPotBlockEntity;getHorizontalFacing()Lnet/minecraft/util/math/Direction;
    • readNbtFromStack

      public void readNbtFromStack(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official a Lczr;a(Lcfv;)V
      intermediary method_49196 Lnet/minecraft/class_8172;method_49196(Lnet/minecraft/class_1799;)V
      named readNbtFromStack Lnet/minecraft/block/entity/DecoratedPotBlockEntity;readNbtFromStack(Lnet/minecraft/item/ItemStack;)V