コード例 #1
0
 @Override
 public void removeRecipe(IInscriberRecipe toBeRemovedRecipe) {
   for (final Iterator<IInscriberRecipe> iterator = this.recipes.iterator();
       iterator.hasNext(); ) {
     final IInscriberRecipe recipe = iterator.next();
     if (recipe.equals(toBeRemovedRecipe)) {
       iterator.remove();
     }
   }
 }
コード例 #2
0
  @Override
  public void addRecipe(IInscriberRecipe recipe) {
    if (recipe == null) {
      throw new IllegalArgumentException(
          "Tried to add an invalid (null) inscriber recipe to the registry.");
    }

    this.recipes.add(recipe);

    this.optionals.addAll(recipe.getTopOptional().asSet());
    this.optionals.addAll(recipe.getBottomOptional().asSet());

    this.inputs.addAll(recipe.getInputs());
  }