From 0caee67e43480ec07ef9ca5f4e70cd3409ba5cd4 Mon Sep 17 00:00:00 2001 From: William Johnstone Date: Fri, 27 Mar 2020 23:39:53 +0000 Subject: [PATCH] Finalise block breaking, (water calculations omitted because of no access to server api) --- .../org/geysermc/connector/entity/PlayerEntity.java | 1 + .../connector/network/translators/Registry.java | 3 +++ .../entity/player/JavaPlayerActionAckTranslator.java | 3 --- .../java/org/geysermc/connector/utils/BlockUtils.java | 10 +++------- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/entity/PlayerEntity.java b/connector/src/main/java/org/geysermc/connector/entity/PlayerEntity.java index c7a0f96ca..ec849ec29 100644 --- a/connector/src/main/java/org/geysermc/connector/entity/PlayerEntity.java +++ b/connector/src/main/java/org/geysermc/connector/entity/PlayerEntity.java @@ -53,6 +53,7 @@ public class PlayerEntity extends LivingEntity { private boolean playerList = true; private final EntityEffectCache effectCache; + public PlayerEntity(GameProfile gameProfile, long entityId, long geyserId, Vector3f position, Vector3f motion, Vector3f rotation) { super(entityId, geyserId, EntityType.PLAYER, position, motion, rotation); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/Registry.java b/connector/src/main/java/org/geysermc/connector/network/translators/Registry.java index f32fe4b6d..866a454f3 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/Registry.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/Registry.java @@ -47,12 +47,15 @@ public class Registry { BEDROCK.MAP.put(clazz, translator); } + @SuppressWarnings("unchecked") public

boolean translate(Class clazz, P packet, GeyserSession session) { if (!session.getUpstream().isClosed() && !session.isClosed()) { try { if (MAP.containsKey(clazz)) { ((PacketTranslator

) MAP.get(clazz)).translate(packet, session); return true; + } else { + GeyserConnector.getInstance().getLogger().debug("Could not find packet for " + (packet.toString().length() > 25 ? packet.getClass().getSimpleName() : packet)); } } catch (Throwable ex) { GeyserConnector.getInstance().getLogger().error("Could not translate packet " + packet.getClass().getSimpleName(), ex); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerActionAckTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerActionAckTranslator.java index a338650d8..fe72b669a 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerActionAckTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerActionAckTranslator.java @@ -65,12 +65,9 @@ public class JavaPlayerActionAckTranslator extends PacketTranslator