mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 20:52:12 -07:00
Make Biome implement Translatable (#8161)
This commit is contained in:
@@ -84,10 +84,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
package io.papermc.paper.world;
|
||||
|
||||
import com.destroystokyo.paper.ClientOption;
|
||||
+import net.minecraft.core.Registry;
|
||||
+import net.minecraft.core.RegistryAccess;
|
||||
+import net.minecraft.network.chat.contents.TranslatableContents;
|
||||
+import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.entity.player.ChatVisiblity;
|
||||
+import net.minecraft.world.item.CreativeModeTab;
|
||||
+import net.minecraft.world.level.GameType;
|
||||
+import net.minecraft.world.level.biome.Biome;
|
||||
import org.bukkit.Difficulty;
|
||||
+import org.bukkit.FireworkEffect;
|
||||
+import org.bukkit.GameMode;
|
||||
@@ -100,6 +104,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
import org.junit.Test;
|
||||
|
||||
-public class TranslationKeyTest {
|
||||
+import java.util.Map;
|
||||
+import java.util.Objects;
|
||||
+
|
||||
+public class TranslationKeyTest extends AbstractTestingBase {
|
||||
@@ -157,5 +162,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ Assert.assertNotNull(bukkit);
|
||||
+ Assert.assertEquals("translation key mismatch for " + bukkit, ((TranslatableContents) nms.getLongDisplayName().getContents()).getKey(), bukkit.translationKey());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Test
|
||||
+ public void testBiome() {
|
||||
+ for (Map.Entry<ResourceKey<Biome>, Biome> nms : RegistryAccess.builtinCopy().registry(Registry.BIOME_REGISTRY).get().entrySet()) {
|
||||
+ org.bukkit.block.Biome bukkit = org.bukkit.block.Biome.valueOf(nms.getKey().location().getPath().toUpperCase());
|
||||
+ Assert.assertEquals("translation key mismatch for " + bukkit, nms.getKey().location().toLanguageKey("biome"), bukkit.translationKey());
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
Reference in New Issue
Block a user