-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compacted crafting plan viewing mode
This groups all missing and available ingredients per type, which is more convenient to view at a glance what the problems are for large and nested crafting jobs. This is shown by default over the old tree-based view, but can be toggled in-game. This default can be changed using the `terminalStorageDefaultToCraftingPlanTree` config option. The tree-based view will be unavailable for very large crafting jobs as it causes packets to become too large. The threshold for this can be modified using the `terminalStorageMaxTreePlanSize` config option. Closes #14 Closes CyclopsMC/IntegratedDynamics#1341
- Loading branch information
1 parent
1c2ec7c
commit d5c531b
Showing
19 changed files
with
1,216 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
...g/cyclops/integratedterminals/api/terminalstorage/crafting/ITerminalCraftingPlanFlat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package org.cyclops.integratedterminals.api.terminalstorage.crafting; | ||
|
||
import org.cyclops.commoncapabilities.api.ingredient.IPrototypedIngredient; | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.List; | ||
|
||
/** | ||
* A job for crafting a given instance. | ||
* This is a flattened representation of {@link ITerminalCraftingPlan}. | ||
* | ||
* It is possible that a job requires no actual crafting, | ||
* but can be fetched from storage completely. | ||
* | ||
* @param <I> The type of identifier. | ||
* @author rubensworks | ||
*/ | ||
public interface ITerminalCraftingPlanFlat<I> { | ||
|
||
/** | ||
* @return The unique id of this plan. | ||
*/ | ||
public I getId(); | ||
|
||
/** | ||
* @return The flattened entries that are crafted as part of this plan. | ||
*/ | ||
public List<? extends IEntry> getEntries(); | ||
|
||
/** | ||
* @return The final output instances of this job. | ||
*/ | ||
public List<IPrototypedIngredient<?, ?>> getOutputs(); | ||
|
||
/** | ||
* @return The job status. | ||
*/ | ||
public TerminalCraftingJobStatus getStatus(); | ||
|
||
/** | ||
* @return A visual label for this plan, such as an error or plan type. | ||
*/ | ||
public String getUnlocalizedLabel(); | ||
|
||
/** | ||
* @return The tick duration for this job. -1 indicates no duration. | ||
*/ | ||
public long getTickDuration(); | ||
|
||
/** | ||
* @return The channel id, or -1 for non-applicable. | ||
*/ | ||
public int getChannel(); | ||
|
||
/** | ||
* @return The initiator name of the crafting job. | ||
*/ | ||
@Nullable | ||
public String getInitiatorName(); | ||
|
||
/** | ||
* Mark this plan as errored. | ||
* @param unlocalizedError An unlocalized error message. | ||
*/ | ||
public void setError(String unlocalizedError); | ||
|
||
public static interface IEntry { | ||
|
||
/** | ||
* @return The entry instance. | ||
*/ | ||
public IPrototypedIngredient<?, ?> getInstance(); | ||
|
||
/** | ||
* @return The number of instances to craft. | ||
*/ | ||
public long getQuantityToCraft(); | ||
|
||
/** | ||
* @return The number of instances to craft. | ||
*/ | ||
public long getQuantityCrafting(); | ||
|
||
/** | ||
* @return The number of instances in storage. | ||
*/ | ||
public long getQuantityInStorage(); | ||
|
||
/** | ||
* @return The number of instances missing from storage. | ||
*/ | ||
public long getQuantityMissing(); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.