Fixes registration of recipes when one of the recipes throws an unexpected unchecked exception during registration. Before, the registration would simply cancel and not log any errors in this case. Fixes issues with outdated IC2 integration (Macerator recipes) causing certain recipes to become non-functional.

This commit is contained in:
Sebastian Hartte 2016-11-02 23:32:20 +01:00
parent af54883fd3
commit 2f8013a49b

View file

@ -32,7 +32,6 @@ import java.util.Map.Entry;
import java.util.Optional;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.annotation.Nonnull;
import com.google.common.base.Preconditions;
@ -371,8 +370,6 @@ public class RecipeHandler implements IRecipeHandler
}
final Map<Class, Integer> processed = new HashMap<Class, Integer>();
try
{
for( final ICraftHandler ch : this.data.handlers )
{
try
@ -390,18 +387,6 @@ public class RecipeHandler implements IRecipeHandler
processed.put( clz, i + 1 );
}
}
catch( final RegistrationError e )
{
AELog.warn( "Unable to register a recipe: " + e.getMessage() );
if( this.data.exceptions )
{
AELog.debug( e );
}
if( this.data.crash )
{
throw e;
}
}
catch( final MissingIngredientError e )
{
if( this.data.errorOnMissing )
@ -413,14 +398,13 @@ public class RecipeHandler implements IRecipeHandler
}
if( this.data.crash )
{
throw e;
}
}
throw new IllegalStateException( e );
}
}
}
catch( final Throwable e )
{
AELog.warn( "Unable to register a recipe: " + e.getMessage() );
if( this.data.exceptions )
{
AELog.debug( e );
@ -430,6 +414,8 @@ public class RecipeHandler implements IRecipeHandler
throw new IllegalStateException( e );
}
}
}
for( final Entry<Class, Integer> e : processed.entrySet() )
{