Browse Source

Forgot that people could insert an already drained Firestone, so added a case for that too

Gregorius Techneticies 2 months ago
parent
commit
481a4f539f
Signed by: Gregorius Techneticies <gregoriustech@gmail.com> GPG Key ID: 1B693EA14F2FD70F

+ 24
- 6
src/main/java/gregtech/tileentity/energy/generators/MultiTileEntityGeneratorSolid.java View File

@@ -118,22 +118,40 @@ public class MultiTileEntityGeneratorSolid extends TileEntityBase09FacingSingle
118 118
 					if (addStackToSlot(1, mOutput1)) mOutput1 = null;
119 119
 					if (mOutput1 == null && slotHas(0) && !WD.hasCollide(worldObj, getOffsetX(mFacing), getOffsetY(mFacing), getOffsetZ(mFacing)) && !getBlockAtSide(mFacing).getMaterial().isLiquid() && WD.oxygen(worldObj, getOffsetX(mFacing), getOffsetY(mFacing), getOffsetZ(mFacing))) {
120 120
 						if (IL.RC_Firestone_Refined.equal(slot(0), T, T)) {
121
-							mEnergy += 800 * EU_PER_LAVA;
122 121
 							ItemStack tStack = ST.container(slot(0), F);
123
-							if (ST.invalid(ST.container(tStack, F))) {
124
-								slot(0, NI);
122
+							if (ST.invalid(tStack)) {
123
+								// Just dump the empty Firestone to the Output. This should not happen, unless you insert an empty Firestone.
124
+								if (addStackToSlot(1, slot(0))) slotKill(0);
125
+							} else if (ST.invalid(ST.container(tStack, F))) {
126
+								// 80% of whatever Heat Energy you get from Lava. This is over 10 times the normal Firestone Furnace burn Value.
127
+								mEnergy += 800 * EU_PER_LAVA;
128
+								// Prevent using up the Firestone entirely.
129
+								slotKill(0);
125 130
 								mOutput1 = tStack;
126 131
 							} else {
132
+								// 80% of whatever Heat Energy you get from Lava. This is over 10 times the normal Firestone Furnace burn Value.
133
+								mEnergy += 800 * EU_PER_LAVA;
134
+								// Continue using the Firestone.
127 135
 								slot(0, tStack);
128 136
 							}
129 137
 						} else if (IL.RC_Firestone_Cracked.equal(slot(0), T, T)) {
130
-							mEnergy += 600 * EU_PER_LAVA;
131 138
 							ItemStack tStack = ST.container(slot(0), F);
132
-							if (ST.invalid(ST.container(tStack, F))) {
133
-								slot(0, NI);
139
+							if (ST.invalid(tStack)) {
140
+								// Just dump the empty Firestone to the Output. This should not happen, unless you insert an empty Firestone.
141
+								if (addStackToSlot(1, slot(0))) slotKill(0);
142
+							} else if (ST.invalid(ST.container(tStack, F))) {
143
+								// Less Power for the broken Firestone, so 60%.
144
+								mEnergy += 600 * EU_PER_LAVA;
145
+								// Prevent using up the Firestone entirely.
146
+								slotKill(0);
134 147
 								mOutput1 = tStack;
135 148
 							} else {
149
+								// Less Power for the broken Firestone, so 60%.
150
+								mEnergy += 600 * EU_PER_LAVA;
151
+								// Continue using the Firestone.
136 152
 								slot(0, tStack);
153
+								// Cracked Firestones cause Fire to be released way more often.
154
+								WD.fire(worldObj, xCoord-FLAME_RANGE+rng(2*FLAME_RANGE+1), yCoord-1+rng(2+FLAME_RANGE), zCoord-FLAME_RANGE+rng(2*FLAME_RANGE+1), T);
137 155
 							}
138 156
 						} else {
139 157
 							Recipe tRecipe = mRecipes.findRecipe(this, mLastRecipe, T, Long.MAX_VALUE, null, ZL_FS, slot(0));

Loading…
Cancel
Save