Class JukeboxBlockEntity

java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.JukeboxBlockEntity
All Implemented Interfaces:
Inventory, SingleStackInventory, Clearable

public class JukeboxBlockEntity extends BlockEntity implements Clearable, SingleStackInventory
Mappings:
Namespace Name
official ddv
intermediary net/minecraft/class_2619
named net/minecraft/block/entity/JukeboxBlockEntity
  • Field Details

    • SECOND_PER_TICK

      private static final int SECOND_PER_TICK
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official c Lddv;c:I
      intermediary field_42799 Lnet/minecraft/class_2619;field_42799:I
      named SECOND_PER_TICK Lnet/minecraft/block/entity/JukeboxBlockEntity;SECOND_PER_TICK:I
    • inventory

      private final DefaultedList<ItemStack> inventory
      Mappings:
      Namespace Name Mixin selector
      official d Lddv;d:Lhn;
      intermediary field_42800 Lnet/minecraft/class_2619;field_42800:Lnet/minecraft/class_2371;
      named inventory Lnet/minecraft/block/entity/JukeboxBlockEntity;inventory:Lnet/minecraft/util/collection/DefaultedList;
    • ticksThisSecond

      private int ticksThisSecond
      Mappings:
      Namespace Name Mixin selector
      official e Lddv;e:I
      intermediary field_39481 Lnet/minecraft/class_2619;field_39481:I
      named ticksThisSecond Lnet/minecraft/block/entity/JukeboxBlockEntity;ticksThisSecond:I
    • tickCount

      private long tickCount
      Mappings:
      Namespace Name Mixin selector
      official f Lddv;f:J
      intermediary field_39482 Lnet/minecraft/class_2619;field_39482:J
      named tickCount Lnet/minecraft/block/entity/JukeboxBlockEntity;tickCount:J
    • recordStartTick

      private long recordStartTick
      Mappings:
      Namespace Name Mixin selector
      official g Lddv;g:J
      intermediary field_39483 Lnet/minecraft/class_2619;field_39483:J
      named recordStartTick Lnet/minecraft/block/entity/JukeboxBlockEntity;recordStartTick:J
    • isPlaying

      private boolean isPlaying
      Mappings:
      Namespace Name Mixin selector
      official h Lddv;h:Z
      intermediary field_39484 Lnet/minecraft/class_2619;field_39484:Z
      named isPlaying Lnet/minecraft/block/entity/JukeboxBlockEntity;isPlaying:Z
  • Constructor Details

    • JukeboxBlockEntity

      public JukeboxBlockEntity(BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lddv;<init>(Lgw;Ldfj;)V
      intermediary <init> Lnet/minecraft/class_2619;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named <init> Lnet/minecraft/block/entity/JukeboxBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
  • Method Details

    • 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 Ldcv;a(Lqw;)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
    • 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 Ldcv;b(Lqw;)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
    • isPlayingRecord

      public boolean isPlayingRecord()
      Mappings:
      Namespace Name Mixin selector
      official f Lddv;f()Z
      intermediary method_44373 Lnet/minecraft/class_2619;method_44373()Z
      named isPlayingRecord Lnet/minecraft/block/entity/JukeboxBlockEntity;isPlayingRecord()Z
    • updateState

      private void updateState(@Nullable @Nullable Entity entity, boolean hasRecord)
      Mappings:
      Namespace Name Mixin selector
      official a Lddv;a(Lbiq;Z)V
      intermediary method_49209 Lnet/minecraft/class_2619;method_49209(Lnet/minecraft/class_1297;Z)V
      named updateState Lnet/minecraft/block/entity/JukeboxBlockEntity;updateState(Lnet/minecraft/entity/Entity;Z)V
    • startPlaying

      public void startPlaying()
      Mappings:
      Namespace Name Mixin selector
      official g Lddv;g()V
      intermediary method_49212 Lnet/minecraft/class_2619;method_49212()V
      named startPlaying Lnet/minecraft/block/entity/JukeboxBlockEntity;startPlaying()V
    • stopPlaying

      private void stopPlaying()
      Mappings:
      Namespace Name Mixin selector
      official v Lddv;v()V
      intermediary method_49214 Lnet/minecraft/class_2619;method_49214()V
      named stopPlaying Lnet/minecraft/block/entity/JukeboxBlockEntity;stopPlaying()V
    • tick

      private void tick(World world, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official b Lddv;b(Lcpv;Lgw;Ldfj;)V
      intermediary method_49211 Lnet/minecraft/class_2619;method_49211(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named tick Lnet/minecraft/block/entity/JukeboxBlockEntity;tick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • isSongFinished

      private boolean isSongFinished(MusicDiscItem musicDisc)
      Mappings:
      Namespace Name Mixin selector
      official a Lddv;a(Lcjx;)Z
      intermediary method_44372 Lnet/minecraft/class_2619;method_44372(Lnet/minecraft/class_1813;)Z
      named isSongFinished Lnet/minecraft/block/entity/JukeboxBlockEntity;isSongFinished(Lnet/minecraft/item/MusicDiscItem;)Z
    • hasSecondPassed

      private boolean hasSecondPassed()
      Mappings:
      Namespace Name Mixin selector
      official w Lddv;w()Z
      intermediary method_44371 Lnet/minecraft/class_2619;method_44371()Z
      named hasSecondPassed Lnet/minecraft/block/entity/JukeboxBlockEntity;hasSecondPassed()Z
    • getStack

      public ItemStack getStack(int slot)
      Returns the stack currently stored at slot.

      If the slot is empty, or is outside the bounds of this inventory, this returns ItemStack.EMPTY.

      Specified by:
      getStack in interface Inventory
      Returns:
      the stack currently stored at slot
      Mappings:
      Namespace Name Mixin selector
      official a Lbgr;a(I)Lcjf;
      intermediary method_5438 Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;
      named getStack Lnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;
    • removeStack

      public ItemStack removeStack(int slot, int amount)
      Removes a specific number of items from slot.
      Specified by:
      removeStack in interface Inventory
      Returns:
      the removed items as a stack
      Mappings:
      Namespace Name Mixin selector
      official a Lbgr;a(II)Lcjf;
      intermediary method_5434 Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;
      named removeStack Lnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;
    • setStack

      public void setStack(int slot, ItemStack stack)
      Sets the stack stored at slot to stack.
      Specified by:
      setStack in interface Inventory
      Mappings:
      Namespace Name Mixin selector
      official a Lbgr;a(ILcjf;)V
      intermediary method_5447 Lnet/minecraft/class_1263;method_5447(ILnet/minecraft/class_1799;)V
      named setStack Lnet/minecraft/inventory/Inventory;setStack(ILnet/minecraft/item/ItemStack;)V
    • getMaxCountPerStack

      public int getMaxCountPerStack()
      Returns the maximum number of items a stack can contain when placed inside this inventory.

      No slots may have more than this number of items. It is effectively the stacking limit for this inventory's slots.

      Specified by:
      getMaxCountPerStack in interface Inventory
      Returns:
      the maximum number of items a stack can contain when placed inside this inventory
      Mappings:
      Namespace Name Mixin selector
      official ag_ Lbgr;ag_()I
      intermediary method_5444 Lnet/minecraft/class_1263;method_5444()I
      named getMaxCountPerStack Lnet/minecraft/inventory/Inventory;getMaxCountPerStack()I
    • canPlayerUse

      public boolean canPlayerUse(PlayerEntity player)
      Specified by:
      canPlayerUse in interface Inventory
      Returns:
      whether player can use this inventory
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lbgr;a(Lcbu;)Z
      intermediary method_5443 Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Z
      named canPlayerUse Lnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
    • isValid

      public boolean isValid(int slot, ItemStack stack)
      Returns whether stack is valid for the slot.

      Implementations can, for example, use this to check whether the item is in a specific tag. This returns true by default.

      Specified by:
      isValid in interface Inventory
      Returns:
      whether stack is valid for the slot
      Mappings:
      Namespace Name Mixin selector
      official b Lbgr;b(ILcjf;)Z
      intermediary method_5437 Lnet/minecraft/class_1263;method_5437(ILnet/minecraft/class_1799;)Z
      named isValid Lnet/minecraft/inventory/Inventory;isValid(ILnet/minecraft/item/ItemStack;)Z
    • canTransferTo

      public boolean canTransferTo(Inventory hopperInventory, int slot, ItemStack stack)
      Returns whether a hopper can transfer stack from slot to the hopper.

      This returns true by default.

      Specified by:
      canTransferTo in interface Inventory
      Returns:
      whether a hopper can transfer stack from slot to the hopper
      Mappings:
      Namespace Name Mixin selector
      official a Lbgr;a(Lbgr;ILcjf;)Z
      intermediary method_49104 Lnet/minecraft/class_1263;method_49104(Lnet/minecraft/class_1263;ILnet/minecraft/class_1799;)Z
      named canTransferTo Lnet/minecraft/inventory/Inventory;canTransferTo(Lnet/minecraft/inventory/Inventory;ILnet/minecraft/item/ItemStack;)Z
    • spawnNoteParticle

      private void spawnNoteParticle(World world, BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      official a Lddv;a(Lcpv;Lgw;)V
      intermediary method_48969 Lnet/minecraft/class_2619;method_48969(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)V
      named spawnNoteParticle Lnet/minecraft/block/entity/JukeboxBlockEntity;spawnNoteParticle(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)V
    • dropRecord

      public void dropRecord()
      Mappings:
      Namespace Name Mixin selector
      official i Lddv;i()V
      intermediary method_49213 Lnet/minecraft/class_2619;method_49213()V
      named dropRecord Lnet/minecraft/block/entity/JukeboxBlockEntity;dropRecord()V
    • tick

      public static void tick(World world, BlockPos pos, BlockState state, JukeboxBlockEntity blockEntity)
      Mappings:
      Namespace Name Mixin selector
      official a Lddv;a(Lcpv;Lgw;Ldfj;Lddv;)V
      intermediary method_44370 Lnet/minecraft/class_2619;method_44370(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2619;)V
      named tick Lnet/minecraft/block/entity/JukeboxBlockEntity;tick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/JukeboxBlockEntity;)V
    • setDisc

      public void setDisc(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official a Lddv;a(Lcjf;)V
      intermediary method_49210 Lnet/minecraft/class_2619;method_49210(Lnet/minecraft/class_1799;)V
      named setDisc Lnet/minecraft/block/entity/JukeboxBlockEntity;setDisc(Lnet/minecraft/item/ItemStack;)V