aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLulonaut <lulonaut@tutanota.de>2022-11-25 21:55:29 +0100
committerGitHub <noreply@github.com>2022-11-25 21:55:29 +0100
commit72904df8c50260e76a784457a5e78a20e4a80b65 (patch)
treed01c4e858ca7116815df53cf6dee99a0f81974fc /src
parentc2ec12edd5d8e32665edd620ffa2267c5a0a56aa (diff)
downloadNotEnoughUpdates-72904df8c50260e76a784457a5e78a20e4a80b65.tar.gz
NotEnoughUpdates-72904df8c50260e76a784457a5e78a20e4a80b65.tar.bz2
NotEnoughUpdates-72904df8c50260e76a784457a5e78a20e4a80b65.zip
show price of essence when pressing shift in essence upgrades gui (#440)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/recipes/EssenceUpgrades.java9
2 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java
index 6811067f..754e2dc3 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java
@@ -52,6 +52,7 @@ public class ItemPriceInformation {
private static HashSet<String> auctionableItems;
private static Gson gson;
private static final NumberFormat format = new DecimalFormat("#,##0.#", new DecimalFormatSymbols(Locale.US));
+ public static String STACKSIZE_OVERRIDE = "NEU_STACKSIZE_OVERRIDE";
public static boolean addToTooltip(List<String> tooltip, String internalname, ItemStack stack) {
return addToTooltip(tooltip, internalname, stack, true);
@@ -131,6 +132,9 @@ public class ItemPriceInformation {
int stackMultiplier = 1;
int shiftStackMultiplier = useStackSize && stack.stackSize > 1 ? stack.stackSize : 64;
+ if (stack.getTagCompound() != null && stack.getTagCompound().hasKey(STACKSIZE_OVERRIDE)) {
+ shiftStackMultiplier = stack.getTagCompound().getInteger(STACKSIZE_OVERRIDE);
+ }
if (shiftPressed) {
stackMultiplier = shiftStackMultiplier;
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/recipes/EssenceUpgrades.java b/src/main/java/io/github/moulberry/notenoughupdates/recipes/EssenceUpgrades.java
index 69c1a912..439ac56b 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/recipes/EssenceUpgrades.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/recipes/EssenceUpgrades.java
@@ -21,6 +21,7 @@ package io.github.moulberry.notenoughupdates.recipes;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
+import io.github.moulberry.notenoughupdates.ItemPriceInformation;
import io.github.moulberry.notenoughupdates.NEUManager;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.core.util.StringUtils;
@@ -38,6 +39,7 @@ import org.jetbrains.annotations.Nullable;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
+import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -227,8 +229,13 @@ public class EssenceUpgrades implements NeuRecipe {
if (essenceItemStack != null) {
essenceItemStack = essenceItemStack.copy();
essenceItemStack.setStackDisplayName(
- EnumChatFormatting.AQUA.toString() + tierUpgrade.getEssenceRequired() + " " + EnumChatFormatting.DARK_GRAY +
+ EnumChatFormatting.AQUA + NumberFormat.getInstance().format(tierUpgrade.getEssenceRequired()) + " " + EnumChatFormatting.DARK_GRAY +
tierUpgrade.getEssenceType() + " Essence");
+
+ essenceItemStack.getTagCompound().setInteger(
+ ItemPriceInformation.STACKSIZE_OVERRIDE,
+ tierUpgrade.getEssenceRequired()
+ );
RenderLocation renderLocation = slotLocations.get(0);
slotList.add(new RecipeSlot(renderLocation.getX() + 1, renderLocation.getY() + 1, essenceItemStack));
}