-
Notifications
You must be signed in to change notification settings - Fork 81
/
Util.java
38 lines (28 loc) · 1.06 KB
/
Util.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.progwml6.natura.library;
import net.minecraft.util.ResourceLocation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.Locale;
public class Util {
public static final String MODID = "natura";
public static final String RESOURCE = MODID.toLowerCase(Locale.US);
public static Logger getLogger(String type) {
String log = MODID;
return LogManager.getLogger(log + "-" + type);
}
/**
* Returns the given Resource prefixed with tinkers resource location. Use this function instead of hardcoding resource locations.
*/
public static String resource(String res) {
return String.format("%s:%s", RESOURCE, res);
}
public static ResourceLocation getResource(String res) {
return new ResourceLocation(RESOURCE, res);
}
/**
* Prefixes the given unlocalized name with tinkers prefix. Use this when passing unlocalized names for a uniform namespace.
*/
public static String prefix(String name) {
return String.format("%s.%s", RESOURCE, name.toLowerCase(Locale.US));
}
}