From f7c5fea87e140d822392e473e86360678d746e98 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Mon, 13 Apr 2020 22:52:38 +0100 Subject: [PATCH 1/3] Prevents animations from being sent to the server before the player has spawned --- .../network/translators/bedrock/BedrockAnimateTranslator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java index 7ccb24262..e64c161be 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java @@ -25,6 +25,7 @@ package org.geysermc.connector.network.translators.bedrock; +import org.geysermc.connector.GeyserConnector; import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.translators.PacketTranslator; import org.geysermc.connector.network.translators.Translator; @@ -40,6 +41,9 @@ public class BedrockAnimateTranslator extends PacketTranslator { @Override public void translate(AnimatePacket packet, GeyserSession session) { + // Stop the player sending animations before they have fully spawned into the server + if (!session.isSpawned()) { return; } + switch (packet.getAction()) { case SWING_ARM: // Delay so entity damage can be processed first From 522dc864de072970846164de5ad6332db0aa6784 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Tue, 14 Apr 2020 10:55:12 +0100 Subject: [PATCH 2/3] Removed unneeded import --- .../network/translators/bedrock/BedrockAnimateTranslator.java | 1 - 1 file changed, 1 deletion(-) diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java index e64c161be..8fecfb86e 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java @@ -25,7 +25,6 @@ package org.geysermc.connector.network.translators.bedrock; -import org.geysermc.connector.GeyserConnector; import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.translators.PacketTranslator; import org.geysermc.connector.network.translators.Translator; From 8fd4632d075d701b54591160304c897c4ff1d75b Mon Sep 17 00:00:00 2001 From: rtm516 Date: Wed, 15 Apr 2020 10:55:10 +0100 Subject: [PATCH 3/3] Fixed single line if statements --- .../network/translators/bedrock/BedrockAnimateTranslator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java index 8fecfb86e..af41c9e02 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java @@ -41,7 +41,9 @@ public class BedrockAnimateTranslator extends PacketTranslator { @Override public void translate(AnimatePacket packet, GeyserSession session) { // Stop the player sending animations before they have fully spawned into the server - if (!session.isSpawned()) { return; } + if (!session.isSpawned()) { + return; + } switch (packet.getAction()) { case SWING_ARM: