aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-06-26 02:55:56 -0500
committeringlettronald <inglettronald@gmail.com>2023-06-26 02:55:56 -0500
commitcc83deeaf522e06f9d7ff1c6d8b506b81bdecc7c (patch)
tree4286ba43e53e808b78629bba1d6b2e66cbb384f5 /src
parent075a29a609a4133f7dc758170cb2f2a3d5ea854c (diff)
downloadDulkirMod-cc83deeaf522e06f9d7ff1c6d8b506b81bdecc7c.tar.gz
DulkirMod-cc83deeaf522e06f9d7ff1c6d8b506b81bdecc7c.tar.bz2
DulkirMod-cc83deeaf522e06f9d7ff1c6d8b506b81bdecc7c.zip
bugfix
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/dulkirmod/features/ImpactDisplay.kt5
-rw-r--r--src/main/kotlin/dulkirmod/features/ReaperDisplay.kt5
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<Boolean>) {
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<Boolean>) {
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
}
}
}