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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
|
package gtPlusPlus.xmod.gregtech.common;
import static gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_Overflow.mOverflowCache;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.Recipe_GT;
import gregtech.common.GT_Proxy;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.ObjMap;
import gtPlusPlus.api.objects.minecraft.FormattedTooltipString;
import gtPlusPlus.core.handler.AchievementHandler;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.BaseCustomTileEntity;
import gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power.BaseCustomPower_MTE;
import gtPlusPlus.xmod.gregtech.common.covers.CoverManager;
import ic2.core.init.BlocksItems;
import ic2.core.init.InternalName;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
public class Meta_GT_Proxy {
static {
Logger.INFO("GT_PROXY - initialized.");
}
public static List<Runnable> GT_BlockIconload = new ArrayList<>();
public static List<Runnable> GT_ItemIconload = new ArrayList<>();
public static AutoMap<Integer> GT_ValidHeatingCoilMetas = new AutoMap<Integer>();
private static Class<BaseCustomTileEntity> sBaseMetaTileEntityClass;
private static Class<BaseCustomPower_MTE> sBaseMetaTileEntityClass2;
public static AchievementHandler mAssemblyAchievements;
public static final Map<String, FormattedTooltipString> mCustomGregtechMetaTooltips = new LinkedHashMap<String, FormattedTooltipString>();
@SideOnly(Side.CLIENT)
public static IIconRegister sBlockIcons, sItemIcons;
public Meta_GT_Proxy() {
}
public static Block sBlockMachines;
public static void preInit() {
//New GT++ Block, yay! (Progress)
//sBlockMachines = new GTPP_Block_Machines();
fixIC2FluidNames();
GT_Log.out.println("GT++ Mod: Register TileEntities.");
BaseMetaTileEntity tBaseMetaTileEntity = constructBaseMetaTileEntity();
BaseMetaTileEntity tBaseMetaTileEntity2 = constructBaseMetaTileEntityCustomPower();
GT_Log.out.println("GT++ Mod: Testing BaseMetaTileEntity.");
if (tBaseMetaTileEntity == null || tBaseMetaTileEntity2 == null) {
GT_Log.out.println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
throw new RuntimeException("");
}
//Gotta set it here so that we don't try call gregtech too early.
//Must set on the correct side
if (ReflectionUtils.doesFieldExist(GT_Proxy.class, "gt6Pipe")) {
StaticFields59.mGT6StylePipes = (boolean) StaticFields59.getFieldFromGregtechProxy("gt6Pipe");
}
else {
StaticFields59.mGT6StylePipes = false;
}
GT_Log.out.println("GT++ Mod: Registering the BaseMetaTileEntity.");
GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntity_GTPP");
GameRegistry.registerTileEntity(tBaseMetaTileEntity2.getClass(), "BaseMetaTileEntity_GTPP2");
CoverManager.generateCustomCovers();
}
public static void init() {
scheduleCoverMapCleaner();
setValidHeatingCoilMetas();
PollutionUtils.setPollutionFluids();
fixIC2FluidNames();
}
public static void postInit() {
mAssemblyAchievements = new AchievementHandler();
fixIC2FluidNames();
}
@SuppressWarnings("deprecation")
public static void fixIC2FluidNames() {
//Fix IC2 Hot Water name
try {
String aNewHeatedWaterName = "Heated Water";
Logger.INFO("Renaming [IC2 Hotspring Water] --> ["+aNewHeatedWaterName+"].");LanguageRegistry.instance().addStringLocalization("fluidHotWater", "Heated Water");
LanguageRegistry.instance().addStringLocalization("fluidHotWater", aNewHeatedWaterName);
LanguageRegistry.instance().addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName);
GT_LanguageManager.addStringLocalization("fluidHotWater", aNewHeatedWaterName);
GT_LanguageManager.addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName);
Block b = BlocksItems.getFluidBlock(InternalName.fluidHotWater);
if (b != null) {
LanguageRegistry.addName(ItemUtils.getSimpleStack(b), aNewHeatedWaterName);
LanguageRegistry.instance().addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName);
GT_LanguageManager.addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName);
}
Fluid f = BlocksItems.getFluid(InternalName.fluidHotWater);
if (f != null) {
LanguageRegistry.instance().addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName);
GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName);
int aDam = FluidRegistry.getFluidID(f);
ItemStack s = ItemList.Display_Fluid.getWithDamage(1, aDam);
if (s != null) {
LanguageRegistry.addName(s, aNewHeatedWaterName);
}
}
}
catch (Throwable t) {
}
}
public static boolean generatePlasmaRecipesForAdvVacFreezer() {
AutoMap<Recipe_GT> aFreezerMapRebaked = new AutoMap<Recipe_GT>();
AutoMap<Recipe_GT> aRemovedRecipes = new AutoMap<Recipe_GT>();
//Find recipes containing Plasma and map them
for (Recipe_GT y : Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList) {
if (y.mFluidInputs.length > 0) {
for (FluidStack r : y.mFluidInputs) {
if (r.getUnlocalizedName().toLowerCase().contains("plasma")) {
aRemovedRecipes.put(y);
continue;
}
}
aFreezerMapRebaked.put(y);
}
}
AutoMap<Recipe_GT> aNewRecipes = new AutoMap<Recipe_GT>();
int aAtomicMass = 0;
int aAtomicTier = 0;
final FluidStack NULL_PLASMA = Materials._NULL.getPlasma(1);
for (String s : ELEMENT.NAMES) {
aAtomicMass++;
aAtomicTier = (aAtomicMass/30)+1;
FluidStack aMoltenFluid = null;
FluidStack aPlasma = null;
//Try Get Material via Gregtech
Materials aGregMaterial = MaterialUtils.getMaterial(s);
if (aGregMaterial != null) {
aMoltenFluid = aGregMaterial.getMolten(1);
if (aMoltenFluid == null) {
aMoltenFluid = aGregMaterial.getFluid(1);
if (aMoltenFluid == null) {
aMoltenFluid = aGregMaterial.getGas(1);
if (aMoltenFluid == null) {
aMoltenFluid = aGregMaterial.getSolid(1);
}
}
}
aPlasma = aGregMaterial.getPlasma(100);
}
//Just wildcard values
if (aMoltenFluid == null || aPlasma == null) {
if (aMoltenFluid == null) {
aMoltenFluid = FluidUtils.getWildcardFluidStack(s, 1);
}
if (aPlasma == null) {
aPlasma = FluidUtils.getFluidStack("plasma."+s.toLowerCase(), 1);
}
}
//Skip this material
if (aMoltenFluid == null || aPlasma == null || aPlasma.isFluidEqual(NULL_PLASMA)) {
Logger.INFO("Could not generate Advanced Vacuum Freezer recipe. Cooling "+s+" plasma. Molten Form Exists? "+(aMoltenFluid != null)+" | Plasma Exists? "+(aPlasma != null));
continue;
}
else {
//Build a new plasma recipe
int aTotalTickTime = (20 * 1 + (aAtomicMass));
Recipe_GT aTempRecipe = new Recipe_GT(true,
new ItemStack[] {},
new ItemStack[] {},
null,
new int[] {10000},
new FluidStack[] {
aPlasma,
FluidUtils.getFluidStack("cryotheum", aTotalTickTime)
},
new FluidStack[] {
aMoltenFluid
},
aTotalTickTime,
(int) GT_Values.V[4+aAtomicTier],
aAtomicMass);
//Add it to the map if it's valid
if (aTempRecipe != null) {
aNewRecipes.put(aTempRecipe);
}
}
}
//Add the new recipes to the map we will rebake over the original
for (Recipe_GT w : aNewRecipes) {
aFreezerMapRebaked.put(w);
}
//Best not touch the original map if we don't have a valid map to override it with.
if (aFreezerMapRebaked.size() > 0) {
int aOriginalCount = Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.size();
//Empty the original map
Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.clear();
//Rebake the real map
for (Recipe_GT w : aFreezerMapRebaked) {
Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.add(w);
}
return Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.size() >= aOriginalCount;
}
return false;
}
public static TileEntity constructCustomGregtechMetaTileEntityByMeta(int aMeta) {
if (aMeta == 12) {
return Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower();
}
else {
return Meta_GT_Proxy.constructBaseMetaTileEntity();
}
}
public static BaseCustomTileEntity constructBaseMetaTileEntity() {
if (sBaseMetaTileEntityClass == null) {
try {
sBaseMetaTileEntityClass = BaseCustomTileEntity.class;
return (BaseCustomTileEntity) BaseCustomTileEntity.class.newInstance();
} catch (Throwable arg1) {
try {
Constructor<?> g = BaseCustomTileEntity.class.getConstructors()[0];
g.setAccessible(true);
return (BaseCustomTileEntity) g.newInstance();
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | SecurityException e) {
}
}
}
try {
return (BaseCustomTileEntity) ((BaseCustomTileEntity) sBaseMetaTileEntityClass.newInstance());
} catch (Throwable arg0) {
arg0.printStackTrace(GT_Log.err);
try {
Constructor<?> g = BaseCustomTileEntity.class.getConstructors()[0];
g.setAccessible(true);
return (BaseCustomTileEntity) g.newInstance();
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | SecurityException e) {
GT_Log.err
.println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
e.printStackTrace(GT_Log.err);
throw new RuntimeException(e);
}
}
}
public static BaseCustomPower_MTE constructBaseMetaTileEntityCustomPower() {
if (sBaseMetaTileEntityClass2 == null) {
try {
sBaseMetaTileEntityClass2 = BaseCustomPower_MTE.class;
return (BaseCustomPower_MTE) BaseCustomPower_MTE.class.newInstance();
} catch (Throwable arg1) {
try {
Constructor<?> g = BaseCustomPower_MTE.class.getConstructors()[0];
g.setAccessible(true);
return (BaseCustomPower_MTE) g.newInstance();
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | SecurityException e) {
// e.printStackTrace();
}
}
}
try {
return (BaseCustomPower_MTE) ((BaseCustomPower_MTE) sBaseMetaTileEntityClass2.newInstance());
} catch (Throwable arg0) {
arg0.printStackTrace(GT_Log.err);
try {
Constructor<?> g = BaseCustomPower_MTE.class.getConstructors()[0];
g.setAccessible(true);
return (BaseCustomPower_MTE) g.newInstance();
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | SecurityException e) {
GT_Log.err
.println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
e.printStackTrace(GT_Log.err);
throw new RuntimeException(e);
}
}
}
public static void setValidHeatingCoilMetas() {
for (int i = 0; i <= 6; i++ ) {
GT_ValidHeatingCoilMetas.put(i);
}
if (CORE.GTNH) {
for (int i = 7; i <= 8; i++ ) {
GT_ValidHeatingCoilMetas.put(i);
}
}
}
public static boolean areWeUsingGregtech5uExperimental(){
final int version = GregTech_API.VERSION;
if ((version == 508) || (version == 507)){
return false;
}
else if (version == 509){
return true;
}
else {
return false;
}
}
public static void scheduleCoverMapCleaner(){
TimerTask repeatedTask = new TimerTask() {
public void run() {
cleanupOverFlowCoverCache();
}
};
Timer timer = new Timer("CoverCleanupManager");
long delay = 120000L;
long period = 300000L;
timer.scheduleAtFixedRate(repeatedTask, delay, period);
}
public static int cleanupOverFlowCoverCache() {
ObjMap<String, ?> cache = mOverflowCache;
int aRemoved = 0;
long aCurrentTime = System.currentTimeMillis()/1000;
for (Object o : cache.values()) {
if (o != null && o instanceof HashMap) {
@SuppressWarnings("unchecked")
HashMap<String, Object> m = (HashMap<String, Object>) o;
if (m != null) {
String s = (String) m.get("aCoverKey");
if (m.containsKey("aLastUpdatedTime")) {
long mapTime = (long) m.get("mLastUpdatedTime");
if ((aCurrentTime-(mapTime/1000) > 30)){
mOverflowCache.remove(s);
aRemoved++;
}
}
else {
mOverflowCache.remove(s);
aRemoved++;
}
}
}
}
return aRemoved;
}
static GT_Proxy[] mProxies = new GT_Proxy[2];
/**
* @deprecated Use {@link StaticFields59#getFieldFromGregtechProxy(boolean,String)} instead
*/
public static Object getFieldFromGregtechProxy(boolean client, String fieldName) {
return StaticFields59.getFieldFromGregtechProxy(fieldName);
}
public static void setCustomGregtechTooltip(String aNbtTagName, FormattedTooltipString aData) {
mCustomGregtechMetaTooltips.put(aNbtTagName, aData);
}
public static void conStructGtTileBlockTooltip(ItemStack aStack, EntityPlayer aPlayer, List<Object> aList, boolean par4) {
try {
int tDamage = aStack.getItemDamage();
if ((tDamage <= 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) {
return;
}
if (GregTech_API.METATILEENTITIES[tDamage] != null) {
IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity();
if (tTileEntity.getDescription() != null) {
int i = 0;
for (String tDescription : tTileEntity.getDescription()) {
if (GT_Utility.isStringValid(tDescription)) {
if(tDescription.contains("%%%")){
String[] tString = tDescription.split("%%%");
if(tString.length>=2){
StringBuffer tBuffer = new StringBuffer();
Object tRep[] = new String[tString.length / 2];
for (int j = 0; j < tString.length; j++)
if (j % 2 == 0) tBuffer.append(tString[j]);
else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];}
aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished), tRep));
}
}else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished );
aList.add(tTranslated.equals("") ? tDescription : tTranslated);}
}else i++;
}
}
if (tTileEntity.getEUCapacity() > 0L) {
final long tVoltage = tTileEntity.getInputVoltage();
byte tTier = (byte) ((byte) Math.max(1, GT_Utility.getTier(tVoltage)));
//Custom handling
if (tDamage < 30500 && tDamage >= 30400) {
int aOffset = tDamage - 30400;
if ((aOffset) <= 10) {
tTier -= 2;
aList.add(EnumChatFormatting.BOLD+"16"+" Fuse Slots"+EnumChatFormatting.GRAY);
aList.add("Per each fuse, you may insert "+EnumChatFormatting.YELLOW+(GT_Values.V[tTier])+EnumChatFormatting.GRAY+" EU/t");
aList.add("However this "+EnumChatFormatting.ITALIC+EnumChatFormatting.RED+"MUST"+EnumChatFormatting.GRAY+" be in a single Amp");
aList.add("This machine can accept upto a single amp of "+GT_Values.VN[Math.min(tTier+2, 12)]+" as a result");
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Breaker_Loss", "Breaker Loss: "+EnumChatFormatting.RED+""+(GT_Values.V[Math.max(tTier-1, 0)]/10)+EnumChatFormatting.GRAY+" EU/t", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
}
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Special_Power_1", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
//aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
//aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_3", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
}
if (tTileEntity.getInputVoltage() > 0L) {
String inA = "0";
if (tTileEntity.getInputAmperage() >= 1L) {
inA = " at " + EnumChatFormatting.YELLOW + tTileEntity.getInputAmperage() + EnumChatFormatting.GRAY +" Amps";
}
else {
inA = " at " + EnumChatFormatting.WHITE + tTileEntity.getInputAmperage() + EnumChatFormatting.GRAY +" Amps";
}
String a1 = "Voltage IN: "+EnumChatFormatting.GREEN + tTileEntity.getInputVoltage()
+ " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")"
+ EnumChatFormatting.GRAY + inA;
aList.add(a1);
}
if (tTileEntity.getOutputVoltage() > 0L) {
String outA = "0";
if (tTileEntity.getOutputAmperage() >= 1L) {
outA = " at " + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY +" Amps";
}
else {
outA = " at " + EnumChatFormatting.WHITE + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY +" Amps";
}
String a1 = "Voltage OUT: "+EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage()
+ " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")"
+ EnumChatFormatting.GRAY + outA;
aList.add(a1);
}
if (tTileEntity.getOutputVoltage() > 0L) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Lossess_EU", "Transmission Loss: "+EnumChatFormatting.DARK_BLUE+""+(tDamage < 30500 && tDamage >= 30400 ? 0 : 1), !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
}
if (tTileEntity.getEUCapacity() > 0) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE2",
"Internal Capacity: ", !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE
+ tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY + " EU");
}
}
/*if (tTileEntity.getEUCapacity() > 0L) {
if (tTileEntity.getInputVoltage() > 0L) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY);
}
if (tTileEntity.getOutputVoltage() > 0L) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" + EnumChatFormatting.GRAY);
}
if (tTileEntity.getOutputAmperage() > 1L) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY);
}
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY);
}*/
}
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
if (aNBT.getBoolean("mMuffler")) {
aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished ));
}
if (aNBT.getBoolean("mSteamConverter")) {
aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished ));
}
int tAmount = 0;
if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) {
aList.add(tAmount + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", "Steam Tank Upgrades", !GregTech_API.sPostloadFinished ));
}
FluidStack afluid = net.minecraftforge.fluids.FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
if (afluid != null) {
int tFluidAmount = afluid.amount;
if (tFluidAmount > 0) {
aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_FLUIDTANK", "Tank Fluid: "+tFluidAmount+"L "+afluid.getLocalizedName()+"", !GregTech_API.sPostloadFinished ));
}
}
}
//Add Custom Here
//Add Custom Tooltips
for (String s : mCustomGregtechMetaTooltips.keySet()) {
if (aNBT.hasKey(s)) {
String aTip = mCustomGregtechMetaTooltips.get(s).getTooltip(aNBT.getString(s));
aList.add(aTip);
}
}
//Add GT++ Stuff
if (tDamage >= 30400 && tDamage < 30500) {
aList.add(EnumChatFormatting.UNDERLINE+"Special GT++ Machine");
}
if ((tDamage >= 750 && tDamage < 1000) || (tDamage >= 30000 && tDamage < 31000)) {
aList.add(CORE.GT_Tooltip);
}
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
}
}
|