Skip to content

Commit

Permalink
fix: šŸ› Tuned where jukebox in backpack plays its sound so that it's pā€¦
Browse files Browse the repository at this point in the history
ā€¦ositioned always in front of player's face and thus doesn't change its volume as player moves around (especially looking up / down or jumping around)
  • Loading branch information
P3pp3rF1y committed Jan 8, 2025
1 parent 6b747d8 commit 6e079a4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.daemon=false

mod_id=sophisticatedcore
mod_group_id=sophisticatedcore
mod_version=1.1.0
mod_version=1.1.1
sonar_project_key=sophisticatedcore:SophisticatedCore
github_package_url=https://maven.pkg.github.com/P3pp3rF1y/SophisticatedCore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,18 @@ public static void playStorageSound(SoundEvent soundEvent, UUID storageUuid, int
if (entity == null) {
return;
}
playStorageSound(storageUuid, new EntityBoundSoundInstance(soundEvent, SoundSource.RECORDS, 2, 1, entity, level.random.nextLong()) {{
if (entity instanceof Player player) {
this.y = player.getEyeY();
playStorageSound(storageUuid, new EntityBoundSoundInstance(soundEvent, SoundSource.RECORDS, 2, 1, entity, level.random.nextLong()) {
@Override
public void tick() {
super.tick();
if (entity instanceof Player player) {
Vec3 lookAngle = player.getLookAngle();
this.x = player.getX() + lookAngle.x;
this.y = player.getEyeY() + lookAngle.y;
this.z = player.getZ() + lookAngle.z;
}
}
}});
});
}

@SuppressWarnings({"unused", "java:S1172"}) // needs to be here for addListener to recognize which event this method should be subscribed to
Expand Down

0 comments on commit 6e079a4

Please sign in to comment.