aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java39
-rw-r--r--src/main/java/de/hysky/skyblocker/utils/ItemUtils.java55
-rw-r--r--src/test/java/de/hysky/skyblocker/utils/ItemUtilsTest.java13
3 files changed, 64 insertions, 43 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 3452cdec..e4e18f8b 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
@@ -14,14 +14,13 @@ import net.minecraft.client.item.TooltipContext;
import net.minecraft.item.DyeableItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
+import net.minecraft.nbt.NbtElement;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.CompletableFuture;
@@ -148,7 +147,7 @@ public class ItemTooltip {
}
if (TooltipInfoType.OBTAINED.isTooltipEnabled()) {
- String timestamp = getTimestamp(stack);
+ String timestamp = ItemUtils.getTimestamp(stack);
if (!timestamp.isEmpty()) {
lines.add(Text.literal(String.format("%-21s", "Obtained: "))
@@ -221,43 +220,11 @@ public class ItemTooltip {
}
}
- /**
- * this method converts the "timestamp" variable into the same date format as Hypixel represents it in the museum.
- * Currently, there are two types of timestamps the legacy which is built like this
- * "dd/MM/yy hh:mm" ("25/04/20 16:38") and the current which is built like this
- * "MM/dd/yy hh:mm aa" ("12/24/20 11:08 PM"). Since Hypixel transforms the two formats into one format without
- * taking into account of their formats, we do the same. The final result looks like this
- * "MMMM dd, yyyy" (December 24, 2020).
- * Since the legacy format has a 25 as "month" SimpleDateFormat converts the 25 into 2 years and 1 month and makes
- * "25/04/20 16:38" -> "January 04, 2022" instead of "April 25, 2020".
- * This causes the museum rank to be much worse than it should be.
- *
- * @param stack the item under the pointer
- * @return if the item have a "Timestamp" it will be shown formated on the tooltip
- */
- public static String getTimestamp(ItemStack stack) {
- NbtCompound ea = ItemUtils.getExtraAttributes(stack);
-
- if (ea != null && ea.contains("timestamp", 8)) {
- SimpleDateFormat nbtFormat = new SimpleDateFormat("MM/dd/yy");
-
- try {
- Date date = nbtFormat.parse(ea.getString("timestamp"));
- SimpleDateFormat skyblockerFormat = new SimpleDateFormat("MMMM dd, yyyy", Locale.ENGLISH);
- return skyblockerFormat.format(date);
- } catch (ParseException e) {
- LOGGER.warn("[Skyblocker-tooltip] getTimestamp", e);
- }
- }
-
- return "";
- }
-
// TODO What in the world is this?
public static String getInternalNameFromNBT(ItemStack stack, boolean internalIDOnly) {
NbtCompound ea = ItemUtils.getExtraAttributes(stack);
- if (ea == null || !ea.contains(ItemUtils.ID, 8)) {
+ if (ea == null || !ea.contains(ItemUtils.ID, NbtElement.STRING_TYPE)) {
return null;
}
String internalName = ea.getString(ItemUtils.ID);
diff --git a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java
index eed91ed8..880ebe76 100644
--- a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java
+++ b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java
@@ -15,20 +15,27 @@ import net.minecraft.text.Texts;
import net.minecraft.util.Formatting;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.Instant;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
import java.util.function.Predicate;
import java.util.regex.Pattern;
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
public class ItemUtils {
+ private static final Logger LOGGER = LoggerFactory.getLogger(ItemUtils.class);
public static final String EXTRA_ATTRIBUTES = "ExtraAttributes";
public static final String ID = "id";
public static final String UUID = "uuid";
+ private static final DateTimeFormatter OBTAINED_DATE_FORMATTER = DateTimeFormatter.ofPattern("MMMM d, yyyy").withZone(ZoneId.systemDefault()).localizedBy(Locale.ENGLISH);
+ private static final SimpleDateFormat OLD_OBTAINED_DATE_FORMAT = new SimpleDateFormat("MM/dd/yy");
public static final Pattern NOT_DURABILITY = Pattern.compile("[^0-9 /]");
public static final Predicate<String> FUEL_PREDICATE = line -> line.contains("Fuel: ");
@@ -102,6 +109,44 @@ public class ItemUtils {
return extraAttributes != null ? extraAttributes.getString(UUID) : "";
}
+ /**
+ * This method converts the "timestamp" variable into the same date format as Hypixel represents it in the museum.
+ * Currently, there are two types of string timestamps the legacy which is built like this
+ * "dd/MM/yy hh:mm" ("25/04/20 16:38") and the current which is built like this
+ * "MM/dd/yy hh:mm aa" ("12/24/20 11:08 PM"). Since Hypixel transforms the two formats into one format without
+ * taking into account of their formats, we do the same. The final result looks like this
+ * "MMMM dd, yyyy" (December 24, 2020).
+ * Since the legacy format has a 25 as "month" SimpleDateFormat converts the 25 into 2 years and 1 month and makes
+ * "25/04/20 16:38" -> "January 04, 2022" instead of "April 25, 2020".
+ * This causes the museum rank to be much worse than it should be.
+ * <p>
+ * This also handles the long timestamp format introduced in January 2024 where the timestamp is in epoch milliseconds.
+ *
+ * @param stack the item under the pointer
+ * @return if the item have a "Timestamp" it will be shown formated on the tooltip
+ */
+ public static String getTimestamp(ItemStack stack) {
+ NbtCompound ea = getExtraAttributes(stack);
+
+ if (ea != null && ea.contains("timestamp", NbtElement.LONG_TYPE)) {
+ Instant date = Instant.ofEpochMilli(ea.getLong("timestamp"));
+
+ return OBTAINED_DATE_FORMATTER.format(date);
+ }
+
+ if (ea != null && ea.contains("timestamp", NbtElement.STRING_TYPE)) {
+ try {
+ Instant date = OLD_OBTAINED_DATE_FORMAT.parse(ea.getString("timestamp")).toInstant();
+
+ return OBTAINED_DATE_FORMATTER.format(date);
+ } catch (ParseException e) {
+ LOGGER.warn("[Skyblocker Item Utils] Encountered an unknown exception while parsing time stamp of item {} with extra attributes {}", stack, ea, e);
+ }
+ }
+
+ return "";
+ }
+
public static boolean hasCustomDurability(@NotNull ItemStack stack) {
NbtCompound extraAttributes = getExtraAttributes(stack);
return extraAttributes != null && (extraAttributes.contains("drill_fuel") || extraAttributes.getString(ID).equals("PICKONIMBUS"));
diff --git a/src/test/java/de/hysky/skyblocker/utils/ItemUtilsTest.java b/src/test/java/de/hysky/skyblocker/utils/ItemUtilsTest.java
index 31abca68..71ff29ef 100644
--- a/src/test/java/de/hysky/skyblocker/utils/ItemUtilsTest.java
+++ b/src/test/java/de/hysky/skyblocker/utils/ItemUtilsTest.java
@@ -11,7 +11,8 @@ import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class ItemUtilsTest {
- private final ItemStack JUJU_SHORTBOW = ItemStack.fromNbt(StringNbtReader.parse("{Count:1b,id:\"minecraft:bow\",tag:{Damage:0,Enchantments:[{id:\"minecraft:protection\",lvl:0s}],ExtraAttributes:{art_of_war_count:1,dungeon_item_level:5,enchantments:{aiming:5,chance:4,cubism:5,impaling:3,infinite_quiver:10,overload:5,piercing:1,power:6,snipe:3,telekinesis:1,ultimate_soul_eater:5},hot_potato_count:15,id:\"JUJU_SHORTBOW\",modifier:\"spiritual\",originTag:\"QUICK_CRAFTING\",rarity_upgrades:1,runes:{DRAGON:3},stats_book:54778,timestamp:\"6/5/21 4:41 AM\",uuid:\"b06b8fe2-470a-43f3-b844-658472f20996\"},HideFlags:255,Unbreakable:1b,display:{Lore:['{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Gear Score: \"},{\"color\":\"light_purple\",\"text\":\"724 \"},{\"color\":\"dark_gray\",\"text\":\"(2297)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Damage: \"},{\"color\":\"red\",\"text\":\"+371 \"},{\"color\":\"yellow\",\"text\":\"(+30) \"},{\"color\":\"dark_gray\",\"text\":\"(+1,275)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Strength: \"},{\"color\":\"red\",\"text\":\"+107 \"},{\"color\":\"yellow\",\"text\":\"(+30) \"},{\"color\":\"gold\",\"text\":\"[+5] \"},{\"color\":\"blue\",\"text\":\"(+28) \"},{\"color\":\"dark_gray\",\"text\":\"(+386.25)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Crit Chance: \"},{\"color\":\"red\",\"text\":\"+28% \"},{\"color\":\"blue\",\"text\":\"(+12%) \"},{\"color\":\"dark_gray\",\"text\":\"(+40.5%)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Crit Damage: \"},{\"color\":\"red\",\"text\":\"+181% \"},{\"color\":\"blue\",\"text\":\"(+55%) \"},{\"color\":\"dark_gray\",\"text\":\"(+637.5%)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Shot Cooldown: \"},{\"color\":\"green\",\"text\":\"0.5s\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"bold\":true,\"color\":\"light_purple\",\"text\":\"\"},{\"bold\":true,\"color\":\"light_purple\",\"text\":\"Soul Eater V\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Chance IV\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Cubism V\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Dragon Tracer V\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Impaling III\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Infinite Quiver X\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Overload V\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Piercing I\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Power VI\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Snipe III\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"dark_purple\",\"text\":\"◆ End Rune III\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Hits \"},{\"color\":\"red\",\"text\":\"3 \"},{\"color\":\"gray\",\"text\":\"mobs on impact.\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Can damage endermen.\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"white\",\"text\":\"Kills: \"},{\"color\":\"gold\",\"text\":\"54,778\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Spiritual Bonus\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Grants a \"},{\"color\":\"green\",\"text\":\"10% \"},{\"color\":\"gray\",\"text\":\"chance to spawn\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"a Spirit Decoy when you kill an\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"enemy in a dungeon.\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gold\",\"text\":\"Shortbow: Instantly shoots!\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"\"},{\"color\":\"dark_red\",\"text\":\"☠ \"},{\"color\":\"red\",\"text\":\"Requires \"},{\"color\":\"dark_purple\",\"text\":\"Enderman Slayer\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"dark_purple\",\"text\":\"5\"},{\"color\":\"red\",\"text\":\".\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"bold\":true,\"obfuscated\":true,\"color\":\"gold\",\"text\":\"a\"},{\"text\":\"\"},{\"bold\":false,\"italic\":false,\"underlined\":false,\"obfuscated\":false,\"strikethrough\":false,\"extra\":[{\"text\":\" \"}],\"text\":\"\"},{\"bold\":true,\"color\":\"gold\",\"text\":\"\"},{\"bold\":true,\"color\":\"gold\",\"text\":\"LEGENDARY DUNGEON BOW \"},{\"bold\":true,\"obfuscated\":true,\"color\":\"gold\",\"text\":\"a\"}],\"text\":\"\"}'],Name:'{\"italic\":false,\"extra\":[{\"color\":\"gold\",\"text\":\"Spiritual Juju Shortbow \"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"}],\"text\":\"\"}'}}}"));
+ private final ItemStack JUJU_SHORTBOW_OLD = ItemStack.fromNbt(StringNbtReader.parse("{Count:1b,id:\"minecraft:bow\",tag:{Damage:0,Enchantments:[{id:\"minecraft:protection\",lvl:0s}],ExtraAttributes:{art_of_war_count:1,dungeon_item_level:5,enchantments:{aiming:5,chance:4,cubism:5,impaling:3,infinite_quiver:10,overload:5,piercing:1,power:6,snipe:3,telekinesis:1,ultimate_soul_eater:5},hot_potato_count:15,id:\"JUJU_SHORTBOW\",modifier:\"spiritual\",originTag:\"QUICK_CRAFTING\",rarity_upgrades:1,runes:{DRAGON:3},stats_book:54778,timestamp:\"6/5/21 4:41 AM\",uuid:\"b06b8fe2-470a-43f3-b844-658472f20996\"},HideFlags:255,Unbreakable:1b,display:{Lore:['{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Gear Score: \"},{\"color\":\"light_purple\",\"text\":\"724 \"},{\"color\":\"dark_gray\",\"text\":\"(2297)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Damage: \"},{\"color\":\"red\",\"text\":\"+371 \"},{\"color\":\"yellow\",\"text\":\"(+30) \"},{\"color\":\"dark_gray\",\"text\":\"(+1,275)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Strength: \"},{\"color\":\"red\",\"text\":\"+107 \"},{\"color\":\"yellow\",\"text\":\"(+30) \"},{\"color\":\"gold\",\"text\":\"[+5] \"},{\"color\":\"blue\",\"text\":\"(+28) \"},{\"color\":\"dark_gray\",\"text\":\"(+386.25)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Crit Chance: \"},{\"color\":\"red\",\"text\":\"+28% \"},{\"color\":\"blue\",\"text\":\"(+12%) \"},{\"color\":\"dark_gray\",\"text\":\"(+40.5%)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Crit Damage: \"},{\"color\":\"red\",\"text\":\"+181% \"},{\"color\":\"blue\",\"text\":\"(+55%) \"},{\"color\":\"dark_gray\",\"text\":\"(+637.5%)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Shot Cooldown: \"},{\"color\":\"green\",\"text\":\"0.5s\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"bold\":true,\"color\":\"light_purple\",\"text\":\"\"},{\"bold\":true,\"color\":\"light_purple\",\"text\":\"Soul Eater V\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Chance IV\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Cubism V\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Dragon Tracer V\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Impaling III\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Infinite Quiver X\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Overload V\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Piercing I\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Power VI\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Snipe III\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"dark_purple\",\"text\":\"◆ End Rune III\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Hits \"},{\"color\":\"red\",\"text\":\"3 \"},{\"color\":\"gray\",\"text\":\"mobs on impact.\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Can damage endermen.\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"white\",\"text\":\"Kills: \"},{\"color\":\"gold\",\"text\":\"54,778\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Spiritual Bonus\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Grants a \"},{\"color\":\"green\",\"text\":\"10% \"},{\"color\":\"gray\",\"text\":\"chance to spawn\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"a Spirit Decoy when you kill an\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"enemy in a dungeon.\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gold\",\"text\":\"Shortbow: Instantly shoots!\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"\"},{\"color\":\"dark_red\",\"text\":\"☠ \"},{\"color\":\"red\",\"text\":\"Requires \"},{\"color\":\"dark_purple\",\"text\":\"Enderman Slayer\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"dark_purple\",\"text\":\"5\"},{\"color\":\"red\",\"text\":\".\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"bold\":true,\"obfuscated\":true,\"color\":\"gold\",\"text\":\"a\"},{\"text\":\"\"},{\"bold\":false,\"italic\":false,\"underlined\":false,\"obfuscated\":false,\"strikethrough\":false,\"extra\":[{\"text\":\" \"}],\"text\":\"\"},{\"bold\":true,\"color\":\"gold\",\"text\":\"\"},{\"bold\":true,\"color\":\"gold\",\"text\":\"LEGENDARY DUNGEON BOW \"},{\"bold\":true,\"obfuscated\":true,\"color\":\"gold\",\"text\":\"a\"}],\"text\":\"\"}'],Name:'{\"italic\":false,\"extra\":[{\"color\":\"gold\",\"text\":\"Spiritual Juju Shortbow \"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"}],\"text\":\"\"}'}}}"));
+ private final ItemStack JUJU_SHORTBOW = ItemStack.fromNbt(StringNbtReader.parse("{Count:1b,id:\"minecraft:bow\",tag:{Damage:0,Enchantments:[{id:\"minecraft:protection\",lvl:0s}],ExtraAttributes:{art_of_war_count:1,dungeon_item_level:5,enchantments:{aiming:5,chance:4,cubism:5,impaling:3,infinite_quiver:10,overload:5,piercing:1,power:6,snipe:3,telekinesis:1,ultimate_soul_eater:5},hot_potato_count:15,id:\"JUJU_SHORTBOW\",modifier:\"spiritual\",originTag:\"QUICK_CRAFTING\",rarity_upgrades:1,runes:{DRAGON:3},stats_book:54778,timestamp:1622882460000L,uuid:\"b06b8fe2-470a-43f3-b844-658472f20996\"},HideFlags:255,Unbreakable:1b,display:{Lore:['{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Gear Score: \"},{\"color\":\"light_purple\",\"text\":\"724 \"},{\"color\":\"dark_gray\",\"text\":\"(2297)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Damage: \"},{\"color\":\"red\",\"text\":\"+371 \"},{\"color\":\"yellow\",\"text\":\"(+30) \"},{\"color\":\"dark_gray\",\"text\":\"(+1,275)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Strength: \"},{\"color\":\"red\",\"text\":\"+107 \"},{\"color\":\"yellow\",\"text\":\"(+30) \"},{\"color\":\"gold\",\"text\":\"[+5] \"},{\"color\":\"blue\",\"text\":\"(+28) \"},{\"color\":\"dark_gray\",\"text\":\"(+386.25)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Crit Chance: \"},{\"color\":\"red\",\"text\":\"+28% \"},{\"color\":\"blue\",\"text\":\"(+12%) \"},{\"color\":\"dark_gray\",\"text\":\"(+40.5%)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Crit Damage: \"},{\"color\":\"red\",\"text\":\"+181% \"},{\"color\":\"blue\",\"text\":\"(+55%) \"},{\"color\":\"dark_gray\",\"text\":\"(+637.5%)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Shot Cooldown: \"},{\"color\":\"green\",\"text\":\"0.5s\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"bold\":true,\"color\":\"light_purple\",\"text\":\"\"},{\"bold\":true,\"color\":\"light_purple\",\"text\":\"Soul Eater V\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Chance IV\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Cubism V\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Dragon Tracer V\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Impaling III\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Infinite Quiver X\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Overload V\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Piercing I\"},{\"color\":\"blue\",\"text\":\", \"},{\"color\":\"blue\",\"text\":\"Power VI\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Snipe III\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"dark_purple\",\"text\":\"◆ End Rune III\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Hits \"},{\"color\":\"red\",\"text\":\"3 \"},{\"color\":\"gray\",\"text\":\"mobs on impact.\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Can damage endermen.\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gold\",\"text\":\"Shortbow: Instantly shoots!\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"white\",\"text\":\"Kills: \"},{\"color\":\"gold\",\"text\":\"54,778\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Spiritual Bonus\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Grants a \"},{\"color\":\"green\",\"text\":\"10% \"},{\"color\":\"gray\",\"text\":\"chance to spawn a\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Spirit Decoy when you kill an enemy\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"in a dungeon.\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"\"},{\"color\":\"dark_red\",\"text\":\"☠ \"},{\"color\":\"red\",\"text\":\"Requires \"},{\"color\":\"dark_purple\",\"text\":\"Enderman Slayer 5\"},{\"color\":\"red\",\"text\":\".\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"bold\":true,\"obfuscated\":true,\"color\":\"gold\",\"text\":\"a\"},{\"text\":\"\"},{\"bold\":false,\"italic\":false,\"underlined\":false,\"obfuscated\":false,\"strikethrough\":false,\"extra\":[{\"text\":\" \"}],\"text\":\"\"},{\"bold\":true,\"color\":\"gold\",\"text\":\"\"},{\"bold\":true,\"color\":\"gold\",\"text\":\"LEGENDARY DUNGEON BOW \"},{\"bold\":true,\"obfuscated\":true,\"color\":\"gold\",\"text\":\"a\"}],\"text\":\"\"}'],Name:'{\"italic\":false,\"extra\":[{\"color\":\"gold\",\"text\":\"Spiritual Juju Shortbow \"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"}],\"text\":\"\"}'}}}"));
private final ItemStack LIVID_DAGGER = ItemStack.fromNbt(StringNbtReader.parse("{Count:1b,id:\"minecraft:iron_sword\",tag:{Damage:0,Enchantments:[{id:\"minecraft:protection\",lvl:0s}],ExtraAttributes:{dungeon_item_level:5,enchantments:{telekinesis:1,ultimate_one_for_all:1},gems:{JASPER_0:\"FLAWLESS\"},hot_potato_count:15,id:\"LIVID_DAGGER\",modifier:\"fabled\",originTag:\"UNKNOWN\",rarity_upgrades:1,timestamp:\"2/20/21 3:09 PM\",uuid:\"214333db-d71c-4080-8487-00b4666bb9a4\"},HideFlags:255,Unbreakable:1b,display:{Lore:['{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Gear Score: \"},{\"color\":\"light_purple\",\"text\":\"933 \"},{\"color\":\"dark_gray\",\"text\":\"(2389)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Damage: \"},{\"color\":\"red\",\"text\":\"+261 \"},{\"color\":\"yellow\",\"text\":\"(+30) \"},{\"color\":\"dark_gray\",\"text\":\"(+900)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Strength: \"},{\"color\":\"red\",\"text\":\"+183 \"},{\"color\":\"yellow\",\"text\":\"(+30) \"},{\"color\":\"blue\",\"text\":\"(+75) \"},{\"color\":\"light_purple\",\"text\":\"(+12) \"},{\"color\":\"dark_gray\",\"text\":\"(+663.75)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Crit Chance: \"},{\"color\":\"red\",\"text\":\"+100% \"},{\"color\":\"dark_gray\",\"text\":\"(+150%)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Crit Damage: \"},{\"color\":\"red\",\"text\":\"+105% \"},{\"color\":\"blue\",\"text\":\"(+50%) \"},{\"color\":\"dark_gray\",\"text\":\"(+375%)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Bonus Attack Speed: \"},{\"color\":\"red\",\"text\":\"+55% \"},{\"color\":\"dark_gray\",\"text\":\"(+75%)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"text\":\" \"},{\"color\":\"dark_purple\",\"text\":\"[\"},{\"color\":\"light_purple\",\"text\":\"❁\"},{\"color\":\"dark_purple\",\"text\":\"]\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"bold\":true,\"color\":\"light_purple\",\"text\":\"\"},{\"bold\":true,\"color\":\"light_purple\",\"text\":\"One For All I\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gold\",\"text\":\"Ability: Throw \"},{\"bold\":true,\"color\":\"yellow\",\"text\":\"RIGHT CLICK\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Throw your dagger at your\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"enemies!\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"dark_gray\",\"text\":\"Mana Cost: \"},{\"color\":\"dark_aqua\",\"text\":\"150\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"dark_gray\",\"text\":\"Cooldown: \"},{\"color\":\"green\",\"text\":\"5s\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Your Critical Hits deal \"},{\"color\":\"blue\",\"text\":\"100%\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"\"},{\"color\":\"gray\",\"text\":\"more damage if you are behind\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"your target.\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Fabled Bonus\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Critical hits have a chance to\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"deal up to \"},{\"color\":\"green\",\"text\":\"15% \"},{\"color\":\"gray\",\"text\":\"extra damage.\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"bold\":true,\"obfuscated\":true,\"color\":\"light_purple\",\"text\":\"a\"},{\"text\":\"\"},{\"bold\":false,\"italic\":false,\"underlined\":false,\"obfuscated\":false,\"strikethrough\":false,\"extra\":[{\"text\":\" \"}],\"text\":\"\"},{\"bold\":true,\"color\":\"light_purple\",\"text\":\"\"},{\"bold\":true,\"color\":\"light_purple\",\"text\":\"MYTHIC DUNGEON SWORD \"},{\"bold\":true,\"obfuscated\":true,\"color\":\"light_purple\",\"text\":\"a\"}],\"text\":\"\"}'],Name:'{\"italic\":false,\"extra\":[{\"color\":\"light_purple\",\"text\":\"Fabled Livid Dagger \"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"},{\"color\":\"gold\",\"text\":\"✪\"}],\"text\":\"\"}'}}}"));
private final ItemStack MITHRIL_DRILL_1 = ItemStack.fromNbt(StringNbtReader.parse("{Count:1b,id:\"minecraft:prismarine_shard\",tag:{Damage:21,Enchantments:[{id:\"minecraft:protection\",lvl:0s}],ExtraAttributes:{compact_blocks:97683,drill_fuel:2979,enchantments:{compact:7,efficiency:5,experience:3,fortune:3,telekinesis:1},id:\"MITHRIL_DRILL_1\",modifier:\"fleet\",originTag:\"UNKNOWN\",timestamp:\"1/30/21 5:52 AM\",uuid:\"575ce2c9-251e-4435-9020-de1a2e24b1d0\"},HideFlags:255,display:{Lore:['{\"italic\":false,\"extra\":[{\"color\":\"dark_gray\",\"text\":\"Breaking Power 5\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Damage: \"},{\"color\":\"red\",\"text\":\"+65\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Mining Speed: \"},{\"color\":\"green\",\"text\":\"+585 \"},{\"color\":\"blue\",\"text\":\"(+25)\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Mining Fortune: \"},{\"color\":\"green\",\"text\":\"+30\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Mining Wisdom: \"},{\"color\":\"green\",\"text\":\"+7\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Compact VII \"},{\"color\":\"dark_gray\",\"text\":\"97,683\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Gain \"},{\"color\":\"dark_aqua\",\"text\":\"+7☯ Mining Wisdom \"},{\"color\":\"gray\",\"text\":\"and a \"},{\"color\":\"green\",\"text\":\"0.4%\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"green\",\"text\":\"\"},{\"color\":\"gray\",\"text\":\"chance to drop an enchanted item.\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"dark_gray\",\"text\":\"150k blocks to tier up!\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Efficiency V\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Grants \"},{\"color\":\"green\",\"text\":\"+110 \"},{\"color\":\"gold\",\"text\":\"⸕ Mining Speed\"},{\"color\":\"gray\",\"text\":\".\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Experience III\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Grants a \"},{\"color\":\"green\",\"text\":\"37.5% \"},{\"color\":\"gray\",\"text\":\"chance for mobs and\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"ores to drop double experience.\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Fortune III\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Grants \"},{\"color\":\"gold\",\"text\":\"+30☘ Mining Fortune\"},{\"color\":\"gray\",\"text\":\", which\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"increases your chance for multiple\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"drops.\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Gain \"},{\"color\":\"green\",\"text\":\"+15% \"},{\"color\":\"dark_green\",\"text\":\"Mithril Powder\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"when using this Drill!\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Fuel Tank: \"},{\"color\":\"red\",\"text\":\"Not Installed\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"\"},{\"color\":\"gray\",\"text\":\"Increases fuel capacity with part\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"installed.\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Drill Engine: \"},{\"color\":\"red\",\"text\":\"Not Installed\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"\"},{\"color\":\"gray\",\"text\":\"Increases \"},{\"color\":\"gold\",\"text\":\"⸕ Mining Speed \"},{\"color\":\"gray\",\"text\":\"with part\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"installed.\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Upgrade Module: \"},{\"color\":\"red\",\"text\":\"Not Installed\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"\"},{\"color\":\"gray\",\"text\":\"Applies a passive upgrade with part\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"installed.\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Apply Drill Parts to this Drill by\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"talking to a \"},{\"color\":\"dark_green\",\"text\":\"Drill Mechanic\"},{\"color\":\"gray\",\"text\":\"!\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Fuel: \"},{\"color\":\"dark_green\",\"text\":\"2,979\"},{\"color\":\"dark_gray\",\"text\":\"/3k\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gold\",\"text\":\"Ability: Mining Speed Boost \"},{\"bold\":true,\"color\":\"yellow\",\"text\":\"RIGHT CLICK\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"Grants \"},{\"color\":\"green\",\"text\":\"+\"},{\"color\":\"green\",\"text\":\"200% \"},{\"color\":\"gold\",\"text\":\"⸕ Mining Speed \"},{\"color\":\"gray\",\"text\":\"for\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"gray\",\"text\":\"\"},{\"color\":\"green\",\"text\":\"15s\"},{\"color\":\"gray\",\"text\":\".\"}],\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"color\":\"dark_gray\",\"text\":\"Cooldown: \"},{\"color\":\"green\",\"text\":\"120s\"}],\"text\":\"\"}','{\"italic\":false,\"text\":\"\"}','{\"italic\":false,\"extra\":[{\"bold\":true,\"color\":\"blue\",\"text\":\"RARE DRILL\"}],\"text\":\"\"}'],Name:'{\"italic\":false,\"extra\":[{\"color\":\"blue\",\"text\":\"Fleet Mithril Drill SX-R226\"}],\"text\":\"\"}'}}}"));
@@ -26,7 +27,7 @@ public class ItemUtilsTest {
@Test
void testGetExtraAttributes() {
- Assertions.assertEquals("{art_of_war_count:1,dungeon_item_level:5,enchantments:{aiming:5,chance:4,cubism:5,impaling:3,infinite_quiver:10,overload:5,piercing:1,power:6,snipe:3,telekinesis:1,ultimate_soul_eater:5},hot_potato_count:15,id:\"JUJU_SHORTBOW\",modifier:\"spiritual\",originTag:\"QUICK_CRAFTING\",rarity_upgrades:1,runes:{DRAGON:3},stats_book:54778,timestamp:\"6/5/21 4:41 AM\",uuid:\"b06b8fe2-470a-43f3-b844-658472f20996\"}", ItemUtils.getExtraAttributes(JUJU_SHORTBOW).toString());
+ Assertions.assertEquals("{art_of_war_count:1,dungeon_item_level:5,enchantments:{aiming:5,chance:4,cubism:5,impaling:3,infinite_quiver:10,overload:5,piercing:1,power:6,snipe:3,telekinesis:1,ultimate_soul_eater:5},hot_potato_count:15,id:\"JUJU_SHORTBOW\",modifier:\"spiritual\",originTag:\"QUICK_CRAFTING\",rarity_upgrades:1,runes:{DRAGON:3},stats_book:54778,timestamp:1622882460000L,uuid:\"b06b8fe2-470a-43f3-b844-658472f20996\"}", ItemUtils.getExtraAttributes(JUJU_SHORTBOW).toString());
Assertions.assertEquals("{dungeon_item_level:5,enchantments:{telekinesis:1,ultimate_one_for_all:1},gems:{JASPER_0:\"FLAWLESS\"},hot_potato_count:15,id:\"LIVID_DAGGER\",modifier:\"fabled\",originTag:\"UNKNOWN\",rarity_upgrades:1,timestamp:\"2/20/21 3:09 PM\",uuid:\"214333db-d71c-4080-8487-00b4666bb9a4\"}", ItemUtils.getExtraAttributes(LIVID_DAGGER).toString());
Assertions.assertEquals("{compact_blocks:97683,drill_fuel:2979,enchantments:{compact:7,efficiency:5,experience:3,fortune:3,telekinesis:1},id:\"MITHRIL_DRILL_1\",modifier:\"fleet\",originTag:\"UNKNOWN\",timestamp:\"1/30/21 5:52 AM\",uuid:\"575ce2c9-251e-4435-9020-de1a2e24b1d0\"}", ItemUtils.getExtraAttributes(MITHRIL_DRILL_1).toString());
}
@@ -46,6 +47,14 @@ public class ItemUtilsTest {
}
@Test
+ void testGetTimestamp() {
+ Assertions.assertEquals("June 5, 2021", ItemUtils.getTimestamp(JUJU_SHORTBOW_OLD));
+ Assertions.assertEquals("June 5, 2021", ItemUtils.getTimestamp(JUJU_SHORTBOW));
+ Assertions.assertEquals("February 20, 2021", ItemUtils.getTimestamp(LIVID_DAGGER));
+ Assertions.assertEquals("January 30, 2021", ItemUtils.getTimestamp(MITHRIL_DRILL_1));
+ }
+
+ @Test
void testGetDurability() {
IntIntPair durability = ItemUtils.getDurability(MITHRIL_DRILL_1);
Assertions.assertNotNull(durability);