Code cleanup and refactoring before porting

This commit is contained in:
2023-05-10 21:21:16 +02:00
parent 1dec8d130c
commit 8e72212bf6
134 changed files with 975 additions and 755 deletions

View File

@@ -0,0 +1,28 @@
package com.hypherionmc.craterlib.util;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
/**
* @author HypherionSA
* Utility class to handle Translation Keys and Formatting
*/
public class LangUtils {
public static Component getTooltipTitle(String key) {
return Component.literal(ChatFormatting.YELLOW + Component.translatable(key).getString());
}
public static String resolveTranslation(String key) {
return Component.translatable(key).getString();
}
public static Component getTranslation(String key) {
return Component.translatable(key);
}
public static Component makeComponent(String text) {
return Component.translatable(text);
}
}