Class CraftingJobHandler

java.lang.Object
org.cyclops.integratedcrafting.core.CraftingJobHandler

public class CraftingJobHandler extends Object
A CraftingJobHandler maintains a list of processing and pending crafting job. Each time that update(INetwork, int, PartPos) is called, the handler will observe the target position for changes in the processing job. Also, it will try initiating pending jobs into the target if none was running.
  • Constructor Details

  • Method Details

    • writeToNBT

      public void writeToNBT(net.minecraft.nbt.CompoundTag tag)
    • readFromNBT

      public void readFromNBT(net.minecraft.nbt.CompoundTag tag)
    • canScheduleCraftingJobs

      public boolean canScheduleCraftingJobs()
    • scheduleCraftingJob

      public void scheduleCraftingJob(CraftingJob craftingJob)
    • getProcessingCraftingJobsPendingIngredients

      public it.unimi.dsi.fastutil.ints.Int2ObjectMap<Map<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>,List<org.cyclops.commoncapabilities.api.ingredient.IPrototypedIngredient<?,?>>>> getProcessingCraftingJobsPendingIngredients()
    • getProcessingCraftingJobsRaw

      public it.unimi.dsi.fastutil.ints.Int2ObjectMap<CraftingJob> getProcessingCraftingJobsRaw()
    • getProcessingCraftingJobs

      public Collection<CraftingJob> getProcessingCraftingJobs()
    • getPendingCraftingJobs

      public Collection<CraftingJob> getPendingCraftingJobs()
    • markCraftingJobProcessing

      public void markCraftingJobProcessing(CraftingJob craftingJob, Map<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>,List<org.cyclops.commoncapabilities.api.ingredient.IPrototypedIngredient<?,?>>> pendingIngredients)
    • unmarkCraftingJobProcessing

      public void unmarkCraftingJobProcessing(CraftingJob craftingJob)
    • setCraftingJobProcessingPendingIngredients

      public void setCraftingJobProcessingPendingIngredients(CraftingJob craftingJob, Map<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>,List<org.cyclops.commoncapabilities.api.ingredient.IPrototypedIngredient<?,?>>> pendingIngredients)
    • getObserversPendingDeletion

      public List<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>> getObserversPendingDeletion()
    • registerIngredientObserver

      protected <T, M> void registerIngredientObserver(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> ingredientComponent, org.cyclops.integrateddynamics.api.network.INetwork network)
    • unregisterIngredientObserver

      protected <T, M> void unregisterIngredientObserver(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> ingredientComponent, org.cyclops.integrateddynamics.api.network.INetwork network)
    • onCraftingJobFinished

      public void onCraftingJobFinished(CraftingJob craftingJob)
    • markCraftingJobFinished

      public void markCraftingJobFinished(int craftingJobId)
    • reRegisterObservers

      public void reRegisterObservers(org.cyclops.integrateddynamics.api.network.INetwork network)
    • update

      public void update(org.cyclops.integrateddynamics.api.network.INetwork network, int channel, org.cyclops.integrateddynamics.api.part.PartPos targetPos)
    • insertCrafting

      protected boolean insertCrafting(org.cyclops.integrateddynamics.api.part.PartPos target, org.cyclops.commoncapabilities.api.ingredient.IMixedIngredients ingredients, org.cyclops.integrateddynamics.api.network.INetwork network, int channel, boolean simulate)
    • getCraftingJobStatus

      public CraftingJobStatus getCraftingJobStatus(ICraftingNetwork network, int channel, int craftingJobId)
    • getAllCraftingJobs

      public it.unimi.dsi.fastutil.ints.Int2ObjectMap<CraftingJob> getAllCraftingJobs()
    • setIngredientComponentTarget

      public void setIngredientComponentTarget(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?> ingredientComponent, @Nullable net.minecraft.core.Direction side)
    • getIngredientComponentTarget

      @Nullable public net.minecraft.core.Direction getIngredientComponentTarget(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?> ingredientComponent)
    • getTargetGetter

      public Function<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>,org.cyclops.integrateddynamics.api.part.PartPos> getTargetGetter(org.cyclops.integrateddynamics.api.part.PartPos defaultPosition)