Commit 7a76e529 authored by Linus K.'s avatar Linus K.
Browse files

Some adjustments

parent d19dd50f
Pipeline #131 passed with stage
in 42 seconds
......@@ -6,6 +6,7 @@ import org.bukkit.entity.*
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.entity.EntityDamageByEntityEvent
import kotlin.math.abs
class KillCatsListener: Listener {
......@@ -37,6 +38,8 @@ class KillCatsListener: Listener {
.asSequence()
.filterIsInstance<Creature>()
.filter { it.type in CAT_KILLERS }
.filter { it.target == null || it.target !is Cat }
.filter { abs(it.location.y - cat.location.y) < 3.0 }
.filter { it.location.distance(cat.location) < 25.0 }
.minBy { it.location.distance(cat.location) }
if(newKiller != null) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment