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
  • 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).