boolean translate(Class extends P> clazz, P packet, GeyserSession session) { - try { - if (MAP.containsKey(clazz)) { - ((PacketTranslator
) MAP.get(clazz)).translate(packet, session); - return true; + if (!session.getUpstream().isClosed() && !session.isClosed()) { + try { + if (MAP.containsKey(clazz)) { + ((PacketTranslator
) MAP.get(clazz)).translate(packet, session);
+ return true;
+ }
+ } catch (Throwable ex) {
+ GeyserLogger.DEFAULT.error("Could not translate packet " + packet.getClass().getSimpleName(), ex);
+ ex.printStackTrace();
}
- } catch (NullPointerException ex) {
- GeyserLogger.DEFAULT.error("Could not translate packet " + packet.getClass().getSimpleName(), ex);
}
return false;
}
diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/TranslatorsInit.java b/connector/src/main/java/org/geysermc/connector/network/translators/TranslatorsInit.java
index b48483a4..f9bb11cf 100644
--- a/connector/src/main/java/org/geysermc/connector/network/translators/TranslatorsInit.java
+++ b/connector/src/main/java/org/geysermc/connector/network/translators/TranslatorsInit.java
@@ -146,10 +146,11 @@ public class TranslatorsInit {
Registry.registerBedrock(AnimatePacket.class, new BedrockAnimateTranslator());
Registry.registerBedrock(CommandRequestPacket.class, new BedrockCommandRequestTranslator());
- Registry.registerBedrock(TextPacket.class, new BedrockTextTranslator());
Registry.registerBedrock(MobEquipmentPacket.class, new BedrockMobEquipmentTranslator());
- Registry.registerBedrock(PlayerActionPacket.class, new BedrockActionTranslator());
Registry.registerBedrock(MovePlayerPacket.class, new BedrockMovePlayerTranslator());
+ Registry.registerBedrock(PlayerActionPacket.class, new BedrockActionTranslator());
+ Registry.registerBedrock(SetLocalPlayerAsInitializedPacket.class, new BedrockPlayerInitialized());
+ Registry.registerBedrock(TextPacket.class, new BedrockTextTranslator());
itemTranslator = new ItemTranslator();
blockTranslator = new BlockTranslator();
diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMovePlayerTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMovePlayerTranslator.java
index a09d0daa..3891af6f 100644
--- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMovePlayerTranslator.java
+++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMovePlayerTranslator.java
@@ -53,9 +53,10 @@ public class BedrockMovePlayerTranslator extends PacketTranslator