Pārlūkot izejas kodu

4.0-unstable

Signed-off-by: shedaniel <daniel@shedaniel.me>
shedaniel 5 gadi atpakaļ
vecāks
revīzija
c20877aed9
47 mainītis faili ar 244 papildinājumiem un 613 dzēšanām
  1. 1 1
      JenkinsD
  2. 6 9
      build.gradle
  3. 8 7
      gradle.properties
  4. 12 14
      src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
  5. 6 6
      src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java
  6. 1 32
      src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java
  7. 0 12
      src/main/java/me/shedaniel/rei/api/ConfigManager.java
  8. 2 17
      src/main/java/me/shedaniel/rei/api/ConfigObject.java
  9. 0 31
      src/main/java/me/shedaniel/rei/api/DisplayHelper.java
  10. 1 1
      src/main/java/me/shedaniel/rei/api/EntryRegistry.java
  11. 0 6
      src/main/java/me/shedaniel/rei/api/EntryStack.java
  12. 0 54
      src/main/java/me/shedaniel/rei/api/ObjectHolder.java
  13. 2 1
      src/main/java/me/shedaniel/rei/api/REIPluginEntry.java
  14. 0 12
      src/main/java/me/shedaniel/rei/api/RecipeCategory.java
  15. 3 17
      src/main/java/me/shedaniel/rei/api/RecipeHelper.java
  16. 17 56
      src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java
  17. 4 3
      src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java
  18. 1 0
      src/main/java/me/shedaniel/rei/gui/RecipeDisplayExporter.java
  19. 50 107
      src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
  20. 14 19
      src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
  21. 4 4
      src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java
  22. 4 3
      src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java
  23. 44 10
      src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
  24. 0 26
      src/main/java/me/shedaniel/rei/gui/widget/ClickableActionedLabelWidget.java
  25. 4 20
      src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java
  26. 2 1
      src/main/java/me/shedaniel/rei/gui/widget/CraftableToggleButtonWidget.java
  27. 1 4
      src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java
  28. 8 6
      src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java
  29. 0 4
      src/main/java/me/shedaniel/rei/gui/widget/LateRenderedButton.java
  30. 6 8
      src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java
  31. 0 16
      src/main/java/me/shedaniel/rei/gui/widget/ReloadConfigButtonWidget.java
  32. 8 9
      src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java
  33. 0 5
      src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java
  34. 1 2
      src/main/java/me/shedaniel/rei/impl/DisplayHelperImpl.java
  35. 1 1
      src/main/java/me/shedaniel/rei/impl/EmptyEntryStack.java
  36. 1 0
      src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java
  37. 0 23
      src/main/java/me/shedaniel/rei/impl/ObjectHolderImpl.java
  38. 6 19
      src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
  39. 9 9
      src/main/java/me/shedaniel/rei/impl/ScreenHelper.java
  40. 4 4
      src/main/java/me/shedaniel/rei/impl/SearchArgument.java
  41. 2 2
      src/main/java/me/shedaniel/rei/listeners/ContainerScreenHooks.java
  42. 0 7
      src/main/java/me/shedaniel/rei/plugin/DefaultAutoCraftingPlugin.java
  43. 4 11
      src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
  44. 2 2
      src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultCategoryHandler.java
  45. 0 5
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java
  46. 3 6
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCustomDisplay.java
  47. 2 1
      src/main/resources/fabric.mod.json

+ 1 - 1
JenkinsD

@@ -4,7 +4,7 @@ pipeline {
 
       stage ('Build') {
          when {
-            expression { env.BRANCH_NAME == '3.x' }
+            expression { env.BRANCH_NAME == '3.x' || env.BRANCH_NAME == '4.x-unstable' }
          }
          steps {
             sh "rm -rf build/libs/"

+ 6 - 9
build.gradle

@@ -61,12 +61,12 @@ dependencies {
     modRuntime("io.github.prospector:modmenu:${modmenu_version}") {
         transitive = false
     }
-    modRuntime("com.lettuce.fudge:notenoughcrashes:1.1.5+1.15.1") {
-        transitive = false
-    }
+//    modRuntime("com.lettuce.fudge:notenoughcrashes:1.1.5+1.15.1") {
+//        transitive = false
+//    }
     if (includeDep) {
         afterEvaluate {
-            def listAdded = []
+            def listAdded = new ArrayList(Arrays.asList((api_exculde as String).split(',')))
             def eachDep = { dep ->
                 for (apiIncludeDepStr in (api_include as String).split(',')) {
                     def apiIncludeGroup = apiIncludeDepStr.split(':')[0]
@@ -111,15 +111,12 @@ curseforge {
         apiKey = project.getProperty('danielshe_curse_api_key')
         project {
             id = '310111'
-            releaseType = 'release'
+            releaseType = 'beta'
             changelogType = "html"
             def df = new SimpleDateFormat("yyyy-MM-dd HH:mm")
             df.setTimeZone(TimeZone.getTimeZone("UTC"))
             def time = df.format(new Date())
             changelog = "<h2>REI v$project.version</h2>Updated at <b>$time</b>.<br><a href=\"https://gist.github.com/shedaniel/b7593e692319976f3349263208792922\">Click here for full changelog</a>"
-            addGameVersion '1.15'
-            addGameVersion '1.15.1'
-            addGameVersion '1.15.2'
             addGameVersion '1.15-Snapshot'
             addGameVersion 'Java 8'
             addGameVersion 'Fabric'
@@ -129,7 +126,7 @@ curseforge {
                 embeddedLibrary 'cloth-config'
             }
             mainArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
-                displayName = "[Fabric 1.15.x] v$project.version"
+                displayName = "[Fabric 20w06a] v$project.version"
             }
             afterEvaluate {
                 uploadTask.dependsOn("remapJar")

+ 8 - 7
gradle.properties

@@ -1,11 +1,12 @@
-mod_version=3.3.18
-minecraft_version=1.15.2
-yarn_version=1.15.2+build.1
-fabricloader_version=0.7.2+build.174
-cloth_events_version=1.1.0
-cloth_config_version=2.9.1
+mod_version=4.0.0-unstable
+minecraft_version=20w06a
+yarn_version=20w06a+build.3
+fabricloader_version=0.7.8+build.184
+cloth_events_version=1.2.0
+cloth_config_version=2.9.3
 modmenu_version=1.8.5+build.23
-fabric_api=0.4.29+build.290-1.15
+fabric_api=0.4.30+build.294-1.16
 autoconfig1u=1.2.4
 api_include=me.shedaniel.cloth:cloth-events,me.shedaniel.cloth:config-2,me.sargunvohra.mcmods:autoconfig1u,org.jetbrains:annotations
+api_exculde=
 #api_include=me.shedaniel.cloth:cloth-events,me.shedaniel.cloth:config-2,me.sargunvohra.mcmods:autoconfig1u,org.jetbrains:annotations,net.fabricmc.fabric-api:fabric-

+ 12 - 14
src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java

@@ -22,7 +22,7 @@ import net.fabricmc.loader.api.ModContainer;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.Element;
 import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
+import net.minecraft.client.gui.screen.ingame.ContainerScreen;
 import net.minecraft.client.gui.screen.ingame.CraftingTableScreen;
 import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
 import net.minecraft.client.gui.screen.ingame.InventoryScreen;
@@ -90,9 +90,8 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
      *
      * @param plugin the plugin instance
      * @return the plugin itself
-     * @deprecated Check REI wiki
      */
-    @Deprecated
+    @ApiStatus.Internal
     public static REIPluginEntry registerPlugin(REIPluginEntry plugin) {
         plugins.put(plugin.getPluginIdentifier(), plugin);
         RoughlyEnoughItemsCore.LOGGER.debug("[REI] Registered plugin %s from %s", plugin.getPluginIdentifier().toString(), plugin.getClass().getSimpleName());
@@ -226,22 +225,21 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
         }
     }
     
-    @SuppressWarnings("deprecation")
     private void registerClothEvents() {
         final Identifier recipeButtonTex = new Identifier("textures/gui/recipe_button.png");
         AtomicLong lastSync = new AtomicLong(-1);
         ClothClientHooks.SYNC_RECIPES.register((minecraftClient, recipeManager, synchronizeRecipesS2CPacket) -> syncRecipes(lastSync));
         ClothClientHooks.SCREEN_ADD_BUTTON.register((minecraftClient, screen, abstractButtonWidget) -> {
-            if (ConfigObject.getInstance().doesDisableRecipeBook() && screen instanceof AbstractContainerScreen && abstractButtonWidget instanceof TexturedButtonWidget)
+            if (ConfigObject.getInstance().doesDisableRecipeBook() && screen instanceof ContainerScreen && abstractButtonWidget instanceof TexturedButtonWidget)
                 if (((RecipeBookButtonWidgetHooks) abstractButtonWidget).rei_getTexture().equals(recipeButtonTex))
                     return ActionResult.FAIL;
             return ActionResult.PASS;
         });
         ClothClientHooks.SCREEN_INIT_POST.register((minecraftClient, screen, screenHooks) -> {
-            if (screen instanceof AbstractContainerScreen) {
+            if (screen instanceof ContainerScreen) {
                 if (screen instanceof InventoryScreen && minecraftClient.interactionManager.hasCreativeInventory())
                     return;
-                ScreenHelper.setLastContainerScreen((AbstractContainerScreen<?>) screen);
+                ScreenHelper.setLastContainerScreen((ContainerScreen<?>) screen);
                 boolean alreadyAdded = false;
                 for (Element element : Lists.newArrayList(screenHooks.cloth_getInputListeners()))
                     if (ContainerScreenOverlay.class.isAssignableFrom(element.getClass()))
@@ -254,11 +252,11 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
             }
         });
         ClothClientHooks.SCREEN_RENDER_POST.register((minecraftClient, screen, i, i1, v) -> {
-            if (screen instanceof AbstractContainerScreen)
+            if (screen instanceof ContainerScreen)
                 ScreenHelper.getLastOverlay().render(i, i1, v);
         });
         ClothClientHooks.SCREEN_MOUSE_DRAGGED.register((minecraftClient, screen, v, v1, i, v2, v3) -> {
-            if (screen instanceof AbstractContainerScreen)
+            if (screen instanceof ContainerScreen)
                 if (ScreenHelper.isOverlayVisible() && ScreenHelper.getLastOverlay().mouseDragged(v, v1, i, v2, v3))
                     return ActionResult.SUCCESS;
             return ActionResult.PASS;
@@ -274,13 +272,13 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
             return ActionResult.PASS;
         });
         ClothClientHooks.SCREEN_MOUSE_SCROLLED.register((minecraftClient, screen, v, v1, v2) -> {
-            if (screen instanceof AbstractContainerScreen)
+            if (screen instanceof ContainerScreen)
                 if (ScreenHelper.isOverlayVisible() && ScreenHelper.getLastOverlay().mouseScrolled(v, v1, v2))
                     return ActionResult.SUCCESS;
             return ActionResult.PASS;
         });
         ClothClientHooks.SCREEN_CHAR_TYPED.register((minecraftClient, screen, character, keyCode) -> {
-            if (screen instanceof AbstractContainerScreen)
+            if (screen instanceof ContainerScreen)
                 if (ScreenHelper.getLastOverlay().charTyped(character, keyCode))
                     return ActionResult.SUCCESS;
             return ActionResult.PASS;
@@ -288,16 +286,16 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
         ClothClientHooks.SCREEN_LATE_RENDER.register((minecraftClient, screen, i, i1, v) -> {
             if (!ScreenHelper.isOverlayVisible())
                 return;
-            if (screen instanceof AbstractContainerScreen)
+            if (screen instanceof ContainerScreen)
                 ScreenHelper.getLastOverlay().lateRender(i, i1, v);
         });
         ClothClientHooks.SCREEN_KEY_PRESSED.register((minecraftClient, screen, i, i1, i2) -> {
             if (screen.getFocused() != null && screen.getFocused() instanceof TextFieldWidget || (screen.getFocused() instanceof RecipeBookWidget && ((RecipeBookGuiHooks) screen.getFocused()).rei_getSearchField() != null && ((RecipeBookGuiHooks) screen.getFocused()).rei_getSearchField().isFocused()))
                 return ActionResult.PASS;
-            if (screen instanceof AbstractContainerScreen)
+            if (screen instanceof ContainerScreen)
                 if (ScreenHelper.getLastOverlay().keyPressed(i, i1, i2))
                     return ActionResult.SUCCESS;
-            if (screen instanceof AbstractContainerScreen && configManager.getConfig().doesDisableRecipeBook() && configManager.getConfig().doesFixTabCloseContainer())
+            if (screen instanceof ContainerScreen && ConfigObject.getInstance().doesDisableRecipeBook() && ConfigObject.getInstance().doesFixTabCloseContainer())
                 if (i == 258 && minecraftClient.options.keyInventory.matchesKey(i, i1)) {
                     minecraftClient.player.closeContainer();
                     return ActionResult.SUCCESS;

+ 6 - 6
src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java

@@ -10,7 +10,7 @@ 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.AbstractContainerScreen;
+import net.minecraft.client.gui.screen.ingame.ContainerScreen;
 import net.minecraft.container.Container;
 
 import java.util.function.Supplier;
@@ -63,7 +63,7 @@ public interface AutoTransferHandler {
     }
     
     interface Context {
-        static Context create(boolean actuallyCrafting, AbstractContainerScreen<?> containerScreen, RecipeDisplay recipeDisplay) {
+        static Context create(boolean actuallyCrafting, ContainerScreen<?> containerScreen, RecipeDisplay recipeDisplay) {
             return new ContextImpl(actuallyCrafting, containerScreen, () -> recipeDisplay);
         }
         
@@ -73,7 +73,7 @@ public interface AutoTransferHandler {
         
         boolean isActuallyCrafting();
         
-        AbstractContainerScreen<?> getContainerScreen();
+        ContainerScreen<?> getContainerScreen();
         
         RecipeDisplay getRecipe();
         
@@ -139,10 +139,10 @@ public interface AutoTransferHandler {
     
     final class ContextImpl implements Context {
         boolean actuallyCrafting;
-        AbstractContainerScreen<?> containerScreen;
+        ContainerScreen<?> containerScreen;
         Supplier<RecipeDisplay> recipeDisplaySupplier;
         
-        private ContextImpl(boolean actuallyCrafting, AbstractContainerScreen<?> containerScreen, Supplier<RecipeDisplay> recipeDisplaySupplier) {
+        private ContextImpl(boolean actuallyCrafting, ContainerScreen<?> containerScreen, Supplier<RecipeDisplay> recipeDisplaySupplier) {
             this.actuallyCrafting = actuallyCrafting;
             this.containerScreen = containerScreen;
             this.recipeDisplaySupplier = recipeDisplaySupplier;
@@ -154,7 +154,7 @@ public interface AutoTransferHandler {
         }
         
         @Override
-        public AbstractContainerScreen<?> getContainerScreen() {
+        public ContainerScreen<?> getContainerScreen() {
             return containerScreen;
         }
         

+ 1 - 32
src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java

@@ -5,14 +5,10 @@
 
 package me.shedaniel.rei.api;
 
-import com.google.common.collect.Lists;
 import me.shedaniel.math.api.Rectangle;
-import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import net.minecraft.client.gui.screen.Screen;
-import org.jetbrains.annotations.ApiStatus;
 
 import java.util.List;
-import java.util.function.Function;
 import java.util.function.Supplier;
 
 public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Screen> {
@@ -20,43 +16,16 @@ public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Sc
      * Gets the exclusion zones by the screen class
      *
      * @param currentScreenClass the current screen class
-     * @param isOnRightSide      whether the user has set the overlay to the right
      * @return the list of exclusion zones
      */
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    default List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide) {
+    default List<Rectangle> getExclusionZones(Class<?> currentScreenClass) {
         return getExclusionZones(currentScreenClass, false);
     }
     
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    default List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide, boolean sort) {
-        return getExclusionZones(currentScreenClass, sort);
-    }
-    
     List<Rectangle> getExclusionZones(Class<?> currentScreenClass, boolean sort);
     
     int supplierSize();
     
-    /**
-     * Register an exclusion zone
-     *
-     * @param screenClass the screen
-     * @param supplier    the exclusion zone supplier, isOnRightSide -> the list of exclusion zones
-     * @see #registerExclusionZones(Class, Supplier) for non deprecated version
-     */
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    default void registerExclusionZones(Class<?> screenClass, Function<Boolean, List<Rectangle>> supplier) {
-        RoughlyEnoughItemsCore.LOGGER.warn("[REI] Someone is registering exclusion zones with the deprecated method: " + supplier.getClass().getName());
-        registerExclusionZones(screenClass, () -> {
-            List<Rectangle> zones = Lists.newArrayList(supplier.apply(false));
-            zones.addAll(supplier.apply(true));
-            return zones;
-        });
-    }
-    
     /**
      * Register an exclusion zone
      *

+ 0 - 12
src/main/java/me/shedaniel/rei/api/ConfigManager.java

@@ -8,13 +8,11 @@ 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 {
     
-    @SuppressWarnings("deprecation")
     static ConfigManager getInstance() {
         return RoughlyEnoughItemsCore.getConfigManager();
     }
@@ -26,16 +24,6 @@ public interface ConfigManager {
      */
     void saveConfig();
     
-    /**
-     * Gets the config instance
-     *
-     * @return the config instance
-     * @deprecated Use {@link ConfigObject#getInstance()}
-     */
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    ConfigObject getConfig();
-    
     /**
      * Gets if craftable only filter is enabled
      *

+ 2 - 17
src/main/java/me/shedaniel/rei/api/ConfigObject.java

@@ -9,8 +9,8 @@ import me.shedaniel.clothconfig2.api.ModifierKeyCode;
 import me.shedaniel.rei.gui.config.ItemListOrdering;
 import me.shedaniel.rei.gui.config.RecipeScreenType;
 import me.shedaniel.rei.gui.config.SearchFieldLocation;
+import me.shedaniel.rei.impl.ConfigManagerImpl;
 import me.shedaniel.rei.impl.ConfigObjectImpl;
-import net.minecraft.client.util.InputUtil;
 import org.jetbrains.annotations.ApiStatus;
 
 import java.lang.annotation.ElementType;
@@ -20,15 +20,10 @@ import java.lang.annotation.Target;
 
 public interface ConfigObject {
     
-    @SuppressWarnings("deprecation")
     static ConfigObject getInstance() {
-        return ConfigManager.getInstance().getConfig();
+        return ((ConfigManagerImpl) ConfigManager.getInstance()).getConfig();
     }
     
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    boolean isLighterButtonHover();
-    
     boolean isOverlayVisible();
     
     void setOverlayVisible(boolean overlayVisible);
@@ -45,11 +40,6 @@ public interface ConfigObject {
     
     boolean isToastDisplayedOnCopyIdentifier();
     
-    @Deprecated
-    default boolean doesRenderEntryExtraOverlay() {
-        return doesRenderEntryEnchantmentGlint();
-    }
-    
     boolean doesRenderEntryEnchantmentGlint();
     
     boolean isEntryListWidgetScrolled();
@@ -104,11 +94,6 @@ public interface ConfigObject {
     
     boolean doSearchFavorites();
     
-    @Deprecated
-    default InputUtil.KeyCode getFavoriteKeybind() {
-        return getFavoriteKeyCode().getKeyCode();
-    }
-    
     ModifierKeyCode getFavoriteKeyCode();
     
     ModifierKeyCode getRecipeKeybind();

+ 0 - 31
src/main/java/me/shedaniel/rei/api/DisplayHelper.java

@@ -17,7 +17,6 @@ import static net.minecraft.util.ActionResult.PASS;
 
 public interface DisplayHelper {
     
-    @SuppressWarnings("deprecation")
     static DisplayHelper getInstance() {
         return RoughlyEnoughItemsCore.getDisplayHelper();
     }
@@ -99,36 +98,6 @@ public interface DisplayHelper {
             return PASS;
         }
         
-        /**
-         * Checks if item slot can fit the screen
-         *
-         * @param isOnRightSide whether the user has set the overlay to the right
-         * @param left          the left x coordinates of the stack
-         * @param top           the top y coordinates for the stack
-         * @param screen        the current screen
-         * @param fullBounds    the current bounds
-         * @return whether the item slot can fit
-         * @deprecated use {@link #canItemSlotWidgetFit(int, int, Object, Rectangle)}
-         */
-        @Deprecated
-        default ActionResult canItemSlotWidgetFit(boolean isOnRightSide, int left, int top, T screen, Rectangle fullBounds) {
-            return canItemSlotWidgetFit(left, top, screen, fullBounds);
-        }
-        
-        /**
-         * Checks if mouse is inside the overlay
-         *
-         * @param isOnRightSide whether the user has set the overlay to the right
-         * @param mouseX        mouse's x coordinates
-         * @param mouseY        mouse's y coordinates
-         * @return whether mouse is inside the overlay
-         * @deprecated use {@link #isInZone(double, double)}
-         */
-        @Deprecated
-        default ActionResult isInZone(boolean isOnRightSide, double mouseX, double mouseY) {
-            return isInZone(mouseX, mouseY);
-        }
-        
         /**
          * Checks if mouse is inside the overlay
          *

+ 1 - 1
src/main/java/me/shedaniel/rei/api/EntryRegistry.java

@@ -17,7 +17,6 @@ import java.util.List;
 
 public interface EntryRegistry {
     
-    @SuppressWarnings("deprecation")
     static EntryRegistry getInstance() {
         return RoughlyEnoughItemsCore.getEntryRegistry();
     }
@@ -59,6 +58,7 @@ public interface EntryRegistry {
      * @param afterEntry           the stack to put after
      * @param stack                the stack to register
      * @param checkAlreadyContains whether the list should check if it is already on the list
+     * @see #queueRegisterEntryAfter(EntryStack, Collection) for a faster method
      */
     @Deprecated
     @ApiStatus.Internal

+ 0 - 6
src/main/java/me/shedaniel/rei/api/EntryStack.java

@@ -167,11 +167,6 @@ public interface EntryStack {
         return setting(settings, value);
     }
     
-    @Deprecated
-    default <T> ObjectHolder<T> getSetting(Settings<T> settings) {
-        return ObjectHolder.of(get(settings));
-    }
-    
     <T> T get(Settings<T> settings);
     
     @Nullable QueuedTooltip getTooltip(int mouseX, int mouseY);
@@ -208,7 +203,6 @@ public interface EntryStack {
         
         public static class Item {
             public static final Settings<Supplier<Boolean>> RENDER_ENCHANTMENT_GLINT = new Settings<>(TRUE);
-            @Deprecated @ApiStatus.ScheduledForRemoval public static final Settings<Supplier<Boolean>> RENDER_OVERLAY = RENDER_ENCHANTMENT_GLINT;
             
             private Item() {
             }

+ 0 - 54
src/main/java/me/shedaniel/rei/api/ObjectHolder.java

@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 2020 shedaniel
- * Licensed under the MIT License (the "License").
- */
-
-package me.shedaniel.rei.api;
-
-import me.shedaniel.rei.impl.ObjectHolderImpl;
-import org.jetbrains.annotations.ApiStatus;
-
-public interface ObjectHolder<T> {
-    @SuppressWarnings("deprecation")
-    static <T> ObjectHolder<T> of(T o) {
-        return new ObjectHolderImpl<>(o);
-    }
-    
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    default int intValue() {
-        return (int) (Object) value();
-    }
-    
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    default long longValue() {
-        return (long) (Object) value();
-    }
-    
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    default boolean booleanValue() {
-        return (boolean) (Object) value();
-    }
-    
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    default float floatValue() {
-        return (float) (Object) value();
-    }
-    
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    default double doubleValue() {
-        return (double) (Object) value();
-    }
-    
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    default String stringValue() {
-        return (String) value();
-    }
-    
-    T value();
-}

+ 2 - 1
src/main/java/me/shedaniel/rei/api/REIPluginEntry.java

@@ -15,7 +15,8 @@ import org.jetbrains.annotations.ApiStatus;
  */
 public interface REIPluginEntry {
     
-    @ApiStatus.OverrideOnly
+    @ApiStatus.ScheduledForRemoval
+    @Deprecated
     default SemanticVersion getMinimumVersion() throws VersionParsingException {
         return null;
     }

+ 0 - 12
src/main/java/me/shedaniel/rei/api/RecipeCategory.java

@@ -127,16 +127,4 @@ public interface RecipeCategory<T extends RecipeDisplay> {
         return -1;
     }
     
-    /**
-     * Gets whether the category will check tags, useful for potions
-     *
-     * @return whether the category will check tags
-     * @deprecated no longer used
-     */
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    default boolean checkTags() {
-        return false;
-    }
-    
 }

+ 3 - 17
src/main/java/me/shedaniel/rei/api/RecipeHelper.java

@@ -7,7 +7,7 @@ package me.shedaniel.rei.api;
 
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
-import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
+import net.minecraft.client.gui.screen.ingame.ContainerScreen;
 import net.minecraft.recipe.Recipe;
 import net.minecraft.recipe.RecipeManager;
 import net.minecraft.util.Identifier;
@@ -21,7 +21,6 @@ import java.util.function.Predicate;
 
 public interface RecipeHelper {
     
-    @SuppressWarnings("deprecation")
     static RecipeHelper getInstance() {
         return RoughlyEnoughItemsCore.getRecipeHelper();
     }
@@ -170,19 +169,6 @@ public interface RecipeHelper {
      */
     List<DisplayVisibilityHandler> getDisplayVisibilityHandlers();
     
-    /**
-     * Checks if the display is visible by asking recipe visibility handlers
-     *
-     * @param display       the display to be checked
-     * @param respectConfig whether it should respect the user's config
-     * @return whether the display should be visible
-     * @deprecated {@link RecipeHelper#isDisplayVisible(RecipeDisplay)} )}
-     */
-    @Deprecated
-    default boolean isDisplayVisible(RecipeDisplay display, boolean respectConfig) {
-        return isDisplayVisible(display);
-    }
-    
     boolean isDisplayNotVisible(RecipeDisplay display);
     
     /**
@@ -203,7 +189,7 @@ public interface RecipeHelper {
      */
     void registerLiveRecipeGenerator(LiveRecipeGenerator<?> liveRecipeGenerator);
     
-    void registerScreenClickArea(Rectangle rectangle, Class<? extends AbstractContainerScreen<?>> screenClass, Identifier... categories);
+    void registerScreenClickArea(Rectangle rectangle, Class<? extends ContainerScreen<?>> screenClass, Identifier... categories);
     
     <T extends Recipe<?>> void registerRecipes(Identifier category, Class<T> recipeClass, Function<T, RecipeDisplay> mappingFunction);
     
@@ -215,7 +201,7 @@ public interface RecipeHelper {
     boolean arePluginsLoading();
     
     interface ScreenClickArea {
-        Class<? extends AbstractContainerScreen> getScreenClass();
+        Class<? extends ContainerScreen> getScreenClass();
         
         Rectangle getRectangle();
         

+ 17 - 56
src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java

@@ -21,11 +21,12 @@ import me.shedaniel.rei.utils.CollectionUtils;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.Element;
 import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
+import net.minecraft.client.gui.screen.ingame.ContainerScreen;
 import net.minecraft.client.render.Tessellator;
 import net.minecraft.client.render.VertexConsumerProvider;
 import net.minecraft.client.resource.language.I18n;
 import net.minecraft.client.sound.PositionedSoundInstance;
+import net.minecraft.client.util.NarratorManager;
 import net.minecraft.client.util.Window;
 import net.minecraft.client.util.math.Matrix4f;
 import net.minecraft.client.util.math.MatrixStack;
@@ -33,6 +34,7 @@ import net.minecraft.client.world.ClientWorld;
 import net.minecraft.container.Slot;
 import net.minecraft.item.ItemStack;
 import net.minecraft.sound.SoundEvents;
+import net.minecraft.text.TranslatableText;
 import net.minecraft.util.ActionResult;
 import net.minecraft.util.Identifier;
 import net.minecraft.world.GameMode;
@@ -100,7 +102,6 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         init();
     }
     
-    @SuppressWarnings("deprecation")
     public void init() {
         this.shouldReInit = false;
         //Update Variables
@@ -123,7 +124,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         this.widgets.add(ScreenHelper.getSearchField());
         ScreenHelper.getSearchField().setChangedListener(ENTRY_LIST_WIDGET::updateSearch);
         if (!ConfigObject.getInstance().isEntryListWidgetScrolled()) {
-            widgets.add(leftButton = new ButtonWidget(new Rectangle(bounds.x, bounds.y + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + 5, 16, 16), I18n.translate("text.rei.left_arrow")) {
+            widgets.add(leftButton = new ButtonWidget(new Rectangle(bounds.x, bounds.y + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + 5, 16, 16), new TranslatableText("text.rei.left_arrow")) {
                 @Override
                 public void onPressed() {
                     ENTRY_LIST_WIDGET.previousPage();
@@ -132,22 +133,12 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                 }
                 
-                @Override
-                public Optional<String> getTooltips() {
-                    return Optional.ofNullable(I18n.translate("text.rei.previous_page"));
-                }
-                
-                @Override
-                public boolean changeFocus(boolean boolean_1) {
-                    return false;
-                }
-                
                 @Override
                 public boolean containsMouse(double mouseX, double mouseY) {
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                 }
-            });
-            widgets.add(rightButton = new ButtonWidget(new Rectangle(bounds.x + bounds.width - 18, bounds.y + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + 5, 16, 16), I18n.translate("text.rei.right_arrow")) {
+            }.tooltip(() -> I18n.translate("text.rei.previous_page")).canChangeFocuses(false));
+            widgets.add(rightButton = new ButtonWidget(new Rectangle(bounds.x + bounds.width - 18, bounds.y + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + 5, 16, 16), new TranslatableText("text.rei.right_arrow")) {
                 @Override
                 public void onPressed() {
                     ENTRY_LIST_WIDGET.nextPage();
@@ -156,24 +147,14 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                 }
                 
-                @Override
-                public Optional<String> getTooltips() {
-                    return Optional.ofNullable(I18n.translate("text.rei.next_page"));
-                }
-                
-                @Override
-                public boolean changeFocus(boolean boolean_1) {
-                    return false;
-                }
-                
                 @Override
                 public boolean containsMouse(double mouseX, double mouseY) {
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                 }
-            });
+            }.tooltip(() -> I18n.translate("text.rei.next_page")).canChangeFocuses(false));
         }
         
-        widgets.add(configButton = new LateRenderedButton(getConfigButtonArea(), "") {
+        widgets.add(configButton = new LateRenderedButton(getConfigButtonArea(), NarratorManager.EMPTY) {
             @Override
             public void onPressed() {
                 if (Screen.hasShiftDown()) {
@@ -230,7 +211,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             }
         });
         if (ConfigObject.getInstance().doesShowUtilsButtons()) {
-            widgets.add(new ButtonWidget(ConfigObject.getInstance().isLowerConfigButton() ? new Rectangle(ConfigObject.getInstance().isLeftHandSidePanel() ? window.getScaledWidth() - 30 : 10, 10, 20, 20) : new Rectangle(ConfigObject.getInstance().isLeftHandSidePanel() ? window.getScaledWidth() - 55 : 35, 10, 20, 20), "") {
+            widgets.add(new ButtonWidget(ConfigObject.getInstance().isLowerConfigButton() ? new Rectangle(ConfigObject.getInstance().isLeftHandSidePanel() ? window.getScaledWidth() - 30 : 10, 10, 20, 20) : new Rectangle(ConfigObject.getInstance().isLeftHandSidePanel() ? window.getScaledWidth() - 55 : 35, 10, 20, 20), NarratorManager.EMPTY) {
                 @Override
                 public void onPressed() {
                     MinecraftClient.getInstance().player.sendChatMessage(ConfigObject.getInstance().getGamemodeCommand().replaceAll("\\{gamemode}", getNextGameMode(Screen.hasShiftDown()).getName()));
@@ -242,24 +223,14 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                     super.render(mouseX, mouseY, delta);
                 }
                 
-                @Override
-                public Optional<String> getTooltips() {
-                    return Optional.ofNullable(I18n.translate("text.rei.gamemode_button.tooltip", getGameModeText(getNextGameMode(Screen.hasShiftDown()))));
-                }
-                
-                @Override
-                public boolean changeFocus(boolean boolean_1) {
-                    return false;
-                }
-                
                 @Override
                 public boolean containsMouse(double mouseX, double mouseY) {
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                 }
-            });
+            }.tooltip(() -> I18n.translate("text.rei.gamemode_button.tooltip", getGameModeText(getNextGameMode(Screen.hasShiftDown())))).canChangeFocuses(false));
             int xxx = ConfigObject.getInstance().isLeftHandSidePanel() ? window.getScaledWidth() - 30 : 10;
             for (Weather weather : Weather.values()) {
-                widgets.add(new ButtonWidget(new Rectangle(xxx, 35, 20, 20), "") {
+                widgets.add(new ButtonWidget(new Rectangle(xxx, 35, 20, 20), NarratorManager.EMPTY) {
                     @Override
                     public void onPressed() {
                         MinecraftClient.getInstance().player.sendChatMessage(ConfigObject.getInstance().getWeatherCommand().replaceAll("\\{weather}", weather.name().toLowerCase(Locale.ROOT)));
@@ -273,21 +244,11 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                         blit(getBounds().x + 3, getBounds().y + 3, weather.getId() * 14, 14, 14, 14);
                     }
                     
-                    @Override
-                    public Optional<String> getTooltips() {
-                        return Optional.ofNullable(I18n.translate("text.rei.weather_button.tooltip", I18n.translate(weather.getTranslateKey())));
-                    }
-                    
-                    @Override
-                    public boolean changeFocus(boolean boolean_1) {
-                        return false;
-                    }
-                    
                     @Override
                     public boolean containsMouse(double mouseX, double mouseY) {
                         return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                     }
-                });
+                }.tooltip(() -> I18n.translate("text.rei.weather_button.tooltip", I18n.translate(weather.getTranslateKey()))).canChangeFocuses(false));
                 xxx += ConfigObject.getInstance().isLeftHandSidePanel() ? -25 : 25;
             }
         }
@@ -443,10 +404,10 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         }
         if (OverlaySearchField.isSearching) {
             setBlitOffset(200);
-            if (MinecraftClient.getInstance().currentScreen instanceof AbstractContainerScreen) {
+            if (MinecraftClient.getInstance().currentScreen instanceof ContainerScreen) {
                 ContainerScreenHooks hooks = (ContainerScreenHooks) MinecraftClient.getInstance().currentScreen;
                 int left = hooks.rei_getContainerLeft(), top = hooks.rei_getContainerTop();
-                for (Slot slot : ((AbstractContainerScreen<?>) MinecraftClient.getInstance().currentScreen).getContainer().slotList)
+                for (Slot slot : ((ContainerScreen<?>) MinecraftClient.getInstance().currentScreen).getContainer().slots)
                     if (!slot.hasStack() || !ENTRY_LIST_WIDGET.canLastSearchTermsBeAppliedTo(EntryStack.create(slot.getStack())))
                         fillGradient(left + slot.xPosition, top + slot.yPosition, left + slot.xPosition + 16, top + slot.yPosition + 16, -601874400, -601874400);
             }
@@ -454,7 +415,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         }
         RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
         this.renderWidgets(mouseX, mouseY, delta);
-        if (MinecraftClient.getInstance().currentScreen instanceof AbstractContainerScreen && ConfigObject.getInstance().areClickableRecipeArrowsEnabled()) {
+        if (MinecraftClient.getInstance().currentScreen instanceof ContainerScreen && ConfigObject.getInstance().areClickableRecipeArrowsEnabled()) {
             ContainerScreenHooks hooks = (ContainerScreenHooks) MinecraftClient.getInstance().currentScreen;
             for (RecipeHelper.ScreenClickArea area : RecipeHelper.getInstance().getScreenClickAreas())
                 if (area.getScreenClass().equals(MinecraftClient.getInstance().currentScreen.getClass()))
@@ -559,7 +520,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             return true;
         }
         ItemStack itemStack = null;
-        if (MinecraftClient.getInstance().currentScreen instanceof AbstractContainerScreen)
+        if (MinecraftClient.getInstance().currentScreen instanceof ContainerScreen)
             if (ScreenHelper.getLastContainerScreenHooks().rei_getHoveredSlot() != null && !ScreenHelper.getLastContainerScreenHooks().rei_getHoveredSlot().getStack().isEmpty())
                 itemStack = ScreenHelper.getLastContainerScreenHooks().rei_getHoveredSlot().getStack();
         if (itemStack != null && !itemStack.isEmpty()) {
@@ -601,7 +562,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
         if (!ScreenHelper.isOverlayVisible())
             return false;
-        if (MinecraftClient.getInstance().currentScreen instanceof AbstractContainerScreen && ConfigObject.getInstance().areClickableRecipeArrowsEnabled()) {
+        if (MinecraftClient.getInstance().currentScreen instanceof ContainerScreen && ConfigObject.getInstance().areClickableRecipeArrowsEnabled()) {
             ContainerScreenHooks hooks = (ContainerScreenHooks) MinecraftClient.getInstance().currentScreen;
             for (RecipeHelper.ScreenClickArea area : RecipeHelper.getInstance().getScreenClickAreas())
                 if (area.getScreenClass().equals(MinecraftClient.getInstance().currentScreen.getClass()))

+ 4 - 3
src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java

@@ -20,8 +20,9 @@ import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.Element;
 import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
+import net.minecraft.client.gui.screen.ingame.ContainerScreen;
 import net.minecraft.client.resource.language.I18n;
+import net.minecraft.client.util.NarratorManager;
 import net.minecraft.text.TranslatableText;
 import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
@@ -84,7 +85,7 @@ public class PreRecipeViewingScreen extends Screen {
     protected void init() {
         this.children.clear();
         this.widgets.clear();
-        this.widgets.add(new ButtonWidget(new Rectangle(width / 2 - 100, height - 40, 200, 20), "") {
+        this.widgets.add(new ButtonWidget(new Rectangle(width / 2 - 100, height - 40, 200, 20), NarratorManager.EMPTY) {
             @Override
             public void render(int mouseX, int mouseY, float delta) {
                 enabled = isSet;
@@ -150,7 +151,7 @@ public class PreRecipeViewingScreen extends Screen {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (int_1 == 256 || this.minecraft.options.keyInventory.matchesKey(int_1, int_2)) {
             MinecraftClient.getInstance().openScreen(parent);
-            if (parent instanceof AbstractContainerScreen)
+            if (parent instanceof ContainerScreen)
                 ScreenHelper.getLastOverlay().init();
             return true;
         }

+ 1 - 0
src/main/java/me/shedaniel/rei/gui/RecipeDisplayExporter.java

@@ -43,6 +43,7 @@ public final class RecipeDisplayExporter extends Widget {
         INSTANCE.exportRecipe(rectangle, widgets);
     }
     
+    @SuppressWarnings("deprecation")
     private void exportRecipe(Rectangle rectangle, List<Widget> widgets) {
         Framebuffer framebuffer = new Framebuffer(rectangle.width * 8, rectangle.height * 8, true, MinecraftClient.IS_SYSTEM_MAC);
         framebuffer.setClearColor(0, 0, 0, 0);

+ 50 - 107
src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java

@@ -23,12 +23,12 @@ import net.minecraft.client.render.Tessellator;
 import net.minecraft.client.render.VertexConsumerProvider;
 import net.minecraft.client.resource.language.I18n;
 import net.minecraft.client.sound.PositionedSoundInstance;
-import net.minecraft.client.util.InputUtil;
 import net.minecraft.client.util.Window;
 import net.minecraft.client.util.math.Matrix4f;
 import net.minecraft.client.util.math.MatrixStack;
 import net.minecraft.sound.SoundEvents;
 import net.minecraft.text.LiteralText;
+import net.minecraft.text.TranslatableText;
 import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
@@ -172,96 +172,52 @@ public class RecipeViewingScreen extends Screen {
         this.bounds = new Rectangle(width / 2 - guiWidth / 2, height / 2 - guiHeight / 2, guiWidth, guiHeight);
         this.page = MathHelper.clamp(page, 0, getTotalPages(selectedCategory) - 1);
         ButtonWidget w, w2;
-        this.widgets.add(w = new ButtonWidget(new Rectangle(bounds.x + 2, bounds.y - 16, 10, 10), I18n.translate("text.rei.left_arrow")) {
-            @Override
-            public void onPressed() {
-                categoryPages--;
-                if (categoryPages < 0)
-                    categoryPages = MathHelper.ceil(categories.size() / (float) tabsPerPage) - 1;
-                RecipeViewingScreen.this.init();
-            }
-        });
-        this.widgets.add(w2 = new ButtonWidget(new Rectangle(bounds.x + bounds.width - 12, bounds.y - 16, 10, 10), I18n.translate("text.rei.right_arrow")) {
-            @Override
-            public void onPressed() {
-                categoryPages++;
-                if (categoryPages > MathHelper.ceil(categories.size() / (float) tabsPerPage) - 1)
-                    categoryPages = 0;
-                RecipeViewingScreen.this.init();
-            }
-        });
+        this.widgets.add(w = ButtonWidget.create(new Rectangle(bounds.x + 2, bounds.y - 16, 10, 10), new TranslatableText("text.rei.left_arrow"), buttonWidget -> {
+            categoryPages--;
+            if (categoryPages < 0)
+                categoryPages = MathHelper.ceil(categories.size() / (float) tabsPerPage) - 1;
+            RecipeViewingScreen.this.init();
+        }));
+        this.widgets.add(w2 = ButtonWidget.create(new Rectangle(bounds.x + bounds.width - 12, bounds.y - 16, 10, 10), new TranslatableText("text.rei.right_arrow"), buttonWidget -> {
+            categoryPages++;
+            if (categoryPages > MathHelper.ceil(categories.size() / (float) tabsPerPage) - 1)
+                categoryPages = 0;
+            RecipeViewingScreen.this.init();
+        }));
         w.enabled = w2.enabled = categories.size() > tabsPerPage;
-        widgets.add(categoryBack = new ButtonWidget(new Rectangle(bounds.getX() + 5, bounds.getY() + 5, 12, 12), I18n.translate("text.rei.left_arrow")) {
-            @Override
-            public void onPressed() {
-                int currentCategoryIndex = categories.indexOf(selectedCategory);
-                currentCategoryIndex--;
-                if (currentCategoryIndex < 0)
-                    currentCategoryIndex = categories.size() - 1;
-                selectedCategory = (RecipeCategory<RecipeDisplay>) categories.get(currentCategoryIndex);
-                categoryPages = MathHelper.floor(currentCategoryIndex / (double) tabsPerPage);
-                page = 0;
-                RecipeViewingScreen.this.init();
-            }
-            
-            @Override
-            public Optional<String> getTooltips() {
-                return Optional.ofNullable(I18n.translate("text.rei.previous_category"));
-            }
-        });
-        widgets.add(new ClickableLabelWidget(new Point(bounds.getCenterX(), bounds.getY() + 7), "") {
-            @Override
-            public void render(int mouseX, int mouseY, float delta) {
-                setText(selectedCategory.getCategoryName());
-                super.render(mouseX, mouseY, delta);
-            }
-            
-            @Override
-            public Optional<String> getTooltips() {
-                return Optional.ofNullable(I18n.translate("text.rei.view_all_categories"));
-            }
-            
-            @Override
-            public void onLabelClicked() {
-                MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
-                ClientHelper.getInstance().executeViewAllRecipesKeyBind();
-            }
-        });
-        widgets.add(categoryNext = new ButtonWidget(new Rectangle(bounds.getMaxX() - 17, bounds.getY() + 5, 12, 12), I18n.translate("text.rei.right_arrow")) {
-            @Override
-            public void onPressed() {
-                int currentCategoryIndex = categories.indexOf(selectedCategory);
-                currentCategoryIndex++;
-                if (currentCategoryIndex >= categories.size())
-                    currentCategoryIndex = 0;
-                selectedCategory = (RecipeCategory<RecipeDisplay>) categories.get(currentCategoryIndex);
-                categoryPages = MathHelper.floor(currentCategoryIndex / (double) tabsPerPage);
-                page = 0;
-                RecipeViewingScreen.this.init();
-            }
-            
-            @Override
-            public Optional<String> getTooltips() {
-                return Optional.ofNullable(I18n.translate("text.rei.next_category"));
-            }
-        });
+        widgets.add(categoryBack = ButtonWidget.create(new Rectangle(bounds.getX() + 5, bounds.getY() + 5, 12, 12), new TranslatableText("text.rei.left_arrow"), buttonWidget -> {
+            int currentCategoryIndex = categories.indexOf(selectedCategory);
+            currentCategoryIndex--;
+            if (currentCategoryIndex < 0)
+                currentCategoryIndex = categories.size() - 1;
+            selectedCategory = (RecipeCategory<RecipeDisplay>) categories.get(currentCategoryIndex);
+            categoryPages = MathHelper.floor(currentCategoryIndex / (double) tabsPerPage);
+            page = 0;
+            RecipeViewingScreen.this.init();
+        }).tooltip(() -> I18n.translate("text.rei.previous_category")));
+        widgets.add(LabelWidget.createClickable(new Point(bounds.getCenterX(), bounds.getY() + 7), selectedCategory.getCategoryName(), clickableLabelWidget -> {
+            MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
+            ClientHelper.getInstance().executeViewAllRecipesKeyBind();
+        }).tooltip(() -> I18n.translate("text.rei.view_all_categories")));
+        widgets.add(categoryNext = ButtonWidget.create(new Rectangle(bounds.getMaxX() - 17, bounds.getY() + 5, 12, 12), new TranslatableText("text.rei.right_arrow"), buttonWidget -> {
+            int currentCategoryIndex = categories.indexOf(selectedCategory);
+            currentCategoryIndex++;
+            if (currentCategoryIndex >= categories.size())
+                currentCategoryIndex = 0;
+            selectedCategory = (RecipeCategory<RecipeDisplay>) categories.get(currentCategoryIndex);
+            categoryPages = MathHelper.floor(currentCategoryIndex / (double) tabsPerPage);
+            page = 0;
+            RecipeViewingScreen.this.init();
+        }).tooltip(() -> I18n.translate("text.rei.next_category")));
         categoryBack.enabled = categories.size() > 1;
         categoryNext.enabled = categories.size() > 1;
         
-        widgets.add(recipeBack = new ButtonWidget(new Rectangle(bounds.getX() + 5, bounds.getY() + 19, 12, 12), I18n.translate("text.rei.left_arrow")) {
-            @Override
-            public void onPressed() {
-                page--;
-                if (page < 0)
-                    page = getTotalPages(selectedCategory) - 1;
-                RecipeViewingScreen.this.init();
-            }
-            
-            @Override
-            public Optional<String> getTooltips() {
-                return Optional.ofNullable(I18n.translate("text.rei.previous_page"));
-            }
-        });
+        widgets.add(recipeBack = ButtonWidget.create(new Rectangle(bounds.getX() + 5, bounds.getY() + 19, 12, 12), new TranslatableText("text.rei.left_arrow"), buttonWidget -> {
+            page--;
+            if (page < 0)
+                page = getTotalPages(selectedCategory) - 1;
+            RecipeViewingScreen.this.init();
+        }).tooltip(() -> I18n.translate("text.rei.previous_page")));
         widgets.add(new ClickableLabelWidget(new Point(bounds.getCenterX(), bounds.getY() + 21), "") {
             @Override
             public void render(int mouseX, int mouseY, float delta) {
@@ -269,32 +225,19 @@ public class RecipeViewingScreen extends Screen {
                 super.render(mouseX, mouseY, delta);
             }
             
-            @Override
-            public Optional<String> getTooltips() {
-                return Optional.ofNullable(I18n.translate("text.rei.choose_page"));
-            }
-            
             @Override
             public void onLabelClicked() {
                 MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                 RecipeViewingScreen.this.choosePageActivated = true;
                 RecipeViewingScreen.this.init();
             }
-        }.clickable(categoriesMap.get(selectedCategory).size() > getRecipesPerPageByHeight()));
-        widgets.add(recipeNext = new ButtonWidget(new Rectangle(bounds.getMaxX() - 17, bounds.getY() + 19, 12, 12), I18n.translate("text.rei.right_arrow")) {
-            @Override
-            public void onPressed() {
-                page++;
-                if (page >= getTotalPages(selectedCategory))
-                    page = 0;
-                RecipeViewingScreen.this.init();
-            }
-            
-            @Override
-            public Optional<String> getTooltips() {
-                return Optional.ofNullable(I18n.translate("text.rei.next_page"));
-            }
-        });
+        }.clickable(categoriesMap.get(selectedCategory).size() > getRecipesPerPageByHeight()).tooltip(() -> I18n.translate("text.rei.choose_page")));
+        widgets.add(recipeNext = ButtonWidget.create(new Rectangle(bounds.getMaxX() - 17, bounds.getY() + 19, 12, 12), new TranslatableText("text.rei.right_arrow"), buttonWidget -> {
+            page++;
+            if (page >= getTotalPages(selectedCategory))
+                page = 0;
+            RecipeViewingScreen.this.init();
+        }).tooltip(() -> I18n.translate("text.rei.next_page")));
         recipeBack.enabled = recipeNext.enabled = categoriesMap.get(selectedCategory).size() > getRecipesPerPageByHeight();
         int tabV = isCompactTabs ? 166 : 192;
         for (int i = 0; i < tabsPerPage; i++) {

+ 14 - 19
src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java

@@ -26,6 +26,7 @@ import net.minecraft.client.render.Tessellator;
 import net.minecraft.client.render.VertexFormats;
 import net.minecraft.client.resource.language.I18n;
 import net.minecraft.client.sound.PositionedSoundInstance;
+import net.minecraft.client.util.NarratorManager;
 import net.minecraft.sound.SoundEvents;
 import net.minecraft.text.LiteralText;
 import net.minecraft.text.TranslatableText;
@@ -148,7 +149,7 @@ public class VillagerRecipeViewingScreen extends Screen {
             int finalIndex = index;
             RecipeEntry recipeEntry;
             recipeRenderers.add(recipeEntry = category.getSimpleRenderer(recipeDisplay));
-            buttonWidgets.add(new ButtonWidget(new Rectangle(bounds.x + 5, 0, recipeEntry.getWidth(), recipeEntry.getHeight()), "") {
+            buttonWidgets.add(new ButtonWidget(new Rectangle(bounds.x + 5, 0, recipeEntry.getWidth(), recipeEntry.getHeight()), NarratorManager.EMPTY) {
                 @Override
                 public void onPressed() {
                     selectedRecipeIndex = finalIndex;
@@ -203,24 +204,18 @@ public class VillagerRecipeViewingScreen extends Screen {
             }
         }
         ButtonWidget w, w2;
-        this.widgets.add(w = new ButtonWidget(new Rectangle(bounds.x + 2, bounds.y - 16, 10, 10), new TranslatableText("text.rei.left_arrow")) {
-            @Override
-            public void onPressed() {
-                tabsPage--;
-                if (tabsPage < 0)
-                    tabsPage = MathHelper.ceil(categories.size() / (float) tabsPerPage) - 1;
-                VillagerRecipeViewingScreen.this.init();
-            }
-        });
-        this.widgets.add(w2 = new ButtonWidget(new Rectangle(bounds.x + bounds.width - 12, bounds.y - 16, 10, 10), new TranslatableText("text.rei.right_arrow")) {
-            @Override
-            public void onPressed() {
-                tabsPage++;
-                if (tabsPage > MathHelper.ceil(categories.size() / (float) tabsPerPage) - 1)
-                    tabsPage = 0;
-                VillagerRecipeViewingScreen.this.init();
-            }
-        });
+        this.widgets.add(w = ButtonWidget.create(new Rectangle(bounds.x + 2, bounds.y - 16, 10, 10), new TranslatableText("text.rei.left_arrow"), buttonWidget -> {
+            tabsPage--;
+            if (tabsPage < 0)
+                tabsPage = MathHelper.ceil(categories.size() / (float) tabsPerPage) - 1;
+            VillagerRecipeViewingScreen.this.init();
+        }));
+        this.widgets.add(w2 = ButtonWidget.create(new Rectangle(bounds.x + bounds.width - 12, bounds.y - 16, 10, 10), new TranslatableText("text.rei.right_arrow"), buttonWidget -> {
+            tabsPage++;
+            if (tabsPage > MathHelper.ceil(categories.size() / (float) tabsPerPage) - 1)
+                tabsPage = 0;
+            VillagerRecipeViewingScreen.this.init();
+        }));
         w.enabled = w2.enabled = categories.size() > tabsPerPage;
         
         this.widgets.add(new ClickableLabelWidget(new Point(bounds.x + 4 + scrollListBounds.width / 2, bounds.y + 6), categories.get(selectedCategoryIndex).getCategoryName()) {

+ 4 - 4
src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java

@@ -11,7 +11,7 @@ import me.shedaniel.rei.impl.ScreenHelper;
 import net.fabricmc.loader.api.FabricLoader;
 import net.fabricmc.loader.api.metadata.CustomValue;
 import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
+import net.minecraft.client.gui.screen.ingame.ContainerScreen;
 import net.minecraft.client.gui.widget.AbstractPressableButtonWidget;
 import net.minecraft.client.resource.language.I18n;
 import net.minecraft.text.LiteralText;
@@ -36,7 +36,7 @@ public class CreditsScreen extends Screen {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (int_1 == 256 && this.shouldCloseOnEsc()) {
             this.minecraft.openScreen(parent);
-            if (parent instanceof AbstractContainerScreen)
+            if (parent instanceof ContainerScreen)
                 ScreenHelper.getLastOverlay().init();
             return true;
         }
@@ -54,7 +54,7 @@ public class CreditsScreen extends Screen {
                     CustomValue.CvObject jsonObject = rei.getMetadata().getCustomValue("rei:translators").getAsObject();
                     jsonObject.forEach(entry -> {
                         CustomValue value = entry.getValue();
-                        String behind = value.getType() == CustomValue.CvType.ARRAY ? Lists.newArrayList(value.getAsArray().iterator()).stream().map(json -> json.getAsString()).sorted(String::compareToIgnoreCase).collect(Collectors.joining(", ")) : value.getAsString();
+                        String behind = value.getType() == CustomValue.CvType.ARRAY ? Lists.newArrayList(value.getAsArray().iterator()).stream().map(CustomValue::getAsString).sorted(String::compareToIgnoreCase).collect(Collectors.joining(", ")) : value.getAsString();
                         translators.add(String.format("  %s - %s", entry.getKey(), behind));
                     });
                 }
@@ -77,7 +77,7 @@ public class CreditsScreen extends Screen {
             @Override
             public void onPress() {
                 CreditsScreen.this.minecraft.openScreen(parent);
-                if (parent instanceof AbstractContainerScreen)
+                if (parent instanceof ContainerScreen)
                     ScreenHelper.getLastOverlay().init();
             }
         });

+ 4 - 3
src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java

@@ -15,8 +15,9 @@ import me.shedaniel.rei.gui.toast.CopyRecipeIdentifierToast;
 import me.shedaniel.rei.impl.ClientHelperImpl;
 import me.shedaniel.rei.impl.ScreenHelper;
 import me.shedaniel.rei.utils.CollectionUtils;
-import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
+import net.minecraft.client.gui.screen.ingame.ContainerScreen;
 import net.minecraft.client.resource.language.I18n;
+import net.minecraft.text.LiteralText;
 import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 import org.jetbrains.annotations.ApiStatus;
@@ -32,13 +33,13 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
     private String extraTooltip;
     private List<String> errorTooltip;
     private List<Widget> setupDisplay;
-    private AbstractContainerScreen<?> containerScreen;
+    private ContainerScreen<?> containerScreen;
     private boolean visible = false;
     private RecipeCategory<?> category;
     private Rectangle displayBounds;
     
     public AutoCraftingButtonWidget(Rectangle displayBounds, Rectangle rectangle, String text, Supplier<RecipeDisplay> displaySupplier, List<Widget> setupDisplay, RecipeCategory<?> recipeCategory) {
-        super(rectangle, text);
+        super(rectangle, new LiteralText(text));
         this.displayBounds = displayBounds;
         this.displaySupplier = displaySupplier;
         Optional<Identifier> recipe = displaySupplier.get().getRecipeLocation();

+ 44 - 10
src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java

@@ -12,6 +12,7 @@ import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.gui.Element;
 import net.minecraft.client.sound.PositionedSoundInstance;
 import net.minecraft.sound.SoundEvents;
+import net.minecraft.text.LiteralText;
 import net.minecraft.text.Text;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
@@ -20,24 +21,57 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
+import java.util.function.Consumer;
+import java.util.function.Supplier;
 
 public abstract class ButtonWidget extends WidgetWithBounds {
     
     protected static final Identifier BUTTON_LOCATION = new Identifier("roughlyenoughitems", "textures/gui/button.png");
     protected static final Identifier BUTTON_LOCATION_DARK = new Identifier("roughlyenoughitems", "textures/gui/button_dark.png");
-    public boolean enabled;
-    public boolean focused;
+    public boolean enabled = true;
+    public boolean focused = false;
+    private boolean canChangeFocuses = true;
     private String text;
     private Rectangle bounds;
+    private Supplier<String> tooltipSupplier;
     
-    public ButtonWidget(Rectangle rectangle, Text text) {
-        this(rectangle, Objects.requireNonNull(text).asFormattedString());
+    protected ButtonWidget(Rectangle rectangle, Text text) {
+        this.bounds = Objects.requireNonNull(rectangle);
+        this.text = Objects.requireNonNull(text).asFormattedString();
     }
     
-    public ButtonWidget(Rectangle rectangle, String text) {
-        this.bounds = Objects.requireNonNull(rectangle);
-        this.enabled = true;
-        this.text = Objects.requireNonNull(text);
+    public static ButtonWidget create(Rectangle point, String text, Consumer<ButtonWidget> onClick) {
+        return create(point, new LiteralText(text), onClick);
+    }
+    
+    public static ButtonWidget create(Rectangle point, Text text, Consumer<ButtonWidget> onClick) {
+        ButtonWidget[] widget = {null};
+        widget[0] = new ButtonWidget(point, text) {
+            @Override
+            public void onPressed() {
+                onClick.accept(widget[0]);
+            }
+        };
+        return widget[0];
+    }
+    
+    public ButtonWidget tooltip(Supplier<String> tooltipSupplier) {
+        this.tooltipSupplier = tooltipSupplier;
+        return this;
+    }
+    
+    public ButtonWidget enabled(boolean enabled) {
+        this.enabled = enabled;
+        return this;
+    }
+    
+    public ButtonWidget canChangeFocuses(boolean canChangeFocuses) {
+        this.canChangeFocuses = canChangeFocuses;
+        return this;
+    }
+    
+    public boolean canChangeFocuses() {
+        return canChangeFocuses;
     }
     
     public Rectangle getBounds() {
@@ -113,7 +147,7 @@ public abstract class ButtonWidget extends WidgetWithBounds {
     
     @Override
     public boolean changeFocus(boolean boolean_1) {
-        if (!enabled)
+        if (!enabled || !canChangeFocuses)
             return false;
         this.focused = !this.focused;
         return true;
@@ -151,7 +185,7 @@ public abstract class ButtonWidget extends WidgetWithBounds {
     public abstract void onPressed();
     
     public Optional<String> getTooltips() {
-        return Optional.empty();
+        return Optional.ofNullable(tooltipSupplier).map(Supplier::get);
     }
     
 }

+ 0 - 26
src/main/java/me/shedaniel/rei/gui/widget/ClickableActionedLabelWidget.java

@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 2020 shedaniel
- * Licensed under the MIT License (the "License").
- */
-
-package me.shedaniel.rei.gui.widget;
-
-import me.shedaniel.math.api.Point;
-import org.jetbrains.annotations.ApiStatus;
-
-import java.util.function.Consumer;
-
-@ApiStatus.Internal
-public class ClickableActionedLabelWidget extends ClickableLabelWidget {
-    private Consumer<ClickableLabelWidget> onClicked;
-    
-    ClickableActionedLabelWidget(Point point, String text, Consumer<ClickableLabelWidget> onClicked) {
-        super(point, text);
-        this.onClicked = onClicked;
-    }
-    
-    @Override
-    public void onLabelClicked() {
-        onClicked.accept(this);
-    }
-}

+ 4 - 20
src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java

@@ -16,23 +16,7 @@ public abstract class ClickableLabelWidget extends LabelWidget {
     private int hoveredColor;
     
     @ApiStatus.Internal
-    public ClickableLabelWidget(int x, int y, String text, boolean clickable) {
-        this(new Point(x, y), text, clickable);
-    }
-    
-    @ApiStatus.Internal
-    public ClickableLabelWidget(int x, int y, String text) {
-        this(new Point(x, y), text, true);
-    }
-    
-    @ApiStatus.Internal
-    public ClickableLabelWidget(Point point, String text, boolean clickable) {
-        this(point, text);
-        clickable(clickable);
-    }
-    
-    @ApiStatus.Internal
-    public ClickableLabelWidget(Point point, String text) {
+    protected ClickableLabelWidget(Point point, String text) {
         super(point, text);
         this.hoveredColor = ScreenHelper.isDarkModeEnabled() ? -1 : 0xFF66FFCC;
     }
@@ -60,9 +44,9 @@ public abstract class ClickableLabelWidget extends LabelWidget {
         int width = font.getStringWidth(getText());
         if (isCentered()) {
             if (isHasShadows())
-                font.drawWithShadow(getText(), pos.x - width / 2, pos.y, color);
+                font.drawWithShadow(getText(), pos.x - width / 2f, pos.y, color);
             else
-                font.draw(getText(), pos.x - width / 2, pos.y, color);
+                font.draw(getText(), pos.x - width / 2f, pos.y, color);
         } else {
             if (isHasShadows())
                 font.drawWithShadow(getText(), pos.x, pos.y, color);
@@ -74,7 +58,7 @@ public abstract class ClickableLabelWidget extends LabelWidget {
     
     @Override
     protected void drawTooltips(int mouseX, int mouseY) {
-        if (getTooltips().isPresent())
+        if (isClickable() && getTooltips().isPresent())
             if (!focused && containsMouse(mouseX, mouseY))
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n")));
             else if (focused)

+ 2 - 1
src/main/java/me/shedaniel/rei/gui/widget/CraftableToggleButtonWidget.java

@@ -10,6 +10,7 @@ import me.shedaniel.rei.api.ConfigManager;
 import net.minecraft.block.Blocks;
 import net.minecraft.client.render.item.ItemRenderer;
 import net.minecraft.client.resource.language.I18n;
+import net.minecraft.client.util.NarratorManager;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.Identifier;
 import org.jetbrains.annotations.ApiStatus;
@@ -24,7 +25,7 @@ public abstract class CraftableToggleButtonWidget extends LateRenderedButton {
     private static final ItemStack ICON = new ItemStack(Blocks.CRAFTING_TABLE);
     
     public CraftableToggleButtonWidget(Rectangle rectangle) {
-        super(rectangle, "");
+        super(rectangle, NarratorManager.EMPTY);
         this.itemRenderer = minecraft.getItemRenderer();
     }
     

+ 1 - 4
src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java

@@ -47,7 +47,6 @@ import java.util.stream.Collectors;
 public class EntryListWidget extends WidgetWithBounds {
     
     static final Supplier<Boolean> RENDER_ENCHANTMENT_GLINT = ConfigObject.getInstance()::doesRenderEntryEnchantmentGlint;
-    @SuppressWarnings("deprecation")
     static final Comparator<? super EntryStack> ENTRY_NAME_COMPARER = Comparator.comparing(SearchArgument::tryGetEntryStackName);
     static final Comparator<? super EntryStack> ENTRY_GROUP_COMPARER = Comparator.comparingInt(stack -> {
         if (stack.getType() == EntryStack.Type.ITEM) {
@@ -73,7 +72,7 @@ public class EntryListWidget extends WidgetWithBounds {
     private List<EntryListEntry> entries = Collections.emptyList();
     private List<Widget> renders = Collections.emptyList();
     private List<Widget> widgets = Collections.emptyList();
-    @SuppressWarnings("deprecation") private List<SearchArgument.SearchArguments> lastSearchArguments = Collections.emptyList();
+    private List<SearchArgument.SearchArguments> lastSearchArguments = Collections.emptyList();
     private boolean draggingScrollBar = false;
     
     public static int entrySize() {
@@ -677,7 +676,6 @@ public class EntryListWidget extends WidgetWithBounds {
         return lastSearchArguments.isEmpty() || canSearchTermsBeAppliedTo(stack, lastSearchArguments);
     }
     
-    @SuppressWarnings("deprecation")
     private boolean canSearchTermsBeAppliedTo(EntryStack stack, List<SearchArgument.SearchArguments> searchArguments) {
         if (searchArguments.isEmpty())
             return true;
@@ -755,7 +753,6 @@ public class EntryListWidget extends WidgetWithBounds {
         return false;
     }
     
-    @SuppressWarnings("deprecation")
     private List<SearchArgument.SearchArguments> processSearchTerm(String searchTerm) {
         List<SearchArgument.SearchArguments> searchArguments = Lists.newArrayList();
         for (String split : StringUtils.splitByWholeSeparatorPreserveAllTokens(searchTerm.toLowerCase(Locale.ROOT), "|")) {

+ 8 - 6
src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java

@@ -26,11 +26,6 @@ public class LabelWidget extends WidgetWithBounds {
     private boolean centered = true;
     private Supplier<String> tooltipSupplier;
     
-    @ApiStatus.Internal
-    public LabelWidget(int x, int y, String text) {
-        this(new Point(x, y), text);
-    }
-    
     @ApiStatus.Internal
     public LabelWidget(Point point, String text) {
         this.pos = point;
@@ -43,7 +38,14 @@ public class LabelWidget extends WidgetWithBounds {
     }
     
     public static ClickableLabelWidget createClickable(Point point, String text, Consumer<ClickableLabelWidget> onClicked) {
-        return new ClickableActionedLabelWidget(point, text, onClicked);
+        ClickableLabelWidget[] widget = {null};
+        widget[0] = new ClickableLabelWidget(point, text) {
+            @Override
+            public void onLabelClicked() {
+                onClicked.accept(widget[0]);
+            }
+        };
+        return widget[0];
     }
     
     public LabelWidget tooltip(Supplier<String> tooltipSupplier) {

+ 0 - 4
src/main/java/me/shedaniel/rei/gui/widget/LateRenderedButton.java

@@ -14,8 +14,4 @@ public abstract class LateRenderedButton extends ButtonWidget implements LateRen
     protected LateRenderedButton(Rectangle rectangle, Text text) {
         super(rectangle, text);
     }
-    
-    protected LateRenderedButton(Rectangle rectangle, String text) {
-        super(rectangle, text);
-    }
 }

+ 6 - 8
src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java

@@ -14,6 +14,7 @@ import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.resource.language.I18n;
 import net.minecraft.client.util.Window;
+import net.minecraft.text.TranslatableText;
 import net.minecraft.util.math.MathHelper;
 import org.jetbrains.annotations.ApiStatus;
 
@@ -116,14 +117,11 @@ public class RecipeChoosePageWidget extends DraggableWidget {
             return stringBuilder_1.toString();
         };
         textFieldWidget.setText(String.valueOf(currentPage + 1));
-        widgets.add(btnDone = new ButtonWidget(new Rectangle(bounds.x + bounds.width - 45, bounds.y + bounds.height + 3, 40, 20), I18n.translate("gui.done")) {
-            @Override
-            public void onPressed() {
-                recipeViewingScreen.page = MathHelper.clamp(getIntFromString(textFieldWidget.getText()).orElse(0) - 1, 0, recipeViewingScreen.getTotalPages(recipeViewingScreen.getSelectedCategory()) - 1);
-                recipeViewingScreen.choosePageActivated = false;
-                recipeViewingScreen.init();
-            }
-        });
+        widgets.add(btnDone = ButtonWidget.create(new Rectangle(bounds.x + bounds.width - 45, bounds.y + bounds.height + 3, 40, 20), new TranslatableText("gui.done"), buttonWidget -> {
+            recipeViewingScreen.page = MathHelper.clamp(getIntFromString(textFieldWidget.getText()).orElse(0) - 1, 0, recipeViewingScreen.getTotalPages(recipeViewingScreen.getSelectedCategory()) - 1);
+            recipeViewingScreen.choosePageActivated = false;
+            recipeViewingScreen.init();
+        }));
         textFieldWidget.setFocused(true);
     }
     

+ 0 - 16
src/main/java/me/shedaniel/rei/gui/widget/ReloadConfigButtonWidget.java

@@ -1,16 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 2020 shedaniel
- * Licensed under the MIT License (the "License").
- */
-
-package me.shedaniel.rei.gui.widget;
-
-import net.minecraft.client.gui.widget.ButtonWidget;
-import org.jetbrains.annotations.ApiStatus;
-
-@ApiStatus.Internal
-public class ReloadConfigButtonWidget extends ButtonWidget {
-    public ReloadConfigButtonWidget(int x, int y, int width, int height, String text, PressAction action) {
-        super(x, y, width, height, text, action);
-    }
-}

+ 8 - 9
src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java

@@ -35,7 +35,6 @@ import me.shedaniel.rei.gui.ContainerScreenOverlay;
 import me.shedaniel.rei.gui.PreRecipeViewingScreen;
 import me.shedaniel.rei.gui.config.RecipeScreenType;
 import me.shedaniel.rei.gui.credits.CreditsScreen;
-import me.shedaniel.rei.gui.widget.ReloadConfigButtonWidget;
 import net.fabricmc.loader.api.FabricLoader;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.Element;
@@ -61,7 +60,7 @@ public class ConfigManagerImpl implements ConfigManager {
     
     private boolean craftableOnly;
     //    private List<EntryStack> favorites = new ArrayList<>();
-    private Gson gson = new GsonBuilder().create();
+    private final Gson gson = new GsonBuilder().create();
     
     public ConfigManagerImpl() {
         this.craftableOnly = false;
@@ -115,9 +114,10 @@ public class ConfigManagerImpl implements ConfigManager {
         
         guiRegistry.registerAnnotationProvider((i13n, field, config, defaults, guiProvider) -> {
             int width = 220;
+            //noinspection deprecation
             return Collections.singletonList(new TooltipListEntry<RecipeScreenType>(i13n, null) {
                 private RecipeScreenType type = getUnsafely(field, config, RecipeScreenType.UNSET);
-                private AbstractButtonWidget buttonWidget = new AbstractPressableButtonWidget(0, 0, 0, 20, "") {
+                private final AbstractButtonWidget buttonWidget = new AbstractPressableButtonWidget(0, 0, 0, 20, "") {
                     @Override
                     public void onPress() {
                         MinecraftClient.getInstance().openScreen(new PreRecipeViewingScreen(getScreen(), type, false, original -> {
@@ -133,7 +133,7 @@ public class ConfigManagerImpl implements ConfigManager {
                         super.render(mouseX, mouseY, delta);
                     }
                 };
-                private List<Element> children = ImmutableList.of(buttonWidget);
+                private final List<Element> children = ImmutableList.of(buttonWidget);
                 
                 @Override
                 public RecipeScreenType getValue() {
@@ -188,7 +188,6 @@ public class ConfigManagerImpl implements ConfigManager {
         ((me.sargunvohra.mcmods.autoconfig1u.ConfigManager<ConfigObjectImpl>) AutoConfig.getConfigHolder(ConfigObjectImpl.class)).save();
     }
     
-    @Override
     public ConfigObject getConfig() {
         return AutoConfig.getConfigHolder(ConfigObjectImpl.class).getConfig();
     }
@@ -214,8 +213,8 @@ public class ConfigManagerImpl implements ConfigManager {
             provider.setBuildFunction(builder -> {
                 if (FabricLoader.getInstance().isModLoaded("modmenu")) {
                     builder.getOrCreateCategory("config.roughlyenoughitems.!general").addEntry(new TooltipListEntry<Object>(I18n.translate("config.roughlyenoughitems.smooth_scrolling"), null) {
-                        int width = 220;
-                        private AbstractButtonWidget buttonWidget = new AbstractPressableButtonWidget(0, 0, 0, 20, this.getFieldName()) {
+                        final int width = 220;
+                        private final AbstractButtonWidget buttonWidget = new AbstractPressableButtonWidget(0, 0, 0, 20, this.getFieldName()) {
                             public void onPress() {
                                 Screen screen = ModMenu.getConfigScreen("cloth-config2", parent);
                                 if (screen != null) {
@@ -224,7 +223,7 @@ public class ConfigManagerImpl implements ConfigManager {
                                     ModMenu.openConfigScreen("cloth-config2");
                             }
                         };
-                        private List<Element> children = ImmutableList.of(this.buttonWidget);
+                        private final List<Element> children = ImmutableList.of(this.buttonWidget);
                         
                         public Object getValue() {
                             return null;
@@ -254,7 +253,7 @@ public class ConfigManagerImpl implements ConfigManager {
                 }
                 return builder.setAfterInitConsumer(screen -> {
                     if (MinecraftClient.getInstance().getNetworkHandler() != null && MinecraftClient.getInstance().getNetworkHandler().getRecipeManager() != null) {
-                        ((ScreenHooks) screen).cloth_addButton(new ReloadConfigButtonWidget(4, 4, 100, 20, I18n.translate("text.rei.reload_config"), buttonWidget -> {
+                        ((ScreenHooks) screen).cloth_addButton(new net.minecraft.client.gui.widget.ButtonWidget(4, 4, 100, 20, I18n.translate("text.rei.reload_config"), buttonWidget -> {
                             RoughlyEnoughItemsCore.syncRecipes(null);
                         }) {
                             @Override

+ 0 - 5
src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java

@@ -34,11 +34,6 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData {
     @ConfigEntry.Category("performance") @ConfigEntry.Gui.TransitiveObject @DontApplyFieldName private Performance performance = new Performance();
     //    @ConfigEntry.Category("filtering") @ConfigEntry.Gui.TransitiveObject @DontApplyFieldName private Filtering filtering = new Filtering();
     
-    @Override
-    public boolean isLighterButtonHover() {
-        return true;
-    }
-    
     @Override
     public boolean isOverlayVisible() {
         return general.overlayVisible;

+ 1 - 2
src/main/java/me/shedaniel/rei/impl/DisplayHelperImpl.java

@@ -79,8 +79,7 @@ public class DisplayHelperImpl implements DisplayHelper {
         return handlerCache.get(screenClass);
     }
     
-    @Deprecated
-    public boolean filterResponsible(DisplayBoundsHandler<?> handler) {
+    private boolean filterResponsible(DisplayBoundsHandler<?> handler) {
         return handler.getBaseSupportedClass().isAssignableFrom(tempScreen);
     }
     

+ 1 - 1
src/main/java/me/shedaniel/rei/impl/EmptyEntryStack.java

@@ -17,7 +17,7 @@ import java.util.Optional;
 @ApiStatus.Internal
 public class EmptyEntryStack implements EntryStack {
     
-    @Deprecated public static final EntryStack EMPTY = new EmptyEntryStack();
+    @Deprecated @ApiStatus.Internal public static final EntryStack EMPTY = new EmptyEntryStack();
     
     private EmptyEntryStack() {
     }

+ 1 - 0
src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java

@@ -73,6 +73,7 @@ public class EntryRegistryImpl implements EntryRegistry {
     
     @Override
     @Deprecated
+    @ApiStatus.Internal
     public void registerEntryAfter(EntryStack afterEntry, EntryStack stack, boolean checkAlreadyContains) {
         if (stack.isEmpty())
             return;

+ 0 - 23
src/main/java/me/shedaniel/rei/impl/ObjectHolderImpl.java

@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 2020 shedaniel
- * Licensed under the MIT License (the "License").
- */
-
-package me.shedaniel.rei.impl;
-
-import me.shedaniel.rei.api.ObjectHolder;
-import org.jetbrains.annotations.ApiStatus;
-
-@ApiStatus.Internal
-public class ObjectHolderImpl<T> implements ObjectHolder<T> {
-    private Object o;
-    
-    public ObjectHolderImpl(Object o) {
-        this.o = o;
-    }
-    
-    @Override
-    public T value() {
-        return (T) o;
-    }
-}

+ 6 - 19
src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java

@@ -13,10 +13,7 @@ import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.*;
 import me.shedaniel.rei.api.plugins.REIPluginV0;
 import me.shedaniel.rei.utils.CollectionUtils;
-import net.fabricmc.loader.api.FabricLoader;
-import net.fabricmc.loader.api.SemanticVersion;
-import net.fabricmc.loader.api.Version;
-import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
+import net.minecraft.client.gui.screen.ingame.ContainerScreen;
 import net.minecraft.recipe.Recipe;
 import net.minecraft.recipe.RecipeManager;
 import net.minecraft.util.ActionResult;
@@ -242,7 +239,7 @@ public class RecipeHelperImpl implements RecipeHelper {
     public void recipesLoaded(RecipeManager recipeManager) {
         long startTime = System.currentTimeMillis();
         arePluginsLoading = true;
-        ScreenHelper.clearData();
+        ScreenHelper.clearLastRecipeScreenData();
         recipeCount[0] = 0;
         this.recipeManager = recipeManager;
         this.recipeCategoryListMap.clear();
@@ -265,19 +262,9 @@ public class RecipeHelperImpl implements RecipeHelper {
         RoughlyEnoughItemsCore.LOGGER.info("[REI] Loading %d plugins: %s", plugins.size(), plugins.stream().map(REIPluginEntry::getPluginIdentifier).map(Identifier::toString).collect(Collectors.joining(", ")));
         Collections.reverse(plugins);
         ((EntryRegistryImpl) EntryRegistry.getInstance()).reset();
-        @SuppressWarnings("OptionalGetWithoutIsPresent")
-        Version reiVersion = FabricLoader.getInstance().getModContainer("roughlyenoughitems").get().getMetadata().getVersion();
-        if (!(reiVersion instanceof SemanticVersion))
-            RoughlyEnoughItemsCore.LOGGER.warn("[REI] Roughly Enough Items is not using semantic versioning, will be ignoring plugins' minimum versions!");
         List<REIPluginV0> reiPluginV0s = new ArrayList<>();
         for (REIPluginEntry plugin : plugins) {
             try {
-                if (reiVersion instanceof SemanticVersion)
-                    if (plugin.getMinimumVersion() == null) {
-                        RoughlyEnoughItemsCore.LOGGER.warn("[REI] Plugin " + plugin.getPluginIdentifier().toString() + " did not provide a minimum version, skipping version check!");
-                    } else if (plugin.getMinimumVersion().compareTo((SemanticVersion) reiVersion) > 0) {
-                        throw new IllegalStateException("Requires " + plugin.getMinimumVersion().getFriendlyString() + " version of REI!");
-                    }
                 if (plugin instanceof REIPluginV0) {
                     ((REIPluginV0) plugin).preRegister();
                     reiPluginV0s.add((REIPluginV0) plugin);
@@ -429,7 +416,7 @@ public class RecipeHelperImpl implements RecipeHelper {
     }
     
     @Override
-    public void registerScreenClickArea(Rectangle rectangle, Class<? extends AbstractContainerScreen<?>> screenClass, Identifier... categories) {
+    public void registerScreenClickArea(Rectangle rectangle, Class<? extends ContainerScreen<?>> screenClass, Identifier... categories) {
         this.screenClickAreas.add(new ScreenClickAreaImpl(screenClass, rectangle, categories));
     }
     
@@ -461,17 +448,17 @@ public class RecipeHelperImpl implements RecipeHelper {
     }
     
     private static class ScreenClickAreaImpl implements ScreenClickArea {
-        Class<? extends AbstractContainerScreen<?>> screenClass;
+        Class<? extends ContainerScreen<?>> screenClass;
         Rectangle rectangle;
         Identifier[] categories;
         
-        private ScreenClickAreaImpl(Class<? extends AbstractContainerScreen<?>> screenClass, Rectangle rectangle, Identifier[] categories) {
+        private ScreenClickAreaImpl(Class<? extends ContainerScreen<?>> screenClass, Rectangle rectangle, Identifier[] categories) {
             this.screenClass = screenClass;
             this.rectangle = rectangle;
             this.categories = categories;
         }
         
-        public Class<? extends AbstractContainerScreen<?>> getScreenClass() {
+        public Class<? extends ContainerScreen<?>> getScreenClass() {
             return screenClass;
         }
         

+ 9 - 9
src/main/java/me/shedaniel/rei/impl/ScreenHelper.java

@@ -18,7 +18,7 @@ import net.fabricmc.api.ClientModInitializer;
 import net.fabricmc.fabric.api.event.client.ClientTickCallback;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
+import net.minecraft.client.gui.screen.ingame.ContainerScreen;
 import net.minecraft.client.util.Window;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.ActionResult;
@@ -34,17 +34,17 @@ public class ScreenHelper implements ClientModInitializer {
     /**
      * @deprecated Use getters instead
      */
-    @Deprecated @ApiStatus.ScheduledForRemoval public static OverlaySearchField searchField;
+    private static OverlaySearchField searchField;
     @ApiStatus.Internal public static List<ItemStack> inventoryStacks = Lists.newArrayList();
     private static ContainerScreenOverlay overlay;
-    private static AbstractContainerScreen<?> lastContainerScreen = null;
+    private static ContainerScreen<?> lastContainerScreen = null;
     private static LinkedHashSet<Screen> lastRecipeScreen = Sets.newLinkedHashSetWithExpectedSize(5);
     
     public static OverlaySearchField getSearchField() {
         return searchField;
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public static void setSearchField(OverlaySearchField searchField) {
         ScreenHelper.searchField = searchField;
     }
@@ -65,7 +65,7 @@ public class ScreenHelper implements ClientModInitializer {
         return screen;
     }
     
-    public static void clearData() {
+    public static void clearLastRecipeScreenData() {
         lastRecipeScreen.clear();
     }
     
@@ -95,11 +95,11 @@ public class ScreenHelper implements ClientModInitializer {
         return getLastOverlay(false, false);
     }
     
-    public static AbstractContainerScreen<?> getLastContainerScreen() {
+    public static ContainerScreen<?> getLastContainerScreen() {
         return lastContainerScreen;
     }
     
-    public static void setLastContainerScreen(AbstractContainerScreen<?> lastContainerScreen) {
+    public static void setLastContainerScreen(ContainerScreen<?> lastContainerScreen) {
         ScreenHelper.lastContainerScreen = lastContainerScreen;
     }
     
@@ -129,8 +129,8 @@ public class ScreenHelper implements ClientModInitializer {
     @Override
     public void onInitializeClient() {
         ClothClientHooks.SCREEN_INIT_PRE.register((client, screen, screenHooks) -> {
-            if (lastContainerScreen != screen && screen instanceof AbstractContainerScreen)
-                lastContainerScreen = (AbstractContainerScreen<?>) screen;
+            if (lastContainerScreen != screen && screen instanceof ContainerScreen)
+                lastContainerScreen = (ContainerScreen<?>) screen;
             return ActionResult.PASS;
         });
         ClientTickCallback.EVENT.register(minecraftClient -> {

+ 4 - 4
src/main/java/me/shedaniel/rei/impl/SearchArgument.java

@@ -29,12 +29,12 @@ import java.util.function.Function;
 @ApiStatus.Internal
 public class SearchArgument {
     
-    public static final SearchArgument ALWAYS = new SearchArgument(ArgumentType.ALWAYS, "", true);
-    @Deprecated private static List<Item> searchBlacklisted = Lists.newArrayList();
+    private static final SearchArgument ALWAYS = new SearchArgument(ArgumentType.ALWAYS, "", true);
+    private static List<Item> searchBlacklisted = Lists.newArrayList();
     private ArgumentType argumentType;
     private String text;
-    public final Function<String, Boolean> INCLUDE = s -> s.contains(text);
-    public final Function<String, Boolean> NOT_INCLUDE = s -> !s.contains(text);
+    private final Function<String, Boolean> INCLUDE = s -> s.contains(text);
+    private final Function<String, Boolean> NOT_INCLUDE = s -> !s.contains(text);
     private boolean include;
     
     public SearchArgument(ArgumentType argumentType, String text, boolean include) {

+ 2 - 2
src/main/java/me/shedaniel/rei/listeners/ContainerScreenHooks.java

@@ -5,14 +5,14 @@
 
 package me.shedaniel.rei.listeners;
 
-import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
+import net.minecraft.client.gui.screen.ingame.ContainerScreen;
 import net.minecraft.container.Slot;
 import org.jetbrains.annotations.ApiStatus;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
 @ApiStatus.Internal
-@Mixin(AbstractContainerScreen.class)
+@Mixin(ContainerScreen.class)
 public interface ContainerScreenHooks {
     
     @Accessor("x")

+ 0 - 7
src/main/java/me/shedaniel/rei/plugin/DefaultAutoCraftingPlugin.java

@@ -10,8 +10,6 @@ import me.shedaniel.rei.api.RecipeHelper;
 import me.shedaniel.rei.api.plugins.REIPluginV0;
 import me.shedaniel.rei.plugin.autocrafting.DefaultCategoryHandler;
 import me.shedaniel.rei.plugin.autocrafting.DefaultRecipeBookHandler;
-import net.fabricmc.loader.api.SemanticVersion;
-import net.fabricmc.loader.util.version.VersionParsingException;
 import net.minecraft.util.Identifier;
 
 public class DefaultAutoCraftingPlugin implements REIPluginV0 {
@@ -23,11 +21,6 @@ public class DefaultAutoCraftingPlugin implements REIPluginV0 {
         return PLUGIN;
     }
     
-    @Override
-    public SemanticVersion getMinimumVersion() throws VersionParsingException {
-        return SemanticVersion.parse("3.0-pre");
-    }
-    
     @Override
     public void registerOthers(RecipeHelper recipeHelper) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {

+ 4 - 11
src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java

@@ -42,8 +42,6 @@ import me.shedaniel.rei.plugin.stonecutting.DefaultStoneCuttingDisplay;
 import me.shedaniel.rei.plugin.stripping.DefaultStrippingCategory;
 import me.shedaniel.rei.plugin.stripping.DefaultStrippingDisplay;
 import me.shedaniel.rei.plugin.stripping.DummyAxeItem;
-import net.fabricmc.loader.api.SemanticVersion;
-import net.fabricmc.loader.util.version.VersionParsingException;
 import net.minecraft.block.ComposterBlock;
 import net.minecraft.block.entity.AbstractFurnaceBlockEntity;
 import net.minecraft.client.MinecraftClient;
@@ -98,11 +96,6 @@ public class DefaultPlugin implements REIPluginV0 {
         return PLUGIN;
     }
     
-    @Override
-    public SemanticVersion getMinimumVersion() throws VersionParsingException {
-        return SemanticVersion.parse("3.2.33");
-    }
-    
     @Override
     public void preRegister() {
         INFO_DISPLAYS.clear();
@@ -283,19 +276,19 @@ public class DefaultPlugin implements REIPluginV0 {
                 return Collections.emptyList();
             return Collections.singletonList(widget.getBounds().clone());
         });
-        displayHelper.registerBoundsHandler(new DisplayHelper.DisplayBoundsHandler<AbstractContainerScreen<?>>() {
+        displayHelper.registerBoundsHandler(new DisplayHelper.DisplayBoundsHandler<ContainerScreen<?>>() {
             @Override
             public Class<?> getBaseSupportedClass() {
-                return AbstractContainerScreen.class;
+                return ContainerScreen.class;
             }
             
             @Override
-            public Rectangle getLeftBounds(AbstractContainerScreen<?> screen) {
+            public Rectangle getLeftBounds(ContainerScreen<?> screen) {
                 return new Rectangle(2, 0, ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft() - 4, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
             
             @Override
-            public Rectangle getRightBounds(AbstractContainerScreen<?> screen) {
+            public Rectangle getRightBounds(ContainerScreen<?> screen) {
                 int startX = ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft() + ScreenHelper.getLastContainerScreenHooks().rei_getContainerWidth() + 2;
                 return new Rectangle(startX, 0, MinecraftClient.getInstance().getWindow().getScaledWidth() - startX - 2, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }

+ 2 - 2
src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultCategoryHandler.java

@@ -18,7 +18,7 @@ import me.shedaniel.rei.server.ContainerInfoHandler;
 import net.fabricmc.fabric.api.network.ClientSidePacketRegistry;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
+import net.minecraft.client.gui.screen.ingame.ContainerScreen;
 import net.minecraft.client.gui.screen.recipebook.RecipeBookProvider;
 import net.minecraft.client.resource.language.I18n;
 import net.minecraft.container.Container;
@@ -39,7 +39,7 @@ public class DefaultCategoryHandler implements AutoTransferHandler {
         if (!(context.getRecipe() instanceof TransferRecipeDisplay))
             return Result.createNotApplicable();
         TransferRecipeDisplay recipe = (TransferRecipeDisplay) context.getRecipe();
-        AbstractContainerScreen<?> containerScreen = context.getContainerScreen();
+        ContainerScreen<?> containerScreen = context.getContainerScreen();
         Container container = containerScreen.getContainer();
         ContainerInfo<Container> containerInfo = (ContainerInfo<Container>) ContainerInfoHandler.getContainerInfo(recipe.getRecipeCategory(), container.getClass());
         if (containerInfo == null)

+ 0 - 5
src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java

@@ -33,11 +33,6 @@ import java.util.function.Supplier;
 
 public class DefaultCraftingCategory implements TransferRecipeCategory<DefaultCraftingDisplay> {
     
-    @Deprecated
-    public static int getSlotWithSize(DefaultCraftingDisplay recipeDisplay, int num) {
-        return getSlotWithSize(recipeDisplay, num, 3);
-    }
-    
     public static int getSlotWithSize(DefaultCraftingDisplay recipeDisplay, int num, int craftingGridWidth) {
         int x = num % recipeDisplay.getWidth();
         int y = (num - x) / recipeDisplay.getWidth();

+ 3 - 6
src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCustomDisplay.java

@@ -11,7 +11,6 @@ import me.shedaniel.rei.utils.CollectionUtils;
 import net.minecraft.item.ItemStack;
 import net.minecraft.recipe.Recipe;
 import net.minecraft.util.Identifier;
-import org.jetbrains.annotations.ApiStatus;
 
 import java.util.List;
 import java.util.Optional;
@@ -49,15 +48,13 @@ public class DefaultCustomDisplay implements DefaultCraftingDisplay {
         this(input, output, null);
     }
     
-    @Deprecated
-    @ApiStatus.ScheduledForRemoval
-    public Recipe getPossibleRecipe() {
-        return possibleRecipe;
+    protected Optional<Recipe<?>> getRecipe() {
+        return Optional.ofNullable(possibleRecipe);
     }
     
     @Override
     public Optional<Identifier> getRecipeLocation() {
-        return Optional.ofNullable(possibleRecipe).map(Recipe::getId);
+        return getRecipe().map(Recipe::getId);
     }
     
     @Override

+ 2 - 1
src/main/resources/fabric.mod.json

@@ -37,7 +37,8 @@
   "depends": {
     "fabricloader": "*",
     "cloth": ">=1.1.0",
-    "cloth-config2": ">=2.6.6"
+    "cloth-config2": ">=2.6.6",
+    "minecraft": "~1.16-Snapshot.20.6.a"
   },
   "mixins": [
     "mixin.roughlyenoughitems.json",