From 7f5d81772b035a6f9b9e3e77fd5d93591f9c97e4 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Thu, 10 Mar 2022 15:16:08 -0500 Subject: [PATCH] Fix inability to toggle sitting of parrots --- .../type/living/animal/tameable/TameableEntity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/TameableEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/TameableEntity.java index 50d17eaaa..33b2144e8 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/TameableEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/TameableEntity.java @@ -61,7 +61,13 @@ public class TameableEntity extends AnimalEntity { // Note: Must be set for wolf collar color to work if (entityMetadata.getValue().isPresent()) { // Owner UUID of entity - Entity entity = session.getEntityCache().getPlayerEntity(entityMetadata.getValue().get()); + UUID uuid = entityMetadata.getValue().get(); + Entity entity; + if (uuid.equals(session.getPlayerEntity().getUuid())) { + entity = session.getPlayerEntity(); + } else { + entity = session.getEntityCache().getPlayerEntity(uuid); + } // Used as both a check since the player isn't in the entity cache and a normal fallback if (entity == null) { // Set to tame, but indicate that we are not the player that owns this