Class PartTypeInterfaceCraftingBase.State<P extends PartTypeInterfaceCraftingBase<P,S>,S extends PartTypeInterfaceCraftingBase.State<P,S>>

java.lang.Object
org.cyclops.integrateddynamics.core.part.PartStateBase<P>
org.cyclops.integratedcrafting.core.part.PartTypeInterfaceCraftingBase.State<P,S>
All Implemented Interfaces:
org.cyclops.cyclopscore.persist.IDirtyMarkListener, ICraftingInterface, ICraftingResultsSink, org.cyclops.integrateddynamics.api.part.IPartState<P>
Direct Known Subclasses:
PartTypeInterfaceCrafting.State, PartTypeInterfaceCraftingAttuned.State
Enclosing class:
PartTypeInterfaceCraftingBase<P extends PartTypeInterfaceCraftingBase<P,S>,S extends PartTypeInterfaceCraftingBase.State<P,S>>

public abstract static class PartTypeInterfaceCraftingBase.State<P extends PartTypeInterfaceCraftingBase<P,S>,S extends PartTypeInterfaceCraftingBase.State<P,S>> extends org.cyclops.integrateddynamics.core.part.PartStateBase<P> implements ICraftingInterface, ICraftingResultsSink
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    protected net.minecraft.world.entity.player.Player
     
    protected org.cyclops.integrateddynamics.api.network.INetwork
     
    protected org.cyclops.integrateddynamics.api.network.IPartNetwork
     
    protected org.cyclops.integrateddynamics.api.evaluate.variable.ValueDeseralizationContext
     

    Fields inherited from interface org.cyclops.integrateddynamics.api.part.IPartState

    GLOBALCOUNTER_KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T, M> void
    addResult(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> ingredientComponent, T instance)
    Add the given instance.
    void
    cancelCraftingJob(int channel, int craftingJobId)
    Cancel the given crafting job.
    boolean
     
    void
    fillCraftingJobBufferFromStorage(CraftingJob craftingJob, Function<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>,org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage> storageGetter)
    Extract the required ingredients from storage and store them in the job.
    void
    flushInventoryOutputBuffer(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)
     
    int
     
     
     
    int
     
    getCraftingJobStatus(ICraftingNetwork network, int channel, int craftingJobId)
    Get the status for the given crafting job.
     
    protected int
     
    net.minecraft.core.Direction
    getIngredientComponentTargetSideOverride(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?> ingredientComponent)
     
    List<org.cyclops.commoncapabilities.api.ingredient.IngredientInstanceWrapper<?,?>>
     
    List<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.PrioritizedPartPos
     
    org.cyclops.integrateddynamics.api.part.PartTarget
     
    void
    readFromNBT(org.cyclops.integrateddynamics.api.evaluate.variable.ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.CompoundTag tag)
     
    void
    reloadRecipes(boolean initialize)
     
    void
    Add the given crafting job to the list of crafting jobs.
    void
    setChannelCrafting(int channelCrafting)
     
    void
    setIngredientComponentTargetSideOverride(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?> ingredientComponent, net.minecraft.core.Direction side)
     
    void
    setLastPlayer(net.minecraft.world.entity.player.Player lastPlayer)
     
    void
    setNetworks(org.cyclops.integrateddynamics.api.network.INetwork network, ICraftingNetwork craftingNetwork, org.cyclops.integrateddynamics.api.network.IPartNetwork partNetwork, int channel, org.cyclops.integrateddynamics.api.evaluate.variable.ValueDeseralizationContext valueDeseralizationContext, boolean initialize)
     
    void
    setShouldAddToCraftingNetwork(boolean shouldAddToCraftingNetwork)
     
    void
    setTarget(org.cyclops.integrateddynamics.api.part.PartTarget target)
     
    boolean
     
    protected <C, T, M> C
    wrapStorageCapability(net.minecraftforge.common.capabilities.Capability<C> capability, org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> ingredientComponent)
     
    void
    writeToNBT(net.minecraft.nbt.CompoundTag tag)
     

    Methods inherited from class org.cyclops.integrateddynamics.core.part.PartStateBase

    addVolatileCapability, clearInventoriesNamed, forceBlockRenderUpdate, gatherCapabilities, generateId, getAspectProperties, getChannel, getId, getInventoriesNamed, getInventoryNamed, getMaxOffset, getOffsetVariableError, getPriority, getTargetOffset, getTargetSideOverride, getUpdateInterval, initializeOffsets, isDirtyAndReset, isEnabled, isForceBlockRenderUpdateAndReset, isUpdateAndReset, markDirty, markOffsetVariablesChanged, onDirty, readAspectProperties, removeVolatileCapability, requiresOffsetUpdates, sendUpdate, setAspectProperties, setChannel, setEnabled, setInventoryNamed, setMaxOffset, setPriority, setTargetOffset, setTargetSideOverride, setUpdateInterval, updateOffsetVariables, writeAspectProperties

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.cyclops.integratedcrafting.api.crafting.ICraftingInterface

    getRecipes

    Methods inherited from interface org.cyclops.integrateddynamics.api.part.IPartState

    loadInventoryNamed, saveInventoryNamed
  • Field Details

    • network

      protected org.cyclops.integrateddynamics.api.network.INetwork network
    • partNetwork

      protected org.cyclops.integrateddynamics.api.network.IPartNetwork partNetwork
    • craftingNetwork

      protected ICraftingNetwork craftingNetwork
    • valueDeseralizationContext

      protected org.cyclops.integrateddynamics.api.evaluate.variable.ValueDeseralizationContext valueDeseralizationContext
    • lastPlayer

      protected net.minecraft.world.entity.player.Player lastPlayer
  • Constructor Details

    • State

      public State()
  • Method Details

    • writeToNBT

      public void writeToNBT(net.minecraft.nbt.CompoundTag tag)
      Specified by:
      writeToNBT in interface org.cyclops.integrateddynamics.api.part.IPartState<P extends PartTypeInterfaceCraftingBase<P,S>>
      Overrides:
      writeToNBT in class org.cyclops.integrateddynamics.core.part.PartStateBase<P extends PartTypeInterfaceCraftingBase<P,S>>
    • readFromNBT

      public void readFromNBT(org.cyclops.integrateddynamics.api.evaluate.variable.ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.CompoundTag tag)
      Specified by:
      readFromNBT in interface org.cyclops.integrateddynamics.api.part.IPartState<P extends PartTypeInterfaceCraftingBase<P,S>>
      Overrides:
      readFromNBT in class org.cyclops.integrateddynamics.core.part.PartStateBase<P extends PartTypeInterfaceCraftingBase<P,S>>
    • getDefaultUpdateInterval

      protected int getDefaultUpdateInterval()
      Overrides:
      getDefaultUpdateInterval in class org.cyclops.integrateddynamics.core.part.PartStateBase<P extends PartTypeInterfaceCraftingBase<P,S>>
    • setChannelCrafting

      public void setChannelCrafting(int channelCrafting)
    • getChannelCrafting

      public int getChannelCrafting()
    • 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, @Nullable org.cyclops.integrateddynamics.api.evaluate.variable.ValueDeseralizationContext valueDeseralizationContext, boolean initialize)
    • reloadRecipes

      public void reloadRecipes(boolean initialize)
    • setLastPlayer

      public void setLastPlayer(net.minecraft.world.entity.player.Player lastPlayer)
    • getCraftingNetwork

      public ICraftingNetwork getCraftingNetwork()
    • canScheduleCraftingJobs

      public boolean canScheduleCraftingJobs()
      Specified by:
      canScheduleCraftingJobs in interface ICraftingInterface
      Returns:
      If this crafting interface can currently accept crafting jobs.
    • scheduleCraftingJob

      public void scheduleCraftingJob(CraftingJob craftingJob)
      Description copied from interface: ICraftingInterface
      Add the given crafting job to the list of crafting jobs.
      Specified by:
      scheduleCraftingJob in interface ICraftingInterface
      Parameters:
      craftingJob - The crafting job.
    • fillCraftingJobBufferFromStorage

      public void fillCraftingJobBufferFromStorage(CraftingJob craftingJob, Function<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>,org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage> storageGetter)
      Description copied from interface: ICraftingInterface
      Extract the required ingredients from storage and store them in the job.
      Specified by:
      fillCraftingJobBufferFromStorage in interface ICraftingInterface
      Parameters:
      craftingJob - The crafting job.
      storageGetter - The storage getter.
    • getCraftingJobsCount

      public int getCraftingJobsCount()
      Specified by:
      getCraftingJobsCount in interface ICraftingInterface
      Returns:
      Get the number of scheduled and running crafting jobs in this interface.
    • getCraftingJobs

      public Iterator<CraftingJob> getCraftingJobs()
      Specified by:
      getCraftingJobs in interface ICraftingInterface
      Returns:
      Get the scheduled and running crafting jobs in this interface.
    • getPendingCraftingJobOutputs

      public List<Map<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>,List<org.cyclops.commoncapabilities.api.ingredient.IPrototypedIngredient<?,?>>>> getPendingCraftingJobOutputs(int craftingJobId)
      Description copied from interface: ICraftingInterface
      Get the pending outputs for the given crafting job, where the list indicates the different entries running in parallel.
      Specified by:
      getPendingCraftingJobOutputs in interface ICraftingInterface
      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: ICraftingInterface
      Get the status for the given crafting job.
      Specified by:
      getCraftingJobStatus in interface ICraftingInterface
      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: ICraftingInterface
      Cancel the given crafting job. Note: this should not be called directly unless you know what you are doing! Instead, you should call ICraftingNetwork.cancelCraftingJob(int, int).
      Specified by:
      cancelCraftingJob in interface ICraftingInterface
      Parameters:
      channel - The channel.
      craftingJobId - A crafting job id.
    • getPosition

      public org.cyclops.integrateddynamics.api.part.PrioritizedPartPos getPosition()
      Specified by:
      getPosition in interface ICraftingInterface
      Returns:
      The prioritized position of this interface.
    • getCraftingJobHandler

      public CraftingJobHandler 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:
      getCapability in interface org.cyclops.integrateddynamics.api.part.IPartState<P extends PartTypeInterfaceCraftingBase<P,S>>
      Overrides:
      getCapability in class org.cyclops.integrateddynamics.core.part.PartStateBase<P extends PartTypeInterfaceCraftingBase<P,S>>
    • wrapStorageCapability

      protected <C, T, M> C wrapStorageCapability(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: ICraftingResultsSink
      Add the given instance.
      Specified by:
      addResult in interface ICraftingResultsSink
      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)
    • flushInventoryOutputBuffer

      public void flushInventoryOutputBuffer(org.cyclops.integrateddynamics.api.network.INetwork network)