mirror of
https://github.com/GTNewHorizons/Gadomancy.git
synced 2026-11-26 14:53:21 +00:00
-Potion crash bugfix
This commit is contained in:
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) {
|
||||
|
||||
Reference in new issue
Block a user