aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-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
}
}
}