Class JukeboxBlockEntity
- All Implemented Interfaces:
Inventory
,SingleStackInventory
,Clearable
- Mappings:
Namespace Name official dhw
intermediary net/minecraft/class_2619
named net/minecraft/block/entity/JukeboxBlockEntity
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private ItemStack
private long
private static final int
private long
private int
Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
Fields inherited from interface net.minecraft.inventory.Inventory
field_42619, MAX_COUNT_PER_STACK
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canTransferTo
(Inventory hopperInventory, int slot, ItemStack stack) Returns whether a hopper can transferstack
fromslot
to the hopper.decreaseStack
(int count) void
int
Returns the maximum number of items a stack can contain when placed inside this inventory.getStack()
private boolean
boolean
private boolean
isSongFinished
(MusicDiscItem musicDisc) boolean
Returns whetherstack
is valid for theslot
.void
readNbt
(NbtCompound nbt) Reads data fromnbt
.void
void
private void
spawnNoteParticle
(World world, BlockPos pos) void
private void
private void
tick
(World world, BlockPos pos, BlockState state) static void
tick
(World world, BlockPos pos, BlockState state, JukeboxBlockEntity blockEntity) private void
updateState
(@Nullable Entity entity, boolean hasRecord) protected void
writeNbt
(NbtCompound nbt) Writes data tonbt
.Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, setCachedState, setStackNbt, setWorld, toInitialChunkDataNbt, toUpdatePacket, writeIdToNbt
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.inventory.Inventory
containsAny, containsAny, count, markDirty, onClose, onOpen
Methods inherited from interface net.minecraft.inventory.SingleStackInventory
canPlayerUse, clear, emptyStack, getStack, isEmpty, removeStack, removeStack, setStack, size
-
Field Details
-
SECOND_PER_TICK
private static final int SECOND_PER_TICK- See Also:
- Mappings:
Namespace Name Mixin selector official c
Ldhw;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
-
recordStack
- Mappings:
Namespace Name Mixin selector official d
Ldhw;d:Lcmy;
intermediary field_46507
Lnet/minecraft/class_2619;field_46507:Lnet/minecraft/class_1799;
named recordStack
Lnet/minecraft/block/entity/JukeboxBlockEntity;recordStack:Lnet/minecraft/item/ItemStack;
-
ticksThisSecond
private int ticksThisSecond- Mappings:
Namespace Name Mixin selector official e
Ldhw;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
Ldhw;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
Ldhw;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
Ldhw;h:Z
intermediary field_39484
Lnet/minecraft/class_2619;field_39484:Z
named isPlaying
Lnet/minecraft/block/entity/JukeboxBlockEntity;isPlaying:Z
-
-
Constructor Details
-
JukeboxBlockEntity
- Mappings:
Namespace Name Mixin selector official <init>
Ldhw;<init>(Lhx;Ldjh;)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
Reads data fromnbt
. 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 classBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector official a
Ldgv;a(Lsn;)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
Writes data tonbt
. 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 classBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector official b
Ldgv;b(Lsn;)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
Ldhw;f()Z
intermediary method_44373
Lnet/minecraft/class_2619;method_44373()Z
named isPlayingRecord
Lnet/minecraft/block/entity/JukeboxBlockEntity;isPlayingRecord()Z
-
updateState
- Mappings:
Namespace Name Mixin selector official a
Ldhw;a(Lblv;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
Ldhw;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 l
Ldhw;l()V
intermediary method_49214
Lnet/minecraft/class_2619;method_49214()V
named stopPlaying
Lnet/minecraft/block/entity/JukeboxBlockEntity;stopPlaying()V
-
tick
- Mappings:
Namespace Name Mixin selector official b
Ldhw;b(Lctp;Lhx;Ldjh;)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
- Mappings:
Namespace Name Mixin selector official a
Ldhw;a(Lcnq;)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 m
Ldhw;m()Z
intermediary method_44371
Lnet/minecraft/class_2619;method_44371()Z
named hasSecondPassed
Lnet/minecraft/block/entity/JukeboxBlockEntity;hasSecondPassed()Z
-
getStack
- Specified by:
getStack
in interfaceSingleStackInventory
- Mappings:
Namespace Name Mixin selector official x
Lene;x()Lcmy;
intermediary method_54079
Lnet/minecraft/class_8181;method_54079()Lnet/minecraft/class_1799;
named getStack
Lnet/minecraft/inventory/SingleStackInventory;getStack()Lnet/minecraft/item/ItemStack;
-
decreaseStack
- Specified by:
decreaseStack
in interfaceSingleStackInventory
- Mappings:
Namespace Name Mixin selector official c
Lene;c(I)Lcmy;
intermediary method_54078
Lnet/minecraft/class_8181;method_54078(I)Lnet/minecraft/class_1799;
named decreaseStack
Lnet/minecraft/inventory/SingleStackInventory;decreaseStack(I)Lnet/minecraft/item/ItemStack;
-
setStack
- Specified by:
setStack
in interfaceSingleStackInventory
- Mappings:
Namespace Name Mixin selector official b
Lene;b(Lcmy;)V
intermediary method_54077
Lnet/minecraft/class_8181;method_54077(Lnet/minecraft/class_1799;)V
named setStack
Lnet/minecraft/inventory/SingleStackInventory;setStack(Lnet/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 interfaceInventory
- Returns:
- the maximum number of items a stack can contain when placed inside this inventory
- Mappings:
Namespace Name Mixin selector official ak_
Lbju;ak_()I
intermediary method_5444
Lnet/minecraft/class_1263;method_5444()I
named getMaxCountPerStack
Lnet/minecraft/inventory/Inventory;getMaxCountPerStack()I
-
asBlockEntity
- Specified by:
asBlockEntity
in interfaceSingleStackInventory
- Mappings:
Namespace Name Mixin selector official y
Lene;y()Ldgv;
intermediary method_54080
Lnet/minecraft/class_8181;method_54080()Lnet/minecraft/class_2586;
named asBlockEntity
Lnet/minecraft/inventory/SingleStackInventory;asBlockEntity()Lnet/minecraft/block/entity/BlockEntity;
-
isValid
Returns whetherstack
is valid for theslot
.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 interfaceInventory
- Returns:
- whether
stack
is valid for theslot
- Mappings:
Namespace Name Mixin selector official b
Lbju;b(ILcmy;)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
Returns whether a hopper can transferstack
fromslot
to the hopper.This returns
true
by default.- Specified by:
canTransferTo
in interfaceInventory
- Returns:
- whether a hopper can transfer
stack
fromslot
to the hopper - Mappings:
Namespace Name Mixin selector official a
Lbju;a(Lbju;ILcmy;)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
- Mappings:
Namespace Name Mixin selector official a
Ldhw;a(Lctp;Lhx;)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 k
Ldhw;k()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
Ldhw;a(Lctp;Lhx;Ldjh;Ldhw;)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
- Mappings:
Namespace Name Mixin selector official a
Ldhw;a(Lcmy;)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
-