From 3e2b524519512b9a6ed4ee666e0cb1386206363d Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 24 Oct 2022 18:05:53 +0700 Subject: [PATCH] Do not trigger glitch effect when damage received is zero or negative Fixes #143 --- .../ru/dbotthepony/mc/otm/capability/MatteryPlayerCapability.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/MatteryPlayerCapability.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/MatteryPlayerCapability.kt index 99bc0b40e..d996928a1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/MatteryPlayerCapability.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/MatteryPlayerCapability.kt @@ -391,7 +391,7 @@ class MatteryPlayerCapability(val ply: Player) : ICapabilityProvider, INBTSerial feature.onHurt(event) } - if (!event.isCanceled) { + if (!event.isCanceled && event.amount > 0f) { sendNetwork(GlitchPacket((event.amount * 300).toLong().coerceAtLeast(200L).coerceAtMost(800L))) } }