From 5468a1828042e0dfa051d200083a46f710e2da2a Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 25 Oct 2022 13:52:45 +0700 Subject: [PATCH] Fix nanobots regeneration reset counters when damage received is zero Fixes #189 --- .../mc/otm/android/feature/NanobotsRegenerationFeature.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/NanobotsRegenerationFeature.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/NanobotsRegenerationFeature.kt index 4a0fcb6c5..5e9f5a147 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/NanobotsRegenerationFeature.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/NanobotsRegenerationFeature.kt @@ -41,8 +41,10 @@ class NanobotsRegenerationFeature(android: MatteryPlayerCapability) : AndroidFea } override fun onHurt(event: LivingHurtEvent) { - ticksPassed = 0 - healTicks = 0 + if (event.amount > 0f) { + ticksPassed = 0 + healTicks = 0 + } } override fun serializeNBT(): CompoundTag {