-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGTValues.java
More file actions
95 lines (80 loc) · 3.37 KB
/
Copy pathGTValues.java
File metadata and controls
95 lines (80 loc) · 3.37 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package gregtech.api;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.oredict.OreDictionary;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
/**
* Made for static imports, this Class is just a Helper.
*/
public class GTValues {
/**
* <p/>
* This is worth exactly one normal Item.
* This Constant can be divided by many commonly used Numbers such as
* 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, ... 64 or 81
* without loosing precision and is for that reason used as Unit of Amount.
* But it is also small enough to be multiplied with larger Numbers.
* <p/>
* This is used to determine the amount of Material contained inside a prefixed Ore.
* For example Nugget = M / 9 as it contains out of 1/9 of an Ingot.
*/
public static final long M = 3628800;
/**
* Renamed from "FLUID_MATERIAL_UNIT" to just "L"
* <p/>
* Fluid per Material Unit (Prime Factors: 3 * 3 * 2 * 2 * 2 * 2)
*/
public static final int L = 144;
/**
* The Item WildCard Tag. Even shorter than the "-1" of the past
*/
public static final short W = OreDictionary.WILDCARD_VALUE;
/**
* The Voltage Tiers. Use this Array instead of the old named Voltage Variables
*/
public static final long[] V = new long[]{8, 32, 128, 512, 2048, 8192, 32768, 131072, 524288, Integer.MAX_VALUE};
public static final int ULV = 0;
public static final int LV = 1;
public static final int MV = 2;
public static final int HV = 3;
public static final int EV = 4;
public static final int IV = 5;
public static final int LuV = 6;
public static final int ZPM = 7;
public static final int UV = 8;
public static final int MAX = 9;
/**
* The short names for the voltages
*/
public static final String[] VN = new String[] {"ULV", "LV", "MV", "HV", "EV", "IV", "LuV", "ZPM", "UV", "MAX"};
/**
* Color values for the voltages
*/
public static final int[] VC = new int[] {0xDCDCDC, 0xDCDCDC, 0xFF6400, 0xFFFF1E, 0x808080, 0xF0F0F5, 0xF0F0F5, 0xF0F0F5, 0xF0F0F5, 0xF0F0F5};
/**
* The long names for the voltages
*/
public static final String[] VOLTAGE_NAMES = new String[] {"Ultra Low Voltage", "Low Voltage", "Medium Voltage", "High Voltage", "Extreme Voltage", "Insane Voltage", "Ludicrous Voltage", "ZPM Voltage", "Ultimate Voltage", "Maximum Voltage"};
/**
* ModID strings, since they are quite common parameters
*/
public static final String MODID = "gregtech",
MODID_FR = "forestry",
MODID_CT = "crafttweaker",
MODID_TOP = "theoneprobe",
MODID_CTM = "ctm",
MODID_CC = "cubicchunks",
MODID_AR = "advancedrocketry",
MODID_JEI = "jei";
//because forge is too fucking retarded to cache results or at least do not create fucking
//immutable collections every time you retrieve indexed mod list
private static final ConcurrentMap<String, Boolean> isModLoadedCache = new ConcurrentHashMap<>();
public static boolean isModLoaded(String modid) {
if (isModLoadedCache.containsKey(modid)) {
return isModLoadedCache.get(modid);
}
boolean isLoaded = Loader.instance().getIndexedModList().containsKey(modid);
isModLoadedCache.put(modid, isLoaded);
return isLoaded;
}
}