Class JukeboxBlockEntity

All Implemented Interfaces:
Clearable, Container, ContainerSingleItem, ICapabilityProvider, ICapabilityProviderImpl<BlockEntity>, ICapabilitySerializable<CompoundTag>, IForgeBlockEntity, INBTSerializable<CompoundTag>

public class JukeboxBlockEntity extends BlockEntity implements Clearable, ContainerSingleItem
  • Field Details

    • SONG_END_PADDING

      private static final int SONG_END_PADDING
      See Also:
    • items

      private final NonNullList<ItemStack> items
    • ticksSinceLastEvent

      private int ticksSinceLastEvent
    • tickCount

      private long tickCount
    • recordStartedTick

      private long recordStartedTick
    • isPlaying

      private boolean isPlaying
  • Constructor Details

    • JukeboxBlockEntity

      public JukeboxBlockEntity(BlockPos p_155613_, BlockState p_155614_)
  • Method Details

    • load

      public void load(CompoundTag p_155616_)
      Overrides:
      load in class BlockEntity
    • saveAdditional

      protected void saveAdditional(CompoundTag p_187507_)
      Overrides:
      saveAdditional in class BlockEntity
    • isRecordPlaying

      public boolean isRecordPlaying()
    • setHasRecordBlockState

      private void setHasRecordBlockState(@Nullable Entity p_273308_, boolean p_273038_)
    • startPlaying

      public void startPlaying()
    • stopPlaying

      private void stopPlaying()
    • tick

      private void tick(Level p_273615_, BlockPos p_273143_, BlockState p_273372_)
    • shouldRecordStopPlaying

      private boolean shouldRecordStopPlaying(RecordItem p_273267_)
    • shouldSendJukeboxPlayingEvent

      private boolean shouldSendJukeboxPlayingEvent()
    • getItem

      public ItemStack getItem(int p_273280_)
      Specified by:
      getItem in interface Container
    • removeItem

      public ItemStack removeItem(int p_273514_, int p_273414_)
      Specified by:
      removeItem in interface Container
    • setItem

      public void setItem(int p_273461_, ItemStack p_273584_)
      Specified by:
      setItem in interface Container
    • getMaxStackSize

      public int getMaxStackSize()
      Specified by:
      getMaxStackSize in interface Container
    • stillValid

      public boolean stillValid(Player p_273466_)
      Specified by:
      stillValid in interface Container
    • canPlaceItem

      public boolean canPlaceItem(int p_273369_, ItemStack p_273689_)
      Specified by:
      canPlaceItem in interface Container
    • canTakeItem

      public boolean canTakeItem(Container p_273497_, int p_273168_, ItemStack p_273785_)
      Specified by:
      canTakeItem in interface Container
    • spawnMusicParticles

      private void spawnMusicParticles(Level p_270782_, BlockPos p_270940_)
    • popOutRecord

      public void popOutRecord()
    • playRecordTick

      public static void playRecordTick(Level p_239938_, BlockPos p_239939_, BlockState p_239940_, JukeboxBlockEntity p_239941_)
    • setRecordWithoutPlaying

      public void setRecordWithoutPlaying(ItemStack p_272693_)