Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
Add ItemRarity test (#6247)
Dieser Commit ist enthalten in:
Ursprung
2961b2adab
Commit
3801a3951c
@ -29,3 +29,33 @@ index 21c1d6b7e97a1dee372ea1fa8eb95a712db63418..e606c246f486eb0775a577ee7ccc87a8
|
||||
// Paper end
|
||||
|
||||
/**
|
||||
diff --git a/src/test/java/io/papermc/paper/inventory/ItemRarityTest.java b/src/test/java/io/papermc/paper/inventory/ItemRarityTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..38e6d42098f216b1d24f50386e7be98181122d8d
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/inventory/ItemRarityTest.java
|
||||
@@ -0,0 +1,24 @@
|
||||
+package io.papermc.paper.inventory;
|
||||
+
|
||||
+import io.papermc.paper.adventure.PaperAdventure;
|
||||
+import net.minecraft.world.item.Rarity;
|
||||
+import org.junit.Test;
|
||||
+
|
||||
+import static org.junit.Assert.assertEquals;
|
||||
+
|
||||
+public class ItemRarityTest {
|
||||
+
|
||||
+ @Test
|
||||
+ public void testConvertFromNmsToBukkit() {
|
||||
+ for (Rarity nmsRarity : Rarity.values()) {
|
||||
+ assertEquals("rarity names are mis-matched", ItemRarity.values()[nmsRarity.ordinal()].name(), nmsRarity.name());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Test
|
||||
+ public void testRarityFormatting() {
|
||||
+ for (Rarity nmsRarity : Rarity.values()) {
|
||||
+ assertEquals("rarity formatting is mis-matched", nmsRarity.color, PaperAdventure.asVanilla(ItemRarity.values()[nmsRarity.ordinal()].color));
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren