blob: 55cdc9b8be2aae303b61e2b9efcb25330cc3b2a0 (
plain)
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
|
package gregtech.nei;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
import gregtech.api.enums.GT_Values;
public class FusionSpecialValueFormatter implements INEISpecialInfoFormatter {
public static final FusionSpecialValueFormatter INSTANCE = new FusionSpecialValueFormatter();
private static final int M = 1000000;
@Override
public List<String> format(NEIRecipeInfo recipeInfo, Function<Integer, String> applyPrefixAndSuffix) {
int euToStart = recipeInfo.recipe.mSpecialValue;
int voltage = recipeInfo.recipe.mEUt;
int tier;
if (euToStart <= 10 * M * 16) {
tier = 1;
} else if (euToStart <= 20 * M * 16) {
tier = 2;
} else if (euToStart <= 40 * M * 16) {
tier = 3;
} else {
tier = 4;
}
if (voltage <= GT_Values.V[6]) {
// no-op
} else if (voltage <= GT_Values.V[7]) {
tier = Math.max(tier, 2);
} else if (voltage <= GT_Values.V[8]) {
tier = Math.max(tier, 3);
} else {
tier = 4;
}
return Collections.singletonList(applyPrefixAndSuffix.apply(euToStart) + " (MK " + tier + ")");
}
}
|