From ba446965dad004cb38679f0f0e1a526151d84213 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Wed, 29 Jul 2020 12:25:47 +0800 Subject: 5.x - 20w30a Signed-off-by: shedaniel --- .../java/me/shedaniel/rei/api/RecipeHelper.java | 274 --------------------- 1 file changed, 274 deletions(-) delete mode 100644 src/main/java/me/shedaniel/rei/api/RecipeHelper.java (limited to 'src/main/java/me/shedaniel/rei/api/RecipeHelper.java') diff --git a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java deleted file mode 100644 index 70682dad8..000000000 --- a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * This file is licensed under the MIT License, part of Roughly Enough Items. - * Copyright (c) 2018, 2019, 2020 shedaniel - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package me.shedaniel.rei.api; - -import me.shedaniel.math.Rectangle; -import me.shedaniel.rei.RoughlyEnoughItemsCore; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.screen.ingame.ContainerScreen; -import net.minecraft.recipe.Recipe; -import net.minecraft.recipe.RecipeManager; -import net.minecraft.util.Identifier; -import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.function.Function; -import java.util.function.Predicate; - -@Environment(EnvType.CLIENT) -public interface RecipeHelper { - - /** - * @return the api instance of {@link me.shedaniel.rei.impl.RecipeHelperImpl} - */ - @NotNull - static RecipeHelper getInstance() { - return RoughlyEnoughItemsCore.getRecipeHelper(); - } - - AutoTransferHandler registerAutoCraftingHandler(AutoTransferHandler handler); - - void registerFocusedStackProvider(FocusedStackProvider provider); - - @Nullable - @ApiStatus.Internal - EntryStack getScreenFocusedStack(Screen screen); - - List getSortedAutoCraftingHandler(); - - /** - * Gets the total recipe count registered - * - * @return the recipe count - */ - int getRecipeCount(); - - /** - * @return a list of sorted recipes - */ - List getAllSortedRecipes(); - - /** - * Gets all craftable items from materials. - * - * @param inventoryItems the materials - * @return the list of craftable entries - */ - List findCraftableEntriesByItems(List inventoryItems); - - /** - * Registers a category - * - * @param category the category to register - */ - void registerCategory(RecipeCategory category); - - default void registerCategories(Iterable> categories) { - for (RecipeCategory category : categories) { - registerCategory(category); - } - } - - default void registerCategories(RecipeCategory... categories) { - for (RecipeCategory category : categories) { - registerCategory(category); - } - } - - /** - * Registers the working stations of a category - * - * @param category the category - * @param workingStations the working stations - */ - void registerWorkingStations(Identifier category, List... workingStations); - - /** - * Registers the working stations of a category - * - * @param category the category - * @param workingStations the working stations - */ - void registerWorkingStations(Identifier category, EntryStack... workingStations); - - List> getWorkingStations(Identifier category); - - /** - * Registers a recipe display. - * - * @param display the recipe display - */ - void registerDisplay(RecipeDisplay display); - - /** - * Registers a recipe display. - * - * @param categoryIdentifier the category to display in - * @param display the recipe display - * @deprecated Use {@link RecipeHelper#registerDisplay(RecipeDisplay)} - */ - @ApiStatus.ScheduledForRemoval - @Deprecated - default void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display) { - registerDisplay(display); - } - - Map, List> buildMapFor(ClientHelper.ViewSearchBuilder builder); - - /** - * Gets a map of recipes for an entry - * - * @param stack the stack to be crafted - * @return the map of recipes - */ - Map, List> getRecipesFor(EntryStack stack); - - RecipeCategory getCategory(Identifier identifier); - - /** - * Gets the vanilla recipe manager - * - * @return the recipe manager - */ - RecipeManager getRecipeManager(); - - /** - * Gets all registered categories - * - * @return the list of categories - */ - List> getAllCategories(); - - /** - * Gets a map of usages for an entry - * - * @param stack the stack to be used - * @return the map of recipes - */ - Map, List> getUsagesFor(EntryStack stack); - - /** - * Gets the optional of the auto crafting button area from a category - * - * @param category the category of the display - * @return the optional of auto crafting button area - */ - Optional getAutoCraftButtonArea(RecipeCategory category); - - /** - * Registers a auto crafting button area - * - * @param category the category of the button area - * @param rectangle the button area - */ - void registerAutoCraftButtonArea(Identifier category, ButtonAreaSupplier rectangle); - - /** - * Removes the auto crafting button - * - * @param category the category of the button - */ - default void removeAutoCraftButton(Identifier category) { - registerAutoCraftButtonArea(category, bounds -> null); - } - - /** - * Gets the map of all recipes visible to the player - * - * @return the map of recipes - */ - Map, List> getAllRecipes(); - - Map, List> getAllRecipesNoHandlers(); - - List getAllRecipesFromCategory(RecipeCategory category); - - /** - * Registers a recipe visibility handler - * - * @param visibilityHandler the handler to be registered - */ - void registerRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler); - - /** - * Unregisters a recipe visibility handler - * - * @param visibilityHandler the handler to be unregistered - */ - void unregisterRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler); - - /** - * Gets an unmodifiable list of recipe visibility handlers - * - * @return the unmodifiable list of handlers - */ - List getDisplayVisibilityHandlers(); - - boolean isDisplayNotVisible(RecipeDisplay display); - - /** - * 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); - - > void registerRecipes(Identifier category, Predicate recipeFilter, Function mappingFunction); - - /** - * Registers a live recipe generator. - * - * @param liveRecipeGenerator the generator to register - * @apiNote Still work in progress - */ - void registerLiveRecipeGenerator(LiveRecipeGenerator liveRecipeGenerator); - - void registerScreenClickArea(Rectangle rectangle, Class> screenClass, Identifier... categories); - - > void registerRecipes(Identifier category, Class recipeClass, Function mappingFunction); - - > void registerRecipes(Identifier category, Function recipeFilter, Function mappingFunction); - - List getScreenClickAreas(); - - @ApiStatus.Internal - boolean arePluginsLoading(); - - interface ScreenClickArea { - Class getScreenClass(); - - Rectangle getRectangle(); - - Identifier[] getCategories(); - } - -} - -- cgit