From 3220532083982f2357c9c8c35cd2e6046c712208 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Sun, 17 May 2020 05:57:18 +0100 Subject: [PATCH] Fixed fishing rod lines not connecting to other players (#580) --- .../geysermc/connector/entity/FishingHookEntity.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/entity/FishingHookEntity.java b/connector/src/main/java/org/geysermc/connector/entity/FishingHookEntity.java index 8d8d5ef2..808e1667 100644 --- a/connector/src/main/java/org/geysermc/connector/entity/FishingHookEntity.java +++ b/connector/src/main/java/org/geysermc/connector/entity/FishingHookEntity.java @@ -37,10 +37,14 @@ public class FishingHookEntity extends Entity { public FishingHookEntity(long entityId, long geyserId, EntityType entityType, Vector3f position, Vector3f motion, Vector3f rotation, ProjectileData data) { super(entityId, geyserId, entityType, position, motion, rotation); - // TODO: Find a better way to do this for (GeyserSession session : GeyserConnector.getInstance().getPlayers().values()) { - if (session.getPlayerEntity().getEntityId() == data.getOwnerId()) { - this.metadata.put(EntityData.OWNER_EID, session.getPlayerEntity().getGeyserId()); + Entity entity = session.getEntityCache().getEntityByJavaId(data.getOwnerId()); + if (entity == null && session.getPlayerEntity().getEntityId() == data.getOwnerId()) { + entity = session.getPlayerEntity(); + } + + if (entity != null) { + this.metadata.put(EntityData.OWNER_EID, entity.getGeyserId()); return; } }