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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
package gregtech.api.enums;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import gregtech.api.objects.MaterialStack;
public class MaterialAdapter {
public static final int DIESEL = 0, GAS = 1, THERMAL = 2, SEMIFLUID = 3, PLASMA = 4, MAGIC = 5;
private int metaItemSubID;
private TextureSet iconSet;
private float toolSpeed = 1.0f;
private int durability = 0;
private int toolQuality = 0;
private int types = 0;
private int r = 255, g = 255, b = 255, a = 255;
private String name;
private String defaultLocalName;
private int fuelType = 0;
private int fuelPower = 0;
private int meltingPoint = 0;
private int blastFurnaceTemp = 0;
private boolean blastFurnaceRequired = false;
private boolean transparent = false;
private int oreValue = 1;
private int densityMultiplier = 1;
private int densityDivider = 1;
private Dyes color = Dyes._NULL;
private int extraData = 0;
private List<MaterialStack> materialList = new ArrayList<MaterialStack>();
private List<TC_Aspects.TC_AspectStack> aspects = new ArrayList<TC_Aspects.TC_AspectStack>();
public MaterialAdapter(int metaItemSubID, TextureSet iconSet, String defaultLocalName) {
this.metaItemSubID = metaItemSubID;
this.iconSet = iconSet;
this.name = defaultLocalName.replace(" ", "");
this.defaultLocalName = defaultLocalName;
}
public Materials constructMaterial() {
return new Materials(metaItemSubID, iconSet, toolSpeed, durability, toolQuality, types, r, g, b, a, name, defaultLocalName, fuelType, fuelPower, meltingPoint, blastFurnaceTemp,
blastFurnaceRequired, transparent, oreValue, densityMultiplier, densityDivider, color, extraData, materialList, aspects);
}
public MaterialAdapter setName(String name){
this.name = name;
return this;
}
public MaterialAdapter setTypes(int types){
this.types = types;
return this;
}
public MaterialAdapter addDustItems(){
types = types | 1;
return this;
}
public MaterialAdapter addMetalItems(){
types = types | 2;
return this;
}
public MaterialAdapter addGemItems(){
types = types | 4;
return this;
}
public MaterialAdapter addOreItems(){
types = types | 8;
return this;
}
public MaterialAdapter addCell(){
types = types | 16;
return this;
}
public MaterialAdapter addPlasma(){
types = types | 32;
return this;
}
public MaterialAdapter addToolHeadItems(){
types = types | 64;
return this;
}
public MaterialAdapter addGearItems(){
types = types | 128;
return this;
}
public MaterialAdapter addFluid(){
types = types | 256;
return this;
}
public MaterialAdapter addGas(){
types = types | 512;
return this;
}
public MaterialAdapter setRGBA(int r, int g, int b, int a){
this.r = r;
this.g = g;
this.b = b;
this.a = a;
return this;
}
public MaterialAdapter setRGB(int r, int g, int b){
this.r = r;
this.g = g;
this.b = b;
return this;
}
public MaterialAdapter setTransparent(boolean transparent){
this.transparent = transparent;
return this;
}
public MaterialAdapter setColor(Dyes color){
this.color = color;
return this;
}
public MaterialAdapter setToolSpeed(float toolSpeed) {
this.toolSpeed = toolSpeed;
return this;
}
public MaterialAdapter setDurability(int durability) {
this.durability = durability;
return this;
}
public MaterialAdapter setToolQuality(int toolQuality) {
this.toolQuality = toolQuality;
return this;
}
public MaterialAdapter setFuelType(int fuelType) {
this.fuelType = fuelType;
return this;
}
public MaterialAdapter setFuelPower(int fuelPower) {
this.fuelPower = fuelPower;
return this;
}
public MaterialAdapter setMeltingPoint(int meltingPoint) {
this.meltingPoint = meltingPoint;
return this;
}
public MaterialAdapter setBlastFurnaceTemp(int blastFurnaceTemp) {
this.blastFurnaceTemp = blastFurnaceTemp;
return this;
}
public MaterialAdapter setBlastFurnaceRequired(boolean blastFurnaceRequired) {
this.blastFurnaceRequired = blastFurnaceRequired;
return this;
}
public MaterialAdapter setOreValue(int oreValue) {
this.oreValue = oreValue;
return this;
}
public MaterialAdapter setDensityMultiplier(int densityMultiplier) {
this.densityMultiplier = densityMultiplier;
return this;
}
public MaterialAdapter setDensityDivider(int densityDivider) {
this.densityDivider = densityDivider;
return this;
}
public MaterialAdapter setExtraData(int extraData) {
this.extraData = extraData;
return this;
}
public MaterialAdapter addElectrolyzerRecipe(){
extraData = extraData | 1;
return this;
}
public MaterialAdapter addCentrifugeRecipe(){
extraData = extraData | 2;
return this;
}
public MaterialAdapter setMaterialList(List<MaterialStack> materialList) {
this.materialList = materialList;
return this;
}
public MaterialAdapter setMaterialList(MaterialStack ... materials) {
this.materialList = Arrays.asList(materials);
return this;
}
public MaterialAdapter setAspects(List<TC_Aspects.TC_AspectStack> aspects) {
this.aspects = aspects;
return this;
}
}
|