Class CraftingJobIndexDefault

java.lang.Object
org.cyclops.integratedcrafting.core.CraftingJobIndexDefault
All Implemented Interfaces:
ICraftingJobIndex, ICraftingJobIndexModifiable

public class CraftingJobIndexDefault extends Object implements ICraftingJobIndexModifiable
A default implementation of ICraftingJobIndex and ICraftingJobIndexModifiable.
  • Constructor Details

    • CraftingJobIndexDefault

      public CraftingJobIndexDefault()
  • Method Details

    • getCraftingJobs

      public Collection<CraftingJob> getCraftingJobs()
      Specified by:
      getCraftingJobs in interface ICraftingJobIndex
      Returns:
      All crafting jobs that are available.
    • getCraftingJobs

      public <T, M> Iterator<CraftingJob> getCraftingJobs(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> outputType, T output, M matchCondition)
      Description copied from interface: ICraftingJobIndex
      Find crafting jobs with the given output.
      Specified by:
      getCraftingJobs in interface ICraftingJobIndex
      Type Parameters:
      T - The instance type.
      M - The matching condition parameter, may be Void.
      Parameters:
      outputType - The recipe component type.
      output - An output ingredient instance.
      matchCondition - A condition under which the matching should be done.
      Returns:
      An iterator of the crafting jobs that have the given output.
    • getCraftingJob

      @Nullable public CraftingJob getCraftingJob(int craftingJobId)
      Description copied from interface: ICraftingJobIndex
      Get the crafting job with the given id.
      Specified by:
      getCraftingJob in interface ICraftingJobIndex
      Parameters:
      craftingJobId - A crafting job id.
      Returns:
      A crafting job or null.
    • initializeIndex

      @Nullable protected <T, M> org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T,M,Collection<CraftingJob>> initializeIndex(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> recipeComponent)
    • addCraftingJob

      public void addCraftingJob(CraftingJob craftingJob)
      Description copied from interface: ICraftingJobIndexModifiable
      Add the given crafting job to this index.
      Specified by:
      addCraftingJob in interface ICraftingJobIndexModifiable
      Parameters:
      craftingJob - A crafting job.
    • addCraftingJobForComponent

      protected <T, M> void addCraftingJobForComponent(org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T,M,Collection<CraftingJob>> index, CraftingJob craftingJob)
    • removeCraftingJob

      public void removeCraftingJob(CraftingJob craftingJob)
      Description copied from interface: ICraftingJobIndexModifiable
      Remove the given crafting job from this index.
      Specified by:
      removeCraftingJob in interface ICraftingJobIndexModifiable
      Parameters:
      craftingJob - A crafting job.
    • removeCraftingJobForComponent

      protected <T, M> void removeCraftingJobForComponent(org.cyclops.cyclopscore.ingredient.collection.IIngredientMapMutable<T,M,Collection<CraftingJob>> index, CraftingJob craftingJob)