Merge pull request #331 from rtm516/early-animation-fix

Prevents animations from being sent to the server before the player has spawned
This commit is contained in:
Redned 2020-04-15 14:36:06 -05:00 committed by GitHub
commit 09e5bbb466
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,6 +40,11 @@ public class BedrockAnimateTranslator extends PacketTranslator<AnimatePacket> {
@Override @Override
public void translate(AnimatePacket packet, GeyserSession session) { 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()) { switch (packet.getAction()) {
case SWING_ARM: case SWING_ARM:
// Delay so entity damage can be processed first // Delay so entity damage can be processed first