aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt21
2 files changed, 9 insertions, 15 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
index 7c0987883..08e6382c1 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
@@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzToolTipEvent
+import at.hannibal2.skyhanni.events.NeuRepositoryReloadEvent
import at.hannibal2.skyhanni.events.RepositoryReloadEvent
import at.hannibal2.skyhanni.events.TabListUpdateEvent
import at.hannibal2.skyhanni.features.bazaar.BazaarApi
@@ -533,7 +534,7 @@ object ComposterOverlay {
}
@SubscribeEvent
- fun onRepoReload(event: io.github.moulberry.notenoughupdates.events.RepositoryReloadEvent) {
+ fun onNeuRepoReload(event: NeuRepositoryReloadEvent) {
updateOrganicMatterFactors()
}
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