From d14db9396bdb744201366a404d09f6f56761033b Mon Sep 17 00:00:00 2001 From: creeper123123321 <7974274+creeper123123321@users.noreply.github.com> Date: Tue, 20 Jul 2021 13:57:53 -0300 Subject: [PATCH] Fix idle ticking in proxies (#2631) --- .../bungee/providers/BungeeMovementTransmitter.java | 5 +++-- .../velocity/providers/VelocityMovementTransmitter.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bungee/src/main/java/com/viaversion/viaversion/bungee/providers/BungeeMovementTransmitter.java b/bungee/src/main/java/com/viaversion/viaversion/bungee/providers/BungeeMovementTransmitter.java index d49031ab4..dbf1958ae 100644 --- a/bungee/src/main/java/com/viaversion/viaversion/bungee/providers/BungeeMovementTransmitter.java +++ b/bungee/src/main/java/com/viaversion/viaversion/bungee/providers/BungeeMovementTransmitter.java @@ -39,13 +39,14 @@ public class BungeeMovementTransmitter extends MovementTransmitterProvider { public void sendPlayer(UserConnection userConnection) { if (userConnection.getProtocolInfo().getState() == State.PLAY) { PacketWrapper wrapper = PacketWrapper.create(0x03, null, userConnection); - wrapper.write(Type.BOOLEAN, userConnection.get(MovementTracker.class).isGround()); + MovementTracker tracker = userConnection.get(MovementTracker.class); + wrapper.write(Type.BOOLEAN, tracker.isGround()); try { wrapper.scheduleSendToServer(Protocol1_9To1_8.class); } catch (Exception e) { e.printStackTrace(); } - // PlayerPackets will increment idle + tracker.incrementIdlePacket(); } } } diff --git a/velocity/src/main/java/com/viaversion/viaversion/velocity/providers/VelocityMovementTransmitter.java b/velocity/src/main/java/com/viaversion/viaversion/velocity/providers/VelocityMovementTransmitter.java index e986accd9..c75290d62 100644 --- a/velocity/src/main/java/com/viaversion/viaversion/velocity/providers/VelocityMovementTransmitter.java +++ b/velocity/src/main/java/com/viaversion/viaversion/velocity/providers/VelocityMovementTransmitter.java @@ -39,13 +39,14 @@ public class VelocityMovementTransmitter extends MovementTransmitterProvider { public void sendPlayer(UserConnection userConnection) { if (userConnection.getProtocolInfo().getState() == State.PLAY) { PacketWrapper wrapper = PacketWrapper.create(0x03, null, userConnection); - wrapper.write(Type.BOOLEAN, userConnection.get(MovementTracker.class).isGround()); + MovementTracker tracker = userConnection.get(MovementTracker.class); + wrapper.write(Type.BOOLEAN, tracker.isGround()); try { wrapper.scheduleSendToServer(Protocol1_9To1_8.class); } catch (Exception e) { e.printStackTrace(); } - // PlayerPackets will increment idle + tracker.incrementIdlePacket(); } } }