It's a long road, to 1.19

This commit is contained in:
2022-06-10 19:48:56 +02:00
parent 94e13cc65d
commit 7dc6bedf0f
12 changed files with 34 additions and 62 deletions

View File

@@ -2,25 +2,23 @@ package me.hypherionmc.craterlib.util;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.TranslatableComponent;
public class LangUtils {
public static Component getTooltipTitle(String key) {
return new TextComponent(ChatFormatting.YELLOW + new TranslatableComponent(key).getString());
return Component.literal(ChatFormatting.YELLOW + Component.translatable(key).getString());
}
public static String resolveTranslation(String key) {
return new TranslatableComponent(key).getString();
return Component.translatable(key).getString();
}
public static Component getTranslation(String key) {
return new TranslatableComponent(key);
return Component.translatable(key);
}
public static Component makeComponent(String text) {
return new TranslatableComponent(text);
return Component.translatable(text);
}
}