From e548f8974f402025692baa60c22a06c38a99c4a3 Mon Sep 17 00:00:00 2001 From: Futuremappermydud <54294576+Futuremappermydud@users.noreply.github.com> Date: Tue, 12 Jul 2022 13:13:09 -0400 Subject: Add Craft Cost to Trade Window (#185) * Add Craft Cost to Trade Window * Allow Vanilla items whoops --- .../io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java index 086b6e06..6107985c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java @@ -21,6 +21,7 @@ package io.github.moulberry.notenoughupdates.miscgui; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.auction.APIManager; import io.github.moulberry.notenoughupdates.core.config.KeybindHelper; import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; @@ -138,6 +139,12 @@ public class TradeWindow { pricePer = auctionPricePer; } } + if (pricePer == -1) { + APIManager.CraftInfo craftCost = NotEnoughUpdates.INSTANCE.manager.auctionManager.getCraftCost(internalname); + if (craftCost != null) { + pricePer = (int) craftCost.craftCost; + } + } return pricePer; } -- cgit