diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientCommonNetworkHandlerMixin.java b/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientCommonNetworkHandlerMixin.java index 1201372..a2bb466 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientCommonNetworkHandlerMixin.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientCommonNetworkHandlerMixin.java @@ -29,11 +29,13 @@ public class ClientCommonNetworkHandlerMixin { private void onSendPacket(Packet packet, CallbackInfo ci) { Stage lastStage = SongHandler.getInstance().lastStage; - if (!SongHandler.getInstance().isIdle() && lastStage != null && packet instanceof PlayerMoveC2SPacket) { - if (!Config.getConfig().rotate) { - connection.send(new PlayerMoveC2SPacket.Full(lastStage.position.getX() + 0.5, lastStage.position.getY(), lastStage.position.getZ() + 0.5, SongPlayer.MC.player.getYaw(), SongPlayer.MC.player.getPitch(), true)); - if (SongPlayer.fakePlayer != null) { - SongPlayer.fakePlayer.copyStagePosAndPlayerLook(); + if (!SongHandler.getInstance().isIdle() && packet instanceof PlayerMoveC2SPacket) { + if (lastStage != null) { + if (!Config.getConfig().rotate) { + connection.send(new PlayerMoveC2SPacket.Full(lastStage.position.getX() + 0.5, lastStage.position.getY(), lastStage.position.getZ() + 0.5, SongPlayer.MC.player.getYaw(), SongPlayer.MC.player.getPitch(), true)); + if (SongPlayer.fakePlayer != null) { + SongPlayer.fakePlayer.copyStagePosAndPlayerLook(); + } } } ci.cancel(); diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java b/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java index a4a1278..29fd86e 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java @@ -862,6 +862,6 @@ public class SongHandler { } public boolean isIdle() { - return currentSong == null && currentPlaylist == null && songQueue.isEmpty() && !cleaningUp; + return currentSong == null && currentPlaylist == null && songQueue.isEmpty() && !cleaningUp && !dirty; } } \ No newline at end of file