aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/api
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-03-05 22:32:29 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-03-05 22:32:29 +0800
commitc9ac8fccef10d968faf9ec60d116694ef511cd14 (patch)
tree68c7029a5dc73f0290772bd0220982f8f975d679 /src/main/java/me/shedaniel/rei/api
parent0924138bc88c1cfa8a3cee5089dc8792555e70fa (diff)
downloadRoughlyEnoughItems-c9ac8fccef10d968faf9ec60d116694ef511cd14.tar.gz
RoughlyEnoughItems-c9ac8fccef10d968faf9ec60d116694ef511cd14.tar.bz2
RoughlyEnoughItems-c9ac8fccef10d968faf9ec60d116694ef511cd14.zip
v2.3.2
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api')
-rw-r--r--src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java (renamed from src/main/java/me/shedaniel/rei/api/SpeedCraftAreaSupplier.java)2
-rw-r--r--src/main/java/me/shedaniel/rei/api/DisplaySettings.java15
-rw-r--r--src/main/java/me/shedaniel/rei/api/IDisplaySettings.java11
-rw-r--r--src/main/java/me/shedaniel/rei/api/IRecipeCategoryCraftable.java18
-rw-r--r--src/main/java/me/shedaniel/rei/api/ItemRegistry.java (renamed from src/main/java/me/shedaniel/rei/api/ItemRegisterer.java)2
-rw-r--r--src/main/java/me/shedaniel/rei/api/REIPlugin.java (renamed from src/main/java/me/shedaniel/rei/api/IRecipePlugin.java)4
-rw-r--r--src/main/java/me/shedaniel/rei/api/RecipeCategory.java (renamed from src/main/java/me/shedaniel/rei/api/IRecipeCategory.java)13
-rw-r--r--src/main/java/me/shedaniel/rei/api/RecipeDisplay.java (renamed from src/main/java/me/shedaniel/rei/api/IRecipeDisplay.java)12
-rw-r--r--src/main/java/me/shedaniel/rei/api/RecipeHelper.java18
-rw-r--r--src/main/java/me/shedaniel/rei/api/SpeedCraftFunctional.java8
10 files changed, 44 insertions, 59 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/SpeedCraftAreaSupplier.java b/src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java
index 685e17f77..07125643c 100644
--- a/src/main/java/me/shedaniel/rei/api/SpeedCraftAreaSupplier.java
+++ b/src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java
@@ -2,7 +2,7 @@ package me.shedaniel.rei.api;
import java.awt.*;
-public interface SpeedCraftAreaSupplier {
+public interface ButtonAreaSupplier {
Rectangle get(Rectangle bounds);
diff --git a/src/main/java/me/shedaniel/rei/api/DisplaySettings.java b/src/main/java/me/shedaniel/rei/api/DisplaySettings.java
new file mode 100644
index 000000000..334d6cc6f
--- /dev/null
+++ b/src/main/java/me/shedaniel/rei/api/DisplaySettings.java
@@ -0,0 +1,15 @@
+package me.shedaniel.rei.api;
+
+public interface DisplaySettings<T extends RecipeDisplay> {
+
+ int getDisplayHeight(RecipeCategory category);
+
+ int getDisplayWidth(RecipeCategory category, T display);
+
+ int getMaximumRecipePerPage(RecipeCategory category);
+
+ default int getFixedRecipesPerPage() {
+ return -1;
+ }
+
+}
diff --git a/src/main/java/me/shedaniel/rei/api/IDisplaySettings.java b/src/main/java/me/shedaniel/rei/api/IDisplaySettings.java
deleted file mode 100644
index baf5aed79..000000000
--- a/src/main/java/me/shedaniel/rei/api/IDisplaySettings.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package me.shedaniel.rei.api;
-
-public interface IDisplaySettings<T extends IRecipeDisplay> {
-
- int getDisplayHeight(IRecipeCategory category);
-
- int getDisplayWidth(IRecipeCategory category, T display);
-
- int getMaximumRecipePerPage(IRecipeCategory category);
-
-}
diff --git a/src/main/java/me/shedaniel/rei/api/IRecipeCategoryCraftable.java b/src/main/java/me/shedaniel/rei/api/IRecipeCategoryCraftable.java
deleted file mode 100644
index 696f5b229..000000000
--- a/src/main/java/me/shedaniel/rei/api/IRecipeCategoryCraftable.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package me.shedaniel.rei.api;
-
-import me.shedaniel.rei.gui.widget.IWidget;
-import me.shedaniel.rei.listeners.IMixinContainerScreen;
-import net.minecraft.client.gui.Screen;
-
-import java.awt.*;
-import java.util.List;
-
-public interface IRecipeCategoryCraftable<T extends IRecipeDisplay> {
-
- boolean canAutoCraftHere(Class<? extends Screen> screenClasses, T recipe);
-
- boolean performAutoCraft(Screen gui, T recipe);
-
- void registerAutoCraftButton(List<IWidget> widgets, Rectangle rectangle, IMixinContainerScreen parentScreen, T recipe);
-
-}
diff --git a/src/main/java/me/shedaniel/rei/api/ItemRegisterer.java b/src/main/java/me/shedaniel/rei/api/ItemRegistry.java
index 6e22e2097..690ca74da 100644
--- a/src/main/java/me/shedaniel/rei/api/ItemRegisterer.java
+++ b/src/main/java/me/shedaniel/rei/api/ItemRegistry.java
@@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack;
import java.util.List;
-public interface ItemRegisterer {
+public interface ItemRegistry {
List<ItemStack> getItemList();
diff --git a/src/main/java/me/shedaniel/rei/api/IRecipePlugin.java b/src/main/java/me/shedaniel/rei/api/REIPlugin.java
index 2f351ea94..8dba79269 100644
--- a/src/main/java/me/shedaniel/rei/api/IRecipePlugin.java
+++ b/src/main/java/me/shedaniel/rei/api/REIPlugin.java
@@ -1,10 +1,10 @@
package me.shedaniel.rei.api;
-public interface IRecipePlugin {
+public interface REIPlugin {
default void onFirstLoad(PluginDisabler pluginDisabler) {}
- void registerItems(ItemRegisterer itemRegisterer);
+ void registerItems(ItemRegistry itemRegistry);
void registerPluginCategories(RecipeHelper recipeHelper);
diff --git a/src/main/java/me/shedaniel/rei/api/IRecipeCategory.java b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java
index ad7605ac6..79a9a0b7d 100644
--- a/src/main/java/me/shedaniel/rei/api/IRecipeCategory.java
+++ b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java
@@ -8,13 +8,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
import java.awt.*;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.function.Supplier;
-public interface IRecipeCategory<T extends IRecipeDisplay> {
+public interface RecipeCategory<T extends RecipeDisplay> {
Identifier getIdentifier();
@@ -32,20 +31,20 @@ public interface IRecipeCategory<T extends IRecipeDisplay> {
DrawableHelper.drawRect(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, RecipeViewingScreen.SUB_COLOR.getRGB());
}
- default IDisplaySettings getDisplaySettings() {
- return new IDisplaySettings<T>() {
+ default DisplaySettings getDisplaySettings() {
+ return new DisplaySettings<T>() {
@Override
- public int getDisplayHeight(IRecipeCategory category) {
+ public int getDisplayHeight(RecipeCategory category) {
return 66;
}
@Override
- public int getDisplayWidth(IRecipeCategory category, T display) {
+ public int getDisplayWidth(RecipeCategory category, T display) {
return 150;
}
@Override
- public int getMaximumRecipePerPage(IRecipeCategory category) {
+ public int getMaximumRecipePerPage(RecipeCategory category) {
return 99;
}
};
diff --git a/src/main/java/me/shedaniel/rei/api/IRecipeDisplay.java b/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java
index df68c8486..109562aa2 100644
--- a/src/main/java/me/shedaniel/rei/api/IRecipeDisplay.java
+++ b/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java
@@ -8,18 +8,18 @@ import net.minecraft.util.Identifier;
import java.util.List;
import java.util.Optional;
-public interface IRecipeDisplay<T extends Recipe> {
+public interface RecipeDisplay<T extends Recipe> {
Optional<T> getRecipe();
-
+
List<List<ItemStack>> getInput();
-
+
List<ItemStack> getOutput();
-
+
default List<List<ItemStack>> getRequiredItems() {
return Lists.newArrayList();
}
-
+
Identifier getRecipeCategory();
-
+
}
diff --git a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java
index 3cb0e783f..ac77c241f 100644
--- a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java
+++ b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java
@@ -19,26 +19,26 @@ public interface RecipeHelper {
List<ItemStack> findCraftableByItems(List<ItemStack> inventoryItems);
- void registerCategory(IRecipeCategory category);
+ void registerCategory(RecipeCategory category);
- void registerDisplay(Identifier categoryIdentifier, IRecipeDisplay display);
+ void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display);
- Map<IRecipeCategory, List<IRecipeDisplay>> getRecipesFor(ItemStack stack);
+ Map<RecipeCategory, List<RecipeDisplay>> getRecipesFor(ItemStack stack);
RecipeManager getRecipeManager();
- List<IRecipeCategory> getAllCategories();
+ List<RecipeCategory> getAllCategories();
- Map<IRecipeCategory, List<IRecipeDisplay>> getUsagesFor(ItemStack stack);
+ Map<RecipeCategory, List<RecipeDisplay>> getUsagesFor(ItemStack stack);
- Optional<SpeedCraftAreaSupplier> getSpeedCraftButtonArea(IRecipeCategory category);
+ Optional<ButtonAreaSupplier> getSpeedCraftButtonArea(RecipeCategory category);
- void registerSpeedCraftButtonArea(Identifier category, SpeedCraftAreaSupplier rectangle);
+ void registerSpeedCraftButtonArea(Identifier category, ButtonAreaSupplier rectangle);
- List<SpeedCraftFunctional> getSpeedCraftFunctional(IRecipeCategory category);
+ List<SpeedCraftFunctional> getSpeedCraftFunctional(RecipeCategory category);
void registerSpeedCraftFunctional(Identifier category, SpeedCraftFunctional functional);
- Map<IRecipeCategory, List<IRecipeDisplay>> getAllRecipes();
+ Map<RecipeCategory, List<RecipeDisplay>> getAllRecipes();
}
diff --git a/src/main/java/me/shedaniel/rei/api/SpeedCraftFunctional.java b/src/main/java/me/shedaniel/rei/api/SpeedCraftFunctional.java
index cec5a9f90..fc4ffde35 100644
--- a/src/main/java/me/shedaniel/rei/api/SpeedCraftFunctional.java
+++ b/src/main/java/me/shedaniel/rei/api/SpeedCraftFunctional.java
@@ -2,12 +2,12 @@ package me.shedaniel.rei.api;
import net.minecraft.client.gui.Screen;
-public interface SpeedCraftFunctional<T extends IRecipeDisplay> {
+public interface SpeedCraftFunctional<T extends RecipeDisplay> {
Class[] getFunctioningFor();
-
+
boolean performAutoCraft(Screen screen, T recipe);
-
+
boolean acceptRecipe(Screen screen, T recipe);
-
+
}