summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2024-02-10 00:24:52 +0100
committerGitHub <noreply@github.com>2024-02-10 00:24:52 +0100
commit4559e5ff05e19817a21ae49f1c0d8a97d273f6a1 (patch)
treee72dac91d07fc84bea80548c89e13276caa68b81 /src/main/java/at/hannibal2/skyhanni/data
parentd3a7cc4ab970b457b7950489da781539e45e0dce (diff)
downloadskyhanni-4559e5ff05e19817a21ae49f1c0d8a97d273f6a1.tar.gz
skyhanni-4559e5ff05e19817a21ae49f1c0d8a97d273f6a1.tar.bz2
skyhanni-4559e5ff05e19817a21ae49f1c0d8a97d273f6a1.zip
Splitting many utils functions from LorenzUtils up into other classes: ChatUtils, CollectionUtils, ConditionalUtils. And code cleanup #978
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/EventCounter.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/FriendAPI.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt14
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/GuildAPI.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt29
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/IslandType.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ItemRenderBackground.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/LocationFixData.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt14
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/PurseAPI.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/RenderData.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ToolTipData.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/TrackerManager.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/ContributorListJson.java1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/GardenJson.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/ItemsJson.java1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/model/ComposterUpgrade.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt28
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/repo/RepoUtils.kt8
34 files changed, 115 insertions, 77 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt b/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt
index 08bef76ff..d631e8e26 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt
@@ -9,8 +9,7 @@ import at.hannibal2.skyhanni.features.chat.ChatFilterGui
import at.hannibal2.skyhanni.utils.IdentityCharacteristics
import at.hannibal2.skyhanni.utils.LorenzLogger
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.LorenzUtils.chat
-import at.hannibal2.skyhanni.utils.LorenzUtils.makeAccessible
+import at.hannibal2.skyhanni.utils.ReflectionUtils.makeAccessible
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.ChatLine
import net.minecraft.client.gui.GuiNewChat
@@ -54,6 +53,7 @@ object ChatManager {
val renderedString = "$format$name"
companion object {
+
val maxLength by lazy {
entries.maxOf { Minecraft.getMinecraft().fontRendererObj.getStringWidth(it.renderedString) }
}
@@ -64,7 +64,7 @@ object ChatManager {
val message: IChatComponent,
var actionKind: ActionKind,
var actionReason: String?,
- val modified: IChatComponent?
+ val modified: IChatComponent?,
)
@SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true)
@@ -77,7 +77,6 @@ object ChatManager {
val actionBarEvent = LorenzActionBarEvent(message)
actionBarEvent.postAndCatch()
}
-
}
@SubscribeEvent
diff --git a/src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt
index ad5d01d3c..9ea5742a1 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt
@@ -20,6 +20,7 @@ import java.io.ByteArrayInputStream
import java.util.Base64
class CropAccessoryData {
+
// TODO USE SH-REPO
private val accessoryBagNamePattern = "Accessory Bag \\((?<current>\\d)/(?<total>\\d)\\)".toPattern()
private var loadedAccessoryThisProfile = false
@@ -89,12 +90,12 @@ class CropAccessoryData {
}
}
-
private fun bestCropAccessory(items: Iterable<ItemStack>) =
items.mapNotNull { item -> CropAccessory.getByName(item.getInternalName()) }
.maxOrNull() ?: CropAccessory.NONE
companion object {
+
var accessoryBagPageCount = 0
private set
diff --git a/src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt b/src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt
index dec06dc8e..ae5a03878 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt
@@ -13,6 +13,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class EntityMovementData {
companion object {
+
private val entityLocation = mutableMapOf<Entity, LorenzVec>()
fun addToTrack(entity: Entity) {
diff --git a/src/main/java/at/hannibal2/skyhanni/data/EventCounter.kt b/src/main/java/at/hannibal2/skyhanni/data/EventCounter.kt
index 70de5e436..f7a730a65 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/EventCounter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/EventCounter.kt
@@ -1,13 +1,14 @@
package at.hannibal2.skyhanni.data
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.utils.CollectionUtils.addOrPut
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.LorenzUtils.addOrPut
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import kotlin.time.Duration.Companion.seconds
object EventCounter {
+
private val config get() = SkyHanniMod.feature.dev.debug
private var map = mutableMapOf<String, Int>()
diff --git a/src/main/java/at/hannibal2/skyhanni/data/FriendAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/FriendAPI.kt
index 834ccaa55..c9cfcc62f 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/FriendAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/FriendAPI.kt
@@ -15,6 +15,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.util.UUID
object FriendAPI {
+
// TODO USE SH-REPO
private val removedFriendPattern =
".*\n§r§eYou removed §r(?<name>.*)§e from your friends list!§r§9§m\n.*".toPattern()
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt
index 34baceb0b..dfa275cb7 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.data
+import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson
import at.hannibal2.skyhanni.events.CropMilestoneUpdateEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.RepositoryReloadEvent
@@ -8,11 +9,11 @@ import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
-import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson
import net.minecraft.item.ItemStack
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
object GardenCropMilestones {
+
// TODO USE SH-REPO
private val cropPattern = "§7Harvest §f(?<name>.*) §7on .*".toPattern()
val totalPattern = "§7Total: §a(?<name>.*)".toPattern()
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt
index 71398af27..950f226f1 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt
@@ -6,11 +6,12 @@ import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson
import at.hannibal2.skyhanni.events.RepositoryReloadEvent
import at.hannibal2.skyhanni.features.garden.CropType
import at.hannibal2.skyhanni.features.garden.GardenAPI
+import at.hannibal2.skyhanni.utils.ChatUtils
+import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy
+import at.hannibal2.skyhanni.utils.CollectionUtils.nextAfter
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.LorenzUtils.editCopy
-import at.hannibal2.skyhanni.utils.LorenzUtils.nextAfter
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary
@@ -23,6 +24,7 @@ import net.minecraft.item.ItemStack
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
object GardenCropMilestonesCommunityFix {
+
private val pattern = ".*§e(?<having>.*)§6/§e(?<max>.*)".toPattern()
private var showWrongData = false
private var showWhenAllCorrect = false
@@ -55,7 +57,7 @@ object GardenCropMilestonesCommunityFix {
}
if (data.isNotEmpty()) {
- LorenzUtils.chat(
+ ChatUtils.chat(
"Found §c${data.size} §ewrong crop milestone steps in the menu! " +
"Correct data got put into clipboard. " +
"Please share it on the §bSkyHanni Discord §ein the channel §b#share-data§e."
@@ -63,7 +65,7 @@ object GardenCropMilestonesCommunityFix {
OSUtils.copyToClipboard("```${data.joinToString("\n")}```")
} else {
if (showWhenAllCorrect) {
- LorenzUtils.chat("No wrong crop milestone steps found!")
+ ChatUtils.chat("No wrong crop milestone steps found!")
}
}
}
@@ -71,7 +73,7 @@ object GardenCropMilestonesCommunityFix {
private fun checkForWrongData(
stack: ItemStack,
crop: CropType,
- wrongData: MutableList<String>
+ wrongData: MutableList<String>,
) {
val name = stack.name ?: return
val rawNumber = name.removeColor().replace(crop.cropName, "").trim()
@@ -151,7 +153,7 @@ object GardenCropMilestonesCommunityFix {
}
}
totalFixedValues += fixed
- LorenzUtils.chat("Fixed: $fixed/$alreadyCorrect, total fixes: $totalFixedValues")
+ ChatUtils.chat("Fixed: $fixed/$alreadyCorrect, total fixes: $totalFixedValues")
val s = ConfigManager.gson.toJsonTree(GardenCropMilestones.cropMilestoneData).toString()
OSUtils.copyToClipboard("\"crop_milestones\":$s,")
}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt
index 1ea0871ee..c15299ab3 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt
@@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class GardenCropUpgrades {
+
// TODO USE SH-REPO
private val tierPattern = "§7Current Tier: §[0-9a-e](\\d)§7/§a9".toRegex()
private val chatUpgradePattern = " {2}§r§6§lCROP UPGRADE §e§f([\\w ]+)§7 #(\\d)".toRegex()
@@ -39,6 +40,7 @@ class GardenCropUpgrades {
}
companion object {
+
private val cropUpgrades: MutableMap<CropType, Int>? get() = GardenAPI.storage?.cropUpgrades
fun CropType.getUpgradeLevel() = cropUpgrades?.get(this)
@@ -46,6 +48,5 @@ class GardenCropUpgrades {
fun CropType.setUpgradeLevel(level: Int) {
cropUpgrades?.put(this, level)
}
-
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
index 0f1da835b..9c50b1c09 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
@@ -6,10 +6,11 @@ import at.hannibal2.skyhanni.config.core.config.gui.GuiPositionEditor
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.LorenzKeyPressEvent
import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests
+import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.LorenzUtils.getPropertiesWithType
import at.hannibal2.skyhanni.utils.LorenzUtils.isRancherSign
import at.hannibal2.skyhanni.utils.NEUItems
+import at.hannibal2.skyhanni.utils.ReflectionUtils.getPropertiesWithType
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import io.github.moulberry.notenoughupdates.itemeditor.GuiElementTextField
import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer
@@ -78,7 +79,7 @@ class GuiEditManager {
SkyHanniMod.screenToOpen = GuiPositionEditor(latestPositions.values.toList(), 2)
if (hotkeyReminder && lastHotkeyReminded.passedSince() > 30.minutes) {
lastHotkeyReminded = SimpleTimeMark.now()
- LorenzUtils.chat(
+ 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."
@@ -116,7 +117,7 @@ class GuiEditManager {
fun Position.getAbsY() = getAbsY0(getDummySize(true).y)
fun GuiProfileViewer.anyTextBoxFocused() =
- this.getPropertiesWithType<GuiElementTextField>().any{it.focus}
+ this.getPropertiesWithType<GuiElementTextField>().any { it.focus }
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuildAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/GuildAPI.kt
index 5a4fb4f99..f4273e745 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/GuildAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/GuildAPI.kt
@@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.cleanPlayerName
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
object GuildAPI {
+
private var inGuildMessage = false
private val list = mutableListOf<String>()
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
index 3f6ec7051..57889cc48 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
@@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.ProfileJoinEvent
import at.hannibal2.skyhanni.features.bingo.BingoAPI
import at.hannibal2.skyhanni.test.command.ErrorManager
+import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.LorenzLogger
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
@@ -26,6 +27,7 @@ import net.minecraftforge.fml.common.network.FMLNetworkEvent
import kotlin.concurrent.thread
class HypixelData {
+
private val patternGroup = RepoPattern.group("data.hypixeldata")
private val tabListProfilePattern by patternGroup.pattern(
"tablistprofile",
@@ -43,6 +45,7 @@ class HypixelData {
private var lastLocRaw = 0L
companion object {
+
private val patternGroup = RepoPattern.group("data.hypixeldata")
private val serverIdScoreboardPattern by patternGroup.pattern(
"serverid.scoreboard",
@@ -61,7 +64,7 @@ class HypixelData {
var skyBlockIsland = IslandType.UNKNOWN
var serverId: String? = null
- //Ironman, Stranded and Bingo
+ // Ironman, Stranded and Bingo
var noTrade = false
var ironman = false
@@ -95,16 +98,20 @@ class HypixelData {
if (!LorenzUtils.inSkyBlock) return null
if (serverId != null) return serverId
- ScoreboardData.sidebarLinesFormatted.forEach { serverIdScoreboardPattern.matchMatcher(it) {
- val serverType = if (group("servertype") == "M") "mega" else "mini"
- serverId = "$serverType${group("serverid")}"
- return serverId
- } }
+ ScoreboardData.sidebarLinesFormatted.forEach {
+ serverIdScoreboardPattern.matchMatcher(it) {
+ val serverType = if (group("servertype") == "M") "mega" else "mini"
+ serverId = "$serverType${group("serverid")}"
+ return serverId
+ }
+ }
- TabListData.getTabList().forEach { serverIdTablistPattern.matchMatcher(it) {
- serverId = group("serverid")
- return serverId
- } }
+ TabListData.getTabList().forEach {
+ serverIdTablistPattern.matchMatcher(it) {
+ serverId = group("serverid")
+ return serverId
+ }
+ }
return serverId
}
@@ -262,7 +269,7 @@ class HypixelData {
if (skyBlockIsland != islandType) {
IslandChangeEvent(islandType, skyBlockIsland).postAndCatch()
if (islandType == IslandType.UNKNOWN) {
- LorenzUtils.debug("Unknown island detected: '$newIsland'")
+ ChatUtils.debug("Unknown island detected: '$newIsland'")
loggerIslandChange.log("Unknown: '$newIsland'")
} else {
loggerIslandChange.log(islandType.name)
diff --git a/src/main/java/at/hannibal2/skyhanni/data/IslandType.kt b/src/main/java/at/hannibal2/skyhanni/data/IslandType.kt
index a3eef5dd9..e6a01136c 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/IslandType.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/IslandType.kt
@@ -17,7 +17,7 @@ enum class IslandType(val displayName: String, val modeName: String = "null") {
CRYSTAL_HOLLOWS("Crystal Hollows"),
THE_PARK("The Park", "floating_islands_1"),
DEEP_CAVERNS("Deep Caverns", "deep_caverns"),
- GOLD_MINES("Gold Mine", "gold_mine"),//TODO confirm
+ GOLD_MINES("Gold Mine", "gold_mine"),// TODO confirm
GARDEN("Garden"),
GARDEN_GUEST("Garden Guest"),
SPIDER_DEN("Spider's Den"),
@@ -29,6 +29,7 @@ enum class IslandType(val displayName: String, val modeName: String = "null") {
;
companion object {
+
fun getByNameOrUnknown(name: String) = getByNameOrNull(name) ?: UNKNOWN
fun getByName(name: String) = getByNameOrNull(name) ?: error("IslandType not found: '$name'")
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemRenderBackground.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemRenderBackground.kt
index f62ebd800..406901b9d 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/ItemRenderBackground.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/ItemRenderBackground.kt
@@ -38,7 +38,6 @@ class ItemRenderBackground {
}
}
-
@SubscribeEvent
fun renderOverlayLol(event: RenderRealOverlayEvent) {
val stack = event.stack
@@ -70,4 +69,4 @@ class ItemRenderBackground {
GlStateManager.popMatrix()
}
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/LocationFixData.kt b/src/main/java/at/hannibal2/skyhanni/data/LocationFixData.kt
index f32256031..728678824 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/LocationFixData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/LocationFixData.kt
@@ -1,13 +1,14 @@
package at.hannibal2.skyhanni.data
+import at.hannibal2.skyhanni.data.jsonobjects.repo.LocationFixJson
import at.hannibal2.skyhanni.events.RepositoryReloadEvent
import at.hannibal2.skyhanni.utils.LocationUtils.isPlayerInside
-import at.hannibal2.skyhanni.data.jsonobjects.repo.LocationFixJson
import net.minecraft.util.AxisAlignedBB
import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
object LocationFixData {
+
private var locationFixes = mutableListOf<LocationFix>()
class LocationFix(val island: IslandType, val area: AxisAlignedBB, val realLocation: String)
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt b/src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt
index 646337a27..e8abad8a9 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt
@@ -5,8 +5,8 @@ import at.hannibal2.skyhanni.config.ConfigManager
import at.hannibal2.skyhanni.data.jsonobjects.local.MayorJson
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.utils.APIUtil
+import at.hannibal2.skyhanni.utils.CollectionUtils.put
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.LorenzUtils.put
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import io.github.moulberry.notenoughupdates.util.SkyBlockTime
import kotlinx.coroutines.Dispatchers
@@ -16,10 +16,12 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import kotlin.time.Duration.Companion.minutes
class MayorElection {
+
private var lastUpdate = SimpleTimeMark.farPast()
private var dispatcher = Dispatchers.IO
companion object {
+
var rawMayorData: MayorJson? = null
var candidates = mapOf<Int, MayorJson.Candidate>()
var currentCandidate: MayorJson.Candidate? = null
diff --git a/src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt
index fa8494dcb..72395b4fc 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt
@@ -13,6 +13,7 @@ import net.minecraft.network.play.server.S2FPacketSetSlot
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
object OtherInventoryData {
+
private var currentInventory: Inventory? = null
private var acceptItems = false
private var lateEvent: InventoryUpdatedEvent? = null
@@ -105,6 +106,6 @@ object OtherInventoryData {
val title: String,
val slotCount: Int,
val items: MutableMap<Int, ItemStack> = mutableMapOf(),
- var fullyOpenedOnce: Boolean = false
+ var fullyOpenedOnce: Boolean = false,
)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt
index 97065766e..824b895bb 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt
@@ -7,12 +7,12 @@ import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.OwnInventoryItemUpdateEvent
import at.hannibal2.skyhanni.events.PacketEvent
import at.hannibal2.skyhanni.events.entity.ItemAddInInventoryEvent
+import at.hannibal2.skyhanni.utils.CollectionUtils.addOrPut
import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull
import at.hannibal2.skyhanni.utils.ItemUtils.getItemName
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.LorenzUtils.addOrPut
import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
@@ -26,6 +26,7 @@ import kotlin.time.Duration
import kotlin.time.Duration.Companion.milliseconds
class OwnInventoryData {
+
private var itemAmounts = mapOf<NEUInternalName, Int>()
private var dirty = false
private val sackToInventoryChatPattern by RepoPattern.pattern(
diff --git a/src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt
index daac67f16..22fb8e4f8 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.data
import at.hannibal2.skyhanni.events.LorenzChatEvent
+import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.OSUtils
import at.hannibal2.skyhanni.utils.StringUtils.cleanPlayerName
@@ -13,6 +14,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import kotlin.random.Random
object PartyAPI {
+
private val patternGroup = RepoPattern.group("data.party")
private val youJoinedPartyPattern by patternGroup.pattern(
"you.joined",
@@ -76,17 +78,17 @@ object PartyAPI {
fun listMembers() {
val size = partyMembers.size
if (size == 0) {
- LorenzUtils.chat("No tracked party members!")
+ ChatUtils.chat("No tracked party members!")
return
}
- LorenzUtils.chat("Tracked party members §7($size) §f:", prefixColor = "§a")
+ ChatUtils.chat("Tracked party members §7($size) §f:", prefixColor = "§a")
for (member in partyMembers) {
- LorenzUtils.chat(" §a- §7$member", false)
+ ChatUtils.chat(" §a- §7$member", false)
}
if (Random.nextDouble() < 0.1) {
OSUtils.openBrowser("https://www.youtube.com/watch?v=iANP7ib7CPA")
- LorenzUtils.hoverableChat("§7Are You Ready To Party?", listOf("§b~Spongebob"), prefix = false)
+ ChatUtils.hoverableChat("§7Are You Ready To Party?", listOf("§b~Spongebob"), prefix = false)
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt
index 8e6f9bb7d..e4b54115c 100644
--- a/