aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me
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
parent0924138bc88c1cfa8a3cee5089dc8792555e70fa (diff)
downloadRoughlyEnoughItems-c9ac8fccef10d968faf9ec60d116694ef511cd14.tar.gz
RoughlyEnoughItems-c9ac8fccef10d968faf9ec60d116694ef511cd14.tar.bz2
RoughlyEnoughItems-c9ac8fccef10d968faf9ec60d116694ef511cd14.zip
v2.3.2
Diffstat (limited to 'src/main/java/me')
-rw-r--r--src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java22
-rw-r--r--src/main/java/me/shedaniel/rei/RoughlyEnoughItemsPlugins.java6
-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
-rw-r--r--src/main/java/me/shedaniel/rei/client/ClientHelper.java10
-rw-r--r--src/main/java/me/shedaniel/rei/client/ItemRegistryImpl.java (renamed from src/main/java/me/shedaniel/rei/client/ItemRegistererImpl.java)4
-rw-r--r--src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java58
-rw-r--r--src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java1
-rw-r--r--src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java39
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java1
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/SpeedCraftingButtonWidget.java6
-rw-r--r--src/main/java/me/shedaniel/rei/mixin/MixinCreativePlayerInventoryScreen.java9
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultBlastingDisplay.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultBrewingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultBrewingDisplay.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultCampfireCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultCampfireDisplay.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultCraftingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultCraftingDisplay.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java10
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultSmeltingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultSmeltingDisplay.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultSmokingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultSmokingDisplay.java5
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultStoneCuttingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultStoneCuttingDisplay.java4
35 files changed, 162 insertions, 164 deletions
diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
index 5c194ab14..5402a3861 100644
--- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
+++ b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
@@ -1,9 +1,9 @@
package me.shedaniel.rei;
import com.google.common.collect.Maps;
-import me.shedaniel.rei.api.ItemRegisterer;
-import me.shedaniel.rei.api.IRecipePlugin;
+import me.shedaniel.rei.api.ItemRegistry;
import me.shedaniel.rei.api.PluginDisabler;
+import me.shedaniel.rei.api.REIPlugin;
import me.shedaniel.rei.api.RecipeHelper;
import me.shedaniel.rei.client.*;
import me.shedaniel.rei.plugin.DefaultPlugin;
@@ -32,10 +32,10 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer, ModInitiali
public static final Logger LOGGER = LogManager.getFormatterLogger("REI");
public static final Identifier DELETE_ITEMS_PACKET = new Identifier("roughlyenoughitems", "delete_item");
public static final Identifier CREATE_ITEMS_PACKET = new Identifier("roughlyenoughitems", "create_item");
- private static final RecipeHelperImpl RECIPE_HELPER = new RecipeHelperImpl();
- private static final PluginDisablerImpl PLUGIN_DISABLER = new PluginDisablerImpl();
- private static final ItemRegistererImpl ITEM_REGISTERER = new ItemRegistererImpl();
- private static final Map<Identifier, IRecipePlugin> plugins = Maps.newHashMap();
+ private static final RecipeHelper RECIPE_HELPER = new RecipeHelperImpl();
+ private static final PluginDisabler PLUGIN_DISABLER = new PluginDisablerImpl();
+ private static final ItemRegistry ITEM_REGISTRY = new ItemRegistryImpl();
+ private static final Map<Identifier, REIPlugin> plugins = Maps.newHashMap();
private static ConfigHelper configHelper;
public static RecipeHelper getRecipeHelper() {
@@ -46,26 +46,26 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer, ModInitiali
return configHelper;
}
- public static ItemRegisterer getItemRegisterer() {
- return ITEM_REGISTERER;
+ public static ItemRegistry getItemRegisterer() {
+ return ITEM_REGISTRY;
}
public static PluginDisabler getPluginDisabler() {
return PLUGIN_DISABLER;
}
- public static IRecipePlugin registerPlugin(Identifier identifier, IRecipePlugin plugin) {
+ public static REIPlugin registerPlugin(Identifier identifier, REIPlugin plugin) {
plugins.put(identifier, plugin);
RoughlyEnoughItemsCore.LOGGER.info("REI: Registered plugin %s from %s", identifier.toString(), plugin.getClass().getSimpleName());
plugin.onFirstLoad(getPluginDisabler());
return plugin;
}
- public static List<IRecipePlugin> getPlugins() {
+ public static List<REIPlugin> getPlugins() {
return new LinkedList<>(plugins.values());
}
- public static Optional<Identifier> getPluginIdentifier(IRecipePlugin plugin) {
+ public static Optional<Identifier> getPluginIdentifier(REIPlugin plugin) {
for(Identifier identifier : plugins.keySet())
if (identifier != null && plugins.get(identifier).equals(plugin))
return Optional.of(identifier);
diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsPlugins.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsPlugins.java
index 0b7bc19c0..0dabfcda9 100644
--- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsPlugins.java
+++ b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsPlugins.java
@@ -3,7 +3,7 @@ package me.shedaniel.rei;
import info.tehnut.pluginloader.LoaderCreator;
import info.tehnut.pluginloader.PluginLoaderBuilder;
import info.tehnut.pluginloader.ValidationStrategy;
-import me.shedaniel.rei.api.IRecipePlugin;
+import me.shedaniel.rei.api.REIPlugin;
import net.fabricmc.loader.language.LanguageAdapter;
import net.fabricmc.loader.language.LanguageAdapterException;
import net.minecraft.util.Identifier;
@@ -14,10 +14,10 @@ public class RoughlyEnoughItemsPlugins implements LoaderCreator {
public void createLoaders() {
LanguageAdapter.Options instantiationOptions = new LanguageAdapter.Options();
- new PluginLoaderBuilder("roughlyenoughitems").withValidator(ValidationStrategy.hasInterface(IRecipePlugin.class)).withInitializer((aClass, container) -> {
+ new PluginLoaderBuilder("roughlyenoughitems").withValidator(ValidationStrategy.hasInterface(REIPlugin.class)).withInitializer((aClass, container) -> {
Identifier id = new Identifier(container.getOwner().getInfo().getId(), container.getInfo().getId());
try {
- IRecipePlugin plugin = (IRecipePlugin) container.getOwner().getAdapter().createInstance(aClass, instantiationOptions);
+ REIPlugin plugin = (REIPlugin) container.getOwner().getAdapter().createInstance(aClass, instantiationOptions);
RoughlyEnoughItemsCore.registerPlugin(id, plugin);
} catch (LanguageAdapterException e) {
RoughlyEnoughItemsCore.LOGGER.error("REI: Error loading plugin %s", id, e);
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);
-
+
}
diff --git a/src/main/java/me/shedaniel/rei/client/ClientHelper.java b/src/main/java/me/shedaniel/rei/client/ClientHelper.java
index d93b32844..277802679 100644
--- a/src/main/java/me/shedaniel/rei/client/ClientHelper.java
+++ b/src/main/java/me/shedaniel/rei/client/ClientHelper.java
@@ -3,8 +3,8 @@ package me.shedaniel.rei.client;
import com.google.common.collect.ImmutableList;
import io.netty.buffer.Unpooled;
import me.shedaniel.rei.RoughlyEnoughItemsCore;
-import me.shedaniel.rei.api.IRecipeCategory;
-import me.shedaniel.rei.api.IRecipeDisplay;
+import me.shedaniel.rei.api.RecipeCategory;
+import me.shedaniel.rei.api.RecipeDisplay;
import me.shedaniel.rei.api.RecipeHelper;
import me.shedaniel.rei.gui.ContainerScreenOverlay;
import me.shedaniel.rei.gui.RecipeViewingScreen;
@@ -111,14 +111,14 @@ public class ClientHelper implements ClientModInitializer {
}
public static boolean executeRecipeKeyBind(ContainerScreenOverlay overlay, ItemStack stack) {
- Map<IRecipeCategory, List<IRecipeDisplay>> map = RecipeHelper.getInstance().getRecipesFor(stack);
+ Map<RecipeCategory, List<RecipeDisplay>> map = RecipeHelper.getInstance().getRecipesFor(stack);
if (map.keySet().size() > 0)
MinecraftClient.getInstance().openScreen(new RecipeViewingScreen(MinecraftClient.getInstance().window, map));
return map.keySet().size() > 0;
}
public static boolean executeUsageKeyBind(ContainerScreenOverlay overlay, ItemStack stack) {
- Map<IRecipeCategory, List<IRecipeDisplay>> map = RecipeHelper.getInstance().getUsagesFor(stack);
+ Map<RecipeCategory, List<RecipeDisplay>> map = RecipeHelper.getInstance().getUsagesFor(stack);
if (map.keySet().size() > 0)
MinecraftClient.getInstance().openScreen(new RecipeViewingScreen(MinecraftClient.getInstance().window, map));
return map.keySet().size() > 0;
@@ -139,7 +139,7 @@ public class ClientHelper implements ClientModInitializer {
}
public static boolean executeViewAllRecipesKeyBind(ContainerScreenOverlay lastOverlay) {
- Map<IRecipeCategory, List<IRecipeDisplay>> map = RecipeHelper.getInstance().getAllRecipes();
+ Map<RecipeCategory, List<RecipeDisplay>> map = RecipeHelper.getInstance().getAllRecipes();
if (map.keySet().size() > 0)
MinecraftClient.getInstance().openScreen(new RecipeViewingScreen(MinecraftClient.getInstance().window, map));
return map.keySet().size() > 0;
diff --git a/src/main/java/me/shedaniel/rei/client/ItemRegistererImpl.java b/src/main/java/me/shedaniel/rei/client/ItemRegistryImpl.java
index 4e1c3ef26..f61c3d063 100644
--- a/src/main/java/me/shedaniel/rei/client/ItemRegistererImpl.java
+++ b/src/main/java/me/shedaniel/rei/client/ItemRegistryImpl.java
@@ -1,7 +1,7 @@
package me.shedaniel.rei.client;
import com.google.common.collect.Lists;
-import me.shedaniel.rei.api.ItemRegisterer;
+import me.shedaniel.rei.api.ItemRegistry;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
@@ -12,7 +12,7 @@ import java.util.List;
import java.util.TreeSet;
import java.util.stream.Collectors;
-public class ItemRegistererImpl implements ItemRegisterer {
+public class ItemRegistryImpl implements ItemRegistry {
private final List<ItemStack> itemList = Lists.newLinkedList();
diff --git a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
index ab0f1a1db..161f32fc9 100644
--- a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
+++ b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
@@ -17,17 +17,17 @@ import java.util.stream.Collectors;
public class RecipeHelperImpl implements RecipeHelper {
private final AtomicInteger recipeCount = new AtomicInteger();
- private final Map<Identifier, List<IRecipeDisplay>> recipeCategoryListMap = Maps.newHashMap();
- private final List<IRecipeCategory> categories = Lists.newArrayList();
- private final Map<Identifier, SpeedCraftAreaSupplier> speedCraftAreaSupplierMap = Maps.newHashMap();
+ private final Map<Identifier, List<RecipeDisplay>> recipeCategoryListMap = Maps.newHashMap();
+ private final List<RecipeCategory> categories = Lists.newArrayList();
+ private final Map<Identifier, ButtonAreaSupplier> speedCraftAreaSupplierMap = Maps.newHashMap();
private final Map<Identifier, List<SpeedCraftFunctional>> speedCraftFunctionalMap = Maps.newHashMap();
private RecipeManager recipeManager;
@Override
public List<ItemStack> findCraftableByItems(List<ItemStack> inventoryItems) {
List<ItemStack> craftables = new ArrayList<>();
- for(List<IRecipeDisplay> value : recipeCategoryListMap.values())
- for(IRecipeDisplay recipeDisplay : value) {
+ for(List<RecipeDisplay> value : recipeCategoryListMap.values())
+ for(RecipeDisplay recipeDisplay : value) {
int slotsCraftable = 0;
List<List<ItemStack>> requiredInput = (List<List<ItemStack>>) recipeDisplay.getRequiredItems();
for(List<ItemStack> slot : requiredInput) {
@@ -54,13 +54,13 @@ public class RecipeHelperImpl implements RecipeHelper {
}
@Override
- public void registerCategory(IRecipeCategory category) {
+ public void registerCategory(RecipeCategory category) {
categories.add(category);
recipeCategoryListMap.put(category.getIdentifier(), Lists.newLinkedList());
}
@Override
- public void registerDisplay(Identifier categoryIdentifier, IRecipeDisplay display) {
+ public void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display) {
if (!recipeCategoryListMap.containsKey(categoryIdentifier))
return;
recipeCount.incrementAndGet();
@@ -68,17 +68,17 @@ public class RecipeHelperImpl implements RecipeHelper {
}
@Override
- public Map<IRecipeCategory, List<IRecipeDisplay>> getRecipesFor(ItemStack stack) {
- Map<Identifier, List<IRecipeDisplay>> categoriesMap = new HashMap<>();
+ public Map<RecipeCategory, List<RecipeDisplay>> getRecipesFor(ItemStack stack) {
+ Map<Identifier, List<RecipeDisplay>> categoriesMap = new HashMap<>();
categories.forEach(f -> categoriesMap.put(f.getIdentifier(), Lists.newArrayList()));
- for(Map.Entry<Identifier, List<IRecipeDisplay>> entry : recipeCategoryListMap.entrySet()) {
- IRecipeCategory category = getCategory(entry.getKey());
- for(IRecipeDisplay recipeDisplay : entry.getValue())
+ for(Map.Entry<Identifier, List<RecipeDisplay>> entry : recipeCategoryListMap.entrySet()) {
+ RecipeCategory category = getCategory(entry.getKey());
+ for(RecipeDisplay recipeDisplay : entry.getValue())
for(ItemStack outputStack : (List<ItemStack>) recipeDisplay.getOutput())
if (category.checkTags() ? ItemStack.areEqual(stack, outputStack) : ItemStack.areEqualIgnoreTags(stack, outputStack))
categoriesMap.get(recipeDisplay.getRecipeCategory()).add(recipeDisplay);
}
- Map<IRecipeCategory, List<IRecipeDisplay>> recipeCategoryListMap = Maps.newLinkedHashMap();
+ Map<RecipeCategory, List<RecipeDisplay>> recipeCategoryListMap = Maps.newLinkedHashMap();
categories.forEach(category -> {
if (categoriesMap.containsKey(category.getIdentifier()) && !categoriesMap.get(category.getIdentifier()).isEmpty())
recipeCategoryListMap.put(category, categoriesMap.get(category.getIdentifier()));
@@ -86,7 +86,7 @@ public class RecipeHelperImpl implements RecipeHelper {
return recipeCategoryListMap;
}
- private IRecipeCategory getCategory(Identifier identifier) {
+ private RecipeCategory getCategory(Identifier identifier) {
return categories.stream().filter(category -> category.getIdentifier().equals(identifier)).findFirst().orElse(null);
}
@@ -96,12 +96,12 @@ public class RecipeHelperImpl implements RecipeHelper {
}
@Override
- public Map<IRecipeCategory, List<IRecipeDisplay>> getUsagesFor(ItemStack stack) {
- Map<Identifier, List<IRecipeDisplay>> categoriesMap = new HashMap<>();
+ public Map<RecipeCategory, List<RecipeDisplay>> getUsagesFor(ItemStack stack) {
+ Map<Identifier, List<RecipeDisplay>> categoriesMap = new HashMap<>();