-Potion crash bugfix

This commit is contained in:
makeo committed 2016-01-11 22:26:03 +01:00
1 parent f7f0e18020
commit 6064a23f4f
1 file changed
+12 -1
@@ -38,10 +38,21 @@ public class RegisteredPotions {
int id = ModConfig.loadPotionId(potionClass.getSimpleName());
if(id == -1) {
id = Potion.potionTypes.length;
for(int i = 0; i < Potion.potionTypes.length; i++) {
if(Potion.potionTypes[i] == null) {
id = i;
}
}
if(id == -1) {
id = Potion.potionTypes.length;
FMLLog.warning("Gadomancy could not find a free potion id and will extend the potionTypes array! This might cause fatal errors. Please consider changing the config!");
}
}
if(id > 127) {
FMLLog.warning("The potion id '" + id + "' of potion '" + Gadomancy.NAME + ":" + potionClass.getSimpleName() + "' is bigger then 127 this might cause errors. Please consider changing the config.");
FMLLog.warning("The potion id '" + id + "' of potion '" + Gadomancy.NAME + ":" + potionClass.getSimpleName() + "' is bigger then 127 this might cause errors as well. Please consider changing the config.");
}
if(id >= Potion.potionTypes.length) {