Skip to content

Commit

Permalink
Improved error handling of bent ItemStacks during recipe processing
Browse files Browse the repository at this point in the history
  • Loading branch information
OreCruncher committed Aug 28, 2015
1 parent 2643dba commit 4b3f356
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public final class ModForestry extends ModPlugin {

};

static final String[] scrapValuesPoor = new String[] { "beeLarvaeGE:*", "pollen:*", "apatite", };
static final String[] scrapValuesPoor = new String[] { "beeLarvaeGE:*", "pollen:*", "apatite", "canEmpty" };

static final String[] scrapValuesStandard = new String[] { "butterflyGE:*", "beePrincessGE:*", "beeQueenGE:*", };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,31 +165,33 @@ private void processRecipeList(final List<Object> recipes, final boolean vanilla
final IRecipe recipe = (IRecipe) o;
final ItemStack stack = recipe.getRecipeOutput();

// Check to see if this item should have a recipe in
// the list. This does not mean that something later
// on can't add one - just means by default it will
// not be included.
if (stack != null && (!vanillaOnly || ItemStackHelper.isVanilla(stack))) {
if (!ItemData.isRecipeIgnored(stack)) {

// If the name is prefixed with any of the mods
// we know about then we can create the recipe.
final String name = Item.itemRegistry.getNameForObject(stack.getItem());

if (SupportedMod.isModWhitelisted(name)) {
try {
try {

// Check to see if this item should have a recipe in
// the list. This does not mean that something later
// on can't add one - just means by default it will
// not be included.
if (stack != null && (!vanillaOnly || ItemStackHelper.isVanilla(stack))) {
if (!ItemData.isRecipeIgnored(stack)) {

// If the name is prefixed with any of the mods
// we know about then we can create the recipe.
final String name = Item.itemRegistry.getNameForObject(stack.getItem());

if (SupportedMod.isModWhitelisted(name)) {
final List<ItemStack> output = RecipeDecomposition.decompose(recipe);
if (vanillaOnly && !ItemStackHelper.isVanilla(output))
continue;
recycler.useRecipe(recipe).save();
} catch (Throwable t) {
ModLog.catching(t);
if (output != null && !output.isEmpty()) {
if (vanillaOnly && !ItemStackHelper.isVanilla(output))
continue;
recycler.useRecipe(recipe).save();
}
}
}
}
} catch (Throwable t) {
ModLog.warn("processRecipeList: Unable to register recipe for [%s]", ItemStackHelper.resolveName(stack));
}
}

}

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 4b3f356

Please sign in to comment.