Skip to content

Commit 0fbde73

Browse files
committedJul 15, 2014
Fix erogenousbeef-zz#226: Config errors could cause startup crashes
Now we just log a stern warning and fall-back to expected-good behavior
1 parent 731302f commit 0fbde73

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎erogenousbeef/bigreactors/common/BigReactors.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package erogenousbeef.bigreactors.common;
22

3+
import java.util.ArrayList;
4+
35
import net.minecraft.block.Block;
46
import net.minecraft.block.material.Material;
57
import net.minecraft.client.renderer.texture.TextureMap;
@@ -248,7 +250,12 @@ public static void register(Object modInstance)
248250
ItemStack product;
249251

250252
if(registerYelloriteSmeltToUranium) {
251-
product = OreDictionary.getOres("ingotUranium").get(0).copy();
253+
ArrayList<ItemStack> candidateOres = OreDictionary.getOres("ingotUranium");
254+
if(candidateOres == null || candidateOres.size() <= 0) {
255+
BRLog.warning("Config value registerYelloriteSmeltToUranium is set to True, but there are no ores registered as ingotUranium in the ore dictionary! Falling back to using standard yellorium only.");
256+
candidateOres = OreDictionary.getOres("ingotYellorium");
257+
}
258+
product = candidateOres.get(0).copy();
252259
}
253260
else {
254261
product = OreDictionary.getOres("ingotYellorium").get(0).copy();

0 commit comments

Comments
 (0)
Please sign in to comment.