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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
package gtPlusPlus.nei;
import codechicken.nei.recipe.TemplateRecipeHandler;
import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
public class GT_NEI_RFPP extends GTPP_NEI_DefaultHandler {
public GT_NEI_RFPP() {
super(GTPP_Recipe_Map.sFissionFuelProcessing);
}
@Override
public TemplateRecipeHandler newInstance() {
return new GT_NEI_RFPP();
}
@Override
public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) {
return new FFPPDefaultRecipe(aRecipe);
}
public class FFPPDefaultRecipe extends CachedDefaultRecipe {
public FFPPDefaultRecipe(final GT_Recipe aRecipe) {
super(aRecipe);
}
@Override
public void handleSlots() {
int tStartIndex = 0;
if (mRecipe.getRepresentativeInput(tStartIndex) != null) {
this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5));
}
tStartIndex++;
if (mRecipe.getRepresentativeInput(tStartIndex) != null) {
this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5));
}
tStartIndex++;
if (mRecipe.getRepresentativeInput(tStartIndex) != null) {
this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5));
}
tStartIndex++;
if (mRecipe.getRepresentativeInput(tStartIndex) != null) {
this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 23));
}
tStartIndex++;
if (mRecipe.getRepresentativeInput(tStartIndex) != null) {
this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23));
}
tStartIndex++;
if (mRecipe.getRepresentativeInput(tStartIndex) != null) {
this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23));
}
tStartIndex++;
if (mRecipe.mSpecialItems != null) {
this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52));
}
tStartIndex = 0;
//Four Output Slots
if (mRecipe.getOutput(tStartIndex) != null) {
this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex)));
}
tStartIndex++;
if (mRecipe.getOutput(tStartIndex) != null) {
this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex)));
}
tStartIndex++;
if (mRecipe.getOutput(tStartIndex) != null) {
this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex)));
}
tStartIndex++;
if (mRecipe.getOutput(tStartIndex) != null) {
this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex)));
}
tStartIndex++;
//New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.)
if (mRecipe.mFluidInputs.length > 2) {
if ((mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) {
this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 12, 5));
}
if ((mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) {
this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 5));
}
if ((mRecipe.mFluidInputs.length > 2) && (mRecipe.mFluidInputs[2] != null) && (mRecipe.mFluidInputs[2].getFluid() != null)) {
this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[2], true), 48, 5));
}
if ((mRecipe.mFluidInputs.length > 3) && (mRecipe.mFluidInputs[3] != null) && (mRecipe.mFluidInputs[3].getFluid() != null)) {
this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[3], true), 12, 23));
}
if ((mRecipe.mFluidInputs.length > 4) && (mRecipe.mFluidInputs[4] != null) && (mRecipe.mFluidInputs[4].getFluid() != null)) {
this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[4], true), 30, 23));
}
if ((mRecipe.mFluidInputs.length > 5) && (mRecipe.mFluidInputs[5] != null) && (mRecipe.mFluidInputs[5].getFluid() != null)) {
this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[5], true), 48, 23));
}
if ((mRecipe.mFluidInputs.length > 6) && (mRecipe.mFluidInputs[6] != null) && (mRecipe.mFluidInputs[6].getFluid() != null)) {
this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[6], true), 12, 41));
}
if ((mRecipe.mFluidInputs.length > 7) && (mRecipe.mFluidInputs[7] != null) && (mRecipe.mFluidInputs[7].getFluid() != null)) {
this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[7], true), 30, 41));
}
if ((mRecipe.mFluidInputs.length > 8) && (mRecipe.mFluidInputs[8] != null) && (mRecipe.mFluidInputs[8].getFluid() != null)) {
this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[8], true), 48, 41));
}
}
//Returns to old behaviour if fluid inputs < 3
else if ((mRecipe.mFluidInputs.length > 0) && (mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) {
this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 48, 52));
if ((mRecipe.mFluidInputs.length == 2) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) {
this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 52));
}
}
if (mRecipe.mFluidOutputs.length > 1) {
if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) {
this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 5));
}
if ((mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) {
this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 120, 5));
}
if ((mRecipe.mFluidOutputs.length > 2) && (mRecipe.mFluidOutputs[2] != null) && (mRecipe.mFluidOutputs[2].getFluid() != null)) {
this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[2], true), 138, 5));
}
if ((mRecipe.mFluidOutputs.length > 3) && (mRecipe.mFluidOutputs[3] != null) && (mRecipe.mFluidOutputs[3].getFluid() != null)) {
this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[3], true), 102, 23));
}
if ((mRecipe.mFluidOutputs.length > 4) && (mRecipe.mFluidOutputs[4] != null) && (mRecipe.mFluidOutputs[4].getFluid() != null)) {
this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[4], true), 120, 23));
}
if ((mRecipe.mFluidOutputs.length > 5) && (mRecipe.mFluidOutputs[5] != null) && (mRecipe.mFluidOutputs[5].getFluid() != null)) {
this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[5], true), 138, 23));
}
if ((mRecipe.mFluidOutputs.length > 6) && (mRecipe.mFluidOutputs[6] != null) && (mRecipe.mFluidOutputs[6].getFluid() != null)) {
this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[6], true), 102, 41));
}
if ((mRecipe.mFluidOutputs.length > 7) && (mRecipe.mFluidOutputs[7] != null) && (mRecipe.mFluidOutputs[7].getFluid() != null)) {
this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[7], true), 120, 41));
}
if ((mRecipe.mFluidOutputs.length > 8) && (mRecipe.mFluidOutputs[8] != null) && (mRecipe.mFluidOutputs[8].getFluid() != null)) {
this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[8], true), 138, 41));
}
} else if ((mRecipe.mFluidOutputs.length > 0) && (mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) {
this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 5));
}
}
}
}
|