mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Fixed recipe removal
This commit is contained in:
1 parent
4cb866c622
commit
ace58996bf
1 file changed
+19
-1
@@ -1,7 +1,10 @@
|
||||
package mekanism.common.recipe;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -69,7 +72,22 @@ public final class RecipeHandler
|
||||
|
||||
public static void removeRecipe(Recipe recipeMap, MachineRecipe recipe)
|
||||
{
|
||||
recipeMap.remove(recipe);
|
||||
List<MachineInput> toRemove = new ArrayList<>();
|
||||
|
||||
for(Iterator iter = recipeMap.get().keySet().iterator(); iter.hasNext();)
|
||||
{
|
||||
MachineInput iterInput = (MachineInput)iter.next();
|
||||
|
||||
if(iterInput.testEquality(recipe.getInput()))
|
||||
{
|
||||
toRemove.add(iterInput);
|
||||
}
|
||||
}
|
||||
|
||||
for(MachineInput iterInput : toRemove)
|
||||
{
|
||||
recipeMap.get().remove(iterInput);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user