aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-09-29 18:10:12 +1000
committerGitHub <noreply@github.com>2024-09-29 10:10:12 +0200
commit37a186a932fcd81cfed66642e6a7833937f43b3a (patch)
tree46c88685f9b9ce804366d68bb96cb02a8e8b3ae4 /src/main/java/at/hannibal2/skyhanni/features/misc
parent1f4ce6c4207fe6ef6eaff48a35f61b18a524a429 (diff)
downloadskyhanni-37a186a932fcd81cfed66642e6a7833937f43b3a.tar.gz
skyhanni-37a186a932fcd81cfed66642e6a7833937f43b3a.tar.bz2
skyhanni-37a186a932fcd81cfed66642e6a7833937f43b3a.zip
Backend: Detekt Fixes Part 2 (#2607)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/IslandAreas.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/MagicalPowerDisplay.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/RoundedRectangleOutlineShader.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabLine.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/Enchant.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantParser.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/Category.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/ResetSuggestionState.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt2
12 files changed, 15 insertions, 17 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt
index bfecbc48f..a5062ee1d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt
@@ -14,10 +14,10 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.addString
import at.hannibal2.skyhanni.utils.HypixelCommands
import at.hannibal2.skyhanni.utils.KeyboardManager
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat
import at.hannibal2.skyhanni.utils.NumberUtil.formatDouble
import at.hannibal2.skyhanni.utils.NumberUtil.formatDoubleOrUserError
import at.hannibal2.skyhanni.utils.NumberUtil.formatIntOrUserError
+import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.RenderUtils.renderRenderables
import at.hannibal2.skyhanni.utils.StringUtils.cleanPlayerName
@@ -228,7 +228,7 @@ object CarryTracker {
add("§7Missing: §e$missing")
add("")
if (cost != "") {
- add("§7Total cost: §e${cost}")
+ add("§7Total cost: §e$cost")
add("§7Cost per carry: §e${formatCost(carry.type.pricePer)}")
} else {
add("§cNo price set for this carry!")
@@ -264,7 +264,7 @@ object CarryTracker {
val missingFormat = formatCost(totalCost - customer.alreadyPaid)
list.add(
Renderable.clickAndHover(
- Renderable.string("§b$customerName $paidFormat§8/${totalCostFormat}"),
+ Renderable.string("§b$customerName $paidFormat§8/$totalCostFormat"),
tips = listOf(
"§7Carries for §b$customerName",
"",
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/IslandAreas.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/IslandAreas.kt
index cddbd201d..faf3130b5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/IslandAreas.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/IslandAreas.kt
@@ -144,7 +144,7 @@ object IslandAreas {
val isTarget = node.name == targetNode?.name
val color = if (isTarget) LorenzColor.GOLD else tag.color
- val coloredName = "${color.getChatColor()}${name}"
+ val coloredName = "${color.getChatColor()}$name"
var suffix = ""
paths[node]?.let { path ->
@@ -161,7 +161,7 @@ object IslandAreas {
}
val distance = difference.roundTo(1)
- val text = "${coloredName}§7: §e$distance$suffix"
+ val text = "$coloredName§7: §e$distance$suffix"
if (!foundCurrentArea) {
foundCurrentArea = true
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/MagicalPowerDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MagicalPowerDisplay.kt
index e7b8ea26c..dedfe3473 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/MagicalPowerDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MagicalPowerDisplay.kt
@@ -93,7 +93,7 @@ object MagicalPowerDisplay {
else -> if (internalName.isAbicase()) endMP += (contactAmount ?: 0) / 2
}
- event.stackTip = "${if (config.colored) rarity.chatColorCode else "§7"}${endMP}"
+ event.stackTip = "${if (config.colored) rarity.chatColorCode else "§7"}$endMP"
}
@SubscribeEvent
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt
index c34a49a7d..98d420525 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt
@@ -4,7 +4,6 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
-import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import net.minecraft.util.EnumParticleTypes
import net.minecraftforge.client.event.RenderBlockOverlayEvent
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/RoundedRectangleOutlineShader.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/RoundedRectangleOutlineShader.kt
index ea8770081..2a5e131fa 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/RoundedRectangleOutlineShader.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/RoundedRectangleOutlineShader.kt
@@ -27,4 +27,4 @@ object RoundedRectangleOutlineShader : Shader("rounded_rect_outline", "rounded_r
registerUniform(Uniform.UniformType.FLOAT, "borderThickness") { borderThickness }
registerUniform(Uniform.UniformType.FLOAT, "borderBlur") { borderBlur }
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabLine.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabLine.kt
index 96b89ce17..a2c227bd7 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabLine.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabLine.kt
@@ -35,4 +35,4 @@ class TabLine(val text: String, val type: TabStringType, val customName: String
this.entity = entity
return entity
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt
index 3f56230c4..2f58a4fd1 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt
@@ -920,11 +920,11 @@ object EstimatedItemValueCalculator {
fun Pair<String, Int>.getAttributeName(): String {
val name = first.fixMending().allLettersFirstUppercase()
- return "§b$name ${second} Shard"
+ return "§b$name $second Shard"
}
fun Pair<String, Int>.getAttributePrice(): Double? = EstimatedItemValueCalculator.getPriceOrCompositePriceForAttribute(
- "ATTRIBUTE_SHARD+ATTRIBUTE_" + first,
+ "ATTRIBUTE_SHARD+ATTRIBUTE_$first",
second,
)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/Enchant.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/Enchant.kt
index 244cc54be..6432be2f6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/Enchant.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/Enchant.kt
@@ -10,8 +10,8 @@ import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import com.google.gson.annotations.Expose
import io.github.notenoughupdates.moulconfig.observer.Property
-import java.util.TreeSet
import net.minecraft.item.ItemStack
+import java.util.TreeSet
open class Enchant : Comparable<Enchant> {
@Expose
@@ -110,7 +110,7 @@ open class Enchant : Comparable<Enchant> {
@Expose
private var stackLevel: TreeSet<Int>? = null
- override fun toString() = "$nbtNum ${stackLevel.toString()} ${super.toString()}"
+ override fun toString() = "$nbtNum $stackLevel ${super.toString()}"
}
class Dummy(name: String) : Enchant() {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantParser.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantParser.kt
index 66c4c0407..162d2adee 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantParser.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantParser.kt
@@ -22,7 +22,6 @@ import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getExtraAttributes
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
-import java.lang.ArithmeticException
import net.minecraft.event.HoverEvent
import net.minecraft.item.ItemStack
import net.minecraft.util.ChatComponentText
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/Category.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/Category.kt
index 3172df6e0..b69e5913d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/Category.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/Category.kt
@@ -1,3 +1,3 @@
package at.hannibal2.skyhanni.features.misc.massconfiguration
-data class Category(val name: String, val description: String) \ No newline at end of file
+data class Category(val name: String, val description: String)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/ResetSuggestionState.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/ResetSuggestionState.kt
index 30a78a7b2..60d809633 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/ResetSuggestionState.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/ResetSuggestionState.kt
@@ -7,4 +7,4 @@ enum class ResetSuggestionState(val label: String) {
;
val next get() = entries[(ordinal + 1) % entries.size]
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt
index f56185aba..84d86615d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt
@@ -49,7 +49,7 @@ class GuiOptionEditorUpdateCheck(option: ProcessedOption) : GuiOptionEditor(opti
val sameVersion = currentVersion.equals(nextVersion, true)
TextRenderUtils.drawStringCenteredScaledMaxWidth(
"${if (UpdateManager.updateState == UpdateManager.UpdateState.NONE) GREEN else RED}$currentVersion" +
- if (nextVersion != null && !sameVersion) "➜ ${GREEN}${nextVersion}" else "",
+ if (nextVersion != null && !sameVersion) "➜ $GREEN$nextVersion" else "",
fr,
widthRemaining / 4F,
10F,