From cc83deeaf522e06f9d7ff1c6d8b506b81bdecc7c Mon Sep 17 00:00:00 2001 From: inglettronald Date: Mon, 26 Jun 2023 02:55:56 -0500 Subject: bugfix --- src/main/kotlin/dulkirmod/features/ImpactDisplay.kt | 5 +++-- src/main/kotlin/dulkirmod/features/ReaperDisplay.kt | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/dulkirmod/features/ImpactDisplay.kt b/src/main/kotlin/dulkirmod/features/ImpactDisplay.kt index e1d3f07..9415edc 100644 --- a/src/main/kotlin/dulkirmod/features/ImpactDisplay.kt +++ b/src/main/kotlin/dulkirmod/features/ImpactDisplay.kt @@ -10,7 +10,8 @@ import kotlin.math.min object ImpactDisplay { - var lastImpact = 0L + private var lastImpact = 0L + private val bladeRegex = "(HYPERION|ASTRAEA|SCYLLA|VALKYRIE)".toRegex() fun shouldDisplay(stack: ItemStack, cir: CallbackInfoReturnable) { if (!isBlade(stack)) return @@ -43,7 +44,7 @@ object ImpactDisplay { val ea: NBTTagCompound = tag.getCompoundTag("ExtraAttributes") if (ea.hasKey("id", 8)) { val id = ea.getString("id") - return id matches "(HYPERION|ASTRAEA|SCYLLA|VALKYRIE)".toRegex() + return id matches bladeRegex } } } diff --git a/src/main/kotlin/dulkirmod/features/ReaperDisplay.kt b/src/main/kotlin/dulkirmod/features/ReaperDisplay.kt index f398ca2..c595775 100644 --- a/src/main/kotlin/dulkirmod/features/ReaperDisplay.kt +++ b/src/main/kotlin/dulkirmod/features/ReaperDisplay.kt @@ -10,7 +10,8 @@ import kotlin.math.min object ReaperDisplay { - var lastReaperUsage = 0L + private var lastReaperUsage = 0L + private val reaperRegex = "(REAPER_CHESTPLATE)|(REAPER_LEGGINGS)|(REAPER_BOOTS)".toRegex() fun shouldDisplay(stack: ItemStack, cir: CallbackInfoReturnable) { if (!isReaper(stack)) return @@ -43,7 +44,7 @@ object ReaperDisplay { val ea: NBTTagCompound = tag.getCompoundTag("ExtraAttributes") if (ea.hasKey("id", 8)) { val id = ea.getString("id") - return id matches "(REAPER_CHESTPLATE)|(REAPER_LEGGINGS)|(REAPER_BOOTS)".toRegex() + return id matches reaperRegex } } } -- cgit