From 15522aed52b515b133f2866788ba8cd5731cd3a1 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sun, 19 Dec 2021 19:15:53 -0500 Subject: [PATCH] Fix fishing rod behavior on Geyser players Fixes #2716 --- .../geyser/entity/type/FishingHookEntity.java | 12 +++--------- .../java/entity/JavaEntityEventTranslator.java | 4 ++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java index 9a85a14a2..3bfa0ee53 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java @@ -50,7 +50,7 @@ public class FishingHookEntity extends ThrowableEntity { private boolean inWater = false; @Getter - private final boolean isOwnerSessionPlayer; + private final long bedrockOwnerId; @Getter private long bedrockTargetId; @@ -66,14 +66,8 @@ public class FishingHookEntity extends ThrowableEntity { // so that it can be handled by moveAbsoluteImmediate. setBoundingBoxHeight(128); - isOwnerSessionPlayer = owner.getGeyserId() == session.getPlayerEntity().getGeyserId(); - this.dirtyMetadata.put(EntityData.OWNER_EID, owner.getGeyserId()); - } - - @Override - public void spawnEntity() { - - super.spawnEntity(); + this.bedrockOwnerId = owner.getGeyserId(); + this.dirtyMetadata.put(EntityData.OWNER_EID, this.bedrockOwnerId); } public void setHookedEntity(IntEntityMetadata entityMetadata) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaEntityEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaEntityEventTranslator.java index ce08d8287..00bea4908 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaEntityEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaEntityEventTranslator.java @@ -119,8 +119,8 @@ public class JavaEntityEventTranslator extends PacketTranslator