diff --git a/gradle.properties b/gradle.properties index a794b9b8..150f4a73 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/main/java/net/p3pp3rf1y/sophisticatedcore/upgrades/jukebox/StorageSoundHandler.java b/src/main/java/net/p3pp3rf1y/sophisticatedcore/upgrades/jukebox/StorageSoundHandler.java index d93c2bf4..c24e8eba 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedcore/upgrades/jukebox/StorageSoundHandler.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedcore/upgrades/jukebox/StorageSoundHandler.java @@ -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