aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-13 21:50:16 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-13 21:50:16 +0200
commit31344fc364cde2cef243a49f1e7d4c4fbb390699 (patch)
tree2736d7f215cae69dfc11487accbf3d715b0290d5 /src/main/java
parent5bd6a4cd3807d128ba55c336946531a8838c51c7 (diff)
downloadskyhanni-31344fc364cde2cef243a49f1e7d4c4fbb390699.tar.gz
skyhanni-31344fc364cde2cef243a49f1e7d4c4fbb390699.tar.bz2
skyhanni-31344fc364cde2cef243a49f1e7d4c4fbb390699.zip
formatting
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt31
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt18
6 files changed, 40 insertions, 39 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index 28a8aa318..191b56c2a 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -69,9 +69,9 @@ class SkyHanniMod {
configManager = ConfigManager()
configManager.firstLoad()
initLogging()
- Runtime.getRuntime().addShutdownHook(Thread {
- configManager.saveConfig(ConfigFileType.FEATURES, "shutdown-hook")
- })
+ Runtime.getRuntime().addShutdownHook(
+ Thread { configManager.saveConfig(ConfigFileType.FEATURES, "shutdown-hook") },
+ )
repo = RepoManager(ConfigManager.configDirectory)
loadModule(repo)
try {
@@ -130,7 +130,7 @@ class SkyHanniMod {
val modules: MutableList<Any> = ArrayList()
private val globalJob: Job = Job(null)
val coroutineScope = CoroutineScope(
- CoroutineName("SkyHanni") + SupervisorJob(globalJob)
+ CoroutineName("SkyHanni") + SupervisorJob(globalJob),
)
var screenToOpen: GuiScreen? = null
private var screenTicks = 0
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
index a7e09b3f0..0f53a3e0c 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
@@ -95,14 +95,14 @@ object GuiEditManager {
SkyHanniMod.screenToOpen = GuiPositionEditor(
currentPositions.values().toList(),
2,
- Minecraft.getMinecraft().currentScreen as? GuiContainer
+ Minecraft.getMinecraft().currentScreen as? GuiContainer,
)
if (hotkeyReminder && lastHotkeyReminded.passedSince() > 30.minutes) {
lastHotkeyReminded = SimpleTimeMark.now()
ChatUtils.chat(
"§eTo edit hidden GUI elements:\n" +
" §7- §e1. Set a key in /sh edit.\n" +
- " §7- §e2. Click that key while the GUI element is visible."
+ " §7- §e2. Click that key while the GUI element is visible.",
)
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
index 8ade8f55e..94dc84efc 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
@@ -40,6 +40,7 @@ import kotlin.time.Duration.Companion.seconds
object HypixelData {
private val patternGroup = RepoPattern.group("data.hypixeldata")
+
// TODO add regex tests
private val serverNameConnectionPattern by patternGroup.pattern(
"servername.connection",
@@ -134,15 +135,15 @@ object HypixelData {
var skyBlockArea: String? = null
var skyBlockAreaWithSymbol: String? = null
- // Data from locraw
- var locrawData: JsonObject? = null
+ // Data from locraw
+ var locrawData: JsonObject? = null
private var locraw: MutableMap<String, String> = listOf(
"server",
- "gametype",
- "lobbyname",
- "lobbytype",
- "mode",
- "map",
+ "gametype",
+ "lobbyname",
+ "lobbytype",
+ "mode",
+ "map",
).associateWith { "" }.toMutableMap()
val server get() = locraw["server"] ?: ""
@@ -169,14 +170,14 @@ object HypixelData {
return
}
- ErrorManager.logErrorWithData(
- Exception("NoServerId"),
- "Could not find server id",
- "islandType" to LorenzUtils.skyBlockIsland,
- "tablist" to TabListData.getTabList(),
- "scoreboard" to ScoreboardData.sidebarLinesFormatted,
- )
- }
+ ErrorManager.logErrorWithData(
+ Exception("NoServerId"),
+ "Could not find server id",
+ "islandType" to LorenzUtils.skyBlockIsland,
+ "tablist" to TabListData.getTabList(),
+ "scoreboard" to ScoreboardData.sidebarLinesFormatted,
+ )
+ }
fun getPlayersOnCurrentServer(): Int {
var amount = 0
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt b/src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt
index 31499adb1..72abf6bab 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt
@@ -28,8 +28,6 @@ object ScoreboardData {
private val minecraftColorCodesPattern = "(?i)[0-9a-fkmolnr]".toPattern()
-
-
fun formatLines(rawList: List<String>): List<String> {
val list = mutableListOf<String>()
for (line in rawList) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt
index d41431726..a3054af48 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt
@@ -207,7 +207,7 @@ object DamageIndicatorManager {
data.nameAbove,
sizeNameAbove,
-18f,
- smallestDistanceVew = smallestDistanceVew
+ smallestDistanceVew = smallestDistanceVew,
)
}
@@ -245,7 +245,7 @@ object DamageIndicatorManager {
finalResult,
sizeFinalResults,
diff,
- smallestDistanceVew = smallestDistanceVew
+ smallestDistanceVew = smallestDistanceVew,
)
diff += 9f
}
@@ -264,7 +264,7 @@ object DamageIndicatorManager {
finalResult,
sizeFinalResults,
diff,
- smallestDistanceVew = smallestDistanceVew
+ smallestDistanceVew = smallestDistanceVew,
)
diff += 9f
}
@@ -303,7 +303,7 @@ object DamageIndicatorManager {
if (now > damageCounter.firstTick + 1_000) {
damageCounter.oldDamages.add(
- 0, OldDamage(now, damageCounter.currentDamage, damageCounter.currentHealing)
+ 0, OldDamage(now, damageCounter.currentDamage, damageCounter.currentHealing),
)
damageCounter.firstTick = 0L
damageCounter.currentDamage = 0
@@ -440,7 +440,7 @@ object DamageIndicatorManager {
entity as EntityMagmaCube,
entityData,
health.toInt(),
- maxHealth.toInt()
+ maxHealth.toInt(),
)
BossType.SLAYER_ZOMBIE_5 -> {
@@ -529,7 +529,7 @@ object DamageIndicatorManager {
}
return NumberUtil.percentageColor(
- calcHealth.toLong(), calcMaxHealth.toLong()
+ calcHealth.toLong(), calcMaxHealth.toLong(),
).getChatColor() + NumberUtil.format(calcHealth)
}
@@ -650,7 +650,7 @@ object DamageIndicatorManager {
else -> return null
}
var result = NumberUtil.percentageColor(
- calcHealth.toLong(), calcMaxHealth.toLong()
+ calcHealth.toLong(), calcMaxHealth.toLong(),
).getChatColor() + NumberUtil.format(calcHealth)
if (!SkyHanniMod.feature.slayer.endermen.phaseDisplay) {
@@ -831,7 +831,7 @@ object DamageIndicatorManager {
entityResult.delayedStart?.asTimeMark(),
entityResult.finalDungeonBoss,
entityResult.bossType,
- foundTime = SimpleTimeMark.now()
+ foundTime = SimpleTimeMark.now(),
)
DamageIndicatorDetectedEvent(entityData).postAndCatch()
return entityData
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
index b3dabadd5..4e1c51de3 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
@@ -197,7 +197,7 @@ object SkyHanniDebugsAndTests {
resetConfig()
},
prefix = false,
- oneTimeClick = true
+ oneTimeClick = true,
)
}
@@ -507,7 +507,7 @@ object SkyHanniDebugsAndTests {
if (Minecraft.getMinecraft().gameSettings.showDebugInfo && debugConfig.currentAreaDebug) {
config.debugLocationPos.renderString(
"Current Area: ${HypixelData.skyBlockArea}",
- posLabel = "SkyBlock Area (Debug)"
+ posLabel = "SkyBlock Area (Debug)",
)
}
@@ -523,7 +523,7 @@ object SkyHanniDebugsAndTests {
val scale = 0.1
val renderables = listOf(
ItemStack(Blocks.glass_pane), ItemStack(Items.diamond_sword), ItemStack(Items.skull),
- ItemStack(Blocks.melon_block)
+ ItemStack(Blocks.melon_block),
).map { item ->
generateSequence(scale) { it + 0.1 }.take(25).map {
Renderable.itemStack(item, it, xSpacing = 0).renderBounds()
@@ -531,7 +531,7 @@ object SkyHanniDebugsAndTests {
}.editCopy {
this.add(
0,
- generateSequence(scale) { it + 0.1 }.take(25).map { Renderable.string(it.round(1).toString()) }.toList()
+ generateSequence(scale) { it + 0.1 }.take(25).map { Renderable.string(it.round(1).toString()) }.toList(),
)
}
config.debugItemPos.renderRenderables(
@@ -540,10 +540,12 @@ object SkyHanniDebugsAndTests {
Renderable.horizontalContainer(
listOf(
Renderable.string("Test:").renderBounds(),
- Renderable.itemStack(ItemStack(Items.diamond_sword)).renderBounds()
- ), spacing = 1
- )
- ), posLabel = "Item Debug"
+ Renderable.itemStack(ItemStack(Items.diamond_sword)).renderBounds(),
+ ),
+ spacing = 1,
+ ),
+ ),
+ posLabel = "Item Debug",
)
}