Class JukeboxBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.JukeboxBlockEntity
- All Implemented Interfaces:
Clearable
,Container
,ContainerSingleItem
,ContainerSingleItem.BlockContainerSingleItem
,IAttachmentHolder
,IBlockEntityExtension
public class JukeboxBlockEntity
extends BlockEntity
implements Clearable, ContainerSingleItem.BlockContainerSingleItem
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
BlockEntity.ComponentHelper, BlockEntity.DataComponentInput
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
Nested classes/interfaces inherited from interface net.minecraft.world.ticks.ContainerSingleItem
ContainerSingleItem.BlockContainerSingleItem
-
Field Summary
Modifier and TypeFieldDescriptionprivate ItemStack
private final JukeboxSongPlayer
static final String
static final String
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
Fields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canPlaceItem
(int p_273369_, ItemStack p_273689_) boolean
canTakeItem
(Container p_273497_, int p_273168_, ItemStack p_273785_) int
int
protected void
loadAdditional
(CompoundTag p_155616_, HolderLookup.Provider p_324026_) private void
notifyItemChangedInJukebox
(boolean p_350455_) void
void
protected void
saveAdditional
(CompoundTag p_187507_, HolderLookup.Provider p_323723_) void
setSongItemWithoutPlaying
(ItemStack p_350615_) void
setTheItem
(ItemStack p_304781_) splitTheItem
(int p_304604_) static void
tick
(Level p_273615_, BlockPos p_273143_, BlockState p_273372_, JukeboxBlockEntity p_350984_) void
Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, triggerEvent
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachments
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.Container
countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged, startOpen, stopOpen
Methods inherited from interface net.minecraft.world.ticks.ContainerSingleItem
clearContent, getContainerSize, getItem, isEmpty, removeItem, removeItemNoUpdate, removeTheItem, setItem
Methods inherited from interface net.minecraft.world.ticks.ContainerSingleItem.BlockContainerSingleItem
stillValid
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
-
Field Details
-
SONG_ITEM_TAG_ID
- See Also:
-
TICKS_SINCE_SONG_STARTED_TAG_ID
- See Also:
-
item
-
jukeboxSongPlayer
-
-
Constructor Details
-
JukeboxBlockEntity
-
-
Method Details
-
getSongPlayer
-
onSongChanged
public void onSongChanged() -
notifyItemChangedInJukebox
private void notifyItemChangedInJukebox(boolean p_350455_) -
popOutTheItem
public void popOutTheItem() -
tick
public static void tick(Level p_273615_, BlockPos p_273143_, BlockState p_273372_, JukeboxBlockEntity p_350984_) -
getComparatorOutput
public int getComparatorOutput() -
loadAdditional
- Overrides:
loadAdditional
in classBlockEntity
-
saveAdditional
- Overrides:
saveAdditional
in classBlockEntity
-
getTheItem
- Specified by:
getTheItem
in interfaceContainerSingleItem
-
splitTheItem
- Specified by:
splitTheItem
in interfaceContainerSingleItem
-
setTheItem
- Specified by:
setTheItem
in interfaceContainerSingleItem
-
getMaxStackSize
public int getMaxStackSize()- Specified by:
getMaxStackSize
in interfaceContainer
-
getContainerBlockEntity
- Specified by:
getContainerBlockEntity
in interfaceContainerSingleItem.BlockContainerSingleItem
-
canPlaceItem
- Specified by:
canPlaceItem
in interfaceContainer
-
canTakeItem
- Specified by:
canTakeItem
in interfaceContainer
-
setSongItemWithoutPlaying
-
tryForcePlaySong
public void tryForcePlaySong()
-