Added config platform and utils

This commit is contained in:
Aleksey 2020-09-22 15:51:54 +03:00
parent 387655f150
commit 41e0d1e42a
8 changed files with 733 additions and 0 deletions

View file

@ -0,0 +1,37 @@
package ru.betterend.util;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.text.TranslatableText;
import ru.betterend.BetterEnd;
public class LangUtil {
private final static String MODID = BetterEnd.MOD_ID;
public final static String CONFIG_ELEMENT = "configuration";
private String element;
public LangUtil(String element) {
this.element = element;
}
public void setElement(String key) {
this.element = key;
}
public String getString(String key) {
return getString(element, key);
}
public TranslatableText getText(String key) {
return getText(element, key);
}
public static String getString(String element, String key) {
return I18n.translate(String.format("%s.%s.%s", MODID, element, key));
}
public static TranslatableText getText(String element, String key) {
return new TranslatableText(getString(element, key));
}
}