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
    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
    flushInventoryOutputBuffer(org.cyclops.integrateddynamics.api.network.INetwork network)
     
    protected <T, M> void
    forceObservationOnInsertable(org.cyclops.commoncapabilities.api.ingredient.IngredientInstanceWrapper<T,M> oldWrapper)
    Iterate over all positions that *could* accept the given instance, and force an observation over them.
    <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
     
     
     
    int
     
    getCraftingJobStatus(ICraftingNetwork network, int channel, int craftingJobId)
    Get the status for the given crafting job.
     
    protected int
     
    it.unimi.dsi.fastutil.ints.IntSet
     
    net.minecraft.core.Direction
    getIngredientComponentTargetSideOverride(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?> ingredientComponent)
     
    List<org.cyclops.commoncapabilities.api.ingredient.IngredientInstanceWrapper<?,?>>
     
    org.cyclops.cyclopscore.inventory.SimpleInventory
     
    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
     
    Collection<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>
     
    it.unimi.dsi.fastutil.ints.Int2ObjectMap<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition>
     
    net.minecraft.network.chat.MutableComponent
     
    org.cyclops.integrateddynamics.api.part.PartTarget
     
    boolean
     
    boolean
     
    void
     
    void
    readFromNBT(net.minecraft.nbt.CompoundTag tag)
     
    protected void
    reloadRecipe(int slot)
     
    void
     
    void
    Add the given crafting job to the list of crafting jobs.
    void
    setChannelCrafting(int channelCrafting)
     
    void
    setDisableCraftingCheck(boolean disableCraftingCheck)
     
    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)
     
    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, getId, getInventoriesNamed, getInventoryNamed, getMaxOffset, getOffsetVariableError, getPriority, getTargetOffset, getTargetSideOverride, getUpdateInterval, isDirtyAndReset, isEnabled, isForceBlockRenderUpdateAndReset, isUpdateAndReset, markDirty, markOffsetVariablesChanged, readAspectProperties, removeVolatileCapability, 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.integrateddynamics.api.part.IPartState

    loadInventoryNamed, saveInventoryNamed
  • Constructor Details

    • State

      public State()
  • Method Details

    • getDefaultUpdateInterval

      protected int getDefaultUpdateInterval()
      Overrides:
      getDefaultUpdateInterval in class org.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:
      writeToNBT in interface org.cyclops.integrateddynamics.api.part.IPartState<PartTypeInterfaceCrafting>
      Overrides:
      writeToNBT in class org.cyclops.integrateddynamics.core.part.PartStateBase<PartTypeInterfaceCrafting>
    • readFromNBT

      public void readFromNBT(net.minecraft.nbt.CompoundTag tag)
      Specified by:
      readFromNBT in interface org.cyclops.integrateddynamics.api.part.IPartState<PartTypeInterfaceCrafting>
      Overrides:
      readFromNBT in class org.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:
      onDirty in interface org.cyclops.cyclopscore.persist.IDirtyMarkListener
      Overrides:
      onDirty in class org.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

      public ICraftingNetwork getCraftingNetwork()
    • getChannel

      public int getChannel()
      Specified by:
      getChannel in interface org.cyclops.integrateddynamics.api.part.IPartState<PartTypeInterfaceCrafting>
      Overrides:
      getChannel in class org.cyclops.integrateddynamics.core.part.PartStateBase<PartTypeInterfaceCrafting>
    • getRecipes

      public Collection<org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition> getRecipes()
      Specified by:
      getRecipes in interface ICraftingInterface
      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:
      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.
    • 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<PartTypeInterfaceCrafting>
      Overrides:
      getCapability in class org.cyclops.integrateddynamics.core.part.PartStateBase<PartTypeInterfaceCrafting>
    • 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)
    • 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)
    • forceObservationOnInsertable

      protected <T, M> void forceObservationOnInsertable(org.cyclops.commoncapabilities.api.ingredient.IngredientInstanceWrapper<T,M> oldWrapper)
      Iterate over all positions that *could* accept the given instance, and force an observation over them. This is necessary to ensure that we have the latest state indexed right before insertion. This allows us to force another observation right after the insertion, which will guarantee that we will track the expected diff events as result.
      Type Parameters:
      T - Ingredient type.
      M - Match flags.
      Parameters:
      oldWrapper - The ingredient to attempt to insert (simulated).