Class JukeboxBlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.JukeboxBlockEntity
- All Implemented Interfaces:
Clearable,Container,ContainerSingleItem,ContainerSingleItem.BlockContainerSingleItem,ICapabilityProvider,ICapabilityProviderImpl<BlockEntity>,IForgeBlockEntity
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.DataComponentInputNested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
CapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>>Nested classes/interfaces inherited from interface net.minecraft.world.ticks.ContainerSingleItem
ContainerSingleItem.BlockContainerSingleItem -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ItemStackprivate final JukeboxSongPlayerstatic final Stringstatic final StringFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFERFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlaceItem(int p_273369_, ItemStack p_273689_) booleancanTakeItem(Container p_273497_, int p_273168_, ItemStack p_273785_) intintprotected voidloadAdditional(CompoundTag p_329712_, HolderLookup.Provider p_330255_) private voidnotifyItemChangedInJukebox(boolean p_342785_) voidvoidprotected voidsaveAdditional(CompoundTag p_187507_, HolderLookup.Provider p_332390_) voidsetSongItemWithoutPlaying(ItemStack p_343692_) voidsetTheItem(ItemStack p_309430_) splitTheItem(int p_309876_) static voidtick(Level p_273615_, BlockPos p_273143_, BlockState p_273372_, JukeboxBlockEntity p_343932_) voidMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, loadCustomOnly, loadStatic, loadWithComponents, onChunkUnloaded, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setLevel, setRemoved, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged, startOpen, stopOpenMethods inherited from interface net.minecraft.world.ticks.ContainerSingleItem
clearContent, getContainerSize, getItem, isEmpty, removeItem, removeItemNoUpdate, removeTheItem, setItemMethods inherited from interface net.minecraft.world.ticks.ContainerSingleItem.BlockContainerSingleItem
stillValidMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, 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_342785_) -
popOutTheItem
public void popOutTheItem() -
tick
public static void tick(Level p_273615_, BlockPos p_273143_, BlockState p_273372_, JukeboxBlockEntity p_343932_) -
getComparatorOutput
public int getComparatorOutput() -
loadAdditional
- Overrides:
loadAdditionalin classBlockEntity
-
saveAdditional
- Overrides:
saveAdditionalin classBlockEntity
-
getTheItem
- Specified by:
getTheItemin interfaceContainerSingleItem
-
splitTheItem
- Specified by:
splitTheItemin interfaceContainerSingleItem
-
setTheItem
- Specified by:
setTheItemin interfaceContainerSingleItem
-
getMaxStackSize
public int getMaxStackSize()- Specified by:
getMaxStackSizein interfaceContainer
-
getContainerBlockEntity
- Specified by:
getContainerBlockEntityin interfaceContainerSingleItem.BlockContainerSingleItem
-
canPlaceItem
- Specified by:
canPlaceItemin interfaceContainer
-
canTakeItem
- Specified by:
canTakeItemin interfaceContainer
-
setSongItemWithoutPlaying
-
tryForcePlaySong
public void tryForcePlaySong()
-