Revert "Small re-factor to the RecipeRemover"

This reverts commit 9c94b045b3.
This commit is contained in:
modmuss50 2015-08-04 10:31:41 +01:00
parent 9c94b045b3
commit 1d6504c7ba
2 changed files with 23 additions and 19 deletions

View file

@ -76,7 +76,7 @@ public class ItemRockCutter extends ItemPickaxe implements IElectricItem {
public boolean canHarvestBlock(Block block, ItemStack stack){
return Items.diamond_pickaxe.canHarvestBlock(block, stack);
}
@Override
public int getHarvestLevel(ItemStack stack, String toolClass)
{

View file

@ -17,29 +17,33 @@ public class RecipeRemover {
public static void removeAnyRecipe(ItemStack resultItem)
{
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for(IRecipe tmpRecipe : recipes){
ItemStack recipeResult = tmpRecipe.getRecipeOutput();
if (ItemStack.areItemStacksEqual(resultItem, recipeResult))
{
recipes.remove(tmpRecipe);
}
}
for (int i = 0; i < recipes.size(); i++)
{
IRecipe tmpRecipe = recipes.get(i);
ItemStack recipeResult = tmpRecipe.getRecipeOutput();
if (ItemStack.areItemStacksEqual(resultItem, recipeResult))
{
recipes.remove(i--);
}
}
}
public static void removeShapedRecipe(ItemStack resultItem)
{
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe tmpRecipe : recipes){
if (tmpRecipe instanceof ShapedRecipes)
{
ShapedRecipes recipe = (ShapedRecipes) tmpRecipe;
ItemStack recipeResult = recipe.getRecipeOutput();
for (int i = 0; i < recipes.size(); i++)
{
IRecipe tmpRecipe = recipes.get(i);
if (tmpRecipe instanceof ShapedRecipes)
{
ShapedRecipes recipe = (ShapedRecipes) tmpRecipe;
ItemStack recipeResult = recipe.getRecipeOutput();
if (ItemStack.areItemStacksEqual(resultItem, recipeResult))
{
recipes.remove(tmpRecipe);
}
}
}
if (ItemStack.areItemStacksEqual(resultItem, recipeResult))
{
recipes.remove(i++);
}
}
}
}
}