aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/api
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-06-07 12:09:48 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-06-07 12:09:48 +0800
commit6fdbd7b5581a1536e644517987c3ba5e631f5c1d (patch)
tree71d5b6ec17e88c5a7bafb5b529d4864b7a2be452 /src/main/java/me/shedaniel/rei/api
parent1f5ab59c04dd04918131c3d3942057e1969277c5 (diff)
downloadRoughlyEnoughItems-6fdbd7b5581a1536e644517987c3ba5e631f5c1d.tar.gz
RoughlyEnoughItems-6fdbd7b5581a1536e644517987c3ba5e631f5c1d.tar.bz2
RoughlyEnoughItems-6fdbd7b5581a1536e644517987c3ba5e631f5c1d.zip
2.9.4
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api')
-rw-r--r--src/main/java/me/shedaniel/rei/api/RecipeCategory.java6
-rw-r--r--src/main/java/me/shedaniel/rei/api/RecipeDisplay.java1
-rw-r--r--src/main/java/me/shedaniel/rei/api/RecipeHelper.java3
3 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java
index 9db9a349f..0f39b7205 100644
--- a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java
+++ b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java
@@ -5,7 +5,7 @@
package me.shedaniel.rei.api;
-import me.shedaniel.rei.RoughlyEnoughItemsCore;
+import me.shedaniel.rei.client.ScreenHelper;
import me.shedaniel.rei.gui.RecipeViewingScreen;
import me.shedaniel.rei.gui.renderables.RecipeRenderer;
import me.shedaniel.rei.gui.widget.CategoryBaseWidget;
@@ -46,6 +46,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
*
* @return the renderer of the icon
*/
+ @SuppressWarnings("deprecation")
default Renderer getIcon() {
return Renderable.fromItemStackSupplier(this::getCategoryIcon);
}
@@ -63,6 +64,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
* @param recipe the recipe to render
* @return the recipe renderer
*/
+ @SuppressWarnings("unchecked")
default RecipeRenderer getSimpleRenderer(T recipe) {
return Renderable.fromRecipe(recipe::getInput, recipe::getOutput);
}
@@ -88,7 +90,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
*/
default void drawCategoryBackground(Rectangle bounds, int mouseX, int mouseY, float delta) {
new CategoryBaseWidget(bounds).render();
- if (RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme) {
+ if (ScreenHelper.isDarkModeEnabled()) {
DrawableHelper.fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, 0xFF404040);
DrawableHelper.fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, 0xFF404040);
} else {
diff --git a/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java b/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java
index cd8ab6efb..d77e2c9ab 100644
--- a/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java
+++ b/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java
@@ -35,7 +35,6 @@ public interface RecipeDisplay<T extends Recipe> {
*
* @return the list of required items
*/
- @Deprecated
default List<List<ItemStack>> getRequiredItems() {
return Lists.newArrayList();
}
diff --git a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java
index cfbda23f0..ca0202d1f 100644
--- a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java
+++ b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java
@@ -15,6 +15,7 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
+import java.util.function.Predicate;
public interface RecipeHelper {
@@ -194,6 +195,8 @@ public interface RecipeHelper {
*/
boolean isDisplayVisible(RecipeDisplay display);
+ <T extends Recipe<?>> void registerRecipes(Identifier category, Predicate<Recipe> recipeFilter, Function<T, RecipeDisplay> mappingFunction);
+
/**
* Gets the cached category setting by the category identifier
*