Fixed glitch with sending extra movement packet after cleanup
This commit is contained in:
parent
2363900c05
commit
707b5e6f0c
2 changed files with 8 additions and 6 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue