From b0364ffc944addf2c32a1b8435c82d955de66872 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Tue, 4 Jan 2022 15:36:08 +0000 Subject: [PATCH] Added Tameable to Entity#tryAsPlayer --- .../src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt index d88006f..2572484 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt @@ -13,7 +13,8 @@ import org.bukkit.OfflinePlayer import org.bukkit.entity.Entity import org.bukkit.entity.Player import org.bukkit.entity.Projectile -import java.util.UUID +import org.bukkit.entity.Tameable +import java.util.* import kotlin.math.abs private val expMultiplierCache = mutableMapOf() @@ -180,6 +181,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 } } \ No newline at end of file