Fix inability to toggle sitting of parrots

This commit is contained in:
Camotoy 2022-03-10 15:16:08 -05:00
parent d0d01714aa
commit 7f5d81772b
1 changed files with 7 additions and 1 deletions

View File

@ -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