Class CraftingJobDependencyGraph

java.lang.Object
org.cyclops.integratedcrafting.api.crafting.CraftingJobDependencyGraph

public class CraftingJobDependencyGraph extends Object
A CraftingJobDependencyGraph stores dependencies between crafting jobs based on their unique ID.
  • Constructor Details

    • CraftingJobDependencyGraph

      public CraftingJobDependencyGraph()
    • CraftingJobDependencyGraph

      public CraftingJobDependencyGraph(it.unimi.dsi.fastutil.ints.Int2ObjectMap<CraftingJob> craftingJobs, it.unimi.dsi.fastutil.ints.Int2ObjectMap<it.unimi.dsi.fastutil.ints.IntCollection> dependencies, it.unimi.dsi.fastutil.ints.Int2ObjectMap<it.unimi.dsi.fastutil.ints.IntCollection> dependents)
  • Method Details

    • getCraftingJobs

      public Collection<CraftingJob> getCraftingJobs()
    • getCraftingJob

      @Nullable public CraftingJob getCraftingJob(int id)
    • getDependencies

      public Collection<CraftingJob> getDependencies(CraftingJob craftingJob)
    • hasDependencies

      public boolean hasDependencies(CraftingJob craftingJob)
    • hasDependencies

      public boolean hasDependencies(int craftingJobId)
    • getDependents

      public Collection<CraftingJob> getDependents(CraftingJob craftingJob)
    • addCraftingJobId

      public void addCraftingJobId(CraftingJob craftingJob)
    • removeCraftingJobId

      public void removeCraftingJobId(CraftingJob craftingJob)
    • onCraftingJobFinished

      public void onCraftingJobFinished(CraftingJob craftingJob)
    • onCraftingJobFinished

      public void onCraftingJobFinished(CraftingJob craftingJob, boolean finishInvalidDependencies)
    • addDependency

      public void addDependency(CraftingJob craftingJob, CraftingJob dependency)
    • addDependency

      public void addDependency(CraftingJob craftingJob, int dependency)
    • removeDependency

      public void removeDependency(int craftingJob, int dependency)
    • importDependencies

      public void importDependencies(CraftingJobDependencyGraph craftingJobsGraph)
    • mergeCraftingJobs

      public void mergeCraftingJobs(CraftingJob target, CraftingJob mergee, boolean markMergeeAsFinished)
      Merge the two crafting jobs by adding the second job's amount into the first job's amount. Furthermore, all dependencies of the second job will be merged into the dependencies of the first job as well.
      Parameters:
      target - The job that should be merged into.
      mergee - The job that should be removed and merged into the target job.
      markMergeeAsFinished - If the mergee job should be marked as finished.
    • serialize

      public static net.minecraft.nbt.CompoundTag serialize(CraftingJobDependencyGraph graph)
    • deserialize

      public static CraftingJobDependencyGraph deserialize(net.minecraft.nbt.CompoundTag tag)