diff options
| author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-02-25 21:44:13 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-25 11:44:13 +0100 |
| commit | 2a8edee6275a4abe3375351455c27d2ee56f9c36 (patch) | |
| tree | c92a63bcd9e8c2614beef7cbeb83d97247a6d3c0 /src/main/java/at/hannibal2/skyhanni/features/misc | |
| parent | 190d97aeb18bbb02778b206404d7084c648038dd (diff) | |
| download | skyhanni-2a8edee6275a4abe3375351455c27d2ee56f9c36.tar.gz skyhanni-2a8edee6275a4abe3375351455c27d2ee56f9c36.tar.bz2 skyhanni-2a8edee6275a4abe3375351455c27d2ee56f9c36.zip | |
/gfs tab complete now uses NEU's Repo instead of SkyHanni Repo. #1053
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt | 21 |
1 files changed, 7 insertions, 14 deletions
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<HashMap<NEUInternalName, HashMap<String, List<String>>>>() {}.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<HashMap<NEUInternalName, HashMap<String, List<String>>>>() {}.type) } @SubscribeEvent |
