diff options
author | David Cole <40234707+DavidArthurCole@users.noreply.github.com> | 2024-09-28 15:23:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-28 21:23:23 +0200 |
commit | 2178deb82a1cc3305113db1fbeee939cd7272d2e (patch) | |
tree | b711c96d4af599588f3bd32b5d4229f8c24251b2 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 633b8f0bdd9b05f553b1bc521a83b4b7de238125 (diff) | |
download | skyhanni-2178deb82a1cc3305113db1fbeee939cd7272d2e.tar.gz skyhanni-2178deb82a1cc3305113db1fbeee939cd7272d2e.tar.bz2 skyhanni-2178deb82a1cc3305113db1fbeee939cd7272d2e.zip |
Backend: Detekt Fixes Part 3 (#2606)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ItemNameResolver.kt | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt | 1 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 1 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/json/ItemStackTypeAdapterFactory.kt (renamed from src/main/java/at/hannibal2/skyhanni/utils/json/ItemStackTypeAdapter.kt) | 0 |
5 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt index fd240b145..7ff17f965 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt @@ -61,8 +61,8 @@ object InventoryUtils { getItemsInOwnInventory().filter { predicate(it) }.sumOf { it.stackSize } fun inStorage() = openInventoryName().let { - (it.contains("Storage") && !it.contains("Rift Storage")) - || it.contains("Ender Chest") || it.contains("Backpack") + (it.contains("Storage") && !it.contains("Rift Storage")) || + it.contains("Ender Chest") || it.contains("Backpack") } fun getItemInHand(): ItemStack? = Minecraft.getMinecraft().thePlayer.heldItem diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemNameResolver.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemNameResolver.kt index 996d19a93..e3776308f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemNameResolver.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemNameResolver.kt @@ -100,9 +100,9 @@ object ItemNameResolver { UtilsPatterns.enchantmentNamePattern.matchMatcher(enchantmentName) { val name = group("name").trim { it <= ' ' } val ultimate = group("format").lowercase().contains("§l") - ((if (ultimate && name != "Ultimate Wise" && name != "Ultimate Jerry") "ULTIMATE_" else "") - + turboCheck(name).replace(" ", "_").replace("-", "_").uppercase() - + ";" + group("level").romanToDecimal()) + ((if (ultimate && name != "Ultimate Wise" && name != "Ultimate Jerry") "ULTIMATE_" else "") + + turboCheck(name).replace(" ", "_").replace("-", "_").uppercase() + + ";" + group("level").romanToDecimal()) } private fun turboCheck(text: String): String { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt index dde61c7c1..19e912215 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt @@ -14,6 +14,7 @@ import org.apache.logging.log4j.core.LoggerContext import org.apache.logging.log4j.core.filter.AbstractFilter import org.apache.logging.log4j.message.Message +@Suppress("CommentWrapping") class MinecraftConsoleFilter(private val loggerConfigName: String) : AbstractFilter( /* onMatch = */ Filter.Result.ACCEPT, /* onMismatch = */ Filter.Result.DENY, diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index 609ccebae..805db90f5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -52,6 +52,7 @@ import kotlin.math.sqrt import kotlin.time.Duration import kotlin.time.DurationUnit +@Suppress("LargeClass") object RenderUtils { enum class HorizontalAlignment(private val value: String) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/json/ItemStackTypeAdapter.kt b/src/main/java/at/hannibal2/skyhanni/utils/json/ItemStackTypeAdapterFactory.kt index 1940b03c0..1940b03c0 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/json/ItemStackTypeAdapter.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/json/ItemStackTypeAdapterFactory.kt |