The Bug:
Jukeboxes now produce a musical note particle when playing a disc, the same one the Noteblock uses. It cycles through a few colors, but it doesn't seem to utilize all of the available ones, seemingly sticking to only warmer colors of the spectrum.
This behavior can be seen here, where a Noteblock is shown with every possible color the particle can utilize, while the jukebox only seems to do warmer colors:
Code Analysis (Yarn Mappings) Thanks to haykam:
The following code calculates the jukebox particle color:
world.getRandom().nextInt(4) / 24fFor comparison, the following code calculates the note block particle color:
Math.pow(2, (note - 12) / 12d) / 24fAs a result, note blocks' particle color ranges from 0 to 0.04166666667 while jukeboxes' particle color ranges from 0 to 0.125. Also note that note blocks' particle colors have 24 steps while jukeboxes' particle colors have only 4 steps.
Steps to Reproduce:
Play a Jukebox in the 23w06a+
Watch the particles it produces
Compare it to the Noteblock's particles, and notice how the jukebox only ever displays a few of the possible colors. Namely only "warm" colors.
Code analysis (Yarn mappings)
The following code calculates the jukebox particle color:
For comparison, the following code calculates the note block particle color:
As a result, note blocks' particle color ranges from 0 to 0.04166666667 while jukeboxes' particle color ranges from 0 to 0.125. Also note that note blocks' particle colors have 24 steps while jukeboxes' particle colors have only 4 steps.