Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-199227

Jukebox sound source incorrectly positioned

    XMLWordPrintable

    Details

    • Confirmation Status:
      Unconfirmed
    • Category:
      (Unassigned)

      Description

      When listening closely to the music from a jukebox it becomes obvious that the music is not coming from the center of the block, but from the corner.

      What I expected to happen:

      I expected the music to come from the center of the jukebox, as all sides show a speaker-like texture (so the most logic place for the sound to come from is the center) and the slot where the music disc goes into the jukebox is also positioned in the center of the block.

      What actually happened:

      The music came out of the lower, north-west corner of the jukebox. This is barely/not hearable when at a range of more than two blocks away from the jukebox, but when listening closely with a stereo headset it becomes pretty obvious that the sound is not correctly positioned.

      To reproduce:

      The effect is best hearable through a stereo-supporting headset.

      1. Place down a jukebox
      2. Put a random music disc in the jukebox
      3. Do a little dance unless you play 11 or 13
      4. Teleport on top of the jukebox, right in the center
      5. Turn around while looking straight down and hear that the sound source position changes relative to you
         This should not happen when the music is supposed to come from the center
      6. Now move to the corner at the north-west side of the jukebox
      7. Turn around again and hear the sound not moving at all
         This means the sound source is positioned at the corner of the jukebox, and not in the center

      Probable fix:

      Looking at the code this Jukebox issue can be easily fixed. Decompiling the code (with Mojang mappings) I see this in LevelRenderer.playStreamingSound(...):

      soundinstance = SimpleSoundInstance.forRecord(soundevent, blockpos.getX(), blockpos.getY(), blockpos.getZ());
      

      While, to make the sound come from the correct position: the center, an offset of 0.5 should be added to each coordinate of the sound source:

      soundinstance = SimpleSoundInstance.forRecord(soundevent, blockpos.getX() + 0.5f, blockpos.getY() + 0.5f, blockpos.getZ() + 0.5f);

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              RGSW Shadew
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: