aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt40
1 files changed, 5 insertions, 35 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
index 3e128292e..025b4cead 100644
--- a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
@@ -1,21 +1,18 @@
package at.hannibal2.skyhanni.api
import at.hannibal2.skyhanni.SkyHanniMod
-import at.hannibal2.skyhanni.config.ConfigManager
-import at.hannibal2.skyhanni.data.jsonobjects.other.NeuSacksJson
+import at.hannibal2.skyhanni.data.SackAPI
import at.hannibal2.skyhanni.events.GuiContainerEvent
import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzToolTipEvent
import at.hannibal2.skyhanni.events.MessageSendToServerEvent
-import at.hannibal2.skyhanni.events.NeuRepositoryReloadEvent
import at.hannibal2.skyhanni.features.commands.tabcomplete.GetFromSacksTabComplete
import at.hannibal2.skyhanni.test.command.ErrorManager
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.ChatUtils.isCommand
import at.hannibal2.skyhanni.utils.ChatUtils.senderIsSkyhanni
-import at.hannibal2.skyhanni.utils.ItemUtils.itemNameWithoutColor
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
@@ -25,9 +22,7 @@ import at.hannibal2.skyhanni.utils.PrimitiveItemStack.Companion.makePrimitiveSta
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
-import at.hannibal2.skyhanni.utils.fromJson
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
-import io.github.moulberry.notenoughupdates.util.Utils
import net.minecraft.inventory.Slot
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.util.Deque
@@ -75,11 +70,11 @@ object GetFromSackAPI {
private var lastItemStack: PrimitiveItemStack? = null
- var sackListInternalNames = emptySet<String>()
- private set
+ @Deprecated("", ReplaceWith("SackAPI.sackListInternalNames"))
+ val sackListInternalNames get() = SackAPI.sackListInternalNames
- var sackListNames = emptySet<String>()
- private set
+ @Deprecated("", ReplaceWith("SackAPI.sackListNames"))
+ val sackListNames get() = SackAPI.sackListNames
private fun addToQueue(items: List<PrimitiveItemStack>) = queue.addAll(items)
@@ -222,29 +217,4 @@ object GetFromSackAPI {
WRONG_AMOUNT,
INTERNAL_ERROR
}
-
- @SubscribeEvent
- fun onNeuRepoReload(event: NeuRepositoryReloadEvent) {
- val data = event.getConstant("sacks") ?: ErrorManager.skyHanniError("NEU sacks data is null.")
- try {
- val sacksData = ConfigManager.gson.fromJson<NeuSacksJson>(data).sacks
- val uniqueSackItems = mutableSetOf<NEUInternalName>()
-
- sacksData.values.forEach { sackInfo ->
- sackInfo.contents.forEach { content ->
- uniqueSackItems.add(content)
- }
- }
-
- sackListInternalNames = uniqueSackItems.map { it.asString() }.toSet()
- sackListNames = uniqueSackItems.map { it.itemNameWithoutColor.uppercase() }.toSet()
-
- } catch (e: Exception) {
- ErrorManager.logErrorWithData(
- e, "Error getting NEU sacks data, make sure your neu repo is updated.",
- "sacksJson" to data
- )
- Utils.showOutdatedRepoNotification()
- }
- }
}