mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-30 19:52:06 -07:00
Fix tests
This commit is contained in:
@@ -80,9 +80,11 @@ diff --git a/src/test/java/io/papermc/paper/world/TranslationKeyTest.java b/src/
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/test/java/io/papermc/paper/world/TranslationKeyTest.java
|
||||
+++ b/src/test/java/io/papermc/paper/world/TranslationKeyTest.java
|
||||
@@ -0,0 +0,0 @@ package io.papermc.paper.world;
|
||||
@@ -0,0 +0,0 @@
|
||||
package io.papermc.paper.world;
|
||||
|
||||
import com.destroystokyo.paper.ClientOption;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
+import net.minecraft.network.chat.contents.TranslatableContents;
|
||||
import net.minecraft.world.entity.player.ChatVisiblity;
|
||||
+import net.minecraft.world.item.CreativeModeTab;
|
||||
+import net.minecraft.world.level.GameType;
|
||||
@@ -112,7 +114,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ @Test
|
||||
+ public void testDifficultyKeys() {
|
||||
+ for (Difficulty bukkitDifficulty : Difficulty.values()) {
|
||||
+ Assert.assertEquals(bukkitDifficulty + "'s translation key doesn't match", ((TranslatableComponent) net.minecraft.world.Difficulty.byId(bukkitDifficulty.ordinal()).getDisplayName()).getKey(), bukkitDifficulty.translationKey());
|
||||
+ Assert.assertEquals(bukkitDifficulty + "'s translation key doesn't match", ((TranslatableContents) net.minecraft.world.Difficulty.byId(bukkitDifficulty.ordinal()).getDisplayName().getContents()).getKey(), bukkitDifficulty.translationKey());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -144,7 +146,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ continue;
|
||||
+ }
|
||||
+ CreativeCategory category = Objects.requireNonNull(CraftCreativeCategory.fromNMS(tab));
|
||||
+ Assert.assertEquals("translation key mismatch for " + category, ((TranslatableComponent) tab.getDisplayName()).getKey(), category.translationKey());
|
||||
+ Assert.assertEquals("translation key mismatch for " + category, ((TranslatableContents) tab.getDisplayName().getContents()).getKey(), category.translationKey());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -153,7 +155,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ for (GameType nms : GameType.values()) {
|
||||
+ GameMode bukkit = GameMode.getByValue(nms.getId());
|
||||
+ Assert.assertNotNull(bukkit);
|
||||
+ Assert.assertEquals("translation key mismatch for " + bukkit, ((TranslatableComponent) nms.getLongDisplayName()).getKey(), bukkit.translationKey());
|
||||
+ Assert.assertEquals("translation key mismatch for " + bukkit, ((TranslatableContents) nms.getLongDisplayName().getContents()).getKey(), bukkit.translationKey());
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
Reference in New Issue
Block a user