Merge and fix
This commit is contained in:
parent
b91c85529d
commit
ce9f4add97
548 changed files with 17517 additions and 16862 deletions
|
@ -1,38 +1,38 @@
|
|||
package ru.betterend.util;
|
||||
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
public class LangUtil {
|
||||
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 translate(String key) {
|
||||
return I18n.translate(key);
|
||||
}
|
||||
|
||||
public static String getString(String element, String key) {
|
||||
return translate(String.format("%s.%s", element, key));
|
||||
}
|
||||
|
||||
public static TranslatableText getText(String element, String key) {
|
||||
return new TranslatableText(getString(element, key));
|
||||
}
|
||||
}
|
||||
package ru.betterend.util;
|
||||
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
public class LangUtil {
|
||||
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 translate(String key) {
|
||||
return I18n.translate(key);
|
||||
}
|
||||
|
||||
public static String getString(String element, String key) {
|
||||
return translate(String.format("%s.%s", element, key));
|
||||
}
|
||||
|
||||
public static TranslatableText getText(String element, String key) {
|
||||
return new TranslatableText(getString(element, key));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,68 +1,68 @@
|
|||
package ru.betterend.util;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
import ru.betterend.BetterEnd;
|
||||
|
||||
public final class Logger {
|
||||
|
||||
private static final org.apache.logging.log4j.Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
private String modPref = "[" + BetterEnd.MOD_ID + "] ";
|
||||
|
||||
private Logger() {}
|
||||
|
||||
public static Logger get() {
|
||||
return new Logger();
|
||||
}
|
||||
|
||||
public void log(Level level, String message) {
|
||||
LOGGER.log(level, modPref + message);
|
||||
}
|
||||
|
||||
public void log(Level level, String message, Object... params) {
|
||||
LOGGER.log(level, modPref + message, params);
|
||||
}
|
||||
|
||||
public void debug(Object message) {
|
||||
this.log(Level.DEBUG, message.toString());
|
||||
}
|
||||
|
||||
public void debug(Object message, Object... params) {
|
||||
this.log(Level.DEBUG, message.toString(), params);
|
||||
}
|
||||
|
||||
public void catching(Throwable ex) {
|
||||
this.error(ex.getLocalizedMessage());
|
||||
LOGGER.catching(ex);
|
||||
}
|
||||
|
||||
public void info(String message) {
|
||||
this.log(Level.INFO, message);
|
||||
}
|
||||
|
||||
public void info(String message, Object... params) {
|
||||
this.log(Level.INFO, message, params);
|
||||
}
|
||||
|
||||
public void warning(String message, Object... params) {
|
||||
this.log(Level.WARN, message, params);
|
||||
}
|
||||
|
||||
public void warning(String message, Object obj, Exception ex) {
|
||||
LOGGER.warn(modPref + message, obj, ex);
|
||||
}
|
||||
|
||||
public void error(String message) {
|
||||
this.log(Level.ERROR, message);
|
||||
}
|
||||
|
||||
public void error(String message, Object obj, Exception ex) {
|
||||
LOGGER.error(modPref + message, obj, ex);
|
||||
}
|
||||
|
||||
public void error(String message, Exception ex) {
|
||||
LOGGER.error(modPref + message, ex);
|
||||
}
|
||||
}
|
||||
package ru.betterend.util;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
import ru.betterend.BetterEnd;
|
||||
|
||||
public final class Logger {
|
||||
|
||||
private static final org.apache.logging.log4j.Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
private String modPref = "[" + BetterEnd.MOD_ID + "] ";
|
||||
|
||||
private Logger() {}
|
||||
|
||||
public static Logger get() {
|
||||
return new Logger();
|
||||
}
|
||||
|
||||
public void log(Level level, String message) {
|
||||
LOGGER.log(level, modPref + message);
|
||||
}
|
||||
|
||||
public void log(Level level, String message, Object... params) {
|
||||
LOGGER.log(level, modPref + message, params);
|
||||
}
|
||||
|
||||
public void debug(Object message) {
|
||||
this.log(Level.DEBUG, message.toString());
|
||||
}
|
||||
|
||||
public void debug(Object message, Object... params) {
|
||||
this.log(Level.DEBUG, message.toString(), params);
|
||||
}
|
||||
|
||||
public void catching(Throwable ex) {
|
||||
this.error(ex.getLocalizedMessage());
|
||||
LOGGER.catching(ex);
|
||||
}
|
||||
|
||||
public void info(String message) {
|
||||
this.log(Level.INFO, message);
|
||||
}
|
||||
|
||||
public void info(String message, Object... params) {
|
||||
this.log(Level.INFO, message, params);
|
||||
}
|
||||
|
||||
public void warning(String message, Object... params) {
|
||||
this.log(Level.WARN, message, params);
|
||||
}
|
||||
|
||||
public void warning(String message, Object obj, Exception ex) {
|
||||
LOGGER.warn(modPref + message, obj, ex);
|
||||
}
|
||||
|
||||
public void error(String message) {
|
||||
this.log(Level.ERROR, message);
|
||||
}
|
||||
|
||||
public void error(String message, Object obj, Exception ex) {
|
||||
LOGGER.error(modPref + message, obj, ex);
|
||||
}
|
||||
|
||||
public void error(String message, Exception ex) {
|
||||
LOGGER.error(modPref + message, ex);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue