Class TerminalStorageTabIngredientCraftingHandlerCraftingNetwork
java.lang.Object
org.cyclops.integratedterminals.modcompat.integratedcrafting.TerminalStorageTabIngredientCraftingHandlerCraftingNetwork
- All Implemented Interfaces:
ITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer>
public class TerminalStorageTabIngredientCraftingHandlerCraftingNetwork
extends Object
implements ITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>,Integer>
An
ITerminalStorageTabIngredientCraftingHandler implementation for
ICraftingNetwork.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateCraftingPlan(org.cyclops.integrateddynamics.api.network.INetwork network, int channel, ITerminalCraftingOption craftingOption, long quantity) Calculate a crafting plan for the given crafting option.booleancancelCraftingJob(org.cyclops.integrateddynamics.api.network.INetwork network, int channel, Integer craftingJobId) Cancel the crafting job with the given id.deserializeCraftingJobId(net.minecraft.nbt.Tag tag) Deserialize a crafting job id.deserializeCraftingOption(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> ingredientComponent, net.minecraft.nbt.CompoundTag tag) Deserialize a crafting option from NBT.deserializeCraftingPlan(net.minecraft.nbt.CompoundTag tag) Deserialize a crafting plan from NBT.<T,M> int[] getCraftingJob(org.cyclops.integrateddynamics.api.network.INetwork network, int channel, Integer craftingJobId) Get the crafting job with the given id.getCraftingJobs(org.cyclops.integrateddynamics.api.network.INetwork network, int channel) <T,M> Collection<TerminalCraftingOptionRecipeDefinition<?, ?>> getCraftingOptions(TerminalStorageTabIngredientComponentServer<T, M> tab, int channel) Get all crafting options in the given tab.net.minecraft.resources.ResourceLocationgetId()protected org.cyclops.integratedcrafting.api.recipe.IRecipeIndexgetRecipeIndex(org.cyclops.integrateddynamics.api.network.INetwork network, int channel) protected static ITerminalCraftingPlan<Integer>newActiveCraftingJob(org.cyclops.integratedcrafting.api.network.ICraftingNetwork craftingNetwork, int channel, org.cyclops.integratedcrafting.api.crafting.CraftingJob craftingJob, org.cyclops.integratedcrafting.api.crafting.CraftingJobDependencyGraph dependencyGraph) protected static ITerminalCraftingPlan<Integer>newCraftingPlan(org.cyclops.integratedcrafting.api.crafting.CraftingJob craftingJob, org.cyclops.integratedcrafting.api.crafting.CraftingJobDependencyGraph dependencyGraph, boolean root) protected static ITerminalCraftingPlan<Integer>newCraftingPlanErrorRecursive(List<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition> childRecipes) protected static ITerminalCraftingPlan<Integer>newCraftingPlanFailed(org.cyclops.integratedcrafting.api.crafting.FailedCraftingRecipeException exception, org.cyclops.integratedcrafting.api.crafting.CraftingJobDependencyGraph dependencyGraph) protected static ITerminalCraftingPlan<Integer>newCraftingPlanUnknown(org.cyclops.integratedcrafting.api.crafting.UnknownCraftingRecipeException exception, org.cyclops.integratedcrafting.api.crafting.CraftingJobDependencyGraph dependencyGraph) protected static ITerminalCraftingPlan<Integer>net.minecraft.nbt.TagSerializes a crafting job id.net.minecraft.nbt.CompoundTagserializeCraftingOption(TerminalCraftingOptionRecipeDefinition craftingOption) Serialize a crafting option to NBT.net.minecraft.nbt.CompoundTagserializeCraftingPlan(ITerminalCraftingPlan<Integer> craftingPlan) Serialize a crafting plan to NBT.voidstartCraftingJob(org.cyclops.integrateddynamics.api.network.INetwork network, int channel, ITerminalCraftingPlan<Integer> craftingPlan, net.minecraft.server.level.ServerPlayer player) Start a crafting job.protected static StringuuidToName(String uuid)
-
Constructor Details
-
TerminalStorageTabIngredientCraftingHandlerCraftingNetwork
public TerminalStorageTabIngredientCraftingHandlerCraftingNetwork()
-
-
Method Details
-
getRecipeIndex
protected org.cyclops.integratedcrafting.api.recipe.IRecipeIndex getRecipeIndex(org.cyclops.integrateddynamics.api.network.INetwork network, int channel) -
getId
public net.minecraft.resources.ResourceLocation getId()- Specified by:
getIdin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Returns:
- The unique id of this handler.
-
getChannels
- Specified by:
getChannelsin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Type Parameters:
T- The instance type.M- The matching condition parameter.- Parameters:
tab- An ingredient tab.- Returns:
- All channels that have crafting options.
-
getCraftingOptions
public <T,M> Collection<TerminalCraftingOptionRecipeDefinition<?,?>> getCraftingOptions(TerminalStorageTabIngredientComponentServer<T, M> tab, int channel) Description copied from interface:ITerminalStorageTabIngredientCraftingHandlerGet all crafting options in the given tab.- Specified by:
getCraftingOptionsin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Type Parameters:
T- The instance type.M- The matching condition parameter.- Parameters:
tab- An ingredient tab.channel- The channel to get the options for.- Returns:
- Crafting options.
-
serializeCraftingOption
public net.minecraft.nbt.CompoundTag serializeCraftingOption(TerminalCraftingOptionRecipeDefinition craftingOption) Description copied from interface:ITerminalStorageTabIngredientCraftingHandlerSerialize a crafting option to NBT.- Specified by:
serializeCraftingOptionin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Parameters:
craftingOption- A crafting option.- Returns:
- An NBT tag.
-
deserializeCraftingOption
public <T,M> TerminalCraftingOptionRecipeDefinition deserializeCraftingOption(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> ingredientComponent, net.minecraft.nbt.CompoundTag tag) throws IllegalArgumentExceptionDescription copied from interface:ITerminalStorageTabIngredientCraftingHandlerDeserialize a crafting option from NBT.- Specified by:
deserializeCraftingOptionin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Type Parameters:
T- The instance type.M- The matching condition parameter.- Parameters:
ingredientComponent- The ingredient component for the crafting option.tag- An NBT tag representing a crafting option.- Returns:
- A crafting option.
- Throws:
IllegalArgumentException- If the given tag was invalid.
-
calculateCraftingPlan
public ITerminalCraftingPlan<Integer> calculateCraftingPlan(org.cyclops.integrateddynamics.api.network.INetwork network, int channel, ITerminalCraftingOption craftingOption, long quantity) Description copied from interface:ITerminalStorageTabIngredientCraftingHandlerCalculate a crafting plan for the given crafting option.- Specified by:
calculateCraftingPlanin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Parameters:
network- The network in which the plan should be calculated.channel- The channel to get the options for.craftingOption- A crafting option.quantity- The requested output quantity.- Returns:
- The calculated crafting plan.
-
newCraftingPlan
protected static ITerminalCraftingPlan<Integer> newCraftingPlan(org.cyclops.integratedcrafting.api.crafting.CraftingJob craftingJob, org.cyclops.integratedcrafting.api.crafting.CraftingJobDependencyGraph dependencyGraph, boolean root) -
newCraftingPlanUnknown
protected static ITerminalCraftingPlan<Integer> newCraftingPlanUnknown(org.cyclops.integratedcrafting.api.crafting.UnknownCraftingRecipeException exception, org.cyclops.integratedcrafting.api.crafting.CraftingJobDependencyGraph dependencyGraph) -
newCraftingPlanFailed
protected static ITerminalCraftingPlan<Integer> newCraftingPlanFailed(org.cyclops.integratedcrafting.api.crafting.FailedCraftingRecipeException exception, org.cyclops.integratedcrafting.api.crafting.CraftingJobDependencyGraph dependencyGraph) -
newCraftingPlanErrorRecursive
protected static ITerminalCraftingPlan<Integer> newCraftingPlanErrorRecursive(List<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition> childRecipes) -
startCraftingJob
public void startCraftingJob(org.cyclops.integrateddynamics.api.network.INetwork network, int channel, ITerminalCraftingPlan<Integer> craftingPlan, net.minecraft.server.level.ServerPlayer player) throws CraftingJobStartException Description copied from interface:ITerminalStorageTabIngredientCraftingHandlerStart a crafting job.- Specified by:
startCraftingJobin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Parameters:
network- The network in which the plan should be started.channel- The channel to get the options for.craftingPlan- A crafting plan.player- The player that started the crafting job.- Throws:
CraftingJobStartException- If the crafting job failed to start.
-
newErroredCraftingJob
-
newActiveCraftingJob
protected static ITerminalCraftingPlan<Integer> newActiveCraftingJob(org.cyclops.integratedcrafting.api.network.ICraftingNetwork craftingNetwork, int channel, org.cyclops.integratedcrafting.api.crafting.CraftingJob craftingJob, org.cyclops.integratedcrafting.api.crafting.CraftingJobDependencyGraph dependencyGraph) -
uuidToName
-
getCraftingJobs
public List<ITerminalCraftingPlan<Integer>> getCraftingJobs(org.cyclops.integrateddynamics.api.network.INetwork network, int channel) - Specified by:
getCraftingJobsin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Parameters:
network- The network in which the plan should be started.channel- The channel to get the options for.- Returns:
- All running crafting plans.
-
getCraftingJob
@Nullable public ITerminalCraftingPlan<Integer> getCraftingJob(org.cyclops.integrateddynamics.api.network.INetwork network, int channel, Integer craftingJobId) Description copied from interface:ITerminalStorageTabIngredientCraftingHandlerGet the crafting job with the given id.- Specified by:
getCraftingJobin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Parameters:
network- The network in which the plan should be started.channel- The channel to get the options for.craftingJobId- A crafting job id.- Returns:
- A crafting job or null.
-
cancelCraftingJob
public boolean cancelCraftingJob(org.cyclops.integrateddynamics.api.network.INetwork network, int channel, Integer craftingJobId) Description copied from interface:ITerminalStorageTabIngredientCraftingHandlerCancel the crafting job with the given id.- Specified by:
cancelCraftingJobin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Parameters:
network- The network in which the plan should be started.channel- The channel to get the options for.craftingJobId- A crafting job id.- Returns:
- If the crafting job was successfully cancelled.
-
serializeCraftingPlan
public net.minecraft.nbt.CompoundTag serializeCraftingPlan(ITerminalCraftingPlan<Integer> craftingPlan) Description copied from interface:ITerminalStorageTabIngredientCraftingHandlerSerialize a crafting plan to NBT.- Specified by:
serializeCraftingPlanin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Parameters:
craftingPlan- A crafting plan.- Returns:
- An NBT tag.
-
deserializeCraftingPlan
public ITerminalCraftingPlan<Integer> deserializeCraftingPlan(net.minecraft.nbt.CompoundTag tag) throws IllegalArgumentException Description copied from interface:ITerminalStorageTabIngredientCraftingHandlerDeserialize a crafting plan from NBT.- Specified by:
deserializeCraftingPlanin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Parameters:
tag- An NBT tag representing a crafting plan.- Returns:
- A crafting option.
- Throws:
IllegalArgumentException- If the given tag was invalid.
-
serializeCraftingJobId
Description copied from interface:ITerminalStorageTabIngredientCraftingHandlerSerializes a crafting job id.- Specified by:
serializeCraftingJobIdin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Parameters:
id- An id.- Returns:
- An NBT tag.
-
deserializeCraftingJobId
Description copied from interface:ITerminalStorageTabIngredientCraftingHandlerDeserialize a crafting job id.- Specified by:
deserializeCraftingJobIdin interfaceITerminalStorageTabIngredientCraftingHandler<TerminalCraftingOptionRecipeDefinition<?,?>, Integer> - Parameters:
tag- An NBT tag.- Returns:
- An id.
-