[1.15.2] Records don't stop to play/ playing when fed into jukebox using hoppers and spamming
Opened this issue ยท 9 comments
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
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.
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.
if you put mutliple disks in the chest it simply plays them all literally at once haha
wouldnt it be possible in the extractItem method to check if its currently playing and return some sort of empty object or something, unsure
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
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.