Class PartTypeInterfaceCrafting.State
java.lang.Object
org.cyclops.integrateddynamics.core.part.PartStateBase<PartTypeInterfaceCrafting>
org.cyclops.integratedcrafting.part.PartTypeInterfaceCrafting.State
- All Implemented Interfaces:
org.cyclops.cyclopscore.persist.IDirtyMarkListener,ICraftingInterface,ICraftingResultsSink,org.cyclops.integrateddynamics.api.part.IPartState<PartTypeInterfaceCrafting>
- Enclosing class:
- PartTypeInterfaceCrafting
public static class PartTypeInterfaceCrafting.State
extends org.cyclops.integrateddynamics.core.part.PartStateBase<PartTypeInterfaceCrafting>
implements ICraftingInterface, ICraftingResultsSink
-
Field Summary
Fields inherited from interface org.cyclops.integrateddynamics.api.part.IPartState
GLOBALCOUNTER_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T,M> void addResult(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> ingredientComponent, T instance) Add the given instance.voidcancelCraftingJob(int channel, int craftingJobId) Cancel the given crafting job.booleanvoidflushInventoryOutputBuffer(org.cyclops.integrateddynamics.api.network.INetwork network) <T> net.minecraftforge.common.util.LazyOptional<T>getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, org.cyclops.integrateddynamics.api.network.INetwork network, org.cyclops.integrateddynamics.api.network.IPartNetwork partNetwork, org.cyclops.integrateddynamics.api.part.PartTarget target) intintintgetCraftingJobStatus(ICraftingNetwork network, int channel, int craftingJobId) Get the status for the given crafting job.protected intit.unimi.dsi.fastutil.ints.IntSetnet.minecraft.core.DirectiongetIngredientComponentTargetSideOverride(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?, ?> ingredientComponent) List<org.cyclops.commoncapabilities.api.ingredient.IngredientInstanceWrapper<?,?>> org.cyclops.cyclopscore.inventory.SimpleInventoryList<Map<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>, List<org.cyclops.commoncapabilities.api.ingredient.IPrototypedIngredient<?, ?>>>> getPendingCraftingJobOutputs(int craftingJobId) Get the pending outputs for the given crafting job, where the list indicates the different entries running in parallel.org.cyclops.integrateddynamics.api.part.PrioritizedPartPosCollection<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>it.unimi.dsi.fastutil.ints.Int2ObjectMap<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>net.minecraft.network.chat.MutableComponentgetRecipeSlotUnlocalizedMessage(int slot) org.cyclops.integrateddynamics.api.part.PartTargetbooleanbooleanisRecipeSlotValid(int slot) voidonDirty()voidreadFromNBT(net.minecraft.nbt.CompoundTag tag) protected voidreloadRecipe(int slot) voidvoidscheduleCraftingJob(CraftingJob craftingJob) Add the given crafting job to the list of crafting jobs.voidsetChannelCrafting(int channelCrafting) voidsetDisableCraftingCheck(boolean disableCraftingCheck) voidsetIngredientComponentTargetSideOverride(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?, ?> ingredientComponent, net.minecraft.core.Direction side) voidsetLastPlayer(net.minecraft.world.entity.player.Player lastPlayer) voidsetNetworks(org.cyclops.integrateddynamics.api.network.INetwork network, ICraftingNetwork craftingNetwork, org.cyclops.integrateddynamics.api.network.IPartNetwork partNetwork, int channel) voidsetShouldAddToCraftingNetwork(boolean shouldAddToCraftingNetwork) voidsetTarget(org.cyclops.integrateddynamics.api.part.PartTarget target) booleanprotected <C,T, M> C wrapStorageCapability(net.minecraftforge.common.capabilities.Capability<C> capability, org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> ingredientComponent) voidwriteToNBT(net.minecraft.nbt.CompoundTag tag) Methods inherited from class org.cyclops.integrateddynamics.core.part.PartStateBase
addVolatileCapability, forceBlockRenderUpdate, gatherCapabilities, generateId, getAspectProperties, getId, getPriority, getTargetSideOverride, getUpdateInterval, isDirtyAndReset, isEnabled, isForceBlockRenderUpdateAndReset, isUpdateAndReset, readAspectProperties, removeVolatileCapability, sendUpdate, setAspectProperties, setChannel, setEnabled, setPriority, setTargetSideOverride, setUpdateInterval, writeAspectProperties
-
Constructor Details
-
State
public State()
-
-
Method Details
-
getDefaultUpdateInterval
protected int getDefaultUpdateInterval()- Overrides:
getDefaultUpdateIntervalin classorg.cyclops.integrateddynamics.core.part.PartStateBase<PartTypeInterfaceCrafting>
-
getInventoryVariables
public org.cyclops.cyclopscore.inventory.SimpleInventory getInventoryVariables()- Returns:
- The inner variables inventory
-
writeToNBT
public void writeToNBT(net.minecraft.nbt.CompoundTag tag) - Specified by:
writeToNBTin interfaceorg.cyclops.integrateddynamics.api.part.IPartState<PartTypeInterfaceCrafting>- Overrides:
writeToNBTin classorg.cyclops.integrateddynamics.core.part.PartStateBase<PartTypeInterfaceCrafting>
-
readFromNBT
public void readFromNBT(net.minecraft.nbt.CompoundTag tag) - Specified by:
readFromNBTin interfaceorg.cyclops.integrateddynamics.api.part.IPartState<PartTypeInterfaceCrafting>- Overrides:
readFromNBTin classorg.cyclops.integrateddynamics.core.part.PartStateBase<PartTypeInterfaceCrafting>
-
setChannelCrafting
public void setChannelCrafting(int channelCrafting) -
getChannelCrafting
public int getChannelCrafting() -
reloadRecipes
public void reloadRecipes() -
reloadRecipe
protected void reloadRecipe(int slot) -
setLastPlayer
public void setLastPlayer(net.minecraft.world.entity.player.Player lastPlayer) -
onDirty
public void onDirty()- Specified by:
onDirtyin interfaceorg.cyclops.cyclopscore.persist.IDirtyMarkListener- Overrides:
onDirtyin classorg.cyclops.integrateddynamics.core.part.PartStateBase<PartTypeInterfaceCrafting>
-
setTarget
public void setTarget(org.cyclops.integrateddynamics.api.part.PartTarget target) -
getTarget
public org.cyclops.integrateddynamics.api.part.PartTarget getTarget() -
setNetworks
public void setNetworks(@Nullable org.cyclops.integrateddynamics.api.network.INetwork network, @Nullable ICraftingNetwork craftingNetwork, @Nullable org.cyclops.integrateddynamics.api.network.IPartNetwork partNetwork, int channel) -
getCraftingNetwork
-
getChannel
public int getChannel()- Specified by:
getChannelin interfaceorg.cyclops.integrateddynamics.api.part.IPartState<PartTypeInterfaceCrafting>- Overrides:
getChannelin classorg.cyclops.integrateddynamics.core.part.PartStateBase<PartTypeInterfaceCrafting>
-
getRecipes
public Collection<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition> getRecipes()- Specified by:
getRecipesin interfaceICraftingInterface- Returns:
- The collection of recipes that is exposed by this crafting interface.
-
getRecipesIndexed
public it.unimi.dsi.fastutil.ints.Int2ObjectMap<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition> getRecipesIndexed() -
canScheduleCraftingJobs
public boolean canScheduleCraftingJobs()- Specified by:
canScheduleCraftingJobsin interfaceICraftingInterface- Returns:
- If this crafting interface can currently accept crafting jobs.
-
scheduleCraftingJob
Description copied from interface:ICraftingInterfaceAdd the given crafting job to the list of crafting jobs.- Specified by:
scheduleCraftingJobin interfaceICraftingInterface- Parameters:
craftingJob- The crafting job.
-
getCraftingJobsCount
public int getCraftingJobsCount()- Specified by:
getCraftingJobsCountin interfaceICraftingInterface- Returns:
- Get the number of scheduled and running crafting jobs in this interface.
-
getCraftingJobs
- Specified by:
getCraftingJobsin interfaceICraftingInterface- Returns:
- Get the scheduled and running crafting jobs in this interface.
-
getPendingCraftingJobOutputs
public List<Map<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>, getPendingCraftingJobOutputsList<org.cyclops.commoncapabilities.api.ingredient.IPrototypedIngredient<?, ?>>>> (int craftingJobId) Description copied from interface:ICraftingInterfaceGet the pending outputs for the given crafting job, where the list indicates the different entries running in parallel.- Specified by:
getPendingCraftingJobOutputsin interfaceICraftingInterface- Parameters:
craftingJobId- A crafting job id.- Returns:
- A collection of all pending prototype-based ingredients.
-
getCraftingJobStatus
public CraftingJobStatus getCraftingJobStatus(ICraftingNetwork network, int channel, int craftingJobId) Description copied from interface:ICraftingInterfaceGet the status for the given crafting job.- Specified by:
getCraftingJobStatusin interfaceICraftingInterface- Parameters:
network- The network.channel- The channel.craftingJobId- A crafting job id.- Returns:
- The crafting status.
-
cancelCraftingJob
public void cancelCraftingJob(int channel, int craftingJobId) Description copied from interface:ICraftingInterfaceCancel the given crafting job. Note: this should not be called directly unless you know what you are doing! Instead, you should callICraftingNetwork.cancelCraftingJob(int, int).- Specified by:
cancelCraftingJobin interfaceICraftingInterface- Parameters:
channel- The channel.craftingJobId- A crafting job id.
-
getPosition
public org.cyclops.integrateddynamics.api.part.PrioritizedPartPos getPosition()- Specified by:
getPositionin interfaceICraftingInterface- Returns:
- The prioritized position of this interface.
-
getCraftingJobHandler
-
shouldAddToCraftingNetwork
public boolean shouldAddToCraftingNetwork() -
setShouldAddToCraftingNetwork
public void setShouldAddToCraftingNetwork(boolean shouldAddToCraftingNetwork) -
getInventoryOutputBuffer
public List<org.cyclops.commoncapabilities.api.ingredient.IngredientInstanceWrapper<?,?>> getInventoryOutputBuffer() -
getCapability
public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, org.cyclops.integrateddynamics.api.network.INetwork network, org.cyclops.integrateddynamics.api.network.IPartNetwork partNetwork, org.cyclops.integrateddynamics.api.part.PartTarget target) - Specified by:
getCapabilityin interfaceorg.cyclops.integrateddynamics.api.part.IPartState<PartTypeInterfaceCrafting>- Overrides:
getCapabilityin classorg.cyclops.integrateddynamics.core.part.PartStateBase<PartTypeInterfaceCrafting>
-
wrapStorageCapability
protected <C,T, C wrapStorageCapabilityM> (net.minecraftforge.common.capabilities.Capability<C> capability, org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> ingredientComponent) -
addResult
public <T,M> void addResult(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T, M> ingredientComponent, T instance) Description copied from interface:ICraftingResultsSinkAdd the given instance.- Specified by:
addResultin interfaceICraftingResultsSink- Type Parameters:
T- The instance type.M- The matching condition parameter, may be Void.- Parameters:
ingredientComponent- An ingredient component type.instance- An instance.
-
setIngredientComponentTargetSideOverride
public void setIngredientComponentTargetSideOverride(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?, ?> ingredientComponent, net.minecraft.core.Direction side) -
getIngredientComponentTargetSideOverride
public net.minecraft.core.Direction getIngredientComponentTargetSideOverride(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?, ?> ingredientComponent) -
isRecipeSlotValid
public boolean isRecipeSlotValid(int slot) -
getRecipeSlotUnlocalizedMessage
@Nullable public net.minecraft.network.chat.MutableComponent getRecipeSlotUnlocalizedMessage(int slot) -
getDelayedRecipeReloads
public it.unimi.dsi.fastutil.ints.IntSet getDelayedRecipeReloads() -
setDisableCraftingCheck
public void setDisableCraftingCheck(boolean disableCraftingCheck) -
isDisableCraftingCheck
public boolean isDisableCraftingCheck() -
flushInventoryOutputBuffer
public void flushInventoryOutputBuffer(org.cyclops.integrateddynamics.api.network.INetwork network)
-