Interface INetworkCraftingHandlerRegistry
- All Superinterfaces:
org.cyclops.cyclopscore.init.IRegistry
- All Known Implementing Classes:
NetworkCraftingHandlerRegistry
public interface INetworkCraftingHandlerRegistry
extends org.cyclops.cyclopscore.init.IRegistry
Registry for
INetworkCraftingHandler
.-
Method Summary
Modifier and TypeMethodDescriptiondefault <T,
M> boolean canCraft
(INetwork network, IPositionedAddonsNetworkIngredients<T, M> ingredientsNetwork, int channel) Check if at least one crafting handler is applicable for the given channel.default <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.default <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 at least one crafting handler is crafting the given instance.<C extends INetworkCraftingHandler>
Cregister
(C craftingHandler) Register a new crafting handler.
-
Method Details
-
register
Register a new crafting handler.- Type Parameters:
C
- The crafting handler type.- Parameters:
craftingHandler
- The crafting handler.- Returns:
- The registered crafting handler.
-
getCraftingHandlers
Collection<INetworkCraftingHandler> getCraftingHandlers()- Returns:
- All registered crafting handlers.
-
isCrafting
default <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 at least one crafting handler is crafting the given instance.- Type Parameters:
T
- The instance type.M
- The matching condition parameter, may be Void.- 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 the instance is being crafted.
-
canCraft
default <T,M> boolean canCraft(INetwork network, IPositionedAddonsNetworkIngredients<T, M> ingredientsNetwork, int channel) Check if at least one crafting handler is applicable for the given channel.- Type Parameters:
T
- The instance type.M
- The matching condition parameter, may be Void.- 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
default <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.- 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.- Returns:
- If a crafting job could be started.
-