Interface INetworkCraftingHandler
public interface INetworkCraftingHandler
A handler that adds crafting capabilities to networks.
-
Method Summary
Modifier and TypeMethodDescription<T,
M> boolean canCraft
(INetwork network, IPositionedAddonsNetworkIngredients<T, M> ingredientsNetwork, int channel) Check if this handler is applicable for the given channel.<T,
M> boolean craft
(INetwork network, IPositionedAddonsNetworkIngredients<T, M> ingredientsNetwork, int channel, org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> ingredientComponent, T instance, M matchCondition, boolean ignoreExistingJobs) Start a crafting job for the given instance in the given channel.<T,
M> boolean isCrafting
(INetwork network, IPositionedAddonsNetworkIngredients<T, M> ingredientsNetwork, int channel, org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> ingredientComponent, T instance, M matchCondition) Check if the given instance is being crafted.
-
Method Details
-
isCrafting
<T,M> boolean isCrafting(INetwork network, IPositionedAddonsNetworkIngredients<T, M> ingredientsNetwork, int channel, org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> ingredientComponent, T instance, M matchCondition) Check if the given instance is being crafted.- Type Parameters:
T
- The instance type.M
- The matching condition parameter, may be Void. Instances MUST properly implement the equals method.- Parameters:
network
- The network to craft in.ingredientsNetwork
- The ingredients network to craft in.channel
- A channel.ingredientComponent
- The ingredient component.instance
- The instance to craft.matchCondition
- The condition under which the instance should be crafted.- Returns:
- If a crafting job exists for the given instance.
-
canCraft
<T,M> boolean canCraft(INetwork network, IPositionedAddonsNetworkIngredients<T, M> ingredientsNetwork, int channel) Check if this handler is applicable for the given channel.- Type Parameters:
T
- The instance type.M
- The matching condition parameter, may be Void. Instances MUST properly implement the equals method.- Parameters:
network
- The network to craft in.ingredientsNetwork
- The ingredients network to craft in.channel
- A channel.- Returns:
- If we can craft in the given channel.
-
craft
<T,M> boolean craft(INetwork network, IPositionedAddonsNetworkIngredients<T, M> ingredientsNetwork, int channel, org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> ingredientComponent, T instance, M matchCondition, boolean ignoreExistingJobs) Start a crafting job for the given instance in the given channel.- Type Parameters:
T
- The instance type.M
- The matching condition parameter, may be Void. Instances MUST properly implement the equals method.- Parameters:
network
- The network to craft in.ingredientsNetwork
- The ingredients network to craft in.channel
- A channel.ingredientComponent
- The ingredient component.instance
- The instance to craft.matchCondition
- The condition under which the instance should be crafted.ignoreExistingJobs
- If running jobs for the given instance should be ignored, and a new job should be started anyways. If true, and a job already existed, then this method MUST return true.- Returns:
- If a crafting job could be started.
-