mirror of
https://github.com/Auxilor/EcoSkills.git
synced 2026-01-06 15:51:52 +00:00
Cleaned up Entity#tryAsPlayer
This commit is contained in:
@@ -171,10 +171,7 @@ fun Player.setStatLevel(stat: Stat, level: Int) {
|
||||
|
||||
fun Entity.tryAsPlayer(): Player? {
|
||||
return when (this) {
|
||||
is Projectile -> {
|
||||
val shooter = this.shooter
|
||||
if (shooter is Player) shooter else null
|
||||
}
|
||||
is Projectile -> this.shooter as? Player
|
||||
is Player -> this
|
||||
else -> null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user