Class CraftingJobDependencyGraph
java.lang.Object
org.cyclops.integratedcrafting.api.crafting.CraftingJobDependencyGraph
A CraftingJobDependencyGraph stores dependencies between crafting jobs based on their unique ID.
-
Constructor Summary
ConstructorsConstructorDescriptionCraftingJobDependencyGraph(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 Summary
Modifier and TypeMethodDescriptionvoidaddCraftingJobId(CraftingJob craftingJob) voidaddDependency(CraftingJob craftingJob, int dependency) voidaddDependency(CraftingJob craftingJob, CraftingJob dependency) static CraftingJobDependencyGraphdeserialize(net.minecraft.nbt.CompoundTag tag) getCraftingJob(int id) getDependencies(CraftingJob craftingJob) getDependents(CraftingJob craftingJob) booleanhasDependencies(int craftingJobId) booleanhasDependencies(CraftingJob craftingJob) voidimportDependencies(CraftingJobDependencyGraph craftingJobsGraph) voidmergeCraftingJobs(CraftingJob target, CraftingJob mergee, boolean markMergeeAsFinished) Merge the two crafting jobs by adding the second job's amount into the first job's amount.voidonCraftingJobFinished(CraftingJob craftingJob) voidonCraftingJobFinished(CraftingJob craftingJob, boolean validateDependencies) voidremoveCraftingJobId(CraftingJob craftingJob) voidremoveDependency(int craftingJob, int dependency) static net.minecraft.nbt.CompoundTag
-
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
-
getCraftingJob
-
getDependencies
-
hasDependencies
-
hasDependencies
public boolean hasDependencies(int craftingJobId) -
getDependents
-
addCraftingJobId
-
removeCraftingJobId
-
onCraftingJobFinished
-
onCraftingJobFinished
-
addDependency
-
addDependency
-
removeDependency
public void removeDependency(int craftingJob, int dependency) -
importDependencies
-
mergeCraftingJobs
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
-
deserialize
-