diff options
Diffstat (limited to 'src')
66 files changed, 101 insertions, 362 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java b/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java index 63f1d08a1..e494aae65 100644 --- a/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java +++ b/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java @@ -25,8 +25,6 @@ package me.shedaniel.rei.api; import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; -import me.shedaniel.rei.gui.ContainerScreenOverlay; -import me.shedaniel.rei.impl.ScreenHelper; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.screen.ScreenHandler; @@ -94,34 +92,10 @@ public interface AutoTransferHandler { HandledScreen<?> getHandledScreen(); - @Deprecated - @ApiStatus.ScheduledForRemoval - default HandledScreen<?> getScreenWithHandler() { - return getHandledScreen(); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval - default HandledScreen<?> getContainerScreen() { - return getHandledScreen(); - } - RecipeDisplay getRecipe(); - @Deprecated - @ApiStatus.ScheduledForRemoval - default ScreenHandler getContainer() { - return getScreenHandler(); - } - default ScreenHandler getScreenHandler() { - return getScreenWithHandler().getScreenHandler(); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval - default ContainerScreenOverlay getOverlay() { - return ScreenHelper.getLastOverlay(); + return getHandledScreen().getScreenHandler(); } } diff --git a/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java b/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java index e44e7dd9e..7ba78120b 100644 --- a/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java +++ b/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java @@ -23,7 +23,8 @@ package me.shedaniel.rei.api; -import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.Rectangle; +import me.shedaniel.rei.impl.DisplayHelperImpl; import net.minecraft.client.gui.screen.Screen; import java.util.List; @@ -31,9 +32,8 @@ import java.util.function.Supplier; public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Screen> { - @SuppressWarnings("deprecation") static BaseBoundsHandler getInstance() { - return DisplayHelper.getInstance().getBaseBoundsHandler(); + return ((DisplayHelperImpl) DisplayHelper.getInstance()).getBaseBoundsHandler(); } /** diff --git a/src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java b/src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java index 33488af45..df6214642 100644 --- a/src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java +++ b/src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java @@ -23,7 +23,7 @@ package me.shedaniel.rei.api; -import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.Rectangle; /** * The supplier for the + button area. diff --git a/src/main/java/me/shedaniel/rei/api/ConfigManager.java b/src/main/java/me/shedaniel/rei/api/ConfigManager.java index e171ffc3c..b3da456da 100644 --- a/src/main/java/me/shedaniel/rei/api/ConfigManager.java +++ b/src/main/java/me/shedaniel/rei/api/ConfigManager.java @@ -26,9 +26,6 @@ package me.shedaniel.rei.api; import me.shedaniel.rei.RoughlyEnoughItemsCore; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.Screen; -import org.jetbrains.annotations.ApiStatus; - -import java.util.List; public interface ConfigManager { @@ -40,16 +37,6 @@ public interface ConfigManager { } /** - * @return the list of favourites - * @deprecated {@link ConfigObject#getFavorites()} - */ - @ApiStatus.ScheduledForRemoval - @Deprecated - default List<EntryStack> getFavorites() { - return ConfigObject.getInstance().getFavorites(); - } - - /** * Saves the config. */ void saveConfig(); diff --git a/src/main/java/me/shedaniel/rei/api/ConfigObject.java b/src/main/java/me/shedaniel/rei/api/ConfigObject.java index 56c57125a..5070d2da0 100644 --- a/src/main/java/me/shedaniel/rei/api/ConfigObject.java +++ b/src/main/java/me/shedaniel/rei/api/ConfigObject.java @@ -93,10 +93,6 @@ public interface ConfigObject { boolean areClickableRecipeArrowsEnabled(); - @ApiStatus.ScheduledForRemoval - @Deprecated - boolean isUsingLightGrayRecipeBorder(); - RecipeBorderType getRecipeBorderType(); boolean doesVillagerScreenHavePermanentScrollBar(); diff --git a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java index 246850cc7..52936de0e 100644 --- a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java +++ b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java @@ -23,12 +23,10 @@ package me.shedaniel.rei.api; -import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.Rectangle; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.gui.config.SearchFieldLocation; -import me.shedaniel.rei.utils.CollectionUtils; import net.minecraft.util.ActionResult; -import org.jetbrains.annotations.ApiStatus; import java.util.List; import java.util.function.Supplier; @@ -54,18 +52,6 @@ public interface DisplayHelper { List<DisplayBoundsHandler<?>> getSortedBoundsHandlers(Class<?> screenClass); /** - * Gets all registered bounds handlers - * - * @return the list of registered bounds handlers - * @deprecated see {@link #getAllOverlayDeciders()} - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - default List<DisplayBoundsHandler<?>> getAllBoundsHandlers() { - return (List) CollectionUtils.castAndMap(getAllOverlayDeciders(), DisplayBoundsHandler.class); - } - - /** * Gets all registered overlay deciders * * @return the list of registered overlay deciders @@ -82,35 +68,12 @@ public interface DisplayHelper { DisplayBoundsHandler<?> getResponsibleBoundsHandler(Class<?> screenClass); /** - * Registers a bounds handler - * - * @param handler the handler to register - * @deprecated see {@link #registerHandler(OverlayDecider)} - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - default void registerBoundsHandler(DisplayBoundsHandler<?> handler) { - registerHandler(handler); - } - - /** * Registers a bounds decider * * @param decider the decider to register */ void registerHandler(OverlayDecider decider); - /** - * Gets the base bounds handler api for exclusion zones - * - * @return the base bounds handler - * @deprecated {@link BaseBoundsHandler#getInstance()} - */ - @ApiStatus.Internal - @Deprecated - @ApiStatus.ScheduledForRemoval - BaseBoundsHandler getBaseBoundsHandler(); - interface DisplayBoundsHandler<T> extends OverlayDecider { /** * Gets the base supported class for the bounds handler diff --git a/src/main/java/me/shedaniel/rei/api/EntryStack.java b/src/main/java/me/shedaniel/rei/api/EntryStack.java index c2d5241e2..d09054ff5 100644 --- a/src/main/java/me/shedaniel/rei/api/EntryStack.java +++ b/src/main/java/me/shedaniel/rei/api/EntryStack.java @@ -26,9 +26,8 @@ package me.shedaniel.rei.api; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import me.shedaniel.math.Point; -import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.widgets.Tooltip; -import me.shedaniel.rei.gui.widget.QueuedTooltip; import me.shedaniel.rei.impl.EmptyEntryStack; import me.shedaniel.rei.impl.FluidEntryStack; import me.shedaniel.rei.impl.ItemEntryStack; @@ -231,23 +230,11 @@ public interface EntryStack { <T> T get(Settings<T> settings); - /** - * @deprecated Use {@link #getTooltip(Point)} - */ @Nullable - @Deprecated - @ApiStatus.ScheduledForRemoval - default QueuedTooltip getTooltip(int mouseX, int mouseY) { + default Tooltip getTooltip(Point mouse) { return null; } - @Nullable - default Tooltip getTooltip(Point point) { - QueuedTooltip tooltip = getTooltip(point.x, point.y); - if (tooltip == null) return null; - return Tooltip.create(new Point(tooltip.getX(), tooltip.getY()), tooltip.getText()); - } - void render(Rectangle bounds, int mouseX, int mouseY, float delta); enum Type { diff --git a/src/main/java/me/shedaniel/rei/api/OptimalEntryStack.java b/src/main/java/me/shedaniel/rei/api/OptimalEntryStack.java index 3e65bc723..bade908d8 100644 --- a/src/main/java/me/shedaniel/rei/api/OptimalEntryStack.java +++ b/src/main/java/me/shedaniel/rei/api/OptimalEntryStack.java @@ -23,7 +23,7 @@ package me.shedaniel.rei.api; -import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.Rectangle; import org.jetbrains.annotations.ApiStatus; @ApiStatus.Internal diff --git a/src/main/java/me/shedaniel/rei/api/REIHelper.java b/src/main/java/me/shedaniel/rei/api/REIHelper.java index 5c8c80209..8a6c0461c 100644 --- a/src/main/java/me/shedaniel/rei/api/REIHelper.java +++ b/src/main/java/me/shedaniel/rei/api/REIHelper.java @@ -24,11 +24,9 @@ package me.shedaniel.rei.api; import me.shedaniel.rei.api.widgets.Tooltip; -import me.shedaniel.rei.gui.widget.QueuedTooltip; import me.shedaniel.rei.gui.widget.TextFieldWidget; import me.shedaniel.rei.impl.ScreenHelper; import net.minecraft.item.ItemStack; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; import java.util.List; @@ -48,15 +46,6 @@ public interface REIHelper { List<ItemStack> getInventoryStacks(); - /** - * @deprecated Use {@link #queueTooltip(Tooltip)} or {@link Tooltip#queue()} - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - default void addTooltip(@Nullable QueuedTooltip tooltip) { - queueTooltip(tooltip); - } - void queueTooltip(@Nullable Tooltip tooltip); } diff --git a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java index d491231b8..50cb7954b 100644 --- a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java +++ b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java @@ -25,18 +25,14 @@ package me.shedaniel.rei.api; import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.widgets.Widgets; -import me.shedaniel.rei.gui.RecipeViewingScreen; import me.shedaniel.rei.gui.entries.RecipeEntry; import me.shedaniel.rei.gui.entries.SimpleRecipeEntry; import me.shedaniel.rei.gui.widget.Widget; -import me.shedaniel.rei.impl.widgets.PanelWidget; -import net.minecraft.client.gui.DrawableHelper; import net.minecraft.util.Identifier; import org.jetbrains.annotations.ApiStatus; import java.util.Collections; import java.util.List; -import java.util.function.Supplier; public interface RecipeCategory<T extends RecipeDisplay> { @@ -78,51 +74,13 @@ public interface RecipeCategory<T extends RecipeDisplay> { /** * Setup the widgets for displaying the recipe * - * @param recipeDisplaySupplier the supplier for getting the recipe - * @param bounds the bounds of the display, configurable with overriding the width, height methods. - * @return the list of widgets - * @deprecated use {@link #setupDisplay(RecipeDisplay, me.shedaniel.math.Rectangle)} - */ - @ApiStatus.OverrideOnly - @ApiStatus.ScheduledForRemoval - @Deprecated - default List<Widget> setupDisplay(Supplier<T> recipeDisplaySupplier, me.shedaniel.math.api.Rectangle bounds) { - return Collections.singletonList(Widgets.createCategoryBase(bounds)); - } - - /** - * Setup the widgets for displaying the recipe - * * @param recipeDisplay the recipe * @param bounds the bounds of the display, configurable with overriding the width, height methods. * @return the list of widgets */ @ApiStatus.OverrideOnly default List<Widget> setupDisplay(T recipeDisplay, Rectangle bounds) { - return setupDisplay(() -> recipeDisplay, new me.shedaniel.math.api.Rectangle(bounds)); - } - - /** - * Draws the category background, used in {@link RecipeViewingScreen} - * - * @param bounds the bounds of the whole recipe viewing screen - * @param mouseX the x coordinates for the mouse - * @param mouseY the y coordinates for the mouse - * @param delta the delta - * @deprecated there is no replacement for this as this is just a dumb idea, please contact me if you want to change my mind - */ - @ApiStatus.OverrideOnly - @Deprecated - @ApiStatus.ScheduledForRemoval - default void drawCategoryBackground(me.shedaniel.math.api.Rectangle bounds, int mouseX, int mouseY, float delta) { - PanelWidget.render(bounds, -1); - if (REIHelper.getInstance().isDarkThemeEnabled()) { - DrawableHelper.fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, 0xFF404040); - DrawableHelper.fill(bounds.x + 17, bounds.y + 19, bounds.x + bounds.width - 17, bounds.y + 31, 0xFF404040); - } else { - DrawableHelper.fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, 0xFF9E9E9E); - DrawableHelper.fill(bounds.x + 17, bounds.y + 19, bounds.x + bounds.width - 17, bounds.y + 31, 0xFF9E9E9E); - } + return Collections.singletonList(Widgets.createCategoryBase(bounds)); } /** diff --git a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java index 122100fb0..9bec4c656 100644 --- a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java +++ b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java @@ -23,7 +23,7 @@ package me.shedaniel.rei.api; -import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.Rectangle; import me.shedaniel.rei.RoughlyEnoughItemsCore; import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.recipe.Recipe; @@ -107,6 +107,7 @@ public interface RecipeHelper { * * @param categoryIdentifier the category to display in * @param display the recipe display + * @deprecated Use {@link RecipeHelper#registerDisplay(RecipeDispl |
