From 9a1f9990f859bd0f292d7ab9d756dd12a56c31a6 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Mon, 3 Jan 2022 13:23:33 +0000 Subject: [PATCH] Added Tameable entities to Entity#tryAsPlayer --- eco-api/src/main/kotlin/com/willfp/libreforge/LibReforge.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eco-api/src/main/kotlin/com/willfp/libreforge/LibReforge.kt b/eco-api/src/main/kotlin/com/willfp/libreforge/LibReforge.kt index 2c0793cdc..c217caa82 100644 --- a/eco-api/src/main/kotlin/com/willfp/libreforge/LibReforge.kt +++ b/eco-api/src/main/kotlin/com/willfp/libreforge/LibReforge.kt @@ -16,6 +16,7 @@ import org.bukkit.Bukkit import org.bukkit.entity.Entity import org.bukkit.entity.Player import org.bukkit.entity.Projectile +import org.bukkit.entity.Tameable import java.util.* private val holderProviders = mutableSetOf() @@ -209,6 +210,7 @@ fun Entity.tryAsPlayer(): Player? { return when (this) { is Projectile -> this.shooter as? Player is Player -> this + is Tameable -> this.owner as? Player else -> null } }