diff options
| author | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2025-06-26 12:07:10 -0400 |
|---|---|---|
| committer | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2025-06-26 12:07:10 -0400 |
| commit | 71ca871f2a2441813b26e24467b8e75b166f747a (patch) | |
| tree | 68df274445975ad1fc1c13fe667c59b2df486a52 /src/test/java/de/hysky | |
| parent | 3bd588279171d1f59b0433d2b94da29f5db4a740 (diff) | |
| download | Skyblocker-71ca871f2a2441813b26e24467b8e75b166f747a.tar.gz Skyblocker-71ca871f2a2441813b26e24467b8e75b166f747a.tar.bz2 Skyblocker-71ca871f2a2441813b26e24467b8e75b166f747a.zip | |
Add attribute list for bazaar price support
The code for generating the list has been left in so that it can easily
be regenerated if necessary.
Diffstat (limited to 'src/test/java/de/hysky')
| -rw-r--r-- | src/test/java/de/hysky/skyblocker/skyblock/hunting/AttributeSerializationTest.java | 18 | ||||
| -rw-r--r-- | src/test/java/de/hysky/skyblocker/utils/ItemUtilsTest.java | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/test/java/de/hysky/skyblocker/skyblock/hunting/AttributeSerializationTest.java b/src/test/java/de/hysky/skyblocker/skyblock/hunting/AttributeSerializationTest.java new file mode 100644 index 00000000..6c085007 --- /dev/null +++ b/src/test/java/de/hysky/skyblocker/skyblock/hunting/AttributeSerializationTest.java @@ -0,0 +1,18 @@ +package de.hysky.skyblocker.skyblock.hunting; + +import java.io.InputStream; + +import org.junit.jupiter.api.Test; + +import com.google.gson.JsonParser; +import com.mojang.serialization.JsonOps; + +public class AttributeSerializationTest { + + @Test + void testAttributeDeserialization() throws Exception { + try (InputStream stream = this.getClass().getResourceAsStream("/assets/skyblocker/hunting/attributes.json")) { + Attribute.LIST_CODEC.parse(JsonOps.INSTANCE, JsonParser.parseString(new String(stream.readAllBytes()))).getOrThrow(); + } + } +} diff --git a/src/test/java/de/hysky/skyblocker/utils/ItemUtilsTest.java b/src/test/java/de/hysky/skyblocker/utils/ItemUtilsTest.java index f38b35d3..f5df10c9 100644 --- a/src/test/java/de/hysky/skyblocker/utils/ItemUtilsTest.java +++ b/src/test/java/de/hysky/skyblocker/utils/ItemUtilsTest.java @@ -92,7 +92,7 @@ public class ItemUtilsTest { Assertions.assertEquals("FORAGING_XP_BOOST_POTION_3", POTION.getSkyblockApiId()); Assertions.assertEquals("ICE_RUNE_1", RUNE.getSkyblockApiId()); Assertions.assertEquals("ENCHANTMENT_FEATHER_FALLING_10", ENCHANTED_BOOK.getSkyblockApiId()); - Assertions.assertEquals("ATTRIBUTE_SHARD-TROPHY_HUNTER_1", ATTRIBUTE_SHARD.getSkyblockApiId()); + Assertions.assertEquals("ATTRIBUTE_SHARD", ATTRIBUTE_SHARD.getSkyblockApiId()); //Does not work due to the file needing to be loaded Assertions.assertEquals("SHINY_WITHER_CHESTPLATE", WITHER_CHESTPLATE.getSkyblockApiId()); Assertions.assertEquals("LVL_1_LEGENDARY_WITHER_SKELETON", WITHER_SKELETON_PET.getSkyblockApiId()); } |
