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
|
package miscutil.gregtech.metatileentity.implementations.base;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.common.gui.GT_Container_Boiler;
import gregtech.common.gui.GT_GUIContainer_Boiler;
import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
public class GregtechSteelBoiler
extends GT_MetaTileEntity_Boiler
{
public GregtechSteelBoiler(int aID, String aName, String aNameRegional, int aTier, String aDescription)
{
super(aID, aName, aNameRegional, "Put it to good use!", new ITexture[0]);
}
public GregtechSteelBoiler(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
{
super(aName, aTier, aDescription, aTextures);
}
public ITexture[][][] getTextureSet(ITexture[] aTextures)
{
ITexture[][][] rTextures = new ITexture[5][17][];
for (byte i = -1; i < 16; i = (byte)(i + 1))
{ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
rTextures[0][(i + 1)] = tmp0;
ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE)};
rTextures[1][(i + 1)] = tmp1;
ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
rTextures[2][(i + 1)] = tmp2;
ITexture[] tmp4 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) };
rTextures[3][(i + 1)] = tmp4;
ITexture[] tmp5 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) };
rTextures[4][(i + 1)] = tmp5;
}
return rTextures;
}
public int maxProgresstime()
{
return 1000;
}
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
{
return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000);
}
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
{
return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000);
}
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
{
return new GregtechSteelBoiler(this.mName, this.mTier, this.mDescription, this.mTextures);
}
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
{
if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L))
{
if (this.mTemperature <= 20)
{
this.mTemperature = 20;
this.mLossTimer = 0;
}
if (++this.mLossTimer > 40)
{
this.mTemperature -= 1;
this.mLossTimer = 0;
}
for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) {
if (i != aBaseMetaTileEntity.getFrontFacing())
{
IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
if (tTileEntity != null)
{
FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
if (tDrained != null)
{
int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
if (tFilledAmount > 0) {
tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
}
}
}
}
}
if (aTick % 10L == 0L) {
if (this.mTemperature > 100)
{
if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0))
{
this.mHadNoWater = true;
}
else
{
if (this.mHadNoWater)
{
aBaseMetaTileEntity.doExplosion(2048L);
return;
}
this.mFluid.amount -= 1;
if (this.mSteam == null) {
this.mSteam = GT_ModHandler.getSteam(150L);
} else if (GT_ModHandler.isSteam(this.mSteam)) {
this.mSteam.amount += 150;
} else {
this.mSteam = GT_ModHandler.getSteam(150L);
}
}
}
else {
this.mHadNoWater = false;
}
}
if ((this.mSteam != null) &&
(this.mSteam.amount > 32000))
{
sendSound((byte)1);
this.mSteam.amount = 24000;
}
if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
(this.mInventory[2] != null)) {
if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal))))
{
this.mProcessingEnergy += 160;
aBaseMetaTileEntity.decrStackSize(2, 1);
if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
}
}
else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Charcoal))))
{
this.mProcessingEnergy += 160;
aBaseMetaTileEntity.decrStackSize(2, 1);
if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
}
}
else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke"))
{
this.mProcessingEnergy += 640;
aBaseMetaTileEntity.decrStackSize(2, 1);
if (aBaseMetaTileEntity.getRandomNumber(2) == 0) {
aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
}
}
else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite))))
{
this.mProcessingEnergy += 40;
aBaseMetaTileEntity.decrStackSize(2, 1);
if (aBaseMetaTileEntity.getRandomNumber(8) == 0) {
aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
}
}
}
if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L))
{
this.mProcessingEnergy -= 2;
this.mTemperature += 1;
}
aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
}
@Override
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_,
int p_102007_3_) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_,
int p_102008_3_) {
// TODO Auto-generated method stub
return false;
}
@Override
public int getSizeInventory() {
// TODO Auto-generated method stub
return 0;
}
@Override
public ItemStack getStackInSlot(int p_70301_1_) {
// TODO Auto-generated method stub
return null;
}
@Override
public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
// TODO Auto-generated method stub
return null;
}
@Override
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
// TODO Auto-generated method stub
return null;
}
@Override
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
// TODO Auto-generated method stub
}
@Override
public String getInventoryName() {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean hasCustomInventoryName() {
// TODO Auto-generated method stub
return false;
}
@Override
public int getInventoryStackLimit() {
// TODO Auto-generated method stub
return 0;
}
@Override
public void markDirty() {
// TODO Auto-generated method stub
}
@Override
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
// TODO Auto-generated method stub
return false;
}
@Override
public void openInventory() {
// TODO Auto-generated method stub
}
@Override
public void closeInventory() {
// TODO Auto-generated method stub
}
@Override
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
// TODO Auto-generated method stub
return false;
}
}
/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
* Qualified Name: gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler_Steel
* JD-Core Version: 0.7.0.1
*/
|