aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/skyblock/item
diff options
context:
space:
mode:
authorAaron <51387595+AzureAaron@users.noreply.github.com>2024-06-16 11:24:33 -0400
committerGitHub <noreply@github.com>2024-06-16 11:24:33 -0400
commit28c362384e728dbb2b02961e4ef46849286ce84d (patch)
tree93da757fb2fe778a8cfad1cd8d069658828f9bca /src/main/java/de/hysky/skyblocker/skyblock/item
parentbf36add23cc29997674877986105fe355339ce12 (diff)
parent8bb84dfe1574f9890d67d2f16d6227aa13979115 (diff)
downloadSkyblocker-28c362384e728dbb2b02961e4ef46849286ce84d.tar.gz
Skyblocker-28c362384e728dbb2b02961e4ef46849286ce84d.tar.bz2
Skyblocker-28c362384e728dbb2b02961e4ef46849286ce84d.zip
Merge pull request #775 from SkyblockerMod/farming-price-fix
Use NPC price if its higher
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/item')
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java
index dd8fdfc3..2f5408a1 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java
@@ -27,10 +27,12 @@ public class ItemTooltip {
* Gets the NEU id from an id and an api id.
* @param id the id of the skyblock item, gotten from {@link de.hysky.skyblocker.utils.ItemUtils#getItemId(net.minecraft.item.ItemStack) ItemUtils#getItemId(ItemStack)} or {@link net.minecraft.item.ItemStack#getSkyblockId() ItemStack#getSkyblockId()}
* @param apiId the api id of the skyblock item, matching the id of the item on the Skyblocker api, gotten from {@link net.minecraft.item.ItemStack#getSkyblockApiId() ItemStack#getSkyblockApiId()}
- * @return the NEU id of the skyblock item, matching the id of the item gotten from {@link io.github.moulberry.repo.data.NEUItem#getSkyblockItemId() NEUItem#getSkyblockItemId()} or {@link net.minecraft.item.ItemStack#getNeuName() ItemStack#getNeuName()}
+ * @return the NEU id of the skyblock item, matching the id of the item gotten from {@link io.github.moulberry.repo.data.NEUItem#getSkyblockItemId() NEUItem#getSkyblockItemId()} or {@link net.minecraft.item.ItemStack#getNeuName() ItemStack#getNeuName()},
+ * or an empty string if either id or apiId is null
*/
@NotNull
public static String getNeuName(String id, String apiId) {
+ if (id == null || apiId == null) return "";
switch (id) {
case "PET" -> {
apiId = apiId.replaceAll("LVL_\\d*_", "");