aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/api/RecipeHelper.java
diff options
context:
space:
mode:
authorDaniel She <shekwancheung0528@gmail.com>2019-06-06 20:14:42 +0800
committerDaniel She <shekwancheung0528@gmail.com>2019-06-06 20:14:42 +0800
commitfab214806ccc3ffbfd03e4034af6cee906124b7a (patch)
treed5c1a2e108b81d3a57988d4f03ed515c991e75e4 /src/main/java/me/shedaniel/rei/api/RecipeHelper.java
parentd414c887e0c42325cf2e7c778b32e3fb13ee2e69 (diff)
parent558504bd65af2138d73825f1ffa8066a5d70e8f5 (diff)
downloadRoughlyEnoughItems-fab214806ccc3ffbfd03e4034af6cee906124b7a.tar.gz
RoughlyEnoughItems-fab214806ccc3ffbfd03e4034af6cee906124b7a.tar.bz2
RoughlyEnoughItems-fab214806ccc3ffbfd03e4034af6cee906124b7a.zip
Merge branch 'fabric-dev' into 1.14
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/RecipeHelper.java')
-rw-r--r--src/main/java/me/shedaniel/rei/api/RecipeHelper.java42
1 files changed, 40 insertions, 2 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java
index a57b7146f..cfbda23f0 100644
--- a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java
+++ b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java
@@ -14,6 +14,7 @@ import net.minecraft.util.Identifier;
import java.util.List;
import java.util.Map;
import java.util.Optional;
+import java.util.function.Function;
public interface RecipeHelper {
@@ -52,6 +53,24 @@ public interface RecipeHelper {
void registerCategory(RecipeCategory category);
/**
+ * Registers the working stations of a category
+ *
+ * @param category the category
+ * @param workingStations the working stations
+ */
+ void registerWorkingStations(Identifier category, List<ItemStack>... workingStations);
+
+ /**
+ * Registers the working stations of a category
+ *
+ * @param category the category
+ * @param workingStations the working stations
+ */
+ void registerWorkingStations(Identifier category, ItemStack... workingStations);
+
+ List<List<ItemStack>> getWorkingStations(Identifier category);
+
+ /**
* Registers a recipe display
*
* @param categoryIdentifier the category to display in
@@ -106,10 +125,10 @@ public interface RecipeHelper {
void registerSpeedCraftButtonArea(Identifier category, ButtonAreaSupplier rectangle);
/**
- * Registers a default speed crafting button area, which is bottom right
- *
* @param category the category of the button area
+ * @deprecated Not required anymore
*/
+ @Deprecated
void registerDefaultSpeedCraftButtonArea(Identifier category);
/**
@@ -162,10 +181,20 @@ public interface RecipeHelper {
* @param display the display to be checked
* @param respectConfig whether it should respect the user's config
* @return whether the display should be visible
+ * @deprecated {@link RecipeHelper#isDisplayVisible(RecipeDisplay)} )}
*/
+ @Deprecated
boolean isDisplayVisible(RecipeDisplay display, boolean respectConfig);
/**
+ * Checks if the display is visible by asking recipe visibility handlers
+ *
+ * @param display the display to be checked
+ * @return whether the display should be visible
+ */
+ boolean isDisplayVisible(RecipeDisplay display);
+
+ /**
* Gets the cached category setting by the category identifier
*
* @param category the identifier of the category
@@ -173,6 +202,15 @@ public interface RecipeHelper {
*/
Optional<DisplaySettings> getCachedCategorySettings(Identifier category);
+ /**
+ * Registers a live recipe generator.
+ *
+ * @param liveRecipeGenerator the generator to register
+ * @apiNote Still work in progress
+ */
void registerLiveRecipeGenerator(LiveRecipeGenerator liveRecipeGenerator);
+ <T extends Recipe<?>> void registerRecipes(Identifier category, Class<T> recipeClass, Function<T, RecipeDisplay> mappingFunction);
+
+ <T extends Recipe<?>> void registerRecipes(Identifier category, Function<Recipe, Boolean> recipeFilter, Function<T, RecipeDisplay> mappingFunction);
}