[SBM] Jukebox

[SBM] Jukebox

103k Downloads

[1.15.2] Records don't stop to play/ playing when fed into jukebox using hoppers and spamming

Opened this issue ยท 9 comments

commented

if you loop a jukebox with hoppers and put a music disk in it it plays all of them at once and doesnt stop when a new disk goes in so it gets horrible

commented

No longer present in 1.16

commented

Still happening to me on 1.16.5
Edit:Actually, if I use a lever on the hopper it doesn't but if I leave an unlocked hopper under it, then it does.
If I unlock the bottom hopper with songs in the input then it doesn't stop the last song also.

commented

Actually i figured out the bugs lol was just being dumb. Now it will lock its contents until it recieves a stop play event, then it will allow one grab then relock until the next play event.

commented

image
this setup now makes a perfectly fine, playlist esque jukebox.

commented

this still happens on 1.19.x
image
The above simple setup leads to spamming records constantly, is it possible to lock the disk in the jukebox until done playing?

commented

if you put mutliple disks in the chest it simply plays them all literally at once haha

commented

wouldnt it be possible in the extractItem method to check if its currently playing and return some sort of empty object or something, unsure

commented

Currently experimenting with implementing a listener for JUKEBOX_STOP_PLAY and JUKEBOX_PLAY but i find when i trigger the box through insertItem, JUKEBOX_PLAY is not triggered. Which was odd, considering taking a peek at the jukebox source code i see
image

Are you somehow playing the jukebox without it invoking playRecordTick(), is that what
jukebox.getLevel().levelEvent(null, 1010, jukebox.getBlockPos(), Item.getId(stack.getItem())); is doing? Cant figure out where the 1010 is coming from.

On top of that, it seems insertItem() is only called on the handler when it gets loaded by another item, and it is not triggered when a player inserts into the jukebox. Is there another capabillity i can't find that handles when a player inserts into an item? The Forge documentation only lists the one IItemHandler and i dont think its fluid/energy related.

commented

definitely need to be fixed