From 2a8edee6275a4abe3375351455c27d2ee56f9c36 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Sun, 25 Feb 2024 21:44:13 +1100 Subject: /gfs tab complete now uses NEU's Repo instead of SkyHanni Repo. #1053 --- .../features/misc/items/EstimatedItemValue.kt | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt index 977d041fa..2d6c37469 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt @@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent +import at.hannibal2.skyhanni.events.NeuRepositoryReloadEvent import at.hannibal2.skyhanni.events.RenderItemTooltipEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.test.command.ErrorManager @@ -25,7 +26,6 @@ import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NEUItems.getItemStackOrNull -import at.hannibal2.skyhanni.utils.NEUItems.manager import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems @@ -35,7 +35,6 @@ import net.minecraft.client.Minecraft import net.minecraft.init.Items import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import java.io.File import kotlin.math.roundToLong object EstimatedItemValue { @@ -51,18 +50,12 @@ object EstimatedItemValue { fun isCurrentlyShowing() = currentlyShowing && Minecraft.getMinecraft().currentScreen != null @SubscribeEvent - fun onRepoReload(event: io.github.moulberry.notenoughupdates.events.RepositoryReloadEvent) { - val data = manager.getJsonFromFile(File(manager.repoLocation, "constants/gemstonecosts.json")) - - if (data != null) - // item_internal_names -> gemstone_slots -> ingredients_array - gemstoneUnlockCosts = - ConfigManager.gson.fromJson( - data, - object : TypeToken>>>() {}.type - ) - else - ChatUtils.error("Gemstone Slot Unlock Costs failed to load!") + fun onNeuRepoReload(event: NeuRepositoryReloadEvent) { + val data = event.getConstant("gemstonecosts") ?: run { + ErrorManager.skyHanniError("Gemstone Slot Unlock Costs failed to load from neu repo!") + } + + gemstoneUnlockCosts = ConfigManager.gson.fromJson(data, object : TypeToken>>>() {}.type) } @SubscribeEvent -- cgit