shedaniel 5 vuotta sitten
vanhempi
sitoutus
97fdf812b0
97 muutettua tiedostoa jossa 382 lisäystä ja 373 poistoa
  1. 1 2
      build.gradle
  2. 1 1
      gradle.properties
  3. 13 20
      src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
  4. 3 0
      src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java
  5. 11 0
      src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java
  6. 3 0
      src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java
  7. 2 0
      src/main/java/me/shedaniel/rei/api/ClientHelper.java
  8. 6 1
      src/main/java/me/shedaniel/rei/api/ConfigManager.java
  9. 4 1
      src/main/java/me/shedaniel/rei/api/ConfigObject.java
  10. 1 1
      src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java
  11. 2 0
      src/main/java/me/shedaniel/rei/api/EntryRegistry.java
  12. 13 13
      src/main/java/me/shedaniel/rei/api/EntryStack.java
  13. 2 3
      src/main/java/me/shedaniel/rei/api/ItemStackHook.java
  14. 7 0
      src/main/java/me/shedaniel/rei/api/ObjectHolder.java
  15. 2 3
      src/main/java/me/shedaniel/rei/api/OptimalEntryStack.java
  16. 2 0
      src/main/java/me/shedaniel/rei/api/REIPluginEntry.java
  17. 6 2
      src/main/java/me/shedaniel/rei/api/RecipeCategory.java
  18. 1 1
      src/main/java/me/shedaniel/rei/api/RecipeDisplay.java
  19. 3 1
      src/main/java/me/shedaniel/rei/api/RecipeHelper.java
  20. 2 0
      src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java
  21. 0 16
      src/main/java/me/shedaniel/rei/api/annotations/Experimental.java
  22. 0 16
      src/main/java/me/shedaniel/rei/api/annotations/Internal.java
  23. 0 16
      src/main/java/me/shedaniel/rei/api/annotations/ToBeRemoved.java
  24. 9 0
      src/main/java/me/shedaniel/rei/api/plugins/REIPluginV0.java
  25. 2 3
      src/main/java/me/shedaniel/rei/gui/ConfigReloadingScreen.java
  26. 4 4
      src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java
  27. 3 7
      src/main/java/me/shedaniel/rei/gui/OverlaySearchField.java
  28. 4 5
      src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java
  29. 34 36
      src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
  30. 5 15
      src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
  31. 2 0
      src/main/java/me/shedaniel/rei/gui/config/ItemCheatingMode.java
  32. 3 0
      src/main/java/me/shedaniel/rei/gui/config/ItemListOrdering.java
  33. 2 0
      src/main/java/me/shedaniel/rei/gui/config/ItemListOrderingConfig.java
  34. 2 0
      src/main/java/me/shedaniel/rei/gui/config/RecipeScreenType.java
  35. 2 0
      src/main/java/me/shedaniel/rei/gui/config/SearchFieldLocation.java
  36. 2 0
      src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java
  37. 2 0
      src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java
  38. 2 0
      src/main/java/me/shedaniel/rei/gui/entries/RecipeEntry.java
  39. 3 1
      src/main/java/me/shedaniel/rei/gui/entries/SimpleRecipeEntry.java
  40. 3 2
      src/main/java/me/shedaniel/rei/gui/toast/CopyRecipeIdentifierToast.java
  41. 6 7
      src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java
  42. 1 5
      src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
  43. 2 3
      src/main/java/me/shedaniel/rei/gui/widget/ClickableActionedLabelWidget.java
  44. 5 4
      src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java
  45. 2 3
      src/main/java/me/shedaniel/rei/gui/widget/CraftableToggleButtonWidget.java
  46. 2 3
      src/main/java/me/shedaniel/rei/gui/widget/DraggableWidget.java
  47. 4 4
      src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java
  48. 3 3
      src/main/java/me/shedaniel/rei/gui/widget/FavoritesListWidget.java
  49. 5 4
      src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java
  50. 8 8
      src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java
  51. 3 2
      src/main/java/me/shedaniel/rei/gui/widget/QueuedTooltip.java
  52. 9 2
      src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java
  53. 2 3
      src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java
  54. 2 3
      src/main/java/me/shedaniel/rei/gui/widget/ReloadConfigButtonWidget.java
  55. 2 3
      src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java
  56. 1 0
      src/main/java/me/shedaniel/rei/gui/widget/WidgetWithBounds.java
  57. 4 3
      src/main/java/me/shedaniel/rei/impl/AbstractEntryStack.java
  58. 3 4
      src/main/java/me/shedaniel/rei/impl/BaseBoundsHandlerImpl.java
  59. 2 3
      src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java
  60. 3 8
      src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java
  61. 2 3
      src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java
  62. 8 9
      src/main/java/me/shedaniel/rei/impl/DisplayHelperImpl.java
  63. 3 2
      src/main/java/me/shedaniel/rei/impl/EmptyEntryStack.java
  64. 6 7
      src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java
  65. 5 4
      src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java
  66. 8 9
      src/main/java/me/shedaniel/rei/impl/ItemEntryStack.java
  67. 2 1
      src/main/java/me/shedaniel/rei/impl/ObjectHolderImpl.java
  68. 2 3
      src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
  69. 3 1
      src/main/java/me/shedaniel/rei/impl/RenderingEntry.java
  70. 3 4
      src/main/java/me/shedaniel/rei/impl/ScreenHelper.java
  71. 8 10
      src/main/java/me/shedaniel/rei/impl/SearchArgument.java
  72. 2 2
      src/main/java/me/shedaniel/rei/impl/Weather.java
  73. 2 0
      src/main/java/me/shedaniel/rei/listeners/AbstractInventoryScreenHooks.java
  74. 2 0
      src/main/java/me/shedaniel/rei/listeners/ContainerScreenHooks.java
  75. 2 0
      src/main/java/me/shedaniel/rei/listeners/RecipeBookButtonWidgetHooks.java
  76. 2 0
      src/main/java/me/shedaniel/rei/listeners/RecipeBookGuiHooks.java
  77. 1 1
      src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultCategoryHandler.java
  78. 0 1
      src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java
  79. 1 1
      src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java
  80. 6 3
      src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java
  81. 1 1
      src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireDisplay.java
  82. 1 1
      src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java
  83. 1 1
      src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingDisplay.java
  84. 3 3
      src/main/java/me/shedaniel/rei/plugin/containers/CraftingContainerInfoWrapper.java
  85. 6 3
      src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java
  86. 14 6
      src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java
  87. 2 1
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java
  88. 4 1
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCustomDisplay.java
  89. 2 2
      src/main/java/me/shedaniel/rei/plugin/fuel/DefaultFuelCategory.java
  90. 13 13
      src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationCategory.java
  91. 5 5
      src/main/java/me/shedaniel/rei/server/ContainerInfoHandler.java
  92. 6 14
      src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java
  93. 3 1
      src/main/java/me/shedaniel/rei/server/RecipeFinder.java
  94. 10 10
      src/main/java/me/shedaniel/rei/server/RecipeGridAligner.java
  95. 1 2
      src/main/java/me/shedaniel/rei/tests/plugin/REITestPlugin.java
  96. 2 2
      src/main/java/me/shedaniel/rei/utils/CollectionUtils.java
  97. 2 1
      src/main/resources/assets/roughlyenoughitems/lang/en_us.json

+ 1 - 2
build.gradle

@@ -88,8 +88,7 @@ dependencies {
         transitive = false
     }
     compile "org.lwjgl:lwjgl-jemalloc:3.2.1"
-    compileOnly "com.google.code.findbugs:jsr305:3.0.2"
-    compileOnly 'org.jetbrains:annotations:15.0'
+    compileOnly 'org.jetbrains:annotations:18.0.0'
     modRuntime("com.lettuce.fudge:notenoughcrashes:1.1.5+1.15.1") {
         transitive = false
     }

+ 1 - 1
gradle.properties

@@ -1,4 +1,4 @@
-mod_version=3.3.11
+mod_version=3.3.12
 minecraft_version=1.15.1
 yarn_version=1.15.1+build.1
 fabricloader_version=0.7.2+build.174

+ 13 - 20
src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java

@@ -9,7 +9,6 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import me.shedaniel.cloth.hooks.ClothClientHooks;
 import me.shedaniel.rei.api.*;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.api.plugins.REIPluginV0;
 import me.shedaniel.rei.gui.ContainerScreenOverlay;
 import me.shedaniel.rei.impl.*;
@@ -44,6 +43,7 @@ import net.minecraft.util.ActionResult;
 import net.minecraft.util.Identifier;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.LinkedList;
 import java.util.List;
@@ -54,37 +54,33 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.atomic.AtomicLong;
 
-@Internal
+@ApiStatus.Internal
 public class RoughlyEnoughItemsCore implements ClientModInitializer {
     
-    @Internal public static final Logger LOGGER;
-    @SuppressWarnings("deprecation") private static final RecipeHelper RECIPE_HELPER = new RecipeHelperImpl();
-    @SuppressWarnings("deprecation") private static final EntryRegistry ENTRY_REGISTRY = new EntryRegistryImpl();
-    @SuppressWarnings("deprecation") private static final DisplayHelper DISPLAY_HELPER = new DisplayHelperImpl();
+    @ApiStatus.Internal public static final Logger LOGGER = LogManager.getFormatterLogger("REI");
+    private static final RecipeHelper RECIPE_HELPER = new RecipeHelperImpl();
+    private static final EntryRegistry ENTRY_REGISTRY = new EntryRegistryImpl();
+    private static final DisplayHelper DISPLAY_HELPER = new DisplayHelperImpl();
     private static final Map<Identifier, REIPluginEntry> plugins = Maps.newHashMap();
     private static final ExecutorService SYNC_RECIPES = Executors.newSingleThreadScheduledExecutor(r -> new Thread(r, "REI-SyncRecipes"));
     private static ConfigManager configManager;
     
-    static {
-        LOGGER = LogManager.getFormatterLogger("REI");
-    }
-    
-    @Deprecated
+    @ApiStatus.Internal
     public static RecipeHelper getRecipeHelper() {
         return RECIPE_HELPER;
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public static ConfigManager getConfigManager() {
         return configManager;
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public static EntryRegistry getEntryRegistry() {
         return ENTRY_REGISTRY;
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public static DisplayHelper getDisplayHelper() {
         return DISPLAY_HELPER;
     }
@@ -135,8 +131,7 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
         return ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.CREATE_ITEMS_PACKET) && ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.DELETE_ITEMS_PACKET);
     }
     
-    @Internal
-    @Deprecated
+    @ApiStatus.Internal
     public static void syncRecipes(AtomicLong lastSync) {
         if (lastSync != null) {
             if (lastSync.get() > 0 && System.currentTimeMillis() - lastSync.get() <= 5000) {
@@ -153,7 +148,6 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
         }
     }
     
-    @SuppressWarnings("deprecation")
     @Override
     public void onInitializeClient() {
         configManager = new ConfigManagerImpl();
@@ -161,7 +155,8 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
         registerClothEvents();
         discoverPluginEntries();
         for (ModContainer modContainer : FabricLoader.getInstance().getAllMods()) {
-            if (modContainer.getMetadata().containsCustomValue("roughlyenoughitems:plugins"))
+            //noinspection deprecation
+            if (modContainer.getMetadata().containsCustomElement("roughlyenoughitems:plugins"))
                 RoughlyEnoughItemsCore.LOGGER.error("[REI] REI plugin from " + modContainer.getMetadata().getId() + " is not loaded because it is too old!");
         }
         
@@ -201,7 +196,6 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
         });
     }
     
-    @SuppressWarnings("deprecation")
     private void discoverPluginEntries() {
         for (REIPluginEntry reiPlugin : FabricLoader.getInstance().getEntrypoints("rei_plugins", REIPluginEntry.class)) {
             try {
@@ -226,7 +220,6 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
         loadTestPlugins();
     }
     
-    @SuppressWarnings("deprecation")
     private void loadTestPlugins() {
         if (System.getProperty("rei.test", "false").equals("true")) {
             registerPlugin(new REITestPlugin());

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

@@ -17,6 +17,9 @@ import java.util.function.Supplier;
 
 public interface AutoTransferHandler {
     
+    /**
+     * @return the priority of this handler, higher priorities will be called first.
+     */
     default double getPriority() {
         return 0d;
     }

+ 11 - 0
src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java

@@ -9,6 +9,7 @@ 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;
@@ -23,11 +24,13 @@ public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Sc
      * @return the list of exclusion zones
      */
     @Deprecated
+    @ApiStatus.ScheduledForRemoval
     default List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide) {
         return getExclusionZones(currentScreenClass, false);
     }
     
     @Deprecated
+    @ApiStatus.ScheduledForRemoval
     default List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide, boolean sort) {
         return getExclusionZones(currentScreenClass, sort);
     }
@@ -41,8 +44,10 @@ public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Sc
      *
      * @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, () -> {
@@ -52,6 +57,12 @@ public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Sc
         });
     }
     
+    /**
+     * Register an exclusion zone
+     *
+     * @param screenClass the screen
+     * @param supplier    the exclusion zone supplier, returns the list of exclusion zones
+     */
     void registerExclusionZones(Class<?> screenClass, Supplier<List<Rectangle>> supplier);
     
 }

+ 3 - 0
src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java

@@ -7,6 +7,9 @@ package me.shedaniel.rei.api;
 
 import me.shedaniel.math.api.Rectangle;
 
+/**
+ * The supplier for the + button area.
+ */
 public interface ButtonAreaSupplier {
     
     /**

+ 2 - 0
src/main/java/me/shedaniel/rei/api/ClientHelper.java

@@ -9,6 +9,7 @@ import me.shedaniel.rei.impl.ClientHelperImpl;
 import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.Identifier;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.List;
 import java.util.Map;
@@ -52,6 +53,7 @@ public interface ClientHelper {
     /**
      * Registers REI's keybinds using Fabric API.
      */
+    @ApiStatus.Internal
     void registerFabricKeyBinds();
     
     /**

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

@@ -6,7 +6,9 @@
 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;
 
@@ -31,6 +33,7 @@ public interface ConfigManager {
      * @deprecated Use {@link ConfigObject#getInstance()}
      */
     @Deprecated
+    @ApiStatus.ScheduledForRemoval
     ConfigObject getConfig();
     
     /**
@@ -50,7 +53,9 @@ public interface ConfigManager {
      *
      * @param parent the screen shown before
      */
-    void openConfigScreen(Screen parent);
+    default void openConfigScreen(Screen parent) {
+        MinecraftClient.getInstance().openScreen(getConfigScreen(parent));
+    }
     
     /**
      * Gets the config screen

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

@@ -11,6 +11,7 @@ import me.shedaniel.rei.gui.config.RecipeScreenType;
 import me.shedaniel.rei.gui.config.SearchFieldLocation;
 import me.shedaniel.rei.impl.ConfigObjectImpl;
 import net.minecraft.client.util.InputUtil;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
@@ -24,6 +25,8 @@ public interface ConfigObject {
         return ConfigManager.getInstance().getConfig();
     }
     
+    @Deprecated
+    @ApiStatus.ScheduledForRemoval
     boolean isLighterButtonHover();
     
     boolean isOverlayVisible();
@@ -125,7 +128,7 @@ public interface ConfigObject {
     double getEntrySize();
     
     @Deprecated
-    abstract ConfigObjectImpl.General getGeneral();
+    ConfigObjectImpl.General getGeneral();
     
     boolean isUsingCompactTabs();
     

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

@@ -10,7 +10,7 @@ import net.minecraft.util.ActionResult;
 public interface DisplayVisibilityHandler {
     
     /**
-     * Gets the priority of the handler
+     * Gets the priority of the handler, the higher the priority, the earlier this is called.
      *
      * @return the priority
      */

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

@@ -9,6 +9,7 @@ import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.utils.CollectionUtils;
 import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Arrays;
 import java.util.Collection;
@@ -60,6 +61,7 @@ public interface EntryRegistry {
      * @param checkAlreadyContains whether the list should check if it is already on the list
      */
     @Deprecated
+    @ApiStatus.Internal
     void registerEntryAfter(EntryStack afterEntry, EntryStack stack, boolean checkAlreadyContains);
     
     

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

@@ -8,7 +8,6 @@ package me.shedaniel.rei.api;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
 import me.shedaniel.math.api.Rectangle;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.widget.QueuedTooltip;
 import me.shedaniel.rei.impl.EmptyEntryStack;
 import me.shedaniel.rei.impl.FluidEntryStack;
@@ -22,8 +21,9 @@ import net.minecraft.nbt.CompoundTag;
 import net.minecraft.nbt.StringNbtReader;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.registry.Registry;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
@@ -53,8 +53,7 @@ public interface EntryStack {
         return new ItemEntryStack(new ItemStack(item));
     }
     
-    @Internal
-    @Deprecated
+    @ApiStatus.Internal
     static EntryStack readFromJson(JsonElement jsonElement) {
         try {
             JsonObject obj = jsonElement.getAsJsonObject();
@@ -74,8 +73,7 @@ public interface EntryStack {
         }
     }
     
-    @Internal
-    @Deprecated
+    @ApiStatus.Internal
     @Nullable
     default JsonElement toJson() {
         try {
@@ -86,9 +84,12 @@ public interface EntryStack {
                     obj1.addProperty("nbt", getItemStack().toTag(new CompoundTag()).toString());
                     return obj1;
                 case FLUID:
+                    Optional<Identifier> optionalIdentifier = getIdentifier();
+                    if (!optionalIdentifier.isPresent())
+                        throw new NullPointerException("Invalid Fluid: " + toString());
                     JsonObject obj2 = new JsonObject();
                     obj2.addProperty("type", "fluid");
-                    obj2.addProperty("id", getIdentifier().get().toString());
+                    obj2.addProperty("id", optionalIdentifier.get().toString());
                     return obj2;
                 case EMPTY:
                     JsonObject obj3 = new JsonObject();
@@ -173,8 +174,7 @@ public interface EntryStack {
     
     <T> T get(Settings<T> settings);
     
-    @Nullable
-    QueuedTooltip getTooltip(int mouseX, int mouseY);
+    @Nullable QueuedTooltip getTooltip(int mouseX, int mouseY);
     
     void render(Rectangle bounds, int mouseX, int mouseY, float delta);
     
@@ -193,8 +193,8 @@ public interface EntryStack {
         public static final Settings<Supplier<Boolean>> TOOLTIP_ENABLED = new Settings<>(TRUE);
         public static final Settings<Supplier<Boolean>> TOOLTIP_APPEND_MOD = new Settings<>(TRUE);
         public static final Settings<Supplier<Boolean>> RENDER_COUNTS = new Settings<>(TRUE);
-        public static final Settings<Function<EntryStack, List<String>>> TOOLTIP_APPEND_EXTRA = new Settings<Function<EntryStack, List<String>>>(stack -> Collections.emptyList());
-        public static final Settings<Function<EntryStack, String>> COUNTS = new Settings<Function<EntryStack, String>>(stack -> null);
+        public static final Settings<Function<EntryStack, List<String>>> TOOLTIP_APPEND_EXTRA = new Settings<>(stack -> Collections.emptyList());
+        public static final Settings<Function<EntryStack, String>> COUNTS = new Settings<>(stack -> null);
         
         private T defaultValue;
         
@@ -208,7 +208,7 @@ public interface EntryStack {
         
         public static class Item {
             public static final Settings<Supplier<Boolean>> RENDER_ENCHANTMENT_GLINT = new Settings<>(TRUE);
-            @Deprecated public static final Settings<Supplier<Boolean>> RENDER_OVERLAY = RENDER_ENCHANTMENT_GLINT;
+            @Deprecated @ApiStatus.ScheduledForRemoval public static final Settings<Supplier<Boolean>> RENDER_OVERLAY = RENDER_ENCHANTMENT_GLINT;
             
             private Item() {
             }
@@ -216,7 +216,7 @@ public interface EntryStack {
         
         public static class Fluid {
             // Return null to disable
-            public static final Settings<Function<EntryStack, String>> AMOUNT_TOOLTIP = new Settings<Function<EntryStack, String>>(stack -> I18n.translate("tooltip.rei.fluid_amount", stack.getAmount()));
+            public static final Settings<Function<EntryStack, String>> AMOUNT_TOOLTIP = new Settings<>(stack -> I18n.translate("tooltip.rei.fluid_amount", stack.getAmount()));
             
             private Fluid() {
             }

+ 2 - 3
src/main/java/me/shedaniel/rei/api/ItemStackHook.java

@@ -5,10 +5,9 @@
 
 package me.shedaniel.rei.api;
 
-import me.shedaniel.rei.api.annotations.Internal;
+import org.jetbrains.annotations.ApiStatus;
 
-@Internal
-@Deprecated
+@ApiStatus.Internal
 public interface ItemStackHook {
     void rei_setRenderEnchantmentGlint(boolean b);
 }

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

@@ -6,6 +6,7 @@
 package me.shedaniel.rei.api;
 
 import me.shedaniel.rei.impl.ObjectHolderImpl;
+import org.jetbrains.annotations.ApiStatus;
 
 public interface ObjectHolder<T> {
     @SuppressWarnings("deprecation")
@@ -14,31 +15,37 @@ public interface ObjectHolder<T> {
     }
     
     @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();
     }

+ 2 - 3
src/main/java/me/shedaniel/rei/api/OptimalEntryStack.java

@@ -6,10 +6,9 @@
 package me.shedaniel.rei.api;
 
 import me.shedaniel.math.api.Rectangle;
-import me.shedaniel.rei.api.annotations.Internal;
+import org.jetbrains.annotations.ApiStatus;
 
-@Internal
-@Deprecated
+@ApiStatus.Internal
 public interface OptimalEntryStack {
     default void optimisedRenderStart(float delta) {
     }

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

@@ -8,12 +8,14 @@ package me.shedaniel.rei.api;
 import net.fabricmc.loader.api.SemanticVersion;
 import net.fabricmc.loader.util.version.VersionParsingException;
 import net.minecraft.util.Identifier;
+import org.jetbrains.annotations.ApiStatus;
 
 /**
  * Get base class of a REI plugin.
  */
 public interface REIPluginEntry {
     
+    @ApiStatus.OverrideOnly
     default SemanticVersion getMinimumVersion() throws VersionParsingException {
         return null;
     }

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

@@ -15,6 +15,7 @@ import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.gui.DrawableHelper;
 import net.minecraft.util.Identifier;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Collections;
 import java.util.List;
@@ -52,7 +53,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
      * @param recipe the recipe to render
      * @return the recipe renderer
      */
-    @SuppressWarnings("unchecked")
+    @ApiStatus.OverrideOnly
     default RecipeEntry getSimpleRenderer(T recipe) {
         return SimpleRecipeEntry.create(recipe::getInputEntries, recipe::getOutputEntries);
     }
@@ -61,9 +62,10 @@ public interface RecipeCategory<T extends RecipeDisplay> {
      * Setup the widgets for displaying the recipe
      *
      * @param recipeDisplaySupplier the supplier for getting the recipe
-     * @param bounds                the bounds of the display, configurable with overriding {@link RecipeCategory#getDisplaySettings()}
+     * @param bounds                the bounds of the display, configurable with overriding the width, height methods.
      * @return the list of widgets
      */
+    @ApiStatus.OverrideOnly
     default List<Widget> setupDisplay(Supplier<T> recipeDisplaySupplier, Rectangle bounds) {
         return Collections.singletonList(new RecipeBaseWidget(bounds));
     }
@@ -76,6 +78,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
      * @param mouseY the y coordinates for the mouse
      * @param delta  the delta
      */
+    @ApiStatus.OverrideOnly
     default void drawCategoryBackground(Rectangle bounds, int mouseX, int mouseY, float delta) {
         PanelWidget.render(bounds, -1);
         if (ScreenHelper.isDarkModeEnabled()) {
@@ -131,6 +134,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
      * @deprecated no longer used
      */
     @Deprecated
+    @ApiStatus.ScheduledForRemoval
     default boolean checkTags() {
         return false;
     }

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

@@ -40,7 +40,7 @@ public interface RecipeDisplay {
     Identifier getRecipeCategory();
     
     /**
-     * Gets the recipe location from datapack
+     * Gets the recipe location from datapack.
      *
      * @return the recipe location
      */

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

@@ -11,6 +11,7 @@ import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
 import net.minecraft.recipe.Recipe;
 import net.minecraft.recipe.RecipeManager;
 import net.minecraft.util.Identifier;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.List;
 import java.util.Map;
@@ -90,7 +91,7 @@ public interface RecipeHelper {
      */
     Map<RecipeCategory<?>, List<RecipeDisplay>> getRecipesFor(EntryStack stack);
     
-    RecipeCategory getCategory(Identifier identifier);
+    RecipeCategory<?> getCategory(Identifier identifier);
     
     /**
      * Gets the vanilla recipe manager
@@ -210,6 +211,7 @@ public interface RecipeHelper {
     
     List<RecipeHelper.ScreenClickArea> getScreenClickAreas();
     
+    @ApiStatus.Internal
     boolean arePluginsLoading();
     
     interface ScreenClickArea {

+ 2 - 0
src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java

@@ -8,9 +8,11 @@ package me.shedaniel.rei.api;
 import it.unimi.dsi.fastutil.ints.IntList;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.gui.widget.Widget;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.List;
 
 public interface TransferRecipeCategory<T extends RecipeDisplay> extends RecipeCategory<T> {
+    @ApiStatus.OverrideOnly
     void renderRedSlots(List<Widget> widgets, Rectangle bounds, T display, IntList redSlots);
 }

+ 0 - 16
src/main/java/me/shedaniel/rei/api/annotations/Experimental.java

@@ -1,16 +0,0 @@
-/*
- * Roughly Enough Items by Danielshe.
- * Licensed under the MIT License.
- */
-
-package me.shedaniel.rei.api.annotations;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.*;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
-public @interface Experimental {}

+ 0 - 16
src/main/java/me/shedaniel/rei/api/annotations/Internal.java

@@ -1,16 +0,0 @@
-/*
- * Roughly Enough Items by Danielshe.
- * Licensed under the MIT License.
- */
-
-package me.shedaniel.rei.api.annotations;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.*;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
-public @interface Internal {}

+ 0 - 16
src/main/java/me/shedaniel/rei/api/annotations/ToBeRemoved.java

@@ -1,16 +0,0 @@
-/*
- * Roughly Enough Items by Danielshe.
- * Licensed under the MIT License.
- */
-
-package me.shedaniel.rei.api.annotations;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.*;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
-public @interface ToBeRemoved {}

+ 9 - 0
src/main/java/me/shedaniel/rei/api/plugins/REIPluginV0.java

@@ -9,7 +9,9 @@ import me.shedaniel.rei.api.DisplayHelper;
 import me.shedaniel.rei.api.EntryRegistry;
 import me.shedaniel.rei.api.REIPluginEntry;
 import me.shedaniel.rei.api.RecipeHelper;
+import org.jetbrains.annotations.ApiStatus;
 
+@ApiStatus.OverrideOnly
 public interface REIPluginV0 extends REIPluginEntry {
     
     /**
@@ -17,6 +19,7 @@ public interface REIPluginV0 extends REIPluginEntry {
      *
      * @param entryRegistry the helper class
      */
+    @ApiStatus.OverrideOnly
     default void registerEntries(EntryRegistry entryRegistry) {
     }
     
@@ -25,6 +28,7 @@ public interface REIPluginV0 extends REIPluginEntry {
      *
      * @param recipeHelper the helper class
      */
+    @ApiStatus.OverrideOnly
     default void registerPluginCategories(RecipeHelper recipeHelper) {
     }
     
@@ -33,6 +37,7 @@ public interface REIPluginV0 extends REIPluginEntry {
      *
      * @param recipeHelper the helper class
      */
+    @ApiStatus.OverrideOnly
     default void registerRecipeDisplays(RecipeHelper recipeHelper) {
     }
     
@@ -41,6 +46,7 @@ public interface REIPluginV0 extends REIPluginEntry {
      *
      * @param displayHelper the helper class
      */
+    @ApiStatus.OverrideOnly
     default void registerBounds(DisplayHelper displayHelper) {
     }
     
@@ -49,12 +55,15 @@ public interface REIPluginV0 extends REIPluginEntry {
      *
      * @param recipeHelper the helper class
      */
+    @ApiStatus.OverrideOnly
     default void registerOthers(RecipeHelper recipeHelper) {
     }
     
+    @ApiStatus.OverrideOnly
     default void preRegister() {
     }
     
+    @ApiStatus.OverrideOnly
     default void postRegister() {
     }
     

+ 2 - 3
src/main/java/me/shedaniel/rei/gui/ConfigReloadingScreen.java

@@ -6,14 +6,13 @@
 package me.shedaniel.rei.gui;
 
 import me.shedaniel.rei.api.RecipeHelper;
-import me.shedaniel.rei.api.annotations.Internal;
 import net.minecraft.client.gui.screen.Screen;
 import net.minecraft.client.resource.language.I18n;
 import net.minecraft.client.util.NarratorManager;
 import net.minecraft.util.Util;
+import org.jetbrains.annotations.ApiStatus;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class ConfigReloadingScreen extends Screen {
     
     private Screen parent;

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

@@ -37,10 +37,12 @@ import net.minecraft.util.ActionResult;
 import net.minecraft.util.Identifier;
 import net.minecraft.world.GameMode;
 import org.apache.logging.log4j.util.TriConsumer;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.*;
 
+@ApiStatus.Internal
 public class ContainerScreenOverlay extends WidgetWithBounds {
     
     private static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
@@ -118,9 +120,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         }
         ScreenHelper.getSearchField().getBounds().setBounds(getTextFieldArea());
         this.widgets.add(ScreenHelper.getSearchField());
-        ScreenHelper.getSearchField().setChangedListener(s -> {
-            ENTRY_LIST_WIDGET.updateSearch(s);
-        });
+        ScreenHelper.getSearchField().setChangedListener(ENTRY_LIST_WIDGET::updateSearch);
         if (!ConfigObject.getInstance().isEntryListWidgetScrolled()) {
             widgets.add(buttonLeft = new ButtonWidget(new Rectangle(rectangle.x, rectangle.y + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + 5, 16, 16), I18n.translate("text.rei.left_arrow")) {
                 @Override

+ 3 - 7
src/main/java/me/shedaniel/rei/gui/OverlaySearchField.java

@@ -9,7 +9,6 @@ import com.google.common.collect.Lists;
 import com.mojang.blaze3d.systems.RenderSystem;
 import me.shedaniel.math.api.Point;
 import me.shedaniel.math.impl.PointHelper;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.widget.TextFieldWidget;
 import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.MinecraftClient;
@@ -18,11 +17,11 @@ import net.minecraft.client.sound.PositionedSoundInstance;
 import net.minecraft.client.util.InputUtil;
 import net.minecraft.sound.SoundEvents;
 import net.minecraft.util.Pair;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.List;
 
-@Internal
-@Deprecated
+@ApiStatus.Internal
 public class OverlaySearchField extends TextFieldWidget {
     
     public static boolean isSearching = false;
@@ -43,8 +42,7 @@ public class OverlaySearchField extends TextFieldWidget {
         super.setFocused(boolean_1);
     }
     
-    @Deprecated
-    @Internal
+    @ApiStatus.Internal
     public void addToHistory(String text) {
         if (!text.isEmpty()) {
             history.removeIf(str -> str.equalsIgnoreCase(text));
@@ -54,7 +52,6 @@ public class OverlaySearchField extends TextFieldWidget {
         }
     }
     
-    @SuppressWarnings("deprecation")
     public void laterRender(int int_1, int int_2, float float_1) {
         RenderSystem.disableDepthTest();
         setEditableColor(ContainerScreenOverlay.getEntryListWidget().getAllStacks().isEmpty() && !getText().isEmpty() ? 16733525 : isSearching ? -852212 : (containsMouse(PointHelper.fromMouse()) || isFocused()) ? (ScreenHelper.isDarkModeEnabled() ? -17587 : -1) : -6250336);
@@ -71,7 +68,6 @@ public class OverlaySearchField extends TextFieldWidget {
             this.font.drawWithShadow(this.font.trimToWidth(this.getSuggestion(), this.getWidth()), x, y, -6250336);
     }
     
-    @SuppressWarnings("deprecation")
     @Override
     public void renderBorder() {
         boolean hasError = ContainerScreenOverlay.getEntryListWidget().getAllStacks().isEmpty() && !getText().isEmpty();

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

@@ -11,7 +11,6 @@ import me.shedaniel.clothconfig2.gui.widget.DynamicNewSmoothScrollingEntryListWi
 import me.shedaniel.clothconfig2.impl.EasingMethod;
 import me.shedaniel.math.api.Point;
 import me.shedaniel.math.api.Rectangle;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.config.RecipeScreenType;
 import me.shedaniel.rei.gui.widget.ButtonWidget;
 import me.shedaniel.rei.gui.widget.LabelWidget;
@@ -27,16 +26,18 @@ import net.minecraft.text.TranslatableText;
 import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Collections;
 import java.util.List;
 
-@Internal
-@Deprecated
+@ApiStatus.Internal
 public class PreRecipeViewingScreen extends Screen {
     
     private static final Identifier IDENTIFIER = new Identifier("roughlyenoughitems", "textures/gui/screenshot.png");
     private final List<Widget> widgets;
+    protected long start;
+    protected long duration;
     private boolean isSet;
     private boolean original;
     private double frame = 0;
@@ -44,8 +45,6 @@ public class PreRecipeViewingScreen extends Screen {
     private BooleanConsumer callback;
     private Screen parent;
     private boolean showTips;
-    protected long start;
-    protected long duration;
     
     public PreRecipeViewingScreen(Screen parent, RecipeScreenType type, boolean showTips, BooleanConsumer callback) {
         super(new TranslatableText("text.rei.recipe_screen_type.selection"));

+ 34 - 36
src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java

@@ -11,7 +11,6 @@ import me.shedaniel.math.api.Point;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.math.impl.PointHelper;
 import me.shedaniel.rei.api.*;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.widget.*;
 import me.shedaniel.rei.impl.ScreenHelper;
 import me.shedaniel.rei.utils.CollectionUtils;
@@ -26,17 +25,16 @@ import net.minecraft.text.LiteralText;
 import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.*;
 import java.util.function.Supplier;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class RecipeViewingScreen extends Screen {
     
     public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
-    private int tabsPerPage = 5;
     private final List<Widget> preWidgets;
     private final List<Widget> widgets;
     private final List<TabWidget> tabs;
@@ -48,6 +46,7 @@ public class RecipeViewingScreen extends Screen {
     public int largestWidth, largestHeight;
     public boolean choosePageActivated;
     public RecipeChoosePageWidget recipeChoosePageWidget;
+    private int tabsPerPage = 5;
     private Rectangle bounds;
     @Nullable private CategoryBaseWidget workingStationsBaseWidget;
     private RecipeCategory<RecipeDisplay> selectedCategory;
@@ -72,6 +71,23 @@ public class RecipeViewingScreen extends Screen {
         this.choosePageActivated = false;
     }
     
+    static void transformNotice(List<Widget> setupDisplay, EntryStack mainStackToNotice) {
+        if (mainStackToNotice.isEmpty())
+            return;
+        for (Widget widget : setupDisplay) {
+            if (widget instanceof EntryWidget) {
+                EntryWidget entry = (EntryWidget) widget;
+                if (entry.entries().size() > 1) {
+                    EntryStack stack = CollectionUtils.firstOrNullEqualsAll(entry.entries(), mainStackToNotice);
+                    if (stack != null) {
+                        entry.clearStacks();
+                        entry.entry(stack);
+                    }
+                }
+            }
+        }
+    }
+    
     public void addMainStackToNotice(EntryStack stack) {
         this.mainStackToNotice = stack;
     }
@@ -343,36 +359,6 @@ public class RecipeViewingScreen extends Screen {
         children.addAll(preWidgets);
     }
     
-    static void transformNotice(List<Widget> setupDisplay, EntryStack mainStackToNotice) {
-        if (mainStackToNotice.isEmpty())
-            return;
-        for (Widget widget : setupDisplay) {
-            if (widget instanceof EntryWidget) {
-                EntryWidget entry = (EntryWidget) widget;
-                if (entry.entries().size() > 1) {
-                    EntryStack stack = CollectionUtils.firstOrNullEqualsAll(entry.entries(), mainStackToNotice);
-                    if (stack != null) {
-                        entry.clearStacks();
-                        entry.entry(stack);
-                    }
-                }
-            }
-        }
-    }
-    
-    public static class WorkstationSlotWidget extends EntryWidget {
-        public WorkstationSlotWidget(int x, int y, List<EntryStack> widgets) {
-            super(new Point(x, y));
-            entries(widgets);
-            noBackground();
-        }
-        
-        @Override
-        public boolean containsMouse(double mouseX, double mouseY) {
-            return getInnerBounds().contains(mouseX, mouseY);
-        }
-    }
-    
     public List<Widget> getWidgets() {
         return widgets;
     }
@@ -398,7 +384,6 @@ public class RecipeViewingScreen extends Screen {
         return categoryPages;
     }
     
-    @SuppressWarnings("deprecation")
     private int getRecipesPerPage() {
         if (selectedCategory.getFixedRecipesPerPage() > 0)
             return selectedCategory.getFixedRecipesPerPage() - 1;
@@ -534,4 +519,17 @@ public class RecipeViewingScreen extends Screen {
         return super.getFocused();
     }
     
+    public static class WorkstationSlotWidget extends EntryWidget {
+        public WorkstationSlotWidget(int x, int y, List<EntryStack> widgets) {
+            super(new Point(x, y));
+            entries(widgets);
+            noBackground();
+        }
+        
+        @Override
+        public boolean containsMouse(double mouseX, double mouseY) {
+            return getInnerBounds().contains(mouseX, mouseY);
+        }
+    }
+    
 }

+ 5 - 15
src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java

@@ -14,7 +14,6 @@ import me.shedaniel.math.api.Point;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.math.impl.PointHelper;
 import me.shedaniel.rei.api.*;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.entries.RecipeEntry;
 import me.shedaniel.rei.gui.widget.*;
 import me.shedaniel.rei.impl.ScreenHelper;
@@ -32,17 +31,16 @@ import net.minecraft.text.LiteralText;
 import net.minecraft.text.TranslatableText;
 import net.minecraft.util.Formatting;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class VillagerRecipeViewingScreen extends Screen {
     
-    private int tabsPerPage = 8;
     private final Map<RecipeCategory<?>, List<RecipeDisplay>> categoryMap;
     private final List<RecipeCategory<?>> categories;
     private final List<Widget> widgets;
@@ -50,6 +48,7 @@ public class VillagerRecipeViewingScreen extends Screen {
     private final List<RecipeEntry> recipeRenderers;
     private final List<TabWidget> tabs;
     public Rectangle bounds, scrollListBounds;
+    private int tabsPerPage = 8;
     private int selectedCategoryIndex, selectedRecipeIndex;
     private double scroll;
     private double target;
@@ -244,14 +243,6 @@ public class VillagerRecipeViewingScreen extends Screen {
         ScreenHelper.getLastOverlay().init();
     }
     
-    private final double clamp(double v) {
-        return clamp(v, 200);
-    }
-    
-    private final double clamp(double v, double clampExtension) {
-        return MathHelper.clamp(v, -clampExtension, getMaxScroll() + clampExtension);
-    }
-    
     private double getMaxScroll() {
         return Math.max(0, this.getMaxScrollPosition() - (scrollListBounds.height - 2));
     }
@@ -289,7 +280,7 @@ public class VillagerRecipeViewingScreen extends Screen {
     }
     
     public void scrollTo(double value, boolean animated, long duration) {
-        target = clamp(value);
+        target = ClothConfigInitializer.clamp(value, getMaxScroll());
         
         if (animated) {
             start = System.currentTimeMillis();
@@ -366,8 +357,7 @@ public class VillagerRecipeViewingScreen extends Screen {
         ScreenHelper.getLastOverlay().render(mouseX, mouseY, delta);
         RenderSystem.pushMatrix();
         ScissorsHandler.INSTANCE.scissor(new Rectangle(0, scrollListBounds.y + 1, width, scrollListBounds.height - 2));
-        for (int i = 0; i < buttonWidgets.size(); i++) {
-            ButtonWidget buttonWidget = buttonWidgets.get(i);
+        for (ButtonWidget buttonWidget : buttonWidgets) {
             buttonWidget.getBounds().y = scrollListBounds.y + 1 + yOffset - (int) scroll;
             if (buttonWidget.getBounds().getMaxY() > scrollListBounds.getMinY() && buttonWidget.getBounds().getMinY() < scrollListBounds.getMaxY()) {
                 buttonWidget.render(mouseX, mouseY, delta);

+ 2 - 0
src/main/java/me/shedaniel/rei/gui/config/ItemCheatingMode.java

@@ -6,9 +6,11 @@
 package me.shedaniel.rei.gui.config;
 
 import net.minecraft.client.resource.language.I18n;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Locale;
 
+@ApiStatus.Internal
 public enum ItemCheatingMode {
     REI_LIKE,
     JEI_LIKE;

+ 3 - 0
src/main/java/me/shedaniel/rei/gui/config/ItemListOrdering.java

@@ -5,6 +5,9 @@
 
 package me.shedaniel.rei.gui.config;
 
+import org.jetbrains.annotations.ApiStatus;
+
+@ApiStatus.Internal
 public enum ItemListOrdering {
     
     registry("ordering.rei.registry"),

+ 2 - 0
src/main/java/me/shedaniel/rei/gui/config/ItemListOrderingConfig.java

@@ -6,7 +6,9 @@
 package me.shedaniel.rei.gui.config;
 
 import net.minecraft.client.resource.language.I18n;
+import org.jetbrains.annotations.ApiStatus;
 
+@ApiStatus.Internal
 public enum ItemListOrderingConfig {
     REGISTRY_ASCENDING(ItemListOrdering.registry, true),
     NAME_ASCENDING(ItemListOrdering.name, true),

+ 2 - 0
src/main/java/me/shedaniel/rei/gui/config/RecipeScreenType.java

@@ -6,9 +6,11 @@
 package me.shedaniel.rei.gui.config;
 
 import net.minecraft.client.resource.language.I18n;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Locale;
 
+@ApiStatus.Internal
 public enum RecipeScreenType {
     UNSET,
     ORIGINAL,

+ 2 - 0
src/main/java/me/shedaniel/rei/gui/config/SearchFieldLocation.java

@@ -6,9 +6,11 @@
 package me.shedaniel.rei.gui.config;
 
 import net.minecraft.client.resource.language.I18n;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Locale;
 
+@ApiStatus.Internal
 public enum SearchFieldLocation {
     CENTER,
     BOTTOM_SIDE,

+ 2 - 0
src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java

@@ -9,7 +9,9 @@ import me.shedaniel.clothconfig2.gui.widget.DynamicNewSmoothScrollingEntryListWi
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.DrawableHelper;
 import net.minecraft.text.Text;
+import org.jetbrains.annotations.ApiStatus;
 
+@ApiStatus.Internal
 public class CreditsEntryListWidget extends DynamicNewSmoothScrollingEntryListWidget<CreditsEntryListWidget.CreditsItem> {
     
     private boolean inFocus;

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

@@ -15,10 +15,12 @@ import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
 import net.minecraft.client.gui.widget.AbstractPressableButtonWidget;
 import net.minecraft.client.resource.language.I18n;
 import net.minecraft.text.LiteralText;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.List;
 import java.util.stream.Collectors;
 
+@ApiStatus.Internal
 public class CreditsScreen extends Screen {
     
     private Screen parent;

+ 2 - 0
src/main/java/me/shedaniel/rei/gui/entries/RecipeEntry.java

@@ -7,7 +7,9 @@ package me.shedaniel.rei.gui.entries;
 
 import me.shedaniel.rei.gui.widget.QueuedTooltip;
 import me.shedaniel.rei.impl.RenderingEntry;
+import org.jetbrains.annotations.ApiStatus;
 
+@ApiStatus.OverrideOnly
 public abstract class RecipeEntry extends RenderingEntry {
     public abstract QueuedTooltip getTooltip(int mouseX, int mouseY);
     

+ 3 - 1
src/main/java/me/shedaniel/rei/gui/entries/SimpleRecipeEntry.java

@@ -15,8 +15,9 @@ import net.minecraft.client.MinecraftClient;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.Pair;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.Comparator;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -30,6 +31,7 @@ public class SimpleRecipeEntry extends RecipeEntry {
     private List<EntryWidget> inputWidgets;
     private EntryWidget outputWidget;
     
+    @ApiStatus.Internal
     protected SimpleRecipeEntry(List<List<EntryStack>> input, List<EntryStack> output) {
         List<Pair<List<EntryStack>, AtomicInteger>> newList = Lists.newArrayList();
         List<Pair<List<EntryStack>, Integer>> a = CollectionUtils.map(input, stacks -> new Pair<>(stacks, stacks.stream().map(EntryStack::getAmount).max(Integer::compareTo).orElse(1)));

+ 3 - 2
src/main/java/me/shedaniel/rei/gui/toast/CopyRecipeIdentifierToast.java

@@ -10,9 +10,10 @@ import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.toast.Toast;
 import net.minecraft.client.toast.ToastManager;
 import net.minecraft.util.Identifier;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
-
+@ApiStatus.Internal
 public class CopyRecipeIdentifierToast implements Toast {
     
     protected static final Identifier TOASTS_TEX = new Identifier("roughlyenoughitems", "textures/gui/toasts.png");

+ 6 - 7
src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java

@@ -11,7 +11,6 @@ import me.shedaniel.math.api.Point;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.math.impl.PointHelper;
 import me.shedaniel.rei.api.*;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.toast.CopyRecipeIdentifierToast;
 import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.MinecraftClient;
@@ -20,6 +19,7 @@ import net.minecraft.client.resource.language.I18n;
 import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.Lazy;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.time.LocalDateTime;
 import java.util.List;
@@ -28,11 +28,10 @@ import java.util.UUID;
 import java.util.function.Supplier;
 import java.util.stream.Collectors;
 
-@Internal
-@Deprecated
+@ApiStatus.Internal
 public class AutoCraftingButtonWidget extends ButtonWidget {
     
-    private static final Lazy<Boolean> IS_YOG = new Lazy(() -> {
+    private static final Lazy<Boolean> IS_YOG = new Lazy<>(() -> {
         try {
             if (MinecraftClient.getInstance().getSession().getProfile().getId().equals(UUID.fromString("f9546389-9415-4358-9c29-2c26b25bff5b")))
                 return true;
@@ -54,7 +53,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
     public AutoCraftingButtonWidget(Rectangle displayBounds, Rectangle rectangle, String text, Supplier<RecipeDisplay> displaySupplier, List<Widget> setupDisplay, RecipeCategory<?> recipeCategory) {
         super(rectangle, text);
         this.displayBounds = displayBounds;
-        this.displaySupplier = () -> displaySupplier.get();
+        this.displaySupplier = displaySupplier;
         Optional<Identifier> recipe = displaySupplier.get().getRecipeLocation();
         extraTooltip = recipe.isPresent() ? I18n.translate("text.rei.recipe_id", Formatting.GRAY.toString(), recipe.get().toString()) : "";
         this.containerScreen = ScreenHelper.getLastContainerScreen();
@@ -124,7 +123,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
         errorTooltip = error == null || error.isEmpty() ? null : Lists.newArrayList();
         if (errorTooltip != null) {
             for (String s : error) {
-                if (!errorTooltip.stream().anyMatch(ss -> ss.equalsIgnoreCase(s)))
+                if (errorTooltip.stream().noneMatch(ss -> ss.equalsIgnoreCase(s)))
                     errorTooltip.add(s);
             }
         }
@@ -150,7 +149,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
     
     @Override
     protected int getTextureId(boolean boolean_1) {
-        return !visible ? 0 : boolean_1 && enabled ? (ConfigObject.getInstance().isLighterButtonHover() ? 4 : 3) : 1;
+        return !visible ? 0 : boolean_1 && enabled ? 4 : 1;
     }
     
     @Override

+ 1 - 5
src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java

@@ -8,8 +8,6 @@ package me.shedaniel.rei.gui.widget;
 import com.mojang.blaze3d.systems.RenderSystem;
 import me.shedaniel.math.api.Point;
 import me.shedaniel.math.api.Rectangle;
-import me.shedaniel.rei.api.ConfigObject;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.gui.Element;
 import net.minecraft.client.sound.PositionedSoundInstance;
@@ -23,8 +21,6 @@ import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
 
-@Internal
-@Deprecated
 public abstract class ButtonWidget extends WidgetWithBounds {
     
     protected static final Identifier BUTTON_LOCATION = new Identifier("roughlyenoughitems", "textures/gui/button.png");
@@ -61,7 +57,7 @@ public abstract class ButtonWidget extends WidgetWithBounds {
         if (!this.enabled) {
             int_1 = 0;
         } else if (boolean_1) {
-            int_1 = ConfigObject.getInstance().isLighterButtonHover() ? 4 : 3; // 2 is the old blue highlight, 3 is the 1.15 outline, 4 is the 1.15 online + light hover
+            int_1 = 4; // 2 is the old blue highlight, 3 is the 1.15 outline, 4 is the 1.15 online + light hover
         }
         
         return int_1;

+ 2 - 3
src/main/java/me/shedaniel/rei/gui/widget/ClickableActionedLabelWidget.java

@@ -6,12 +6,11 @@
 package me.shedaniel.rei.gui.widget;
 
 import me.shedaniel.math.api.Point;
-import me.shedaniel.rei.api.annotations.Internal;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.function.Consumer;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class ClickableActionedLabelWidget extends ClickableLabelWidget {
     private Consumer<ClickableLabelWidget> onClicked;
     

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

@@ -7,6 +7,7 @@ package me.shedaniel.rei.gui.widget;
 
 import me.shedaniel.math.api.Point;
 import me.shedaniel.rei.impl.ScreenHelper;
+import org.jetbrains.annotations.ApiStatus;
 
 public abstract class ClickableLabelWidget extends LabelWidget {
     
@@ -14,23 +15,23 @@ public abstract class ClickableLabelWidget extends LabelWidget {
     private boolean clickable = true;
     private int hoveredColor;
     
-    @Deprecated
+    @ApiStatus.Internal
     public ClickableLabelWidget(int x, int y, String text, boolean clickable) {
         this(new Point(x, y), text, clickable);
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public ClickableLabelWidget(int x, int y, String text) {
         this(new Point(x, y), text, true);
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public ClickableLabelWidget(Point point, String text, boolean clickable) {
         this(point, text);
         clickable(clickable);
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public ClickableLabelWidget(Point point, String text) {
         super(point, text);
         this.hoveredColor = ScreenHelper.isDarkModeEnabled() ? -1 : 0xFF66FFCC;

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

@@ -8,18 +8,17 @@ package me.shedaniel.rei.gui.widget;
 import com.mojang.blaze3d.systems.RenderSystem;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.ConfigManager;
-import me.shedaniel.rei.api.annotations.Internal;
 import net.minecraft.block.Blocks;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.render.item.ItemRenderer;
 import net.minecraft.client.resource.language.I18n;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.Identifier;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Optional;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public abstract class CraftableToggleButtonWidget extends ButtonWidget {
     
     public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");

+ 2 - 3
src/main/java/me/shedaniel/rei/gui/widget/DraggableWidget.java

@@ -8,13 +8,12 @@ package me.shedaniel.rei.gui.widget;
 import me.shedaniel.math.api.Point;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.math.impl.PointHelper;
-import me.shedaniel.rei.api.annotations.Internal;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.Element;
 import net.minecraft.client.util.Window;
+import org.jetbrains.annotations.ApiStatus;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public abstract class DraggableWidget extends WidgetWithBounds {
     
     public boolean dragged = false;

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

@@ -15,7 +15,6 @@ import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.math.impl.PointHelper;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.*;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.ContainerScreenOverlay;
 import me.shedaniel.rei.gui.config.ItemListOrdering;
 import me.shedaniel.rei.impl.ScreenHelper;
@@ -36,14 +35,15 @@ import net.minecraft.util.ActionResult;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 import org.apache.commons.lang3.StringUtils;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.*;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.function.Supplier;
 import java.util.stream.Collectors;
 
-@Internal
+@ApiStatus.Internal
 public class EntryListWidget extends WidgetWithBounds {
     
     static final Supplier<Boolean> RENDER_ENCHANTMENT_GLINT = ConfigObject.getInstance()::doesRenderEntryEnchantmentGlint;
@@ -604,7 +604,7 @@ public class EntryListWidget extends WidgetWithBounds {
             favoritesListWidget.updateEntriesPosition();
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public List<EntryStack> getAllStacks() {
         return allStacks;
     }

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

@@ -14,7 +14,6 @@ import me.shedaniel.math.api.Point;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.math.impl.PointHelper;
 import me.shedaniel.rei.api.*;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.config.ItemListOrdering;
 import me.shedaniel.rei.impl.ScreenHelper;
 import me.shedaniel.rei.utils.CollectionUtils;
@@ -23,14 +22,15 @@ import net.minecraft.client.render.BufferBuilder;
 import net.minecraft.client.render.Tessellator;
 import net.minecraft.client.render.VertexFormats;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.Collections;
 import java.util.List;
 
 import static me.shedaniel.rei.gui.widget.EntryListWidget.*;
 
-@Internal
+@ApiStatus.Internal
 public class FavoritesListWidget extends WidgetWithBounds {
     protected double target;
     protected double scroll;

+ 5 - 4
src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java

@@ -9,6 +9,7 @@ import me.shedaniel.math.api.Point;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.gui.Element;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Collections;
 import java.util.List;
@@ -25,12 +26,12 @@ public class LabelWidget extends WidgetWithBounds {
     private boolean centered = true;
     private Supplier<String> tooltipSupplier;
     
-    @Deprecated
+    @ApiStatus.Internal
     public LabelWidget(int x, int y, String text) {
         this(new Point(x, y), text);
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public LabelWidget(Point point, String text) {
         this.pos = point;
         this.text = text;
@@ -136,9 +137,9 @@ public class LabelWidget extends WidgetWithBounds {
         Point pos = getPosition();
         if (isCentered()) {
             if (hasShadows)
-                font.drawWithShadow(text, pos.x - width / 2, pos.y, defaultColor);
+                font.drawWithShadow(text, pos.x - width / 2f, pos.y, defaultColor);
             else
-                font.draw(text, pos.x - width / 2, pos.y, defaultColor);
+                font.draw(text, pos.x - width / 2f, pos.y, defaultColor);
         } else {
             if (hasShadows)
                 font.drawWithShadow(text, pos.x, pos.y, defaultColor);

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

@@ -28,6 +28,12 @@ public class PanelWidget extends WidgetWithBounds {
         this.bounds = bounds;
     }
     
+    public static void render(Rectangle bounds, int color) {
+        TEMP.bounds = bounds;
+        TEMP.color = color;
+        TEMP.render();
+    }
+    
     @Override
     public Rectangle getBounds() {
         return bounds;
@@ -38,12 +44,6 @@ public class PanelWidget extends WidgetWithBounds {
         return Collections.emptyList();
     }
     
-    public static void render(Rectangle bounds, int color) {
-        TEMP.bounds = bounds;
-        TEMP.color = color;
-        TEMP.render();
-    }
-    
     public void render() {
         render(0, 0, 0);
     }
@@ -60,10 +60,10 @@ public class PanelWidget extends WidgetWithBounds {
     public void render(int mouseX, int mouseY, float delta) {
         if (!isRendering())
             return;
+        float alpha = ((color >> 24) & 0xFF) / 255f;
         float red = ((color >> 16) & 0xFF) / 255f;
         float green = ((color >> 8) & 0xFF) / 255f;
-        float blue = ((color >> 0) & 0xFF) / 255f;
-        float alpha = ((color >> 32) & 0xFF) / 255f;
+        float blue = (color & 0xFF) / 255f;
         RenderSystem.color4f(red, green, blue, alpha);
         minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? CHEST_GUI_TEXTURE_DARK : CHEST_GUI_TEXTURE);
         int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height;

+ 3 - 2
src/main/java/me/shedaniel/rei/gui/widget/QueuedTooltip.java

@@ -9,6 +9,7 @@ package me.shedaniel.rei.gui.widget;
 import com.google.common.collect.Lists;
 import me.shedaniel.math.api.Point;
 import me.shedaniel.math.impl.PointHelper;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.List;
 import java.util.function.Consumer;
@@ -40,13 +41,13 @@ public class QueuedTooltip {
         return QueuedTooltip.create(PointHelper.fromMouse(), text);
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public QueuedTooltip setSpecialRenderer(Consumer<QueuedTooltip> consumer) {
         this.consumer = consumer;
         return this;
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public Consumer<QueuedTooltip> getConsumer() {
         return consumer;
     }

+ 9 - 2
src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java

@@ -11,6 +11,7 @@ import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.Element;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Collections;
 import java.util.List;
@@ -18,9 +19,10 @@ import java.util.List;
 public class RecipeArrowWidget extends WidgetWithBounds {
     
     private int x, y;
+    private double time = 250d;
     private boolean animated;
     
-    @Deprecated
+    @ApiStatus.Internal
     public RecipeArrowWidget(int x, int y, boolean animated) {
         this.x = x;
         this.y = y;
@@ -31,6 +33,11 @@ public class RecipeArrowWidget extends WidgetWithBounds {
         return new RecipeArrowWidget(point.x, point.y, animated);
     }
     
+    public RecipeArrowWidget time(double time) {
+        this.time = time;
+        return this;
+    }
+    
     @Override
     public Rectangle getBounds() {
         return new Rectangle(x, y, 24, 17);
@@ -41,7 +48,7 @@ public class RecipeArrowWidget extends WidgetWithBounds {
         MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
         blit(x, y, 106, 91, 24, 17);
         if (animated) {
-            int width = MathHelper.ceil((System.currentTimeMillis() / 250 % 24d) / 1f);
+            int width = MathHelper.ceil((System.currentTimeMillis() / (time / 24) % 24d) / 1f);
             blit(x, y, 82, 91, width, 17);
         }
     }

+ 2 - 3
src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java

@@ -9,20 +9,19 @@ import com.google.common.collect.Lists;
 import com.mojang.blaze3d.systems.RenderSystem;
 import me.shedaniel.math.api.Point;
 import me.shedaniel.math.api.Rectangle;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.RecipeViewingScreen;
 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.util.math.MathHelper;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class RecipeChoosePageWidget extends DraggableWidget {
     
     private int currentPage;

+ 2 - 3
src/main/java/me/shedaniel/rei/gui/widget/ReloadConfigButtonWidget.java

@@ -5,11 +5,10 @@
 
 package me.shedaniel.rei.gui.widget;
 
-import me.shedaniel.rei.api.annotations.Internal;
 import net.minecraft.client.gui.widget.ButtonWidget;
+import org.jetbrains.annotations.ApiStatus;
 
-@Internal
-@Deprecated
+@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);

+ 2 - 3
src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java

@@ -9,16 +9,15 @@ import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.ClientHelper;
 import me.shedaniel.rei.api.EntryStack;
 import me.shedaniel.rei.api.RecipeCategory;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Collections;
 import java.util.List;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class TabWidget extends WidgetWithBounds {
     
     public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");

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

@@ -11,6 +11,7 @@ public abstract class WidgetWithBounds extends Widget {
     
     public abstract Rectangle getBounds();
     
+    @Override
     public boolean containsMouse(double mouseX, double mouseY) {
         return getBounds().contains(mouseX, mouseY);
     }

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

@@ -7,13 +7,14 @@ package me.shedaniel.rei.impl;
 
 import me.shedaniel.rei.api.EntryStack;
 import net.minecraft.client.gui.DrawableHelper;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.HashMap;
 import java.util.Map;
 
-@Deprecated
+@ApiStatus.Internal
 public abstract class AbstractEntryStack extends DrawableHelper implements EntryStack {
-    private Map<Settings, Object> settings = new HashMap<>();
+    private Map<Settings<?>, Object> settings = new HashMap<>();
     
     @Override
     public <T> EntryStack setting(Settings<T> settings, T value) {
@@ -33,7 +34,7 @@ public abstract class AbstractEntryStack extends DrawableHelper implements Entry
         return this;
     }
     
-    protected Map<Settings, Object> getSettings() {
+    protected Map<Settings<?>, Object> getSettings() {
         return settings;
     }
     

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

@@ -9,18 +9,17 @@ import com.google.common.collect.Lists;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.BaseBoundsHandler;
 import me.shedaniel.rei.api.DisplayHelper;
-import me.shedaniel.rei.api.annotations.Internal;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.screen.Screen;
 import net.minecraft.util.ActionResult;
 import net.minecraft.util.Pair;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Comparator;
 import java.util.List;
 import java.util.function.Supplier;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class BaseBoundsHandlerImpl implements BaseBoundsHandler {
     
     private static final Comparator<? super Rectangle> RECTANGLE_COMPARER = Comparator.comparingLong(Rectangle::hashCode);
@@ -70,7 +69,7 @@ public class BaseBoundsHandlerImpl implements BaseBoundsHandler {
     }
     
     private long currentHashCode(boolean isOnRightSide) {
-        DisplayHelper.DisplayBoundsHandler handler = DisplayHelper.getInstance().getResponsibleBoundsHandler(MinecraftClient.getInstance().currentScreen.getClass());
+        DisplayHelper.DisplayBoundsHandler<Screen> handler = (DisplayHelper.DisplayBoundsHandler<Screen>) DisplayHelper.getInstance().getResponsibleBoundsHandler(MinecraftClient.getInstance().currentScreen.getClass());
         return areasHashCode(isOnRightSide ? handler.getRightBounds(MinecraftClient.getInstance().currentScreen) : handler.getLeftBounds(MinecraftClient.getInstance().currentScreen), getExclusionZones(MinecraftClient.getInstance().currentScreen.getClass(), false));
     }
     

+ 2 - 3
src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java

@@ -13,7 +13,6 @@ import me.shedaniel.clothconfig2.api.ModifierKeyCode;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.RoughlyEnoughItemsNetwork;
 import me.shedaniel.rei.api.*;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.PreRecipeViewingScreen;
 import me.shedaniel.rei.gui.RecipeViewingScreen;
 import me.shedaniel.rei.gui.VillagerRecipeViewingScreen;
@@ -37,14 +36,14 @@ import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.PacketByteBuf;
 import net.minecraft.util.registry.Registry;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
     
     public static ClientHelperImpl instance;

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

@@ -29,7 +29,6 @@ import me.shedaniel.rei.api.ConfigManager;
 import me.shedaniel.rei.api.ConfigObject;
 import me.shedaniel.rei.api.EntryStack;
 import me.shedaniel.rei.api.RecipeHelper;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.ConfigReloadingScreen;
 import me.shedaniel.rei.gui.ContainerScreenOverlay;
 import me.shedaniel.rei.gui.PreRecipeViewingScreen;
@@ -47,6 +46,7 @@ import net.minecraft.client.util.InputUtil;
 import net.minecraft.client.util.Window;
 import net.minecraft.text.LiteralText;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -56,8 +56,7 @@ import java.util.Optional;
 import static me.sargunvohra.mcmods.autoconfig1u.util.Utils.getUnsafely;
 import static me.sargunvohra.mcmods.autoconfig1u.util.Utils.setUnsafely;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class ConfigManagerImpl implements ConfigManager {
     
     private boolean craftableOnly;
@@ -216,11 +215,7 @@ public class ConfigManagerImpl implements ConfigManager {
         craftableOnly = !craftableOnly;
     }
     
-    @Override
-    public void openConfigScreen(Screen parent) {
-        MinecraftClient.getInstance().openScreen(getConfigScreen(parent));
-    }
-    
+    @SuppressWarnings("deprecation")
     @Override
     public Screen getConfigScreen(Screen parent) {
         try {

+ 2 - 3
src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java

@@ -12,18 +12,17 @@ import me.sargunvohra.mcmods.autoconfig1u.shadowed.blue.endless.jankson.Comment;
 import me.shedaniel.clothconfig2.api.Modifier;
 import me.shedaniel.clothconfig2.api.ModifierKeyCode;
 import me.shedaniel.rei.api.ConfigObject;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.config.ItemListOrdering;
 import me.shedaniel.rei.gui.config.ItemListOrderingConfig;
 import me.shedaniel.rei.gui.config.RecipeScreenType;
 import me.shedaniel.rei.gui.config.SearchFieldLocation;
 import net.minecraft.client.util.InputUtil;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.ArrayList;
 import java.util.List;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 @Config(name = "roughlyenoughitems/config")
 public class ConfigObjectImpl implements ConfigObject, ConfigData {
     

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

@@ -10,21 +10,20 @@ import com.google.common.collect.Maps;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.BaseBoundsHandler;
 import me.shedaniel.rei.api.DisplayHelper;
-import me.shedaniel.rei.api.annotations.Internal;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class DisplayHelperImpl implements DisplayHelper {
     
     private static final Comparator<DisplayBoundsHandler<?>> BOUNDS_HANDLER_COMPARATOR;
-    private static final DisplayBoundsHandler<Object> EMPTY = new DisplayBoundsHandler() {
+    private static final DisplayBoundsHandler<Object> EMPTY = new DisplayBoundsHandler<Object>() {
         @Override
-        public Class getBaseSupportedClass() {
+        public Class<Object> getBaseSupportedClass() {
             return null;
         }
         
@@ -51,7 +50,7 @@ public class DisplayHelperImpl implements DisplayHelper {
     
     private List<DisplayBoundsHandler<?>> screenDisplayBoundsHandlers = Lists.newArrayList();
     private Map<Class<?>, DisplayBoundsHandler<?>> handlerCache = Maps.newHashMap();
-    private Map<Class, List<DisplayBoundsHandler<?>>> handlerSortedCache = Maps.newHashMap();
+    private Map<Class<?>, List<DisplayBoundsHandler<?>>> handlerSortedCache = Maps.newHashMap();
     private BaseBoundsHandler baseBoundsHandler;
     private Class<?> tempScreen;
     
@@ -95,17 +94,17 @@ public class DisplayHelperImpl implements DisplayHelper {
         return baseBoundsHandler;
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public void setBaseBoundsHandler(BaseBoundsHandler baseBoundsHandler) {
         this.baseBoundsHandler = baseBoundsHandler;
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public void resetData() {
         screenDisplayBoundsHandlers.clear();
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public void resetCache() {
         handlerCache.clear();
         handlerSortedCache.clear();

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

@@ -9,11 +9,12 @@ import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.EntryStack;
 import me.shedaniel.rei.gui.widget.QueuedTooltip;
 import net.minecraft.util.Identifier;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.Optional;
 
-@Deprecated
+@ApiStatus.Internal
 public class EmptyEntryStack implements EntryStack {
     
     @Deprecated public static final EntryStack EMPTY = new EmptyEntryStack();

+ 6 - 7
src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java

@@ -10,18 +10,17 @@ import com.google.common.collect.Queues;
 import me.shedaniel.rei.api.EntryRegistry;
 import me.shedaniel.rei.api.EntryStack;
 import me.shedaniel.rei.api.RecipeHelper;
-import me.shedaniel.rei.api.annotations.Internal;
 import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.DefaultedList;
 import net.minecraft.util.Pair;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.*;
 import java.util.concurrent.CopyOnWriteArrayList;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class EntryRegistryImpl implements EntryRegistry {
     
     private final CopyOnWriteArrayList<EntryStack> entries = Lists.newCopyOnWriteArrayList();
@@ -57,7 +56,7 @@ public class EntryRegistryImpl implements EntryRegistry {
     
     @Override
     public List<ItemStack> appendStacksForItem(Item item) {
-        DefaultedList<ItemStack> list = new DefaultedLinkedList(Lists.newLinkedList(), null);
+        DefaultedList<ItemStack> list = new DefaultedLinkedList<>(Lists.newLinkedList(), null);
         item.appendStacks(item.getGroup(), list);
         if (list.isEmpty())
             list.add(item.getStackForRender());
@@ -81,7 +80,7 @@ public class EntryRegistryImpl implements EntryRegistry {
             getStacksList().add(stack);
         } else {
             int last = getStacksList().size();
-            for (int i = last - 1; i >= 0; i++)
+            for (int i = last - 1; i >= 0; i--)
                 if (getStacksList().get(i).equalsAll(afterEntry)) {
                     last = i + 1;
                     break;
@@ -113,7 +112,7 @@ public class EntryRegistryImpl implements EntryRegistry {
             getStacksList().addAll(stacks);
     }
     
-    private class DefaultedLinkedList<E> extends DefaultedList<E> {
+    private static class DefaultedLinkedList<E> extends DefaultedList<E> {
         public DefaultedLinkedList(List<E> delegate, @Nullable E initialElement) {
             super(delegate, initialElement);
         }

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

@@ -25,11 +25,12 @@ import net.minecraft.util.Identifier;
 import net.minecraft.util.Pair;
 import net.minecraft.util.math.BlockPos;
 import net.minecraft.util.registry.Registry;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.*;
 
-@Deprecated
+@ApiStatus.Internal
 public class FluidEntryStack extends AbstractEntryStack {
     private static final Map<Fluid, Pair<Sprite, Integer>> FLUID_SPRITE_CACHE = new HashMap<>();
     private static final int EMPTY_AMOUNT = -1319182373;
@@ -93,8 +94,8 @@ public class FluidEntryStack extends AbstractEntryStack {
     @Override
     public EntryStack copy() {
         EntryStack stack = EntryStack.create(fluid, amount);
-        for (Map.Entry<Settings, Object> entry : getSettings().entrySet()) {
-            stack.setting(entry.getKey(), entry.getValue());
+        for (Map.Entry<Settings<?>, Object> entry : getSettings().entrySet()) {
+            stack.setting((Settings<? super Object>) entry.getKey(), entry.getValue());
         }
         return stack;
     }

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

@@ -21,15 +21,18 @@ import net.minecraft.client.util.math.MatrixStack;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.registry.Registry;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 
-@Deprecated
+@ApiStatus.Internal
 public class ItemEntryStack extends AbstractEntryStack implements OptimalEntryStack {
     
+    private static final MatrixStack matrices = new MatrixStack();
+    private final ItemRenderer itemRenderer = MinecraftClient.getInstance().getItemRenderer();
     private ItemStack itemStack;
     private int hash = -1;
     
@@ -63,12 +66,11 @@ public class ItemEntryStack extends AbstractEntryStack implements OptimalEntrySt
         return itemStack.isEmpty();
     }
     
-    @SuppressWarnings("rawtypes")
     @Override
     public EntryStack copy() {
         EntryStack stack = EntryStack.create(getItemStack().copy());
-        for (Map.Entry<Settings, Object> entry : getSettings().entrySet()) {
-            stack.setting(entry.getKey(), entry.getValue());
+        for (Map.Entry<Settings<?>, Object> entry : getSettings().entrySet()) {
+            stack.setting((Settings<? super Object>) entry.getKey(), entry.getValue());
         }
         return stack;
     }
@@ -127,7 +129,7 @@ public class ItemEntryStack extends AbstractEntryStack implements OptimalEntrySt
         //        }
         return hash;
     }
-    
+
     @Nullable
     @Override
     public QueuedTooltip getTooltip(int mouseX, int mouseY) {
@@ -149,9 +151,6 @@ public class ItemEntryStack extends AbstractEntryStack implements OptimalEntrySt
         return QueuedTooltip.create(toolTip);
     }
     
-    private static final MatrixStack matrices = new MatrixStack();
-    private final ItemRenderer itemRenderer = MinecraftClient.getInstance().getItemRenderer();
-    
     @Override
     public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
         optimisedRenderStart(delta);

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

@@ -6,8 +6,9 @@
 package me.shedaniel.rei.impl;
 
 import me.shedaniel.rei.api.ObjectHolder;
+import org.jetbrains.annotations.ApiStatus;
 
-@Deprecated
+@ApiStatus.Internal
 public class ObjectHolderImpl<T> implements ObjectHolder<T> {
     private Object o;
     

+ 2 - 3
src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java

@@ -11,7 +11,6 @@ import com.google.common.collect.Sets;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.*;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.api.plugins.REIPluginV0;
 import me.shedaniel.rei.utils.CollectionUtils;
 import net.fabricmc.loader.api.FabricLoader;
@@ -22,14 +21,14 @@ import net.minecraft.recipe.Recipe;
 import net.minecraft.recipe.RecipeManager;
 import net.minecraft.util.ActionResult;
 import net.minecraft.util.Identifier;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.*;
 import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class RecipeHelperImpl implements RecipeHelper {
     
     private static final Comparator<DisplayVisibilityHandler> VISIBILITY_HANDLER_COMPARATOR;

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

@@ -9,10 +9,12 @@ import me.shedaniel.rei.api.EntryStack;
 import me.shedaniel.rei.gui.widget.QueuedTooltip;
 import net.minecraft.client.gui.DrawableHelper;
 import net.minecraft.util.Identifier;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.Optional;
 
+@ApiStatus.Internal
 public abstract class RenderingEntry extends DrawableHelper implements EntryStack {
     @Override
     public Optional<Identifier> getIdentifier() {

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

@@ -11,7 +11,6 @@ import com.google.common.collect.Sets;
 import me.shedaniel.cloth.hooks.ClothClientHooks;
 import me.shedaniel.rei.api.ConfigManager;
 import me.shedaniel.rei.api.ConfigObject;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.ContainerScreenOverlay;
 import me.shedaniel.rei.gui.OverlaySearchField;
 import me.shedaniel.rei.listeners.ContainerScreenHooks;
@@ -24,6 +23,7 @@ import net.minecraft.client.util.Window;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.ActionResult;
 import org.apache.logging.log4j.util.TriConsumer;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.LinkedHashSet;
 import java.util.List;
@@ -34,13 +34,12 @@ public class ScreenHelper implements ClientModInitializer {
     /**
      * @deprecated Use getters instead
      */
-    @Deprecated public static OverlaySearchField searchField;
-    @Deprecated @Internal public static List<ItemStack> inventoryStacks = Lists.newArrayList();
+    @Deprecated @ApiStatus.ScheduledForRemoval public static OverlaySearchField searchField;
+    @ApiStatus.Internal public static List<ItemStack> inventoryStacks = Lists.newArrayList();
     private static ContainerScreenOverlay overlay;
     private static AbstractContainerScreen<?> lastContainerScreen = null;
     private static LinkedHashSet<Screen> lastRecipeScreen = Sets.newLinkedHashSetWithExpectedSize(5);
     
-    @SuppressWarnings("deprecation")
     public static OverlaySearchField getSearchField() {
         return searchField;
     }

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

@@ -7,7 +7,6 @@ package me.shedaniel.rei.impl;
 
 import com.google.common.collect.Lists;
 import me.shedaniel.rei.api.EntryStack;
-import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.widget.QueuedTooltip;
 import me.shedaniel.rei.utils.CollectionUtils;
 import net.minecraft.client.MinecraftClient;
@@ -20,14 +19,14 @@ import net.minecraft.text.Text;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.registry.Registry;
 import org.apache.commons.lang3.StringUtils;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
 import java.util.function.Function;
 
-@Deprecated
-@Internal
+@ApiStatus.Internal
 public class SearchArgument {
     
     public static final SearchArgument ALWAYS = new SearchArgument(ArgumentType.ALWAYS, "", true);
@@ -48,7 +47,7 @@ public class SearchArgument {
         this.include = include;
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public static String tryGetEntryStackName(EntryStack stack) {
         if (stack.getType() == EntryStack.Type.ITEM)
             return tryGetItemStackName(stack.getItemStack());
@@ -57,7 +56,7 @@ public class SearchArgument {
         return "";
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public static String tryGetEntryStackTooltip(EntryStack stack) {
         QueuedTooltip tooltip = stack.getTooltip(0, 0);
         if (tooltip != null)
@@ -65,7 +64,7 @@ public class SearchArgument {
         return "";
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public static String tryGetFluidName(Fluid fluid) {
         Identifier id = Registry.FLUID.getId(fluid);
         if (I18n.hasTranslation("block." + id.toString().replaceFirst(":", ".")))
@@ -73,7 +72,7 @@ public class SearchArgument {
         return CollectionUtils.mapAndJoinToString(id.getPath().split("_"), StringUtils::capitalize, " ");
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public static List<String> tryGetItemStackToolTip(ItemStack itemStack, boolean careAboutAdvanced) {
         if (!searchBlacklisted.contains(itemStack.getItem()))
             try {
@@ -85,7 +84,7 @@ public class SearchArgument {
         return Collections.singletonList(tryGetItemStackName(itemStack));
     }
     
-    @Deprecated
+    @ApiStatus.Internal
     public static String tryGetItemStackName(ItemStack stack) {
         if (!searchBlacklisted.contains(stack.getItem()))
             try {
@@ -131,8 +130,7 @@ public class SearchArgument {
         ALWAYS
     }
     
-    @Deprecated
-    @Internal
+    @ApiStatus.Internal
     public static class SearchArguments {
         public static final SearchArguments ALWAYS = new SearchArguments(new SearchArgument[]{SearchArgument.ALWAYS});
         private SearchArgument[] arguments;

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

@@ -5,9 +5,9 @@
 
 package me.shedaniel.rei.impl;
 
-import me.shedaniel.rei.api.annotations.Internal;
+import org.jetbrains.annotations.ApiStatus;
 
-@Internal
+@ApiStatus.Internal
 public enum Weather {
     CLEAR(0, "text.rei.weather.clear"),
     RAIN(1, "text.rei.weather.rain"),

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

@@ -6,9 +6,11 @@
 package me.shedaniel.rei.listeners;
 
 import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen;
+import org.jetbrains.annotations.ApiStatus;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
+@ApiStatus.Internal
 @Mixin(AbstractInventoryScreen.class)
 public interface AbstractInventoryScreenHooks {
     @Accessor("offsetGuiForEffects")

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

@@ -7,9 +7,11 @@ package me.shedaniel.rei.listeners;
 
 import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
 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)
 public interface ContainerScreenHooks {
     

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

@@ -7,9 +7,11 @@ package me.shedaniel.rei.listeners;
 
 import net.minecraft.client.gui.widget.TexturedButtonWidget;
 import net.minecraft.util.Identifier;
+import org.jetbrains.annotations.ApiStatus;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
+@ApiStatus.Internal
 @Mixin(TexturedButtonWidget.class)
 public interface RecipeBookButtonWidgetHooks {
     @Accessor("texture")

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

@@ -9,11 +9,13 @@ import net.minecraft.client.gui.screen.recipebook.RecipeBookGhostSlots;
 import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget;
 import net.minecraft.client.gui.screen.recipebook.RecipeGroupButtonWidget;
 import net.minecraft.client.gui.widget.TextFieldWidget;
+import org.jetbrains.annotations.ApiStatus;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
 import java.util.List;
 
+@ApiStatus.Internal
 @Mixin(RecipeBookWidget.class)
 public interface RecipeBookGuiHooks {
     

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

@@ -41,7 +41,7 @@ public class DefaultCategoryHandler implements AutoTransferHandler {
         TransferRecipeDisplay recipe = (TransferRecipeDisplay) context.getRecipe();
         AbstractContainerScreen<?> containerScreen = context.getContainerScreen();
         Container container = containerScreen.getContainer();
-        ContainerInfo containerInfo = ContainerInfoHandler.getContainerInfo(recipe.getRecipeCategory(), container.getClass());
+        ContainerInfo<Container> containerInfo = (ContainerInfo<Container>) ContainerInfoHandler.getContainerInfo(recipe.getRecipeCategory(), container.getClass());
         if (containerInfo == null)
             return Result.createNotApplicable();
         if (recipe.getHeight() > containerInfo.getCraftingHeight(container) || recipe.getWidth() > containerInfo.getCraftingWidth(container))

+ 0 - 1
src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java

@@ -21,7 +21,6 @@ import net.minecraft.container.PlayerContainer;
 import net.minecraft.recipe.Recipe;
 
 public class DefaultRecipeBookHandler implements AutoTransferHandler {
-    @SuppressWarnings("deprecation")
     @Override
     public Result handle(Context context) {
         if (context.getRecipe() instanceof TransferRecipeDisplay && DefaultCategoryHandler.canUseMovePackets())

+ 1 - 1
src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java

@@ -52,7 +52,7 @@ public class DefaultBrewingCategory implements RecipeCategory<DefaultBrewingDisp
                 super.render(mouseX, mouseY, delta);
                 MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
                 blit(startPoint.x, startPoint.y, 0, 108, 103, 59);
-                int width = MathHelper.ceil((System.currentTimeMillis() / 250 % 18d) / 1f);
+                int width = MathHelper.ceil(System.currentTimeMillis() / 250d % 18d);
                 blit(startPoint.x + 44, startPoint.y + 28, 103, 163, width, 4);
             }
         }));

+ 6 - 3
src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java

@@ -21,6 +21,7 @@ import net.minecraft.client.resource.language.I18n;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
+import java.text.DecimalFormat;
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
@@ -46,20 +47,22 @@ public class DefaultCampfireCategory implements RecipeCategory<DefaultCampfireDi
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultCampfireDisplay> recipeDisplaySupplier, Rectangle bounds) {
         Point startPoint = new Point(bounds.getCenterX() - 41, bounds.y + 10);
+        final double cookingTime = recipeDisplaySupplier.get().getCookTime();
+        DecimalFormat df = new DecimalFormat("###.##");
         List<Widget> widgets = new LinkedList<>(Collections.singletonList(new RecipeBaseWidget(bounds) {
             @Override
             public void render(int mouseX, int mouseY, float delta) {
                 super.render(mouseX, mouseY, delta);
                 MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
                 blit(startPoint.x, startPoint.y, 0, 177, 82, 34);
-                int height = MathHelper.ceil((System.currentTimeMillis() / 250 % 14d) / 1f);
+                int height = 14 - MathHelper.ceil(System.currentTimeMillis() / 250d % 14d);
                 blit(startPoint.x + 2, startPoint.y + 31 + (3 - height), 82, 77 + (14 - height), 14, height);
-                String text = I18n.translate("category.rei.campfire.time", MathHelper.floor(recipeDisplaySupplier.get().getCookTime() / 20d));
+                String text = I18n.translate("category.rei.campfire.time", df.format(cookingTime / 20d));
                 int length = MinecraftClient.getInstance().textRenderer.getStringWidth(text);
                 MinecraftClient.getInstance().textRenderer.draw(text, bounds.x + bounds.width - length - 5, bounds.y + 5, ScreenHelper.isDarkModeEnabled() ? 0xFFBBBBBB : 0xFF404040);
             }
         }));
-        widgets.add(RecipeArrowWidget.create(new Point(startPoint.x + 24, startPoint.y + 8), true));
+        widgets.add(RecipeArrowWidget.create(new Point(startPoint.x + 24, startPoint.y + 8), true).time(cookingTime * 50));
         widgets.add(EntryWidget.create(startPoint.x + 1, startPoint.y + 1).entries(recipeDisplaySupplier.get().getInputEntries().get(0)));
         widgets.add(EntryWidget.create(startPoint.x + 61, startPoint.y + 9).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
         return widgets;

+ 1 - 1
src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireDisplay.java

@@ -45,7 +45,7 @@ public class DefaultCampfireDisplay implements RecipeDisplay {
         this.cookTime = cookTime;
     }
     
-    public int getCookTime() {
+    public double getCookTime() {
         return cookTime;
     }
     

+ 1 - 1
src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java

@@ -22,8 +22,8 @@ import net.minecraft.client.resource.language.I18n;
 import net.minecraft.item.ItemConvertible;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;

+ 1 - 1
src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingDisplay.java

@@ -26,7 +26,7 @@ public class DefaultCompostingDisplay implements RecipeDisplay {
         this.page = page;
         this.order = order.stream().map(EntryStack::create).collect(Collectors.toList());
         this.inputMap = inputMap;
-        this.output = Arrays.asList(output).stream().map(EntryStack::create).collect(Collectors.toList());
+        this.output = Arrays.stream(output).map(EntryStack::create).collect(Collectors.toList());
         this.allItems = allItems.stream().map(EntryStack::create).collect(Collectors.toList());
     }
     

+ 3 - 3
src/main/java/me/shedaniel/rei/plugin/containers/CraftingContainerInfoWrapper.java

@@ -14,12 +14,12 @@ import net.minecraft.item.ItemStack;
 public class CraftingContainerInfoWrapper<T extends CraftingContainer<?>> implements ContainerInfo<T> {
     private Class<? extends CraftingContainer<?>> containerClass;
     
-    public <T extends CraftingContainer<?>> CraftingContainerInfoWrapper(Class<T> containerClass) {
+    public CraftingContainerInfoWrapper(Class<T> containerClass) {
         this.containerClass = containerClass;
     }
     
-    public static <T extends CraftingContainer<?>> ContainerInfo<T> create(Class<T> containerClass) {
-        return new CraftingContainerInfoWrapper<T>(containerClass);
+    public static <R extends CraftingContainer<?>> ContainerInfo<R> create(Class<R> containerClass) {
+        return new CraftingContainerInfoWrapper<>(containerClass);
     }
     
     @Override

+ 6 - 3
src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java

@@ -25,6 +25,7 @@ import net.minecraft.client.resource.language.I18n;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
+import java.text.DecimalFormat;
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
@@ -54,21 +55,23 @@ public class DefaultCookingCategory implements TransferRecipeCategory<DefaultCoo
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultCookingDisplay> recipeDisplaySupplier, Rectangle bounds) {
         Point startPoint = new Point(bounds.getCenterX() - 41, bounds.y + 10);
+        double cookingTime = recipeDisplaySupplier.get().getCookingTime();
+        DecimalFormat df = new DecimalFormat("###.##");
         List<Widget> widgets = new LinkedList<>(Collections.singletonList(new RecipeBaseWidget(bounds) {
             @Override
             public void render(int mouseX, int mouseY, float delta) {
                 super.render(mouseX, mouseY, delta);
                 MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
                 blit(startPoint.x, startPoint.y, 0, 177, 82, 34);
-                int height = MathHelper.ceil((System.currentTimeMillis() / 250 % 14d) / 1f);
+                int height = 14 - MathHelper.ceil((System.currentTimeMillis() / 250d % 14d) / 1f);
                 blit(startPoint.x + 2, startPoint.y + 31 + (3 - height), 82, 77 + (14 - height), 14, height);
-                String text = I18n.translate("category.rei.cooking.xp", recipeDisplaySupplier.get().getXp());
+                String text = I18n.translate("category.rei.cooking.time&xp", df.format(recipeDisplaySupplier.get().getXp()), df.format(cookingTime / 20d));
                 int length = MinecraftClient.getInstance().textRenderer.getStringWidth(text);
                 MinecraftClient.getInstance().textRenderer.draw(text, bounds.x + bounds.width - length - 5, bounds.y + 5, ScreenHelper.isDarkModeEnabled() ? 0xFFBBBBBB : 0xFF404040);
                 
             }
         }));
-        widgets.add(RecipeArrowWidget.create(new Point(startPoint.x + 24, startPoint.y + 8), true));
+        widgets.add(RecipeArrowWidget.create(new Point(startPoint.x + 24, startPoint.y + 8), true).time(cookingTime * 50));
         widgets.add(EntryWidget.create(startPoint.x + 1, startPoint.y + 1).entries(recipeDisplaySupplier.get().getInputEntries().get(0)));
         widgets.add(EntryWidget.create(startPoint.x + 61, startPoint.y + 9).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
         return widgets;

+ 14 - 6
src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java

@@ -17,6 +17,7 @@ import net.minecraft.item.ItemStack;
 import net.minecraft.recipe.AbstractCookingRecipe;
 import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -25,16 +26,18 @@ import java.util.Optional;
 import java.util.stream.Collectors;
 
 public abstract class DefaultCookingDisplay implements TransferRecipeDisplay {
-    private AbstractCookingRecipe recipe;
-    private List<List<EntryStack>> input;
     private static List<EntryStack> fuel;
-    private List<EntryStack> output;
-    private float xp;
     
     static {
         fuel = FurnaceBlockEntity.createFuelTimeMap().keySet().stream().map(Item::getStackForRender).map(EntryStack::create).map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(Formatting.YELLOW.toString() + I18n.translate("category.rei.smelting.fuel")))).collect(Collectors.toList());
     }
     
+    private AbstractCookingRecipe recipe;
+    private List<List<EntryStack>> input;
+    private List<EntryStack> output;
+    private float xp;
+    private double cookTime;
+    
     public DefaultCookingDisplay(AbstractCookingRecipe recipe) {
         this.recipe = recipe;
         this.input = recipe.getPreviewInputs().stream().map(i -> {
@@ -46,7 +49,8 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay {
         }).collect(Collectors.toList());
         this.input.add(fuel);
         this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
-        xp = recipe.getExperience();
+        this.xp = recipe.getExperience();
+        this.cookTime = recipe.getCookTime();
     }
     
     @Override
@@ -73,7 +77,11 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay {
         return xp;
     }
     
-    @Deprecated
+    public double getCookingTime() {
+        return cookTime;
+    }
+    
+    @ApiStatus.Internal
     public Optional<AbstractCookingRecipe> getOptionalRecipe() {
         return Optional.ofNullable(recipe);
     }

+ 2 - 1
src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java

@@ -23,6 +23,7 @@ import net.minecraft.block.Blocks;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.DrawableHelper;
 import net.minecraft.client.resource.language.I18n;
+import net.minecraft.container.Container;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
@@ -88,7 +89,7 @@ public class DefaultCraftingCategory implements TransferRecipeCategory<DefaultCr
     
     @Override
     public void renderRedSlots(List<Widget> widgets, Rectangle bounds, DefaultCraftingDisplay display, IntList redSlots) {
-        ContainerInfo info = ContainerInfoHandler.getContainerInfo(getIdentifier(), ScreenHelper.getLastContainerScreen().getContainer().getClass());
+        ContainerInfo<Container> info = (ContainerInfo<Container>) ContainerInfoHandler.getContainerInfo(getIdentifier(), ScreenHelper.getLastContainerScreen().getContainer().getClass());
         if (info == null)
             return;
         RenderSystem.translatef(0, 0, 400);

+ 4 - 1
src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCustomDisplay.java

@@ -11,6 +11,7 @@ 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;
@@ -35,7 +36,7 @@ public class DefaultCustomDisplay implements DefaultCraftingDisplay {
         for (int i = 0; i < 9; i++)
             if (i < this.input.size()) {
                 List<EntryStack> stacks = this.input.get(i);
-                if (stacks.stream().filter(stack -> !stack.isEmpty()).count() > 0) {
+                if (stacks.stream().anyMatch(stack -> !stack.isEmpty())) {
                     row.set((i - (i % 3)) / 3, true);
                     column.set(i % 3, true);
                 }
@@ -48,6 +49,8 @@ public class DefaultCustomDisplay implements DefaultCraftingDisplay {
         this(input, output, null);
     }
     
+    @Deprecated
+    @ApiStatus.ScheduledForRemoval
     public Recipe getPossibleRecipe() {
         return possibleRecipe;
     }

+ 2 - 2
src/main/java/me/shedaniel/rei/plugin/fuel/DefaultFuelCategory.java

@@ -21,8 +21,8 @@ import net.minecraft.client.resource.language.I18n;
 import net.minecraft.item.Items;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
@@ -58,7 +58,7 @@ public class DefaultFuelCategory implements RecipeCategory<DefaultFuelDisplay> {
                 super.render(mouseX, mouseY, delta);
                 MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
                 blit(bounds.x + 5, startPoint.y, 0, 73, 18, 34);
-                int height = MathHelper.ceil((System.currentTimeMillis() / 250 % 14d) / 1f);
+                int height = MathHelper.ceil(System.currentTimeMillis() / 250d % 14d);
                 blit(bounds.x + 7, startPoint.y + 12 + (3 - height), 82, 77 + (14 - height), 14, height);
                 minecraft.textRenderer.draw(I18n.translate("category.rei.fuel.time", recipeDisplaySupplier.get().getFuelTime()), bounds.x + 26, bounds.getMaxY() - 15, ScreenHelper.isDarkModeEnabled() ? 0xFFBBBBBB : 0xFF404040);
             }

+ 13 - 13
src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationCategory.java

@@ -32,13 +32,25 @@ import net.minecraft.client.util.math.Matrix4f;
 import net.minecraft.text.Text;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.Collections;
 import java.util.List;
 import java.util.function.Supplier;
 
 public class DefaultInformationCategory implements RecipeCategory<DefaultInformationDisplay> {
+    protected static void innerBlit(Matrix4f matrix4f, int xStart, int xEnd, int yStart, int yEnd, int z, float uStart, float uEnd, float vStart, float vEnd) {
+        BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
+        bufferBuilder.begin(7, VertexFormats.POSITION_TEXTURE);
+        bufferBuilder.vertex(matrix4f, xStart, yEnd, z).texture(uStart, vEnd).next();
+        bufferBuilder.vertex(matrix4f, xEnd, yEnd, z).texture(uEnd, vEnd).next();
+        bufferBuilder.vertex(matrix4f, xEnd, yStart, z).texture(uEnd, vStart).next();
+        bufferBuilder.vertex(matrix4f, xStart, yStart, z).texture(uStart, vStart).next();
+        bufferBuilder.end();
+        RenderSystem.enableAlphaTest();
+        BufferRenderer.draw(bufferBuilder);
+    }
+    
     @Override
     public Identifier getIdentifier() {
         return DefaultPlugin.INFO;
@@ -83,18 +95,6 @@ public class DefaultInformationCategory implements RecipeCategory<DefaultInforma
         };
     }
     
-    protected static void innerBlit(Matrix4f matrix4f, int xStart, int xEnd, int yStart, int yEnd, int z, float uStart, float uEnd, float vStart, float vEnd) {
-        BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
-        bufferBuilder.begin(7, VertexFormats.POSITION_TEXTURE);
-        bufferBuilder.vertex(matrix4f, xStart, yEnd, z).texture(uStart, vEnd).next();
-        bufferBuilder.vertex(matrix4f, xEnd, yEnd, z).texture(uEnd, vEnd).next();
-        bufferBuilder.vertex(matrix4f, xEnd, yStart, z).texture(uEnd, vStart).next();
-        bufferBuilder.vertex(matrix4f, xStart, yStart, z).texture(uStart, vStart).next();
-        bufferBuilder.end();
-        RenderSystem.enableAlphaTest();
-        BufferRenderer.draw(bufferBuilder);
-    }
-    
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultInformationDisplay> recipeDisplaySupplier, Rectangle bounds) {
         DefaultInformationDisplay display = recipeDisplaySupplier.get();

+ 5 - 5
src/main/java/me/shedaniel/rei/server/ContainerInfoHandler.java

@@ -12,9 +12,9 @@ import net.minecraft.util.Identifier;
 import java.util.Map;
 
 public class ContainerInfoHandler {
-    private static final Map<String, Map<Class<? extends Container>, ContainerInfo>> containerInfoMap = Maps.newLinkedHashMap();
+    private static final Map<String, Map<Class<? extends Container>, ContainerInfo<? extends Container>>> containerInfoMap = Maps.newLinkedHashMap();
     
-    public static void registerContainerInfo(Identifier category, ContainerInfo containerInfo) {
+    public static void registerContainerInfo(Identifier category, ContainerInfo<? extends Container> containerInfo) {
         if (!containerInfoMap.containsKey(category.toString()))
             containerInfoMap.put(category.toString(), Maps.newLinkedHashMap());
         containerInfoMap.get(category.toString()).put(containerInfo.getContainerClass(), containerInfo);
@@ -24,13 +24,13 @@ public class ContainerInfoHandler {
         return containerInfoMap.containsKey(category.toString()) && !containerInfoMap.get(category.toString()).isEmpty();
     }
     
-    public static ContainerInfo getContainerInfo(Identifier category, Class<?> containerClass) {
+    public static ContainerInfo<? extends Container> getContainerInfo(Identifier category, Class<?> containerClass) {
         if (!isCategoryHandled(category))
             return null;
-        Map<Class<? extends Container>, ContainerInfo> infoMap = containerInfoMap.get(category.toString());
+        Map<Class<? extends Container>, ContainerInfo<? extends Container>> infoMap = containerInfoMap.get(category.toString());
         if (infoMap.containsKey(containerClass))
             return infoMap.get(containerClass);
-        for (Map.Entry<Class<? extends Container>, ContainerInfo> entry : infoMap.entrySet())
+        for (Map.Entry<Class<? extends Container>, ContainerInfo<? extends Container>> entry : infoMap.entrySet())
             if (entry.getKey().isAssignableFrom(containerClass))
                 return entry.getValue();
         return null;

+ 6 - 14
src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java

@@ -8,7 +8,6 @@ package me.shedaniel.rei.server;
 import com.google.common.collect.Lists;
 import it.unimi.dsi.fastutil.ints.IntArrayList;
 import it.unimi.dsi.fastutil.ints.IntList;
-import it.unimi.dsi.fastutil.ints.IntListIterator;
 import net.minecraft.container.Container;
 import net.minecraft.container.Slot;
 import net.minecraft.entity.player.PlayerInventory;
@@ -21,7 +20,6 @@ import net.minecraft.util.DefaultedList;
 import net.minecraft.util.Identifier;
 
 import java.util.*;
-import java.util.stream.Collectors;
 
 public class InputSlotCrafter<C extends Inventory> implements RecipeGridAligner<Integer> {
     
@@ -29,13 +27,13 @@ public class InputSlotCrafter<C extends Inventory> implements RecipeGridAligner<
     protected ContainerInfo containerInfo;
     protected PlayerInventory inventory;
     
-    private InputSlotCrafter(Container craftingContainer, ContainerInfo containerInfo) {
+    private InputSlotCrafter(Container craftingContainer, ContainerInfo<? extends Container> containerInfo) {
         this.craftingContainer = craftingContainer;
         this.containerInfo = containerInfo;
     }
     
     public static <C extends Inventory> void start(Identifier category, Container craftingContainer_1, ServerPlayerEntity player, Map<Integer, List<ItemStack>> map, boolean hasShift) {
-        ContainerInfo containerInfo = Objects.requireNonNull(ContainerInfoHandler.getContainerInfo(category, craftingContainer_1.getClass()), "Container Info does not exist on the server!");
+        ContainerInfo<? extends Container> containerInfo = Objects.requireNonNull(ContainerInfoHandler.getContainerInfo(category, craftingContainer_1.getClass()), "Container Info does not exist on the server!");
         new InputSlotCrafter<C>(craftingContainer_1, containerInfo).fillInputSlots(player, map, hasShift);
     }
     
@@ -53,7 +51,7 @@ public class InputSlotCrafter<C extends Inventory> implements RecipeGridAligner<
             this.containerInfo.populateRecipeFinder(craftingContainer, recipeFinder);
             DefaultedList<Ingredient> ingredients = DefaultedList.of();
             map.entrySet().stream().sorted(Comparator.comparingInt(Map.Entry::getKey)).forEach(entry -> {
-                ingredients.add(Ingredient.ofItems(entry.getValue().stream().map(ItemStack::getItem).collect(Collectors.toList()).toArray(new Item[0])));
+                ingredients.add(Ingredient.ofItems(entry.getValue().stream().map(ItemStack::getItem).toArray(Item[]::new)));
             });
             if (recipeFinder.findRecipe(ingredients, null)) {
                 this.fillInputSlots(recipeFinder, ingredients, hasShift);
@@ -121,10 +119,8 @@ public class InputSlotCrafter<C extends Inventory> implements RecipeGridAligner<
         IntList intList_1 = new IntArrayList();
         if (recipeFinder.findRecipe(ingredients, intList_1, int_2)) {
             int int_4 = int_2;
-            IntListIterator var8 = intList_1.iterator();
             
-            while (var8.hasNext()) {
-                int int_5 = var8.next();
+            for (int int_5 : intList_1) {
                 int int_6 = RecipeFinder.getStackFromId(int_5).getMaxCount();
                 if (int_6 < int_4) {
                     int_4 = int_6;
@@ -198,10 +194,8 @@ public class InputSlotCrafter<C extends Inventory> implements RecipeGridAligner<
                 if (!itemStack_1.isEmpty()) {
                     int int_3 = this.inventory.getOccupiedSlotWithRoomForStack(itemStack_1);
                     if (int_3 == -1 && list_1.size() <= int_1) {
-                        Iterator<ItemStack> var6 = list_1.iterator();
                         
-                        while (var6.hasNext()) {
-                            ItemStack itemStack_2 = var6.next();
+                        for (ItemStack itemStack_2 : list_1) {
                             if (itemStack_2.isItemEqualIgnoreDamage(itemStack_1) && itemStack_2.getCount() != itemStack_2.getMaxCount() && itemStack_2.getCount() + itemStack_1.getCount() <= itemStack_2.getMaxCount()) {
                                 itemStack_2.increment(itemStack_1.getCount());
                                 itemStack_1.setCount(0);
@@ -228,9 +222,7 @@ public class InputSlotCrafter<C extends Inventory> implements RecipeGridAligner<
     
     private int getFreeInventorySlots() {
         int int_1 = 0;
-        Iterator<ItemStack> var2 = this.inventory.main.iterator();
-        while (var2.hasNext()) {
-            ItemStack itemStack_1 = var2.next();
+        for (ItemStack itemStack_1 : this.inventory.main) {
             if (itemStack_1.isEmpty()) {
                 ++int_1;
             }

+ 3 - 1
src/main/java/me/shedaniel/rei/server/RecipeFinder.java

@@ -12,13 +12,15 @@ import net.minecraft.item.ItemStack;
 import net.minecraft.recipe.Ingredient;
 import net.minecraft.util.DefaultedList;
 import net.minecraft.util.registry.Registry;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.BitSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.stream.Collectors;
 
+@ApiStatus.Internal
 public class RecipeFinder {
     public final Int2IntMap idToAmountMap = new Int2IntOpenHashMap();
     

+ 10 - 10
src/main/java/me/shedaniel/rei/server/RecipeGridAligner.java

@@ -8,13 +8,13 @@ package me.shedaniel.rei.server;
 import net.minecraft.recipe.Ingredient;
 import net.minecraft.util.DefaultedList;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Iterator;
 
+@ApiStatus.Internal
 public interface RecipeGridAligner<T> {
     default void alignRecipeToGrid(int int_1, int int_2, int int_3, DefaultedList<Ingredient> recipe_1, Iterator<T> iterator_1, int int_4) {
-        int int_5 = int_1;
-        int int_6 = int_2;
         int int_7 = 0;
         
         for (int int_8 = 0; int_8 < int_2; ++int_8) {
@@ -22,8 +22,8 @@ public interface RecipeGridAligner<T> {
                 ++int_7;
             }
             
-            boolean boolean_1 = (float) int_6 < (float) int_2 / 2.0F;
-            int int_9 = MathHelper.floor((float) int_2 / 2.0F - (float) int_6 / 2.0F);
+            boolean boolean_1 = (float) int_2 < (float) int_2 / 2.0F;
+            int int_9 = MathHelper.floor((float) int_2 / 2.0F - (float) int_2 / 2.0F);
             if (boolean_1 && int_9 > int_8) {
                 int_7 += int_1;
                 ++int_8;
@@ -34,13 +34,13 @@ public interface RecipeGridAligner<T> {
                     return;
                 }
                 
-                boolean_1 = (float) int_5 < (float) int_1 / 2.0F;
-                int_9 = MathHelper.floor((float) int_1 / 2.0F - (float) int_5 / 2.0F);
-                int int_11 = int_5;
-                boolean boolean_2 = int_10 < int_5;
+                boolean_1 = (float) int_1 < (float) int_1 / 2.0F;
+                int_9 = MathHelper.floor((float) int_1 / 2.0F - (float) int_1 / 2.0F);
+                int int_11 = int_1;
+                boolean boolean_2 = int_10 < int_1;
                 if (boolean_1) {
-                    int_11 = int_9 + int_5;
-                    boolean_2 = int_9 <= int_10 && int_10 < int_9 + int_5;
+                    int_11 = int_9 + int_1;
+                    boolean_2 = int_9 <= int_10 && int_10 < int_9 + int_1;
                 }
                 
                 if (boolean_2) {

+ 1 - 2
src/main/java/me/shedaniel/rei/tests/plugin/REITestPlugin.java

@@ -19,7 +19,6 @@ import java.util.Collections;
 import java.util.Random;
 
 @TestOnly
-@Deprecated
 public class REITestPlugin implements REIPluginV0 {
     
     private Random random = new Random();
@@ -44,7 +43,7 @@ public class REITestPlugin implements REIPluginV0 {
                     for (int i = 0; i < 15; i++)
                         entryRegistry.registerEntry(transformStack(EntryStack.create(stack)));
                 }
-            } catch (Exception e) {
+            } catch (Exception ignored) {
             }
         }
     }

+ 2 - 2
src/main/java/me/shedaniel/rei/utils/CollectionUtils.java

@@ -8,13 +8,13 @@ package me.shedaniel.rei.utils;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import me.shedaniel.rei.api.EntryStack;
-import me.shedaniel.rei.api.annotations.Internal;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.*;
 import java.util.function.Function;
 import java.util.function.Predicate;
 
-@Internal
+@ApiStatus.Internal
 public class CollectionUtils {
     public static <A, B> List<B> getOrPutEmptyList(Map<A, List<B>> map, A key) {
         List<B> b = map.get(key);

+ 2 - 1
src/main/resources/assets/roughlyenoughitems/lang/en_us.json

@@ -14,10 +14,11 @@
   "category.rei.fuel.time": "Burn Time: %d ticks",
   "category.rei.fuel.time_short": "%d ticks",
   "category.rei.cooking.xp": "%f XP",
+  "category.rei.cooking.time&xp": "%s XP in %s sec",
   "category.rei.smoking": "Smoking",
   "category.rei.blasting": "Blasting",
   "category.rei.campfire": "Campfire",
-  "category.rei.campfire.time": "%d Seconds",
+  "category.rei.campfire.time": "%s sec",
   "category.rei.stone_cutting": "Stone Cutting",
   "category.rei.brewing": "Brewing",
   "category.rei.brewing.input": "Original Potion",