From 6fc4005c723ff4f4c46d2401bd08e435f7e116c2 Mon Sep 17 00:00:00 2001 From: StealWonders <6114858+StealWonders@users.noreply.github.com> Date: Tue, 11 Jan 2022 11:02:23 +0100 Subject: [PATCH] Fix for unwanted audio panning (#3430) * Fixes https://github.com/IntellectualSites/PlotSquared/issues/3422 * Removed old code Co-authored-by: Alex --- .../main/java/com/plotsquared/core/listener/PlotListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java b/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java index d4871ae6f..5cd38cde8 100644 --- a/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java +++ b/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java @@ -281,7 +281,7 @@ public class PlotListener { Location location = player.getLocation(); Location lastLocation = musicMeta.get().orElse(null); if (lastLocation != null) { - player.playMusic(lastLocation, musicFlag); + plot.getCenter(center -> player.playMusic(center.add(0, Short.MAX_VALUE, 0), musicFlag)); if (musicFlag == ItemTypes.AIR) { musicMeta.remove(); } @@ -289,7 +289,7 @@ public class PlotListener { if (musicFlag != ItemTypes.AIR) { try { musicMeta.set(location); - player.playMusic(location, musicFlag); + plot.getCenter(center -> player.playMusic(center.add(0, Short.MAX_VALUE, 0), musicFlag)); } catch (Exception ignored) { } }