Prechádzať zdrojové kódy

Finishing workstation usage and close #220

shedaniel 5 rokov pred
rodič
commit
7aea3ac005
100 zmenil súbory, kde vykonal 1570 pridanie a 1475 odobranie
  1. 1 1
      gradle.properties
  2. 3 3
      src/main/java/me/shedaniel/rei/REIModMenuEntryPoint.java
  3. 39 35
      src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
  4. 3 3
      src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java
  5. 35 35
      src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java
  6. 6 6
      src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java
  7. 3 3
      src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java
  8. 27 27
      src/main/java/me/shedaniel/rei/api/ClientHelper.java
  9. 9 9
      src/main/java/me/shedaniel/rei/api/ConfigManager.java
  10. 52 47
      src/main/java/me/shedaniel/rei/api/ConfigObject.java
  11. 18 18
      src/main/java/me/shedaniel/rei/api/DisplayHelper.java
  12. 3 3
      src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java
  13. 10 10
      src/main/java/me/shedaniel/rei/api/EntryRegistry.java
  14. 42 41
      src/main/java/me/shedaniel/rei/api/EntryStack.java
  15. 4 4
      src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java
  16. 7 7
      src/main/java/me/shedaniel/rei/api/ObjectHolder.java
  17. 4 4
      src/main/java/me/shedaniel/rei/api/REIPluginEntry.java
  18. 12 12
      src/main/java/me/shedaniel/rei/api/RecipeCategory.java
  19. 6 6
      src/main/java/me/shedaniel/rei/api/RecipeDisplay.java
  20. 37 37
      src/main/java/me/shedaniel/rei/api/RecipeHelper.java
  21. 4 4
      src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java
  22. 2 1
      src/main/java/me/shedaniel/rei/api/annotations/Experimental.java
  23. 2 1
      src/main/java/me/shedaniel/rei/api/annotations/Internal.java
  24. 2 1
      src/main/java/me/shedaniel/rei/api/annotations/ToBeRemoved.java
  25. 8 8
      src/main/java/me/shedaniel/rei/api/plugins/REIPluginV0.java
  26. 5 5
      src/main/java/me/shedaniel/rei/gui/ConfigReloadingScreen.java
  27. 69 69
      src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java
  28. 12 12
      src/main/java/me/shedaniel/rei/gui/OverlaySearchField.java
  29. 14 14
      src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java
  30. 39 38
      src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
  31. 30 30
      src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
  32. 1 1
      src/main/java/me/shedaniel/rei/gui/config/ItemCheatingMode.java
  33. 5 5
      src/main/java/me/shedaniel/rei/gui/config/ItemListOrdering.java
  34. 6 6
      src/main/java/me/shedaniel/rei/gui/config/ItemListOrderingConfig.java
  35. 1 1
      src/main/java/me/shedaniel/rei/gui/config/RecipeScreenType.java
  36. 1 1
      src/main/java/me/shedaniel/rei/gui/config/SearchFieldLocation.java
  37. 16 16
      src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java
  38. 7 7
      src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java
  39. 21 21
      src/main/java/me/shedaniel/rei/gui/entries/RecipeEntry.java
  40. 11 11
      src/main/java/me/shedaniel/rei/gui/entries/SimpleRecipeEntry.java
  41. 8 8
      src/main/java/me/shedaniel/rei/gui/toast/CopyRecipeIdentifierToast.java
  42. 10 10
      src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java
  43. 22 22
      src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
  44. 4 4
      src/main/java/me/shedaniel/rei/gui/widget/CategoryBaseWidget.java
  45. 17 17
      src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java
  46. 8 8
      src/main/java/me/shedaniel/rei/gui/widget/CraftableToggleButtonWidget.java
  47. 13 13
      src/main/java/me/shedaniel/rei/gui/widget/DraggableWidget.java
  48. 71 71
      src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java
  49. 29 29
      src/main/java/me/shedaniel/rei/gui/widget/EntryWidget.java
  50. 67 47
      src/main/java/me/shedaniel/rei/gui/widget/FavoritesListWidget.java
  51. 21 21
      src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java
  52. 16 16
      src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java
  53. 13 13
      src/main/java/me/shedaniel/rei/gui/widget/QueuedTooltip.java
  54. 5 5
      src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java
  55. 3 3
      src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
  56. 21 21
      src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java
  57. 5 5
      src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java
  58. 12 12
      src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java
  59. 88 88
      src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java
  60. 4 4
      src/main/java/me/shedaniel/rei/gui/widget/Widget.java
  61. 6 6
      src/main/java/me/shedaniel/rei/gui/widget/WidgetWithBounds.java
  62. 9 9
      src/main/java/me/shedaniel/rei/impl/AbstractEntryStack.java
  63. 15 15
      src/main/java/me/shedaniel/rei/impl/BaseBoundsHandlerImpl.java
  64. 27 27
      src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java
  65. 13 13
      src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java
  66. 103 67
      src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java
  67. 16 16
      src/main/java/me/shedaniel/rei/impl/DisplayHelperImpl.java
  68. 28 27
      src/main/java/me/shedaniel/rei/impl/EmptyEntryStack.java
  69. 5 5
      src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java
  70. 18 18
      src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java
  71. 18 18
      src/main/java/me/shedaniel/rei/impl/ItemEntryStack.java
  72. 2 2
      src/main/java/me/shedaniel/rei/impl/ObjectHolderImpl.java
  73. 83 64
      src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
  74. 22 21
      src/main/java/me/shedaniel/rei/impl/ScreenHelper.java
  75. 20 19
      src/main/java/me/shedaniel/rei/impl/SearchArgument.java
  76. 7 7
      src/main/java/me/shedaniel/rei/impl/Weather.java
  77. 6 6
      src/main/java/me/shedaniel/rei/listeners/ContainerScreenHooks.java
  78. 4 4
      src/main/java/me/shedaniel/rei/listeners/RecipeBookGuiHooks.java
  79. 12 9
      src/main/java/me/shedaniel/rei/mixin/MixinBrewingRecipeRegistry.java
  80. 1 1
      src/main/java/me/shedaniel/rei/mixin/MixinItemRenderer.java
  81. 3 3
      src/main/java/me/shedaniel/rei/mixin/MixinItemStack.java
  82. 4 4
      src/main/java/me/shedaniel/rei/plugin/DefaultAutoCraftingPlugin.java
  83. 23 23
      src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
  84. 2 2
      src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java
  85. 6 6
      src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultCategoryHandler.java
  86. 1 1
      src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java
  87. 2 2
      src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingDisplay.java
  88. 3 3
      src/main/java/me/shedaniel/rei/plugin/brewing/BrewingRecipe.java
  89. 5 5
      src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java
  90. 7 7
      src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java
  91. 5 5
      src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java
  92. 10 10
      src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireDisplay.java
  93. 9 9
      src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java
  94. 10 10
      src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingDisplay.java
  95. 8 8
      src/main/java/me/shedaniel/rei/plugin/containers/CraftingContainerInfoWrapper.java
  96. 7 7
      src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java
  97. 11 11
      src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java
  98. 7 7
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java
  99. 5 5
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingDisplay.java
  100. 13 13
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCustomDisplay.java

+ 1 - 1
gradle.properties

@@ -1,4 +1,4 @@
-mod_version=3.2.28
+mod_version=3.2.29
 minecraft_version=1.15
 minecraft_version=1.15
 yarn_version=1.15+build.1
 yarn_version=1.15+build.1
 fabricloader_version=0.7.2+build.174
 fabricloader_version=0.7.2+build.174

+ 3 - 3
src/main/java/me/shedaniel/rei/REIModMenuEntryPoint.java

@@ -12,15 +12,15 @@ import net.minecraft.client.gui.screen.Screen;
 import java.util.function.Function;
 import java.util.function.Function;
 
 
 public class REIModMenuEntryPoint implements ModMenuApi {
 public class REIModMenuEntryPoint implements ModMenuApi {
-    
+
     @Override
     @Override
     public String getModId() {
     public String getModId() {
         return "roughlyenoughitems";
         return "roughlyenoughitems";
     }
     }
-    
+
     @Override
     @Override
     public Function<Screen, ? extends Screen> getConfigScreenFactory() {
     public Function<Screen, ? extends Screen> getConfigScreenFactory() {
         return parent -> ConfigManager.getInstance().getConfigScreen(parent);
         return parent -> ConfigManager.getInstance().getConfigScreen(parent);
     }
     }
-    
+
 }
 }

+ 39 - 35
src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java

@@ -56,39 +56,43 @@ import java.util.concurrent.atomic.AtomicLong;
 
 
 @Internal
 @Internal
 public class RoughlyEnoughItemsCore implements ClientModInitializer {
 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();
+
+    @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();
     private static final Map<Identifier, REIPluginEntry> plugins = Maps.newHashMap();
     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 final ExecutorService SYNC_RECIPES = Executors.newSingleThreadScheduledExecutor(r -> new Thread(r, "REI-SyncRecipes"));
     private static ConfigManager configManager;
     private static ConfigManager configManager;
-    
+
     static {
     static {
         LOGGER = LogManager.getFormatterLogger("REI");
         LOGGER = LogManager.getFormatterLogger("REI");
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public static RecipeHelper getRecipeHelper() {
     public static RecipeHelper getRecipeHelper() {
         return RECIPE_HELPER;
         return RECIPE_HELPER;
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public static ConfigManager getConfigManager() {
     public static ConfigManager getConfigManager() {
         return configManager;
         return configManager;
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public static EntryRegistry getEntryRegistry() {
     public static EntryRegistry getEntryRegistry() {
         return ENTRY_REGISTRY;
         return ENTRY_REGISTRY;
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public static DisplayHelper getDisplayHelper() {
     public static DisplayHelper getDisplayHelper() {
         return DISPLAY_HELPER;
         return DISPLAY_HELPER;
     }
     }
-    
+
     /**
     /**
      * Registers a REI plugin
      * Registers a REI plugin
      *
      *
@@ -103,18 +107,18 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
         RoughlyEnoughItemsCore.LOGGER.debug("[REI] Registered plugin %s from %s", plugin.getPluginIdentifier().toString(), plugin.getClass().getSimpleName());
         RoughlyEnoughItemsCore.LOGGER.debug("[REI] Registered plugin %s from %s", plugin.getPluginIdentifier().toString(), plugin.getClass().getSimpleName());
         return plugin;
         return plugin;
     }
     }
-    
+
     public static List<REIPluginEntry> getPlugins() {
     public static List<REIPluginEntry> getPlugins() {
         return new LinkedList<>(plugins.values());
         return new LinkedList<>(plugins.values());
     }
     }
-    
+
     public static Optional<Identifier> getPluginIdentifier(REIPluginEntry plugin) {
     public static Optional<Identifier> getPluginIdentifier(REIPluginEntry plugin) {
-        for(Identifier identifier : plugins.keySet())
+        for (Identifier identifier : plugins.keySet())
             if (identifier != null && plugins.get(identifier).equals(plugin))
             if (identifier != null && plugins.get(identifier).equals(plugin))
                 return Optional.of(identifier);
                 return Optional.of(identifier);
         return Optional.empty();
         return Optional.empty();
     }
     }
-    
+
     public static boolean hasPermissionToUsePackets() {
     public static boolean hasPermissionToUsePackets() {
         try {
         try {
             MinecraftClient.getInstance().getNetworkHandler().getCommandSource().hasPermissionLevel(0);
             MinecraftClient.getInstance().getNetworkHandler().getCommandSource().hasPermissionLevel(0);
@@ -123,7 +127,7 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
             return true;
             return true;
         }
         }
     }
     }
-    
+
     public static boolean hasOperatorPermission() {
     public static boolean hasOperatorPermission() {
         try {
         try {
             return MinecraftClient.getInstance().getNetworkHandler().getCommandSource().hasPermissionLevel(1);
             return MinecraftClient.getInstance().getNetworkHandler().getCommandSource().hasPermissionLevel(1);
@@ -131,11 +135,11 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
             return true;
             return true;
         }
         }
     }
     }
-    
+
     public static boolean canUsePackets() {
     public static boolean canUsePackets() {
         return ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.CREATE_ITEMS_PACKET) && ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.DELETE_ITEMS_PACKET);
         return ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.CREATE_ITEMS_PACKET) && ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.DELETE_ITEMS_PACKET);
     }
     }
-    
+
     @Internal
     @Internal
     @Deprecated
     @Deprecated
     public static void syncRecipes(AtomicLong lastSync) {
     public static void syncRecipes(AtomicLong lastSync) {
@@ -153,19 +157,19 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
             ((RecipeHelperImpl) RecipeHelper.getInstance()).recipesLoaded(recipeManager);
             ((RecipeHelperImpl) RecipeHelper.getInstance()).recipesLoaded(recipeManager);
         }
         }
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     @Override
     @Override
     public void onInitializeClient() {
     public void onInitializeClient() {
         configManager = new ConfigManagerImpl();
         configManager = new ConfigManagerImpl();
-        
+
         registerClothEvents();
         registerClothEvents();
         discoverPluginEntries();
         discoverPluginEntries();
-        for(ModContainer modContainer : FabricLoader.getInstance().getAllMods()) {
+        for (ModContainer modContainer : FabricLoader.getInstance().getAllMods()) {
             if (modContainer.getMetadata().containsCustomValue("roughlyenoughitems:plugins"))
             if (modContainer.getMetadata().containsCustomValue("roughlyenoughitems:plugins"))
                 RoughlyEnoughItemsCore.LOGGER.error("[REI] REI plugin from " + modContainer.getMetadata().getId() + " is not loaded because it is too old!");
                 RoughlyEnoughItemsCore.LOGGER.error("[REI] REI plugin from " + modContainer.getMetadata().getId() + " is not loaded because it is too old!");
         }
         }
-        
+
         ClientSidePacketRegistry.INSTANCE.register(RoughlyEnoughItemsNetwork.CREATE_ITEMS_MESSAGE_PACKET, (packetContext, packetByteBuf) -> {
         ClientSidePacketRegistry.INSTANCE.register(RoughlyEnoughItemsNetwork.CREATE_ITEMS_MESSAGE_PACKET, (packetContext, packetByteBuf) -> {
             ItemStack stack = packetByteBuf.readItemStack();
             ItemStack stack = packetByteBuf.readItemStack();
             String player = packetByteBuf.readString(32767);
             String player = packetByteBuf.readString(32767);
@@ -177,21 +181,21 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
                 RecipeBookWidget recipeBookGui = ((RecipeBookProvider) currentScreen).getRecipeBookGui();
                 RecipeBookWidget recipeBookGui = ((RecipeBookProvider) currentScreen).getRecipeBookGui();
                 RecipeBookGhostSlots ghostSlots = ((RecipeBookGuiHooks) recipeBookGui).rei_getGhostSlots();
                 RecipeBookGhostSlots ghostSlots = ((RecipeBookGuiHooks) recipeBookGui).rei_getGhostSlots();
                 ghostSlots.reset();
                 ghostSlots.reset();
-                
+
                 List<List<ItemStack>> input = Lists.newArrayList();
                 List<List<ItemStack>> input = Lists.newArrayList();
                 int mapSize = packetByteBuf.readInt();
                 int mapSize = packetByteBuf.readInt();
-                for(int i = 0; i < mapSize; i++) {
+                for (int i = 0; i < mapSize; i++) {
                     List<ItemStack> list = Lists.newArrayList();
                     List<ItemStack> list = Lists.newArrayList();
                     int count = packetByteBuf.readInt();
                     int count = packetByteBuf.readInt();
-                    for(int j = 0; j < count; j++) {
+                    for (int j = 0; j < count; j++) {
                         list.add(packetByteBuf.readItemStack());
                         list.add(packetByteBuf.readItemStack());
                     }
                     }
                     input.add(list);
                     input.add(list);
                 }
                 }
-                
+
                 ghostSlots.addSlot(Ingredient.ofItems(Items.STONE), 381203812, 12738291);
                 ghostSlots.addSlot(Ingredient.ofItems(Items.STONE), 381203812, 12738291);
                 CraftingTableContainer container = ((CraftingTableScreen) currentScreen).getContainer();
                 CraftingTableContainer container = ((CraftingTableScreen) currentScreen).getContainer();
-                for(int i = 0; i < input.size(); i++) {
+                for (int i = 0; i < input.size(); i++) {
                     List<ItemStack> stacks = input.get(i);
                     List<ItemStack> stacks = input.get(i);
                     if (!stacks.isEmpty()) {
                     if (!stacks.isEmpty()) {
                         Slot slot = container.getSlot(i + container.getCraftingResultSlotIndex() + 1);
                         Slot slot = container.getSlot(i + container.getCraftingResultSlotIndex() + 1);
@@ -201,10 +205,10 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
             }
             }
         });
         });
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     private void discoverPluginEntries() {
     private void discoverPluginEntries() {
-        for(REIPluginEntry reiPlugin : FabricLoader.getInstance().getEntrypoints("rei_plugins", REIPluginEntry.class)) {
+        for (REIPluginEntry reiPlugin : FabricLoader.getInstance().getEntrypoints("rei_plugins", REIPluginEntry.class)) {
             try {
             try {
                 if (!REIPluginV0.class.isAssignableFrom(reiPlugin.getClass()))
                 if (!REIPluginV0.class.isAssignableFrom(reiPlugin.getClass()))
                     throw new IllegalArgumentException("REI plugin is too old!");
                     throw new IllegalArgumentException("REI plugin is too old!");
@@ -214,7 +218,7 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
                 RoughlyEnoughItemsCore.LOGGER.error("[REI] Can't load REI plugins from %s: %s", reiPlugin.getClass(), e.getLocalizedMessage());
                 RoughlyEnoughItemsCore.LOGGER.error("[REI] Can't load REI plugins from %s: %s", reiPlugin.getClass(), e.getLocalizedMessage());
             }
             }
         }
         }
-        for(REIPluginV0 reiPlugin : FabricLoader.getInstance().getEntrypoints("rei_plugins_v0", REIPluginV0.class)) {
+        for (REIPluginV0 reiPlugin : FabricLoader.getInstance().getEntrypoints("rei_plugins_v0", REIPluginV0.class)) {
             try {
             try {
                 registerPlugin(reiPlugin);
                 registerPlugin(reiPlugin);
             } catch (Exception e) {
             } catch (Exception e) {
@@ -222,18 +226,18 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
                 RoughlyEnoughItemsCore.LOGGER.error("[REI] Can't load REI plugins from %s: %s", reiPlugin.getClass(), e.getLocalizedMessage());
                 RoughlyEnoughItemsCore.LOGGER.error("[REI] Can't load REI plugins from %s: %s", reiPlugin.getClass(), e.getLocalizedMessage());
             }
             }
         }
         }
-        
+
         // Test Only
         // Test Only
         loadTestPlugins();
         loadTestPlugins();
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     private void loadTestPlugins() {
     private void loadTestPlugins() {
         if (System.getProperty("rei.test", "false").equals("true")) {
         if (System.getProperty("rei.test", "false").equals("true")) {
             registerPlugin(new REITestPlugin());
             registerPlugin(new REITestPlugin());
         }
         }
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     private void registerClothEvents() {
     private void registerClothEvents() {
         final Identifier recipeButtonTex = new Identifier("textures/gui/recipe_button.png");
         final Identifier recipeButtonTex = new Identifier("textures/gui/recipe_button.png");
@@ -251,7 +255,7 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
                     return;
                     return;
                 ScreenHelper.setLastContainerScreen((AbstractContainerScreen<?>) screen);
                 ScreenHelper.setLastContainerScreen((AbstractContainerScreen<?>) screen);
                 boolean alreadyAdded = false;
                 boolean alreadyAdded = false;
-                for(Element element : Lists.newArrayList(screenHooks.cloth_getInputListeners()))
+                for (Element element : Lists.newArrayList(screenHooks.cloth_getInputListeners()))
                     if (ContainerScreenOverlay.class.isAssignableFrom(element.getClass()))
                     if (ContainerScreenOverlay.class.isAssignableFrom(element.getClass()))
                         if (alreadyAdded)
                         if (alreadyAdded)
                             screenHooks.cloth_getInputListeners().remove(element);
                             screenHooks.cloth_getInputListeners().remove(element);
@@ -313,5 +317,5 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
             return ActionResult.PASS;
             return ActionResult.PASS;
         });
         });
     }
     }
-    
+
 }
 }

+ 3 - 3
src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java

@@ -27,13 +27,13 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 public class RoughlyEnoughItemsNetwork implements ModInitializer {
 public class RoughlyEnoughItemsNetwork implements ModInitializer {
-    
+
     public static final Identifier DELETE_ITEMS_PACKET = new Identifier("roughlyenoughitems", "delete_item");
     public static final Identifier DELETE_ITEMS_PACKET = new Identifier("roughlyenoughitems", "delete_item");
     public static final Identifier CREATE_ITEMS_PACKET = new Identifier("roughlyenoughitems", "create_item");
     public static final Identifier CREATE_ITEMS_PACKET = new Identifier("roughlyenoughitems", "create_item");
     public static final Identifier CREATE_ITEMS_MESSAGE_PACKET = new Identifier("roughlyenoughitems", "ci_msg");
     public static final Identifier CREATE_ITEMS_MESSAGE_PACKET = new Identifier("roughlyenoughitems", "ci_msg");
     public static final Identifier MOVE_ITEMS_PACKET = new Identifier("roughlyenoughitems", "move_items");
     public static final Identifier MOVE_ITEMS_PACKET = new Identifier("roughlyenoughitems", "move_items");
     public static final Identifier NOT_ENOUGH_ITEMS_PACKET = new Identifier("roughlyenoughitems", "og_not_enough");
     public static final Identifier NOT_ENOUGH_ITEMS_PACKET = new Identifier("roughlyenoughitems", "og_not_enough");
-    
+
     @Override
     @Override
     public void onInitialize() {
     public void onInitialize() {
         FabricLoader.getInstance().getEntrypoints("rei_containers", Runnable.class).forEach(Runnable::run);
         FabricLoader.getInstance().getEntrypoints("rei_containers", Runnable.class).forEach(Runnable::run);
@@ -103,5 +103,5 @@ public class RoughlyEnoughItemsNetwork implements ModInitializer {
             }
             }
         });
         });
     }
     }
-    
+
 }
 }

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

@@ -16,89 +16,89 @@ import net.minecraft.container.Container;
 import java.util.function.Supplier;
 import java.util.function.Supplier;
 
 
 public interface AutoTransferHandler {
 public interface AutoTransferHandler {
-    
+
     default double getPriority() {
     default double getPriority() {
         return 0d;
         return 0d;
     }
     }
-    
+
     Result handle(Context context);
     Result handle(Context context);
-    
+
     public interface Result {
     public interface Result {
         static Result createSuccessful() {
         static Result createSuccessful() {
             return new ResultImpl();
             return new ResultImpl();
         }
         }
-        
+
         static Result createNotApplicable() {
         static Result createNotApplicable() {
             return new ResultImpl(false);
             return new ResultImpl(false);
         }
         }
-        
+
         static Result createFailed(String errorKey) {
         static Result createFailed(String errorKey) {
             return new ResultImpl(errorKey, new IntArrayList(), 1744764928);
             return new ResultImpl(errorKey, new IntArrayList(), 1744764928);
         }
         }
-        
+
         static Result createFailedCustomButtonColor(String errorKey, int color) {
         static Result createFailedCustomButtonColor(String errorKey, int color) {
             return new ResultImpl(errorKey, new IntArrayList(), color);
             return new ResultImpl(errorKey, new IntArrayList(), color);
         }
         }
-        
+
         static Result createFailed(String errorKey, IntList redSlots) {
         static Result createFailed(String errorKey, IntList redSlots) {
             return new ResultImpl(errorKey, redSlots, 1744764928);
             return new ResultImpl(errorKey, redSlots, 1744764928);
         }
         }
-        
+
         static Result createFailedCustomButtonColor(String errorKey, IntList redSlots, int color) {
         static Result createFailedCustomButtonColor(String errorKey, IntList redSlots, int color) {
             return new ResultImpl(errorKey, redSlots, color);
             return new ResultImpl(errorKey, redSlots, color);
         }
         }
-        
+
         int getColor();
         int getColor();
-        
+
         boolean isSuccessful();
         boolean isSuccessful();
-        
+
         boolean isApplicable();
         boolean isApplicable();
-        
+
         String getErrorKey();
         String getErrorKey();
-        
+
         IntList getIntegers();
         IntList getIntegers();
     }
     }
-    
+
     public interface Context {
     public interface Context {
         static Context create(boolean actuallyCrafting, AbstractContainerScreen<?> containerScreen, RecipeDisplay recipeDisplay) {
         static Context create(boolean actuallyCrafting, AbstractContainerScreen<?> containerScreen, RecipeDisplay recipeDisplay) {
             return new ContextImpl(actuallyCrafting, containerScreen, () -> recipeDisplay);
             return new ContextImpl(actuallyCrafting, containerScreen, () -> recipeDisplay);
         }
         }
-        
+
         default MinecraftClient getMinecraft() {
         default MinecraftClient getMinecraft() {
             return MinecraftClient.getInstance();
             return MinecraftClient.getInstance();
         }
         }
-        
+
         boolean isActuallyCrafting();
         boolean isActuallyCrafting();
-        
+
         AbstractContainerScreen<?> getContainerScreen();
         AbstractContainerScreen<?> getContainerScreen();
-        
+
         RecipeDisplay getRecipe();
         RecipeDisplay getRecipe();
-        
+
         default Container getContainer() {
         default Container getContainer() {
             return getContainerScreen().getContainer();
             return getContainerScreen().getContainer();
         }
         }
-        
+
         default ContainerScreenOverlay getOverlay() {
         default ContainerScreenOverlay getOverlay() {
             return ScreenHelper.getLastOverlay();
             return ScreenHelper.getLastOverlay();
         }
         }
     }
     }
-    
+
     public final class ResultImpl implements Result {
     public final class ResultImpl implements Result {
         private boolean successful, applicable;
         private boolean successful, applicable;
         private String errorKey;
         private String errorKey;
         private IntList integers = new IntArrayList();
         private IntList integers = new IntArrayList();
         private int color;
         private int color;
-        
+
         private ResultImpl() {
         private ResultImpl() {
             this.successful = true;
             this.successful = true;
             this.applicable = true;
             this.applicable = true;
         }
         }
-        
+
         public ResultImpl(boolean applicable) {
         public ResultImpl(boolean applicable) {
             this.successful = false;
             this.successful = false;
             this.applicable = applicable;
             this.applicable = applicable;
         }
         }
-        
+
         public ResultImpl(String errorKey, IntList integers, int color) {
         public ResultImpl(String errorKey, IntList integers, int color) {
             this.successful = false;
             this.successful = false;
             this.applicable = true;
             this.applicable = true;
@@ -107,58 +107,58 @@ public interface AutoTransferHandler {
                 this.integers = integers;
                 this.integers = integers;
             this.color = color;
             this.color = color;
         }
         }
-        
+
         @Override
         @Override
         public int getColor() {
         public int getColor() {
             return color;
             return color;
         }
         }
-        
+
         @Override
         @Override
         public boolean isSuccessful() {
         public boolean isSuccessful() {
             return successful;
             return successful;
         }
         }
-        
+
         @Override
         @Override
         public boolean isApplicable() {
         public boolean isApplicable() {
             return applicable;
             return applicable;
         }
         }
-        
+
         @Override
         @Override
         public String getErrorKey() {
         public String getErrorKey() {
             return errorKey;
             return errorKey;
         }
         }
-        
+
         @Override
         @Override
         public IntList getIntegers() {
         public IntList getIntegers() {
             return integers;
             return integers;
         }
         }
     }
     }
-    
+
     public final class ContextImpl implements Context {
     public final class ContextImpl implements Context {
         boolean actuallyCrafting;
         boolean actuallyCrafting;
         AbstractContainerScreen<?> containerScreen;
         AbstractContainerScreen<?> containerScreen;
         Supplier<RecipeDisplay> recipeDisplaySupplier;
         Supplier<RecipeDisplay> recipeDisplaySupplier;
-        
+
         private ContextImpl(boolean actuallyCrafting, AbstractContainerScreen<?> containerScreen, Supplier<RecipeDisplay> recipeDisplaySupplier) {
         private ContextImpl(boolean actuallyCrafting, AbstractContainerScreen<?> containerScreen, Supplier<RecipeDisplay> recipeDisplaySupplier) {
             this.actuallyCrafting = actuallyCrafting;
             this.actuallyCrafting = actuallyCrafting;
             this.containerScreen = containerScreen;
             this.containerScreen = containerScreen;
             this.recipeDisplaySupplier = recipeDisplaySupplier;
             this.recipeDisplaySupplier = recipeDisplaySupplier;
         }
         }
-        
+
         @Override
         @Override
         public boolean isActuallyCrafting() {
         public boolean isActuallyCrafting() {
             return actuallyCrafting;
             return actuallyCrafting;
         }
         }
-        
+
         @Override
         @Override
         public AbstractContainerScreen<?> getContainerScreen() {
         public AbstractContainerScreen<?> getContainerScreen() {
             return containerScreen;
             return containerScreen;
         }
         }
-        
+
         @Override
         @Override
         public RecipeDisplay getRecipe() {
         public RecipeDisplay getRecipe() {
             return recipeDisplaySupplier.get();
             return recipeDisplaySupplier.get();
         }
         }
     }
     }
-    
+
 }
 }

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

@@ -26,16 +26,16 @@ public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Sc
     default List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide) {
     default List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide) {
         return getExclusionZones(currentScreenClass, false);
         return getExclusionZones(currentScreenClass, false);
     }
     }
-    
+
     @Deprecated
     @Deprecated
     default List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide, boolean sort) {
     default List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide, boolean sort) {
         return getExclusionZones(currentScreenClass, sort);
         return getExclusionZones(currentScreenClass, sort);
     }
     }
-    
+
     List<Rectangle> getExclusionZones(Class<?> currentScreenClass, boolean sort);
     List<Rectangle> getExclusionZones(Class<?> currentScreenClass, boolean sort);
-    
+
     int supplierSize();
     int supplierSize();
-    
+
     /**
     /**
      * Register an exclusion zone
      * Register an exclusion zone
      *
      *
@@ -51,7 +51,7 @@ public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Sc
             return zones;
             return zones;
         });
         });
     }
     }
-    
+
     void registerExclusionZones(Class<?> screenClass, Supplier<List<Rectangle>> supplier);
     void registerExclusionZones(Class<?> screenClass, Supplier<List<Rectangle>> supplier);
-    
+
 }
 }

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

@@ -8,7 +8,7 @@ package me.shedaniel.rei.api;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.math.api.Rectangle;
 
 
 public interface ButtonAreaSupplier {
 public interface ButtonAreaSupplier {
-    
+
     /**
     /**
      * Declares the button bounds
      * Declares the button bounds
      *
      *
@@ -16,7 +16,7 @@ public interface ButtonAreaSupplier {
      * @return the bounds of the button
      * @return the bounds of the button
      */
      */
     Rectangle get(Rectangle bounds);
     Rectangle get(Rectangle bounds);
-    
+
     /**
     /**
      * Declares the button text
      * Declares the button text
      *
      *
@@ -25,5 +25,5 @@ public interface ButtonAreaSupplier {
     default String getButtonText() {
     default String getButtonText() {
         return "+";
         return "+";
     }
     }
-    
+
 }
 }

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

@@ -22,14 +22,14 @@ public interface ClientHelper {
     static ClientHelper getInstance() {
     static ClientHelper getInstance() {
         return ClientHelperImpl.instance;
         return ClientHelperImpl.instance;
     }
     }
-    
+
     /**
     /**
      * Checks if cheating is enabled
      * Checks if cheating is enabled
      *
      *
      * @return whether cheating is enabled
      * @return whether cheating is enabled
      */
      */
     boolean isCheating();
     boolean isCheating();
-    
+
     /**
     /**
      * Sets current cheating mode
      * Sets current cheating mode
      * Should save the config in {@link ConfigManager}.
      * Should save the config in {@link ConfigManager}.
@@ -37,9 +37,9 @@ public interface ClientHelper {
      * @param cheating the new cheating mode
      * @param cheating the new cheating mode
      */
      */
     void setCheating(boolean cheating);
     void setCheating(boolean cheating);
-    
+
     List<ItemStack> getInventoryItemsTypes();
     List<ItemStack> getInventoryItemsTypes();
-    
+
     /**
     /**
      * Opens a recipe viewing screen:
      * Opens a recipe viewing screen:
      * Opens {@link me.shedaniel.rei.gui.PreRecipeViewingScreen} if not set
      * Opens {@link me.shedaniel.rei.gui.PreRecipeViewingScreen} if not set
@@ -49,12 +49,12 @@ public interface ClientHelper {
      * @param map the map of recipes
      * @param map the map of recipes
      */
      */
     void openRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map);
     void openRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map);
-    
+
     /**
     /**
      * Registers REI's keybinds using Fabric API.
      * Registers REI's keybinds using Fabric API.
      */
      */
     void registerFabricKeyBinds();
     void registerFabricKeyBinds();
-    
+
     /**
     /**
      * Tries to cheat stack using either packets or commands.
      * Tries to cheat stack using either packets or commands.
      *
      *
@@ -62,11 +62,11 @@ public interface ClientHelper {
      * @return whether it failed
      * @return whether it failed
      */
      */
     boolean tryCheatingEntry(EntryStack stack);
     boolean tryCheatingEntry(EntryStack stack);
-    
+
     default boolean tryCheatingStack(ItemStack stack) {
     default boolean tryCheatingStack(ItemStack stack) {
         return tryCheatingEntry(EntryStack.create(stack));
         return tryCheatingEntry(EntryStack.create(stack));
     }
     }
-    
+
     /**
     /**
      * Finds recipe for the stack and opens the recipe screen.
      * Finds recipe for the stack and opens the recipe screen.
      *
      *
@@ -74,11 +74,11 @@ public interface ClientHelper {
      * @return whether the stack has any recipes to show
      * @return whether the stack has any recipes to show
      */
      */
     boolean executeRecipeKeyBind(EntryStack stack);
     boolean executeRecipeKeyBind(EntryStack stack);
-    
+
     default boolean executeRecipeKeyBind(ItemStack stack) {
     default boolean executeRecipeKeyBind(ItemStack stack) {
         return executeRecipeKeyBind(EntryStack.create(stack));
         return executeRecipeKeyBind(EntryStack.create(stack));
     }
     }
-    
+
     /**
     /**
      * Finds usage for the stack and opens the recipe screen.
      * Finds usage for the stack and opens the recipe screen.
      *
      *
@@ -86,15 +86,15 @@ public interface ClientHelper {
      * @return whether the stack has any usages to show
      * @return whether the stack has any usages to show
      */
      */
     boolean executeUsageKeyBind(EntryStack stack);
     boolean executeUsageKeyBind(EntryStack stack);
-    
+
     default boolean executeUsageKeyBind(ItemStack stack) {
     default boolean executeUsageKeyBind(ItemStack stack) {
         return executeUsageKeyBind(EntryStack.create(stack));
         return executeUsageKeyBind(EntryStack.create(stack));
     }
     }
-    
+
     FabricKeyBinding getFocusSearchFieldKeyBinding();
     FabricKeyBinding getFocusSearchFieldKeyBinding();
-    
+
     FabricKeyBinding getCopyRecipeIdentifierKeyBinding();
     FabricKeyBinding getCopyRecipeIdentifierKeyBinding();
-    
+
     /**
     /**
      * Gets the mod from an item
      * Gets the mod from an item
      *
      *
@@ -102,12 +102,12 @@ public interface ClientHelper {
      * @return the mod name
      * @return the mod name
      */
      */
     String getModFromItem(Item item);
     String getModFromItem(Item item);
-    
+
     /**
     /**
      * Tries to delete the player's cursor item
      * Tries to delete the player's cursor item
      */
      */
     void sendDeletePacket();
     void sendDeletePacket();
-    
+
     /**
     /**
      * Gets the formatted mod from an item
      * Gets the formatted mod from an item
      *
      *
@@ -115,7 +115,7 @@ public interface ClientHelper {
      * @return the mod name with blue and italic formatting
      * @return the mod name with blue and italic formatting
      */
      */
     String getFormattedModFromItem(Item item);
     String getFormattedModFromItem(Item item);
-    
+
     /**
     /**
      * Gets the formatted mod from an identifier
      * Gets the formatted mod from an identifier
      *
      *
@@ -123,7 +123,7 @@ public interface ClientHelper {
      * @return the mod name with blue and italic formatting
      * @return the mod name with blue and italic formatting
      */
      */
     String getFormattedModFromIdentifier(Identifier identifier);
     String getFormattedModFromIdentifier(Identifier identifier);
-    
+
     /**
     /**
      * Gets the mod from an identifier
      * Gets the mod from an identifier
      *
      *
@@ -131,42 +131,42 @@ public interface ClientHelper {
      * @return the mod name
      * @return the mod name
      */
      */
     String getModFromIdentifier(Identifier identifier);
     String getModFromIdentifier(Identifier identifier);
-    
+
     FabricKeyBinding[] getREIKeyBindings();
     FabricKeyBinding[] getREIKeyBindings();
-    
+
     /**
     /**
      * @return the recipe keybind, defaulted R
      * @return the recipe keybind, defaulted R
      */
      */
     FabricKeyBinding getRecipeKeyBinding();
     FabricKeyBinding getRecipeKeyBinding();
-    
+
     /**
     /**
      * @return the usage keybind, defaulted U
      * @return the usage keybind, defaulted U
      */
      */
     FabricKeyBinding getUsageKeyBinding();
     FabricKeyBinding getUsageKeyBinding();
-    
+
     /**
     /**
      * @return the hide keybind, defaulted O
      * @return the hide keybind, defaulted O
      */
      */
     FabricKeyBinding getHideKeyBinding();
     FabricKeyBinding getHideKeyBinding();
-    
+
     /**
     /**
      * @return the previous page keybind, defaulted not set
      * @return the previous page keybind, defaulted not set
      */
      */
     FabricKeyBinding getPreviousPageKeyBinding();
     FabricKeyBinding getPreviousPageKeyBinding();
-    
+
     /**
     /**
      * @return the next page keybind, defaulted not set
      * @return the next page keybind, defaulted not set
      */
      */
     FabricKeyBinding getNextPageKeyBinding();
     FabricKeyBinding getNextPageKeyBinding();
-    
+
     /**
     /**
      * Finds all recipes and open them in a recipe screen.
      * Finds all recipes and open them in a recipe screen.
      *
      *
      * @return whether there are any recipes to show
      * @return whether there are any recipes to show
      */
      */
     boolean executeViewAllRecipesKeyBind();
     boolean executeViewAllRecipesKeyBind();
-    
+
     boolean executeViewAllRecipesFromCategory(Identifier category);
     boolean executeViewAllRecipesFromCategory(Identifier category);
-    
+
     boolean executeViewAllRecipesFromCategories(List<Identifier> categories);
     boolean executeViewAllRecipesFromCategories(List<Identifier> categories);
 }
 }

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

@@ -11,19 +11,19 @@ import net.minecraft.client.gui.screen.Screen;
 import java.util.List;
 import java.util.List;
 
 
 public interface ConfigManager {
 public interface ConfigManager {
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     static ConfigManager getInstance() {
     static ConfigManager getInstance() {
         return RoughlyEnoughItemsCore.getConfigManager();
         return RoughlyEnoughItemsCore.getConfigManager();
     }
     }
-    
+
     List<EntryStack> getFavorites();
     List<EntryStack> getFavorites();
-    
+
     /**
     /**
      * Saves the config.
      * Saves the config.
      */
      */
     void saveConfig();
     void saveConfig();
-    
+
     /**
     /**
      * Gets the config instance
      * Gets the config instance
      *
      *
@@ -32,26 +32,26 @@ public interface ConfigManager {
      */
      */
     @Deprecated
     @Deprecated
     ConfigObject getConfig();
     ConfigObject getConfig();
-    
+
     /**
     /**
      * Gets if craftable only filter is enabled
      * Gets if craftable only filter is enabled
      *
      *
      * @return whether craftable only filter is enabled
      * @return whether craftable only filter is enabled
      */
      */
     boolean isCraftableOnlyEnabled();
     boolean isCraftableOnlyEnabled();
-    
+
     /**
     /**
      * Toggles the craftable only filter
      * Toggles the craftable only filter
      */
      */
     void toggleCraftableOnly();
     void toggleCraftableOnly();
-    
+
     /**
     /**
      * Opens the config screen
      * Opens the config screen
      *
      *
      * @param parent the screen shown before
      * @param parent the screen shown before
      */
      */
     void openConfigScreen(Screen parent);
     void openConfigScreen(Screen parent);
-    
+
     /**
     /**
      * Gets the config screen
      * Gets the config screen
      *
      *
@@ -59,5 +59,5 @@ public interface ConfigManager {
      * @return the config screen
      * @return the config screen
      */
      */
     Screen getConfigScreen(Screen parent);
     Screen getConfigScreen(Screen parent);
-    
+
 }
 }

+ 52 - 47
src/main/java/me/shedaniel/rei/api/ConfigObject.java

@@ -17,103 +17,108 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 import java.lang.annotation.Target;
 
 
 public interface ConfigObject {
 public interface ConfigObject {
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     static ConfigObject getInstance() {
     static ConfigObject getInstance() {
         return ConfigManager.getInstance().getConfig();
         return ConfigManager.getInstance().getConfig();
     }
     }
-    
+
     boolean isLighterButtonHover();
     boolean isLighterButtonHover();
-    
+
     void setLighterButtonHover(boolean lighterButtonHover);
     void setLighterButtonHover(boolean lighterButtonHover);
-    
+
     boolean isOverlayVisible();
     boolean isOverlayVisible();
-    
+
     void setOverlayVisible(boolean overlayVisible);
     void setOverlayVisible(boolean overlayVisible);
-    
+
     boolean isCheating();
     boolean isCheating();
-    
+
     void setCheating(boolean cheating);
     void setCheating(boolean cheating);
-    
+
     ItemListOrdering getItemListOrdering();
     ItemListOrdering getItemListOrdering();
-    
+
     boolean isItemListAscending();
     boolean isItemListAscending();
-    
+
     boolean isUsingDarkTheme();
     boolean isUsingDarkTheme();
-    
+
     boolean isToastDisplayedOnCopyIdentifier();
     boolean isToastDisplayedOnCopyIdentifier();
-    
+
     @Deprecated
     @Deprecated
     default boolean doesRenderEntryExtraOverlay() {
     default boolean doesRenderEntryExtraOverlay() {
         return doesRenderEntryEnchantmentGlint();
         return doesRenderEntryEnchantmentGlint();
     }
     }
-    
+
     boolean doesRenderEntryEnchantmentGlint();
     boolean doesRenderEntryEnchantmentGlint();
-    
+
     boolean isEntryListWidgetScrolled();
     boolean isEntryListWidgetScrolled();
-    
+
     boolean shouldAppendModNames();
     boolean shouldAppendModNames();
-    
+
     RecipeScreenType getRecipeScreenType();
     RecipeScreenType getRecipeScreenType();
-    
+
     void setRecipeScreenType(RecipeScreenType recipeScreenType);
     void setRecipeScreenType(RecipeScreenType recipeScreenType);
-    
+
     boolean isLoadingDefaultPlugin();
     boolean isLoadingDefaultPlugin();
-    
+
     SearchFieldLocation getSearchFieldLocation();
     SearchFieldLocation getSearchFieldLocation();
-    
+
     boolean isLeftHandSidePanel();
     boolean isLeftHandSidePanel();
-    
+
     boolean isCraftableFilterEnabled();
     boolean isCraftableFilterEnabled();
-    
+
     String getGamemodeCommand();
     String getGamemodeCommand();
-    
+
     String getGiveCommand();
     String getGiveCommand();
-    
+
     String getWeatherCommand();
     String getWeatherCommand();
-    
+
     int getMaxRecipePerPage();
     int getMaxRecipePerPage();
-    
+
     boolean doesShowUtilsButtons();
     boolean doesShowUtilsButtons();
-    
+
     boolean doesDisableRecipeBook();
     boolean doesDisableRecipeBook();
-    
+
     boolean doesFixTabCloseContainer();
     boolean doesFixTabCloseContainer();
-    
+
     boolean areClickableRecipeArrowsEnabled();
     boolean areClickableRecipeArrowsEnabled();
-    
+
     ItemCheatingMode getItemCheatingMode();
     ItemCheatingMode getItemCheatingMode();
-    
+
     boolean isUsingLightGrayRecipeBorder();
     boolean isUsingLightGrayRecipeBorder();
-    
+
     boolean doesVillagerScreenHavePermanentScrollBar();
     boolean doesVillagerScreenHavePermanentScrollBar();
-    
+
     boolean doesRegisterRecipesInAnotherThread();
     boolean doesRegisterRecipesInAnotherThread();
-    
+
     boolean doesSnapToRows();
     boolean doesSnapToRows();
-    
+
     boolean isFavoritesEnabled();
     boolean isFavoritesEnabled();
-    
+
     boolean doDisplayFavoritesTooltip();
     boolean doDisplayFavoritesTooltip();
-    
+
     boolean doDisplayFavoritesOnTheLeft();
     boolean doDisplayFavoritesOnTheLeft();
-    
+
     boolean doesFastEntryRendering();
     boolean doesFastEntryRendering();
-    
+
     boolean doDebugRenderTimeRequired();
     boolean doDebugRenderTimeRequired();
-    
+
+    boolean doSearchFavorites();
+
     InputUtil.KeyCode getFavoriteKeybind();
     InputUtil.KeyCode getFavoriteKeybind();
-    
+
     @Retention(RetentionPolicy.RUNTIME)
     @Retention(RetentionPolicy.RUNTIME)
     @Target({ElementType.FIELD})
     @Target({ElementType.FIELD})
-    public @interface AddInFrontKeyCode {}
-    
+    public @interface AddInFrontKeyCode {
+    }
+
     @Retention(RetentionPolicy.RUNTIME)
     @Retention(RetentionPolicy.RUNTIME)
     @Target({ElementType.FIELD})
     @Target({ElementType.FIELD})
-    public @interface DontApplyFieldName {}
-    
+    public @interface DontApplyFieldName {
+    }
+
     @Retention(RetentionPolicy.RUNTIME)
     @Retention(RetentionPolicy.RUNTIME)
     @Target({ElementType.FIELD})
     @Target({ElementType.FIELD})
-    public @interface UseEnumSelectorInstead {}
-    
+    public @interface UseEnumSelectorInstead {
+    }
+
 }
 }

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

@@ -15,12 +15,12 @@ import java.util.List;
 import static net.minecraft.util.ActionResult.PASS;
 import static net.minecraft.util.ActionResult.PASS;
 
 
 public interface DisplayHelper {
 public interface DisplayHelper {
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     static DisplayHelper getInstance() {
     static DisplayHelper getInstance() {
         return RoughlyEnoughItemsCore.getDisplayHelper();
         return RoughlyEnoughItemsCore.getDisplayHelper();
     }
     }
-    
+
     /**
     /**
      * Gets the sorted version of all responsible bounds handlers
      * Gets the sorted version of all responsible bounds handlers
      *
      *
@@ -29,14 +29,14 @@ public interface DisplayHelper {
      * @see DisplayHelper#getResponsibleBoundsHandler(Class) for the unsorted version
      * @see DisplayHelper#getResponsibleBoundsHandler(Class) for the unsorted version
      */
      */
     List<DisplayBoundsHandler<?>> getSortedBoundsHandlers(Class<?> screenClass);
     List<DisplayBoundsHandler<?>> getSortedBoundsHandlers(Class<?> screenClass);
-    
+
     /**
     /**
      * Gets all registered bounds handlers
      * Gets all registered bounds handlers
      *
      *
      * @return the list of registered bounds handlers
      * @return the list of registered bounds handlers
      */
      */
     List<DisplayBoundsHandler<?>> getAllBoundsHandlers();
     List<DisplayBoundsHandler<?>> getAllBoundsHandlers();
-    
+
     /**
     /**
      * Gets all responsible bounds handlers
      * Gets all responsible bounds handlers
      *
      *
@@ -45,21 +45,21 @@ public interface DisplayHelper {
      * @see DisplayHelper#getSortedBoundsHandlers(Class) for the sorted version
      * @see DisplayHelper#getSortedBoundsHandlers(Class) for the sorted version
      */
      */
     DisplayBoundsHandler<?> getResponsibleBoundsHandler(Class<?> screenClass);
     DisplayBoundsHandler<?> getResponsibleBoundsHandler(Class<?> screenClass);
-    
+
     /**
     /**
      * Registers a bounds handler
      * Registers a bounds handler
      *
      *
      * @param handler the handler to register
      * @param handler the handler to register
      */
      */
     void registerBoundsHandler(DisplayBoundsHandler<?> handler);
     void registerBoundsHandler(DisplayBoundsHandler<?> handler);
-    
+
     /**
     /**
      * Gets the base bounds handler api for exclusion zones
      * Gets the base bounds handler api for exclusion zones
      *
      *
      * @return the base bounds handler
      * @return the base bounds handler
      */
      */
     BaseBoundsHandler getBaseBoundsHandler();
     BaseBoundsHandler getBaseBoundsHandler();
-    
+
     public static interface DisplayBoundsHandler<T> {
     public static interface DisplayBoundsHandler<T> {
         /**
         /**
          * Gets the base supported class for the bounds handler
          * Gets the base supported class for the bounds handler
@@ -67,7 +67,7 @@ public interface DisplayHelper {
          * @return the base class
          * @return the base class
          */
          */
         Class<?> getBaseSupportedClass();
         Class<?> getBaseSupportedClass();
-        
+
         /**
         /**
          * Gets the left bounds of the overlay
          * Gets the left bounds of the overlay
          *
          *
@@ -75,7 +75,7 @@ public interface DisplayHelper {
          * @return the left bounds
          * @return the left bounds
          */
          */
         Rectangle getLeftBounds(T screen);
         Rectangle getLeftBounds(T screen);
-        
+
         /**
         /**
          * Gets the right bounds of the overlay
          * Gets the right bounds of the overlay
          *
          *
@@ -83,7 +83,7 @@ public interface DisplayHelper {
          * @return the right bounds
          * @return the right bounds
          */
          */
         Rectangle getRightBounds(T screen);
         Rectangle getRightBounds(T screen);
-        
+
         /**
         /**
          * Checks if item slot can fit the screen
          * Checks if item slot can fit the screen
          *
          *
@@ -97,7 +97,7 @@ public interface DisplayHelper {
         default ActionResult canItemSlotWidgetFit(int left, int top, T screen, Rectangle fullBounds) {
         default ActionResult canItemSlotWidgetFit(int left, int top, T screen, Rectangle fullBounds) {
             return PASS;
             return PASS;
         }
         }
-        
+
         /**
         /**
          * Checks if item slot can fit the screen
          * Checks if item slot can fit the screen
          *
          *
@@ -113,7 +113,7 @@ public interface DisplayHelper {
         default ActionResult canItemSlotWidgetFit(boolean isOnRightSide, int left, int top, T screen, Rectangle fullBounds) {
         default ActionResult canItemSlotWidgetFit(boolean isOnRightSide, int left, int top, T screen, Rectangle fullBounds) {
             return canItemSlotWidgetFit(left, top, screen, fullBounds);
             return canItemSlotWidgetFit(left, top, screen, fullBounds);
         }
         }
-        
+
         /**
         /**
          * Checks if mouse is inside the overlay
          * Checks if mouse is inside the overlay
          *
          *
@@ -127,7 +127,7 @@ public interface DisplayHelper {
         default ActionResult isInZone(boolean isOnRightSide, double mouseX, double mouseY) {
         default ActionResult isInZone(boolean isOnRightSide, double mouseX, double mouseY) {
             return isInZone(mouseX, mouseY);
             return isInZone(mouseX, mouseY);
         }
         }
-        
+
         /**
         /**
          * Checks if mouse is inside the overlay
          * Checks if mouse is inside the overlay
          *
          *
@@ -138,7 +138,7 @@ public interface DisplayHelper {
         default ActionResult isInZone(double mouseX, double mouseY) {
         default ActionResult isInZone(double mouseX, double mouseY) {
             return PASS;
             return PASS;
         }
         }
-        
+
         /**
         /**
          * Gets the item list bounds by the overlay bounds
          * Gets the item list bounds by the overlay bounds
          *
          *
@@ -148,12 +148,12 @@ public interface DisplayHelper {
         default Rectangle getItemListArea(Rectangle rectangle) {
         default Rectangle getItemListArea(Rectangle rectangle) {
             return new Rectangle(rectangle.x + 1, rectangle.y + 2 + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + (ConfigObject.getInstance().isEntryListWidgetScrolled() ? 0 : 22), rectangle.width - 2, rectangle.height - (ConfigObject.getInstance().getSearchFieldLocation() != SearchFieldLocation.CENTER ? 27 + 22 : 27) + (!ConfigObject.getInstance().isEntryListWidgetScrolled() ? 0 : 22));
             return new Rectangle(rectangle.x + 1, rectangle.y + 2 + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + (ConfigObject.getInstance().isEntryListWidgetScrolled() ? 0 : 22), rectangle.width - 2, rectangle.height - (ConfigObject.getInstance().getSearchFieldLocation() != SearchFieldLocation.CENTER ? 27 + 22 : 27) + (!ConfigObject.getInstance().isEntryListWidgetScrolled() ? 0 : 22));
         }
         }
-        
+
         default Rectangle getFavoritesListArea(Rectangle rectangle) {
         default Rectangle getFavoritesListArea(Rectangle rectangle) {
             int offset = 31 + (ConfigObject.getInstance().doesShowUtilsButtons() ? 25 : 0);
             int offset = 31 + (ConfigObject.getInstance().doesShowUtilsButtons() ? 25 : 0);
             return new Rectangle(rectangle.x + 1, rectangle.y + 2 + offset, rectangle.width - 2, rectangle.height - 5 - offset);
             return new Rectangle(rectangle.x + 1, rectangle.y + 2 + offset, rectangle.width - 2, rectangle.height - 5 - offset);
         }
         }
-        
+
         /**
         /**
          * Checks if REI should recalculate the overlay bounds
          * Checks if REI should recalculate the overlay bounds
          *
          *
@@ -164,7 +164,7 @@ public interface DisplayHelper {
         default boolean shouldRecalculateArea(boolean isOnRightSide, Rectangle rectangle) {
         default boolean shouldRecalculateArea(boolean isOnRightSide, Rectangle rectangle) {
             return false;
             return false;
         }
         }
-        
+
         /**
         /**
          * Gets the priority of the handler, the higher it is, the earlier it is called.
          * Gets the priority of the handler, the higher it is, the earlier it is called.
          *
          *
@@ -174,5 +174,5 @@ public interface DisplayHelper {
             return 0f;
             return 0f;
         }
         }
     }
     }
-    
+
 }
 }

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

@@ -8,7 +8,7 @@ package me.shedaniel.rei.api;
 import net.minecraft.util.ActionResult;
 import net.minecraft.util.ActionResult;
 
 
 public interface DisplayVisibilityHandler {
 public interface DisplayVisibilityHandler {
-    
+
     /**
     /**
      * Gets the priority of the handler
      * Gets the priority of the handler
      *
      *
@@ -17,7 +17,7 @@ public interface DisplayVisibilityHandler {
     default float getPriority() {
     default float getPriority() {
         return 0f;
         return 0f;
     }
     }
-    
+
     /**
     /**
      * Handles the visibility of the display.
      * Handles the visibility of the display.
      * {@link ActionResult#PASS} to pass the handling to another handler
      * {@link ActionResult#PASS} to pass the handling to another handler
@@ -29,5 +29,5 @@ public interface DisplayVisibilityHandler {
      * @return the visibility
      * @return the visibility
      */
      */
     ActionResult handleDisplay(RecipeCategory<?> category, RecipeDisplay display);
     ActionResult handleDisplay(RecipeCategory<?> category, RecipeDisplay display);
-    
+
 }
 }

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

@@ -13,19 +13,19 @@ import net.minecraft.item.ItemStack;
 import java.util.List;
 import java.util.List;
 
 
 public interface EntryRegistry {
 public interface EntryRegistry {
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     static EntryRegistry getInstance() {
     static EntryRegistry getInstance() {
         return RoughlyEnoughItemsCore.getEntryRegistry();
         return RoughlyEnoughItemsCore.getEntryRegistry();
     }
     }
-    
+
     /**
     /**
      * Gets the current modifiable stacks list
      * Gets the current modifiable stacks list
      *
      *
      * @return a stacks list
      * @return a stacks list
      */
      */
     List<EntryStack> getStacksList();
     List<EntryStack> getStacksList();
-    
+
     /**
     /**
      * Gets all possible stacks from an item
      * Gets all possible stacks from an item
      *
      *
@@ -33,11 +33,11 @@ public interface EntryRegistry {
      * @return the array of possible stacks
      * @return the array of possible stacks
      */
      */
     ItemStack[] getAllStacksFromItem(Item item);
     ItemStack[] getAllStacksFromItem(Item item);
-    
+
     default void registerEntry(EntryStack stack) {
     default void registerEntry(EntryStack stack) {
         registerEntryAfter(null, stack);
         registerEntryAfter(null, stack);
     }
     }
-    
+
     /**
     /**
      * Registers an new stack to the entry list
      * Registers an new stack to the entry list
      *
      *
@@ -47,7 +47,7 @@ public interface EntryRegistry {
     default void registerEntryAfter(EntryStack afterEntry, EntryStack stack) {
     default void registerEntryAfter(EntryStack afterEntry, EntryStack stack) {
         registerEntryAfter(afterEntry, stack, true);
         registerEntryAfter(afterEntry, stack, true);
     }
     }
-    
+
     /**
     /**
      * Registers an new stack to the entry list
      * Registers an new stack to the entry list
      *
      *
@@ -57,7 +57,7 @@ public interface EntryRegistry {
      */
      */
     @Deprecated
     @Deprecated
     void registerEntryAfter(EntryStack afterEntry, EntryStack stack, boolean checkAlreadyContains);
     void registerEntryAfter(EntryStack afterEntry, EntryStack stack, boolean checkAlreadyContains);
-    
+
     /**
     /**
      * Registers multiple stacks to the item list
      * Registers multiple stacks to the item list
      *
      *
@@ -71,7 +71,7 @@ public interface EntryRegistry {
                 registerEntryAfter(afterStack, stack);
                 registerEntryAfter(afterStack, stack);
         }
         }
     }
     }
-    
+
     /**
     /**
      * Registers multiple stacks to the item list
      * Registers multiple stacks to the item list
      *
      *
@@ -80,7 +80,7 @@ public interface EntryRegistry {
     default void registerEntries(EntryStack... stacks) {
     default void registerEntries(EntryStack... stacks) {
         registerEntriesAfter(null, stacks);
         registerEntriesAfter(null, stacks);
     }
     }
-    
+
     /**
     /**
      * Checks if a stack is already registered
      * Checks if a stack is already registered
      *
      *
@@ -90,5 +90,5 @@ public interface EntryRegistry {
     default boolean alreadyContain(EntryStack stack) {
     default boolean alreadyContain(EntryStack stack) {
         return CollectionUtils.anyMatchEqualsAll(getStacksList(), stack);
         return CollectionUtils.anyMatchEqualsAll(getStacksList(), stack);
     }
     }
-    
+
 }
 }

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

@@ -32,27 +32,27 @@ import java.util.function.Supplier;
 
 
 @SuppressWarnings("deprecation")
 @SuppressWarnings("deprecation")
 public interface EntryStack {
 public interface EntryStack {
-    
+
     static EntryStack empty() {
     static EntryStack empty() {
         return EmptyEntryStack.EMPTY;
         return EmptyEntryStack.EMPTY;
     }
     }
-    
+
     static EntryStack create(Fluid fluid) {
     static EntryStack create(Fluid fluid) {
         return new FluidEntryStack(fluid);
         return new FluidEntryStack(fluid);
     }
     }
-    
+
     static EntryStack create(Fluid fluid, int amount) {
     static EntryStack create(Fluid fluid, int amount) {
         return new FluidEntryStack(fluid, amount);
         return new FluidEntryStack(fluid, amount);
     }
     }
-    
+
     static EntryStack create(ItemStack stack) {
     static EntryStack create(ItemStack stack) {
         return new ItemEntryStack(stack);
         return new ItemEntryStack(stack);
     }
     }
-    
+
     static EntryStack create(ItemConvertible item) {
     static EntryStack create(ItemConvertible item) {
         return new ItemEntryStack(new ItemStack(item));
         return new ItemEntryStack(new ItemStack(item));
     }
     }
-    
+
     @Internal
     @Internal
     @Deprecated
     @Deprecated
     static EntryStack readFromJson(JsonElement jsonElement) {
     static EntryStack readFromJson(JsonElement jsonElement) {
@@ -73,7 +73,7 @@ public interface EntryStack {
             return EntryStack.empty();
             return EntryStack.empty();
         }
         }
     }
     }
-    
+
     @Internal
     @Internal
     @Deprecated
     @Deprecated
     @Nullable
     @Nullable
@@ -102,77 +102,77 @@ public interface EntryStack {
             return null;
             return null;
         }
         }
     }
     }
-    
+
     Optional<Identifier> getIdentifier();
     Optional<Identifier> getIdentifier();
-    
+
     EntryStack.Type getType();
     EntryStack.Type getType();
-    
+
     int getAmount();
     int getAmount();
-    
+
     void setAmount(int amount);
     void setAmount(int amount);
-    
+
     boolean isEmpty();
     boolean isEmpty();
-    
+
     EntryStack copy();
     EntryStack copy();
-    
+
     Object getObject();
     Object getObject();
-    
+
     boolean equals(EntryStack stack, boolean ignoreTags, boolean ignoreAmount);
     boolean equals(EntryStack stack, boolean ignoreTags, boolean ignoreAmount);
-    
+
     boolean equalsIgnoreTagsAndAmount(EntryStack stack);
     boolean equalsIgnoreTagsAndAmount(EntryStack stack);
-    
+
     boolean equalsIgnoreTags(EntryStack stack);
     boolean equalsIgnoreTags(EntryStack stack);
-    
+
     boolean equalsIgnoreAmount(EntryStack stack);
     boolean equalsIgnoreAmount(EntryStack stack);
-    
+
     boolean equalsAll(EntryStack stack);
     boolean equalsAll(EntryStack stack);
-    
+
     int getZ();
     int getZ();
-    
+
     void setZ(int z);
     void setZ(int z);
-    
+
     default ItemStack getItemStack() {
     default ItemStack getItemStack() {
         if (getType() == Type.ITEM)
         if (getType() == Type.ITEM)
             return (ItemStack) getObject();
             return (ItemStack) getObject();
         return null;
         return null;
     }
     }
-    
+
     default Item getItem() {
     default Item getItem() {
         if (getType() == Type.ITEM)
         if (getType() == Type.ITEM)
             return ((ItemStack) getObject()).getItem();
             return ((ItemStack) getObject()).getItem();
         return null;
         return null;
     }
     }
-    
+
     default Fluid getFluid() {
     default Fluid getFluid() {
         if (getType() == Type.FLUID)
         if (getType() == Type.FLUID)
             return (Fluid) getObject();
             return (Fluid) getObject();
         return null;
         return null;
     }
     }
-    
+
     <T> EntryStack setting(Settings<T> settings, T value);
     <T> EntryStack setting(Settings<T> settings, T value);
-    
+
     <T> EntryStack removeSetting(Settings<T> settings);
     <T> EntryStack removeSetting(Settings<T> settings);
-    
+
     EntryStack clearSettings();
     EntryStack clearSettings();
-    
+
     default <T> EntryStack addSetting(Settings<T> settings, T value) {
     default <T> EntryStack addSetting(Settings<T> settings, T value) {
         return setting(settings, value);
         return setting(settings, value);
     }
     }
-    
+
     <T> ObjectHolder<T> getSetting(Settings<T> settings);
     <T> ObjectHolder<T> getSetting(Settings<T> settings);
-    
+
     @Nullable
     @Nullable
     QueuedTooltip getTooltip(int mouseX, int mouseY);
     QueuedTooltip getTooltip(int mouseX, int mouseY);
-    
+
     void render(Rectangle bounds, int mouseX, int mouseY, float delta);
     void render(Rectangle bounds, int mouseX, int mouseY, float delta);
-    
+
     public static enum Type {
     public static enum Type {
         ITEM,
         ITEM,
         FLUID,
         FLUID,
         EMPTY,
         EMPTY,
         RENDER
         RENDER
     }
     }
-    
+
     public static class Settings<T> {
     public static class Settings<T> {
         public static final Supplier<Boolean> TRUE = () -> true;
         public static final Supplier<Boolean> TRUE = () -> true;
         public static final Supplier<Boolean> FALSE = () -> false;
         public static final Supplier<Boolean> FALSE = () -> false;
@@ -183,29 +183,30 @@ public interface EntryStack {
         public static final Settings<Supplier<Boolean>> RENDER_COUNTS = 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, 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, String>> COUNTS = new Settings<Function<EntryStack, String>>(stack -> null);
-        
+
         private T defaultValue;
         private T defaultValue;
-        
+
         public Settings(T defaultValue) {
         public Settings(T defaultValue) {
             this.defaultValue = defaultValue;
             this.defaultValue = defaultValue;
         }
         }
-        
+
         public T getDefaultValue() {
         public T getDefaultValue() {
             return defaultValue;
             return defaultValue;
         }
         }
-        
+
         public static class Item {
         public static class Item {
             public static final Settings<Supplier<Boolean>> RENDER_ENCHANTMENT_GLINT = new Settings(TRUE);
             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
+            public static final Settings<Supplier<Boolean>> RENDER_OVERLAY = RENDER_ENCHANTMENT_GLINT;
+
             private Item() {
             private Item() {
             }
             }
         }
         }
-        
+
         public static class Fluid {
         public static class Fluid {
             // Return null to disable
             // 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<Function<EntryStack, String>>(stack -> I18n.translate("tooltip.rei.fluid_amount", stack.getAmount()));
-            
+
             private Fluid() {
             private Fluid() {
             }
             }
         }
         }

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

@@ -11,15 +11,15 @@ import java.util.List;
 import java.util.Optional;
 import java.util.Optional;
 
 
 public interface LiveRecipeGenerator<T extends RecipeDisplay> {
 public interface LiveRecipeGenerator<T extends RecipeDisplay> {
-    
+
     Identifier getCategoryIdentifier();
     Identifier getCategoryIdentifier();
-    
+
     default Optional<List<T>> getRecipeFor(EntryStack entry) {
     default Optional<List<T>> getRecipeFor(EntryStack entry) {
         return Optional.empty();
         return Optional.empty();
     }
     }
-    
+
     default Optional<List<T>> getUsageFor(EntryStack entry) {
     default Optional<List<T>> getUsageFor(EntryStack entry) {
         return Optional.empty();
         return Optional.empty();
     }
     }
-    
+
 }
 }

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

@@ -12,36 +12,36 @@ public interface ObjectHolder<T> {
     static <T> ObjectHolder<T> of(T o) {
     static <T> ObjectHolder<T> of(T o) {
         return new ObjectHolderImpl<>(o);
         return new ObjectHolderImpl<>(o);
     }
     }
-    
+
     @Deprecated
     @Deprecated
     default int intValue() {
     default int intValue() {
         return (int) (Object) value();
         return (int) (Object) value();
     }
     }
-    
+
     @Deprecated
     @Deprecated
     default long longValue() {
     default long longValue() {
         return (long) (Object) value();
         return (long) (Object) value();
     }
     }
-    
+
     @Deprecated
     @Deprecated
     default boolean booleanValue() {
     default boolean booleanValue() {
         return (boolean) (Object) value();
         return (boolean) (Object) value();
     }
     }
-    
+
     @Deprecated
     @Deprecated
     default float floatValue() {
     default float floatValue() {
         return (float) (Object) value();
         return (float) (Object) value();
     }
     }
-    
+
     @Deprecated
     @Deprecated
     default double doubleValue() {
     default double doubleValue() {
         return (double) (Object) value();
         return (double) (Object) value();
     }
     }
-    
+
     @Deprecated
     @Deprecated
     default String stringValue() {
     default String stringValue() {
         return (String) value();
         return (String) value();
     }
     }
-    
+
     T value();
     T value();
 }
 }

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

@@ -13,11 +13,11 @@ import net.minecraft.util.Identifier;
  * Get base class of a REI plugin.
  * Get base class of a REI plugin.
  */
  */
 public interface REIPluginEntry {
 public interface REIPluginEntry {
-    
+
     default SemanticVersion getMinimumVersion() throws VersionParsingException {
     default SemanticVersion getMinimumVersion() throws VersionParsingException {
         return null;
         return null;
     }
     }
-    
+
     /**
     /**
      * Gets the priority of the plugin.
      * Gets the priority of the plugin.
      *
      *
@@ -26,12 +26,12 @@ public interface REIPluginEntry {
     default int getPriority() {
     default int getPriority() {
         return 0;
         return 0;
     }
     }
-    
+
     /**
     /**
      * Get the identifier of the plugin
      * Get the identifier of the plugin
      *
      *
      * @return the identifier
      * @return the identifier
      */
      */
     Identifier getPluginIdentifier();
     Identifier getPluginIdentifier();
-    
+
 }
 }

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

@@ -22,14 +22,14 @@ import java.util.function.Supplier;
 
 
 
 
 public interface RecipeCategory<T extends RecipeDisplay> {
 public interface RecipeCategory<T extends RecipeDisplay> {
-    
+
     /**
     /**
      * Gets the identifier of the category, must be unique
      * Gets the identifier of the category, must be unique
      *
      *
      * @return the unique identifier of the category
      * @return the unique identifier of the category
      */
      */
     Identifier getIdentifier();
     Identifier getIdentifier();
-    
+
     /**
     /**
      * Gets the renderer of the icon, allowing developers to render things other than items
      * Gets the renderer of the icon, allowing developers to render things other than items
      *
      *
@@ -38,14 +38,14 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default EntryStack getLogo() {
     default EntryStack getLogo() {
         return EntryStack.empty();
         return EntryStack.empty();
     }
     }
-    
+
     /**
     /**
      * Gets the category name
      * Gets the category name
      *
      *
      * @return the name
      * @return the name
      */
      */
     String getCategoryName();
     String getCategoryName();
-    
+
     /**
     /**
      * Gets the recipe renderer for the category, used in {@link me.shedaniel.rei.gui.VillagerRecipeViewingScreen} for rendering simple recipes
      * Gets the recipe renderer for the category, used in {@link me.shedaniel.rei.gui.VillagerRecipeViewingScreen} for rendering simple recipes
      *
      *
@@ -56,7 +56,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default RecipeEntry getSimpleRenderer(T recipe) {
     default RecipeEntry getSimpleRenderer(T recipe) {
         return SimpleRecipeEntry.create(recipe::getInputEntries, recipe::getOutputEntries);
         return SimpleRecipeEntry.create(recipe::getInputEntries, recipe::getOutputEntries);
     }
     }
-    
+
     /**
     /**
      * Setup the widgets for displaying the recipe
      * Setup the widgets for displaying the recipe
      *
      *
@@ -67,7 +67,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default List<Widget> setupDisplay(Supplier<T> recipeDisplaySupplier, Rectangle bounds) {
     default List<Widget> setupDisplay(Supplier<T> recipeDisplaySupplier, Rectangle bounds) {
         return Collections.singletonList(new RecipeBaseWidget(bounds));
         return Collections.singletonList(new RecipeBaseWidget(bounds));
     }
     }
-    
+
     /**
     /**
      * Draws the category background, used in {@link RecipeViewingScreen}
      * Draws the category background, used in {@link RecipeViewingScreen}
      *
      *
@@ -86,7 +86,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
             DrawableHelper.fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, 0xFF9E9E9E);
             DrawableHelper.fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, 0xFF9E9E9E);
         }
         }
     }
     }
-    
+
     /**
     /**
      * Gets the recipe display height
      * Gets the recipe display height
      *
      *
@@ -95,7 +95,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default int getDisplayHeight() {
     default int getDisplayHeight() {
         return 66;
         return 66;
     }
     }
-    
+
     /**
     /**
      * Gets the recipe display width
      * Gets the recipe display width
      *
      *
@@ -105,7 +105,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default int getDisplayWidth(T display) {
     default int getDisplayWidth(T display) {
         return 150;
         return 150;
     }
     }
-    
+
     /**
     /**
      * Gets the maximum recipe per page.
      * Gets the maximum recipe per page.
      *
      *
@@ -114,7 +114,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default int getMaximumRecipePerPage() {
     default int getMaximumRecipePerPage() {
         return 99;
         return 99;
     }
     }
-    
+
     /**
     /**
      * Gets the fixed amount of recipes per page.
      * Gets the fixed amount of recipes per page.
      *
      *
@@ -124,7 +124,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default int getFixedRecipesPerPage() {
     default int getFixedRecipesPerPage() {
         return -1;
         return -1;
     }
     }
-    
+
     /**
     /**
      * Gets whether the category will check tags, useful for potions
      * Gets whether the category will check tags, useful for potions
      *
      *
@@ -135,5 +135,5 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default boolean checkTags() {
     default boolean checkTags() {
         return false;
         return false;
     }
     }
-    
+
 }
 }

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

@@ -12,17 +12,17 @@ import java.util.List;
 import java.util.Optional;
 import java.util.Optional;
 
 
 public interface RecipeDisplay {
 public interface RecipeDisplay {
-    
+
     /**
     /**
      * @return a list of inputs
      * @return a list of inputs
      */
      */
     List<List<EntryStack>> getInputEntries();
     List<List<EntryStack>> getInputEntries();
-    
+
     /**
     /**
      * @return a list of outputs
      * @return a list of outputs
      */
      */
     List<EntryStack> getOutputEntries();
     List<EntryStack> getOutputEntries();
-    
+
     /**
     /**
      * Gets the required items used in craftable filters
      * Gets the required items used in craftable filters
      *
      *
@@ -31,14 +31,14 @@ public interface RecipeDisplay {
     default List<List<EntryStack>> getRequiredEntries() {
     default List<List<EntryStack>> getRequiredEntries() {
         return Collections.emptyList();
         return Collections.emptyList();
     }
     }
-    
+
     /**
     /**
      * Gets the recipe display category identifier
      * Gets the recipe display category identifier
      *
      *
      * @return the identifier of the category
      * @return the identifier of the category
      */
      */
     Identifier getRecipeCategory();
     Identifier getRecipeCategory();
-    
+
     /**
     /**
      * Gets the recipe location from datapack
      * Gets the recipe location from datapack
      *
      *
@@ -47,5 +47,5 @@ public interface RecipeDisplay {
     default Optional<Identifier> getRecipeLocation() {
     default Optional<Identifier> getRecipeLocation() {
         return Optional.empty();
         return Optional.empty();
     }
     }
-    
+
 }
 }

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

@@ -19,28 +19,28 @@ import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.function.Predicate;
 
 
 public interface RecipeHelper {
 public interface RecipeHelper {
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     static RecipeHelper getInstance() {
     static RecipeHelper getInstance() {
         return RoughlyEnoughItemsCore.getRecipeHelper();
         return RoughlyEnoughItemsCore.getRecipeHelper();
     }
     }
-    
+
     AutoTransferHandler registerAutoCraftingHandler(AutoTransferHandler handler);
     AutoTransferHandler registerAutoCraftingHandler(AutoTransferHandler handler);
-    
+
     List<AutoTransferHandler> getSortedAutoCraftingHandler();
     List<AutoTransferHandler> getSortedAutoCraftingHandler();
-    
+
     /**
     /**
      * Gets the total recipe count registered
      * Gets the total recipe count registered
      *
      *
      * @return the recipe count
      * @return the recipe count
      */
      */
     int getRecipeCount();
     int getRecipeCount();
-    
+
     /**
     /**
      * @return a list of sorted recipes
      * @return a list of sorted recipes
      */
      */
     List<Recipe> getAllSortedRecipes();
     List<Recipe> getAllSortedRecipes();
-    
+
     /**
     /**
      * Gets all craftable items from materials.
      * Gets all craftable items from materials.
      *
      *
@@ -48,14 +48,14 @@ public interface RecipeHelper {
      * @return the list of craftable entries
      * @return the list of craftable entries
      */
      */
     List<EntryStack> findCraftableEntriesByItems(List<EntryStack> inventoryItems);
     List<EntryStack> findCraftableEntriesByItems(List<EntryStack> inventoryItems);
-    
+
     /**
     /**
      * Registers a category
      * Registers a category
      *
      *
      * @param category the category to register
      * @param category the category to register
      */
      */
     void registerCategory(RecipeCategory<?> category);
     void registerCategory(RecipeCategory<?> category);
-    
+
     /**
     /**
      * Registers the working stations of a category
      * Registers the working stations of a category
      *
      *
@@ -63,7 +63,7 @@ public interface RecipeHelper {
      * @param workingStations the working stations
      * @param workingStations the working stations
      */
      */
     void registerWorkingStations(Identifier category, List<EntryStack>... workingStations);
     void registerWorkingStations(Identifier category, List<EntryStack>... workingStations);
-    
+
     /**
     /**
      * Registers the working stations of a category
      * Registers the working stations of a category
      *
      *
@@ -71,9 +71,9 @@ public interface RecipeHelper {
      * @param workingStations the working stations
      * @param workingStations the working stations
      */
      */
     void registerWorkingStations(Identifier category, EntryStack... workingStations);
     void registerWorkingStations(Identifier category, EntryStack... workingStations);
-    
+
     List<List<EntryStack>> getWorkingStations(Identifier category);
     List<List<EntryStack>> getWorkingStations(Identifier category);
-    
+
     /**
     /**
      * Registers a recipe display
      * Registers a recipe display
      *
      *
@@ -81,7 +81,7 @@ public interface RecipeHelper {
      * @param display            the recipe display
      * @param display            the recipe display
      */
      */
     void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display);
     void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display);
-    
+
     /**
     /**
      * Gets a map of recipes for an entry
      * Gets a map of recipes for an entry
      *
      *
@@ -89,23 +89,23 @@ public interface RecipeHelper {
      * @return the map of recipes
      * @return the map of recipes
      */
      */
     Map<RecipeCategory<?>, List<RecipeDisplay>> getRecipesFor(EntryStack stack);
     Map<RecipeCategory<?>, List<RecipeDisplay>> getRecipesFor(EntryStack stack);
-    
+
     RecipeCategory getCategory(Identifier identifier);
     RecipeCategory getCategory(Identifier identifier);
-    
+
     /**
     /**
      * Gets the vanilla recipe manager
      * Gets the vanilla recipe manager
      *
      *
      * @return the recipe manager
      * @return the recipe manager
      */
      */
     RecipeManager getRecipeManager();
     RecipeManager getRecipeManager();
-    
+
     /**
     /**
      * Gets all registered categories
      * Gets all registered categories
      *
      *
      * @return the list of categories
      * @return the list of categories
      */
      */
     List<RecipeCategory<?>> getAllCategories();
     List<RecipeCategory<?>> getAllCategories();
-    
+
     /**
     /**
      * Gets a map of usages for an entry
      * Gets a map of usages for an entry
      *
      *
@@ -113,7 +113,7 @@ public interface RecipeHelper {
      * @return the map of recipes
      * @return the map of recipes
      */
      */
     Map<RecipeCategory<?>, List<RecipeDisplay>> getUsagesFor(EntryStack stack);
     Map<RecipeCategory<?>, List<RecipeDisplay>> getUsagesFor(EntryStack stack);
-    
+
     /**
     /**
      * Gets the optional of the auto crafting button area from a category
      * Gets the optional of the auto crafting button area from a category
      *
      *
@@ -121,7 +121,7 @@ public interface RecipeHelper {
      * @return the optional of auto crafting button area
      * @return the optional of auto crafting button area
      */
      */
     Optional<ButtonAreaSupplier> getAutoCraftButtonArea(RecipeCategory<?> category);
     Optional<ButtonAreaSupplier> getAutoCraftButtonArea(RecipeCategory<?> category);
-    
+
     /**
     /**
      * Registers a auto crafting button area
      * Registers a auto crafting button area
      *
      *
@@ -129,7 +129,7 @@ public interface RecipeHelper {
      * @param rectangle the button area
      * @param rectangle the button area
      */
      */
     void registerAutoCraftButtonArea(Identifier category, ButtonAreaSupplier rectangle);
     void registerAutoCraftButtonArea(Identifier category, ButtonAreaSupplier rectangle);
-    
+
     /**
     /**
      * Removes the auto crafting button
      * Removes the auto crafting button
      *
      *
@@ -138,37 +138,37 @@ public interface RecipeHelper {
     default void removeAutoCraftButton(Identifier category) {
     default void removeAutoCraftButton(Identifier category) {
         registerAutoCraftButtonArea(category, bounds -> null);
         registerAutoCraftButtonArea(category, bounds -> null);
     }
     }
-    
+
     /**
     /**
      * Gets the map of all recipes visible to the player
      * Gets the map of all recipes visible to the player
      *
      *
      * @return the map of recipes
      * @return the map of recipes
      */
      */
     Map<RecipeCategory<?>, List<RecipeDisplay>> getAllRecipes();
     Map<RecipeCategory<?>, List<RecipeDisplay>> getAllRecipes();
-    
+
     List<RecipeDisplay> getAllRecipesFromCategory(RecipeCategory<?> category);
     List<RecipeDisplay> getAllRecipesFromCategory(RecipeCategory<?> category);
-    
+
     /**
     /**
      * Registers a recipe visibility handler
      * Registers a recipe visibility handler
      *
      *
      * @param visibilityHandler the handler to be registered
      * @param visibilityHandler the handler to be registered
      */
      */
     void registerRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler);
     void registerRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler);
-    
+
     /**
     /**
      * Unregisters a recipe visibility handler
      * Unregisters a recipe visibility handler
      *
      *
      * @param visibilityHandler the handler to be unregistered
      * @param visibilityHandler the handler to be unregistered
      */
      */
     void unregisterRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler);
     void unregisterRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler);
-    
+
     /**
     /**
      * Gets an unmodifiable list of recipe visibility handlers
      * Gets an unmodifiable list of recipe visibility handlers
      *
      *
      * @return the unmodifiable list of handlers
      * @return the unmodifiable list of handlers
      */
      */
     List<DisplayVisibilityHandler> getDisplayVisibilityHandlers();
     List<DisplayVisibilityHandler> getDisplayVisibilityHandlers();
-    
+
     /**
     /**
      * Checks if the display is visible by asking recipe visibility handlers
      * Checks if the display is visible by asking recipe visibility handlers
      *
      *
@@ -179,7 +179,7 @@ public interface RecipeHelper {
      */
      */
     @Deprecated
     @Deprecated
     boolean isDisplayVisible(RecipeDisplay display, boolean respectConfig);
     boolean isDisplayVisible(RecipeDisplay display, boolean respectConfig);
-    
+
     /**
     /**
      * Checks if the display is visible by asking recipe visibility handlers
      * Checks if the display is visible by asking recipe visibility handlers
      *
      *
@@ -187,9 +187,9 @@ public interface RecipeHelper {
      * @return whether the display should be visible
      * @return whether the display should be visible
      */
      */
     boolean isDisplayVisible(RecipeDisplay display);
     boolean isDisplayVisible(RecipeDisplay display);
-    
+
     <T extends Recipe<?>> void registerRecipes(Identifier category, Predicate<Recipe> recipeFilter, Function<T, RecipeDisplay> mappingFunction);
     <T extends Recipe<?>> void registerRecipes(Identifier category, Predicate<Recipe> recipeFilter, Function<T, RecipeDisplay> mappingFunction);
-    
+
     /**
     /**
      * Registers a live recipe generator.
      * Registers a live recipe generator.
      *
      *
@@ -197,24 +197,24 @@ public interface RecipeHelper {
      * @apiNote Still work in progress
      * @apiNote Still work in progress
      */
      */
     void registerLiveRecipeGenerator(LiveRecipeGenerator<?> liveRecipeGenerator);
     void registerLiveRecipeGenerator(LiveRecipeGenerator<?> liveRecipeGenerator);
-    
+
     void registerScreenClickArea(Rectangle rectangle, Class<? extends AbstractContainerScreen<?>> screenClass, Identifier... categories);
     void registerScreenClickArea(Rectangle rectangle, Class<? extends AbstractContainerScreen<?>> screenClass, Identifier... categories);
-    
+
     <T extends Recipe<?>> void registerRecipes(Identifier category, Class<T> recipeClass, Function<T, RecipeDisplay> mappingFunction);
     <T extends Recipe<?>> void registerRecipes(Identifier category, Class<T> recipeClass, Function<T, RecipeDisplay> mappingFunction);
-    
+
     <T extends Recipe<?>> void registerRecipes(Identifier category, Function<Recipe, Boolean> recipeFilter, Function<T, RecipeDisplay> mappingFunction);
     <T extends Recipe<?>> void registerRecipes(Identifier category, Function<Recipe, Boolean> recipeFilter, Function<T, RecipeDisplay> mappingFunction);
-    
+
     List<RecipeHelper.ScreenClickArea> getScreenClickAreas();
     List<RecipeHelper.ScreenClickArea> getScreenClickAreas();
-    
+
     boolean arePluginsLoading();
     boolean arePluginsLoading();
-    
+
     interface ScreenClickArea {
     interface ScreenClickArea {
         Class<? extends AbstractContainerScreen> getScreenClass();
         Class<? extends AbstractContainerScreen> getScreenClass();
-        
+
         Rectangle getRectangle();
         Rectangle getRectangle();
-        
+
         Identifier[] getCategories();
         Identifier[] getCategories();
     }
     }
-    
+
 }
 }
 
 

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

@@ -11,11 +11,11 @@ import net.minecraft.container.Container;
 import java.util.List;
 import java.util.List;
 
 
 public interface TransferRecipeDisplay extends RecipeDisplay {
 public interface TransferRecipeDisplay extends RecipeDisplay {
-    
+
     int getWidth();
     int getWidth();
-    
+
     int getHeight();
     int getHeight();
-    
+
     List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container);
     List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container);
-    
+
 }
 }

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

@@ -13,4 +13,5 @@ import static java.lang.annotation.ElementType.*;
 
 
 @Retention(RetentionPolicy.RUNTIME)
 @Retention(RetentionPolicy.RUNTIME)
 @Target(value = {CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
 @Target(value = {CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
-public @interface Experimental {}
+public @interface Experimental {
+}

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

@@ -13,4 +13,5 @@ import static java.lang.annotation.ElementType.*;
 
 
 @Retention(RetentionPolicy.RUNTIME)
 @Retention(RetentionPolicy.RUNTIME)
 @Target(value = {CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
 @Target(value = {CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
-public @interface Internal {}
+public @interface Internal {
+}

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

@@ -13,4 +13,5 @@ import static java.lang.annotation.ElementType.*;
 
 
 @Retention(RetentionPolicy.RUNTIME)
 @Retention(RetentionPolicy.RUNTIME)
 @Target(value = {CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
 @Target(value = {CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
-public @interface ToBeRemoved {}
+public @interface ToBeRemoved {
+}

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

@@ -11,7 +11,7 @@ import me.shedaniel.rei.api.REIPluginEntry;
 import me.shedaniel.rei.api.RecipeHelper;
 import me.shedaniel.rei.api.RecipeHelper;
 
 
 public interface REIPluginV0 extends REIPluginEntry {
 public interface REIPluginV0 extends REIPluginEntry {
-    
+
     /**
     /**
      * Registers entries on the item panel
      * Registers entries on the item panel
      *
      *
@@ -19,7 +19,7 @@ public interface REIPluginV0 extends REIPluginEntry {
      */
      */
     default void registerEntries(EntryRegistry entryRegistry) {
     default void registerEntries(EntryRegistry entryRegistry) {
     }
     }
-    
+
     /**
     /**
      * Registers categories
      * Registers categories
      *
      *
@@ -27,7 +27,7 @@ public interface REIPluginV0 extends REIPluginEntry {
      */
      */
     default void registerPluginCategories(RecipeHelper recipeHelper) {
     default void registerPluginCategories(RecipeHelper recipeHelper) {
     }
     }
-    
+
     /**
     /**
      * Registers displays for categories
      * Registers displays for categories
      *
      *
@@ -35,7 +35,7 @@ public interface REIPluginV0 extends REIPluginEntry {
      */
      */
     default void registerRecipeDisplays(RecipeHelper recipeHelper) {
     default void registerRecipeDisplays(RecipeHelper recipeHelper) {
     }
     }
-    
+
     /**
     /**
      * Registers bounds handlers
      * Registers bounds handlers
      *
      *
@@ -43,7 +43,7 @@ public interface REIPluginV0 extends REIPluginEntry {
      */
      */
     default void registerBounds(DisplayHelper displayHelper) {
     default void registerBounds(DisplayHelper displayHelper) {
     }
     }
-    
+
     /**
     /**
      * Register other stuff
      * Register other stuff
      *
      *
@@ -51,11 +51,11 @@ public interface REIPluginV0 extends REIPluginEntry {
      */
      */
     default void registerOthers(RecipeHelper recipeHelper) {
     default void registerOthers(RecipeHelper recipeHelper) {
     }
     }
-    
+
     default void preRegister() {
     default void preRegister() {
     }
     }
-    
+
     default void postRegister() {
     default void postRegister() {
     }
     }
-    
+
 }
 }

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

@@ -15,19 +15,19 @@ import net.minecraft.util.Util;
 @Deprecated
 @Deprecated
 @Internal
 @Internal
 public class ConfigReloadingScreen extends Screen {
 public class ConfigReloadingScreen extends Screen {
-    
+
     private Screen parent;
     private Screen parent;
-    
+
     public ConfigReloadingScreen(Screen parent) {
     public ConfigReloadingScreen(Screen parent) {
         super(NarratorManager.EMPTY);
         super(NarratorManager.EMPTY);
         this.parent = parent;
         this.parent = parent;
     }
     }
-    
+
     @Override
     @Override
     public boolean shouldCloseOnEsc() {
     public boolean shouldCloseOnEsc() {
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public void render(int int_1, int int_2, float float_1) {
     public void render(int int_1, int int_2, float float_1) {
         this.renderDirtBackground(0);
         this.renderDirtBackground(0);
@@ -50,7 +50,7 @@ public class ConfigReloadingScreen extends Screen {
         this.drawCenteredString(this.font, string_3, this.width / 2, this.height / 2 - 41, 8421504);
         this.drawCenteredString(this.font, string_3, this.width / 2, this.height / 2 - 41, 8421504);
         super.render(int_1, int_2, float_1);
         super.render(int_1, int_2, float_1);
     }
     }
-    
+
     @Override
     @Override
     public boolean isPauseScreen() {
     public boolean isPauseScreen() {
         return false;
         return false;

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

@@ -42,7 +42,7 @@ import javax.annotation.Nullable;
 import java.util.*;
 import java.util.*;
 
 
 public class ContainerScreenOverlay extends WidgetWithBounds {
 public class ContainerScreenOverlay extends WidgetWithBounds {
-    
+
     private static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     private static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     private static final List<QueuedTooltip> QUEUED_TOOLTIPS = Lists.newArrayList();
     private static final List<QueuedTooltip> QUEUED_TOOLTIPS = Lists.newArrayList();
     private static final EntryListWidget ENTRY_LIST_WIDGET = new EntryListWidget();
     private static final EntryListWidget ENTRY_LIST_WIDGET = new EntryListWidget();
@@ -70,7 +70,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         VertexConsumerProvider.Immediate immediate = VertexConsumerProvider.immediate(Tessellator.getInstance().getBuffer());
         VertexConsumerProvider.Immediate immediate = VertexConsumerProvider.immediate(Tessellator.getInstance().getBuffer());
         matrixStack_1.translate(0.0D, 0.0D, getBlitOffset());
         matrixStack_1.translate(0.0D, 0.0D, getBlitOffset());
         Matrix4f matrix4f_1 = matrixStack_1.peek().getModel();
         Matrix4f matrix4f_1 = matrixStack_1.peek().getModel();
-        for(int lineIndex = 0; lineIndex < tooltipLines.size(); lineIndex++) {
+        for (int lineIndex = 0; lineIndex < tooltipLines.size(); lineIndex++) {
             font.draw(tooltipLines.get(lineIndex), x, currentY, -1, true, matrix4f_1, immediate, false, 0, 15728880);
             font.draw(tooltipLines.get(lineIndex), x, currentY, -1, true, matrix4f_1, immediate, false, 0, 15728880);
             currentY += lineIndex == 0 ? 12 : 10;
             currentY += lineIndex == 0 ? 12 : 10;
         }
         }
@@ -83,20 +83,20 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
     private Window window;
     private Window window;
     private CraftableToggleButtonWidget toggleButtonWidget;
     private CraftableToggleButtonWidget toggleButtonWidget;
     private ButtonWidget buttonLeft, buttonRight;
     private ButtonWidget buttonLeft, buttonRight;
-    
+
     public static EntryListWidget getEntryListWidget() {
     public static EntryListWidget getEntryListWidget() {
         return ENTRY_LIST_WIDGET;
         return ENTRY_LIST_WIDGET;
     }
     }
-    
+
     @Nullable
     @Nullable
     public static FavoritesListWidget getFavoritesListWidget() {
     public static FavoritesListWidget getFavoritesListWidget() {
         return favoritesListWidget;
         return favoritesListWidget;
     }
     }
-    
+
     public void init(boolean useless) {
     public void init(boolean useless) {
         init();
         init();
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     public void init() {
     public void init() {
         this.shouldReInit = false;
         this.shouldReInit = false;
@@ -130,17 +130,17 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                         ENTRY_LIST_WIDGET.setPage(ENTRY_LIST_WIDGET.getTotalPages() - 1);
                         ENTRY_LIST_WIDGET.setPage(ENTRY_LIST_WIDGET.getTotalPages() - 1);
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                 }
                 }
-                
+
                 @Override
                 @Override
                 public Optional<String> getTooltips() {
                 public Optional<String> getTooltips() {
                     return Optional.ofNullable(I18n.translate("text.rei.previous_page"));
                     return Optional.ofNullable(I18n.translate("text.rei.previous_page"));
                 }
                 }
-                
+
                 @Override
                 @Override
                 public boolean changeFocus(boolean boolean_1) {
                 public boolean changeFocus(boolean boolean_1) {
                     return false;
                     return false;
                 }
                 }
-                
+
                 @Override
                 @Override
                 public boolean containsMouse(double mouseX, double mouseY) {
                 public boolean containsMouse(double mouseX, double mouseY) {
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
@@ -154,24 +154,24 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                         ENTRY_LIST_WIDGET.setPage(0);
                         ENTRY_LIST_WIDGET.setPage(0);
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                 }
                 }
-                
+
                 @Override
                 @Override
                 public Optional<String> getTooltips() {
                 public Optional<String> getTooltips() {
                     return Optional.ofNullable(I18n.translate("text.rei.next_page"));
                     return Optional.ofNullable(I18n.translate("text.rei.next_page"));
                 }
                 }
-                
+
                 @Override
                 @Override
                 public boolean changeFocus(boolean boolean_1) {
                 public boolean changeFocus(boolean boolean_1) {
                     return false;
                     return false;
                 }
                 }
-                
+
                 @Override
                 @Override
                 public boolean containsMouse(double mouseX, double mouseY) {
                 public boolean containsMouse(double mouseX, double mouseY) {
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                 }
                 }
             });
             });
         }
         }
-        
+
         widgets.add(new ButtonWidget(new Rectangle(ConfigObject.getInstance().isLeftHandSidePanel() ? window.getScaledWidth() - 30 : 10, 10, 20, 20), "") {
         widgets.add(new ButtonWidget(new Rectangle(ConfigObject.getInstance().isLeftHandSidePanel() ? window.getScaledWidth() - 30 : 10, 10, 20, 20), "") {
             @Override
             @Override
             public void onPressed() {
             public void onPressed() {
@@ -181,7 +181,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                 }
                 }
                 ConfigManager.getInstance().openConfigScreen(ScreenHelper.getLastContainerScreen());
                 ConfigManager.getInstance().openConfigScreen(ScreenHelper.getLastContainerScreen());
             }
             }
-            
+
             @Override
             @Override
             public void render(int mouseX, int mouseY, float delta) {
             public void render(int mouseX, int mouseY, float delta) {
                 super.render(mouseX, mouseY, delta);
                 super.render(mouseX, mouseY, delta);
@@ -196,7 +196,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                 RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
                 RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
                 blit(bounds.x + 3, bounds.y + 3, 0, 0, 14, 14);
                 blit(bounds.x + 3, bounds.y + 3, 0, 0, 14, 14);
             }
             }
-            
+
             @Override
             @Override
             public Optional<String> getTooltips() {
             public Optional<String> getTooltips() {
                 String tooltips = I18n.translate("text.rei.config_tooltip");
                 String tooltips = I18n.translate("text.rei.config_tooltip");
@@ -211,12 +211,12 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                     tooltips += "\n" + I18n.translate("text.rei.cheating_limited_enabled");
                     tooltips += "\n" + I18n.translate("text.rei.cheating_limited_enabled");
                 return Optional.ofNullable(tooltips);
                 return Optional.ofNullable(tooltips);
             }
             }
-            
+
             @Override
             @Override
             public boolean changeFocus(boolean boolean_1) {
             public boolean changeFocus(boolean boolean_1) {
                 return false;
                 return false;
             }
             }
-            
+
             @Override
             @Override
             public boolean containsMouse(double mouseX, double mouseY) {
             public boolean containsMouse(double mouseX, double mouseY) {
                 return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                 return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
@@ -228,36 +228,36 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                 public void onPressed() {
                 public void onPressed() {
                     MinecraftClient.getInstance().player.sendChatMessage(ConfigObject.getInstance().getGamemodeCommand().replaceAll("\\{gamemode}", getNextGameMode(Screen.hasShiftDown()).getName()));
                     MinecraftClient.getInstance().player.sendChatMessage(ConfigObject.getInstance().getGamemodeCommand().replaceAll("\\{gamemode}", getNextGameMode(Screen.hasShiftDown()).getName()));
                 }
                 }
-                
+
                 @Override
                 @Override
                 public void render(int mouseX, int mouseY, float delta) {
                 public void render(int mouseX, int mouseY, float delta) {
                     setText(getGameModeShortText(getCurrentGameMode()));
                     setText(getGameModeShortText(getCurrentGameMode()));
                     super.render(mouseX, mouseY, delta);
                     super.render(mouseX, mouseY, delta);
                 }
                 }
-                
+
                 @Override
                 @Override
                 public Optional<String> getTooltips() {
                 public Optional<String> getTooltips() {
                     return Optional.ofNullable(I18n.translate("text.rei.gamemode_button.tooltip", getGameModeText(getNextGameMode(Screen.hasShiftDown()))));
                     return Optional.ofNullable(I18n.translate("text.rei.gamemode_button.tooltip", getGameModeText(getNextGameMode(Screen.hasShiftDown()))));
                 }
                 }
-                
+
                 @Override
                 @Override
                 public boolean changeFocus(boolean boolean_1) {
                 public boolean changeFocus(boolean boolean_1) {
                     return false;
                     return false;
                 }
                 }
-                
+
                 @Override
                 @Override
                 public boolean containsMouse(double mouseX, double mouseY) {
                 public boolean containsMouse(double mouseX, double mouseY) {
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                 }
                 }
             });
             });
             int xxx = ConfigObject.getInstance().isLeftHandSidePanel() ? window.getScaledWidth() - 30 : 10;
             int xxx = ConfigObject.getInstance().isLeftHandSidePanel() ? window.getScaledWidth() - 30 : 10;
-            for(Weather weather : Weather.values()) {
+            for (Weather weather : Weather.values()) {
                 widgets.add(new ButtonWidget(new Rectangle(xxx, 35, 20, 20), "") {
                 widgets.add(new ButtonWidget(new Rectangle(xxx, 35, 20, 20), "") {
                     @Override
                     @Override
                     public void onPressed() {
                     public void onPressed() {
                         MinecraftClient.getInstance().player.sendChatMessage(ConfigObject.getInstance().getWeatherCommand().replaceAll("\\{weather}", weather.name().toLowerCase(Locale.ROOT)));
                         MinecraftClient.getInstance().player.sendChatMessage(ConfigObject.getInstance().getWeatherCommand().replaceAll("\\{weather}", weather.name().toLowerCase(Locale.ROOT)));
                     }
                     }
-                    
+
                     @Override
                     @Override
                     public void render(int mouseX, int mouseY, float delta) {
                     public void render(int mouseX, int mouseY, float delta) {
                         super.render(mouseX, mouseY, delta);
                         super.render(mouseX, mouseY, delta);
@@ -265,17 +265,17 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                         RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
                         RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
                         blit(getBounds().x + 3, getBounds().y + 3, weather.getId() * 14, 14, 14, 14);
                         blit(getBounds().x + 3, getBounds().y + 3, weather.getId() * 14, 14, 14, 14);
                     }
                     }
-                    
+
                     @Override
                     @Override
                     public Optional<String> getTooltips() {
                     public Optional<String> getTooltips() {
                         return Optional.ofNullable(I18n.translate("text.rei.weather_button.tooltip", I18n.translate(weather.getTranslateKey())));
                         return Optional.ofNullable(I18n.translate("text.rei.weather_button.tooltip", I18n.translate(weather.getTranslateKey())));
                     }
                     }
-                    
+
                     @Override
                     @Override
                     public boolean changeFocus(boolean boolean_1) {
                     public boolean changeFocus(boolean boolean_1) {
                         return false;
                         return false;
                     }
                     }
-                    
+
                     @Override
                     @Override
                     public boolean containsMouse(double mouseX, double mouseY) {
                     public boolean containsMouse(double mouseX, double mouseY) {
                         return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                         return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
@@ -291,19 +291,19 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                     setText(String.format("%s/%s", ENTRY_LIST_WIDGET.getPage() + 1, ENTRY_LIST_WIDGET.getTotalPages()));
                     setText(String.format("%s/%s", ENTRY_LIST_WIDGET.getPage() + 1, ENTRY_LIST_WIDGET.getTotalPages()));
                     super.render(mouseX, mouseY, delta);
                     super.render(mouseX, mouseY, delta);
                 }
                 }
-                
+
                 @Override
                 @Override
                 public Optional<String> getTooltips() {
                 public Optional<String> getTooltips() {
                     return Optional.ofNullable(I18n.translate("text.rei.go_back_first_page"));
                     return Optional.ofNullable(I18n.translate("text.rei.go_back_first_page"));
                 }
                 }
-                
+
                 @Override
                 @Override
                 public void onLabelClicked() {
                 public void onLabelClicked() {
                     MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                     MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                     ENTRY_LIST_WIDGET.setPage(0);
                     ENTRY_LIST_WIDGET.setPage(0);
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                 }
                 }
-                
+
                 @Override
                 @Override
                 public boolean changeFocus(boolean boolean_1) {
                 public boolean changeFocus(boolean boolean_1) {
                     return false;
                     return false;
@@ -318,14 +318,14 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                     ConfigManager.getInstance().toggleCraftableOnly();
                     ConfigManager.getInstance().toggleCraftableOnly();
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                 }
                 }
-                
+
                 @Override
                 @Override
                 public void lateRender(int mouseX, int mouseY, float delta) {
                 public void lateRender(int mouseX, int mouseY, float delta) {
                     setBlitOffset(300);
                     setBlitOffset(300);
                     super.lateRender(mouseX, mouseY, delta);
                     super.lateRender(mouseX, mouseY, delta);
                     setBlitOffset(0);
                     setBlitOffset(0);
                 }
                 }
-                
+
                 @Override
                 @Override
                 public boolean containsMouse(double mouseX, double mouseY) {
                 public boolean containsMouse(double mouseX, double mouseY) {
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
@@ -334,7 +334,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         else
         else
             toggleButtonWidget = null;
             toggleButtonWidget = null;
     }
     }
-    
+
     private Weather getNextWeather() {
     private Weather getNextWeather() {
         try {
         try {
             Weather current = getCurrentWeather();
             Weather current = getCurrentWeather();
@@ -346,7 +346,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             return Weather.CLEAR;
             return Weather.CLEAR;
         }
         }
     }
     }
-    
+
     private Weather getCurrentWeather() {
     private Weather getCurrentWeather() {
         ClientWorld world = MinecraftClient.getInstance().world;
         ClientWorld world = MinecraftClient.getInstance().world;
         if (world.isThundering())
         if (world.isThundering())
@@ -355,15 +355,15 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             return Weather.RAIN;
             return Weather.RAIN;
         return Weather.CLEAR;
         return Weather.CLEAR;
     }
     }
-    
+
     private String getGameModeShortText(GameMode gameMode) {
     private String getGameModeShortText(GameMode gameMode) {
         return I18n.translate("text.rei.short_gamemode." + gameMode.getName());
         return I18n.translate("text.rei.short_gamemode." + gameMode.getName());
     }
     }
-    
+
     private String getGameModeText(GameMode gameMode) {
     private String getGameModeText(GameMode gameMode) {
         return I18n.translate("selectWorld.gameMode." + gameMode.getName());
         return I18n.translate("selectWorld.gameMode." + gameMode.getName());
     }
     }
-    
+
     private GameMode getNextGameMode(boolean reverse) {
     private GameMode getNextGameMode(boolean reverse) {
         try {
         try {
             GameMode current = getCurrentGameMode();
             GameMode current = getCurrentGameMode();
@@ -379,11 +379,11 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             return GameMode.NOT_SET;
             return GameMode.NOT_SET;
         }
         }
     }
     }
-    
+
     private GameMode getCurrentGameMode() {
     private GameMode getCurrentGameMode() {
         return MinecraftClient.getInstance().getNetworkHandler().getPlayerListEntry(MinecraftClient.getInstance().player.getGameProfile().getId()).getGameMode();
         return MinecraftClient.getInstance().getNetworkHandler().getPlayerListEntry(MinecraftClient.getInstance().player.getGameProfile().getId()).getGameMode();
     }
     }
-    
+
     private Rectangle getTextFieldArea() {
     private Rectangle getTextFieldArea() {
         int widthRemoved = ConfigObject.getInstance().isCraftableFilterEnabled() ? 22 : 2;
         int widthRemoved = ConfigObject.getInstance().isCraftableFilterEnabled() ? 22 : 2;
         SearchFieldLocation searchFieldLocation = ConfigObject.getInstance().getSearchFieldLocation();
         SearchFieldLocation searchFieldLocation = ConfigObject.getInstance().getSearchFieldLocation();
@@ -401,30 +401,30 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         }
         }
         return new Rectangle(ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft(), window.getScaledHeight() - 22, ScreenHelper.getLastContainerScreenHooks().rei_getContainerWidth() - widthRemoved, 18);
         return new Rectangle(ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft(), window.getScaledHeight() - 22, ScreenHelper.getLastContainerScreenHooks().rei_getContainerWidth() - widthRemoved, 18);
     }
     }
-    
+
     private Rectangle getCraftableToggleArea() {
     private Rectangle getCraftableToggleArea() {
         Rectangle searchBoxArea = getTextFieldArea();
         Rectangle searchBoxArea = getTextFieldArea();
         searchBoxArea.setLocation(searchBoxArea.x + searchBoxArea.width + 4, searchBoxArea.y - 1);
         searchBoxArea.setLocation(searchBoxArea.x + searchBoxArea.width + 4, searchBoxArea.y - 1);
         searchBoxArea.setSize(20, 20);
         searchBoxArea.setSize(20, 20);
         return searchBoxArea;
         return searchBoxArea;
     }
     }
-    
+
     private String getCheatModeText() {
     private String getCheatModeText() {
         return I18n.translate(String.format("%s%s", "text.rei.", ClientHelper.getInstance().isCheating() ? "cheat" : "nocheat"));
         return I18n.translate(String.format("%s%s", "text.rei.", ClientHelper.getInstance().isCheating() ? "cheat" : "nocheat"));
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getBounds() {
     public Rectangle getBounds() {
         return rectangle;
         return rectangle;
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
         List<ItemStack> currentStacks = ClientHelper.getInstance().getInventoryItemsTypes();
         List<ItemStack> currentStacks = ClientHelper.getInstance().getInventoryItemsTypes();
         if (shouldReInit)
         if (shouldReInit)
             init();
             init();
         else {
         else {
-            for(DisplayHelper.DisplayBoundsHandler<?> handler : DisplayHelper.getInstance().getSortedBoundsHandlers(minecraft.currentScreen.getClass())) {
+            for (DisplayHelper.DisplayBoundsHandler<?> handler : DisplayHelper.getInstance().getSortedBoundsHandlers(minecraft.currentScreen.getClass())) {
                 if (handler != null && handler.shouldRecalculateArea(!ConfigObject.getInstance().isLeftHandSidePanel(), rectangle)) {
                 if (handler != null && handler.shouldRecalculateArea(!ConfigObject.getInstance().isLeftHandSidePanel(), rectangle)) {
                     init();
                     init();
                     break;
                     break;
@@ -440,7 +440,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             if (MinecraftClient.getInstance().currentScreen instanceof AbstractContainerScreen) {
             if (MinecraftClient.getInstance().currentScreen instanceof AbstractContainerScreen) {
                 ContainerScreenHooks hooks = (ContainerScreenHooks) MinecraftClient.getInstance().currentScreen;
                 ContainerScreenHooks hooks = (ContainerScreenHooks) MinecraftClient.getInstance().currentScreen;
                 int left = hooks.rei_getContainerLeft(), top = hooks.rei_getContainerTop();
                 int left = hooks.rei_getContainerLeft(), top = hooks.rei_getContainerTop();
-                for(Slot slot : ((AbstractContainerScreen<?>) MinecraftClient.getInstance().currentScreen).getContainer().slotList)
+                for (Slot slot : ((AbstractContainerScreen<?>) MinecraftClient.getInstance().currentScreen).getContainer().slotList)
                     if (!slot.hasStack() || !ENTRY_LIST_WIDGET.canLastSearchTermsBeAppliedTo(EntryStack.create(slot.getStack())))
                     if (!slot.hasStack() || !ENTRY_LIST_WIDGET.canLastSearchTermsBeAppliedTo(EntryStack.create(slot.getStack())))
                         fillGradient(left + slot.xPosition, top + slot.yPosition, left + slot.xPosition + 16, top + slot.yPosition + 16, -601874400, -601874400);
                         fillGradient(left + slot.xPosition, top + slot.yPosition, left + slot.xPosition + 16, top + slot.yPosition + 16, -601874400, -601874400);
             }
             }
@@ -450,7 +450,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         this.renderWidgets(mouseX, mouseY, delta);
         this.renderWidgets(mouseX, mouseY, delta);
         if (MinecraftClient.getInstance().currentScreen instanceof AbstractContainerScreen && ConfigObject.getInstance().areClickableRecipeArrowsEnabled()) {
         if (MinecraftClient.getInstance().currentScreen instanceof AbstractContainerScreen && ConfigObject.getInstance().areClickableRecipeArrowsEnabled()) {
             ContainerScreenHooks hooks = (ContainerScreenHooks) MinecraftClient.getInstance().currentScreen;
             ContainerScreenHooks hooks = (ContainerScreenHooks) MinecraftClient.getInstance().currentScreen;
-            for(RecipeHelper.ScreenClickArea area : RecipeHelper.getInstance().getScreenClickAreas())
+            for (RecipeHelper.ScreenClickArea area : RecipeHelper.getInstance().getScreenClickAreas())
                 if (area.getScreenClass().equals(MinecraftClient.getInstance().currentScreen.getClass()))
                 if (area.getScreenClass().equals(MinecraftClient.getInstance().currentScreen.getClass()))
                     if (area.getRectangle().contains(mouseX - hooks.rei_getContainerLeft(), mouseY - hooks.rei_getContainerTop())) {
                     if (area.getRectangle().contains(mouseX - hooks.rei_getContainerLeft(), mouseY - hooks.rei_getContainerTop())) {
                         String collect = CollectionUtils.mapAndJoinToString(area.getCategories(), identifier -> RecipeHelper.getInstance().getCategory(identifier).getCategoryName(), ", ");
                         String collect = CollectionUtils.mapAndJoinToString(area.getCategories(), identifier -> RecipeHelper.getInstance().getCategory(identifier).getCategoryName(), ", ");
@@ -459,7 +459,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                     }
                     }
         }
         }
     }
     }
-    
+
     public void lateRender(int mouseX, int mouseY, float delta) {
     public void lateRender(int mouseX, int mouseY, float delta) {
         if (ScreenHelper.isOverlayVisible()) {
         if (ScreenHelper.isOverlayVisible()) {
             ScreenHelper.getSearchField().laterRender(mouseX, mouseY, delta);
             ScreenHelper.getSearchField().laterRender(mouseX, mouseY, delta);
@@ -468,13 +468,13 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         }
         }
         Screen currentScreen = MinecraftClient.getInstance().currentScreen;
         Screen currentScreen = MinecraftClient.getInstance().currentScreen;
         if (!(currentScreen instanceof RecipeViewingScreen) || !((RecipeViewingScreen) currentScreen).choosePageActivated)
         if (!(currentScreen instanceof RecipeViewingScreen) || !((RecipeViewingScreen) currentScreen).choosePageActivated)
-            for(QueuedTooltip queuedTooltip : QUEUED_TOOLTIPS) {
+            for (QueuedTooltip queuedTooltip : QUEUED_TOOLTIPS) {
                 if (queuedTooltip != null)
                 if (queuedTooltip != null)
                     renderTooltip(queuedTooltip);
                     renderTooltip(queuedTooltip);
             }
             }
         QUEUED_TOOLTIPS.clear();
         QUEUED_TOOLTIPS.clear();
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     public void renderTooltip(QueuedTooltip tooltip) {
     public void renderTooltip(QueuedTooltip tooltip) {
         if (tooltip.getConsumer() == null)
         if (tooltip.getConsumer() == null)
@@ -482,7 +482,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         else
         else
             tooltip.getConsumer().accept(tooltip);
             tooltip.getConsumer().accept(tooltip);
     }
     }
-    
+
     public void renderTooltip(List<String> lines, int mouseX, int mouseY) {
     public void renderTooltip(List<String> lines, int mouseX, int mouseY) {
         if (lines.isEmpty())
         if (lines.isEmpty())
             return;
             return;
@@ -491,29 +491,29 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         tooltipLines = lines;
         tooltipLines = lines;
         ScreenHelper.drawHoveringWidget(mouseX, mouseY, renderTooltipCallback, tooltipWidth, tooltipHeight, 0);
         ScreenHelper.drawHoveringWidget(mouseX, mouseY, renderTooltipCallback, tooltipWidth, tooltipHeight, 0);
     }
     }
-    
+
     private boolean hasSameListContent(List<ItemStack> list1, List<ItemStack> list2) {
     private boolean hasSameListContent(List<ItemStack> list1, List<ItemStack> list2) {
         list1.sort(Comparator.comparing(Object::toString));
         list1.sort(Comparator.comparing(Object::toString));
         list2.sort(Comparator.comparing(Object::toString));
         list2.sort(Comparator.comparing(Object::toString));
         return CollectionUtils.mapAndJoinToString(list1, Object::toString, "").equals(CollectionUtils.mapAndJoinToString(list2, Object::toString, ""));
         return CollectionUtils.mapAndJoinToString(list1, Object::toString, "").equals(CollectionUtils.mapAndJoinToString(list2, Object::toString, ""));
     }
     }
-    
+
     public void addTooltip(@Nullable QueuedTooltip queuedTooltip) {
     public void addTooltip(@Nullable QueuedTooltip queuedTooltip) {
         if (queuedTooltip != null)
         if (queuedTooltip != null)
             QUEUED_TOOLTIPS.add(queuedTooltip);
             QUEUED_TOOLTIPS.add(queuedTooltip);
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     public void renderWidgets(int int_1, int int_2, float float_1) {
     public void renderWidgets(int int_1, int int_2, float float_1) {
         if (!ScreenHelper.isOverlayVisible())
         if (!ScreenHelper.isOverlayVisible())
             return;
             return;
         if (!ConfigObject.getInstance().isEntryListWidgetScrolled())
         if (!ConfigObject.getInstance().isEntryListWidgetScrolled())
             buttonLeft.enabled = buttonRight.enabled = ENTRY_LIST_WIDGET.getTotalPages() != 1;
             buttonLeft.enabled = buttonRight.enabled = ENTRY_LIST_WIDGET.getTotalPages() != 1;
-        for(Widget widget : widgets) {
+        for (Widget widget : widgets) {
             widget.render(int_1, int_2, float_1);
             widget.render(int_1, int_2, float_1);
         }
         }
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseScrolled(double i, double j, double amount) {
     public boolean mouseScrolled(double i, double j, double amount) {
         if (!ScreenHelper.isOverlayVisible())
         if (!ScreenHelper.isOverlayVisible())
@@ -534,18 +534,18 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             if (favoritesListWidget != null && favoritesListWidget.mouseScrolled(i, j, amount))
             if (favoritesListWidget != null && favoritesListWidget.mouseScrolled(i, j, amount))
                 return true;
                 return true;
         }
         }
-        for(Widget widget : widgets)
+        for (Widget widget : widgets)
             if (widget != ENTRY_LIST_WIDGET && (favoritesListWidget == null || widget != favoritesListWidget) && widget.mouseScrolled(i, j, amount))
             if (widget != ENTRY_LIST_WIDGET && (favoritesListWidget == null || widget != favoritesListWidget) && widget.mouseScrolled(i, j, amount))
                 return true;
                 return true;
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (ScreenHelper.isOverlayVisible()) {
         if (ScreenHelper.isOverlayVisible()) {
             if (ScreenHelper.getSearchField().keyPressed(int_1, int_2, int_3))
             if (ScreenHelper.getSearchField().keyPressed(int_1, int_2, int_3))
                 return true;
                 return true;
-            for(Element listener : widgets)
+            for (Element listener : widgets)
                 if (listener != ScreenHelper.getSearchField() && listener.keyPressed(int_1, int_2, int_3))
                 if (listener != ScreenHelper.getSearchField() && listener.keyPressed(int_1, int_2, int_3))
                     return true;
                     return true;
         }
         }
@@ -574,31 +574,31 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         }
         }
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public boolean charTyped(char char_1, int int_1) {
     public boolean charTyped(char char_1, int int_1) {
         if (!ScreenHelper.isOverlayVisible())
         if (!ScreenHelper.isOverlayVisible())
             return false;
             return false;
         if (ScreenHelper.getSearchField().charTyped(char_1, int_1))
         if (ScreenHelper.getSearchField().charTyped(char_1, int_1))
             return true;
             return true;
-        for(Element listener : widgets)
+        for (Element listener : widgets)
             if (listener != ScreenHelper.getSearchField() && listener.charTyped(char_1, int_1))
             if (listener != ScreenHelper.getSearchField() && listener.charTyped(char_1, int_1))
                 return true;
                 return true;
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public List<? extends Element> children() {
     public List<? extends Element> children() {
         return widgets;
         return widgets;
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
         if (!ScreenHelper.isOverlayVisible())
         if (!ScreenHelper.isOverlayVisible())
             return false;
             return false;
         if (MinecraftClient.getInstance().currentScreen instanceof AbstractContainerScreen && ConfigObject.getInstance().areClickableRecipeArrowsEnabled()) {
         if (MinecraftClient.getInstance().currentScreen instanceof AbstractContainerScreen && ConfigObject.getInstance().areClickableRecipeArrowsEnabled()) {
             ContainerScreenHooks hooks = (ContainerScreenHooks) MinecraftClient.getInstance().currentScreen;
             ContainerScreenHooks hooks = (ContainerScreenHooks) MinecraftClient.getInstance().currentScreen;
-            for(RecipeHelper.ScreenClickArea area : RecipeHelper.getInstance().getScreenClickAreas())
+            for (RecipeHelper.ScreenClickArea area : RecipeHelper.getInstance().getScreenClickAreas())
                 if (area.getScreenClass().equals(MinecraftClient.getInstance().currentScreen.getClass()))
                 if (area.getScreenClass().equals(MinecraftClient.getInstance().currentScreen.getClass()))
                     if (area.getRectangle().contains(double_1 - hooks.rei_getContainerLeft(), double_2 - hooks.rei_getContainerTop())) {
                     if (area.getRectangle().contains(double_1 - hooks.rei_getContainerLeft(), double_2 - hooks.rei_getContainerTop())) {
                         ClientHelper.getInstance().executeViewAllRecipesFromCategories(Arrays.asList(area.getCategories()));
                         ClientHelper.getInstance().executeViewAllRecipesFromCategories(Arrays.asList(area.getCategories()));
@@ -606,7 +606,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                         return true;
                         return true;
                     }
                     }
         }
         }
-        for(Element element : widgets)
+        for (Element element : widgets)
             if (element.mouseClicked(double_1, double_2, int_1)) {
             if (element.mouseClicked(double_1, double_2, int_1)) {
                 this.setFocused(element);
                 this.setFocused(element);
                 if (int_1 == 0)
                 if (int_1 == 0)
@@ -615,29 +615,29 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             }
             }
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseDragged(double double_1, double double_2, int int_1, double double_3, double double_4) {
     public boolean mouseDragged(double double_1, double double_2, int int_1, double double_3, double double_4) {
         if (!ScreenHelper.isOverlayVisible())
         if (!ScreenHelper.isOverlayVisible())
             return false;
             return false;
         return this.getFocused() != null && this.isDragging() && int_1 == 0 ? this.getFocused().mouseDragged(double_1, double_2, int_1, double_3, double_4) : false;
         return this.getFocused() != null && this.isDragging() && int_1 == 0 ? this.getFocused().mouseDragged(double_1, double_2, int_1, double_3, double_4) : false;
     }
     }
-    
+
     public boolean isInside(double mouseX, double mouseY) {
     public boolean isInside(double mouseX, double mouseY) {
         return rectangle.contains(mouseX, mouseY) && isNotInExclusionZones(mouseX, mouseY);
         return rectangle.contains(mouseX, mouseY) && isNotInExclusionZones(mouseX, mouseY);
     }
     }
-    
+
     public boolean isNotInExclusionZones(double mouseX, double mouseY) {
     public boolean isNotInExclusionZones(double mouseX, double mouseY) {
-        for(DisplayHelper.DisplayBoundsHandler<?> handler : DisplayHelper.getInstance().getSortedBoundsHandlers(MinecraftClient.getInstance().currentScreen.getClass())) {
+        for (DisplayHelper.DisplayBoundsHandler<?> handler : DisplayHelper.getInstance().getSortedBoundsHandlers(MinecraftClient.getInstance().currentScreen.getClass())) {
             ActionResult in = handler.isInZone(mouseX, mouseY);
             ActionResult in = handler.isInZone(mouseX, mouseY);
             if (in != ActionResult.PASS)
             if (in != ActionResult.PASS)
                 return in == ActionResult.SUCCESS;
                 return in == ActionResult.SUCCESS;
         }
         }
         return true;
         return true;
     }
     }
-    
+
     public boolean isInside(Point point) {
     public boolean isInside(Point point) {
         return isInside(point.getX(), point.getY());
         return isInside(point.getX(), point.getY());
     }
     }
-    
+
 }
 }

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

@@ -20,25 +20,25 @@ import net.minecraft.sound.SoundEvents;
 import java.util.List;
 import java.util.List;
 
 
 public class OverlaySearchField extends TextFieldWidget {
 public class OverlaySearchField extends TextFieldWidget {
-    
+
     public static boolean isSearching = false;
     public static boolean isSearching = false;
     public long keybindFocusTime = -1;
     public long keybindFocusTime = -1;
     public int keybindFocusKey = -1;
     public int keybindFocusKey = -1;
     protected long lastClickedTime = -1;
     protected long lastClickedTime = -1;
     private List<String> history = Lists.newArrayListWithCapacity(100);
     private List<String> history = Lists.newArrayListWithCapacity(100);
-    
+
     OverlaySearchField(int x, int y, int width, int height) {
     OverlaySearchField(int x, int y, int width, int height) {
         super(x, y, width, height);
         super(x, y, width, height);
         setMaxLength(10000);
         setMaxLength(10000);
     }
     }
-    
+
     @Override
     @Override
     public void setFocused(boolean boolean_1) {
     public void setFocused(boolean boolean_1) {
         if (isFocused() != boolean_1)
         if (isFocused() != boolean_1)
             addToHistory(getText());
             addToHistory(getText());
         super.setFocused(boolean_1);
         super.setFocused(boolean_1);
     }
     }
-    
+
     @Deprecated
     @Deprecated
     @Internal
     @Internal
     public void addToHistory(String text) {
     public void addToHistory(String text) {
@@ -49,7 +49,7 @@ public class OverlaySearchField extends TextFieldWidget {
                 history.remove(0);
                 history.remove(0);
         }
         }
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     public void laterRender(int int_1, int int_2, float float_1) {
     public void laterRender(int int_1, int int_2, float float_1) {
         RenderSystem.disableDepthTest();
         RenderSystem.disableDepthTest();
@@ -58,7 +58,7 @@ public class OverlaySearchField extends TextFieldWidget {
         super.render(int_1, int_2, float_1);
         super.render(int_1, int_2, float_1);
         RenderSystem.enableDepthTest();
         RenderSystem.enableDepthTest();
     }
     }
-    
+
     @Override
     @Override
     public void renderBorder() {
     public void renderBorder() {
         if (!isSearching)
         if (!isSearching)
@@ -68,7 +68,7 @@ public class OverlaySearchField extends TextFieldWidget {
             fill(this.getBounds().x, this.getBounds().y, this.getBounds().x + this.getBounds().width, this.getBounds().y + this.getBounds().height, -16777216);
             fill(this.getBounds().x, this.getBounds().y, this.getBounds().x + this.getBounds().width, this.getBounds().y + this.getBounds().height, -16777216);
         }
         }
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
         boolean contains = containsMouse(double_1, double_2);
         boolean contains = containsMouse(double_1, double_2);
@@ -86,7 +86,7 @@ public class OverlaySearchField extends TextFieldWidget {
             }
             }
         return super.mouseClicked(double_1, double_2, int_1);
         return super.mouseClicked(double_1, double_2, int_1);
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (this.isVisible() && this.isFocused())
         if (this.isVisible() && this.isFocused())
@@ -115,7 +115,7 @@ public class OverlaySearchField extends TextFieldWidget {
             }
             }
         return super.keyPressed(int_1, int_2, int_3);
         return super.keyPressed(int_1, int_2, int_3);
     }
     }
-    
+
     @Override
     @Override
     public boolean charTyped(char char_1, int int_1) {
     public boolean charTyped(char char_1, int int_1) {
         if (System.currentTimeMillis() - keybindFocusTime < 1000 && InputUtil.isKeyPressed(MinecraftClient.getInstance().getWindow().getHandle(), keybindFocusKey)) {
         if (System.currentTimeMillis() - keybindFocusTime < 1000 && InputUtil.isKeyPressed(MinecraftClient.getInstance().getWindow().getHandle(), keybindFocusKey)) {
@@ -125,14 +125,14 @@ public class OverlaySearchField extends TextFieldWidget {
         }
         }
         return super.charTyped(char_1, int_1);
         return super.charTyped(char_1, int_1);
     }
     }
-    
+
     @Override
     @Override
     public boolean containsMouse(double mouseX, double mouseY) {
     public boolean containsMouse(double mouseX, double mouseY) {
         return ScreenHelper.getLastOverlay().isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
         return ScreenHelper.getLastOverlay().isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
     }
     }
-    
+
     @Override
     @Override
     public void render(int int_1, int int_2, float float_1) {
     public void render(int int_1, int int_2, float float_1) {
     }
     }
-    
+
 }
 }

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

@@ -28,19 +28,19 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 public class PreRecipeViewingScreen extends Screen {
 public class PreRecipeViewingScreen extends Screen {
-    
+
     private static final Identifier IDENTIFIER = new Identifier("roughlyenoughitems", "textures/gui/screenshot.png");
     private static final Identifier IDENTIFIER = new Identifier("roughlyenoughitems", "textures/gui/screenshot.png");
     private final List<Widget> widgets;
     private final List<Widget> widgets;
     private boolean original;
     private boolean original;
     private Map<RecipeCategory<?>, List<RecipeDisplay>> map;
     private Map<RecipeCategory<?>, List<RecipeDisplay>> map;
-    
+
     public PreRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map) {
     public PreRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map) {
         super(new TranslatableText("text.rei.recipe_screen_type.selection"));
         super(new TranslatableText("text.rei.recipe_screen_type.selection"));
         this.widgets = Lists.newArrayList();
         this.widgets = Lists.newArrayList();
         this.original = true;
         this.original = true;
         this.map = map;
         this.map = map;
     }
     }
-    
+
     @Override
     @Override
     protected void init() {
     protected void init() {
         this.children.clear();
         this.children.clear();
@@ -57,22 +57,22 @@ public class PreRecipeViewingScreen extends Screen {
         this.widgets.add(new ScreenTypeSelection(width / 2 + 5, height / 2 - 112 / 2 - 10, 112));
         this.widgets.add(new ScreenTypeSelection(width / 2 + 5, height / 2 - 112 / 2 - 10, 112));
         this.children.addAll(widgets);
         this.children.addAll(widgets);
     }
     }
-    
+
     @Override
     @Override
     public void render(int int_1, int int_2, float float_1) {
     public void render(int int_1, int int_2, float float_1) {
         this.renderBackground();
         this.renderBackground();
         this.drawCenteredString(this.font, this.title.asFormattedString(), this.width / 2, 20, 16777215);
         this.drawCenteredString(this.font, this.title.asFormattedString(), this.width / 2, 20, 16777215);
         int i = 30;
         int i = 30;
-        for(String s : this.font.wrapStringToWidthAsList(I18n.translate("text.rei.recipe_screen_type.selection.sub"), width - 30)) {
+        for (String s : this.font.wrapStringToWidthAsList(I18n.translate("text.rei.recipe_screen_type.selection.sub"), width - 30)) {
             this.drawCenteredString(this.font, Formatting.GRAY.toString() + s, width / 2, i, -1);
             this.drawCenteredString(this.font, Formatting.GRAY.toString() + s, width / 2, i, -1);
             i += 10;
             i += 10;
         }
         }
         super.render(int_1, int_2, float_1);
         super.render(int_1, int_2, float_1);
-        for(Widget widget : widgets) {
+        for (Widget widget : widgets) {
             widget.render(int_1, int_2, float_1);
             widget.render(int_1, int_2, float_1);
         }
         }
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if ((int_1 == 256 || this.minecraft.options.keyInventory.matchesKey(int_1, int_2)) && this.shouldCloseOnEsc()) {
         if ((int_1 == 256 || this.minecraft.options.keyInventory.matchesKey(int_1, int_2)) && this.shouldCloseOnEsc()) {
@@ -82,23 +82,23 @@ public class PreRecipeViewingScreen extends Screen {
         }
         }
         return super.keyPressed(int_1, int_2, int_3);
         return super.keyPressed(int_1, int_2, int_3);
     }
     }
-    
+
     public class ScreenTypeSelection extends WidgetWithBounds {
     public class ScreenTypeSelection extends WidgetWithBounds {
-        
+
         private Rectangle bounds;
         private Rectangle bounds;
         private int u, v;
         private int u, v;
-        
+
         public ScreenTypeSelection(int x, int y, int v) {
         public ScreenTypeSelection(int x, int y, int v) {
             this.bounds = new Rectangle(x - 4, y - 4, 208, 120);
             this.bounds = new Rectangle(x - 4, y - 4, 208, 120);
             this.u = 0;
             this.u = 0;
             this.v = v;
             this.v = v;
         }
         }
-        
+
         @Override
         @Override
         public Rectangle getBounds() {
         public Rectangle getBounds() {
             return bounds;
             return bounds;
         }
         }
-        
+
         @Override
         @Override
         public void render(int i, int i1, float delta) {
         public void render(int i, int i1, float delta) {
             MinecraftClient.getInstance().getTextureManager().bindTexture(IDENTIFIER);
             MinecraftClient.getInstance().getTextureManager().bindTexture(IDENTIFIER);
@@ -110,7 +110,7 @@ public class PreRecipeViewingScreen extends Screen {
                 fillGradient(bounds.x + bounds.width - 2, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height, 0xFFFFFFFF, 0xFFFFFFFF);
                 fillGradient(bounds.x + bounds.width - 2, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height, 0xFFFFFFFF, 0xFFFFFFFF);
             }
             }
         }
         }
-        
+
         @Override
         @Override
         public boolean mouseClicked(double double_1, double double_2, int int_1) {
         public boolean mouseClicked(double double_1, double double_2, int int_1) {
             if (containsMouse(double_1, double_2)) {
             if (containsMouse(double_1, double_2)) {
@@ -120,7 +120,7 @@ public class PreRecipeViewingScreen extends Screen {
             }
             }
             return false;
             return false;
         }
         }
-        
+
         @Override
         @Override
         public List<? extends Element> children() {
         public List<? extends Element> children() {
             return Collections.emptyList();
             return Collections.emptyList();

+ 39 - 38
src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java

@@ -31,7 +31,7 @@ import java.util.*;
 import java.util.function.Supplier;
 import java.util.function.Supplier;
 
 
 public class RecipeViewingScreen extends Screen {
 public class RecipeViewingScreen extends Screen {
-    
+
     public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     private static final int TABS_PER_PAGE = 5;
     private static final int TABS_PER_PAGE = 5;
     private final List<Widget> preWidgets;
     private final List<Widget> preWidgets;
@@ -46,10 +46,11 @@ public class RecipeViewingScreen extends Screen {
     public boolean choosePageActivated;
     public boolean choosePageActivated;
     public RecipeChoosePageWidget recipeChoosePageWidget;
     public RecipeChoosePageWidget recipeChoosePageWidget;
     private Rectangle bounds;
     private Rectangle bounds;
-    @Nullable private CategoryBaseWidget workingStationsBaseWidget;
+    @Nullable
+    private CategoryBaseWidget workingStationsBaseWidget;
     private RecipeCategory<RecipeDisplay> selectedCategory;
     private RecipeCategory<RecipeDisplay> selectedCategory;
     private ButtonWidget recipeBack, recipeNext, categoryBack, categoryNext;
     private ButtonWidget recipeBack, recipeNext, categoryBack, categoryNext;
-    
+
     public RecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> categoriesMap) {
     public RecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> categoriesMap) {
         super(new LiteralText(""));
         super(new LiteralText(""));
         this.categoryPages = 0;
         this.categoryPages = 0;
@@ -67,12 +68,12 @@ public class RecipeViewingScreen extends Screen {
         this.tabs = new ArrayList<>();
         this.tabs = new ArrayList<>();
         this.choosePageActivated = false;
         this.choosePageActivated = false;
     }
     }
-    
+
     @Nullable
     @Nullable
     public CategoryBaseWidget getWorkingStationsBaseWidget() {
     public CategoryBaseWidget getWorkingStationsBaseWidget() {
         return workingStationsBaseWidget;
         return workingStationsBaseWidget;
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (int_1 == 256 && choosePageActivated) {
         if (int_1 == 256 && choosePageActivated) {
@@ -114,12 +115,12 @@ public class RecipeViewingScreen extends Screen {
         }
         }
         return super.keyPressed(int_1, int_2, int_3);
         return super.keyPressed(int_1, int_2, int_3);
     }
     }
-    
+
     @Override
     @Override
     public boolean isPauseScreen() {
     public boolean isPauseScreen() {
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public void init() {
     public void init() {
         super.init();
         super.init();
@@ -134,7 +135,7 @@ public class RecipeViewingScreen extends Screen {
         this.guiHeight = MathHelper.floor(MathHelper.clamp((selectedCategory.getDisplayHeight() + 7d) * (getRecipesPerPage() + 1d) + 40d, 186d, (double) largestHeight));
         this.guiHeight = MathHelper.floor(MathHelper.clamp((selectedCategory.getDisplayHeight() + 7d) * (getRecipesPerPage() + 1d) + 40d, 186d, (double) largestHeight));
         this.bounds = new Rectangle(width / 2 - guiWidth / 2, height / 2 - guiHeight / 2, guiWidth, guiHeight);
         this.bounds = new Rectangle(width / 2 - guiWidth / 2, height / 2 - guiHeight / 2, guiWidth, guiHeight);
         this.page = MathHelper.clamp(page, 0, getTotalPages(selectedCategory) - 1);
         this.page = MathHelper.clamp(page, 0, getTotalPages(selectedCategory) - 1);
-        
+
         ButtonWidget w, w2;
         ButtonWidget w, w2;
         this.widgets.add(w = new ButtonWidget(new Rectangle(bounds.x + 2, bounds.y - 16, 10, 10), I18n.translate("text.rei.left_arrow")) {
         this.widgets.add(w = new ButtonWidget(new Rectangle(bounds.x + 2, bounds.y - 16, 10, 10), I18n.translate("text.rei.left_arrow")) {
             @Override
             @Override
@@ -167,7 +168,7 @@ public class RecipeViewingScreen extends Screen {
                 page = 0;
                 page = 0;
                 RecipeViewingScreen.this.init();
                 RecipeViewingScreen.this.init();
             }
             }
-            
+
             @Override
             @Override
             public Optional<String> getTooltips() {
             public Optional<String> getTooltips() {
                 return Optional.ofNullable(I18n.translate("text.rei.previous_category"));
                 return Optional.ofNullable(I18n.translate("text.rei.previous_category"));
@@ -179,12 +180,12 @@ public class RecipeViewingScreen extends Screen {
                 setText(selectedCategory.getCategoryName());
                 setText(selectedCategory.getCategoryName());
                 super.render(mouseX, mouseY, delta);
                 super.render(mouseX, mouseY, delta);
             }
             }
-            
+
             @Override
             @Override
             public Optional<String> getTooltips() {
             public Optional<String> getTooltips() {
                 return Optional.ofNullable(I18n.translate("text.rei.view_all_categories"));
                 return Optional.ofNullable(I18n.translate("text.rei.view_all_categories"));
             }
             }
-            
+
             @Override
             @Override
             public void onLabelClicked() {
             public void onLabelClicked() {
                 MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                 MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
@@ -203,7 +204,7 @@ public class RecipeViewingScreen extends Screen {
                 page = 0;
                 page = 0;
                 RecipeViewingScreen.this.init();
                 RecipeViewingScreen.this.init();
             }
             }
-            
+
             @Override
             @Override
             public Optional<String> getTooltips() {
             public Optional<String> getTooltips() {
                 return Optional.ofNullable(I18n.translate("text.rei.next_category"));
                 return Optional.ofNullable(I18n.translate("text.rei.next_category"));
@@ -211,7 +212,7 @@ public class RecipeViewingScreen extends Screen {
         });
         });
         categoryBack.enabled = categories.size() > 1;
         categoryBack.enabled = categories.size() > 1;
         categoryNext.enabled = categories.size() > 1;
         categoryNext.enabled = categories.size() > 1;
-        
+
         widgets.add(recipeBack = new ButtonWidget(new Rectangle(bounds.getX() + 5, bounds.getY() + 21, 12, 12), I18n.translate("text.rei.left_arrow")) {
         widgets.add(recipeBack = new ButtonWidget(new Rectangle(bounds.getX() + 5, bounds.getY() + 21, 12, 12), I18n.translate("text.rei.left_arrow")) {
             @Override
             @Override
             public void onPressed() {
             public void onPressed() {
@@ -220,7 +221,7 @@ public class RecipeViewingScreen extends Screen {
                     page = getTotalPages(selectedCategory) - 1;
                     page = getTotalPages(selectedCategory) - 1;
                 RecipeViewingScreen.this.init();
                 RecipeViewingScreen.this.init();
             }
             }
-            
+
             @Override
             @Override
             public Optional<String> getTooltips() {
             public Optional<String> getTooltips() {
                 return Optional.ofNullable(I18n.translate("text.rei.previous_page"));
                 return Optional.ofNullable(I18n.translate("text.rei.previous_page"));
@@ -232,12 +233,12 @@ public class RecipeViewingScreen extends Screen {
                 setText(String.format("%d/%d", page + 1, getTotalPages(selectedCategory)));
                 setText(String.format("%d/%d", page + 1, getTotalPages(selectedCategory)));
                 super.render(mouseX, mouseY, delta);
                 super.render(mouseX, mouseY, delta);
             }
             }
-            
+
             @Override
             @Override
             public Optional<String> getTooltips() {
             public Optional<String> getTooltips() {
                 return Optional.ofNullable(I18n.translate("text.rei.choose_page"));
                 return Optional.ofNullable(I18n.translate("text.rei.choose_page"));
             }
             }
-            
+
             @Override
             @Override
             public void onLabelClicked() {
             public void onLabelClicked() {
                 MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                 MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
@@ -253,7 +254,7 @@ public class RecipeViewingScreen extends Screen {
                     page = 0;
                     page = 0;
                 RecipeViewingScreen.this.init();
                 RecipeViewingScreen.this.init();
             }
             }
-            
+
             @Override
             @Override
             public Optional<String> getTooltips() {
             public Optional<String> getTooltips() {
                 return Optional.ofNullable(I18n.translate("text.rei.next_page"));
                 return Optional.ofNullable(I18n.translate("text.rei.next_page"));
@@ -299,7 +300,7 @@ public class RecipeViewingScreen extends Screen {
             recipeChoosePageWidget = new RecipeChoosePageWidget(this, page, getTotalPages(selectedCategory));
             recipeChoosePageWidget = new RecipeChoosePageWidget(this, page, getTotalPages(selectedCategory));
         else
         else
             recipeChoosePageWidget = null;
             recipeChoosePageWidget = null;
-        
+
         workingStationsBaseWidget = null;
         workingStationsBaseWidget = null;
         List<List<EntryStack>> workingStations = RecipeHelper.getInstance().getWorkingStations(selectedCategory.getIdentifier());
         List<List<EntryStack>> workingStations = RecipeHelper.getInstance().getWorkingStations(selectedCategory.getIdentifier());
         if (!workingStations.isEmpty()) {
         if (!workingStations.isEmpty()) {
@@ -323,17 +324,17 @@ public class RecipeViewingScreen extends Screen {
                 }
                 }
             }
             }
         }
         }
-        
+
         children.addAll(tabs);
         children.addAll(tabs);
         children.add(ScreenHelper.getLastOverlay(true, false));
         children.add(ScreenHelper.getLastOverlay(true, false));
         children.addAll(widgets);
         children.addAll(widgets);
         children.addAll(preWidgets);
         children.addAll(preWidgets);
     }
     }
-    
+
     public List<Widget> getWidgets() {
     public List<Widget> getWidgets() {
         return widgets;
         return widgets;
     }
     }
-    
+
     public List<RecipeDisplay> getCurrentDisplayed() {
     public List<RecipeDisplay> getCurrentDisplayed() {
         List<RecipeDisplay> list = Lists.newArrayList();
         List<RecipeDisplay> list = Lists.newArrayList();
         int recipesPerPage = getRecipesPerPage();
         int recipesPerPage = getRecipesPerPage();
@@ -342,19 +343,19 @@ public class RecipeViewingScreen extends Screen {
                 list.add(categoriesMap.get(selectedCategory).get(page * (recipesPerPage + 1) + i));
                 list.add(categoriesMap.get(selectedCategory).get(page * (recipesPerPage + 1) + i));
         return list;
         return list;
     }
     }
-    
+
     public RecipeCategory<?> getSelectedCategory() {
     public RecipeCategory<?> getSelectedCategory() {
         return selectedCategory;
         return selectedCategory;
     }
     }
-    
+
     public int getPage() {
     public int getPage() {
         return page;
         return page;
     }
     }
-    
+
     public int getCategoryPage() {
     public int getCategoryPage() {
         return categoryPages;
         return categoryPages;
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     private int getRecipesPerPage() {
     private int getRecipesPerPage() {
         if (selectedCategory.getFixedRecipesPerPage() > 0)
         if (selectedCategory.getFixedRecipesPerPage() > 0)
@@ -362,16 +363,16 @@ public class RecipeViewingScreen extends Screen {
         int height = selectedCategory.getDisplayHeight();
         int height = selectedCategory.getDisplayHeight();
         return MathHelper.clamp(MathHelper.floor(((double) largestHeight - 40d) / ((double) height + 7d)) - 1, 0, Math.min(ConfigObject.getInstance().getMaxRecipePerPage() - 1, selectedCategory.getMaximumRecipePerPage() - 1));
         return MathHelper.clamp(MathHelper.floor(((double) largestHeight - 40d) / ((double) height + 7d)) - 1, 0, Math.min(ConfigObject.getInstance().getMaxRecipePerPage() - 1, selectedCategory.getMaximumRecipePerPage() - 1));
     }
     }
-    
+
     private int getRecipesPerPageByHeight() {
     private int getRecipesPerPageByHeight() {
         int height = selectedCategory.getDisplayHeight();
         int height = selectedCategory.getDisplayHeight();
         return MathHelper.clamp(MathHelper.floor(((double) guiHeight - 40d) / ((double) height + 7d)), 0, Math.min(ConfigObject.getInstance().getMaxRecipePerPage() - 1, selectedCategory.getMaximumRecipePerPage() - 1));
         return MathHelper.clamp(MathHelper.floor(((double) guiHeight - 40d) / ((double) height + 7d)), 0, Math.min(ConfigObject.getInstance().getMaxRecipePerPage() - 1, selectedCategory.getMaximumRecipePerPage() - 1));
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
         this.fillGradient(0, 0, this.width, this.height, -1072689136, -804253680);
         this.fillGradient(0, 0, this.width, this.height, -1072689136, -804253680);
-        for(Widget widget : preWidgets) {
+        for (Widget widget : preWidgets) {
             widget.render(mouseX, mouseY, delta);
             widget.render(mouseX, mouseY, delta);
         }
         }
         if (selectedCategory != null)
         if (selectedCategory != null)
@@ -391,7 +392,7 @@ public class RecipeViewingScreen extends Screen {
                 tab.render(mouseX, mouseY, delta);
                 tab.render(mouseX, mouseY, delta);
         }
         }
         super.render(mouseX, mouseY, delta);
         super.render(mouseX, mouseY, delta);
-        for(Widget widget : widgets) {
+        for (Widget widget : widgets) {
             widget.render(mouseX, mouseY, delta);
             widget.render(mouseX, mouseY, delta);
         }
         }
         RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
         RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -408,15 +409,15 @@ public class RecipeViewingScreen extends Screen {
             recipeChoosePageWidget.render(mouseX, mouseY, delta);
             recipeChoosePageWidget.render(mouseX, mouseY, delta);
         }
         }
     }
     }
-    
+
     public int getTotalPages(RecipeCategory category) {
     public int getTotalPages(RecipeCategory category) {
         return MathHelper.ceil(categoriesMap.get(category).size() / (double) (getRecipesPerPage() + 1));
         return MathHelper.ceil(categoriesMap.get(category).size() / (double) (getRecipesPerPage() + 1));
     }
     }
-    
+
     public Rectangle getBounds() {
     public Rectangle getBounds() {
         return bounds;
         return bounds;
     }
     }
-    
+
     @Override
     @Override
     public boolean charTyped(char char_1, int int_1) {
     public boolean charTyped(char char_1, int int_1) {
         if (choosePageActivated) {
         if (choosePageActivated) {
@@ -427,7 +428,7 @@ public class RecipeViewingScreen extends Screen {
                 return true;
                 return true;
         return super.charTyped(char_1, int_1);
         return super.charTyped(char_1, int_1);
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseDragged(double double_1, double double_2, int int_1, double double_3, double double_4) {
     public boolean mouseDragged(double double_1, double double_2, int int_1, double double_3, double double_4) {
         if (choosePageActivated) {
         if (choosePageActivated) {
@@ -435,7 +436,7 @@ public class RecipeViewingScreen extends Screen {
         }
         }
         return super.mouseDragged(double_1, double_2, int_1, double_3, double_4);
         return super.mouseDragged(double_1, double_2, int_1, double_3, double_4);
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseReleased(double double_1, double double_2, int int_1) {
     public boolean mouseReleased(double double_1, double double_2, int int_1) {
         if (choosePageActivated) {
         if (choosePageActivated) {
@@ -443,7 +444,7 @@ public class RecipeViewingScreen extends Screen {
         }
         }
         return super.mouseReleased(double_1, double_2, int_1);
         return super.mouseReleased(double_1, double_2, int_1);
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseScrolled(double i, double j, double amount) {
     public boolean mouseScrolled(double i, double j, double amount) {
         for (Element listener : children())
         for (Element listener : children())
@@ -463,7 +464,7 @@ public class RecipeViewingScreen extends Screen {
         }
         }
         return super.mouseScrolled(i, j, amount);
         return super.mouseScrolled(i, j, amount);
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
         if (choosePageActivated)
         if (choosePageActivated)
@@ -483,12 +484,12 @@ public class RecipeViewingScreen extends Screen {
             }
             }
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public Element getFocused() {
     public Element getFocused() {
         if (choosePageActivated)
         if (choosePageActivated)
             return recipeChoosePageWidget;
             return recipeChoosePageWidget;
         return super.getFocused();
         return super.getFocused();
     }
     }
-    
+
 }
 }

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

@@ -40,7 +40,7 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.Optional;
 
 
 public class VillagerRecipeViewingScreen extends Screen {
 public class VillagerRecipeViewingScreen extends Screen {
-    
+
     private static final int TABS_PER_PAGE = 8;
     private static final int TABS_PER_PAGE = 8;
     private final Map<RecipeCategory<?>, List<RecipeDisplay>> categoryMap;
     private final Map<RecipeCategory<?>, List<RecipeDisplay>> categoryMap;
     private final List<RecipeCategory<?>> categories;
     private final List<RecipeCategory<?>> categories;
@@ -59,7 +59,7 @@ public class VillagerRecipeViewingScreen extends Screen {
     private long scrollBarAlphaFutureTime = -1;
     private long scrollBarAlphaFutureTime = -1;
     private boolean draggingScrollBar = false;
     private boolean draggingScrollBar = false;
     private int tabsPage;
     private int tabsPage;
-    
+
     public VillagerRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map) {
     public VillagerRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map) {
         super(new LiteralText(""));
         super(new LiteralText(""));
         this.widgets = Lists.newArrayList();
         this.widgets = Lists.newArrayList();
@@ -82,7 +82,7 @@ public class VillagerRecipeViewingScreen extends Screen {
             }
             }
         });
         });
     }
     }
-    
+
     @Override
     @Override
     protected void init() {
     protected void init() {
         super.init();
         super.init();
@@ -99,7 +99,7 @@ public class VillagerRecipeViewingScreen extends Screen {
         int guiWidth = MathHelper.clamp(category.getDisplayWidth(display) + 30, 0, largestWidth) + 100;
         int guiWidth = MathHelper.clamp(category.getDisplayWidth(display) + 30, 0, largestWidth) + 100;
         int guiHeight = MathHelper.clamp(category.getDisplayHeight() + 40, 166, largestHeight);
         int guiHeight = MathHelper.clamp(category.getDisplayHeight() + 40, 166, largestHeight);
         this.bounds = new Rectangle(width / 2 - guiWidth / 2, height / 2 - guiHeight / 2, guiWidth, guiHeight);
         this.bounds = new Rectangle(width / 2 - guiWidth / 2, height / 2 - guiHeight / 2, guiWidth, guiHeight);
-        
+
         List<List<EntryStack>> workingStations = RecipeHelper.getInstance().getWorkingStations(category.getIdentifier());
         List<List<EntryStack>> workingStations = RecipeHelper.getInstance().getWorkingStations(category.getIdentifier());
         if (!workingStations.isEmpty()) {
         if (!workingStations.isEmpty()) {
             int ww = MathHelper.floor((bounds.width - 16) / 18f);
             int ww = MathHelper.floor((bounds.width - 16) / 18f);
@@ -121,18 +121,18 @@ public class VillagerRecipeViewingScreen extends Screen {
                 }
                 }
             }
             }
         }
         }
-        
+
         this.widgets.add(new CategoryBaseWidget(bounds));
         this.widgets.add(new CategoryBaseWidget(bounds));
         this.scrollListBounds = new Rectangle(bounds.x + 4, bounds.y + 17, 97 + 5, guiHeight - 17 - 7);
         this.scrollListBounds = new Rectangle(bounds.x + 4, bounds.y + 17, 97 + 5, guiHeight - 17 - 7);
         this.widgets.add(new SlotBaseWidget(scrollListBounds));
         this.widgets.add(new SlotBaseWidget(scrollListBounds));
-        
+
         Rectangle recipeBounds = new Rectangle(bounds.x + 100 + (guiWidth - 100) / 2 - category.getDisplayWidth(display) / 2, bounds.y + bounds.height / 2 - category.getDisplayHeight() / 2, category.getDisplayWidth(display), category.getDisplayHeight());
         Rectangle recipeBounds = new Rectangle(bounds.x + 100 + (guiWidth - 100) / 2 - category.getDisplayWidth(display) / 2, bounds.y + bounds.height / 2 - category.getDisplayHeight() / 2, category.getDisplayWidth(display), category.getDisplayHeight());
         List<Widget> setupDisplay = category.setupDisplay(() -> display, recipeBounds);
         List<Widget> setupDisplay = category.setupDisplay(() -> display, recipeBounds);
         this.widgets.addAll(setupDisplay);
         this.widgets.addAll(setupDisplay);
         Optional<ButtonAreaSupplier> supplier = RecipeHelper.getInstance().getAutoCraftButtonArea(category);
         Optional<ButtonAreaSupplier> supplier = RecipeHelper.getInstance().getAutoCraftButtonArea(category);
         if (supplier.isPresent() && supplier.get().get(recipeBounds) != null)
         if (supplier.isPresent() && supplier.get().get(recipeBounds) != null)
             this.widgets.add(new AutoCraftingButtonWidget(recipeBounds, supplier.get().get(recipeBounds), supplier.get().getButtonText(), () -> display, setupDisplay, category));
             this.widgets.add(new AutoCraftingButtonWidget(recipeBounds, supplier.get().get(recipeBounds), supplier.get().getButtonText(), () -> display, setupDisplay, category));
-        
+
         int index = 0;
         int index = 0;
         for (RecipeDisplay recipeDisplay : categoryMap.get(category)) {
         for (RecipeDisplay recipeDisplay : categoryMap.get(category)) {
             int finalIndex = index;
             int finalIndex = index;
@@ -144,18 +144,18 @@ public class VillagerRecipeViewingScreen extends Screen {
                     selectedRecipeIndex = finalIndex;
                     selectedRecipeIndex = finalIndex;
                     VillagerRecipeViewingScreen.this.init();
                     VillagerRecipeViewingScreen.this.init();
                 }
                 }
-                
+
                 @Override
                 @Override
                 public boolean isHovered(int mouseX, int mouseY) {
                 public boolean isHovered(int mouseX, int mouseY) {
                     return (isMouseOver(mouseX, mouseY) && scrollListBounds.contains(mouseX, mouseY)) || focused;
                     return (isMouseOver(mouseX, mouseY) && scrollListBounds.contains(mouseX, mouseY)) || focused;
                 }
                 }
-                
+
                 @Override
                 @Override
                 protected int getTextureId(boolean boolean_1) {
                 protected int getTextureId(boolean boolean_1) {
                     enabled = selectedRecipeIndex != finalIndex;
                     enabled = selectedRecipeIndex != finalIndex;
                     return super.getTextureId(boolean_1);
                     return super.getTextureId(boolean_1);
                 }
                 }
-                
+
                 @Override
                 @Override
                 public boolean mouseClicked(double mouseX, double mouseY, int button) {
                 public boolean mouseClicked(double mouseX, double mouseY, int button) {
                     if ((isMouseOver(mouseX, mouseY) && scrollListBounds.contains(mouseX, mouseY)) && enabled && button == 0) {
                     if ((isMouseOver(mouseX, mouseY) && scrollListBounds.contains(mouseX, mouseY)) && enabled && button == 0) {
@@ -211,39 +211,39 @@ public class VillagerRecipeViewingScreen extends Screen {
             }
             }
         });
         });
         w.enabled = w2.enabled = categories.size() > TABS_PER_PAGE;
         w.enabled = w2.enabled = categories.size() > TABS_PER_PAGE;
-        
+
         this.widgets.add(new ClickableLabelWidget(new Point(bounds.x + 4 + scrollListBounds.width / 2, bounds.y + 6), categories.get(selectedCategoryIndex).getCategoryName()) {
         this.widgets.add(new ClickableLabelWidget(new Point(bounds.x + 4 + scrollListBounds.width / 2, bounds.y + 6), categories.get(selectedCategoryIndex).getCategoryName()) {
             @Override
             @Override
             public void onLabelClicked() {
             public void onLabelClicked() {
                 MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                 MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                 ClientHelper.getInstance().executeViewAllRecipesKeyBind();
                 ClientHelper.getInstance().executeViewAllRecipesKeyBind();
             }
             }
-            
+
             @Override
             @Override
             public Optional<String> getTooltips() {
             public Optional<String> getTooltips() {
                 return Optional.ofNullable(I18n.translate("text.rei.view_all_categories"));
                 return Optional.ofNullable(I18n.translate("text.rei.view_all_categories"));
             }
             }
         });
         });
-        
+
         this.children.addAll(buttonWidgets);
         this.children.addAll(buttonWidgets);
         this.widgets.addAll(tabs);
         this.widgets.addAll(tabs);
         this.children.addAll(widgets);
         this.children.addAll(widgets);
         this.children.add(ScreenHelper.getLastOverlay(true, false));
         this.children.add(ScreenHelper.getLastOverlay(true, false));
         ScreenHelper.getLastOverlay().init();
         ScreenHelper.getLastOverlay().init();
     }
     }
-    
+
     private final double clamp(double v) {
     private final double clamp(double v) {
         return clamp(v, 200);
         return clamp(v, 200);
     }
     }
-    
+
     private final double clamp(double v, double clampExtension) {
     private final double clamp(double v, double clampExtension) {
         return MathHelper.clamp(v, -clampExtension, getMaxScroll() + clampExtension);
         return MathHelper.clamp(v, -clampExtension, getMaxScroll() + clampExtension);
     }
     }
-    
+
     private double getMaxScroll() {
     private double getMaxScroll() {
         return Math.max(0, this.getMaxScrollPosition() - (scrollListBounds.height - 2));
         return Math.max(0, this.getMaxScrollPosition() - (scrollListBounds.height - 2));
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseClicked(double mouseX, double mouseY, int int_1) {
     public boolean mouseClicked(double mouseX, double mouseY, int int_1) {
         double height = getMaxScrollPosition();
         double height = getMaxScrollPosition();
@@ -259,7 +259,7 @@ public class VillagerRecipeViewingScreen extends Screen {
         this.draggingScrollBar = false;
         this.draggingScrollBar = false;
         return super.mouseClicked(mouseX, mouseY, int_1);
         return super.mouseClicked(mouseX, mouseY, int_1);
     }
     }
-    
+
     @Override
     @Override
     public boolean charTyped(char char_1, int int_1) {
     public boolean charTyped(char char_1, int int_1) {
         for (Element listener : children())
         for (Element listener : children())
@@ -267,25 +267,25 @@ public class VillagerRecipeViewingScreen extends Screen {
                 return true;
                 return true;
         return super.charTyped(char_1, int_1);
         return super.charTyped(char_1, int_1);
     }
     }
-    
+
     public void offset(double value, boolean animated) {
     public void offset(double value, boolean animated) {
         scrollTo(target + value, animated);
         scrollTo(target + value, animated);
     }
     }
-    
+
     public void scrollTo(double value, boolean animated) {
     public void scrollTo(double value, boolean animated) {
         scrollTo(value, animated, ClothConfigInitializer.getScrollDuration());
         scrollTo(value, animated, ClothConfigInitializer.getScrollDuration());
     }
     }
-    
+
     public void scrollTo(double value, boolean animated, long duration) {
     public void scrollTo(double value, boolean animated, long duration) {
         target = clamp(value);
         target = clamp(value);
-        
+
         if (animated) {
         if (animated) {
             start = System.currentTimeMillis();
             start = System.currentTimeMillis();
             this.duration = duration;
             this.duration = duration;
         } else
         } else
             scroll = target;
             scroll = target;
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
         double height = CollectionUtils.sumInt(buttonWidgets, b -> b.getBounds().getHeight());
         double height = CollectionUtils.sumInt(buttonWidgets, b -> b.getBounds().getHeight());
@@ -316,11 +316,11 @@ public class VillagerRecipeViewingScreen extends Screen {
         }
         }
         return super.mouseScrolled(double_1, double_2, double_3);
         return super.mouseScrolled(double_1, double_2, double_3);
     }
     }
-    
+
     private double getMaxScrollPosition() {
     private double getMaxScrollPosition() {
         return CollectionUtils.sumInt(buttonWidgets, b -> b.getBounds().getHeight());
         return CollectionUtils.sumInt(buttonWidgets, b -> b.getBounds().getHeight());
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
         if (ConfigObject.getInstance().doesVillagerScreenHavePermanentScrollBar()) {
         if (ConfigObject.getInstance().doesVillagerScreenHavePermanentScrollBar()) {
@@ -348,7 +348,7 @@ public class VillagerRecipeViewingScreen extends Screen {
         updatePosition(delta);
         updatePosition(delta);
         this.fillGradient(0, 0, this.width, this.height, -1072689136, -804253680);
         this.fillGradient(0, 0, this.width, this.height, -1072689136, -804253680);
         int yOffset = 0;
         int yOffset = 0;
-        for(Widget widget : widgets) {
+        for (Widget widget : widgets) {
             widget.render(mouseX, mouseY, delta);
             widget.render(mouseX, mouseY, delta);
         }
         }
         ScreenHelper.getLastOverlay().render(mouseX, mouseY, delta);
         ScreenHelper.getLastOverlay().render(mouseX, mouseY, delta);
@@ -408,7 +408,7 @@ public class VillagerRecipeViewingScreen extends Screen {
         RenderSystem.popMatrix();
         RenderSystem.popMatrix();
         ScreenHelper.getLastOverlay().lateRender(mouseX, mouseY, delta);
         ScreenHelper.getLastOverlay().lateRender(mouseX, mouseY, delta);
     }
     }
-    
+
     private void updatePosition(float delta) {
     private void updatePosition(float delta) {
         target = clamp(target);
         target = clamp(target);
         if (target < 0) {
         if (target < 0) {
@@ -421,7 +421,7 @@ public class VillagerRecipeViewingScreen extends Screen {
         else
         else
             scroll = target;
             scroll = target;
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseDragged(double mouseX, double mouseY, int int_1, double double_3, double double_4) {
     public boolean mouseDragged(double mouseX, double mouseY, int int_1, double double_3, double double_4) {
         if (int_1 == 0 && scrollBarAlpha > 0 && draggingScrollBar) {
         if (int_1 == 0 && scrollBarAlpha > 0 && draggingScrollBar) {
@@ -438,7 +438,7 @@ public class VillagerRecipeViewingScreen extends Screen {
         }
         }
         return super.mouseDragged(mouseX, mouseY, int_1, double_3, double_4);
         return super.mouseDragged(mouseX, mouseY, int_1, double_3, double_4);
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if ((int_1 == 256 || this.minecraft.options.keyInventory.matchesKey(int_1, int_2)) && this.shouldCloseOnEsc()) {
         if ((int_1 == 256 || this.minecraft.options.keyInventory.matchesKey(int_1, int_2)) && this.shouldCloseOnEsc()) {
@@ -483,5 +483,5 @@ public class VillagerRecipeViewingScreen extends Screen {
         }
         }
         return super.keyPressed(int_1, int_2, int_3);
         return super.keyPressed(int_1, int_2, int_3);
     }
     }
-    
+
 }
 }

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

@@ -12,7 +12,7 @@ import java.util.Locale;
 public enum ItemCheatingMode {
 public enum ItemCheatingMode {
     REI_LIKE,
     REI_LIKE,
     JEI_LIKE;
     JEI_LIKE;
-    
+
     @Override
     @Override
     public String toString() {
     public String toString() {
         return I18n.translate("config.roughlyenoughitems.itemCheatingMode." + name().toLowerCase(Locale.ROOT));
         return I18n.translate("config.roughlyenoughitems.itemCheatingMode." + name().toLowerCase(Locale.ROOT));

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

@@ -6,19 +6,19 @@
 package me.shedaniel.rei.gui.config;
 package me.shedaniel.rei.gui.config;
 
 
 public enum ItemListOrdering {
 public enum ItemListOrdering {
-    
+
     registry("ordering.rei.registry"),
     registry("ordering.rei.registry"),
     name("ordering.rei.name"),
     name("ordering.rei.name"),
     item_groups("ordering.rei.item_groups");
     item_groups("ordering.rei.item_groups");
-    
+
     private String nameTranslationKey;
     private String nameTranslationKey;
-    
+
     ItemListOrdering(String nameTranslationKey) {
     ItemListOrdering(String nameTranslationKey) {
         this.nameTranslationKey = nameTranslationKey;
         this.nameTranslationKey = nameTranslationKey;
     }
     }
-    
+
     public String getNameTranslationKey() {
     public String getNameTranslationKey() {
         return nameTranslationKey;
         return nameTranslationKey;
     }
     }
-    
+
 }
 }

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

@@ -14,28 +14,28 @@ public enum ItemListOrderingConfig {
     REGISTRY_DESCENDING(ItemListOrdering.registry, false),
     REGISTRY_DESCENDING(ItemListOrdering.registry, false),
     NAME_DESCENDING(ItemListOrdering.name, false),
     NAME_DESCENDING(ItemListOrdering.name, false),
     GROUPS_DESCENDING(ItemListOrdering.item_groups, false);
     GROUPS_DESCENDING(ItemListOrdering.item_groups, false);
-    
+
     private ItemListOrdering ordering;
     private ItemListOrdering ordering;
     private boolean isAscending;
     private boolean isAscending;
-    
+
     ItemListOrderingConfig(ItemListOrdering ordering, boolean isAscending) {
     ItemListOrderingConfig(ItemListOrdering ordering, boolean isAscending) {
         this.ordering = ordering;
         this.ordering = ordering;
         this.isAscending = isAscending;
         this.isAscending = isAscending;
     }
     }
-    
+
     public static ItemListOrderingConfig from(ItemListOrdering ordering, boolean isAscending) {
     public static ItemListOrderingConfig from(ItemListOrdering ordering, boolean isAscending) {
         int index = ordering.ordinal() + (isAscending ? 0 : 3);
         int index = ordering.ordinal() + (isAscending ? 0 : 3);
         return values()[index];
         return values()[index];
     }
     }
-    
+
     public ItemListOrdering getOrdering() {
     public ItemListOrdering getOrdering() {
         return ordering;
         return ordering;
     }
     }
-    
+
     public boolean isAscending() {
     public boolean isAscending() {
         return isAscending;
         return isAscending;
     }
     }
-    
+
     @Override
     @Override
     public String toString() {
     public String toString() {
         return I18n.translate("config.roughlyenoughitems.list_ordering_button", I18n.translate(getOrdering().getNameTranslationKey()), I18n.translate(isAscending ? "ordering.rei.ascending" : "ordering.rei.descending"));
         return I18n.translate("config.roughlyenoughitems.list_ordering_button", I18n.translate(getOrdering().getNameTranslationKey()), I18n.translate(isAscending ? "ordering.rei.ascending" : "ordering.rei.descending"));

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

@@ -13,7 +13,7 @@ public enum RecipeScreenType {
     UNSET,
     UNSET,
     ORIGINAL,
     ORIGINAL,
     VILLAGER;
     VILLAGER;
-    
+
     @Override
     @Override
     public String toString() {
     public String toString() {
         return I18n.translate("config.roughlyenoughitems.recipeScreenType." + name().toLowerCase(Locale.ROOT));
         return I18n.translate("config.roughlyenoughitems.recipeScreenType." + name().toLowerCase(Locale.ROOT));

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

@@ -13,7 +13,7 @@ public enum SearchFieldLocation {
     CENTER,
     CENTER,
     BOTTOM_SIDE,
     BOTTOM_SIDE,
     TOP_SIDE;
     TOP_SIDE;
-    
+
     @Override
     @Override
     public String toString() {
     public String toString() {
         return I18n.translate("config.roughlyenoughitems.searchFieldLocation.%s", name().toLowerCase(Locale.ROOT));
         return I18n.translate("config.roughlyenoughitems.searchFieldLocation.%s", name().toLowerCase(Locale.ROOT));

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

@@ -11,13 +11,13 @@ import net.minecraft.client.gui.DrawableHelper;
 import net.minecraft.text.Text;
 import net.minecraft.text.Text;
 
 
 public class CreditsEntryListWidget extends DynamicNewSmoothScrollingEntryListWidget<CreditsEntryListWidget.CreditsItem> {
 public class CreditsEntryListWidget extends DynamicNewSmoothScrollingEntryListWidget<CreditsEntryListWidget.CreditsItem> {
-    
+
     private boolean inFocus;
     private boolean inFocus;
-    
+
     public CreditsEntryListWidget(MinecraftClient client, int width, int height, int startY, int endY) {
     public CreditsEntryListWidget(MinecraftClient client, int width, int height, int startY, int endY) {
         super(client, width, height, startY, endY, DrawableHelper.BACKGROUND_LOCATION);
         super(client, width, height, startY, endY, DrawableHelper.BACKGROUND_LOCATION);
     }
     }
-    
+
     @Override
     @Override
     public boolean changeFocus(boolean boolean_1) {
     public boolean changeFocus(boolean boolean_1) {
         if (!this.inFocus && this.getItemCount() == 0) {
         if (!this.inFocus && this.getItemCount() == 0) {
@@ -29,58 +29,58 @@ public class CreditsEntryListWidget extends DynamicNewSmoothScrollingEntryListWi
             } else if (this.inFocus && this.getFocused() != null) {
             } else if (this.inFocus && this.getFocused() != null) {
                 this.moveSelection(0);
                 this.moveSelection(0);
             }
             }
-            
+
             return this.inFocus;
             return this.inFocus;
         }
         }
     }
     }
-    
+
     public void creditsClearEntries() {
     public void creditsClearEntries() {
         clearItems();
         clearItems();
     }
     }
-    
+
     private CreditsItem rei_getEntry(int int_1) {
     private CreditsItem rei_getEntry(int int_1) {
         return this.children().get(int_1);
         return this.children().get(int_1);
     }
     }
-    
+
     public void creditsAddEntry(CreditsItem entry) {
     public void creditsAddEntry(CreditsItem entry) {
         addItem(entry);
         addItem(entry);
     }
     }
-    
+
     @Override
     @Override
     public int getItemWidth() {
     public int getItemWidth() {
         return width - 80;
         return width - 80;
     }
     }
-    
+
     @Override
     @Override
     protected int getScrollbarPosition() {
     protected int getScrollbarPosition() {
         return width - 40;
         return width - 40;
     }
     }
-    
+
     public static class CreditsItem extends DynamicNewSmoothScrollingEntryListWidget.Entry<CreditsItem> {
     public static class CreditsItem extends DynamicNewSmoothScrollingEntryListWidget.Entry<CreditsItem> {
         private String text;
         private String text;
-        
+
         public CreditsItem(Text textComponent) {
         public CreditsItem(Text textComponent) {
             this(textComponent.asFormattedString());
             this(textComponent.asFormattedString());
         }
         }
-        
+
         public CreditsItem(String text) {
         public CreditsItem(String text) {
             this.text = text;
             this.text = text;
         }
         }
-        
+
         @Override
         @Override
         public void render(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) {
         public void render(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) {
             MinecraftClient.getInstance().textRenderer.drawWithShadow(text, x + 5, y + 5, -1);
             MinecraftClient.getInstance().textRenderer.drawWithShadow(text, x + 5, y + 5, -1);
         }
         }
-        
+
         @Override
         @Override
         public int getItemHeight() {
         public int getItemHeight() {
             return 12;
             return 12;
         }
         }
-        
+
         @Override
         @Override
         public boolean changeFocus(boolean boolean_1) {
         public boolean changeFocus(boolean boolean_1) {
             return false;
             return false;
         }
         }
     }
     }
-    
+
 }
 }

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

@@ -20,16 +20,16 @@ import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 public class CreditsScreen extends Screen {
 public class CreditsScreen extends Screen {
-    
+
     private Screen parent;
     private Screen parent;
     private AbstractPressableButtonWidget buttonDone;
     private AbstractPressableButtonWidget buttonDone;
     private CreditsEntryListWidget entryListWidget;
     private CreditsEntryListWidget entryListWidget;
-    
+
     public CreditsScreen(Screen parent) {
     public CreditsScreen(Screen parent) {
         super(new LiteralText(""));
         super(new LiteralText(""));
         this.parent = parent;
         this.parent = parent;
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (int_1 == 256 && this.shouldCloseOnEsc()) {
         if (int_1 == 256 && this.shouldCloseOnEsc()) {
@@ -40,7 +40,7 @@ public class CreditsScreen extends Screen {
         }
         }
         return super.keyPressed(int_1, int_2, int_3);
         return super.keyPressed(int_1, int_2, int_3);
     }
     }
-    
+
     @Override
     @Override
     protected void init() {
     protected void init() {
         children.add(entryListWidget = new CreditsEntryListWidget(minecraft, width, height, 32, height - 32));
         children.add(entryListWidget = new CreditsEntryListWidget(minecraft, width, height, 32, height - 32));
@@ -80,14 +80,14 @@ public class CreditsScreen extends Screen {
             }
             }
         });
         });
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
         if (entryListWidget.mouseScrolled(double_1, double_2, double_3))
         if (entryListWidget.mouseScrolled(double_1, double_2, double_3))
             return true;
             return true;
         return super.mouseScrolled(double_1, double_2, double_3);
         return super.mouseScrolled(double_1, double_2, double_3);
     }
     }
-    
+
     @Override
     @Override
     public void render(int int_1, int int_2, float float_1) {
     public void render(int int_1, int int_2, float float_1) {
         this.renderDirtBackground(0);
         this.renderDirtBackground(0);
@@ -96,5 +96,5 @@ public class CreditsScreen extends Screen {
         super.render(int_1, int_2, float_1);
         super.render(int_1, int_2, float_1);
         buttonDone.render(int_1, int_2, float_1);
         buttonDone.render(int_1, int_2, float_1);
     }
     }
-    
+
 }
 }

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

@@ -17,100 +17,100 @@ public abstract class RecipeEntry extends DrawableHelper implements EntryStack {
     public Optional<Identifier> getIdentifier() {
     public Optional<Identifier> getIdentifier() {
         return Optional.empty();
         return Optional.empty();
     }
     }
-    
+
     @Override
     @Override
     public Type getType() {
     public Type getType() {
         return Type.RENDER;
         return Type.RENDER;
     }
     }
-    
+
     @Override
     @Override
     public int getAmount() {
     public int getAmount() {
         return 0;
         return 0;
     }
     }
-    
+
     @Override
     @Override
     public void setAmount(int amount) {
     public void setAmount(int amount) {
-    
+
     }
     }
-    
+
     @Override
     @Override
     public boolean isEmpty() {
     public boolean isEmpty() {
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public EntryStack copy() {
     public EntryStack copy() {
         return this;
         return this;
     }
     }
-    
+
     @Override
     @Override
     public Object getObject() {
     public Object getObject() {
         return null;
         return null;
     }
     }
-    
+
     @Override
     @Override
     public boolean equals(EntryStack stack, boolean ignoreTags, boolean ignoreAmount) {
     public boolean equals(EntryStack stack, boolean ignoreTags, boolean ignoreAmount) {
         return stack == this;
         return stack == this;
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsIgnoreTagsAndAmount(EntryStack stack) {
     public boolean equalsIgnoreTagsAndAmount(EntryStack stack) {
         return stack == this;
         return stack == this;
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsIgnoreTags(EntryStack stack) {
     public boolean equalsIgnoreTags(EntryStack stack) {
         return stack == this;
         return stack == this;
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsIgnoreAmount(EntryStack stack) {
     public boolean equalsIgnoreAmount(EntryStack stack) {
         return stack == this;
         return stack == this;
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsAll(EntryStack stack) {
     public boolean equalsAll(EntryStack stack) {
         return stack == this;
         return stack == this;
     }
     }
-    
+
     @Override
     @Override
     public int getZ() {
     public int getZ() {
         return getBlitOffset();
         return getBlitOffset();
     }
     }
-    
+
     @Override
     @Override
     public void setZ(int z) {
     public void setZ(int z) {
         setBlitOffset(z);
         setBlitOffset(z);
     }
     }
-    
+
     @Override
     @Override
     public <T> EntryStack setting(Settings<T> settings, T value) {
     public <T> EntryStack setting(Settings<T> settings, T value) {
         return this;
         return this;
     }
     }
-    
+
     @Override
     @Override
     public <T> EntryStack removeSetting(Settings<T> settings) {
     public <T> EntryStack removeSetting(Settings<T> settings) {
         return this;
         return this;
     }
     }
-    
+
     @Override
     @Override
     public EntryStack clearSettings() {
     public EntryStack clearSettings() {
         return this;
         return this;
     }
     }
-    
+
     @Override
     @Override
     public <T> EntryStack addSetting(Settings<T> settings, T value) {
     public <T> EntryStack addSetting(Settings<T> settings, T value) {
         return this;
         return this;
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     @Override
     @Override
     public <T> ObjectHolder<T> getSetting(Settings<T> settings) {
     public <T> ObjectHolder<T> getSetting(Settings<T> settings) {
         return ObjectHolder.of(settings.getDefaultValue());
         return ObjectHolder.of(settings.getDefaultValue());
     }
     }
-    
+
     public abstract int getHeight();
     public abstract int getHeight();
-    
+
     public final int getWidth() {
     public final int getWidth() {
         return 100;
         return 100;
     }
     }

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

@@ -25,12 +25,12 @@ import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 public class SimpleRecipeEntry extends RecipeEntry {
 public class SimpleRecipeEntry extends RecipeEntry {
-    
+
     private static final Comparator<EntryStack> ENTRY_COMPARATOR = Comparator.comparingLong(EntryStack::hashCode);
     private static final Comparator<EntryStack> ENTRY_COMPARATOR = Comparator.comparingLong(EntryStack::hashCode);
     private static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     private static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     private List<EntryWidget> inputWidgets;
     private List<EntryWidget> inputWidgets;
     private EntryWidget outputWidget;
     private EntryWidget outputWidget;
-    
+
     protected SimpleRecipeEntry(List<List<EntryStack>> input, List<EntryStack> output) {
     protected SimpleRecipeEntry(List<List<EntryStack>> input, List<EntryStack> output) {
         List<Pair<List<EntryStack>, AtomicInteger>> newList = Lists.newArrayList();
         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)));
         List<Pair<List<EntryStack>, Integer>> a = CollectionUtils.map(input, stacks -> new Pair<>(stacks, stacks.stream().map(EntryStack::getAmount).max(Integer::compareTo).orElse(1)));
@@ -53,15 +53,15 @@ public class SimpleRecipeEntry extends RecipeEntry {
         }).collect(Collectors.toList());
         }).collect(Collectors.toList());
         this.outputWidget = EntryWidget.create(0, 0).entries(CollectionUtils.filter(output, stack -> !stack.isEmpty())).noBackground().noHighlight().noTooltips();
         this.outputWidget = EntryWidget.create(0, 0).entries(CollectionUtils.filter(output, stack -> !stack.isEmpty())).noBackground().noHighlight().noTooltips();
     }
     }
-    
+
     public static RecipeEntry create(Supplier<List<List<EntryStack>>> input, Supplier<List<EntryStack>> output) {
     public static RecipeEntry create(Supplier<List<List<EntryStack>>> input, Supplier<List<EntryStack>> output) {
         return create(input.get(), output.get());
         return create(input.get(), output.get());
     }
     }
-    
+
     public static RecipeEntry create(List<List<EntryStack>> input, List<EntryStack> output) {
     public static RecipeEntry create(List<List<EntryStack>> input, List<EntryStack> output) {
         return new SimpleRecipeEntry(input, output);
         return new SimpleRecipeEntry(input, output);
     }
     }
-    
+
     public static boolean equalsList(List<EntryStack> list_1, List<EntryStack> list_2) {
     public static boolean equalsList(List<EntryStack> list_1, List<EntryStack> list_2) {
         List<EntryStack> stacks_1 = list_1.stream().distinct().sorted(ENTRY_COMPARATOR).collect(Collectors.toList());
         List<EntryStack> stacks_1 = list_1.stream().distinct().sorted(ENTRY_COMPARATOR).collect(Collectors.toList());
         List<EntryStack> stacks_2 = list_2.stream().distinct().sorted(ENTRY_COMPARATOR).collect(Collectors.toList());
         List<EntryStack> stacks_2 = list_2.stream().distinct().sorted(ENTRY_COMPARATOR).collect(Collectors.toList());
@@ -74,7 +74,7 @@ public class SimpleRecipeEntry extends RecipeEntry {
                 return false;
                 return false;
         return true;
         return true;
     }
     }
-    
+
     @Override
     @Override
     public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
     public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
         int xx = bounds.x + 4, yy = bounds.y + 2;
         int xx = bounds.x + 4, yy = bounds.y + 2;
@@ -101,7 +101,7 @@ public class SimpleRecipeEntry extends RecipeEntry {
         outputWidget.getBounds().setLocation(xx, yy);
         outputWidget.getBounds().setLocation(xx, yy);
         outputWidget.render(mouseX, mouseY, delta);
         outputWidget.render(mouseX, mouseY, delta);
     }
     }
-    
+
     @Nullable
     @Nullable
     @Override
     @Override
     public QueuedTooltip getTooltip(int mouseX, int mouseY) {
     public QueuedTooltip getTooltip(int mouseX, int mouseY) {
@@ -113,18 +113,18 @@ public class SimpleRecipeEntry extends RecipeEntry {
             return outputWidget.getCurrentTooltip(mouseX, mouseY);
             return outputWidget.getCurrentTooltip(mouseX, mouseY);
         return null;
         return null;
     }
     }
-    
+
     @Override
     @Override
     public int getHeight() {
     public int getHeight() {
         return 4 + getItemsHeight() * 18;
         return 4 + getItemsHeight() * 18;
     }
     }
-    
+
     public int getItemsHeight() {
     public int getItemsHeight() {
         return MathHelper.ceil(((float) inputWidgets.size()) / (getItemsPerLine() - 2));
         return MathHelper.ceil(((float) inputWidgets.size()) / (getItemsPerLine() - 2));
     }
     }
-    
+
     public int getItemsPerLine() {
     public int getItemsPerLine() {
         return MathHelper.floor((getWidth() - 4f) / 18f);
         return MathHelper.floor((getWidth() - 4f) / 18f);
     }
     }
-    
+
 }
 }

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

@@ -14,21 +14,21 @@ import net.minecraft.util.Identifier;
 import javax.annotation.Nullable;
 import javax.annotation.Nullable;
 
 
 public class CopyRecipeIdentifierToast implements Toast {
 public class CopyRecipeIdentifierToast implements Toast {
-    
+
     protected static final Identifier TOASTS_TEX = new Identifier("roughlyenoughitems", "textures/gui/toasts.png");
     protected static final Identifier TOASTS_TEX = new Identifier("roughlyenoughitems", "textures/gui/toasts.png");
     private String title;
     private String title;
     private String subtitle;
     private String subtitle;
     private long startTime;
     private long startTime;
-    
+
     public CopyRecipeIdentifierToast(String title, @Nullable String subtitleNullable) {
     public CopyRecipeIdentifierToast(String title, @Nullable String subtitleNullable) {
         this.title = title;
         this.title = title;
         this.subtitle = subtitleNullable;
         this.subtitle = subtitleNullable;
     }
     }
-    
+
     public static void addToast(String title, @Nullable String subtitleNullable) {
     public static void addToast(String title, @Nullable String subtitleNullable) {
         MinecraftClient.getInstance().getToastManager().add(new CopyRecipeIdentifierToast(title, subtitleNullable));
         MinecraftClient.getInstance().getToastManager().add(new CopyRecipeIdentifierToast(title, subtitleNullable));
     }
     }
-    
+
     @Override
     @Override
     public Visibility draw(ToastManager toastManager, long var2) {
     public Visibility draw(ToastManager toastManager, long var2) {
         toastManager.getGame().getTextureManager().bindTexture(TOASTS_TEX);
         toastManager.getGame().getTextureManager().bindTexture(TOASTS_TEX);
@@ -40,17 +40,17 @@ public class CopyRecipeIdentifierToast implements Toast {
             toastManager.getGame().textRenderer.draw(this.title, 18.0F, 7.0F, 11141120);
             toastManager.getGame().textRenderer.draw(this.title, 18.0F, 7.0F, 11141120);
             toastManager.getGame().textRenderer.draw(this.subtitle, 18.0F, 18.0F, -16777216);
             toastManager.getGame().textRenderer.draw(this.subtitle, 18.0F, 18.0F, -16777216);
         }
         }
-        
+
         return var2 - this.startTime < 5000L ? Visibility.SHOW : Visibility.HIDE;
         return var2 - this.startTime < 5000L ? Visibility.SHOW : Visibility.HIDE;
     }
     }
-    
+
     @Override
     @Override
     public Object getType() {
     public Object getType() {
         return Type.THIS_IS_SURE_A_TYPE;
         return Type.THIS_IS_SURE_A_TYPE;
     }
     }
-    
+
     public enum Type {
     public enum Type {
         THIS_IS_SURE_A_TYPE
         THIS_IS_SURE_A_TYPE
     }
     }
-    
+
 }
 }

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

@@ -28,7 +28,7 @@ import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 public class AutoCraftingButtonWidget extends ButtonWidget {
 public class AutoCraftingButtonWidget extends ButtonWidget {
-    
+
     private static final Lazy<Boolean> IS_YOG = new Lazy(() -> {
     private static final Lazy<Boolean> IS_YOG = new Lazy(() -> {
         try {
         try {
             if (MinecraftClient.getInstance().getSession().getProfile().getId().equals(UUID.fromString("f9546389-9415-4358-9c29-2c26b25bff5b")))
             if (MinecraftClient.getInstance().getSession().getProfile().getId().equals(UUID.fromString("f9546389-9415-4358-9c29-2c26b25bff5b")))
@@ -47,7 +47,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
     private boolean visible = false;
     private boolean visible = false;
     private RecipeCategory<?> category;
     private RecipeCategory<?> category;
     private Rectangle displayBounds;
     private Rectangle displayBounds;
-    
+
     public AutoCraftingButtonWidget(Rectangle displayBounds, Rectangle rectangle, String text, Supplier<RecipeDisplay> displaySupplier, List<Widget> setupDisplay, RecipeCategory<?> recipeCategory) {
     public AutoCraftingButtonWidget(Rectangle displayBounds, Rectangle rectangle, String text, Supplier<RecipeDisplay> displaySupplier, List<Widget> setupDisplay, RecipeCategory<?> recipeCategory) {
         super(rectangle, text);
         super(rectangle, text);
         this.displayBounds = displayBounds;
         this.displayBounds = displayBounds;
@@ -58,7 +58,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
         this.setupDisplay = setupDisplay;
         this.setupDisplay = setupDisplay;
         this.category = recipeCategory;
         this.category = recipeCategory;
     }
     }
-    
+
     @Override
     @Override
     public void onPressed() {
     public void onPressed() {
         AutoTransferHandler.Context context = AutoTransferHandler.Context.create(true, containerScreen, displaySupplier.get());
         AutoTransferHandler.Context context = AutoTransferHandler.Context.create(true, containerScreen, displaySupplier.get());
@@ -73,7 +73,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
         minecraft.openScreen(containerScreen);
         minecraft.openScreen(containerScreen);
         ScreenHelper.getLastOverlay().init();
         ScreenHelper.getLastOverlay().init();
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
         this.enabled = false;
         this.enabled = false;
@@ -127,29 +127,29 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
         }
         }
         int x = getBounds().x, y = getBounds().y, width = getBounds().width, height = getBounds().height;
         int x = getBounds().x, y = getBounds().y, width = getBounds().width, height = getBounds().height;
         renderBackground(x, y, width, height, this.getTextureId(isHovered(mouseX, mouseY)));
         renderBackground(x, y, width, height, this.getTextureId(isHovered(mouseX, mouseY)));
-        
+
         int colour = 14737632;
         int colour = 14737632;
         if (!this.visible) {
         if (!this.visible) {
             colour = 10526880;
             colour = 10526880;
         } else if (enabled && isHovered(mouseX, mouseY)) {
         } else if (enabled && isHovered(mouseX, mouseY)) {
             colour = 16777120;
             colour = 16777120;
         }
         }
-        
+
         fillGradient(x, y, x + width, y + height, color, color);
         fillGradient(x, y, x + width, y + height, color, color);
         this.drawCenteredString(font, getText(), x + width / 2, y + (height - 8) / 2, colour);
         this.drawCenteredString(font, getText(), x + width / 2, y + (height - 8) / 2, colour);
-        
+
         if (getTooltips().isPresent())
         if (getTooltips().isPresent())
             if (!focused && containsMouse(mouseX, mouseY))
             if (!focused && containsMouse(mouseX, mouseY))
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n")));
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n")));
             else if (focused)
             else if (focused)
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(new Point(x + width / 2, y + height / 2), getTooltips().get().split("\n")));
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(new Point(x + width / 2, y + height / 2), getTooltips().get().split("\n")));
     }
     }
-    
+
     @Override
     @Override
     protected int getTextureId(boolean boolean_1) {
     protected int getTextureId(boolean boolean_1) {
         return !visible ? 0 : boolean_1 && enabled ? (ConfigObject.getInstance().isLighterButtonHover() ? 4 : 3) : 1;
         return !visible ? 0 : boolean_1 && enabled ? (ConfigObject.getInstance().isLighterButtonHover() ? 4 : 3) : 1;
     }
     }
-    
+
     @Override
     @Override
     public Optional<String> getTooltips() {
     public Optional<String> getTooltips() {
         String str = "";
         String str = "";
@@ -168,7 +168,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
         }
         }
         return Optional.of(str);
         return Optional.of(str);
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (displaySupplier.get().getRecipeLocation().isPresent() && ClientHelper.getInstance().getCopyRecipeIdentifierKeyBinding().matchesKey(int_1, int_2) && containsMouse(PointHelper.fromMouse())) {
         if (displaySupplier.get().getRecipeLocation().isPresent() && ClientHelper.getInstance().getCopyRecipeIdentifierKeyBinding().matchesKey(int_1, int_2) && containsMouse(PointHelper.fromMouse())) {

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

@@ -23,36 +23,36 @@ import java.util.Objects;
 import java.util.Optional;
 import java.util.Optional;
 
 
 public abstract class ButtonWidget extends WidgetWithBounds {
 public abstract class ButtonWidget extends WidgetWithBounds {
-    
+
     protected static final Identifier BUTTON_LOCATION = new Identifier("roughlyenoughitems", "textures/gui/button.png");
     protected static final Identifier BUTTON_LOCATION = new Identifier("roughlyenoughitems", "textures/gui/button.png");
     protected static final Identifier BUTTON_LOCATION_DARK = new Identifier("roughlyenoughitems", "textures/gui/button_dark.png");
     protected static final Identifier BUTTON_LOCATION_DARK = new Identifier("roughlyenoughitems", "textures/gui/button_dark.png");
     public boolean enabled;
     public boolean enabled;
     public boolean focused;
     public boolean focused;
     private String text;
     private String text;
     private Rectangle bounds;
     private Rectangle bounds;
-    
+
     public ButtonWidget(Rectangle rectangle, Text text) {
     public ButtonWidget(Rectangle rectangle, Text text) {
         this(rectangle, Objects.requireNonNull(text).asFormattedString());
         this(rectangle, Objects.requireNonNull(text).asFormattedString());
     }
     }
-    
+
     public ButtonWidget(Rectangle rectangle, String text) {
     public ButtonWidget(Rectangle rectangle, String text) {
         this.bounds = Objects.requireNonNull(rectangle);
         this.bounds = Objects.requireNonNull(rectangle);
         this.enabled = true;
         this.enabled = true;
         this.text = Objects.requireNonNull(text);
         this.text = Objects.requireNonNull(text);
     }
     }
-    
+
     public Rectangle getBounds() {
     public Rectangle getBounds() {
         return bounds;
         return bounds;
     }
     }
-    
+
     public String getText() {
     public String getText() {
         return text;
         return text;
     }
     }
-    
+
     public void setText(String text) {
     public void setText(String text) {
         this.text = text;
         this.text = text;
     }
     }
-    
+
     protected int getTextureId(boolean boolean_1) {
     protected int getTextureId(boolean boolean_1) {
         int int_1 = 1;
         int int_1 = 1;
         if (!this.enabled) {
         if (!this.enabled) {
@@ -60,10 +60,10 @@ public abstract class ButtonWidget extends WidgetWithBounds {
         } else if (boolean_1) {
         } 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 = 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
         }
         }
-        
+
         return int_1;
         return int_1;
     }
     }
-    
+
     protected void renderBackground(int x, int y, int width, int height, int textureOffset) {
     protected void renderBackground(int x, int y, int width, int height, int textureOffset) {
         minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? BUTTON_LOCATION_DARK : BUTTON_LOCATION);
         minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? BUTTON_LOCATION_DARK : BUTTON_LOCATION);
         RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
         RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -75,7 +75,7 @@ public abstract class ButtonWidget extends WidgetWithBounds {
         blit(x + width - 4, y, getBlitOffset(), 252, textureOffset * 80, 4, 4, 512, 256);
         blit(x + width - 4, y, getBlitOffset(), 252, textureOffset * 80, 4, 4, 512, 256);
         blit(x, y + height - 4, getBlitOffset(), 0, textureOffset * 80 + 76, 4, 4, 512, 256);
         blit(x, y + height - 4, getBlitOffset(), 0, textureOffset * 80 + 76, 4, 4, 512, 256);
         blit(x + width - 4, y + height - 4, getBlitOffset(), 252, textureOffset * 80 + 76, 4, 4, 512, 256);
         blit(x + width - 4, y + height - 4, getBlitOffset(), 252, textureOffset * 80 + 76, 4, 4, 512, 256);
-        
+
         //Sides
         //Sides
         blit(x + 4, y, getBlitOffset(), 4, textureOffset * 80, MathHelper.ceil((width - 8) / 2f), 4, 512, 256);
         blit(x + 4, y, getBlitOffset(), 4, textureOffset * 80, MathHelper.ceil((width - 8) / 2f), 4, 512, 256);
         blit(x + 4, y + height - 4, getBlitOffset(), 4, textureOffset * 80 + 76, MathHelper.ceil((width - 8) / 2f), 4, 512, 256);
         blit(x + 4, y + height - 4, getBlitOffset(), 4, textureOffset * 80 + 76, MathHelper.ceil((width - 8) / 2f), 4, 512, 256);
@@ -86,32 +86,32 @@ public abstract class ButtonWidget extends WidgetWithBounds {
             blit(x + MathHelper.ceil(width / 2f), i, getBlitOffset(), 256 - MathHelper.floor(width / 2f), 4 + textureOffset * 80, MathHelper.floor(width / 2f), MathHelper.clamp(y + height - 4 - i, 0, 76), 512, 256);
             blit(x + MathHelper.ceil(width / 2f), i, getBlitOffset(), 256 - MathHelper.floor(width / 2f), 4 + textureOffset * 80, MathHelper.floor(width / 2f), MathHelper.clamp(y + height - 4 - i, 0, 76), 512, 256);
         }
         }
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
         int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height;
         int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height;
         renderBackground(x, y, width, height, this.getTextureId(isHovered(mouseX, mouseY)));
         renderBackground(x, y, width, height, this.getTextureId(isHovered(mouseX, mouseY)));
-        
+
         int color = 14737632;
         int color = 14737632;
         if (!this.enabled) {
         if (!this.enabled) {
             color = 10526880;
             color = 10526880;
         } else if (isHovered(mouseX, mouseY)) {
         } else if (isHovered(mouseX, mouseY)) {
             color = 16777120;
             color = 16777120;
         }
         }
-        
+
         this.drawCenteredString(font, getText(), x + width / 2, y + (height - 8) / 2, color);
         this.drawCenteredString(font, getText(), x + width / 2, y + (height - 8) / 2, color);
-        
+
         if (getTooltips().isPresent())
         if (getTooltips().isPresent())
             if (!focused && containsMouse(mouseX, mouseY))
             if (!focused && containsMouse(mouseX, mouseY))
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n")));
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n")));
             else if (focused)
             else if (focused)
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(new Point(x + width / 2, y + height / 2), getTooltips().get().split("\n")));
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(new Point(x + width / 2, y + height / 2), getTooltips().get().split("\n")));
     }
     }
-    
+
     public boolean isHovered(int mouseX, int mouseY) {
     public boolean isHovered(int mouseX, int mouseY) {
         return isMouseOver(mouseX, mouseY) || focused;
         return isMouseOver(mouseX, mouseY) || focused;
     }
     }
-    
+
     @Override
     @Override
     public boolean changeFocus(boolean boolean_1) {
     public boolean changeFocus(boolean boolean_1) {
         if (!enabled)
         if (!enabled)
@@ -119,12 +119,12 @@ public abstract class ButtonWidget extends WidgetWithBounds {
         this.focused = !this.focused;
         this.focused = !this.focused;
         return true;
         return true;
     }
     }
-    
+
     @Override
     @Override
     public List<? extends Element> children() {
     public List<? extends Element> children() {
         return Collections.emptyList();
         return Collections.emptyList();
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseClicked(double mouseX, double mouseY, int button) {
     public boolean mouseClicked(double mouseX, double mouseY, int button) {
         if (isMouseOver(mouseX, mouseY) && enabled && button == 0) {
         if (isMouseOver(mouseX, mouseY) && enabled && button == 0) {
@@ -134,7 +134,7 @@ public abstract class ButtonWidget extends WidgetWithBounds {
         }
         }
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (this.enabled && focused) {
         if (this.enabled && focused) {
@@ -148,11 +148,11 @@ public abstract class ButtonWidget extends WidgetWithBounds {
         }
         }
         return false;
         return false;
     }
     }
-    
+
     public abstract void onPressed();
     public abstract void onPressed();
-    
+
     public Optional<String> getTooltips() {
     public Optional<String> getTooltips() {
         return Optional.empty();
         return Optional.empty();
     }
     }
-    
+
 }
 }

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

@@ -8,19 +8,19 @@ package me.shedaniel.rei.gui.widget;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.math.api.Rectangle;
 
 
 public class CategoryBaseWidget extends RecipeBaseWidget {
 public class CategoryBaseWidget extends RecipeBaseWidget {
-    
+
     public CategoryBaseWidget(Rectangle bounds) {
     public CategoryBaseWidget(Rectangle bounds) {
         super(bounds);
         super(bounds);
     }
     }
-    
+
     @Override
     @Override
     protected int getYTextureOffset() {
     protected int getYTextureOffset() {
         return 66;
         return 66;
     }
     }
-    
+
     @Override
     @Override
     protected boolean isRendering() {
     protected boolean isRendering() {
         return true;
         return true;
     }
     }
-    
+
 }
 }

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

@@ -11,46 +11,46 @@ import me.shedaniel.rei.impl.ScreenHelper;
 import java.util.Optional;
 import java.util.Optional;
 
 
 public abstract class ClickableLabelWidget extends LabelWidget {
 public abstract class ClickableLabelWidget extends LabelWidget {
-    
+
     public boolean focused;
     public boolean focused;
     private boolean clickable = true;
     private boolean clickable = true;
     private int hoveredColor;
     private int hoveredColor;
-    
+
     @Deprecated
     @Deprecated
     public ClickableLabelWidget(int x, int y, String text, boolean clickable) {
     public ClickableLabelWidget(int x, int y, String text, boolean clickable) {
         this(new Point(x, y), text, clickable);
         this(new Point(x, y), text, clickable);
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public ClickableLabelWidget(int x, int y, String text) {
     public ClickableLabelWidget(int x, int y, String text) {
         this(new Point(x, y), text, true);
         this(new Point(x, y), text, true);
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public ClickableLabelWidget(Point point, String text, boolean clickable) {
     public ClickableLabelWidget(Point point, String text, boolean clickable) {
         this(point, text);
         this(point, text);
         clickable(clickable);
         clickable(clickable);
     }
     }
-    
+
     public ClickableLabelWidget(Point point, String text) {
     public ClickableLabelWidget(Point point, String text) {
         super(point, text);
         super(point, text);
         this.hoveredColor = ScreenHelper.isDarkModeEnabled() ? -1 : 0xFF66FFCC;
         this.hoveredColor = ScreenHelper.isDarkModeEnabled() ? -1 : 0xFF66FFCC;
     }
     }
-    
+
     public LabelWidget hoveredColor(int hoveredColor) {
     public LabelWidget hoveredColor(int hoveredColor) {
         this.hoveredColor = hoveredColor;
         this.hoveredColor = hoveredColor;
         return this;
         return this;
     }
     }
-    
+
     public LabelWidget clickable(boolean clickable) {
     public LabelWidget clickable(boolean clickable) {
         this.clickable = clickable;
         this.clickable = clickable;
         return this;
         return this;
     }
     }
-    
+
     public boolean isClickable() {
     public boolean isClickable() {
         return clickable;
         return clickable;
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
         int color = getDefaultColor();
         int color = getDefaultColor();
@@ -75,11 +75,11 @@ public abstract class ClickableLabelWidget extends LabelWidget {
             else if (focused)
             else if (focused)
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(pos, getTooltips().get().split("\n")));
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(pos, getTooltips().get().split("\n")));
     }
     }
-    
+
     public int getHoveredColor() {
     public int getHoveredColor() {
         return hoveredColor;
         return hoveredColor;
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseClicked(double mouseX, double mouseY, int button) {
     public boolean mouseClicked(double mouseX, double mouseY, int button) {
         if (button == 0 && isClickable() && containsMouse(mouseX, mouseY)) {
         if (button == 0 && isClickable() && containsMouse(mouseX, mouseY)) {
@@ -88,11 +88,11 @@ public abstract class ClickableLabelWidget extends LabelWidget {
         }
         }
         return false;
         return false;
     }
     }
-    
+
     public Optional<String> getTooltips() {
     public Optional<String> getTooltips() {
         return Optional.empty();
         return Optional.empty();
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (!isClickable() || !focused)
         if (!isClickable() || !focused)
@@ -102,7 +102,7 @@ public abstract class ClickableLabelWidget extends LabelWidget {
         this.onLabelClicked();
         this.onLabelClicked();
         return true;
         return true;
     }
     }
-    
+
     @Override
     @Override
     public boolean changeFocus(boolean boolean_1) {
     public boolean changeFocus(boolean boolean_1) {
         if (!isClickable())
         if (!isClickable())
@@ -110,11 +110,11 @@ public abstract class ClickableLabelWidget extends LabelWidget {
         this.focused = !this.focused;
         this.focused = !this.focused;
         return true;
         return true;
     }
     }
-    
+
     public boolean isHovered(int mouseX, int mouseY) {
     public boolean isHovered(int mouseX, int mouseY) {
         return isClickable() && (containsMouse(mouseX, mouseY) || focused);
         return isClickable() && (containsMouse(mouseX, mouseY) || focused);
     }
     }
-    
+
     public abstract void onLabelClicked();
     public abstract void onLabelClicked();
-    
+
 }
 }

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

@@ -18,22 +18,22 @@ import net.minecraft.util.Identifier;
 import java.util.Optional;
 import java.util.Optional;
 
 
 public abstract class CraftableToggleButtonWidget extends ButtonWidget {
 public abstract class CraftableToggleButtonWidget extends ButtonWidget {
-    
+
     public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     private ItemRenderer itemRenderer;
     private ItemRenderer itemRenderer;
-    
+
     public CraftableToggleButtonWidget(Rectangle rectangle) {
     public CraftableToggleButtonWidget(Rectangle rectangle) {
         super(rectangle, "");
         super(rectangle, "");
         this.itemRenderer = minecraft.getItemRenderer();
         this.itemRenderer = minecraft.getItemRenderer();
     }
     }
-    
+
     public CraftableToggleButtonWidget(int x, int y, int width, int height) {
     public CraftableToggleButtonWidget(int x, int y, int width, int height) {
         this(new Rectangle(x, y, width, height));
         this(new Rectangle(x, y, width, height));
     }
     }
-    
+
     public void lateRender(int mouseX, int mouseY, float delta) {
     public void lateRender(int mouseX, int mouseY, float delta) {
         super.render(mouseX, mouseY, delta);
         super.render(mouseX, mouseY, delta);
-        
+
         this.itemRenderer.zOffset = getBlitOffset();
         this.itemRenderer.zOffset = getBlitOffset();
         Rectangle bounds = getBounds();
         Rectangle bounds = getBounds();
         this.itemRenderer.renderGuiItem(new ItemStack(Blocks.CRAFTING_TABLE), bounds.x + 2, bounds.y + 2);
         this.itemRenderer.renderGuiItem(new ItemStack(Blocks.CRAFTING_TABLE), bounds.x + 2, bounds.y + 2);
@@ -45,16 +45,16 @@ public abstract class CraftableToggleButtonWidget extends ButtonWidget {
         this.fillGradient(bounds.x + 1, bounds.y + 1, bounds.getMaxX() - 1, bounds.getMaxY() - 1, color, color);
         this.fillGradient(bounds.x + 1, bounds.y + 1, bounds.getMaxX() - 1, bounds.getMaxY() - 1, color, color);
         setBlitOffset(0);
         setBlitOffset(0);
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
     }
     }
-    
+
     @Override
     @Override
     public boolean changeFocus(boolean boolean_1) {
     public boolean changeFocus(boolean boolean_1) {
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public Optional<String> getTooltips() {
     public Optional<String> getTooltips() {
         return Optional.ofNullable(I18n.translate(ConfigManager.getInstance().isCraftableOnlyEnabled() ? "text.rei.showing_craftable" : "text.rei.showing_all"));
         return Optional.ofNullable(I18n.translate(ConfigManager.getInstance().isCraftableOnlyEnabled() ? "text.rei.showing_craftable" : "text.rei.showing_all"));

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

@@ -13,31 +13,31 @@ import net.minecraft.client.gui.Element;
 import net.minecraft.client.util.Window;
 import net.minecraft.client.util.Window;
 
 
 public abstract class DraggableWidget extends WidgetWithBounds {
 public abstract class DraggableWidget extends WidgetWithBounds {
-    
+
     public boolean dragged = false;
     public boolean dragged = false;
     private Point midPoint, startPoint;
     private Point midPoint, startPoint;
     private int relateX, relateY;
     private int relateX, relateY;
-    
+
     public DraggableWidget(Point startingPoint) {
     public DraggableWidget(Point startingPoint) {
         initWidgets(midPoint = startingPoint);
         initWidgets(midPoint = startingPoint);
     }
     }
-    
+
     public DraggableWidget() {
     public DraggableWidget() {
         this(new Point(MinecraftClient.getInstance().getWindow().getScaledWidth() / 2, MinecraftClient.getInstance().getWindow().getScaledHeight() / 2));
         this(new Point(MinecraftClient.getInstance().getWindow().getScaledWidth() / 2, MinecraftClient.getInstance().getWindow().getScaledHeight() / 2));
     }
     }
-    
+
     protected abstract void initWidgets(Point midPoint);
     protected abstract void initWidgets(Point midPoint);
-    
+
     public abstract void updateWidgets(Point midPoint);
     public abstract void updateWidgets(Point midPoint);
-    
+
     public abstract Rectangle getGrabBounds();
     public abstract Rectangle getGrabBounds();
-    
+
     public abstract Rectangle getDragBounds();
     public abstract Rectangle getDragBounds();
-    
+
     public final Point getMidPoint() {
     public final Point getMidPoint() {
         return midPoint;
         return midPoint;
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseDragged(double double_1, double double_2, int int_1, double double_3, double double_4) {
     public boolean mouseDragged(double double_1, double double_2, int int_1, double double_3, double double_4) {
         Point mouse = PointHelper.fromMouse();
         Point mouse = PointHelper.fromMouse();
@@ -61,9 +61,9 @@ public abstract class DraggableWidget extends WidgetWithBounds {
                 return true;
                 return true;
         return false;
         return false;
     }
     }
-    
+
     public abstract Point processMidPoint(Point midPoint, Point mouse, Point startPoint, Window window, int relateX, int relateY);
     public abstract Point processMidPoint(Point midPoint, Point mouse, Point startPoint, Window window, int relateX, int relateY);
-    
+
     @Override
     @Override
     public boolean mouseReleased(double double_1, double double_2, int int_1) {
     public boolean mouseReleased(double double_1, double double_2, int int_1) {
         if (int_1 == 0)
         if (int_1 == 0)
@@ -77,8 +77,8 @@ public abstract class DraggableWidget extends WidgetWithBounds {
                 return true;
                 return true;
         return false;
         return false;
     }
     }
-    
+
     public void onMouseReleaseMidPoint(Point midPoint) {
     public void onMouseReleaseMidPoint(Point midPoint) {
     }
     }
-    
+
 }
 }

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

@@ -45,7 +45,7 @@ import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 public class EntryListWidget extends WidgetWithBounds {
 public class EntryListWidget extends WidgetWithBounds {
-    
+
     static final Supplier<Boolean> RENDER_ENCHANTMENT_GLINT = ConfigObject.getInstance()::doesRenderEntryEnchantmentGlint;
     static final Supplier<Boolean> RENDER_ENCHANTMENT_GLINT = ConfigObject.getInstance()::doesRenderEntryEnchantmentGlint;
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     static final Comparator<? super EntryStack> ENTRY_NAME_COMPARER = Comparator.comparing(SearchArgument::tryGetEntryStackName);
     static final Comparator<? super EntryStack> ENTRY_NAME_COMPARER = Comparator.comparing(SearchArgument::tryGetEntryStackName);
@@ -74,18 +74,18 @@ public class EntryListWidget extends WidgetWithBounds {
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     private List<SearchArgument.SearchArguments> lastSearchArguments = Collections.emptyList();
     private List<SearchArgument.SearchArguments> lastSearchArguments = Collections.emptyList();
     private boolean draggingScrollBar = false;
     private boolean draggingScrollBar = false;
-    
+
     @SuppressWarnings("rawtypes")
     @SuppressWarnings("rawtypes")
     static boolean notSteppingOnExclusionZones(int left, int top, Rectangle listArea) {
     static boolean notSteppingOnExclusionZones(int left, int top, Rectangle listArea) {
         MinecraftClient instance = MinecraftClient.getInstance();
         MinecraftClient instance = MinecraftClient.getInstance();
-        for(DisplayHelper.DisplayBoundsHandler sortedBoundsHandler : DisplayHelper.getInstance().getSortedBoundsHandlers(instance.currentScreen.getClass())) {
+        for (DisplayHelper.DisplayBoundsHandler sortedBoundsHandler : DisplayHelper.getInstance().getSortedBoundsHandlers(instance.currentScreen.getClass())) {
             ActionResult fit = sortedBoundsHandler.canItemSlotWidgetFit(left, top, instance.currentScreen, listArea);
             ActionResult fit = sortedBoundsHandler.canItemSlotWidgetFit(left, top, instance.currentScreen, listArea);
             if (fit != ActionResult.PASS)
             if (fit != ActionResult.PASS)
                 return fit == ActionResult.SUCCESS;
                 return fit == ActionResult.SUCCESS;
         }
         }
         return true;
         return true;
     }
     }
-    
+
     private static Rectangle updateInnerBounds(Rectangle bounds) {
     private static Rectangle updateInnerBounds(Rectangle bounds) {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled()) {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled()) {
             int width = Math.max(MathHelper.floor((bounds.width - 2 - 6) / 18f), 1);
             int width = Math.max(MathHelper.floor((bounds.width - 2 - 6) / 18f), 1);
@@ -97,7 +97,7 @@ public class EntryListWidget extends WidgetWithBounds {
         int height = Math.max(MathHelper.floor((bounds.height - 2) / 18f), 1);
         int height = Math.max(MathHelper.floor((bounds.height - 2) / 18f), 1);
         return new Rectangle(bounds.getCenterX() - width * 9, bounds.getCenterY() - height * 9, width * 18, height * 18);
         return new Rectangle(bounds.getCenterX() - width * 9, bounds.getCenterY() - height * 9, width * 18, height * 18);
     }
     }
-    
+
     protected final int getSlotsHeightNumberForFavorites() {
     protected final int getSlotsHeightNumberForFavorites() {
         if (favorites.isEmpty())
         if (favorites.isEmpty())
             return 0;
             return 0;
@@ -109,49 +109,49 @@ public class EntryListWidget extends WidgetWithBounds {
             height--;
             height--;
         return height + pagesToFit + 1;
         return height + pagesToFit + 1;
     }
     }
-    
+
     protected final int getScrollNumberForFavorites() {
     protected final int getScrollNumberForFavorites() {
         if (favorites.isEmpty())
         if (favorites.isEmpty())
             return 0;
             return 0;
         return (innerBounds.width / 18) * getSlotsHeightNumberForFavorites();
         return (innerBounds.width / 18) * getSlotsHeightNumberForFavorites();
     }
     }
-    
+
     protected final int getMaxScrollPosition() {
     protected final int getMaxScrollPosition() {
         if (favorites.isEmpty())
         if (favorites.isEmpty())
             return MathHelper.ceil((allStacks.size() + blockedCount) / (innerBounds.width / 18f)) * 18;
             return MathHelper.ceil((allStacks.size() + blockedCount) / (innerBounds.width / 18f)) * 18;
         return MathHelper.ceil((allStacks.size() + blockedCount + getScrollNumberForFavorites()) / (innerBounds.width / 18f)) * 18 - 12;
         return MathHelper.ceil((allStacks.size() + blockedCount + getScrollNumberForFavorites()) / (innerBounds.width / 18f)) * 18 - 12;
     }
     }
-    
+
     protected final int getMaxScroll() {
     protected final int getMaxScroll() {
         return Math.max(0, this.getMaxScrollPosition() - innerBounds.height);
         return Math.max(0, this.getMaxScrollPosition() - innerBounds.height);
     }
     }
-    
+
     protected final double clamp(double v) {
     protected final double clamp(double v) {
         return this.clamp(v, 200.0D);
         return this.clamp(v, 200.0D);
     }
     }
-    
+
     protected final double clamp(double v, double clampExtension) {
     protected final double clamp(double v, double clampExtension) {
         return MathHelper.clamp(v, -clampExtension, (double) this.getMaxScroll() + clampExtension);
         return MathHelper.clamp(v, -clampExtension, (double) this.getMaxScroll() + clampExtension);
     }
     }
-    
+
     protected final void offset(double value, boolean animated) {
     protected final void offset(double value, boolean animated) {
         scrollTo(target + value, animated);
         scrollTo(target + value, animated);
     }
     }
-    
+
     protected final void scrollTo(double value, boolean animated) {
     protected final void scrollTo(double value, boolean animated) {
         scrollTo(value, animated, ClothConfigInitializer.getScrollDuration());
         scrollTo(value, animated, ClothConfigInitializer.getScrollDuration());
     }
     }
-    
+
     protected final void scrollTo(double value, boolean animated, long duration) {
     protected final void scrollTo(double value, boolean animated, long duration) {
         target = clamp(value);
         target = clamp(value);
-        
+
         if (animated) {
         if (animated) {
             start = System.currentTimeMillis();
             start = System.currentTimeMillis();
             this.duration = duration;
             this.duration = duration;
         } else
         } else
             scroll = target;
             scroll = target;
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled() && bounds.contains(double_1, double_2)) {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled() && bounds.contains(double_1, double_2)) {
@@ -160,38 +160,38 @@ public class EntryListWidget extends WidgetWithBounds {
         }
         }
         return super.mouseScrolled(double_1, double_2, double_3);
         return super.mouseScrolled(double_1, double_2, double_3);
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getBounds() {
     public Rectangle getBounds() {
         return bounds;
         return bounds;
     }
     }
-    
+
     public int getPage() {
     public int getPage() {
         return page;
         return page;
     }
     }
-    
+
     public void setPage(int page) {
     public void setPage(int page) {
         this.page = page;
         this.page = page;
     }
     }
-    
+
     public void previousPage() {
     public void previousPage() {
         this.page--;
         this.page--;
     }
     }
-    
+
     public void nextPage() {
     public void nextPage() {
         this.page++;
         this.page++;
     }
     }
-    
+
     public int getTotalPages() {
     public int getTotalPages() {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled())
         if (ConfigObject.getInstance().isEntryListWidgetScrolled())
             return 1;
             return 1;
         return MathHelper.ceil((allStacks.size() + getScrollNumberForFavorites()) / (float) entries.size());
         return MathHelper.ceil((allStacks.size() + getScrollNumberForFavorites()) / (float) entries.size());
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled()) {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled()) {
-            for(EntryListEntry entry : entries)
+            for (EntryListEntry entry : entries)
                 entry.clearStacks();
                 entry.clearStacks();
             ScissorsHandler.INSTANCE.scissor(bounds);
             ScissorsHandler.INSTANCE.scissor(bounds);
             int sizeForFavorites = getSlotsHeightNumberForFavorites();
             int sizeForFavorites = getSlotsHeightNumberForFavorites();
@@ -205,7 +205,7 @@ public class EntryListWidget extends WidgetWithBounds {
                 if (sizeForFavorites > 0) {
                 if (sizeForFavorites > 0) {
                     drawString(font, I18n.translate("text.rei.favorites"), innerBounds.x + 2, (int) (innerBounds.y + 8 - scroll), -1);
                     drawString(font, I18n.translate("text.rei.favorites"), innerBounds.x + 2, (int) (innerBounds.y + 8 - scroll), -1);
                     nextIndex += innerBounds.width / 18;
                     nextIndex += innerBounds.width / 18;
-                    for(int i1 = 0; i1 < favorites.size(); i1++) {
+                    for (int i1 = 0; i1 < favorites.size(); i1++) {
                         EntryStack stack = favorites.get(i1);
                         EntryStack stack = favorites.get(i1);
                         back1:
                         back1:
                         while (true) {
                         while (true) {
@@ -232,7 +232,7 @@ public class EntryListWidget extends WidgetWithBounds {
                 }
                 }
                 int offset = sizeForFavorites > 0 ? -12 : 0;
                 int offset = sizeForFavorites > 0 ? -12 : 0;
                 back:
                 back:
-                for(; i < allStacks.size(); i++) {
+                for (; i < allStacks.size(); i++) {
                     EntryStack stack = allStacks.get(i);
                     EntryStack stack = allStacks.get(i);
                     while (true) {
                     while (true) {
                         EntryListEntry entry = entries.get(nextIndex);
                         EntryListEntry entry = entries.get(nextIndex);
@@ -269,7 +269,7 @@ public class EntryListWidget extends WidgetWithBounds {
                 if (sizeForFavorites > 0) {
                 if (sizeForFavorites > 0) {
                     drawString(font, I18n.translate("text.rei.favorites"), innerBounds.x + 2, (int) (innerBounds.y + 8 - scroll), -1);
                     drawString(font, I18n.translate("text.rei.favorites"), innerBounds.x + 2, (int) (innerBounds.y + 8 - scroll), -1);
                     nextIndex += innerBounds.width / 18;
                     nextIndex += innerBounds.width / 18;
-                    for(int i1 = 0; i1 < favorites.size(); i1++) {
+                    for (int i1 = 0; i1 < favorites.size(); i1++) {
                         EntryStack stack = favorites.get(i1);
                         EntryStack stack = favorites.get(i1);
                         back1:
                         back1:
                         while (true) {
                         while (true) {
@@ -293,7 +293,7 @@ public class EntryListWidget extends WidgetWithBounds {
                 }
                 }
                 int offset = sizeForFavorites > 0 ? -12 : 0;
                 int offset = sizeForFavorites > 0 ? -12 : 0;
                 back:
                 back:
-                for(; i < allStacks.size(); i++) {
+                for (; i < allStacks.size(); i++) {
                     EntryStack stack = allStacks.get(i);
                     EntryStack stack = allStacks.get(i);
                     while (true) {
                     while (true) {
                         EntryListEntry entry = entries.get(nextIndex);
                         EntryListEntry entry = entries.get(nextIndex);
@@ -320,7 +320,7 @@ public class EntryListWidget extends WidgetWithBounds {
             if (debugTime) {
             if (debugTime) {
                 int size = 0;
                 int size = 0;
                 long time = 0;
                 long time = 0;
-                for(Widget widget : widgets) {
+                for (Widget widget : widgets) {
                     if (widget instanceof EntryListEntry) {
                     if (widget instanceof EntryListEntry) {
                         size++;
                         size++;
                         long l = System.currentTimeMillis();
                         long l = System.currentTimeMillis();
@@ -341,19 +341,19 @@ public class EntryListWidget extends WidgetWithBounds {
                 immediate.draw();
                 immediate.draw();
                 setZ(z);
                 setZ(z);
             } else {
             } else {
-                for(Widget widget : widgets) {
+                for (Widget widget : widgets) {
                     widget.render(mouseX, mouseY, delta);
                     widget.render(mouseX, mouseY, delta);
                 }
                 }
             }
             }
         }
         }
     }
     }
-    
+
     private int getScrollbarMinX() {
     private int getScrollbarMinX() {
         if (ConfigObject.getInstance().isLeftHandSidePanel())
         if (ConfigObject.getInstance().isLeftHandSidePanel())
             return bounds.x + 1;
             return bounds.x + 1;
         return bounds.getMaxX() - 7;
         return bounds.getMaxX() - 7;
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseDragged(double mouseX, double mouseY, int int_1, double double_3, double double_4) {
     public boolean mouseDragged(double mouseX, double mouseY, int int_1, double double_3, double double_4) {
         if (int_1 == 0 && draggingScrollBar) {
         if (int_1 == 0 && draggingScrollBar) {
@@ -374,7 +374,7 @@ public class EntryListWidget extends WidgetWithBounds {
         }
         }
         return super.mouseDragged(mouseX, mouseY, int_1, double_3, double_4);
         return super.mouseDragged(mouseX, mouseY, int_1, double_3, double_4);
     }
     }
-    
+
     private void renderScrollbar() {
     private void renderScrollbar() {
         int maxScroll = getMaxScroll();
         int maxScroll = getMaxScroll();
         if (maxScroll > 0) {
         if (maxScroll > 0) {
@@ -383,13 +383,13 @@ public class EntryListWidget extends WidgetWithBounds {
             height -= Math.min((scroll < 0 ? (int) -scroll : scroll > maxScroll ? (int) scroll - maxScroll : 0), height * .95);
             height -= Math.min((scroll < 0 ? (int) -scroll : scroll > maxScroll ? (int) scroll - maxScroll : 0), height * .95);
             height = Math.max(10, height);
             height = Math.max(10, height);
             int minY = Math.min(Math.max((int) scroll * (innerBounds.height - height) / maxScroll + innerBounds.y, innerBounds.y), innerBounds.getMaxY() - height);
             int minY = Math.min(Math.max((int) scroll * (innerBounds.height - height) / maxScroll + innerBounds.y, innerBounds.y), innerBounds.getMaxY() - height);
-            
+
             int scrollbarPositionMinX = getScrollbarMinX();
             int scrollbarPositionMinX = getScrollbarMinX();
             int scrollbarPositionMaxX = scrollbarPositionMinX + 6;
             int scrollbarPositionMaxX = scrollbarPositionMinX + 6;
             boolean hovered = (new Rectangle(scrollbarPositionMinX, minY, scrollbarPositionMaxX - scrollbarPositionMinX, height)).contains(PointHelper.fromMouse());
             boolean hovered = (new Rectangle(scrollbarPositionMinX, minY, scrollbarPositionMaxX - scrollbarPositionMinX, height)).contains(PointHelper.fromMouse());
             float bottomC = (hovered ? .67f : .5f) * (ScreenHelper.isDarkModeEnabled() ? 0.8f : 1f);
             float bottomC = (hovered ? .67f : .5f) * (ScreenHelper.isDarkModeEnabled() ? 0.8f : 1f);
             float topC = (hovered ? .87f : .67f) * (ScreenHelper.isDarkModeEnabled() ? 0.8f : 1f);
             float topC = (hovered ? .87f : .67f) * (ScreenHelper.isDarkModeEnabled() ? 0.8f : 1f);
-            
+
             RenderSystem.disableTexture();
             RenderSystem.disableTexture();
             RenderSystem.enableBlend();
             RenderSystem.enableBlend();
             RenderSystem.disableAlphaTest();
             RenderSystem.disableAlphaTest();
@@ -415,7 +415,7 @@ public class EntryListWidget extends WidgetWithBounds {
             RenderSystem.enableTexture();
             RenderSystem.enableTexture();
         }
         }
     }
     }
-    
+
     private void updatePosition(float delta) {
     private void updatePosition(float delta) {
         target = clamp(target);
         target = clamp(target);
         if (target < 0) {
         if (target < 0) {
@@ -434,16 +434,16 @@ public class EntryListWidget extends WidgetWithBounds {
         else
         else
             scroll = target;
             scroll = target;
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (containsMouse(PointHelper.fromMouse()))
         if (containsMouse(PointHelper.fromMouse()))
-            for(Widget widget : widgets)
+            for (Widget widget : widgets)
                 if (widget.keyPressed(int_1, int_2, int_3))
                 if (widget.keyPressed(int_1, int_2, int_3))
                     return true;
                     return true;
         return false;
         return false;
     }
     }
-    
+
     public void updateArea(DisplayHelper.DisplayBoundsHandler<?> boundsHandler, @Nullable String searchTerm) {
     public void updateArea(DisplayHelper.DisplayBoundsHandler<?> boundsHandler, @Nullable String searchTerm) {
         this.bounds = boundsHandler.getItemListArea(ScreenHelper.getLastOverlay().getBounds());
         this.bounds = boundsHandler.getItemListArea(ScreenHelper.getLastOverlay().getBounds());
         FavoritesListWidget favoritesListWidget = ContainerScreenOverlay.getFavoritesListWidget();
         FavoritesListWidget favoritesListWidget = ContainerScreenOverlay.getFavoritesListWidget();
@@ -456,7 +456,7 @@ public class EntryListWidget extends WidgetWithBounds {
         else
         else
             updateEntriesPosition();
             updateEntriesPosition();
     }
     }
-    
+
     public void updateEntriesPosition() {
     public void updateEntriesPosition() {
         this.innerBounds = updateInnerBounds(bounds);
         this.innerBounds = updateInnerBounds(bounds);
         if (!ConfigObject.getInstance().isEntryListWidgetScrolled()) {
         if (!ConfigObject.getInstance().isEntryListWidgetScrolled()) {
@@ -464,8 +464,8 @@ public class EntryListWidget extends WidgetWithBounds {
             List<EntryListEntry> entries = Lists.newLinkedList();
             List<EntryListEntry> entries = Lists.newLinkedList();
             int width = innerBounds.width / 18;
             int width = innerBounds.width / 18;
             int height = innerBounds.height / 18;
             int height = innerBounds.height / 18;
-            for(int currentY = 0; currentY < height; currentY++) {
-                for(int currentX = 0; currentX < width; currentX++) {
+            for (int currentY = 0; currentY < height; currentY++) {
+                for (int currentX = 0; currentX < width; currentX++) {
                     if (notSteppingOnExclusionZones(currentX * 18 + innerBounds.x, currentY * 18 + innerBounds.y, innerBounds)) {
                     if (notSteppingOnExclusionZones(currentX * 18 + innerBounds.x, currentY * 18 + innerBounds.y, innerBounds)) {
                         entries.add((EntryListEntry) new EntryListEntry(currentX * 18 + innerBounds.x, currentY * 18 + innerBounds.y).noBackground());
                         entries.add((EntryListEntry) new EntryListEntry(currentX * 18 + innerBounds.x, currentY * 18 + innerBounds.y).noBackground());
                     }
                     }
@@ -474,7 +474,7 @@ public class EntryListWidget extends WidgetWithBounds {
             page = Math.max(Math.min(page, getTotalPages() - 1), 0);
             page = Math.max(Math.min(page, getTotalPages() - 1), 0);
             int numberForFavorites = getScrollNumberForFavorites();
             int numberForFavorites = getScrollNumberForFavorites();
             List<EntryStack> subList = allStacks.stream().skip(Math.max(0, page * entries.size() - numberForFavorites)).limit(Math.max(0, entries.size() - Math.max(0, numberForFavorites - page * entries.size()))).collect(Collectors.toList());
             List<EntryStack> subList = allStacks.stream().skip(Math.max(0, page * entries.size() - numberForFavorites)).limit(Math.max(0, entries.size() - Math.max(0, numberForFavorites - page * entries.size()))).collect(Collectors.toList());
-            for(int i = 0; i < subList.size(); i++) {
+            for (int i = 0; i < subList.size(); i++) {
                 EntryStack stack = subList.get(i);
                 EntryStack stack = subList.get(i);
                 entries.get(i + Math.max(0, numberForFavorites - page * entries.size())).clearStacks().entry(stack);
                 entries.get(i + Math.max(0, numberForFavorites - page * entries.size())).clearStacks().entry(stack);
                 entries.get(i + Math.max(0, numberForFavorites - page * entries.size())).isFavorites = false;
                 entries.get(i + Math.max(0, numberForFavorites - page * entries.size())).isFavorites = false;
@@ -489,7 +489,7 @@ public class EntryListWidget extends WidgetWithBounds {
                     j += width;
                     j += width;
                 }
                 }
                 List<EntryStack> subFavoritesList = favorites.stream().skip(skippedFavorites).limit(Math.max(0, entries.size() - width)).collect(Collectors.toList());
                 List<EntryStack> subFavoritesList = favorites.stream().skip(skippedFavorites).limit(Math.max(0, entries.size() - width)).collect(Collectors.toList());
-                for(int i = 0; i < subFavoritesList.size(); i++) {
+                for (int i = 0; i < subFavoritesList.size(); i++) {
                     EntryStack stack = subFavoritesList.get(i);
                     EntryStack stack = subFavoritesList.get(i);
                     entries.get(j).clearStacks().entry(stack);
                     entries.get(j).clearStacks().entry(stack);
                     entries.get(j).isFavorites = true;
                     entries.get(j).isFavorites = true;
@@ -505,7 +505,7 @@ public class EntryListWidget extends WidgetWithBounds {
             int currentX = 0;
             int currentX = 0;
             int currentY = 0;
             int currentY = 0;
             List<EntryListEntry> entries = Lists.newLinkedList();
             List<EntryListEntry> entries = Lists.newLinkedList();
-            for(int i = 0; i < slotsToPrepare; i++) {
+            for (int i = 0; i < slotsToPrepare; i++) {
                 int xPos = currentX * 18 + innerBounds.x;
                 int xPos = currentX * 18 + innerBounds.x;
                 int yPos = currentY * 18 + innerBounds.y;
                 int yPos = currentY * 18 + innerBounds.y;
                 entries.add((EntryListEntry) new EntryListEntry(xPos, yPos).noBackground());
                 entries.add((EntryListEntry) new EntryListEntry(xPos, yPos).noBackground());
@@ -522,12 +522,12 @@ public class EntryListWidget extends WidgetWithBounds {
         if (favoritesListWidget != null)
         if (favoritesListWidget != null)
             favoritesListWidget.updateEntriesPosition();
             favoritesListWidget.updateEntriesPosition();
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public List<EntryStack> getAllStacks() {
     public List<EntryStack> getAllStacks() {
         return allStacks;
         return allStacks;
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     public void updateSearch(String searchTerm) {
     public void updateSearch(String searchTerm) {
         lastSearchArguments = processSearchTerm(searchTerm);
         lastSearchArguments = processSearchTerm(searchTerm);
@@ -535,7 +535,7 @@ public class EntryListWidget extends WidgetWithBounds {
             List<EntryStack> list = Lists.newLinkedList();
             List<EntryStack> list = Lists.newLinkedList();
             boolean checkCraftable = ConfigManager.getInstance().isCraftableOnlyEnabled() && !ScreenHelper.inventoryStacks.isEmpty();
             boolean checkCraftable = ConfigManager.getInstance().isCraftableOnlyEnabled() && !ScreenHelper.inventoryStacks.isEmpty();
             List<EntryStack> workingItems = checkCraftable ? RecipeHelper.getInstance().findCraftableEntriesByItems(CollectionUtils.map(ScreenHelper.inventoryStacks, EntryStack::create)) : null;
             List<EntryStack> workingItems = checkCraftable ? RecipeHelper.getInstance().findCraftableEntriesByItems(CollectionUtils.map(ScreenHelper.inventoryStacks, EntryStack::create)) : null;
-            for(EntryStack stack : EntryRegistry.getInstance().getStacksList()) {
+            for (EntryStack stack : EntryRegistry.getInstance().getStacksList()) {
                 if (canLastSearchTermsBeAppliedTo(stack)) {
                 if (canLastSearchTermsBeAppliedTo(stack)) {
                     if (workingItems != null && CollectionUtils.findFirstOrNullEquals(workingItems, stack) == null)
                     if (workingItems != null && CollectionUtils.findFirstOrNullEquals(workingItems, stack) == null)
                         continue;
                         continue;
@@ -555,7 +555,7 @@ public class EntryListWidget extends WidgetWithBounds {
             List<EntryStack> list = Lists.newLinkedList();
             List<EntryStack> list = Lists.newLinkedList();
             boolean checkCraftable = ConfigManager.getInstance().isCraftableOnlyEnabled() && !ScreenHelper.inventoryStacks.isEmpty();
             boolean checkCraftable = ConfigManager.getInstance().isCraftableOnlyEnabled() && !ScreenHelper.inventoryStacks.isEmpty();
             List<EntryStack> workingItems = checkCraftable ? RecipeHelper.getInstance().findCraftableEntriesByItems(CollectionUtils.map(ScreenHelper.inventoryStacks, EntryStack::create)) : null;
             List<EntryStack> workingItems = checkCraftable ? RecipeHelper.getInstance().findCraftableEntriesByItems(CollectionUtils.map(ScreenHelper.inventoryStacks, EntryStack::create)) : null;
-            for(EntryStack stack : ConfigManager.getInstance().getFavorites()) {
+            for (EntryStack stack : ConfigManager.getInstance().getFavorites()) {
                 if (canLastSearchTermsBeAppliedTo(stack)) {
                 if (canLastSearchTermsBeAppliedTo(stack)) {
                     if (workingItems != null && CollectionUtils.findFirstOrNullEquals(workingItems, stack) == null)
                     if (workingItems != null && CollectionUtils.findFirstOrNullEquals(workingItems, stack) == null)
                         continue;
                         continue;
@@ -578,20 +578,20 @@ public class EntryListWidget extends WidgetWithBounds {
             favoritesListWidget.updateSearch(this, searchTerm);
             favoritesListWidget.updateSearch(this, searchTerm);
         updateEntriesPosition();
         updateEntriesPosition();
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     public boolean canLastSearchTermsBeAppliedTo(EntryStack stack) {
     public boolean canLastSearchTermsBeAppliedTo(EntryStack stack) {
         return lastSearchArguments.isEmpty() || canSearchTermsBeAppliedTo(stack, lastSearchArguments);
         return lastSearchArguments.isEmpty() || canSearchTermsBeAppliedTo(stack, lastSearchArguments);
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     private boolean canSearchTermsBeAppliedTo(EntryStack stack, List<SearchArgument.SearchArguments> searchArguments) {
     private boolean canSearchTermsBeAppliedTo(EntryStack stack, List<SearchArgument.SearchArguments> searchArguments) {
         if (searchArguments.isEmpty())
         if (searchArguments.isEmpty())
             return true;
             return true;
         String mod = null, name = null, tooltip = null, tags[] = null;
         String mod = null, name = null, tooltip = null, tags[] = null;
-        for(SearchArgument.SearchArguments arguments : searchArguments) {
+        for (SearchArgument.SearchArguments arguments : searchArguments) {
             boolean applicable = true;
             boolean applicable = true;
-            for(SearchArgument argument : arguments.getArguments()) {
+            for (SearchArgument argument : arguments.getArguments()) {
                 if (argument.getArgumentType() == SearchArgument.ArgumentType.ALWAYS)
                 if (argument.getArgumentType() == SearchArgument.ArgumentType.ALWAYS)
                     return true;
                     return true;
                 else if (argument.getArgumentType() == SearchArgument.ArgumentType.MOD) {
                 else if (argument.getArgumentType() == SearchArgument.ArgumentType.MOD) {
@@ -620,19 +620,19 @@ public class EntryListWidget extends WidgetWithBounds {
                         if (stack.getType() == EntryStack.Type.ITEM) {
                         if (stack.getType() == EntryStack.Type.ITEM) {
                             Identifier[] tagsFor = minecraft.getNetworkHandler().getTagManager().items().getTagsFor(stack.getItem()).toArray(new Identifier[0]);
                             Identifier[] tagsFor = minecraft.getNetworkHandler().getTagManager().items().getTagsFor(stack.getItem()).toArray(new Identifier[0]);
                             tags = new String[tagsFor.length];
                             tags = new String[tagsFor.length];
-                            for(int i = 0; i < tagsFor.length; i++)
+                            for (int i = 0; i < tagsFor.length; i++)
                                 tags[i] = tagsFor[i].toString();
                                 tags[i] = tagsFor[i].toString();
                         } else if (stack.getType() == EntryStack.Type.FLUID) {
                         } else if (stack.getType() == EntryStack.Type.FLUID) {
                             Identifier[] tagsFor = minecraft.getNetworkHandler().getTagManager().fluids().getTagsFor(stack.getFluid()).toArray(new Identifier[0]);
                             Identifier[] tagsFor = minecraft.getNetworkHandler().getTagManager().fluids().getTagsFor(stack.getFluid()).toArray(new Identifier[0]);
                             tags = new String[tagsFor.length];
                             tags = new String[tagsFor.length];
-                            for(int i = 0; i < tagsFor.length; i++)
+                            for (int i = 0; i < tagsFor.length; i++)
                                 tags[i] = tagsFor[i].toString();
                                 tags[i] = tagsFor[i].toString();
                         } else
                         } else
                             tags = new String[0];
                             tags = new String[0];
                     }
                     }
                     if (tags != null && tags.length > 0) {
                     if (tags != null && tags.length > 0) {
                         boolean a = false;
                         boolean a = false;
-                        for(String tag : tags)
+                        for (String tag : tags)
                             if (argument.getFunction(argument.isInclude()).apply(tag))
                             if (argument.getFunction(argument.isInclude()).apply(tag))
                                 a = true;
                                 a = true;
                         if (!a) {
                         if (!a) {
@@ -650,17 +650,17 @@ public class EntryListWidget extends WidgetWithBounds {
         }
         }
         return false;
         return false;
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     private List<SearchArgument.SearchArguments> processSearchTerm(String searchTerm) {
     private List<SearchArgument.SearchArguments> processSearchTerm(String searchTerm) {
         List<SearchArgument.SearchArguments> searchArguments = Lists.newArrayList();
         List<SearchArgument.SearchArguments> searchArguments = Lists.newArrayList();
-        for(String split : StringUtils.splitByWholeSeparatorPreserveAllTokens(searchTerm.toLowerCase(Locale.ROOT), "|")) {
+        for (String split : StringUtils.splitByWholeSeparatorPreserveAllTokens(searchTerm.toLowerCase(Locale.ROOT), "|")) {
             String[] terms = StringUtils.split(split);
             String[] terms = StringUtils.split(split);
             if (terms.length == 0)
             if (terms.length == 0)
                 searchArguments.add(SearchArgument.SearchArguments.ALWAYS);
                 searchArguments.add(SearchArgument.SearchArguments.ALWAYS);
             else {
             else {
                 SearchArgument[] arguments = new SearchArgument[terms.length];
                 SearchArgument[] arguments = new SearchArgument[terms.length];
-                for(int i = 0; i < terms.length; i++) {
+                for (int i = 0; i < terms.length; i++) {
                     String term = terms[i];
                     String term = terms[i];
                     if (term.startsWith("-@") || term.startsWith("@-")) {
                     if (term.startsWith("-@") || term.startsWith("@-")) {
                         arguments[i] = new SearchArgument(SearchArgument.ArgumentType.MOD, term.substring(2), false);
                         arguments[i] = new SearchArgument(SearchArgument.ArgumentType.MOD, term.substring(2), false);
@@ -685,12 +685,12 @@ public class EntryListWidget extends WidgetWithBounds {
         }
         }
         return searchArguments;
         return searchArguments;
     }
     }
-    
+
     @Override
     @Override
     public List<? extends Widget> children() {
     public List<? extends Widget> children() {
         return widgets;
         return widgets;
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
         double height = getMaxScroll();
         double height = getMaxScroll();
@@ -703,7 +703,7 @@ public class EntryListWidget extends WidgetWithBounds {
             }
             }
         }
         }
         this.draggingScrollBar = false;
         this.draggingScrollBar = false;
-        
+
         if (containsMouse(double_1, double_2)) {
         if (containsMouse(double_1, double_2)) {
             ClientPlayerEntity player = minecraft.player;
             ClientPlayerEntity player = minecraft.player;
             if (ClientHelper.getInstance().isCheating() && !player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets()) {
             if (ClientHelper.getInstance().isCheating() && !player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets()) {
@@ -712,33 +712,33 @@ public class EntryListWidget extends WidgetWithBounds {
             }
             }
             if (!player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets())
             if (!player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets())
                 return false;
                 return false;
-            for(Widget widget : children())
+            for (Widget widget : children())
                 if (widget.mouseClicked(double_1, double_2, int_1))
                 if (widget.mouseClicked(double_1, double_2, int_1))
                     return true;
                     return true;
         }
         }
         return false;
         return false;
     }
     }
-    
+
     private class EntryListEntry extends EntryWidget {
     private class EntryListEntry extends EntryWidget {
         private int backupY;
         private int backupY;
         private boolean isFavorites;
         private boolean isFavorites;
-        
+
         private EntryListEntry(int x, int y) {
         private EntryListEntry(int x, int y) {
             super(x, y);
             super(x, y);
             this.backupY = y;
             this.backupY = y;
         }
         }
-        
+
         @Override
         @Override
         public boolean containsMouse(double mouseX, double mouseY) {
         public boolean containsMouse(double mouseX, double mouseY) {
             return super.containsMouse(mouseX, mouseY) && bounds.contains(mouseX, mouseY);
             return super.containsMouse(mouseX, mouseY) && bounds.contains(mouseX, mouseY);
         }
         }
-        
+
         @Override
         @Override
         protected void drawHighlighted(int mouseX, int mouseY, float delta) {
         protected void drawHighlighted(int mouseX, int mouseY, float delta) {
             if (getCurrentEntry().getType() != EntryStack.Type.EMPTY)
             if (getCurrentEntry().getType() != EntryStack.Type.EMPTY)
                 super.drawHighlighted(mouseX, mouseY, delta);
                 super.drawHighlighted(mouseX, mouseY, delta);
         }
         }
-        
+
         private String getLocalizedName(InputUtil.KeyCode value) {
         private String getLocalizedName(InputUtil.KeyCode value) {
             String string_1 = value.getName();
             String string_1 = value.getName();
             int int_1 = value.getKeyCode();
             int int_1 = value.getKeyCode();
@@ -754,10 +754,10 @@ public class EntryListWidget extends WidgetWithBounds {
                     String string_3 = I18n.translate(string_1, new Object[0]);
                     String string_3 = I18n.translate(string_1, new Object[0]);
                     string_2 = Objects.equals(string_3, string_1) ? I18n.translate(InputUtil.Type.MOUSE.getName(), new Object[]{int_1 + 1}) : string_3;
                     string_2 = Objects.equals(string_3, string_1) ? I18n.translate(InputUtil.Type.MOUSE.getName(), new Object[]{int_1 + 1}) : string_3;
             }
             }
-            
+
             return string_2 == null ? I18n.translate(string_1, new Object[0]) : string_2;
             return string_2 == null ? I18n.translate(string_1, new Object[0]) : string_2;
         }
         }
-        
+
         @Override
         @Override
         protected void queueTooltip(int mouseX, int mouseY, float delta) {
         protected void queueTooltip(int mouseX, int mouseY, float delta) {
             if (!ClientHelper.getInstance().isCheating() || minecraft.player.inventory.getCursorStack().isEmpty()) {
             if (!ClientHelper.getInstance().isCheating() || minecraft.player.inventory.getCursorStack().isEmpty()) {
@@ -775,7 +775,7 @@ public class EntryListWidget extends WidgetWithBounds {
                 }
                 }
             }
             }
         }
         }
-        
+
         @Override
         @Override
         public boolean keyPressed(int int_1, int int_2, int int_3) {
         public boolean keyPressed(int int_1, int int_2, int int_3) {
             if (interactable && ConfigObject.getInstance().isFavoritesEnabled() && containsMouse(PointHelper.fromMouse()) && !getCurrentEntry().isEmpty()) {
             if (interactable && ConfigObject.getInstance().isFavoritesEnabled() && containsMouse(PointHelper.fromMouse()) && !getCurrentEntry().isEmpty()) {
@@ -808,7 +808,7 @@ public class EntryListWidget extends WidgetWithBounds {
             }
             }
             return super.keyPressed(int_1, int_2, int_3);
             return super.keyPressed(int_1, int_2, int_3);
         }
         }
-        
+
         @Override
         @Override
         public boolean mouseClicked(double mouseX, double mouseY, int button) {
         public boolean mouseClicked(double mouseX, double mouseY, int button) {
             if (!interactable)
             if (!interactable)

+ 29 - 29
src/main/java/me/shedaniel/rei/gui/widget/EntryWidget.java

@@ -21,77 +21,77 @@ import java.util.Collections;
 import java.util.List;
 import java.util.List;
 
 
 public class EntryWidget extends WidgetWithBounds {
 public class EntryWidget extends WidgetWithBounds {
-    
+
     protected static final Identifier RECIPE_GUI = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     protected static final Identifier RECIPE_GUI = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     protected static final Identifier RECIPE_GUI_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
     protected static final Identifier RECIPE_GUI_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
-    
+
     protected boolean highlight = true;
     protected boolean highlight = true;
     protected boolean tooltips = true;
     protected boolean tooltips = true;
     protected boolean background = true;
     protected boolean background = true;
     protected boolean interactable = true;
     protected boolean interactable = true;
     private Rectangle bounds;
     private Rectangle bounds;
     private List<EntryStack> entryStacks;
     private List<EntryStack> entryStacks;
-    
+
     protected EntryWidget(int x, int y) {
     protected EntryWidget(int x, int y) {
         this.bounds = new Rectangle(x - 1, y - 1, 18, 18);
         this.bounds = new Rectangle(x - 1, y - 1, 18, 18);
         this.entryStacks = new ArrayList<>();
         this.entryStacks = new ArrayList<>();
     }
     }
-    
+
     public static EntryWidget create(int x, int y) {
     public static EntryWidget create(int x, int y) {
         return new EntryWidget(x, y);
         return new EntryWidget(x, y);
     }
     }
-    
+
     public EntryWidget disableInteractions() {
     public EntryWidget disableInteractions() {
         return interactable(false);
         return interactable(false);
     }
     }
-    
+
     public EntryWidget interactable(boolean b) {
     public EntryWidget interactable(boolean b) {
         interactable = b;
         interactable = b;
         return this;
         return this;
     }
     }
-    
+
     public EntryWidget noHighlight() {
     public EntryWidget noHighlight() {
         return highlight(false);
         return highlight(false);
     }
     }
-    
+
     public EntryWidget highlight(boolean b) {
     public EntryWidget highlight(boolean b) {
         highlight = b;
         highlight = b;
         return this;
         return this;
     }
     }
-    
+
     public EntryWidget noTooltips() {
     public EntryWidget noTooltips() {
         return tooltips(false);
         return tooltips(false);
     }
     }
-    
+
     public EntryWidget tooltips(boolean b) {
     public EntryWidget tooltips(boolean b) {
         tooltips = b;
         tooltips = b;
         return this;
         return this;
     }
     }
-    
+
     public EntryWidget noBackground() {
     public EntryWidget noBackground() {
         return background(false);
         return background(false);
     }
     }
-    
+
     public EntryWidget background(boolean b) {
     public EntryWidget background(boolean b) {
         background = b;
         background = b;
         return this;
         return this;
     }
     }
-    
+
     public EntryWidget clearStacks() {
     public EntryWidget clearStacks() {
         entryStacks.clear();
         entryStacks.clear();
         return this;
         return this;
     }
     }
-    
+
     public EntryWidget entry(EntryStack stack) {
     public EntryWidget entry(EntryStack stack) {
         entryStacks.add(stack);
         entryStacks.add(stack);
         return this;
         return this;
     }
     }
-    
+
     public EntryWidget entries(Collection<EntryStack> stacks) {
     public EntryWidget entries(Collection<EntryStack> stacks) {
         entryStacks.addAll(stacks);
         entryStacks.addAll(stacks);
         return this;
         return this;
     }
     }
-    
+
     protected EntryStack getCurrentEntry() {
     protected EntryStack getCurrentEntry() {
         if (entryStacks.isEmpty())
         if (entryStacks.isEmpty())
             return EntryStack.empty();
             return EntryStack.empty();
@@ -99,27 +99,27 @@ public class EntryWidget extends WidgetWithBounds {
             return entryStacks.get(0);
             return entryStacks.get(0);
         return entryStacks.get(MathHelper.floor((System.currentTimeMillis() / 500 % (double) entryStacks.size()) / 1f));
         return entryStacks.get(MathHelper.floor((System.currentTimeMillis() / 500 % (double) entryStacks.size()) / 1f));
     }
     }
-    
+
     public List<EntryStack> entries() {
     public List<EntryStack> entries() {
         return entryStacks;
         return entryStacks;
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getBounds() {
     public Rectangle getBounds() {
         return bounds;
         return bounds;
     }
     }
-    
+
     protected Rectangle getInnerBounds() {
     protected Rectangle getInnerBounds() {
         return new Rectangle(bounds.x + 1, bounds.y + 1, bounds.width - 2, bounds.height - 2);
         return new Rectangle(bounds.x + 1, bounds.y + 1, bounds.width - 2, bounds.height - 2);
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
         if (background) {
         if (background) {
             drawBackground(mouseX, mouseY, delta);
             drawBackground(mouseX, mouseY, delta);
         }
         }
         drawCurrentEntry(mouseX, mouseY, delta);
         drawCurrentEntry(mouseX, mouseY, delta);
-        
+
         boolean highlighted = containsMouse(mouseX, mouseY);
         boolean highlighted = containsMouse(mouseX, mouseY);
         if (tooltips && highlighted) {
         if (tooltips && highlighted) {
             queueTooltip(mouseX, mouseY, delta);
             queueTooltip(mouseX, mouseY, delta);
@@ -128,29 +128,29 @@ public class EntryWidget extends WidgetWithBounds {
             drawHighlighted(mouseX, mouseY, delta);
             drawHighlighted(mouseX, mouseY, delta);
         }
         }
     }
     }
-    
+
     protected void drawBackground(int mouseX, int mouseY, float delta) {
     protected void drawBackground(int mouseX, int mouseY, float delta) {
         minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? RECIPE_GUI_DARK : RECIPE_GUI);
         minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? RECIPE_GUI_DARK : RECIPE_GUI);
         blit(bounds.x, bounds.y, 0, 222, bounds.width, bounds.height);
         blit(bounds.x, bounds.y, 0, 222, bounds.width, bounds.height);
     }
     }
-    
+
     protected void drawCurrentEntry(int mouseX, int mouseY, float delta) {
     protected void drawCurrentEntry(int mouseX, int mouseY, float delta) {
         EntryStack entry = getCurrentEntry();
         EntryStack entry = getCurrentEntry();
         entry.setZ(100);
         entry.setZ(100);
         entry.render(getInnerBounds(), mouseX, mouseY, delta);
         entry.render(getInnerBounds(), mouseX, mouseY, delta);
     }
     }
-    
+
     protected void queueTooltip(int mouseX, int mouseY, float delta) {
     protected void queueTooltip(int mouseX, int mouseY, float delta) {
         QueuedTooltip tooltip = getCurrentTooltip(mouseX, mouseY);
         QueuedTooltip tooltip = getCurrentTooltip(mouseX, mouseY);
         if (tooltip != null) {
         if (tooltip != null) {
             ScreenHelper.getLastOverlay().addTooltip(tooltip);
             ScreenHelper.getLastOverlay().addTooltip(tooltip);
         }
         }
     }
     }
-    
+
     public QueuedTooltip getCurrentTooltip(int mouseX, int mouseY) {
     public QueuedTooltip getCurrentTooltip(int mouseX, int mouseY) {
         return getCurrentEntry().getTooltip(mouseX, mouseY);
         return getCurrentEntry().getTooltip(mouseX, mouseY);
     }
     }
-    
+
     protected void drawHighlighted(int mouseX, int mouseY, float delta) {
     protected void drawHighlighted(int mouseX, int mouseY, float delta) {
         RenderSystem.disableDepthTest();
         RenderSystem.disableDepthTest();
         RenderSystem.colorMask(true, true, true, false);
         RenderSystem.colorMask(true, true, true, false);
@@ -162,12 +162,12 @@ public class EntryWidget extends WidgetWithBounds {
         RenderSystem.colorMask(true, true, true, true);
         RenderSystem.colorMask(true, true, true, true);
         RenderSystem.enableDepthTest();
         RenderSystem.enableDepthTest();
     }
     }
-    
+
     @Override
     @Override
     public List<? extends Element> children() {
     public List<? extends Element> children() {
         return Collections.emptyList();
         return Collections.emptyList();
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseClicked(double mouseX, double mouseY, int button) {
     public boolean mouseClicked(double mouseX, double mouseY, int button) {
         if (!interactable)
         if (!interactable)
@@ -179,7 +179,7 @@ public class EntryWidget extends WidgetWithBounds {
                 return ClientHelper.getInstance().executeUsageKeyBind(getCurrentEntry());
                 return ClientHelper.getInstance().executeUsageKeyBind(getCurrentEntry());
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (!interactable)
         if (!interactable)

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

@@ -48,48 +48,48 @@ public class FavoritesListWidget extends WidgetWithBounds {
     private Rectangle bounds, innerBounds;
     private Rectangle bounds, innerBounds;
     private List<EntryListEntry> entries = Collections.emptyList();
     private List<EntryListEntry> entries = Collections.emptyList();
     private boolean draggingScrollBar = false;
     private boolean draggingScrollBar = false;
-    
+
     private static Rectangle updateInnerBounds(Rectangle bounds) {
     private static Rectangle updateInnerBounds(Rectangle bounds) {
         int width = Math.max(MathHelper.floor((bounds.width - 2 - 6) / 18f), 1);
         int width = Math.max(MathHelper.floor((bounds.width - 2 - 6) / 18f), 1);
         if (!ConfigObject.getInstance().isLeftHandSidePanel())
         if (!ConfigObject.getInstance().isLeftHandSidePanel())
             return new Rectangle(bounds.getCenterX() - width * 9 + 3, bounds.y, width * 18, bounds.height);
             return new Rectangle(bounds.getCenterX() - width * 9 + 3, bounds.y, width * 18, bounds.height);
         return new Rectangle(bounds.getCenterX() - width * 9 - 3, bounds.y, width * 18, bounds.height);
         return new Rectangle(bounds.getCenterX() - width * 9 - 3, bounds.y, width * 18, bounds.height);
     }
     }
-    
+
     protected final int getMaxScrollPosition() {
     protected final int getMaxScrollPosition() {
         return MathHelper.ceil((favorites.size() + blockedCount) / (innerBounds.width / 18f)) * 18;
         return MathHelper.ceil((favorites.size() + blockedCount) / (innerBounds.width / 18f)) * 18;
     }
     }
-    
+
     protected final int getMaxScroll() {
     protected final int getMaxScroll() {
         return Math.max(0, this.getMaxScrollPosition() - innerBounds.height);
         return Math.max(0, this.getMaxScrollPosition() - innerBounds.height);
     }
     }
-    
+
     protected final double clamp(double v) {
     protected final double clamp(double v) {
         return this.clamp(v, 200.0D);
         return this.clamp(v, 200.0D);
     }
     }
-    
+
     protected final double clamp(double v, double clampExtension) {
     protected final double clamp(double v, double clampExtension) {
         return MathHelper.clamp(v, -clampExtension, (double) this.getMaxScroll() + clampExtension);
         return MathHelper.clamp(v, -clampExtension, (double) this.getMaxScroll() + clampExtension);
     }
     }
-    
+
     protected final void offset(double value, boolean animated) {
     protected final void offset(double value, boolean animated) {
         scrollTo(target + value, animated);
         scrollTo(target + value, animated);
     }
     }
-    
+
     protected final void scrollTo(double value, boolean animated) {
     protected final void scrollTo(double value, boolean animated) {
         scrollTo(value, animated, ClothConfigInitializer.getScrollDuration());
         scrollTo(value, animated, ClothConfigInitializer.getScrollDuration());
     }
     }
-    
+
     protected final void scrollTo(double value, boolean animated, long duration) {
     protected final void scrollTo(double value, boolean animated, long duration) {
         target = clamp(value);
         target = clamp(value);
-        
+
         if (animated) {
         if (animated) {
             start = System.currentTimeMillis();
             start = System.currentTimeMillis();
             this.duration = duration;
             this.duration = duration;
         } else
         } else
             scroll = target;
             scroll = target;
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled() && bounds.contains(double_1, double_2)) {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled() && bounds.contains(double_1, double_2)) {
@@ -98,14 +98,15 @@ public class FavoritesListWidget extends WidgetWithBounds {
         }
         }
         return super.mouseScrolled(double_1, double_2, double_3);
         return super.mouseScrolled(double_1, double_2, double_3);
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getBounds() {
     public Rectangle getBounds() {
         return bounds;
         return bounds;
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
+        if (bounds.isEmpty()) return;
         for (EntryListEntry entry : entries)
         for (EntryListEntry entry : entries)
             entry.clearStacks();
             entry.clearStacks();
         ScissorsHandler.INSTANCE.scissor(bounds);
         ScissorsHandler.INSTANCE.scissor(bounds);
@@ -136,13 +137,13 @@ public class FavoritesListWidget extends WidgetWithBounds {
         ScissorsHandler.INSTANCE.removeLastScissor();
         ScissorsHandler.INSTANCE.removeLastScissor();
         renderScrollbar();
         renderScrollbar();
     }
     }
-    
+
     private int getScrollbarMinX() {
     private int getScrollbarMinX() {
         if (!ConfigObject.getInstance().isLeftHandSidePanel())
         if (!ConfigObject.getInstance().isLeftHandSidePanel())
             return bounds.x + 1;
             return bounds.x + 1;
         return bounds.getMaxX() - 7;
         return bounds.getMaxX() - 7;
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseDragged(double mouseX, double mouseY, int int_1, double double_3, double double_4) {
     public boolean mouseDragged(double mouseX, double mouseY, int int_1, double double_3, double double_4) {
         if (int_1 == 0 && draggingScrollBar) {
         if (int_1 == 0 && draggingScrollBar) {
@@ -163,7 +164,7 @@ public class FavoritesListWidget extends WidgetWithBounds {
         }
         }
         return super.mouseDragged(mouseX, mouseY, int_1, double_3, double_4);
         return super.mouseDragged(mouseX, mouseY, int_1, double_3, double_4);
     }
     }
-    
+
     private void renderScrollbar() {
     private void renderScrollbar() {
         int maxScroll = getMaxScroll();
         int maxScroll = getMaxScroll();
         if (maxScroll > 0) {
         if (maxScroll > 0) {
@@ -172,13 +173,13 @@ public class FavoritesListWidget extends WidgetWithBounds {
             height -= Math.min((scroll < 0 ? (int) -scroll : scroll > maxScroll ? (int) scroll - maxScroll : 0), height * .95);
             height -= Math.min((scroll < 0 ? (int) -scroll : scroll > maxScroll ? (int) scroll - maxScroll : 0), height * .95);
             height = Math.max(10, height);
             height = Math.max(10, height);
             int minY = Math.min(Math.max((int) scroll * (innerBounds.height - height) / maxScroll + innerBounds.y, innerBounds.y), innerBounds.getMaxY() - height);
             int minY = Math.min(Math.max((int) scroll * (innerBounds.height - height) / maxScroll + innerBounds.y, innerBounds.y), innerBounds.getMaxY() - height);
-            
+
             int scrollbarPositionMinX = getScrollbarMinX();
             int scrollbarPositionMinX = getScrollbarMinX();
             int scrollbarPositionMaxX = scrollbarPositionMinX + 6;
             int scrollbarPositionMaxX = scrollbarPositionMinX + 6;
             boolean hovered = (new Rectangle(scrollbarPositionMinX, minY, scrollbarPositionMaxX - scrollbarPositionMinX, height)).contains(PointHelper.fromMouse());
             boolean hovered = (new Rectangle(scrollbarPositionMinX, minY, scrollbarPositionMaxX - scrollbarPositionMinX, height)).contains(PointHelper.fromMouse());
             float bottomC = (hovered ? .67f : .5f) * (ScreenHelper.isDarkModeEnabled() ? 0.8f : 1f);
             float bottomC = (hovered ? .67f : .5f) * (ScreenHelper.isDarkModeEnabled() ? 0.8f : 1f);
             float topC = (hovered ? .87f : .67f) * (ScreenHelper.isDarkModeEnabled() ? 0.8f : 1f);
             float topC = (hovered ? .87f : .67f) * (ScreenHelper.isDarkModeEnabled() ? 0.8f : 1f);
-            
+
             RenderSystem.disableTexture();
             RenderSystem.disableTexture();
             RenderSystem.enableBlend();
             RenderSystem.enableBlend();
             RenderSystem.disableAlphaTest();
             RenderSystem.disableAlphaTest();
@@ -204,7 +205,7 @@ public class FavoritesListWidget extends WidgetWithBounds {
             RenderSystem.enableTexture();
             RenderSystem.enableTexture();
         }
         }
     }
     }
-    
+
     private void updatePosition(float delta) {
     private void updatePosition(float delta) {
         target = clamp(target);
         target = clamp(target);
         if (target < 0) {
         if (target < 0) {
@@ -223,7 +224,7 @@ public class FavoritesListWidget extends WidgetWithBounds {
         else
         else
             scroll = target;
             scroll = target;
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (containsMouse(PointHelper.fromMouse()))
         if (containsMouse(PointHelper.fromMouse()))
@@ -232,37 +233,56 @@ public class FavoritesListWidget extends WidgetWithBounds {
                     return true;
                     return true;
         return false;
         return false;
     }
     }
-    
+
     @SuppressWarnings("rawtypes")
     @SuppressWarnings("rawtypes")
     public void updateFavoritesBounds(DisplayHelper.DisplayBoundsHandler boundsHandler, @Nullable String searchTerm) {
     public void updateFavoritesBounds(DisplayHelper.DisplayBoundsHandler boundsHandler, @Nullable String searchTerm) {
         this.bounds = boundsHandler.getFavoritesListArea(!ConfigObject.getInstance().isLeftHandSidePanel() ? boundsHandler.getLeftBounds(MinecraftClient.getInstance().currentScreen) : boundsHandler.getRightBounds(MinecraftClient.getInstance().currentScreen));
         this.bounds = boundsHandler.getFavoritesListArea(!ConfigObject.getInstance().isLeftHandSidePanel() ? boundsHandler.getLeftBounds(MinecraftClient.getInstance().currentScreen) : boundsHandler.getRightBounds(MinecraftClient.getInstance().currentScreen));
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     public void updateSearch(EntryListWidget listWidget, String searchTerm) {
     public void updateSearch(EntryListWidget listWidget, String searchTerm) {
         if (ConfigObject.getInstance().isFavoritesEnabled() && ConfigObject.getInstance().doDisplayFavoritesOnTheLeft()) {
         if (ConfigObject.getInstance().isFavoritesEnabled() && ConfigObject.getInstance().doDisplayFavoritesOnTheLeft()) {
-            List<EntryStack> list = Lists.newLinkedList();
-            boolean checkCraftable = ConfigManager.getInstance().isCraftableOnlyEnabled() && !ScreenHelper.inventoryStacks.isEmpty();
-            List<EntryStack> workingItems = checkCraftable ? RecipeHelper.getInstance().findCraftableEntriesByItems(CollectionUtils.map(ScreenHelper.inventoryStacks, EntryStack::create)) : null;
-            for (EntryStack stack : ConfigManager.getInstance().getFavorites()) {
-                if (listWidget.canLastSearchTermsBeAppliedTo(stack)) {
+            if (ConfigObject.getInstance().doSearchFavorites()) {
+                List<EntryStack> list = Lists.newLinkedList();
+                boolean checkCraftable = ConfigManager.getInstance().isCraftableOnlyEnabled() && !ScreenHelper.inventoryStacks.isEmpty();
+                List<EntryStack> workingItems = checkCraftable ? RecipeHelper.getInstance().findCraftableEntriesByItems(CollectionUtils.map(ScreenHelper.inventoryStacks, EntryStack::create)) : null;
+                for (EntryStack stack : ConfigManager.getInstance().getFavorites()) {
+                    if (listWidget.canLastSearchTermsBeAppliedTo(stack)) {
+                        if (workingItems != null && CollectionUtils.findFirstOrNullEquals(workingItems, stack) == null)
+                            continue;
+                        list.add(stack.copy().setting(EntryStack.Settings.RENDER_COUNTS, EntryStack.Settings.FALSE).setting(EntryStack.Settings.Item.RENDER_ENCHANTMENT_GLINT, RENDER_ENCHANTMENT_GLINT));
+                    }
+                }
+                ItemListOrdering ordering = ConfigObject.getInstance().getItemListOrdering();
+                if (ordering == ItemListOrdering.name)
+                    list.sort(ENTRY_NAME_COMPARER);
+                if (ordering == ItemListOrdering.item_groups)
+                    list.sort(ENTRY_GROUP_COMPARER);
+                if (!ConfigObject.getInstance().isItemListAscending())
+                    Collections.reverse(list);
+                favorites = list;
+            } else {
+                List<EntryStack> list = Lists.newLinkedList();
+                boolean checkCraftable = ConfigManager.getInstance().isCraftableOnlyEnabled() && !ScreenHelper.inventoryStacks.isEmpty();
+                List<EntryStack> workingItems = checkCraftable ? RecipeHelper.getInstance().findCraftableEntriesByItems(CollectionUtils.map(ScreenHelper.inventoryStacks, EntryStack::create)) : null;
+                for (EntryStack stack : ConfigManager.getInstance().getFavorites()) {
                     if (workingItems != null && CollectionUtils.findFirstOrNullEquals(workingItems, stack) == null)
                     if (workingItems != null && CollectionUtils.findFirstOrNullEquals(workingItems, stack) == null)
                         continue;
                         continue;
                     list.add(stack.copy().setting(EntryStack.Settings.RENDER_COUNTS, EntryStack.Settings.FALSE).setting(EntryStack.Settings.Item.RENDER_ENCHANTMENT_GLINT, RENDER_ENCHANTMENT_GLINT));
                     list.add(stack.copy().setting(EntryStack.Settings.RENDER_COUNTS, EntryStack.Settings.FALSE).setting(EntryStack.Settings.Item.RENDER_ENCHANTMENT_GLINT, RENDER_ENCHANTMENT_GLINT));
                 }
                 }
+                ItemListOrdering ordering = ConfigObject.getInstance().getItemListOrdering();
+                if (ordering == ItemListOrdering.name)
+                    list.sort(ENTRY_NAME_COMPARER);
+                if (ordering == ItemListOrdering.item_groups)
+                    list.sort(ENTRY_GROUP_COMPARER);
+                if (!ConfigObject.getInstance().isItemListAscending())
+                    Collections.reverse(list);
+                favorites = list;
             }
             }
-            ItemListOrdering ordering = ConfigObject.getInstance().getItemListOrdering();
-            if (ordering == ItemListOrdering.name)
-                list.sort(ENTRY_NAME_COMPARER);
-            if (ordering == ItemListOrdering.item_groups)
-                list.sort(ENTRY_GROUP_COMPARER);
-            if (!ConfigObject.getInstance().isItemListAscending())
-                Collections.reverse(list);
-            favorites = list;
         } else
         } else
             favorites = Collections.emptyList();
             favorites = Collections.emptyList();
     }
     }
-    
+
     public void updateEntriesPosition() {
     public void updateEntriesPosition() {
         this.innerBounds = updateInnerBounds(bounds);
         this.innerBounds = updateInnerBounds(bounds);
         int width = innerBounds.width / 18;
         int width = innerBounds.width / 18;
@@ -283,12 +303,12 @@ public class FavoritesListWidget extends WidgetWithBounds {
         }
         }
         this.entries = entries;
         this.entries = entries;
     }
     }
-    
+
     @Override
     @Override
     public List<? extends Widget> children() {
     public List<? extends Widget> children() {
         return entries;
         return entries;
     }
     }
-    
+
     @Override
     @Override
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
         double height = getMaxScroll();
         double height = getMaxScroll();
@@ -301,7 +321,7 @@ public class FavoritesListWidget extends WidgetWithBounds {
             }
             }
         }
         }
         this.draggingScrollBar = false;
         this.draggingScrollBar = false;
-        
+
         if (containsMouse(double_1, double_2)) {
         if (containsMouse(double_1, double_2)) {
             ClientPlayerEntity player = minecraft.player;
             ClientPlayerEntity player = minecraft.player;
             if (ClientHelper.getInstance().isCheating() && !player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets()) {
             if (ClientHelper.getInstance().isCheating() && !player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets()) {
@@ -316,26 +336,26 @@ public class FavoritesListWidget extends WidgetWithBounds {
         }
         }
         return false;
         return false;
     }
     }
-    
+
     private class EntryListEntry extends EntryWidget {
     private class EntryListEntry extends EntryWidget {
         private int backupY;
         private int backupY;
-        
+
         private EntryListEntry(int x, int y) {
         private EntryListEntry(int x, int y) {
             super(x, y);
             super(x, y);
             this.backupY = y;
             this.backupY = y;
         }
         }
-        
+
         @Override
         @Override
         public boolean containsMouse(double mouseX, double mouseY) {
         public boolean containsMouse(double mouseX, double mouseY) {
             return super.containsMouse(mouseX, mouseY) && bounds.contains(mouseX, mouseY);
             return super.containsMouse(mouseX, mouseY) && bounds.contains(mouseX, mouseY);
         }
         }
-        
+
         @Override
         @Override
         protected void drawHighlighted(int mouseX, int mouseY, float delta) {
         protected void drawHighlighted(int mouseX, int mouseY, float delta) {
             if (getCurrentEntry().getType() != EntryStack.Type.EMPTY)
             if (getCurrentEntry().getType() != EntryStack.Type.EMPTY)
                 super.drawHighlighted(mouseX, mouseY, delta);
                 super.drawHighlighted(mouseX, mouseY, delta);
         }
         }
-        
+
         private String getLocalizedName(InputUtil.KeyCode value) {
         private String getLocalizedName(InputUtil.KeyCode value) {
             String string_1 = value.getName();
             String string_1 = value.getName();
             int int_1 = value.getKeyCode();
             int int_1 = value.getKeyCode();
@@ -351,10 +371,10 @@ public class FavoritesListWidget extends WidgetWithBounds {
                     String string_3 = I18n.translate(string_1, new Object[0]);
                     String string_3 = I18n.translate(string_1, new Object[0]);
                     string_2 = Objects.equals(string_3, string_1) ? I18n.translate(InputUtil.Type.MOUSE.getName(), new Object[]{int_1 + 1}) : string_3;
                     string_2 = Objects.equals(string_3, string_1) ? I18n.translate(InputUtil.Type.MOUSE.getName(), new Object[]{int_1 + 1}) : string_3;
             }
             }
-            
+
             return string_2 == null ? I18n.translate(string_1, new Object[0]) : string_2;
             return string_2 == null ? I18n.translate(string_1, new Object[0]) : string_2;
         }
         }
-        
+
         @Override
         @Override
         protected void queueTooltip(int mouseX, int mouseY, float delta) {
         protected void queueTooltip(int mouseX, int mouseY, float delta) {
             if (!ClientHelper.getInstance().isCheating() || minecraft.player.inventory.getCursorStack().isEmpty()) {
             if (!ClientHelper.getInstance().isCheating() || minecraft.player.inventory.getCursorStack().isEmpty()) {
@@ -368,7 +388,7 @@ public class FavoritesListWidget extends WidgetWithBounds {
                 }
                 }
             }
             }
         }
         }
-        
+
         @Override
         @Override
         public boolean keyPressed(int int_1, int int_2, int int_3) {
         public boolean keyPressed(int int_1, int int_2, int int_3) {
             if (interactable && ConfigObject.getInstance().isFavoritesEnabled() && containsMouse(PointHelper.fromMouse()) && !getCurrentEntry().isEmpty()) {
             if (interactable && ConfigObject.getInstance().isFavoritesEnabled() && containsMouse(PointHelper.fromMouse()) && !getCurrentEntry().isEmpty()) {
@@ -391,7 +411,7 @@ public class FavoritesListWidget extends WidgetWithBounds {
             }
             }
             return super.keyPressed(int_1, int_2, int_3);
             return super.keyPressed(int_1, int_2, int_3);
         }
         }
-        
+
         @Override
         @Override
         public boolean mouseClicked(double mouseX, double mouseY, int button) {
         public boolean mouseClicked(double mouseX, double mouseY, int button) {
             if (!interactable)
             if (!interactable)

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

@@ -14,86 +14,86 @@ import java.util.Collections;
 import java.util.List;
 import java.util.List;
 
 
 public class LabelWidget extends WidgetWithBounds {
 public class LabelWidget extends WidgetWithBounds {
-    
+
     private Point pos;
     private Point pos;
     private String text;
     private String text;
     private int defaultColor;
     private int defaultColor;
     private boolean hasShadows = true;
     private boolean hasShadows = true;
     private boolean centered = true;
     private boolean centered = true;
-    
+
     @Deprecated
     @Deprecated
     public LabelWidget(int x, int y, String text) {
     public LabelWidget(int x, int y, String text) {
         this(new Point(x, y), text);
         this(new Point(x, y), text);
     }
     }
-    
+
     public LabelWidget(Point point, String text) {
     public LabelWidget(Point point, String text) {
         this.pos = point;
         this.pos = point;
         this.text = text;
         this.text = text;
         this.defaultColor = ScreenHelper.isDarkModeEnabled() ? 0xFFBBBBBB : -1;
         this.defaultColor = ScreenHelper.isDarkModeEnabled() ? 0xFFBBBBBB : -1;
     }
     }
-    
+
     public boolean isCentered() {
     public boolean isCentered() {
         return centered;
         return centered;
     }
     }
-    
+
     public void setCentered(boolean centered) {
     public void setCentered(boolean centered) {
         this.centered = centered;
         this.centered = centered;
     }
     }
-    
+
     public LabelWidget centered() {
     public LabelWidget centered() {
         setCentered(true);
         setCentered(true);
         return this;
         return this;
     }
     }
-    
+
     public LabelWidget leftAligned() {
     public LabelWidget leftAligned() {
         setCentered(false);
         setCentered(false);
         return this;
         return this;
     }
     }
-    
+
     public boolean isHasShadows() {
     public boolean isHasShadows() {
         return hasShadows;
         return hasShadows;
     }
     }
-    
+
     public void setHasShadows(boolean hasShadows) {
     public void setHasShadows(boolean hasShadows) {
         this.hasShadows = hasShadows;
         this.hasShadows = hasShadows;
     }
     }
-    
+
     public LabelWidget noShadow() {
     public LabelWidget noShadow() {
         setHasShadows(false);
         setHasShadows(false);
         return this;
         return this;
     }
     }
-    
+
     public int getDefaultColor() {
     public int getDefaultColor() {
         return defaultColor;
         return defaultColor;
     }
     }
-    
+
     public void setDefaultColor(int defaultColor) {
     public void setDefaultColor(int defaultColor) {
         this.defaultColor = defaultColor;
         this.defaultColor = defaultColor;
     }
     }
-    
+
     public Point getPosition() {
     public Point getPosition() {
         return pos;
         return pos;
     }
     }
-    
+
     public LabelWidget setPosition(Point position) {
     public LabelWidget setPosition(Point position) {
         this.pos = position;
         this.pos = position;
         return this;
         return this;
     }
     }
-    
+
     public String getText() {
     public String getText() {
         return text;
         return text;
     }
     }
-    
+
     public LabelWidget setText(String text) {
     public LabelWidget setText(String text) {
         this.text = text;
         this.text = text;
         return this;
         return this;
     }
     }
-    
+
     public LabelWidget color(int defaultColor) {
     public LabelWidget color(int defaultColor) {
         this.defaultColor = defaultColor;
         this.defaultColor = defaultColor;
         return this;
         return this;
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getBounds() {
     public Rectangle getBounds() {
         int width = font.getStringWidth(text);
         int width = font.getStringWidth(text);
@@ -102,12 +102,12 @@ public class LabelWidget extends WidgetWithBounds {
             return new Rectangle(pos.x - width / 2 - 1, pos.y - 5, width + 2, 14);
             return new Rectangle(pos.x - width / 2 - 1, pos.y - 5, width + 2, 14);
         return new Rectangle(pos.x - 1, pos.y - 5, width + 2, 14);
         return new Rectangle(pos.x - 1, pos.y - 5, width + 2, 14);
     }
     }
-    
+
     @Override
     @Override
     public List<? extends Element> children() {
     public List<? extends Element> children() {
         return Collections.emptyList();
         return Collections.emptyList();
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
         int width = font.getStringWidth(text);
         int width = font.getStringWidth(text);
@@ -124,5 +124,5 @@ public class LabelWidget extends WidgetWithBounds {
                 font.draw(text, pos.x, pos.y, defaultColor);
                 font.draw(text, pos.x, pos.y, defaultColor);
         }
         }
     }
     }
-    
+
 }
 }

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

@@ -16,39 +16,39 @@ import java.util.Collections;
 import java.util.List;
 import java.util.List;
 
 
 public class PanelWidget extends WidgetWithBounds {
 public class PanelWidget extends WidgetWithBounds {
-    
+
     private static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     private static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     private static final Identifier CHEST_GUI_TEXTURE_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
     private static final Identifier CHEST_GUI_TEXTURE_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
-    
+
     private Rectangle bounds;
     private Rectangle bounds;
     private int color = -1;
     private int color = -1;
-    
+
     public PanelWidget(Rectangle bounds) {
     public PanelWidget(Rectangle bounds) {
         this.bounds = bounds;
         this.bounds = bounds;
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getBounds() {
     public Rectangle getBounds() {
         return bounds;
         return bounds;
     }
     }
-    
+
     @Override
     @Override
     public List<Widget> children() {
     public List<Widget> children() {
         return Collections.emptyList();
         return Collections.emptyList();
     }
     }
-    
+
     public void render() {
     public void render() {
         render(0, 0, 0);
         render(0, 0, 0);
     }
     }
-    
+
     public int getColor() {
     public int getColor() {
         return color;
         return color;
     }
     }
-    
+
     public void setColor(int color) {
     public void setColor(int color) {
         this.color = color;
         this.color = color;
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
         if (!isRendering())
         if (!isRendering())
@@ -62,13 +62,13 @@ public class PanelWidget extends WidgetWithBounds {
         int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height;
         int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height;
         int xTextureOffset = getXTextureOffset();
         int xTextureOffset = getXTextureOffset();
         int yTextureOffset = getYTextureOffset();
         int yTextureOffset = getYTextureOffset();
-        
+
         //Four Corners
         //Four Corners
         this.blit(x, y, 106 + xTextureOffset, 124 + yTextureOffset, 4, 4);
         this.blit(x, y, 106 + xTextureOffset, 124 + yTextureOffset, 4, 4);
         this.blit(x + width - 4, y, 252 + xTextureOffset, 124 + yTextureOffset, 4, 4);
         this.blit(x + width - 4, y, 252 + xTextureOffset, 124 + yTextureOffset, 4, 4);
         this.blit(x, y + height - 4, 106 + xTextureOffset, 186 + yTextureOffset, 4, 4);
         this.blit(x, y + height - 4, 106 + xTextureOffset, 186 + yTextureOffset, 4, 4);
         this.blit(x + width - 4, y + height - 4, 252 + xTextureOffset, 186 + yTextureOffset, 4, 4);
         this.blit(x + width - 4, y + height - 4, 252 + xTextureOffset, 186 + yTextureOffset, 4, 4);
-        
+
         //Sides
         //Sides
         for (int xx = 4; xx < width - 4; xx += 128) {
         for (int xx = 4; xx < width - 4; xx += 128) {
             int thisWidth = Math.min(128, width - 4 - xx);
             int thisWidth = Math.min(128, width - 4 - xx);
@@ -82,21 +82,21 @@ public class PanelWidget extends WidgetWithBounds {
         }
         }
         fillGradient(x + 4, y + 4, x + width - 4, y + height - 4, getInnerColor(), getInnerColor());
         fillGradient(x + 4, y + 4, x + width - 4, y + height - 4, getInnerColor(), getInnerColor());
     }
     }
-    
+
     protected boolean isRendering() {
     protected boolean isRendering() {
         return ConfigObject.getInstance().getRecipeScreenType() != RecipeScreenType.VILLAGER;
         return ConfigObject.getInstance().getRecipeScreenType() != RecipeScreenType.VILLAGER;
     }
     }
-    
+
     protected int getInnerColor() {
     protected int getInnerColor() {
         return ScreenHelper.isDarkModeEnabled() ? -13750738 : -3750202;
         return ScreenHelper.isDarkModeEnabled() ? -13750738 : -3750202;
     }
     }
-    
+
     protected int getXTextureOffset() {
     protected int getXTextureOffset() {
         return 0;
         return 0;
     }
     }
-    
+
     protected int getYTextureOffset() {
     protected int getYTextureOffset() {
         return ConfigObject.getInstance().isUsingLightGrayRecipeBorder() ? 0 : 66;
         return ConfigObject.getInstance().isUsingLightGrayRecipeBorder() ? 0 : 66;
     }
     }
-    
+
 }
 }

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

@@ -14,57 +14,57 @@ import java.util.List;
 import java.util.function.Consumer;
 import java.util.function.Consumer;
 
 
 public class QueuedTooltip {
 public class QueuedTooltip {
-    
+
     private Point location;
     private Point location;
     private List<String> text;
     private List<String> text;
     private Consumer<QueuedTooltip> consumer = null;
     private Consumer<QueuedTooltip> consumer = null;
-    
+
     private QueuedTooltip(Point location, List<String> text) {
     private QueuedTooltip(Point location, List<String> text) {
         this.location = location;
         this.location = location;
         this.text = Lists.newArrayList(text);
         this.text = Lists.newArrayList(text);
     }
     }
-    
+
     public static QueuedTooltip create(Point location, List<String> text) {
     public static QueuedTooltip create(Point location, List<String> text) {
         return new QueuedTooltip(location, text);
         return new QueuedTooltip(location, text);
     }
     }
-    
+
     public static QueuedTooltip create(Point location, String... text) {
     public static QueuedTooltip create(Point location, String... text) {
         return QueuedTooltip.create(location, Lists.newArrayList(text));
         return QueuedTooltip.create(location, Lists.newArrayList(text));
     }
     }
-    
+
     public static QueuedTooltip create(List<String> text) {
     public static QueuedTooltip create(List<String> text) {
         return QueuedTooltip.create(PointHelper.fromMouse(), text);
         return QueuedTooltip.create(PointHelper.fromMouse(), text);
     }
     }
-    
+
     public static QueuedTooltip create(String... text) {
     public static QueuedTooltip create(String... text) {
         return QueuedTooltip.create(PointHelper.fromMouse(), text);
         return QueuedTooltip.create(PointHelper.fromMouse(), text);
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public QueuedTooltip setSpecialRenderer(Consumer<QueuedTooltip> consumer) {
     public QueuedTooltip setSpecialRenderer(Consumer<QueuedTooltip> consumer) {
         this.consumer = consumer;
         this.consumer = consumer;
         return this;
         return this;
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public Consumer<QueuedTooltip> getConsumer() {
     public Consumer<QueuedTooltip> getConsumer() {
         return consumer;
         return consumer;
     }
     }
-    
+
     public Point getLocation() {
     public Point getLocation() {
         return location;
         return location;
     }
     }
-    
+
     public int getX() {
     public int getX() {
         return getLocation().x;
         return getLocation().x;
     }
     }
-    
+
     public int getY() {
     public int getY() {
         return getLocation().y;
         return getLocation().y;
     }
     }
-    
+
     public List<String> getText() {
     public List<String> getText() {
         return text;
         return text;
     }
     }
-    
+
 }
 }

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

@@ -15,21 +15,21 @@ import java.util.Collections;
 import java.util.List;
 import java.util.List;
 
 
 public class RecipeArrowWidget extends WidgetWithBounds {
 public class RecipeArrowWidget extends WidgetWithBounds {
-    
+
     private int x, y;
     private int x, y;
     private boolean animated;
     private boolean animated;
-    
+
     public RecipeArrowWidget(int x, int y, boolean animated) {
     public RecipeArrowWidget(int x, int y, boolean animated) {
         this.x = x;
         this.x = x;
         this.y = y;
         this.y = y;
         this.animated = animated;
         this.animated = animated;
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getBounds() {
     public Rectangle getBounds() {
         return new Rectangle(x, y, 24, 17);
         return new Rectangle(x, y, 24, 17);
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
         MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
         MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
@@ -39,7 +39,7 @@ public class RecipeArrowWidget extends WidgetWithBounds {
             blit(x, y, 82, 91, width, 17);
             blit(x, y, 82, 91, width, 17);
         }
         }
     }
     }
-    
+
     @Override
     @Override
     public List<? extends Element> children() {
     public List<? extends Element> children() {
         return Collections.emptyList();
         return Collections.emptyList();

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

@@ -9,14 +9,14 @@ import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.ConfigObject;
 import me.shedaniel.rei.api.ConfigObject;
 
 
 public class RecipeBaseWidget extends PanelWidget {
 public class RecipeBaseWidget extends PanelWidget {
-    
+
     public RecipeBaseWidget(Rectangle bounds) {
     public RecipeBaseWidget(Rectangle bounds) {
         super(bounds);
         super(bounds);
     }
     }
-    
+
     @Override
     @Override
     protected int getYTextureOffset() {
     protected int getYTextureOffset() {
         return ConfigObject.getInstance().isUsingLightGrayRecipeBorder() ? 0 : 66;
         return ConfigObject.getInstance().isUsingLightGrayRecipeBorder() ? 0 : 66;
     }
     }
-    
+
 }
 }

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

@@ -21,7 +21,7 @@ import java.util.List;
 import java.util.Optional;
 import java.util.Optional;
 
 
 public class RecipeChoosePageWidget extends DraggableWidget {
 public class RecipeChoosePageWidget extends DraggableWidget {
-    
+
     private int currentPage;
     private int currentPage;
     private int maxPage;
     private int maxPage;
     private Rectangle bounds, grabBounds, dragBounds;
     private Rectangle bounds, grabBounds, dragBounds;
@@ -30,7 +30,7 @@ public class RecipeChoosePageWidget extends DraggableWidget {
     private TextFieldWidget textFieldWidget;
     private TextFieldWidget textFieldWidget;
     private CategoryBaseWidget base1, base2;
     private CategoryBaseWidget base1, base2;
     private ButtonWidget btnDone;
     private ButtonWidget btnDone;
-    
+
     public RecipeChoosePageWidget(RecipeViewingScreen recipeViewingScreen, int currentPage, int maxPage) {
     public RecipeChoosePageWidget(RecipeViewingScreen recipeViewingScreen, int currentPage, int maxPage) {
         super(getPointFromConfig());
         super(getPointFromConfig());
         this.recipeViewingScreen = recipeViewingScreen;
         this.recipeViewingScreen = recipeViewingScreen;
@@ -38,32 +38,32 @@ public class RecipeChoosePageWidget extends DraggableWidget {
         this.maxPage = maxPage;
         this.maxPage = maxPage;
         initWidgets(getMidPoint());
         initWidgets(getMidPoint());
     }
     }
-    
+
     private static Point getPointFromConfig() {
     private static Point getPointFromConfig() {
         Window window = MinecraftClient.getInstance().getWindow();
         Window window = MinecraftClient.getInstance().getWindow();
         return new Point(window.getScaledWidth() * .5, window.getScaledHeight() * .5);
         return new Point(window.getScaledWidth() * .5, window.getScaledHeight() * .5);
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getBounds() {
     public Rectangle getBounds() {
         return bounds;
         return bounds;
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getGrabBounds() {
     public Rectangle getGrabBounds() {
         return grabBounds;
         return grabBounds;
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getDragBounds() {
     public Rectangle getDragBounds() {
         return dragBounds;
         return dragBounds;
     }
     }
-    
+
     @Override
     @Override
     public boolean containsMouse(double mouseX, double mouseY) {
     public boolean containsMouse(double mouseX, double mouseY) {
         return getBounds().contains(mouseX, mouseY) || new Rectangle(bounds.x + bounds.width - 50, bounds.y + bounds.height - 3, 50, 36).contains(mouseX, mouseY);
         return getBounds().contains(mouseX, mouseY) || new Rectangle(bounds.x + bounds.width - 50, bounds.y + bounds.height - 3, 50, 36).contains(mouseX, mouseY);
     }
     }
-    
+
     @Override
     @Override
     public void updateWidgets(Point midPoint) {
     public void updateWidgets(Point midPoint) {
         this.bounds = new Rectangle(midPoint.x - 50, midPoint.y - 20, 100, 40);
         this.bounds = new Rectangle(midPoint.x - 50, midPoint.y - 20, 100, 40);
@@ -74,7 +74,7 @@ public class RecipeChoosePageWidget extends DraggableWidget {
         textFieldWidget.getBounds().setLocation(bounds.x + 7, bounds.y + 16);
         textFieldWidget.getBounds().setLocation(bounds.x + 7, bounds.y + 16);
         btnDone.getBounds().setLocation(bounds.x + bounds.width - 45, bounds.y + bounds.height + 3);
         btnDone.getBounds().setLocation(bounds.x + bounds.width - 45, bounds.y + bounds.height + 3);
     }
     }
-    
+
     @Override
     @Override
     protected void initWidgets(Point midPoint) {
     protected void initWidgets(Point midPoint) {
         this.bounds = new Rectangle(midPoint.x - 50, midPoint.y - 20, 100, 40);
         this.bounds = new Rectangle(midPoint.x - 50, midPoint.y - 20, 100, 40);
@@ -88,7 +88,7 @@ public class RecipeChoosePageWidget extends DraggableWidget {
             public List<Widget> children() {
             public List<Widget> children() {
                 return Collections.emptyList();
                 return Collections.emptyList();
             }
             }
-            
+
             @Override
             @Override
             public void render(int i, int i1, float v) {
             public void render(int i, int i1, float v) {
                 font.draw(I18n.translate("text.rei.choose_page"), bounds.x + 5, bounds.y + 5, ScreenHelper.isDarkModeEnabled() ? 0xFFBBBBBB : 0xFF404040);
                 font.draw(I18n.translate("text.rei.choose_page"), bounds.x + 5, bounds.y + 5, ScreenHelper.isDarkModeEnabled() ? 0xFFBBBBBB : 0xFF404040);
@@ -105,13 +105,13 @@ public class RecipeChoosePageWidget extends DraggableWidget {
             StringBuilder stringBuilder_1 = new StringBuilder();
             StringBuilder stringBuilder_1 = new StringBuilder();
             char[] var2 = s.toCharArray();
             char[] var2 = s.toCharArray();
             int var3 = var2.length;
             int var3 = var2.length;
-            
+
             for (int var4 = 0; var4 < var3; ++var4) {
             for (int var4 = 0; var4 < var3; ++var4) {
                 char char_1 = var2[var4];
                 char char_1 = var2[var4];
                 if (Character.isDigit(char_1))
                 if (Character.isDigit(char_1))
                     stringBuilder_1.append(char_1);
                     stringBuilder_1.append(char_1);
             }
             }
-            
+
             return stringBuilder_1.toString();
             return stringBuilder_1.toString();
         };
         };
         textFieldWidget.setText(String.valueOf(currentPage + 1));
         textFieldWidget.setText(String.valueOf(currentPage + 1));
@@ -125,26 +125,26 @@ public class RecipeChoosePageWidget extends DraggableWidget {
         });
         });
         textFieldWidget.setFocused(true);
         textFieldWidget.setFocused(true);
     }
     }
-    
+
     @Override
     @Override
     public Point processMidPoint(Point midPoint, Point mouse, Point startPoint, Window window, int relateX, int relateY) {
     public Point processMidPoint(Point midPoint, Point mouse, Point startPoint, Window window, int relateX, int relateY) {
         return new Point(MathHelper.clamp(mouse.x - relateX, getDragBounds().width / 2, window.getScaledWidth() - getDragBounds().width / 2), MathHelper.clamp(mouse.y - relateY, 20, window.getScaledHeight() - 50));
         return new Point(MathHelper.clamp(mouse.x - relateX, getDragBounds().width / 2, window.getScaledWidth() - getDragBounds().width / 2), MathHelper.clamp(mouse.y - relateY, 20, window.getScaledHeight() - 50));
     }
     }
-    
+
     @Override
     @Override
     public List<Widget> children() {
     public List<Widget> children() {
         return widgets;
         return widgets;
     }
     }
-    
+
     @Override
     @Override
     public void render(int i, int i1, float v) {
     public void render(int i, int i1, float v) {
         RenderSystem.translatef(0, 0, 800);
         RenderSystem.translatef(0, 0, 800);
-        for(Widget widget : widgets) {
+        for (Widget widget : widgets) {
             widget.render(i, i1, v);
             widget.render(i, i1, v);
         }
         }
         RenderSystem.translatef(0, 0, -800);
         RenderSystem.translatef(0, 0, -800);
     }
     }
-    
+
     @Override
     @Override
     public boolean charTyped(char char_1, int int_1) {
     public boolean charTyped(char char_1, int int_1) {
         for (Widget widget : widgets)
         for (Widget widget : widgets)
@@ -152,7 +152,7 @@ public class RecipeChoosePageWidget extends DraggableWidget {
                 return true;
                 return true;
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (int_1 == 335 || int_1 == 257) {
         if (int_1 == 335 || int_1 == 257) {
@@ -166,7 +166,7 @@ public class RecipeChoosePageWidget extends DraggableWidget {
                 return true;
                 return true;
         return false;
         return false;
     }
     }
-    
+
     public Optional<Integer> getIntFromString(String s) {
     public Optional<Integer> getIntFromString(String s) {
         try {
         try {
             return Optional.of(Integer.valueOf(s));
             return Optional.of(Integer.valueOf(s));
@@ -174,9 +174,9 @@ public class RecipeChoosePageWidget extends DraggableWidget {
         }
         }
         return Optional.empty();
         return Optional.empty();
     }
     }
-    
+
     @Override
     @Override
     public void onMouseReleaseMidPoint(Point midPoint) {
     public void onMouseReleaseMidPoint(Point midPoint) {
     }
     }
-    
+
 }
 }

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

@@ -9,24 +9,24 @@ import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.impl.ScreenHelper;
 import me.shedaniel.rei.impl.ScreenHelper;
 
 
 public class SlotBaseWidget extends RecipeBaseWidget {
 public class SlotBaseWidget extends RecipeBaseWidget {
-    
+
     public SlotBaseWidget(Rectangle bounds) {
     public SlotBaseWidget(Rectangle bounds) {
         super(bounds);
         super(bounds);
     }
     }
-    
+
     @Override
     @Override
     public int getInnerColor() {
     public int getInnerColor() {
         return ScreenHelper.isDarkModeEnabled() ? -13619152 : -7631989;
         return ScreenHelper.isDarkModeEnabled() ? -13619152 : -7631989;
     }
     }
-    
+
     @Override
     @Override
     protected int getYTextureOffset() {
     protected int getYTextureOffset() {
         return -66;
         return -66;
     }
     }
-    
+
     @Override
     @Override
     protected boolean isRendering() {
     protected boolean isRendering() {
         return true;
         return true;
     }
     }
-    
+
 }
 }

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

@@ -17,22 +17,22 @@ import java.util.Collections;
 import java.util.List;
 import java.util.List;
 
 
 public class TabWidget extends WidgetWithBounds {
 public class TabWidget extends WidgetWithBounds {
-    
+
     public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     public static final Identifier CHEST_GUI_TEXTURE_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
     public static final Identifier CHEST_GUI_TEXTURE_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
-    
+
     public boolean shown = false, selected = false;
     public boolean shown = false, selected = false;
     public EntryStack logo;
     public EntryStack logo;
     public int id;
     public int id;
     public String categoryName;
     public String categoryName;
     public Rectangle bounds;
     public Rectangle bounds;
     public RecipeCategory category;
     public RecipeCategory category;
-    
+
     public TabWidget(int id, Rectangle bounds) {
     public TabWidget(int id, Rectangle bounds) {
         this.id = id;
         this.id = id;
         this.bounds = bounds;
         this.bounds = bounds;
     }
     }
-    
+
     public void setRenderer(RecipeCategory category, EntryStack logo, String categoryName, boolean selected) {
     public void setRenderer(RecipeCategory category, EntryStack logo, String categoryName, boolean selected) {
         if (logo == null) {
         if (logo == null) {
             shown = false;
             shown = false;
@@ -45,24 +45,24 @@ public class TabWidget extends WidgetWithBounds {
         this.selected = selected;
         this.selected = selected;
         this.categoryName = categoryName;
         this.categoryName = categoryName;
     }
     }
-    
+
     public boolean isSelected() {
     public boolean isSelected() {
         return selected;
         return selected;
     }
     }
-    
+
     public int getId() {
     public int getId() {
         return id;
         return id;
     }
     }
-    
+
     public boolean isShown() {
     public boolean isShown() {
         return shown;
         return shown;
     }
     }
-    
+
     @Override
     @Override
     public List<Widget> children() {
     public List<Widget> children() {
         return Collections.emptyList();
         return Collections.emptyList();
     }
     }
-    
+
     @Override
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     public void render(int mouseX, int mouseY, float delta) {
         if (shown) {
         if (shown) {
@@ -75,7 +75,7 @@ public class TabWidget extends WidgetWithBounds {
             }
             }
         }
         }
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     private void drawTooltip() {
     private void drawTooltip() {
         if (this.minecraft.options.advancedItemTooltips)
         if (this.minecraft.options.advancedItemTooltips)
@@ -83,10 +83,10 @@ public class TabWidget extends WidgetWithBounds {
         else
         else
             ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(categoryName, ClientHelper.getInstance().getFormattedModFromIdentifier(category.getIdentifier())));
             ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(categoryName, ClientHelper.getInstance().getFormattedModFromIdentifier(category.getIdentifier())));
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getBounds() {
     public Rectangle getBounds() {
         return bounds;
         return bounds;
     }
     }
-    
+
 }
 }

+ 88 - 88
src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java

@@ -27,7 +27,7 @@ import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.function.Predicate;
 
 
 public class TextFieldWidget extends WidgetWithBounds implements Tickable {
 public class TextFieldWidget extends WidgetWithBounds implements Tickable {
-    
+
     public Function<String, String> stripInvaild;
     public Function<String, String> stripInvaild;
     protected int focusedTicks;
     protected int focusedTicks;
     protected boolean editable;
     protected boolean editable;
@@ -48,7 +48,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
     private String suggestion;
     private String suggestion;
     private Consumer<String> changedListener;
     private Consumer<String> changedListener;
     private Predicate<String> textPredicate;
     private Predicate<String> textPredicate;
-    
+
     public TextFieldWidget(Rectangle rectangle) {
     public TextFieldWidget(Rectangle rectangle) {
         this.text = "";
         this.text = "";
         this.maxLength = 32;
         this.maxLength = 32;
@@ -65,41 +65,41 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
         this.bounds = rectangle;
         this.bounds = rectangle;
         this.stripInvaild = s -> SharedConstants.stripInvalidChars(s);
         this.stripInvaild = s -> SharedConstants.stripInvalidChars(s);
     }
     }
-    
+
     public TextFieldWidget(int x, int y, int width, int height) {
     public TextFieldWidget(int x, int y, int width, int height) {
         this(new Rectangle(x, y, width, height));
         this(new Rectangle(x, y, width, height));
     }
     }
-    
+
     public String getSuggestion() {
     public String getSuggestion() {
         return suggestion;
         return suggestion;
     }
     }
-    
+
     public void setSuggestion(String string_1) {
     public void setSuggestion(String string_1) {
         this.suggestion = string_1;
         this.suggestion = string_1;
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getBounds() {
     public Rectangle getBounds() {
         return bounds;
         return bounds;
     }
     }
-    
+
     public void setChangedListener(Consumer<String> biConsumer_1) {
     public void setChangedListener(Consumer<String> biConsumer_1) {
         this.changedListener = biConsumer_1;
         this.changedListener = biConsumer_1;
     }
     }
-    
+
     public void method_1854(BiFunction<String, Integer, String> biFunction_1) {
     public void method_1854(BiFunction<String, Integer, String> biFunction_1) {
         this.renderTextProvider = biFunction_1;
         this.renderTextProvider = biFunction_1;
     }
     }
-    
+
     @Override
     @Override
     public void tick() {
     public void tick() {
         ++this.focusedTicks;
         ++this.focusedTicks;
     }
     }
-    
+
     public String getText() {
     public String getText() {
         return this.text;
         return this.text;
     }
     }
-    
+
     public void setText(String string_1) {
     public void setText(String string_1) {
         if (this.textPredicate.test(string_1)) {
         if (this.textPredicate.test(string_1)) {
             if (string_1.length() > this.maxLength) {
             if (string_1.length() > this.maxLength) {
@@ -107,22 +107,22 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             } else {
             } else {
                 this.text = string_1;
                 this.text = string_1;
             }
             }
-            
+
             this.onChanged(string_1);
             this.onChanged(string_1);
             this.method_1872();
             this.method_1872();
         }
         }
     }
     }
-    
+
     public String getSelectedText() {
     public String getSelectedText() {
         int int_1 = this.cursorMax < this.cursorMin ? this.cursorMax : this.cursorMin;
         int int_1 = this.cursorMax < this.cursorMin ? this.cursorMax : this.cursorMin;
         int int_2 = this.cursorMax < this.cursorMin ? this.cursorMin : this.cursorMax;
         int int_2 = this.cursorMax < this.cursorMin ? this.cursorMin : this.cursorMax;
         return this.text.substring(int_1, int_2);
         return this.text.substring(int_1, int_2);
     }
     }
-    
+
     public void method_1890(Predicate<String> predicate_1) {
     public void method_1890(Predicate<String> predicate_1) {
         this.textPredicate = predicate_1;
         this.textPredicate = predicate_1;
     }
     }
-    
+
     public void addText(String string_1) {
     public void addText(String string_1) {
         String string_2 = "";
         String string_2 = "";
         String string_3 = stripInvaild.apply(string_1);
         String string_3 = stripInvaild.apply(string_1);
@@ -132,7 +132,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
         if (!this.text.isEmpty()) {
         if (!this.text.isEmpty()) {
             string_2 = string_2 + this.text.substring(0, int_1);
             string_2 = string_2 + this.text.substring(0, int_1);
         }
         }
-        
+
         int int_5;
         int int_5;
         if (int_3 < string_3.length()) {
         if (int_3 < string_3.length()) {
             string_2 = string_2 + string_3.substring(0, int_3);
             string_2 = string_2 + string_3.substring(0, int_3);
@@ -141,11 +141,11 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             string_2 = string_2 + string_3;
             string_2 = string_2 + string_3;
             int_5 = string_3.length();
             int_5 = string_3.length();
         }
         }
-        
+
         if (!this.text.isEmpty() && int_2 < this.text.length()) {
         if (!this.text.isEmpty() && int_2 < this.text.length()) {
             string_2 = string_2 + this.text.substring(int_2);
             string_2 = string_2 + this.text.substring(int_2);
         }
         }
-        
+
         if (this.textPredicate.test(string_2)) {
         if (this.textPredicate.test(string_2)) {
             this.text = string_2;
             this.text = string_2;
             this.setCursor(int_1 + int_5);
             this.setCursor(int_1 + int_5);
@@ -153,23 +153,23 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             this.onChanged(this.text);
             this.onChanged(this.text);
         }
         }
     }
     }
-    
+
     public void onChanged(String string_1) {
     public void onChanged(String string_1) {
         if (this.changedListener != null) {
         if (this.changedListener != null) {
             this.changedListener.accept(string_1);
             this.changedListener.accept(string_1);
         }
         }
-        
+
     }
     }
-    
+
     private void method_16873(int int_1) {
     private void method_16873(int int_1) {
         if (Screen.hasControlDown()) {
         if (Screen.hasControlDown()) {
             this.method_1877(int_1);
             this.method_1877(int_1);
         } else {
         } else {
             this.method_1878(int_1);
             this.method_1878(int_1);
         }
         }
-        
+
     }
     }
-    
+
     public void method_1877(int int_1) {
     public void method_1877(int int_1) {
         if (!this.text.isEmpty()) {
         if (!this.text.isEmpty()) {
             if (this.cursorMin != this.cursorMax) {
             if (this.cursorMin != this.cursorMax) {
@@ -179,7 +179,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             }
             }
         }
         }
     }
     }
-    
+
     public void method_1878(int int_1) {
     public void method_1878(int int_1) {
         if (!this.text.isEmpty()) {
         if (!this.text.isEmpty()) {
             if (this.cursorMin != this.cursorMax) {
             if (this.cursorMin != this.cursorMax) {
@@ -192,36 +192,36 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
                 if (int_2 >= 0) {
                 if (int_2 >= 0) {
                     string_1 = this.text.substring(0, int_2);
                     string_1 = this.text.substring(0, int_2);
                 }
                 }
-                
+
                 if (int_3 < this.text.length()) {
                 if (int_3 < this.text.length()) {
                     string_1 = string_1 + this.text.substring(int_3);
                     string_1 = string_1 + this.text.substring(int_3);
                 }
                 }
-                
+
                 if (this.textPredicate.test(string_1)) {
                 if (this.textPredicate.test(string_1)) {
                     this.text = string_1;
                     this.text = string_1;
                     if (boolean_1) {
                     if (boolean_1) {
                         this.moveCursor(int_1);
                         this.moveCursor(int_1);
                     }
                     }
-                    
+
                     this.onChanged(this.text);
                     this.onChanged(this.text);
                 }
                 }
             }
             }
         }
         }
     }
     }
-    
+
     public int method_1853(int int_1) {
     public int method_1853(int int_1) {
         return this.method_1869(int_1, this.getCursor());
         return this.method_1869(int_1, this.getCursor());
     }
     }
-    
+
     public int method_1869(int int_1, int int_2) {
     public int method_1869(int int_1, int int_2) {
         return this.method_1864(int_1, int_2, true);
         return this.method_1864(int_1, int_2, true);
     }
     }
-    
+
     public int method_1864(int int_1, int int_2, boolean boolean_1) {
     public int method_1864(int int_1, int int_2, boolean boolean_1) {
         int int_3 = int_2;
         int int_3 = int_2;
         boolean boolean_2 = int_1 < 0;
         boolean boolean_2 = int_1 < 0;
         int int_4 = Math.abs(int_1);
         int int_4 = Math.abs(int_1);
-        
+
         for (int int_5 = 0; int_5 < int_4; ++int_5) {
         for (int int_5 = 0; int_5 < int_4; ++int_5) {
             if (!boolean_2) {
             if (!boolean_2) {
                 int int_6 = this.text.length();
                 int int_6 = this.text.length();
@@ -237,37 +237,37 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
                 while (boolean_1 && int_3 > 0 && this.text.charAt(int_3 - 1) == ' ') {
                 while (boolean_1 && int_3 > 0 && this.text.charAt(int_3 - 1) == ' ') {
                     --int_3;
                     --int_3;
                 }
                 }
-                
+
                 while (int_3 > 0 && this.text.charAt(int_3 - 1) != ' ') {
                 while (int_3 > 0 && this.text.charAt(int_3 - 1) != ' ') {
                     --int_3;
                     --int_3;
                 }
                 }
             }
             }
         }
         }
-        
+
         return int_3;
         return int_3;
     }
     }
-    
+
     public void moveCursor(int int_1) {
     public void moveCursor(int int_1) {
         this.method_1883(this.cursorMax + int_1);
         this.method_1883(this.cursorMax + int_1);
     }
     }
-    
+
     public void method_1883(int int_1) {
     public void method_1883(int int_1) {
         this.setCursor(int_1);
         this.setCursor(int_1);
         if (!this.field_17037) {
         if (!this.field_17037) {
             this.method_1884(this.cursorMax);
             this.method_1884(this.cursorMax);
         }
         }
-        
+
         this.onChanged(this.text);
         this.onChanged(this.text);
     }
     }
-    
+
     public void method_1870() {
     public void method_1870() {
         this.method_1883(0);
         this.method_1883(0);
     }
     }
-    
+
     public void method_1872() {
     public void method_1872() {
         this.method_1883(this.text.length());
         this.method_1883(this.text.length());
     }
     }
-    
+
     public boolean keyPressed(int int_1, int int_2, int int_3) {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (this.isVisible() && this.isFocused()) {
         if (this.isVisible() && this.isFocused()) {
             this.field_17037 = Screen.hasShiftDown();
             this.field_17037 = Screen.hasShiftDown();
@@ -282,14 +282,14 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
                 if (this.editable) {
                 if (this.editable) {
                     this.addText(minecraft.keyboard.getClipboard());
                     this.addText(minecraft.keyboard.getClipboard());
                 }
                 }
-                
+
                 return true;
                 return true;
             } else if (Screen.isCut(int_1)) {
             } else if (Screen.isCut(int_1)) {
                 minecraft.keyboard.setClipboard(this.getSelectedText());
                 minecraft.keyboard.setClipboard(this.getSelectedText());
                 if (this.editable) {
                 if (this.editable) {
                     this.addText("");
                     this.addText("");
                 }
                 }
-                
+
                 return true;
                 return true;
             } else {
             } else {
                 switch (int_1) {
                 switch (int_1) {
@@ -297,7 +297,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
                         if (this.editable) {
                         if (this.editable) {
                             this.method_16873(-1);
                             this.method_16873(-1);
                         }
                         }
-                        
+
                         return true;
                         return true;
                     case 260:
                     case 260:
                     case 264:
                     case 264:
@@ -310,7 +310,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
                         if (this.editable) {
                         if (this.editable) {
                             this.method_16873(1);
                             this.method_16873(1);
                         }
                         }
-                        
+
                         return true;
                         return true;
                     case 262:
                     case 262:
                         if (Screen.hasControlDown()) {
                         if (Screen.hasControlDown()) {
@@ -318,7 +318,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
                         } else {
                         } else {
                             this.moveCursor(1);
                             this.moveCursor(1);
                         }
                         }
-                        
+
                         return true;
                         return true;
                     case 263:
                     case 263:
                         if (Screen.hasControlDown()) {
                         if (Screen.hasControlDown()) {
@@ -326,7 +326,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
                         } else {
                         } else {
                             this.moveCursor(-1);
                             this.moveCursor(-1);
                         }
                         }
-                        
+
                         return true;
                         return true;
                     case 268:
                     case 268:
                         this.method_1870();
                         this.method_1870();
@@ -340,7 +340,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             return false;
             return false;
         }
         }
     }
     }
-    
+
     @Override
     @Override
     public boolean charTyped(char char_1, int int_1) {
     public boolean charTyped(char char_1, int int_1) {
         if (this.isVisible() && this.isFocused()) {
         if (this.isVisible() && this.isFocused()) {
@@ -348,7 +348,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
                 if (this.editable) {
                 if (this.editable) {
                     this.addText(Character.toString(char_1));
                     this.addText(Character.toString(char_1));
                 }
                 }
-                
+
                 return true;
                 return true;
             } else {
             } else {
                 return false;
                 return false;
@@ -357,12 +357,12 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             return false;
             return false;
         }
         }
     }
     }
-    
+
     @Override
     @Override
     public List<Widget> children() {
     public List<Widget> children() {
         return Collections.emptyList();
         return Collections.emptyList();
     }
     }
-    
+
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
         if (!this.isVisible()) {
         if (!this.isVisible()) {
             return false;
             return false;
@@ -371,13 +371,13 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             if (this.field_2096) {
             if (this.field_2096) {
                 this.setFocused(boolean_1);
                 this.setFocused(boolean_1);
             }
             }
-            
+
             if (this.focused && boolean_1 && int_1 == 0) {
             if (this.focused && boolean_1 && int_1 == 0) {
                 int int_2 = MathHelper.floor(double_1) - this.bounds.x;
                 int int_2 = MathHelper.floor(double_1) - this.bounds.x;
                 if (this.hasBorder) {
                 if (this.hasBorder) {
                     int_2 -= 4;
                     int_2 -= 4;
                 }
                 }
-                
+
                 String string_1 = this.font.trimToWidth(this.text.substring(this.field_2103), this.getWidth());
                 String string_1 = this.font.trimToWidth(this.text.substring(this.field_2103), this.getWidth());
                 this.method_1883(this.font.trimToWidth(string_1, int_2).length() + this.field_2103);
                 this.method_1883(this.font.trimToWidth(string_1, int_2).length() + this.field_2103);
                 return true;
                 return true;
@@ -386,7 +386,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             }
             }
         }
         }
     }
     }
-    
+
     public void renderBorder() {
     public void renderBorder() {
         if (this.hasBorder()) {
         if (this.hasBorder()) {
             if (containsMouse(PointHelper.fromMouse()) || focused)
             if (containsMouse(PointHelper.fromMouse()) || focused)
@@ -396,11 +396,11 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             fill(this.bounds.x, this.bounds.y, this.bounds.x + this.bounds.width, this.bounds.y + this.bounds.height, -16777216);
             fill(this.bounds.x, this.bounds.y, this.bounds.x + this.bounds.width, this.bounds.y + this.bounds.height, -16777216);
         }
         }
     }
     }
-    
+
     public void render(int int_1, int int_2, float float_1) {
     public void render(int int_1, int int_2, float float_1) {
         if (this.isVisible()) {
         if (this.isVisible()) {
             renderBorder();
             renderBorder();
-            
+
             int color = this.editable ? this.editableColor : this.notEditableColor;
             int color = this.editable ? this.editableColor : this.notEditableColor;
             int int_4 = this.cursorMax - this.field_2103;
             int int_4 = this.cursorMax - this.field_2103;
             int int_5 = this.cursorMin - this.field_2103;
             int int_5 = this.cursorMin - this.field_2103;
@@ -413,12 +413,12 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             if (int_5 > string_1.length()) {
             if (int_5 > string_1.length()) {
                 int_5 = string_1.length();
                 int_5 = string_1.length();
             }
             }
-            
+
             if (!string_1.isEmpty()) {
             if (!string_1.isEmpty()) {
                 String string_2 = boolean_1 ? string_1.substring(0, int_4) : string_1;
                 String string_2 = boolean_1 ? string_1.substring(0, int_4) : string_1;
                 int_8 = this.font.drawWithShadow((String) this.renderTextProvider.apply(string_2, this.field_2103), (float) int_6, (float) int_7, color);
                 int_8 = this.font.drawWithShadow((String) this.renderTextProvider.apply(string_2, this.field_2103), (float) int_6, (float) int_7, color);
             }
             }
-            
+
             boolean boolean_3 = this.cursorMax < this.text.length() || this.text.length() >= this.getMaxLength();
             boolean boolean_3 = this.cursorMax < this.text.length() || this.text.length() >= this.getMaxLength();
             int int_9 = int_8;
             int int_9 = int_8;
             if (!boolean_1) {
             if (!boolean_1) {
@@ -427,15 +427,15 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
                 int_9 = int_8 - 1;
                 int_9 = int_8 - 1;
                 --int_8;
                 --int_8;
             }
             }
-            
+
             if (!string_1.isEmpty() && boolean_1 && int_4 < string_1.length()) {
             if (!string_1.isEmpty() && boolean_1 && int_4 < string_1.length()) {
                 this.font.drawWithShadow((String) this.renderTextProvider.apply(string_1.substring(int_4), this.cursorMax), (float) int_8, (float) int_7, color);
                 this.font.drawWithShadow((String) this.renderTextProvider.apply(string_1.substring(int_4), this.cursorMax), (float) int_8, (float) int_7, color);
             }
             }
-            
+
             if (!boolean_3 && text.isEmpty() && this.suggestion != null) {
             if (!boolean_3 && text.isEmpty() && this.suggestion != null) {
                 this.font.drawWithShadow(this.font.trimToWidth(this.suggestion, this.getWidth()), (float) int_6, (float) int_7, -8355712);
                 this.font.drawWithShadow(this.font.trimToWidth(this.suggestion, this.getWidth()), (float) int_6, (float) int_7, -8355712);
             }
             }
-            
+
             int var10002;
             int var10002;
             int var10003;
             int var10003;
             if (boolean_2) {
             if (boolean_2) {
@@ -449,7 +449,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
                     this.font.drawWithShadow("_", (float) int_9, (float) int_7, color);
                     this.font.drawWithShadow("_", (float) int_9, (float) int_7, color);
                 }
                 }
             }
             }
-            
+
             if (int_5 != int_4) {
             if (int_5 != int_4) {
                 int int_10 = int_6 + this.font.getStringWidth(string_1.substring(0, int_5));
                 int int_10 = int_6 + this.font.getStringWidth(string_1.substring(0, int_5));
                 var10002 = int_7 - 1;
                 var10002 = int_7 - 1;
@@ -459,7 +459,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             }
             }
         }
         }
     }
     }
-    
+
     protected void method_1886(int int_1, int int_2, int int_3, int int_4) {
     protected void method_1886(int int_1, int int_2, int int_3, int int_4) {
         int int_6;
         int int_6;
         if (int_1 < int_3) {
         if (int_1 < int_3) {
@@ -467,21 +467,21 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             int_1 = int_3;
             int_1 = int_3;
             int_3 = int_6;
             int_3 = int_6;
         }
         }
-        
+
         if (int_2 < int_4) {
         if (int_2 < int_4) {
             int_6 = int_2;
             int_6 = int_2;
             int_2 = int_4;
             int_2 = int_4;
             int_4 = int_6;
             int_4 = int_6;
         }
         }
-        
+
         if (int_3 > this.bounds.x + this.bounds.width) {
         if (int_3 > this.bounds.x + this.bounds.width) {
             int_3 = this.bounds.x + this.bounds.width;
             int_3 = this.bounds.x + this.bounds.width;
         }
         }
-        
+
         if (int_1 > this.bounds.x + this.bounds.width) {
         if (int_1 > this.bounds.x + this.bounds.width) {
             int_1 = this.bounds.x + this.bounds.width;
             int_1 = this.bounds.x + this.bounds.width;
         }
         }
-        
+
         Tessellator tessellator_1 = Tessellator.getInstance();
         Tessellator tessellator_1 = Tessellator.getInstance();
         BufferBuilder bufferBuilder_1 = tessellator_1.getBuffer();
         BufferBuilder bufferBuilder_1 = tessellator_1.getBuffer();
         RenderSystem.color4f(0.0F, 0.0F, 255.0F, 255.0F);
         RenderSystem.color4f(0.0F, 0.0F, 255.0F, 255.0F);
@@ -497,11 +497,11 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
         RenderSystem.disableColorLogicOp();
         RenderSystem.disableColorLogicOp();
         RenderSystem.enableTexture();
         RenderSystem.enableTexture();
     }
     }
-    
+
     public int getMaxLength() {
     public int getMaxLength() {
         return this.maxLength;
         return this.maxLength;
     }
     }
-    
+
     public void setMaxLength(int int_1) {
     public void setMaxLength(int int_1) {
         this.maxLength = int_1;
         this.maxLength = int_1;
         if (this.text.length() > int_1) {
         if (this.text.length() > int_1) {
@@ -509,31 +509,31 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             this.onChanged(this.text);
             this.onChanged(this.text);
         }
         }
     }
     }
-    
+
     public int getCursor() {
     public int getCursor() {
         return this.cursorMax;
         return this.cursorMax;
     }
     }
-    
+
     public void setCursor(int int_1) {
     public void setCursor(int int_1) {
         this.cursorMax = MathHelper.clamp(int_1, 0, this.text.length());
         this.cursorMax = MathHelper.clamp(int_1, 0, this.text.length());
     }
     }
-    
+
     public boolean hasBorder() {
     public boolean hasBorder() {
         return this.hasBorder;
         return this.hasBorder;
     }
     }
-    
+
     public void setHasBorder(boolean boolean_1) {
     public void setHasBorder(boolean boolean_1) {
         this.hasBorder = boolean_1;
         this.hasBorder = boolean_1;
     }
     }
-    
+
     public void setEditableColor(int int_1) {
     public void setEditableColor(int int_1) {
         this.editableColor = int_1;
         this.editableColor = int_1;
     }
     }
-    
+
     public void setNotEditableColor(int int_1) {
     public void setNotEditableColor(int int_1) {
         this.notEditableColor = int_1;
         this.notEditableColor = int_1;
     }
     }
-    
+
     public boolean changeFocus(boolean boolean_1) {
     public boolean changeFocus(boolean boolean_1) {
         if (this.visible && this.editable) {
         if (this.visible && this.editable) {
             this.setFocused(!this.focused);
             this.setFocused(!this.focused);
@@ -541,25 +541,25 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
         }
         }
         return false;
         return false;
     }
     }
-    
+
     public boolean isFocused() {
     public boolean isFocused() {
         return this.focused;
         return this.focused;
     }
     }
-    
+
     public void setFocused(boolean boolean_1) {
     public void setFocused(boolean boolean_1) {
         if (boolean_1 && !this.focused)
         if (boolean_1 && !this.focused)
             this.focusedTicks = 0;
             this.focusedTicks = 0;
         this.focused = boolean_1;
         this.focused = boolean_1;
     }
     }
-    
+
     public void setIsEditable(boolean boolean_1) {
     public void setIsEditable(boolean boolean_1) {
         this.editable = boolean_1;
         this.editable = boolean_1;
     }
     }
-    
+
     public int getWidth() {
     public int getWidth() {
         return this.hasBorder() ? this.bounds.width - 8 : this.bounds.width;
         return this.hasBorder() ? this.bounds.width - 8 : this.bounds.width;
     }
     }
-    
+
     public void method_1884(int int_1) {
     public void method_1884(int int_1) {
         int int_2 = this.text.length();
         int int_2 = this.text.length();
         this.cursorMin = MathHelper.clamp(int_1, 0, int_2);
         this.cursorMin = MathHelper.clamp(int_1, 0, int_2);
@@ -567,39 +567,39 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             if (this.field_2103 > int_2) {
             if (this.field_2103 > int_2) {
                 this.field_2103 = int_2;
                 this.field_2103 = int_2;
             }
             }
-            
+
             int int_3 = this.getWidth();
             int int_3 = this.getWidth();
             String string_1 = this.font.trimToWidth(this.text.substring(this.field_2103), int_3);
             String string_1 = this.font.trimToWidth(this.text.substring(this.field_2103), int_3);
             int int_4 = string_1.length() + this.field_2103;
             int int_4 = string_1.length() + this.field_2103;
             if (this.cursorMin == this.field_2103) {
             if (this.cursorMin == this.field_2103) {
                 this.field_2103 -= this.font.trimToWidth(this.text, int_3, true).length();
                 this.field_2103 -= this.font.trimToWidth(this.text, int_3, true).length();
             }
             }
-            
+
             if (this.cursorMin > int_4) {
             if (this.cursorMin > int_4) {
                 this.field_2103 += this.cursorMin - int_4;
                 this.field_2103 += this.cursorMin - int_4;
             } else if (this.cursorMin <= this.field_2103) {
             } else if (this.cursorMin <= this.field_2103) {
                 this.field_2103 -= this.field_2103 - this.cursorMin;
                 this.field_2103 -= this.field_2103 - this.cursorMin;
             }
             }
-            
+
             this.field_2103 = MathHelper.clamp(this.field_2103, 0, int_2);
             this.field_2103 = MathHelper.clamp(this.field_2103, 0, int_2);
         }
         }
-        
+
     }
     }
-    
+
     public void method_1856(boolean boolean_1) {
     public void method_1856(boolean boolean_1) {
         this.field_2096 = boolean_1;
         this.field_2096 = boolean_1;
     }
     }
-    
+
     public boolean isVisible() {
     public boolean isVisible() {
         return this.visible;
         return this.visible;
     }
     }
-    
+
     public void setVisible(boolean boolean_1) {
     public void setVisible(boolean boolean_1) {
         this.visible = boolean_1;
         this.visible = boolean_1;
     }
     }
-    
+
     public int method_1889(int int_1) {
     public int method_1889(int int_1) {
         return int_1 > this.text.length() ? this.bounds.x : this.bounds.x + this.font.getStringWidth(this.text.substring(0, int_1));
         return int_1 > this.text.length() ? this.bounds.x : this.bounds.x + this.font.getStringWidth(this.text.substring(0, int_1));
     }
     }
-    
+
 }
 }

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

@@ -16,7 +16,7 @@ import net.minecraft.client.gui.Drawable;
  * @see WidgetWithBounds for a widget with bounds
  * @see WidgetWithBounds for a widget with bounds
  */
  */
 public abstract class Widget extends AbstractParentElement implements Drawable {
 public abstract class Widget extends AbstractParentElement implements Drawable {
-    
+
     /**
     /**
      * The Minecraft Client instance
      * The Minecraft Client instance
      */
      */
@@ -25,13 +25,13 @@ public abstract class Widget extends AbstractParentElement implements Drawable {
      * The font for rendering text
      * The font for rendering text
      */
      */
     protected final TextRenderer font = minecraft.textRenderer;
     protected final TextRenderer font = minecraft.textRenderer;
-    
+
     public int getZ() {
     public int getZ() {
         return this.getBlitOffset();
         return this.getBlitOffset();
     }
     }
-    
+
     public void setZ(int z) {
     public void setZ(int z) {
         this.setBlitOffset(z);
         this.setBlitOffset(z);
     }
     }
-    
+
 }
 }

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

@@ -9,24 +9,24 @@ import me.shedaniel.math.api.Point;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.math.api.Rectangle;
 
 
 public abstract class WidgetWithBounds extends Widget {
 public abstract class WidgetWithBounds extends Widget {
-    
+
     abstract public Rectangle getBounds();
     abstract public Rectangle getBounds();
-    
+
     public final boolean containsMouse(int mouseX, int mouseY) {
     public final boolean containsMouse(int mouseX, int mouseY) {
         return containsMouse((double) mouseX, (double) mouseY);
         return containsMouse((double) mouseX, (double) mouseY);
     }
     }
-    
+
     public final boolean containsMouse(Point point) {
     public final boolean containsMouse(Point point) {
         return containsMouse(point.x, point.y);
         return containsMouse(point.x, point.y);
     }
     }
-    
+
     public boolean containsMouse(double mouseX, double mouseY) {
     public boolean containsMouse(double mouseX, double mouseY) {
         return getBounds().contains(mouseX, mouseY);
         return getBounds().contains(mouseX, mouseY);
     }
     }
-    
+
     @Override
     @Override
     public boolean isMouseOver(double double_1, double double_2) {
     public boolean isMouseOver(double double_1, double double_2) {
         return containsMouse(double_1, double_2);
         return containsMouse(double_1, double_2);
     }
     }
-    
+
 }
 }

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

@@ -15,29 +15,29 @@ import java.util.Map;
 @Deprecated
 @Deprecated
 public abstract class AbstractEntryStack extends DrawableHelper implements EntryStack {
 public abstract class AbstractEntryStack extends DrawableHelper implements EntryStack {
     private Map<Settings, Object> settings = new HashMap<>();
     private Map<Settings, Object> settings = new HashMap<>();
-    
+
     @Override
     @Override
     public <T> EntryStack setting(Settings<T> settings, T value) {
     public <T> EntryStack setting(Settings<T> settings, T value) {
         this.settings.put(settings, value);
         this.settings.put(settings, value);
         return this;
         return this;
     }
     }
-    
+
     @Override
     @Override
     public <T> EntryStack removeSetting(Settings<T> settings) {
     public <T> EntryStack removeSetting(Settings<T> settings) {
         this.settings.remove(settings);
         this.settings.remove(settings);
         return this;
         return this;
     }
     }
-    
+
     @Override
     @Override
     public EntryStack clearSettings() {
     public EntryStack clearSettings() {
         this.settings.clear();
         this.settings.clear();
         return this;
         return this;
     }
     }
-    
+
     protected Map<Settings, Object> getSettings() {
     protected Map<Settings, Object> getSettings() {
         return settings;
         return settings;
     }
     }
-    
+
     @Override
     @Override
     public <T> ObjectHolder<T> getSetting(Settings<T> settings) {
     public <T> ObjectHolder<T> getSetting(Settings<T> settings) {
         Object o = this.settings.get(settings);
         Object o = this.settings.get(settings);
@@ -45,7 +45,7 @@ public abstract class AbstractEntryStack extends DrawableHelper implements Entry
             return ObjectHolder.of(settings.getDefaultValue());
             return ObjectHolder.of(settings.getDefaultValue());
         return ObjectHolder.of((T) o);
         return ObjectHolder.of((T) o);
     }
     }
-    
+
     @Override
     @Override
     public boolean equals(EntryStack stack, boolean ignoreTags, boolean ignoreAmount) {
     public boolean equals(EntryStack stack, boolean ignoreTags, boolean ignoreAmount) {
         if (ignoreTags && ignoreAmount)
         if (ignoreTags && ignoreAmount)
@@ -56,7 +56,7 @@ public abstract class AbstractEntryStack extends DrawableHelper implements Entry
             return equalsIgnoreTags(stack);
             return equalsIgnoreTags(stack);
         return equalsAll(stack);
         return equalsAll(stack);
     }
     }
-    
+
     @Override
     @Override
     public boolean equals(Object obj) {
     public boolean equals(Object obj) {
         if (!(obj instanceof EntryStack))
         if (!(obj instanceof EntryStack))
@@ -65,12 +65,12 @@ public abstract class AbstractEntryStack extends DrawableHelper implements Entry
         boolean checkTags = getSetting(Settings.CHECK_TAGS).value().get() || stack.getSetting(Settings.CHECK_TAGS).value().get();
         boolean checkTags = getSetting(Settings.CHECK_TAGS).value().get() || stack.getSetting(Settings.CHECK_TAGS).value().get();
         return equals(stack, !checkTags, true);
         return equals(stack, !checkTags, true);
     }
     }
-    
+
     @Override
     @Override
     public int getZ() {
     public int getZ() {
         return getBlitOffset();
         return getBlitOffset();
     }
     }
-    
+
     @Override
     @Override
     public void setZ(int z) {
     public void setZ(int z) {
         setBlitOffset(z);
         setBlitOffset(z);

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

@@ -22,32 +22,32 @@ import java.util.function.Supplier;
 @Deprecated
 @Deprecated
 @Internal
 @Internal
 public class BaseBoundsHandlerImpl implements BaseBoundsHandler {
 public class BaseBoundsHandlerImpl implements BaseBoundsHandler {
-    
+
     private static final Comparator<? super Rectangle> RECTANGLE_COMPARER = Comparator.comparingLong(Rectangle::hashCode);
     private static final Comparator<? super Rectangle> RECTANGLE_COMPARER = Comparator.comparingLong(Rectangle::hashCode);
-    
+
     private long lastArea = -1;
     private long lastArea = -1;
     private List<Pair<Pair<Class<?>, Float>, Supplier<List<Rectangle>>>> list = Lists.newArrayList();
     private List<Pair<Pair<Class<?>, Float>, Supplier<List<Rectangle>>>> list = Lists.newArrayList();
-    
+
     @Override
     @Override
     public Class<?> getBaseSupportedClass() {
     public Class<?> getBaseSupportedClass() {
         return Screen.class;
         return Screen.class;
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getLeftBounds(Screen screen) {
     public Rectangle getLeftBounds(Screen screen) {
         return new Rectangle();
         return new Rectangle();
     }
     }
-    
+
     @Override
     @Override
     public Rectangle getRightBounds(Screen screen) {
     public Rectangle getRightBounds(Screen screen) {
         return new Rectangle();
         return new Rectangle();
     }
     }
-    
+
     @Override
     @Override
     public float getPriority() {
     public float getPriority() {
         return -5f;
         return -5f;
     }
     }
-    
+
     @Override
     @Override
     public ActionResult isInZone(double mouseX, double mouseY) {
     public ActionResult isInZone(double mouseX, double mouseY) {
         Class<? extends Screen> screenClass = MinecraftClient.getInstance().currentScreen.getClass();
         Class<? extends Screen> screenClass = MinecraftClient.getInstance().currentScreen.getClass();
@@ -59,7 +59,7 @@ public class BaseBoundsHandlerImpl implements BaseBoundsHandler {
         }
         }
         return ActionResult.PASS;
         return ActionResult.PASS;
     }
     }
-    
+
     @Override
     @Override
     public boolean shouldRecalculateArea(boolean isOnRightSide, Rectangle rectangle) {
     public boolean shouldRecalculateArea(boolean isOnRightSide, Rectangle rectangle) {
         long current = currentHashCode(isOnRightSide);
         long current = currentHashCode(isOnRightSide);
@@ -68,12 +68,12 @@ public class BaseBoundsHandlerImpl implements BaseBoundsHandler {
         lastArea = current;
         lastArea = current;
         return true;
         return true;
     }
     }
-    
+
     private long currentHashCode(boolean isOnRightSide) {
     private long currentHashCode(boolean isOnRightSide) {
         DisplayHelper.DisplayBoundsHandler handler = DisplayHelper.getInstance().getResponsibleBoundsHandler(MinecraftClient.getInstance().currentScreen.getClass());
         DisplayHelper.DisplayBoundsHandler handler = 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));
         return areasHashCode(isOnRightSide ? handler.getRightBounds(MinecraftClient.getInstance().currentScreen) : handler.getLeftBounds(MinecraftClient.getInstance().currentScreen), getExclusionZones(MinecraftClient.getInstance().currentScreen.getClass(), false));
     }
     }
-    
+
     @Override
     @Override
     public ActionResult canItemSlotWidgetFit(int left, int top, Screen screen, Rectangle fullBounds) {
     public ActionResult canItemSlotWidgetFit(int left, int top, Screen screen, Rectangle fullBounds) {
         Class<? extends Screen> screenClass = screen.getClass();
         Class<? extends Screen> screenClass = screen.getClass();
@@ -86,7 +86,7 @@ public class BaseBoundsHandlerImpl implements BaseBoundsHandler {
         }
         }
         return ActionResult.PASS;
         return ActionResult.PASS;
     }
     }
-    
+
     @Override
     @Override
     public List<Rectangle> getExclusionZones(Class<?> currentScreenClass, boolean sort) {
     public List<Rectangle> getExclusionZones(Class<?> currentScreenClass, boolean sort) {
         List<Rectangle> rectangles = Lists.newArrayList();
         List<Rectangle> rectangles = Lists.newArrayList();
@@ -98,22 +98,22 @@ public class BaseBoundsHandlerImpl implements BaseBoundsHandler {
             rectangles.sort(RECTANGLE_COMPARER);
             rectangles.sort(RECTANGLE_COMPARER);
         return rectangles;
         return rectangles;
     }
     }
-    
+
     @Override
     @Override
     public int supplierSize() {
     public int supplierSize() {
         return list.size();
         return list.size();
     }
     }
-    
+
     @Override
     @Override
     public void registerExclusionZones(Class<?> screenClass, Supplier<List<Rectangle>> supplier) {
     public void registerExclusionZones(Class<?> screenClass, Supplier<List<Rectangle>> supplier) {
         list.add(new Pair<>(new Pair<>(screenClass, 0f), supplier));
         list.add(new Pair<>(new Pair<>(screenClass, 0f), supplier));
     }
     }
-    
+
     private long areasHashCode(Rectangle rectangle, List<Rectangle> exclusionZones) {
     private long areasHashCode(Rectangle rectangle, List<Rectangle> exclusionZones) {
         int hashCode = 31 + (rectangle == null ? 0 : rectangle.hashCode());
         int hashCode = 31 + (rectangle == null ? 0 : rectangle.hashCode());
         for (Rectangle e : exclusionZones)
         for (Rectangle e : exclusionZones)
             hashCode = 31 * hashCode + (e == null ? 0 : e.hashCode());
             hashCode = 31 * hashCode + (e == null ? 0 : e.hashCode());
         return hashCode;
         return hashCode;
     }
     }
-    
+
 }
 }

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

@@ -45,7 +45,7 @@ import java.util.Optional;
 @Deprecated
 @Deprecated
 @Internal
 @Internal
 public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
 public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
-    
+
     public static ClientHelperImpl instance;
     public static ClientHelperImpl instance;
     private final Identifier recipeKeybind = new Identifier("roughlyenoughitems", "recipe_keybind");
     private final Identifier recipeKeybind = new Identifier("roughlyenoughitems", "recipe_keybind");
     private final Identifier usageKeybind = new Identifier("roughlyenoughitems", "usage_keybind");
     private final Identifier usageKeybind = new Identifier("roughlyenoughitems", "usage_keybind");
@@ -57,7 +57,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
     private final Identifier favoriteEntryKeybind = new Identifier("roughlyenoughitems", "favorite_entry");
     private final Identifier favoriteEntryKeybind = new Identifier("roughlyenoughitems", "favorite_entry");
     private final Map<String, String> modNameCache = Maps.newHashMap();
     private final Map<String, String> modNameCache = Maps.newHashMap();
     public FabricKeyBinding recipe, usage, hide, previousPage, nextPage, focusSearchField, copyRecipeIdentifier;
     public FabricKeyBinding recipe, usage, hide, previousPage, nextPage, focusSearchField, copyRecipeIdentifier;
-    
+
     @Override
     @Override
     public String getFormattedModFromItem(Item item) {
     public String getFormattedModFromItem(Item item) {
         String mod = getModFromItem(item);
         String mod = getModFromItem(item);
@@ -65,7 +65,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             return "";
             return "";
         return Formatting.BLUE.toString() + Formatting.ITALIC.toString() + mod;
         return Formatting.BLUE.toString() + Formatting.ITALIC.toString() + mod;
     }
     }
-    
+
     @Override
     @Override
     public String getFormattedModFromIdentifier(Identifier identifier) {
     public String getFormattedModFromIdentifier(Identifier identifier) {
         String mod = getModFromIdentifier(identifier);
         String mod = getModFromIdentifier(identifier);
@@ -73,54 +73,54 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             return "";
             return "";
         return Formatting.BLUE.toString() + Formatting.ITALIC.toString() + mod;
         return Formatting.BLUE.toString() + Formatting.ITALIC.toString() + mod;
     }
     }
-    
+
     @Override
     @Override
     public FabricKeyBinding[] getREIKeyBindings() {
     public FabricKeyBinding[] getREIKeyBindings() {
         return new FabricKeyBinding[]{recipe, usage, hide, previousPage, nextPage, focusSearchField, copyRecipeIdentifier};
         return new FabricKeyBinding[]{recipe, usage, hide, previousPage, nextPage, focusSearchField, copyRecipeIdentifier};
     }
     }
-    
+
     @Override
     @Override
     public FabricKeyBinding getRecipeKeyBinding() {
     public FabricKeyBinding getRecipeKeyBinding() {
         return recipe;
         return recipe;
     }
     }
-    
+
     @Override
     @Override
     public FabricKeyBinding getUsageKeyBinding() {
     public FabricKeyBinding getUsageKeyBinding() {
         return usage;
         return usage;
     }
     }
-    
+
     @Override
     @Override
     public FabricKeyBinding getHideKeyBinding() {
     public FabricKeyBinding getHideKeyBinding() {
         return hide;
         return hide;
     }
     }
-    
+
     @Override
     @Override
     public FabricKeyBinding getPreviousPageKeyBinding() {
     public FabricKeyBinding getPreviousPageKeyBinding() {
         return previousPage;
         return previousPage;
     }
     }
-    
+
     @Override
     @Override
     public FabricKeyBinding getNextPageKeyBinding() {
     public FabricKeyBinding getNextPageKeyBinding() {
         return nextPage;
         return nextPage;
     }
     }
-    
+
     @Override
     @Override
     public FabricKeyBinding getFocusSearchFieldKeyBinding() {
     public FabricKeyBinding getFocusSearchFieldKeyBinding() {
         return focusSearchField;
         return focusSearchField;
     }
     }
-    
+
     @Override
     @Override
     public FabricKeyBinding getCopyRecipeIdentifierKeyBinding() {
     public FabricKeyBinding getCopyRecipeIdentifierKeyBinding() {
         return copyRecipeIdentifier;
         return copyRecipeIdentifier;
     }
     }
-    
+
     @Override
     @Override
     public String getModFromItem(Item item) {
     public String getModFromItem(Item item) {
         if (item.equals(Items.AIR))
         if (item.equals(Items.AIR))
             return "";
             return "";
         return getModFromIdentifier(Registry.ITEM.getId(item));
         return getModFromIdentifier(Registry.ITEM.getId(item));
     }
     }
-    
+
     @Override
     @Override
     public String getModFromIdentifier(Identifier identifier) {
     public String getModFromIdentifier(Identifier identifier) {
         if (identifier == null)
         if (identifier == null)
@@ -133,18 +133,18 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
         modNameCache.put(modid, s);
         modNameCache.put(modid, s);
         return s;
         return s;
     }
     }
-    
+
     @Override
     @Override
     public boolean isCheating() {
     public boolean isCheating() {
         return ConfigObject.getInstance().isCheating();
         return ConfigObject.getInstance().isCheating();
     }
     }
-    
+
     @Override
     @Override
     public void setCheating(boolean cheating) {
     public void setCheating(boolean cheating) {
         ConfigObject.getInstance().setCheating(cheating);
         ConfigObject.getInstance().setCheating(cheating);
         ConfigManager.getInstance().saveConfig();
         ConfigManager.getInstance().saveConfig();
     }
     }
-    
+
     @Override
     @Override
     public void sendDeletePacket() {
     public void sendDeletePacket() {
         if (ScreenHelper.getLastContainerScreen() instanceof CreativeInventoryScreen) {
         if (ScreenHelper.getLastContainerScreen() instanceof CreativeInventoryScreen) {
@@ -153,7 +153,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
         }
         }
         ClientSidePacketRegistry.INSTANCE.sendToServer(RoughlyEnoughItemsNetwork.DELETE_ITEMS_PACKET, new PacketByteBuf(Unpooled.buffer()));
         ClientSidePacketRegistry.INSTANCE.sendToServer(RoughlyEnoughItemsNetwork.DELETE_ITEMS_PACKET, new PacketByteBuf(Unpooled.buffer()));
     }
     }
-    
+
     @Override
     @Override
     public boolean tryCheatingEntry(EntryStack entry) {
     public boolean tryCheatingEntry(EntryStack entry) {
         if (entry.getType() != EntryStack.Type.ITEM)
         if (entry.getType() != EntryStack.Type.ITEM)
@@ -181,7 +181,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             return true;
             return true;
         }
         }
     }
     }
-    
+
     @Override
     @Override
     public boolean executeRecipeKeyBind(EntryStack stack) {
     public boolean executeRecipeKeyBind(EntryStack stack) {
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = RecipeHelper.getInstance().getRecipesFor(stack);
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = RecipeHelper.getInstance().getRecipesFor(stack);
@@ -189,7 +189,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             openRecipeViewingScreen(map);
             openRecipeViewingScreen(map);
         return map.keySet().size() > 0;
         return map.keySet().size() > 0;
     }
     }
-    
+
     @Override
     @Override
     public boolean executeUsageKeyBind(EntryStack stack) {
     public boolean executeUsageKeyBind(EntryStack stack) {
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = RecipeHelper.getInstance().getUsagesFor(stack);
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = RecipeHelper.getInstance().getUsagesFor(stack);
@@ -197,7 +197,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             openRecipeViewingScreen(map);
             openRecipeViewingScreen(map);
         return map.keySet().size() > 0;
         return map.keySet().size() > 0;
     }
     }
-    
+
     @Override
     @Override
     public List<ItemStack> getInventoryItemsTypes() {
     public List<ItemStack> getInventoryItemsTypes() {
         List<DefaultedList<ItemStack>> field_7543 = ImmutableList.of(MinecraftClient.getInstance().player.inventory.main, MinecraftClient.getInstance().player.inventory.armor, MinecraftClient.getInstance().player.inventory.offHand);
         List<DefaultedList<ItemStack>> field_7543 = ImmutableList.of(MinecraftClient.getInstance().player.inventory.main, MinecraftClient.getInstance().player.inventory.armor, MinecraftClient.getInstance().player.inventory.offHand);
@@ -208,7 +208,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
         }));
         }));
         return inventoryStacks;
         return inventoryStacks;
     }
     }
-    
+
     @Override
     @Override
     public boolean executeViewAllRecipesKeyBind() {
     public boolean executeViewAllRecipesKeyBind() {
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = RecipeHelper.getInstance().getAllRecipes();
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = RecipeHelper.getInstance().getAllRecipes();
@@ -216,7 +216,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             openRecipeViewingScreen(map);
             openRecipeViewingScreen(map);
         return map.keySet().size() > 0;
         return map.keySet().size() > 0;
     }
     }
-    
+
     @Override
     @Override
     public boolean executeViewAllRecipesFromCategory(Identifier category) {
     public boolean executeViewAllRecipesFromCategory(Identifier category) {
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = Maps.newLinkedHashMap();
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = Maps.newLinkedHashMap();
@@ -229,7 +229,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             openRecipeViewingScreen(map);
             openRecipeViewingScreen(map);
         return map.keySet().size() > 0;
         return map.keySet().size() > 0;
     }
     }
-    
+
     @Override
     @Override
     public boolean executeViewAllRecipesFromCategories(List<Identifier> categories) {
     public boolean executeViewAllRecipesFromCategories(List<Identifier> categories) {
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = Maps.newLinkedHashMap();
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = Maps.newLinkedHashMap();
@@ -244,7 +244,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             openRecipeViewingScreen(map);
             openRecipeViewingScreen(map);
         return map.keySet().size() > 0;
         return map.keySet().size() > 0;
     }
     }
-    
+
     @Override
     @Override
     public void openRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map) {
     public void openRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map) {
         Screen screen = null;
         Screen screen = null;
@@ -257,7 +257,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
         ScreenHelper.storeRecipeScreen(MinecraftClient.getInstance().currentScreen);
         ScreenHelper.storeRecipeScreen(MinecraftClient.getInstance().currentScreen);
         MinecraftClient.getInstance().openScreen(screen);
         MinecraftClient.getInstance().openScreen(screen);
     }
     }
-    
+
     @Override
     @Override
     public void onInitializeClient() {
     public void onInitializeClient() {
         ClientHelperImpl.instance = (ClientHelperImpl) this;
         ClientHelperImpl.instance = (ClientHelperImpl) this;
@@ -265,7 +265,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
         modNameCache.put("minecraft", "Minecraft");
         modNameCache.put("minecraft", "Minecraft");
         modNameCache.put("c", "Common");
         modNameCache.put("c", "Common");
     }
     }
-    
+
     @Override
     @Override
     public void registerFabricKeyBinds() {
     public void registerFabricKeyBinds() {
         String category = "key.rei.category";
         String category = "key.rei.category";
@@ -278,5 +278,5 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
         KeyBindingRegistryImpl.INSTANCE.register(focusSearchField = FabricKeyBinding.Builder.create(focusSearchFieldKeybind, InputUtil.Type.KEYSYM, -1, category).build());
         KeyBindingRegistryImpl.INSTANCE.register(focusSearchField = FabricKeyBinding.Builder.create(focusSearchFieldKeybind, InputUtil.Type.KEYSYM, -1, category).build());
         KeyBindingRegistryImpl.INSTANCE.register(copyRecipeIdentifier = FabricKeyBinding.Builder.create(copyRecipeIdentifierKeybind, InputUtil.Type.KEYSYM, -1, category).build());
         KeyBindingRegistryImpl.INSTANCE.register(copyRecipeIdentifier = FabricKeyBinding.Builder.create(copyRecipeIdentifierKeybind, InputUtil.Type.KEYSYM, -1, category).build());
     }
     }
-    
+
 }
 }

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

@@ -43,10 +43,10 @@ import static me.sargunvohra.mcmods.autoconfig1u.util.Utils.setUnsafely;
 @Deprecated
 @Deprecated
 @Internal
 @Internal
 public class ConfigManagerImpl implements ConfigManager {
 public class ConfigManagerImpl implements ConfigManager {
-    
+
     private boolean craftableOnly;
     private boolean craftableOnly;
     private List<EntryStack> favorites = new ArrayList<>();
     private List<EntryStack> favorites = new ArrayList<>();
-    
+
     public ConfigManagerImpl() {
     public ConfigManagerImpl() {
         this.craftableOnly = false;
         this.craftableOnly = false;
         AutoConfig.register(ConfigObjectImpl.class, (definition, configClass) -> {
         AutoConfig.register(ConfigObjectImpl.class, (definition, configClass) -> {
@@ -76,12 +76,12 @@ public class ConfigManagerImpl implements ConfigManager {
         loadFavoredEntries();
         loadFavoredEntries();
         RoughlyEnoughItemsCore.LOGGER.info("[REI] Config is loaded.");
         RoughlyEnoughItemsCore.LOGGER.info("[REI] Config is loaded.");
     }
     }
-    
+
     @Override
     @Override
     public List<EntryStack> getFavorites() {
     public List<EntryStack> getFavorites() {
         return favorites;
         return favorites;
     }
     }
-    
+
     public void loadFavoredEntries() {
     public void loadFavoredEntries() {
         favorites.clear();
         favorites.clear();
         Gson gson = new GsonBuilder().create();
         Gson gson = new GsonBuilder().create();
@@ -92,7 +92,7 @@ public class ConfigManagerImpl implements ConfigManager {
         }
         }
         saveConfig();
         saveConfig();
     }
     }
-    
+
     @Override
     @Override
     public void saveConfig() {
     public void saveConfig() {
         Gson gson = new GsonBuilder().create();
         Gson gson = new GsonBuilder().create();
@@ -105,27 +105,27 @@ public class ConfigManagerImpl implements ConfigManager {
         }
         }
         ((me.sargunvohra.mcmods.autoconfig1u.ConfigManager<ConfigObjectImpl>) AutoConfig.getConfigHolder(ConfigObjectImpl.class)).save();
         ((me.sargunvohra.mcmods.autoconfig1u.ConfigManager<ConfigObjectImpl>) AutoConfig.getConfigHolder(ConfigObjectImpl.class)).save();
     }
     }
-    
+
     @Override
     @Override
     public ConfigObject getConfig() {
     public ConfigObject getConfig() {
         return AutoConfig.getConfigHolder(ConfigObjectImpl.class).getConfig();
         return AutoConfig.getConfigHolder(ConfigObjectImpl.class).getConfig();
     }
     }
-    
+
     @Override
     @Override
     public boolean isCraftableOnlyEnabled() {
     public boolean isCraftableOnlyEnabled() {
         return craftableOnly;
         return craftableOnly;
     }
     }
-    
+
     @Override
     @Override
     public void toggleCraftableOnly() {
     public void toggleCraftableOnly() {
         craftableOnly = !craftableOnly;
         craftableOnly = !craftableOnly;
     }
     }
-    
+
     @Override
     @Override
     public void openConfigScreen(Screen parent) {
     public void openConfigScreen(Screen parent) {
         MinecraftClient.getInstance().openScreen(getConfigScreen(parent));
         MinecraftClient.getInstance().openScreen(getConfigScreen(parent));
     }
     }
-    
+
     @Override
     @Override
     public Screen getConfigScreen(Screen parent) {
     public Screen getConfigScreen(Screen parent) {
         try {
         try {
@@ -177,7 +177,7 @@ public class ConfigManagerImpl implements ConfigManager {
                 }
                 }
                 super.render(int_1, int_2, float_1);
                 super.render(int_1, int_2, float_1);
             }
             }
-            
+
             @Override
             @Override
             protected void init() {
             protected void init() {
                 super.init();
                 super.init();
@@ -185,7 +185,7 @@ public class ConfigManagerImpl implements ConfigManager {
                     this.minecraft.openScreen(parent);
                     this.minecraft.openScreen(parent);
                 }));
                 }));
             }
             }
-            
+
             @Override
             @Override
             public boolean keyPressed(int int_1, int int_2, int int_3) {
             public boolean keyPressed(int int_1, int int_2, int int_3) {
                 if (int_1 == 256 && this.shouldCloseOnEsc()) {
                 if (int_1 == 256 && this.shouldCloseOnEsc()) {
@@ -196,5 +196,5 @@ public class ConfigManagerImpl implements ConfigManager {
             }
             }
         };
         };
     }
     }
-    
+
 }
 }

+ 103 - 67
src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java

@@ -21,241 +21,273 @@ import java.util.List;
 @Internal
 @Internal
 @Config(name = "roughlyenoughitems/config")
 @Config(name = "roughlyenoughitems/config")
 public class ConfigObjectImpl implements ConfigObject, ConfigData {
 public class ConfigObjectImpl implements ConfigObject, ConfigData {
-    
-    @ConfigEntry.Category("!general") @ConfigEntry.Gui.TransitiveObject @DontApplyFieldName
+
+    @ConfigEntry.Category("!general")
+    @ConfigEntry.Gui.TransitiveObject
+    @DontApplyFieldName
     public General general = new General();
     public General general = new General();
-    @ConfigEntry.Category("appearance") @ConfigEntry.Gui.TransitiveObject @DontApplyFieldName
+    @ConfigEntry.Category("appearance")
+    @ConfigEntry.Gui.TransitiveObject
+    @DontApplyFieldName
     private Appearance appearance = new Appearance();
     private Appearance appearance = new Appearance();
-    @ConfigEntry.Category("modules") @ConfigEntry.Gui.TransitiveObject @DontApplyFieldName
+    @ConfigEntry.Category("modules")
+    @ConfigEntry.Gui.TransitiveObject
+    @DontApplyFieldName
     private Modules modules = new Modules();
     private Modules modules = new Modules();
-    @ConfigEntry.Category("technical") @ConfigEntry.Gui.TransitiveObject @DontApplyFieldName
+    @ConfigEntry.Category("technical")
+    @ConfigEntry.Gui.TransitiveObject
+    @DontApplyFieldName
     private Technical technical = new Technical();
     private Technical technical = new Technical();
-    @ConfigEntry.Category("performance") @ConfigEntry.Gui.TransitiveObject @DontApplyFieldName
+    @ConfigEntry.Category("performance")
+    @ConfigEntry.Gui.TransitiveObject
+    @DontApplyFieldName
     private Performance performance = new Performance();
     private Performance performance = new Performance();
-    
+
     @Override
     @Override
     public boolean isLighterButtonHover() {
     public boolean isLighterButtonHover() {
         return appearance.lighterButtonHover;
         return appearance.lighterButtonHover;
     }
     }
-    
+
     @Override
     @Override
     public void setLighterButtonHover(boolean lighterButtonHover) {
     public void setLighterButtonHover(boolean lighterButtonHover) {
         appearance.lighterButtonHover = lighterButtonHover;
         appearance.lighterButtonHover = lighterButtonHover;
     }
     }
-    
+
     @Override
     @Override
     public boolean isOverlayVisible() {
     public boolean isOverlayVisible() {
         return general.overlayVisible;
         return general.overlayVisible;
     }
     }
-    
+
     @Override
     @Override
     public void setOverlayVisible(boolean overlayVisible) {
     public void setOverlayVisible(boolean overlayVisible) {
         general.overlayVisible = overlayVisible;
         general.overlayVisible = overlayVisible;
     }
     }
-    
+
     @Override
     @Override
     public boolean isCheating() {
     public boolean isCheating() {
         return general.cheating;
         return general.cheating;
     }
     }
-    
+
     @Override
     @Override
     public void setCheating(boolean cheating) {
     public void setCheating(boolean cheating) {
         general.cheating = cheating;
         general.cheating = cheating;
     }
     }
-    
+
     @Override
     @Override
     public ItemListOrdering getItemListOrdering() {
     public ItemListOrdering getItemListOrdering() {
         return appearance.itemListOrdering.getOrdering();
         return appearance.itemListOrdering.getOrdering();
     }
     }
-    
+
     @Override
     @Override
     public boolean isItemListAscending() {
     public boolean isItemListAscending() {
         return appearance.itemListOrdering.isAscending();
         return appearance.itemListOrdering.isAscending();
     }
     }
-    
+
     @Override
     @Override
     public boolean isUsingDarkTheme() {
     public boolean isUsingDarkTheme() {
         return appearance.darkTheme;
         return appearance.darkTheme;
     }
     }
-    
+
     @Override
     @Override
     public boolean isToastDisplayedOnCopyIdentifier() {
     public boolean isToastDisplayedOnCopyIdentifier() {
         return modules.toastDisplayedOnCopyIdentifier;
         return modules.toastDisplayedOnCopyIdentifier;
     }
     }
-    
+
     @Override
     @Override
     public boolean doesRenderEntryEnchantmentGlint() {
     public boolean doesRenderEntryEnchantmentGlint() {
         return performance.renderEntryEnchantmentGlint;
         return performance.renderEntryEnchantmentGlint;
     }
     }
-    
+
     @Override
     @Override
     public boolean isEntryListWidgetScrolled() {
     public boolean isEntryListWidgetScrolled() {
         return appearance.scrollingEntryListWidget;
         return appearance.scrollingEntryListWidget;
     }
     }
-    
+
     @Override
     @Override
     public boolean shouldAppendModNames() {
     public boolean shouldAppendModNames() {
         return appearance.appendModNames;
         return appearance.appendModNames;
     }
     }
-    
+
     @Override
     @Override
     public RecipeScreenType getRecipeScreenType() {
     public RecipeScreenType getRecipeScreenType() {
         return appearance.recipeScreenType;
         return appearance.recipeScreenType;
     }
     }
-    
+
     @Override
     @Override
     public void setRecipeScreenType(RecipeScreenType recipeScreenType) {
     public void setRecipeScreenType(RecipeScreenType recipeScreenType) {
         appearance.recipeScreenType = recipeScreenType;
         appearance.recipeScreenType = recipeScreenType;
     }
     }
-    
+
     @Override
     @Override
     public boolean isLoadingDefaultPlugin() {
     public boolean isLoadingDefaultPlugin() {
         return technical.loadDefaultPlugin;
         return technical.loadDefaultPlugin;
     }
     }
-    
+
     @Override
     @Override
     public SearchFieldLocation getSearchFieldLocation() {
     public SearchFieldLocation getSearchFieldLocation() {
         return appearance.searchFieldLocation;
         return appearance.searchFieldLocation;
     }
     }
-    
+
     @Override
     @Override
     public boolean isLeftHandSidePanel() {
     public boolean isLeftHandSidePanel() {
         return appearance.mirrorItemPanel;
         return appearance.mirrorItemPanel;
     }
     }
-    
+
     @Override
     @Override
     public boolean isCraftableFilterEnabled() {
     public boolean isCraftableFilterEnabled() {
         return modules.enableCraftableOnlyButton;
         return modules.enableCraftableOnlyButton;
     }
     }
-    
+
     @Override
     @Override
     public String getGamemodeCommand() {
     public String getGamemodeCommand() {
         return technical.gamemodeCommand;
         return technical.gamemodeCommand;
     }
     }
-    
+
     @Override
     @Override
     public String getGiveCommand() {
     public String getGiveCommand() {
         return technical.giveCommand;
         return technical.giveCommand;
     }
     }
-    
+
     @Override
     @Override
     public String getWeatherCommand() {
     public String getWeatherCommand() {
         return technical.weatherCommand;
         return technical.weatherCommand;
     }
     }
-    
+
     @Override
     @Override
     public int getMaxRecipePerPage() {
     public int getMaxRecipePerPage() {
         return appearance.maxRecipePerPage;
         return appearance.maxRecipePerPage;
     }
     }
-    
+
     @Override
     @Override
     public boolean doesShowUtilsButtons() {
     public boolean doesShowUtilsButtons() {
         return modules.showUtilsButtons;
         return modules.showUtilsButtons;
     }
     }
-    
+
     @Override
     @Override
     public boolean doesDisableRecipeBook() {
     public boolean doesDisableRecipeBook() {
         return modules.disableRecipeBook;
         return modules.disableRecipeBook;
     }
     }
-    
+
     @Override
     @Override
     public boolean doesFixTabCloseContainer() {
     public boolean doesFixTabCloseContainer() {
         return modules.fixTabCloseContainer;
         return modules.fixTabCloseContainer;
     }
     }
-    
+
     @Override
     @Override
     public boolean areClickableRecipeArrowsEnabled() {
     public boolean areClickableRecipeArrowsEnabled() {
         return appearance.clickableRecipeArrows;
         return appearance.clickableRecipeArrows;
     }
     }
-    
+
     @Override
     @Override
     public ItemCheatingMode getItemCheatingMode() {
     public ItemCheatingMode getItemCheatingMode() {
         return appearance.itemCheatingMode;
         return appearance.itemCheatingMode;
     }
     }
-    
+
     @Override
     @Override
     public boolean isUsingLightGrayRecipeBorder() {
     public boolean isUsingLightGrayRecipeBorder() {
         return appearance.lightGrayRecipeBorder;
         return appearance.lightGrayRecipeBorder;
     }
     }
-    
+
     @Override
     @Override
     public boolean doesVillagerScreenHavePermanentScrollBar() {
     public boolean doesVillagerScreenHavePermanentScrollBar() {
         return appearance.villagerScreenPermanentScrollBar;
         return appearance.villagerScreenPermanentScrollBar;
     }
     }
-    
+
     @Override
     @Override
     public boolean doesRegisterRecipesInAnotherThread() {
     public boolean doesRegisterRecipesInAnotherThread() {
         return technical.registerRecipesInAnotherThread;
         return technical.registerRecipesInAnotherThread;
     }
     }
-    
+
     @Override
     @Override
     public boolean doesSnapToRows() {
     public boolean doesSnapToRows() {
         return appearance.snapToRows;
         return appearance.snapToRows;
     }
     }
-    
+
     @Override
     @Override
     public boolean isFavoritesEnabled() {
     public boolean isFavoritesEnabled() {
         return general.favoritesEnabled;
         return general.favoritesEnabled;
     }
     }
-    
+
     @Override
     @Override
     public boolean doDisplayFavoritesTooltip() {
     public boolean doDisplayFavoritesTooltip() {
         return isFavoritesEnabled() && appearance.displayFavoritesTooltip;
         return isFavoritesEnabled() && appearance.displayFavoritesTooltip;
     }
     }
-    
+
     @Override
     @Override
     public boolean doDisplayFavoritesOnTheLeft() {
     public boolean doDisplayFavoritesOnTheLeft() {
         return appearance.displayFavoritesOnTheLeft;
         return appearance.displayFavoritesOnTheLeft;
     }
     }
-    
+
     @Override
     @Override
     public boolean doesFastEntryRendering() {
     public boolean doesFastEntryRendering() {
         return performance.fastEntryRendering;
         return performance.fastEntryRendering;
     }
     }
-    
+
     @Override
     @Override
     public boolean doDebugRenderTimeRequired() {
     public boolean doDebugRenderTimeRequired() {
         return technical.debugRenderTimeRequired;
         return technical.debugRenderTimeRequired;
     }
     }
-    
+
+    @Override
+    public boolean doSearchFavorites() {
+        return appearance.searchFavorites;
+    }
+
     @Override
     @Override
     public InputUtil.KeyCode getFavoriteKeybind() {
     public InputUtil.KeyCode getFavoriteKeybind() {
         return general.favoriteKeybind == null ? InputUtil.UNKNOWN_KEYCODE : general.favoriteKeybind;
         return general.favoriteKeybind == null ? InputUtil.UNKNOWN_KEYCODE : general.favoriteKeybind;
     }
     }
-    
+
     public static class General {
     public static class General {
-        @ConfigEntry.Gui.Excluded public List<String> favorites = new ArrayList<>();
-        @Comment("Declares whether cheating mode is on.") private boolean cheating = false;
-        @Comment("Declares whether REI is visible.") @ConfigEntry.Gui.Excluded private boolean overlayVisible = true;
+        @ConfigEntry.Gui.Excluded
+        public List<String> favorites = new ArrayList<>();
+        @Comment("Declares whether cheating mode is on.")
+        private boolean cheating = false;
+        @Comment("Declares whether REI is visible.")
+        @ConfigEntry.Gui.Excluded
+        private boolean overlayVisible = true;
         private boolean favoritesEnabled = true;
         private boolean favoritesEnabled = true;
-        @AddInFrontKeyCode private InputUtil.KeyCode favoriteKeybind = InputUtil.Type.KEYSYM.createFromCode(65);
+        @AddInFrontKeyCode
+        private InputUtil.KeyCode favoriteKeybind = InputUtil.Type.KEYSYM.createFromCode(65);
     }
     }
-    
+
     public static class Appearance {
     public static class Appearance {
-        @Comment("The ordering of the items on the item panel.") @UseEnumSelectorInstead
+        @Comment("The ordering of the items on the item panel.")
+        @UseEnumSelectorInstead
         private ItemListOrderingConfig itemListOrdering = ItemListOrderingConfig.REGISTRY_ASCENDING;
         private ItemListOrderingConfig itemListOrdering = ItemListOrderingConfig.REGISTRY_ASCENDING;
-        @Comment("Declares the appearance of REI windows.") private boolean darkTheme = false;
-        @Comment("The ordering of the items on the item panel.") @UseEnumSelectorInstead
+        @Comment("Declares the appearance of REI windows.")
+        private boolean darkTheme = false;
+        @Comment("The ordering of the items on the item panel.")
+        @UseEnumSelectorInstead
         private RecipeScreenType recipeScreenType = RecipeScreenType.UNSET;
         private RecipeScreenType recipeScreenType = RecipeScreenType.UNSET;
-        @Comment("Declares the position of the search field.") @UseEnumSelectorInstead
+        @Comment("Declares the position of the search field.")
+        @UseEnumSelectorInstead
         private SearchFieldLocation searchFieldLocation = SearchFieldLocation.CENTER;
         private SearchFieldLocation searchFieldLocation = SearchFieldLocation.CENTER;
-        @Comment("Declares the position of the item list panel.") private boolean mirrorItemPanel = false;
+        @Comment("Declares the position of the item list panel.")
+        private boolean mirrorItemPanel = false;
         @Comment("Declares the maximum amount of recipes displayed in a page if possible.")
         @Comment("Declares the maximum amount of recipes displayed in a page if possible.")
-        @ConfigEntry.BoundedDiscrete(min = 2, max = 99) private int maxRecipePerPage = 3;
+        @ConfigEntry.BoundedDiscrete(min = 2, max = 99)
+        private int maxRecipePerPage = 3;
         @Comment("Declares whether REI should lighten the button if hovered.")
         @Comment("Declares whether REI should lighten the button if hovered.")
         private boolean lighterButtonHover = true;
         private boolean lighterButtonHover = true;
         private boolean clickableRecipeArrows = true;
         private boolean clickableRecipeArrows = true;
-        @UseEnumSelectorInstead private ItemCheatingMode itemCheatingMode = ItemCheatingMode.REI_LIKE;
-        @Comment("Declares the appearance of recipe's border.") private boolean lightGrayRecipeBorder = false;
-        @Comment("Declares whether REI should append mod names to item stacks.") private boolean appendModNames = true;
+        @UseEnumSelectorInstead
+        private ItemCheatingMode itemCheatingMode = ItemCheatingMode.REI_LIKE;
+        @Comment("Declares the appearance of recipe's border.")
+        private boolean lightGrayRecipeBorder = false;
+        @Comment("Declares whether REI should append mod names to item stacks.")
+        private boolean appendModNames = true;
         @Comment("Declares how the scrollbar in villager screen should act.")
         @Comment("Declares how the scrollbar in villager screen should act.")
         private boolean villagerScreenPermanentScrollBar = false;
         private boolean villagerScreenPermanentScrollBar = false;
-        @Comment("Declares whether if entry list widget is scrolled.") private boolean scrollingEntryListWidget = false;
+        @Comment("Declares whether entry list widget is scrolled.")
+        private boolean scrollingEntryListWidget = false;
         private boolean snapToRows = false;
         private boolean snapToRows = false;
         private boolean displayFavoritesOnTheLeft = true;
         private boolean displayFavoritesOnTheLeft = true;
         private boolean displayFavoritesTooltip = true;
         private boolean displayFavoritesTooltip = true;
+        @Comment("Declares whether favorites will be searched.")
+        private boolean searchFavorites = true;
     }
     }
-    
+
     public static class Technical {
     public static class Technical {
         @Comment("To disable REI's default plugin.\nDon't change this unless you understand what you are doing!")
         @Comment("To disable REI's default plugin.\nDon't change this unless you understand what you are doing!")
         private boolean loadDefaultPlugin = true;
         private boolean loadDefaultPlugin = true;
@@ -263,24 +295,28 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData {
         private String gamemodeCommand = "/gamemode {gamemode}";
         private String gamemodeCommand = "/gamemode {gamemode}";
         @Comment("Declares the command used in servers to cheat items.")
         @Comment("Declares the command used in servers to cheat items.")
         private String giveCommand = "/give {player_name} {item_identifier}{nbt} {count}";
         private String giveCommand = "/give {player_name} {item_identifier}{nbt} {count}";
-        @Comment("Declares the command used to change weather.") private String weatherCommand = "/weather {weather}";
+        @Comment("Declares the command used to change weather.")
+        private String weatherCommand = "/weather {weather}";
         private boolean registerRecipesInAnotherThread = true;
         private boolean registerRecipesInAnotherThread = true;
         private boolean debugRenderTimeRequired = false;
         private boolean debugRenderTimeRequired = false;
     }
     }
-    
+
     public static class Modules {
     public static class Modules {
         @Comment("Declares whether the craftable filter button is enabled.")
         @Comment("Declares whether the craftable filter button is enabled.")
         private boolean enableCraftableOnlyButton = true;
         private boolean enableCraftableOnlyButton = true;
         private boolean toastDisplayedOnCopyIdentifier = true;
         private boolean toastDisplayedOnCopyIdentifier = true;
-        @Comment("Declares whether the utils buttons are shown.") private boolean showUtilsButtons = false;
-        @Comment("Declares whether REI should remove the recipe book.") private boolean disableRecipeBook = false;
+        @Comment("Declares whether the utils buttons are shown.")
+        private boolean showUtilsButtons = false;
+        @Comment("Declares whether REI should remove the recipe book.")
+        private boolean disableRecipeBook = false;
         @Comment("Declares whether REI should fix closing container with tab.")
         @Comment("Declares whether REI should fix closing container with tab.")
         private boolean fixTabCloseContainer = false;
         private boolean fixTabCloseContainer = false;
     }
     }
-    
+
     public static class Performance {
     public static class Performance {
         @Comment("Whether REI should render entry's enchantment glint")
         @Comment("Whether REI should render entry's enchantment glint")
         private boolean renderEntryEnchantmentGlint = true;
         private boolean renderEntryEnchantmentGlint = true;
-        @ConfigEntry.Gui.Excluded private boolean fastEntryRendering = false;
+        @ConfigEntry.Gui.Excluded
+        private boolean fastEntryRendering = false;
     }
     }
 }
 }

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

@@ -20,41 +20,41 @@ import java.util.stream.Collectors;
 @Deprecated
 @Deprecated
 @Internal
 @Internal
 public class DisplayHelperImpl implements DisplayHelper {
 public class DisplayHelperImpl implements DisplayHelper {
-    
+
     private static final Comparator<DisplayBoundsHandler<?>> BOUNDS_HANDLER_COMPARATOR;
     private static final Comparator<DisplayBoundsHandler<?>> BOUNDS_HANDLER_COMPARATOR;
     private static final DisplayBoundsHandler<Object> EMPTY = new DisplayBoundsHandler() {
     private static final DisplayBoundsHandler<Object> EMPTY = new DisplayBoundsHandler() {
         @Override
         @Override
         public Class getBaseSupportedClass() {
         public Class getBaseSupportedClass() {
             return null;
             return null;
         }
         }
-        
+
         @Override
         @Override
         public Rectangle getLeftBounds(Object screen) {
         public Rectangle getLeftBounds(Object screen) {
             return new Rectangle();
             return new Rectangle();
         }
         }
-        
+
         @Override
         @Override
         public Rectangle getRightBounds(Object screen) {
         public Rectangle getRightBounds(Object screen) {
             return new Rectangle();
             return new Rectangle();
         }
         }
-        
+
         @Override
         @Override
         public float getPriority() {
         public float getPriority() {
             return -10f;
             return -10f;
         }
         }
     };
     };
-    
+
     static {
     static {
         Comparator<DisplayBoundsHandler<?>> comparator = Comparator.comparingDouble(DisplayBoundsHandler::getPriority);
         Comparator<DisplayBoundsHandler<?>> comparator = Comparator.comparingDouble(DisplayBoundsHandler::getPriority);
         BOUNDS_HANDLER_COMPARATOR = comparator.reversed();
         BOUNDS_HANDLER_COMPARATOR = comparator.reversed();
     }
     }
-    
+
     private List<DisplayBoundsHandler<?>> screenDisplayBoundsHandlers = Lists.newArrayList();
     private List<DisplayBoundsHandler<?>> screenDisplayBoundsHandlers = Lists.newArrayList();
     private Map<Class<?>, DisplayBoundsHandler<?>> handlerCache = Maps.newHashMap();
     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 BaseBoundsHandler baseBoundsHandler;
     private Class<?> tempScreen;
     private Class<?> tempScreen;
-    
+
     @Override
     @Override
     public List<DisplayBoundsHandler<?>> getSortedBoundsHandlers(Class<?> screenClass) {
     public List<DisplayBoundsHandler<?>> getSortedBoundsHandlers(Class<?> screenClass) {
         List<DisplayBoundsHandler<?>> possibleCached = handlerSortedCache.get(screenClass);
         List<DisplayBoundsHandler<?>> possibleCached = handlerSortedCache.get(screenClass);
@@ -64,12 +64,12 @@ public class DisplayHelperImpl implements DisplayHelper {
         handlerSortedCache.put(screenClass, screenDisplayBoundsHandlers.stream().filter(this::filterResponsible).sorted(BOUNDS_HANDLER_COMPARATOR).collect(Collectors.toList()));
         handlerSortedCache.put(screenClass, screenDisplayBoundsHandlers.stream().filter(this::filterResponsible).sorted(BOUNDS_HANDLER_COMPARATOR).collect(Collectors.toList()));
         return handlerSortedCache.get(screenClass);
         return handlerSortedCache.get(screenClass);
     }
     }
-    
+
     @Override
     @Override
     public List<DisplayBoundsHandler<?>> getAllBoundsHandlers() {
     public List<DisplayBoundsHandler<?>> getAllBoundsHandlers() {
         return screenDisplayBoundsHandlers;
         return screenDisplayBoundsHandlers;
     }
     }
-    
+
     @Override
     @Override
     public DisplayBoundsHandler<?> getResponsibleBoundsHandler(Class<?> screenClass) {
     public DisplayBoundsHandler<?> getResponsibleBoundsHandler(Class<?> screenClass) {
         DisplayBoundsHandler<?> possibleCached = handlerCache.get(screenClass);
         DisplayBoundsHandler<?> possibleCached = handlerCache.get(screenClass);
@@ -79,36 +79,36 @@ public class DisplayHelperImpl implements DisplayHelper {
         handlerCache.put(screenClass, handlers.isEmpty() ? EMPTY : handlers.get(0));
         handlerCache.put(screenClass, handlers.isEmpty() ? EMPTY : handlers.get(0));
         return handlerCache.get(screenClass);
         return handlerCache.get(screenClass);
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public boolean filterResponsible(DisplayBoundsHandler<?> handler) {
     public boolean filterResponsible(DisplayBoundsHandler<?> handler) {
         return handler.getBaseSupportedClass().isAssignableFrom(tempScreen);
         return handler.getBaseSupportedClass().isAssignableFrom(tempScreen);
     }
     }
-    
+
     @Override
     @Override
     public void registerBoundsHandler(DisplayBoundsHandler<?> handler) {
     public void registerBoundsHandler(DisplayBoundsHandler<?> handler) {
         screenDisplayBoundsHandlers.add(handler);
         screenDisplayBoundsHandlers.add(handler);
     }
     }
-    
+
     @Override
     @Override
     public BaseBoundsHandler getBaseBoundsHandler() {
     public BaseBoundsHandler getBaseBoundsHandler() {
         return baseBoundsHandler;
         return baseBoundsHandler;
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public void setBaseBoundsHandler(BaseBoundsHandler baseBoundsHandler) {
     public void setBaseBoundsHandler(BaseBoundsHandler baseBoundsHandler) {
         this.baseBoundsHandler = baseBoundsHandler;
         this.baseBoundsHandler = baseBoundsHandler;
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public void resetData() {
     public void resetData() {
         screenDisplayBoundsHandlers.clear();
         screenDisplayBoundsHandlers.clear();
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public void resetCache() {
     public void resetCache() {
         handlerCache.clear();
         handlerCache.clear();
         handlerSortedCache.clear();
         handlerSortedCache.clear();
     }
     }
-    
+
 }
 }

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

@@ -16,113 +16,114 @@ import java.util.Optional;
 
 
 @Deprecated
 @Deprecated
 public class EmptyEntryStack implements EntryStack {
 public class EmptyEntryStack implements EntryStack {
-    
-    @Deprecated public static final EntryStack EMPTY = new EmptyEntryStack();
-    
+
+    @Deprecated
+    public static final EntryStack EMPTY = new EmptyEntryStack();
+
     private EmptyEntryStack() {
     private EmptyEntryStack() {
     }
     }
-    
+
     @Override
     @Override
     public Optional<Identifier> getIdentifier() {
     public Optional<Identifier> getIdentifier() {
         return Optional.empty();
         return Optional.empty();
     }
     }
-    
+
     @Override
     @Override
     public Type getType() {
     public Type getType() {
         return Type.EMPTY;
         return Type.EMPTY;
     }
     }
-    
+
     @Override
     @Override
     public int getAmount() {
     public int getAmount() {
         return 0;
         return 0;
     }
     }
-    
+
     @Override
     @Override
     public void setAmount(int amount) {
     public void setAmount(int amount) {
-    
+
     }
     }
-    
+
     @Override
     @Override
     public boolean isEmpty() {
     public boolean isEmpty() {
         return true;
         return true;
     }
     }
-    
+
     @Override
     @Override
     public EntryStack copy() {
     public EntryStack copy() {
         return this;
         return this;
     }
     }
-    
+
     @Override
     @Override
     public Object getObject() {
     public Object getObject() {
         return null;
         return null;
     }
     }
-    
+
     @Override
     @Override
     public boolean equals(EntryStack stack, boolean ignoreTags, boolean ignoreAmount) {
     public boolean equals(EntryStack stack, boolean ignoreTags, boolean ignoreAmount) {
         return stack.getType() == getType();
         return stack.getType() == getType();
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsIgnoreTagsAndAmount(EntryStack stack) {
     public boolean equalsIgnoreTagsAndAmount(EntryStack stack) {
         return stack.getType() == getType();
         return stack.getType() == getType();
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsIgnoreTags(EntryStack stack) {
     public boolean equalsIgnoreTags(EntryStack stack) {
         return stack.getType() == getType();
         return stack.getType() == getType();
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsIgnoreAmount(EntryStack stack) {
     public boolean equalsIgnoreAmount(EntryStack stack) {
         return stack.getType() == getType();
         return stack.getType() == getType();
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsAll(EntryStack stack) {
     public boolean equalsAll(EntryStack stack) {
         return stack.getType() == getType();
         return stack.getType() == getType();
     }
     }
-    
+
     @Override
     @Override
     public int getZ() {
     public int getZ() {
         return 0;
         return 0;
     }
     }
-    
+
     @Override
     @Override
     public void setZ(int z) {
     public void setZ(int z) {
-    
+
     }
     }
-    
+
     @Override
     @Override
     public <T> EntryStack setting(Settings<T> settings, T value) {
     public <T> EntryStack setting(Settings<T> settings, T value) {
         return this;
         return this;
     }
     }
-    
+
     @Override
     @Override
     public <T> EntryStack removeSetting(Settings<T> settings) {
     public <T> EntryStack removeSetting(Settings<T> settings) {
         return this;
         return this;
     }
     }
-    
+
     @Override
     @Override
     public EntryStack clearSettings() {
     public EntryStack clearSettings() {
         return this;
         return this;
     }
     }
-    
+
     @Override
     @Override
     public <T> ObjectHolder<T> getSetting(Settings<T> settings) {
     public <T> ObjectHolder<T> getSetting(Settings<T> settings) {
         return ObjectHolder.of(settings.getDefaultValue());
         return ObjectHolder.of(settings.getDefaultValue());
     }
     }
-    
+
     @Override
     @Override
     @Nullable
     @Nullable
     public QueuedTooltip getTooltip(int mouseX, int mouseY) {
     public QueuedTooltip getTooltip(int mouseX, int mouseY) {
         return null;
         return null;
     }
     }
-    
+
     @Override
     @Override
     public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
     public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
-    
+
     }
     }
-    
+
     @Override
     @Override
     public int hashCode() {
     public int hashCode() {
         return 0;
         return 0;

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

@@ -21,14 +21,14 @@ import java.util.stream.Collectors;
 @Deprecated
 @Deprecated
 @Internal
 @Internal
 public class EntryRegistryImpl implements EntryRegistry {
 public class EntryRegistryImpl implements EntryRegistry {
-    
+
     private final CopyOnWriteArrayList<EntryStack> entries = Lists.newCopyOnWriteArrayList();
     private final CopyOnWriteArrayList<EntryStack> entries = Lists.newCopyOnWriteArrayList();
-    
+
     @Override
     @Override
     public List<EntryStack> getStacksList() {
     public List<EntryStack> getStacksList() {
         return entries;
         return entries;
     }
     }
-    
+
     @Override
     @Override
     public ItemStack[] getAllStacksFromItem(Item item) {
     public ItemStack[] getAllStacksFromItem(Item item) {
         DefaultedList<ItemStack> list = DefaultedList.of();
         DefaultedList<ItemStack> list = DefaultedList.of();
@@ -37,7 +37,7 @@ public class EntryRegistryImpl implements EntryRegistry {
         TreeSet<ItemStack> stackSet = list.stream().collect(Collectors.toCollection(() -> new TreeSet<ItemStack>((p1, p2) -> ItemStack.areEqualIgnoreDamage(p1, p2) ? 0 : 1)));
         TreeSet<ItemStack> stackSet = list.stream().collect(Collectors.toCollection(() -> new TreeSet<ItemStack>((p1, p2) -> ItemStack.areEqualIgnoreDamage(p1, p2) ? 0 : 1)));
         return Lists.newArrayList(stackSet).toArray(new ItemStack[0]);
         return Lists.newArrayList(stackSet).toArray(new ItemStack[0]);
     }
     }
-    
+
     @Override
     @Override
     @Deprecated
     @Deprecated
     public void registerEntryAfter(EntryStack afterEntry, EntryStack stack, boolean checkAlreadyContains) {
     public void registerEntryAfter(EntryStack afterEntry, EntryStack stack, boolean checkAlreadyContains) {
@@ -52,5 +52,5 @@ public class EntryRegistryImpl implements EntryRegistry {
                 entries.add(last, stack);
                 entries.add(last, stack);
             }
             }
     }
     }
-    
+
 }
 }

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

@@ -38,21 +38,21 @@ public class FluidEntryStack extends AbstractEntryStack {
     private static final int EMPTY_AMOUNT = -1319182373;
     private static final int EMPTY_AMOUNT = -1319182373;
     private Fluid fluid;
     private Fluid fluid;
     private int amount;
     private int amount;
-    
+
     public FluidEntryStack(Fluid fluid) {
     public FluidEntryStack(Fluid fluid) {
         this(fluid, EMPTY_AMOUNT);
         this(fluid, EMPTY_AMOUNT);
     }
     }
-    
+
     public FluidEntryStack(Fluid fluid, int amount) {
     public FluidEntryStack(Fluid fluid, int amount) {
         this.fluid = fluid;
         this.fluid = fluid;
         this.amount = amount;
         this.amount = amount;
     }
     }
-    
+
     protected static Pair<Sprite, Integer> getOrLoadSprite(Fluid fluid) {
     protected static Pair<Sprite, Integer> getOrLoadSprite(Fluid fluid) {
         Pair<Sprite, Integer> possibleCached = FLUID_SPRITE_CACHE.get(fluid);
         Pair<Sprite, Integer> possibleCached = FLUID_SPRITE_CACHE.get(fluid);
         if (possibleCached != null)
         if (possibleCached != null)
             return possibleCached;
             return possibleCached;
-        
+
         FluidRenderHandler fluidRenderHandler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
         FluidRenderHandler fluidRenderHandler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
         if (fluidRenderHandler == null)
         if (fluidRenderHandler == null)
             return null;
             return null;
@@ -64,22 +64,22 @@ public class FluidEntryStack extends AbstractEntryStack {
         FLUID_SPRITE_CACHE.put(fluid, pair);
         FLUID_SPRITE_CACHE.put(fluid, pair);
         return pair;
         return pair;
     }
     }
-    
+
     @Override
     @Override
     public Optional<Identifier> getIdentifier() {
     public Optional<Identifier> getIdentifier() {
         return Optional.ofNullable(Registry.FLUID.getId(getFluid()));
         return Optional.ofNullable(Registry.FLUID.getId(getFluid()));
     }
     }
-    
+
     @Override
     @Override
     public Type getType() {
     public Type getType() {
         return Type.FLUID;
         return Type.FLUID;
     }
     }
-    
+
     @Override
     @Override
     public int getAmount() {
     public int getAmount() {
         return amount;
         return amount;
     }
     }
-    
+
     @Override
     @Override
     public void setAmount(int amount) {
     public void setAmount(int amount) {
         this.amount = amount == EMPTY_AMOUNT ? EMPTY_AMOUNT : Math.max(amount, 0);
         this.amount = amount == EMPTY_AMOUNT ? EMPTY_AMOUNT : Math.max(amount, 0);
@@ -87,12 +87,12 @@ public class FluidEntryStack extends AbstractEntryStack {
             fluid = Fluids.EMPTY;
             fluid = Fluids.EMPTY;
         }
         }
     }
     }
-    
+
     @Override
     @Override
     public boolean isEmpty() {
     public boolean isEmpty() {
         return (amount != EMPTY_AMOUNT && amount <= 0) || fluid == Fluids.EMPTY;
         return (amount != EMPTY_AMOUNT && amount <= 0) || fluid == Fluids.EMPTY;
     }
     }
-    
+
     @Override
     @Override
     public EntryStack copy() {
     public EntryStack copy() {
         EntryStack stack = EntryStack.create(fluid, amount);
         EntryStack stack = EntryStack.create(fluid, amount);
@@ -101,40 +101,40 @@ public class FluidEntryStack extends AbstractEntryStack {
         }
         }
         return stack;
         return stack;
     }
     }
-    
+
     @Override
     @Override
     public Object getObject() {
     public Object getObject() {
         return fluid;
         return fluid;
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsIgnoreTagsAndAmount(EntryStack stack) {
     public boolean equalsIgnoreTagsAndAmount(EntryStack stack) {
         if (stack.getType() != Type.FLUID)
         if (stack.getType() != Type.FLUID)
             return false;
             return false;
         return fluid == stack.getFluid();
         return fluid == stack.getFluid();
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsIgnoreTags(EntryStack stack) {
     public boolean equalsIgnoreTags(EntryStack stack) {
         if (stack.getType() != Type.FLUID)
         if (stack.getType() != Type.FLUID)
             return false;
             return false;
         return fluid == stack.getFluid() && amount == stack.getAmount();
         return fluid == stack.getFluid() && amount == stack.getAmount();
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsIgnoreAmount(EntryStack stack) {
     public boolean equalsIgnoreAmount(EntryStack stack) {
         if (stack.getType() != Type.FLUID)
         if (stack.getType() != Type.FLUID)
             return false;
             return false;
         return fluid == stack.getFluid();
         return fluid == stack.getFluid();
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsAll(EntryStack stack) {
     public boolean equalsAll(EntryStack stack) {
         if (stack.getType() != Type.FLUID)
         if (stack.getType() != Type.FLUID)
             return false;
             return false;
         return fluid == stack.getFluid() && amount == stack.getAmount();
         return fluid == stack.getFluid() && amount == stack.getAmount();
     }
     }
-    
+
     @Override
     @Override
     public int hashCode() {
     public int hashCode() {
         int result = 1;
         int result = 1;
@@ -144,7 +144,7 @@ public class FluidEntryStack extends AbstractEntryStack {
         result = 31 * result;
         result = 31 * result;
         return result;
         return result;
     }
     }
-    
+
     @Nullable
     @Nullable
     @Override
     @Override
     public QueuedTooltip getTooltip(int mouseX, int mouseY) {
     public QueuedTooltip getTooltip(int mouseX, int mouseY) {
@@ -171,7 +171,7 @@ public class FluidEntryStack extends AbstractEntryStack {
         }
         }
         return QueuedTooltip.create(toolTip);
         return QueuedTooltip.create(toolTip);
     }
     }
-    
+
     @Override
     @Override
     public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
     public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
         if (getSetting(Settings.RENDER).value().get()) {
         if (getSetting(Settings.RENDER).value().get()) {

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

@@ -32,59 +32,59 @@ import java.util.Optional;
 
 
 @Deprecated
 @Deprecated
 public class ItemEntryStack extends AbstractEntryStack {
 public class ItemEntryStack extends AbstractEntryStack {
-    
+
     private ItemStack itemStack;
     private ItemStack itemStack;
-    
+
     public ItemEntryStack(ItemStack itemStack) {
     public ItemEntryStack(ItemStack itemStack) {
         this.itemStack = itemStack;
         this.itemStack = itemStack;
     }
     }
-    
+
     @Override
     @Override
     public Optional<Identifier> getIdentifier() {
     public Optional<Identifier> getIdentifier() {
         return Optional.ofNullable(Registry.ITEM.getId(getItem()));
         return Optional.ofNullable(Registry.ITEM.getId(getItem()));
     }
     }
-    
+
     @Override
     @Override
     public Type getType() {
     public Type getType() {
         return Type.ITEM;
         return Type.ITEM;
     }
     }
-    
+
     @Override
     @Override
     public int getAmount() {
     public int getAmount() {
         return itemStack.getCount();
         return itemStack.getCount();
     }
     }
-    
+
     @Override
     @Override
     public void setAmount(int amount) {
     public void setAmount(int amount) {
         itemStack.setCount(amount);
         itemStack.setCount(amount);
     }
     }
-    
+
     @Override
     @Override
     public boolean isEmpty() {
     public boolean isEmpty() {
         return itemStack.isEmpty();
         return itemStack.isEmpty();
     }
     }
-    
+
     @Override
     @Override
     public EntryStack copy() {
     public EntryStack copy() {
         EntryStack stack = EntryStack.create(getItemStack().copy());
         EntryStack stack = EntryStack.create(getItemStack().copy());
-        for(Map.Entry<Settings, Object> entry : getSettings().entrySet()) {
+        for (Map.Entry<Settings, Object> entry : getSettings().entrySet()) {
             stack.setting(entry.getKey(), entry.getValue());
             stack.setting(entry.getKey(), entry.getValue());
         }
         }
         return stack;
         return stack;
     }
     }
-    
+
     @Override
     @Override
     public Object getObject() {
     public Object getObject() {
         return itemStack;
         return itemStack;
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsIgnoreTagsAndAmount(EntryStack stack) {
     public boolean equalsIgnoreTagsAndAmount(EntryStack stack) {
         if (stack.getType() != Type.ITEM)
         if (stack.getType() != Type.ITEM)
             return false;
             return false;
         return itemStack.getItem() == stack.getItem();
         return itemStack.getItem() == stack.getItem();
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsAll(EntryStack stack) {
     public boolean equalsAll(EntryStack stack) {
         if (stack.getType() != Type.ITEM)
         if (stack.getType() != Type.ITEM)
@@ -93,7 +93,7 @@ public class ItemEntryStack extends AbstractEntryStack {
             return false;
             return false;
         return ItemStack.areTagsEqual(itemStack, stack.getItemStack());
         return ItemStack.areTagsEqual(itemStack, stack.getItemStack());
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsIgnoreAmount(EntryStack stack) {
     public boolean equalsIgnoreAmount(EntryStack stack) {
         if (stack.getType() != Type.ITEM)
         if (stack.getType() != Type.ITEM)
@@ -102,7 +102,7 @@ public class ItemEntryStack extends AbstractEntryStack {
             return false;
             return false;
         return ItemStack.areTagsEqual(itemStack, stack.getItemStack());
         return ItemStack.areTagsEqual(itemStack, stack.getItemStack());
     }
     }
-    
+
     @Override
     @Override
     public boolean equalsIgnoreTags(EntryStack stack) {
     public boolean equalsIgnoreTags(EntryStack stack) {
         if (stack.getType() != Type.ITEM)
         if (stack.getType() != Type.ITEM)
@@ -111,7 +111,7 @@ public class ItemEntryStack extends AbstractEntryStack {
             return false;
             return false;
         return getAmount() == stack.getAmount();
         return getAmount() == stack.getAmount();
     }
     }
-    
+
     @Override
     @Override
     public int hashCode() {
     public int hashCode() {
         int result = 1;
         int result = 1;
@@ -121,7 +121,7 @@ public class ItemEntryStack extends AbstractEntryStack {
         result = 31 * result + (itemStack.hasTag() ? itemStack.getTag().hashCode() : 0);
         result = 31 * result + (itemStack.hasTag() ? itemStack.getTag().hashCode() : 0);
         return result;
         return result;
     }
     }
-    
+
     @Nullable
     @Nullable
     @Override
     @Override
     public QueuedTooltip getTooltip(int mouseX, int mouseY) {
     public QueuedTooltip getTooltip(int mouseX, int mouseY) {
@@ -132,7 +132,7 @@ public class ItemEntryStack extends AbstractEntryStack {
         if (getSetting(Settings.TOOLTIP_APPEND_MOD).value().get() && ConfigObject.getInstance().shouldAppendModNames()) {
         if (getSetting(Settings.TOOLTIP_APPEND_MOD).value().get() && ConfigObject.getInstance().shouldAppendModNames()) {
             final String modString = ClientHelper.getInstance().getFormattedModFromItem(getItem());
             final String modString = ClientHelper.getInstance().getFormattedModFromItem(getItem());
             boolean alreadyHasMod = false;
             boolean alreadyHasMod = false;
-            for(String s : toolTip)
+            for (String s : toolTip)
                 if (s.equalsIgnoreCase(modString)) {
                 if (s.equalsIgnoreCase(modString)) {
                     alreadyHasMod = true;
                     alreadyHasMod = true;
                     break;
                     break;
@@ -142,7 +142,7 @@ public class ItemEntryStack extends AbstractEntryStack {
         }
         }
         return QueuedTooltip.create(toolTip);
         return QueuedTooltip.create(toolTip);
     }
     }
-    
+
     @Override
     @Override
     public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
     public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
         if (!isEmpty() && getSetting(Settings.RENDER).value().get()) {
         if (!isEmpty() && getSetting(Settings.RENDER).value().get()) {

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

@@ -10,11 +10,11 @@ import me.shedaniel.rei.api.ObjectHolder;
 @Deprecated
 @Deprecated
 public class ObjectHolderImpl<T> implements ObjectHolder<T> {
 public class ObjectHolderImpl<T> implements ObjectHolder<T> {
     private Object o;
     private Object o;
-    
+
     public ObjectHolderImpl(Object o) {
     public ObjectHolderImpl(Object o) {
         this.o = o;
         this.o = o;
     }
     }
-    
+
     @Override
     @Override
     public T value() {
     public T value() {
         return (T) o;
         return (T) o;

+ 83 - 64
src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java

@@ -7,6 +7,7 @@ package me.shedaniel.rei.impl;
 
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.*;
 import me.shedaniel.rei.api.*;
@@ -31,20 +32,21 @@ import java.util.stream.Collectors;
 @Deprecated
 @Deprecated
 @Internal
 @Internal
 public class RecipeHelperImpl implements RecipeHelper {
 public class RecipeHelperImpl implements RecipeHelper {
-    
+
     private static final Comparator<DisplayVisibilityHandler> VISIBILITY_HANDLER_COMPARATOR;
     private static final Comparator<DisplayVisibilityHandler> VISIBILITY_HANDLER_COMPARATOR;
-    @SuppressWarnings("rawtypes") private static final Comparator<Recipe> RECIPE_COMPARATOR = (o1, o2) -> {
+    @SuppressWarnings("rawtypes")
+    private static final Comparator<Recipe> RECIPE_COMPARATOR = (o1, o2) -> {
         int int_1 = o1.getId().getNamespace().compareTo(o2.getId().getNamespace());
         int int_1 = o1.getId().getNamespace().compareTo(o2.getId().getNamespace());
         if (int_1 == 0)
         if (int_1 == 0)
             int_1 = o1.getId().getPath().compareTo(o2.getId().getPath());
             int_1 = o1.getId().getPath().compareTo(o2.getId().getPath());
         return int_1;
         return int_1;
     };
     };
-    
+
     static {
     static {
         Comparator<DisplayVisibilityHandler> comparator = Comparator.comparingDouble(DisplayVisibilityHandler::getPriority);
         Comparator<DisplayVisibilityHandler> comparator = Comparator.comparingDouble(DisplayVisibilityHandler::getPriority);
         VISIBILITY_HANDLER_COMPARATOR = comparator.reversed();
         VISIBILITY_HANDLER_COMPARATOR = comparator.reversed();
     }
     }
-    
+
     private final List<AutoTransferHandler> autoTransferHandlers = Lists.newArrayList();
     private final List<AutoTransferHandler> autoTransferHandlers = Lists.newArrayList();
     private final List<RecipeFunction> recipeFunctions = Lists.newArrayList();
     private final List<RecipeFunction> recipeFunctions = Lists.newArrayList();
     private final List<ScreenClickArea> screenClickAreas = Lists.newArrayList();
     private final List<ScreenClickArea> screenClickAreas = Lists.newArrayList();
@@ -57,7 +59,7 @@ public class RecipeHelperImpl implements RecipeHelper {
     private final List<LiveRecipeGenerator<RecipeDisplay>> liveRecipeGenerators = Lists.newArrayList();
     private final List<LiveRecipeGenerator<RecipeDisplay>> liveRecipeGenerators = Lists.newArrayList();
     private RecipeManager recipeManager;
     private RecipeManager recipeManager;
     private boolean arePluginsLoading = false;
     private boolean arePluginsLoading = false;
-    
+
     @Override
     @Override
     public List<EntryStack> findCraftableEntriesByItems(List<EntryStack> inventoryItems) {
     public List<EntryStack> findCraftableEntriesByItems(List<EntryStack> inventoryItems) {
         List<EntryStack> craftables = new ArrayList<>();
         List<EntryStack> craftables = new ArrayList<>();
@@ -70,16 +72,13 @@ public class RecipeHelperImpl implements RecipeHelper {
                         slotsCraftable++;
                         slotsCraftable++;
                         continue;
                         continue;
                     }
                     }
-                    boolean slotDone = false;
+                    back:
                     for (EntryStack possibleType : inventoryItems) {
                     for (EntryStack possibleType : inventoryItems) {
                         for (EntryStack slotPossible : slot)
                         for (EntryStack slotPossible : slot)
                             if (possibleType.equals(slotPossible)) {
                             if (possibleType.equals(slotPossible)) {
                                 slotsCraftable++;
                                 slotsCraftable++;
-                                slotDone = true;
-                                break;
+                                break back;
                             }
                             }
-                        if (slotDone)
-                            break;
                     }
                     }
                 }
                 }
                 if (slotsCraftable == recipeDisplay.getRequiredEntries().size())
                 if (slotsCraftable == recipeDisplay.getRequiredEntries().size())
@@ -87,34 +86,34 @@ public class RecipeHelperImpl implements RecipeHelper {
             }
             }
         return craftables.stream().distinct().collect(Collectors.toList());
         return craftables.stream().distinct().collect(Collectors.toList());
     }
     }
-    
+
     @Override
     @Override
     public boolean arePluginsLoading() {
     public boolean arePluginsLoading() {
         return arePluginsLoading;
         return arePluginsLoading;
     }
     }
-    
+
     @Override
     @Override
     public void registerCategory(RecipeCategory<?> category) {
     public void registerCategory(RecipeCategory<?> category) {
         categories.add(category);
         categories.add(category);
         recipeCategoryListMap.put(category.getIdentifier(), Lists.newLinkedList());
         recipeCategoryListMap.put(category.getIdentifier(), Lists.newLinkedList());
         categoryWorkingStations.put(category.getIdentifier(), Lists.newLinkedList());
         categoryWorkingStations.put(category.getIdentifier(), Lists.newLinkedList());
     }
     }
-    
+
     @Override
     @Override
     public void registerWorkingStations(Identifier category, List<EntryStack>... workingStations) {
     public void registerWorkingStations(Identifier category, List<EntryStack>... workingStations) {
         categoryWorkingStations.get(category).addAll(Arrays.asList(workingStations));
         categoryWorkingStations.get(category).addAll(Arrays.asList(workingStations));
     }
     }
-    
+
     @Override
     @Override
     public void registerWorkingStations(Identifier category, EntryStack... workingStations) {
     public void registerWorkingStations(Identifier category, EntryStack... workingStations) {
         categoryWorkingStations.get(category).addAll(Arrays.asList(workingStations).stream().map(Collections::singletonList).collect(Collectors.toList()));
         categoryWorkingStations.get(category).addAll(Arrays.asList(workingStations).stream().map(Collections::singletonList).collect(Collectors.toList()));
     }
     }
-    
+
     @Override
     @Override
     public List<List<EntryStack>> getWorkingStations(Identifier category) {
     public List<List<EntryStack>> getWorkingStations(Identifier category) {
         return categoryWorkingStations.get(category);
         return categoryWorkingStations.get(category);
     }
     }
-    
+
     @Override
     @Override
     public void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display) {
     public void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display) {
         if (!recipeCategoryListMap.containsKey(categoryIdentifier))
         if (!recipeCategoryListMap.containsKey(categoryIdentifier))
@@ -122,14 +121,14 @@ public class RecipeHelperImpl implements RecipeHelper {
         recipeCount.incrementAndGet();
         recipeCount.incrementAndGet();
         recipeCategoryListMap.get(categoryIdentifier).add(display);
         recipeCategoryListMap.get(categoryIdentifier).add(display);
     }
     }
-    
+
     private void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display, int index) {
     private void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display, int index) {
         if (!recipeCategoryListMap.containsKey(categoryIdentifier))
         if (!recipeCategoryListMap.containsKey(categoryIdentifier))
             return;
             return;
         recipeCount.incrementAndGet();
         recipeCount.incrementAndGet();
         recipeCategoryListMap.get(categoryIdentifier).add(index, display);
         recipeCategoryListMap.get(categoryIdentifier).add(index, display);
     }
     }
-    
+
     @Override
     @Override
     public Map<RecipeCategory<?>, List<RecipeDisplay>> getRecipesFor(EntryStack stack) {
     public Map<RecipeCategory<?>, List<RecipeDisplay>> getRecipesFor(EntryStack stack) {
         Map<Identifier, List<RecipeDisplay>> categoriesMap = new HashMap<>();
         Map<Identifier, List<RecipeDisplay>> categoriesMap = new HashMap<>();
@@ -154,38 +153,58 @@ public class RecipeHelperImpl implements RecipeHelper {
                 recipeCategoryListMap.remove(category);
                 recipeCategoryListMap.remove(category);
         return recipeCategoryListMap;
         return recipeCategoryListMap;
     }
     }
-    
+
     @Override
     @Override
     public RecipeCategory<?> getCategory(Identifier identifier) {
     public RecipeCategory<?> getCategory(Identifier identifier) {
         return CollectionUtils.findFirstOrNull(categories, category -> category.getIdentifier().equals(identifier));
         return CollectionUtils.findFirstOrNull(categories, category -> category.getIdentifier().equals(identifier));
     }
     }
-    
+
     @Override
     @Override
     public RecipeManager getRecipeManager() {
     public RecipeManager getRecipeManager() {
         return recipeManager;
         return recipeManager;
     }
     }
-    
+
+    private boolean isStackWorkStationOfCategory(Identifier category, EntryStack stack) {
+        for (List<EntryStack> stacks : getWorkingStations(category)) {
+            for (EntryStack entryStack : stacks) {
+                if (entryStack.equalsIgnoreTagsAndAmount(stack))
+                    return true;
+            }
+        }
+        return false;
+    }
+
     @Override
     @Override
     public Map<RecipeCategory<?>, List<RecipeDisplay>> getUsagesFor(EntryStack stack) {
     public Map<RecipeCategory<?>, List<RecipeDisplay>> getUsagesFor(EntryStack stack) {
-        Map<Identifier, List<RecipeDisplay>> categoriesMap = new HashMap<>();
-        categories.forEach(f -> categoriesMap.put(f.getIdentifier(), Lists.newArrayList()));
+        Map<Identifier, Set<RecipeDisplay>> categoriesMap = new HashMap<>();
+        categories.forEach(f -> categoriesMap.put(f.getIdentifier(), Sets.newLinkedHashSet()));
         for (Map.Entry<Identifier, List<RecipeDisplay>> entry : recipeCategoryListMap.entrySet()) {
         for (Map.Entry<Identifier, List<RecipeDisplay>> entry : recipeCategoryListMap.entrySet()) {
-            boolean isWorkstationCategory = getWorkingStations(entry.getKey()).stream().anyMatch(ws -> ws.contains(stack));
-            for (RecipeDisplay recipeDisplay : entry.getValue()) {
-                if (isWorkstationCategory) {
+            boolean isWorkstationCategory = isStackWorkStationOfCategory(entry.getKey(), stack);
+            if (isWorkstationCategory) {
+                for (RecipeDisplay recipeDisplay : entry.getValue()) {
+                    back:
+                    for (List<EntryStack> input : recipeDisplay.getInputEntries()) {
+                        for (EntryStack otherEntry : input) {
+                            if (otherEntry.equals(stack)) {
+                                categoriesMap.get(recipeDisplay.getRecipeCategory()).add(recipeDisplay);
+                                break back;
+                            }
+                        }
+                    }
+                }
+                for (RecipeDisplay recipeDisplay : entry.getValue()) {
                     categoriesMap.get(recipeDisplay.getRecipeCategory()).add(recipeDisplay);
                     categoriesMap.get(recipeDisplay.getRecipeCategory()).add(recipeDisplay);
-                } else {
-                    boolean found = false;
+                }
+            } else {
+                for (RecipeDisplay recipeDisplay : entry.getValue()) {
+                    back:
                     for (List<EntryStack> input : recipeDisplay.getInputEntries()) {
                     for (List<EntryStack> input : recipeDisplay.getInputEntries()) {
                         for (EntryStack otherEntry : input) {
                         for (EntryStack otherEntry : input) {
                             if (otherEntry.equals(stack)) {
                             if (otherEntry.equals(stack)) {
                                 categoriesMap.get(recipeDisplay.getRecipeCategory()).add(recipeDisplay);
                                 categoriesMap.get(recipeDisplay.getRecipeCategory()).add(recipeDisplay);
-                                found = true;
-                                break;
+                                break back;
                             }
                             }
                         }
                         }
-                        if (found)
-                            break;
                     }
                     }
                 }
                 }
             }
             }
@@ -203,19 +222,19 @@ public class RecipeHelperImpl implements RecipeHelper {
                 recipeCategoryListMap.remove(category);
                 recipeCategoryListMap.remove(category);
         return recipeCategoryListMap;
         return recipeCategoryListMap;
     }
     }
-    
+
     @Override
     @Override
     public List<RecipeCategory<?>> getAllCategories() {
     public List<RecipeCategory<?>> getAllCategories() {
         return Collections.unmodifiableList(categories);
         return Collections.unmodifiableList(categories);
     }
     }
-    
+
     @Override
     @Override
     public Optional<ButtonAreaSupplier> getAutoCraftButtonArea(RecipeCategory<?> category) {
     public Optional<ButtonAreaSupplier> getAutoCraftButtonArea(RecipeCategory<?> category) {
         if (!autoCraftAreaSupplierMap.containsKey(category.getIdentifier()))
         if (!autoCraftAreaSupplierMap.containsKey(category.getIdentifier()))
             return Optional.ofNullable(bounds -> new Rectangle(bounds.getMaxX() - 16, bounds.getMaxY() - 16, 10, 10));
             return Optional.ofNullable(bounds -> new Rectangle(bounds.getMaxX() - 16, bounds.getMaxY() - 16, 10, 10));
         return Optional.ofNullable(autoCraftAreaSupplierMap.get(category.getIdentifier()));
         return Optional.ofNullable(autoCraftAreaSupplierMap.get(category.getIdentifier()));
     }
     }
-    
+
     @Override
     @Override
     public void registerAutoCraftButtonArea(Identifier category, ButtonAreaSupplier rectangle) {
     public void registerAutoCraftButtonArea(Identifier category, ButtonAreaSupplier rectangle) {
         if (rectangle == null) {
         if (rectangle == null) {
@@ -224,7 +243,7 @@ public class RecipeHelperImpl implements RecipeHelper {
         } else
         } else
             autoCraftAreaSupplierMap.put(category, rectangle);
             autoCraftAreaSupplierMap.put(category, rectangle);
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     public void recipesLoaded(RecipeManager recipeManager) {
     public void recipesLoaded(RecipeManager recipeManager) {
         long startTime = System.currentTimeMillis();
         long startTime = System.currentTimeMillis();
@@ -308,7 +327,7 @@ public class RecipeHelperImpl implements RecipeHelper {
                 public ActionResult handleDisplay(RecipeCategory<?> category, RecipeDisplay display) {
                 public ActionResult handleDisplay(RecipeCategory<?> category, RecipeDisplay display) {
                     return ActionResult.SUCCESS;
                     return ActionResult.SUCCESS;
                 }
                 }
-                
+
                 @Override
                 @Override
                 public float getPriority() {
                 public float getPriority() {
                     return -1f;
                     return -1f;
@@ -317,34 +336,34 @@ public class RecipeHelperImpl implements RecipeHelper {
         // Clear Cache
         // Clear Cache
         ((DisplayHelperImpl) DisplayHelper.getInstance()).resetCache();
         ((DisplayHelperImpl) DisplayHelper.getInstance()).resetCache();
         ScreenHelper.getOptionalOverlay().ifPresent(overlay -> overlay.shouldReInit = true);
         ScreenHelper.getOptionalOverlay().ifPresent(overlay -> overlay.shouldReInit = true);
-        
+
         long usedTime = System.currentTimeMillis() - startTime;
         long usedTime = System.currentTimeMillis() - startTime;
         RoughlyEnoughItemsCore.LOGGER.info("[REI] Registered %d stack entries, %d recipes displays, %d exclusion zones suppliers, %d bounds handler, %d visibility handlers and %d categories (%s) in %d ms.", EntryRegistry.getInstance().getStacksList().size(), recipeCount.get(), DisplayHelper.getInstance().getBaseBoundsHandler().supplierSize(), DisplayHelper.getInstance().getAllBoundsHandlers().size(), getDisplayVisibilityHandlers().size(), categories.size(), String.join(", ", categories.stream().map(RecipeCategory::getCategoryName).collect(Collectors.toList())), usedTime);
         RoughlyEnoughItemsCore.LOGGER.info("[REI] Registered %d stack entries, %d recipes displays, %d exclusion zones suppliers, %d bounds handler, %d visibility handlers and %d categories (%s) in %d ms.", EntryRegistry.getInstance().getStacksList().size(), recipeCount.get(), DisplayHelper.getInstance().getBaseBoundsHandler().supplierSize(), DisplayHelper.getInstance().getAllBoundsHandlers().size(), getDisplayVisibilityHandlers().size(), categories.size(), String.join(", ", categories.stream().map(RecipeCategory::getCategoryName).collect(Collectors.toList())), usedTime);
         arePluginsLoading = false;
         arePluginsLoading = false;
     }
     }
-    
+
     @Override
     @Override
     public AutoTransferHandler registerAutoCraftingHandler(AutoTransferHandler handler) {
     public AutoTransferHandler registerAutoCraftingHandler(AutoTransferHandler handler) {
         autoTransferHandlers.add(handler);
         autoTransferHandlers.add(handler);
         return handler;
         return handler;
     }
     }
-    
+
     @Override
     @Override
     public List<AutoTransferHandler> getSortedAutoCraftingHandler() {
     public List<AutoTransferHandler> getSortedAutoCraftingHandler() {
         return autoTransferHandlers.stream().sorted(Comparator.comparingDouble(AutoTransferHandler::getPriority).reversed()).collect(Collectors.toList());
         return autoTransferHandlers.stream().sorted(Comparator.comparingDouble(AutoTransferHandler::getPriority).reversed()).collect(Collectors.toList());
     }
     }
-    
+
     @Override
     @Override
     public int getRecipeCount() {
     public int getRecipeCount() {
         return recipeCount.get();
         return recipeCount.get();
     }
     }
-    
+
     @Override
     @Override
     @SuppressWarnings("rawtypes")
     @SuppressWarnings("rawtypes")
     public List<Recipe> getAllSortedRecipes() {
     public List<Recipe> getAllSortedRecipes() {
         return getRecipeManager().values().stream().sorted(RECIPE_COMPARATOR).collect(Collectors.toList());
         return getRecipeManager().values().stream().sorted(RECIPE_COMPARATOR).collect(Collectors.toList());
     }
     }
-    
+
     @Override
     @Override
     public Map<RecipeCategory<?>, List<RecipeDisplay>> getAllRecipes() {
     public Map<RecipeCategory<?>, List<RecipeDisplay>> getAllRecipes() {
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = Maps.newLinkedHashMap();
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = Maps.newLinkedHashMap();
@@ -357,33 +376,33 @@ public class RecipeHelperImpl implements RecipeHelper {
         }
         }
         return map;
         return map;
     }
     }
-    
+
     @Override
     @Override
     public List<RecipeDisplay> getAllRecipesFromCategory(RecipeCategory<?> category) {
     public List<RecipeDisplay> getAllRecipesFromCategory(RecipeCategory<?> category) {
         return recipeCategoryListMap.get(category.getIdentifier());
         return recipeCategoryListMap.get(category.getIdentifier());
     }
     }
-    
+
     @Override
     @Override
     public void registerRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler) {
     public void registerRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler) {
         displayVisibilityHandlers.add(visibilityHandler);
         displayVisibilityHandlers.add(visibilityHandler);
     }
     }
-    
+
     @Override
     @Override
     public void unregisterRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler) {
     public void unregisterRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler) {
         displayVisibilityHandlers.remove(visibilityHandler);
         displayVisibilityHandlers.remove(visibilityHandler);
     }
     }
-    
+
     @Override
     @Override
     public List<DisplayVisibilityHandler> getDisplayVisibilityHandlers() {
     public List<DisplayVisibilityHandler> getDisplayVisibilityHandlers() {
         return Collections.unmodifiableList(displayVisibilityHandlers);
         return Collections.unmodifiableList(displayVisibilityHandlers);
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     @Override
     @Override
     public boolean isDisplayVisible(RecipeDisplay display, boolean respectConfig) {
     public boolean isDisplayVisible(RecipeDisplay display, boolean respectConfig) {
         return isDisplayVisible(display);
         return isDisplayVisible(display);
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     @Override
     @Override
     public boolean isDisplayVisible(RecipeDisplay display) {
     public boolean isDisplayVisible(RecipeDisplay display) {
@@ -400,74 +419,74 @@ public class RecipeHelperImpl implements RecipeHelper {
         }
         }
         return true;
         return true;
     }
     }
-    
+
     @Override
     @Override
     public void registerScreenClickArea(Rectangle rectangle, Class<? extends AbstractContainerScreen<?>> screenClass, Identifier... categories) {
     public void registerScreenClickArea(Rectangle rectangle, Class<? extends AbstractContainerScreen<?>> screenClass, Identifier... categories) {
         this.screenClickAreas.add(new ScreenClickAreaImpl(screenClass, rectangle, categories));
         this.screenClickAreas.add(new ScreenClickAreaImpl(screenClass, rectangle, categories));
     }
     }
-    
+
     @Override
     @Override
     public <T extends Recipe<?>> void registerRecipes(Identifier category, Class<T> recipeClass, Function<T, RecipeDisplay> mappingFunction) {
     public <T extends Recipe<?>> void registerRecipes(Identifier category, Class<T> recipeClass, Function<T, RecipeDisplay> mappingFunction) {
         recipeFunctions.add(new RecipeFunction(category, recipe -> recipeClass.isAssignableFrom(recipe.getClass()), mappingFunction));
         recipeFunctions.add(new RecipeFunction(category, recipe -> recipeClass.isAssignableFrom(recipe.getClass()), mappingFunction));
     }
     }
-    
+
     @Override
     @Override
     public <T extends Recipe<?>> void registerRecipes(Identifier category, @SuppressWarnings("rawtypes")
     public <T extends Recipe<?>> void registerRecipes(Identifier category, @SuppressWarnings("rawtypes")
             Function<Recipe, Boolean> recipeFilter, Function<T, RecipeDisplay> mappingFunction) {
             Function<Recipe, Boolean> recipeFilter, Function<T, RecipeDisplay> mappingFunction) {
         recipeFunctions.add(new RecipeFunction(category, recipeFilter::apply, mappingFunction));
         recipeFunctions.add(new RecipeFunction(category, recipeFilter::apply, mappingFunction));
     }
     }
-    
+
     @Override
     @Override
     public <T extends Recipe<?>> void registerRecipes(Identifier category,
     public <T extends Recipe<?>> void registerRecipes(Identifier category,
-            @SuppressWarnings("rawtypes") Predicate<Recipe> recipeFilter, Function<T, RecipeDisplay> mappingFunction) {
+                                                      @SuppressWarnings("rawtypes") Predicate<Recipe> recipeFilter, Function<T, RecipeDisplay> mappingFunction) {
         recipeFunctions.add(new RecipeFunction(category, recipeFilter, mappingFunction));
         recipeFunctions.add(new RecipeFunction(category, recipeFilter, mappingFunction));
     }
     }
-    
+
     @Override
     @Override
     public void registerLiveRecipeGenerator(LiveRecipeGenerator<?> liveRecipeGenerator) {
     public void registerLiveRecipeGenerator(LiveRecipeGenerator<?> liveRecipeGenerator) {
         liveRecipeGenerators.add((LiveRecipeGenerator<RecipeDisplay>) liveRecipeGenerator);
         liveRecipeGenerators.add((LiveRecipeGenerator<RecipeDisplay>) liveRecipeGenerator);
     }
     }
-    
+
     @Override
     @Override
     public List<ScreenClickArea> getScreenClickAreas() {
     public List<ScreenClickArea> getScreenClickAreas() {
         return screenClickAreas;
         return screenClickAreas;
     }
     }
-    
+
     private class ScreenClickAreaImpl implements ScreenClickArea {
     private class ScreenClickAreaImpl implements ScreenClickArea {
         Class<? extends AbstractContainerScreen<?>> screenClass;
         Class<? extends AbstractContainerScreen<?>> screenClass;
         Rectangle rectangle;
         Rectangle rectangle;
         Identifier[] categories;
         Identifier[] categories;
-        
+
         private ScreenClickAreaImpl(Class<? extends AbstractContainerScreen<?>> screenClass, Rectangle rectangle, Identifier[] categories) {
         private ScreenClickAreaImpl(Class<? extends AbstractContainerScreen<?>> screenClass, Rectangle rectangle, Identifier[] categories) {
             this.screenClass = screenClass;
             this.screenClass = screenClass;
             this.rectangle = rectangle;
             this.rectangle = rectangle;
             this.categories = categories;
             this.categories = categories;
         }
         }
-        
+
         public Class<? extends AbstractContainerScreen<?>> getScreenClass() {
         public Class<? extends AbstractContainerScreen<?>> getScreenClass() {
             return screenClass;
             return screenClass;
         }
         }
-        
+
         public Rectangle getRectangle() {
         public Rectangle getRectangle() {
             return rectangle;
             return rectangle;
         }
         }
-        
+
         public Identifier[] getCategories() {
         public Identifier[] getCategories() {
             return categories;
             return categories;
         }
         }
     }
     }
-    
+
     @SuppressWarnings("rawtypes")
     @SuppressWarnings("rawtypes")
     private class RecipeFunction {
     private class RecipeFunction {
         Identifier category;
         Identifier category;
         Predicate<Recipe> recipeFilter;
         Predicate<Recipe> recipeFilter;
         Function mappingFunction;
         Function mappingFunction;
-        
+
         public RecipeFunction(Identifier category, Predicate<Recipe> recipeFilter, Function<?, RecipeDisplay> mappingFunction) {
         public RecipeFunction(Identifier category, Predicate<Recipe> recipeFilter, Function<?, RecipeDisplay> mappingFunction) {
             this.category = category;
             this.category = category;
             this.recipeFilter = recipeFilter;
             this.recipeFilter = recipeFilter;
             this.mappingFunction = mappingFunction;
             this.mappingFunction = mappingFunction;
         }
         }
     }
     }
-    
+
 }
 }

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

@@ -29,59 +29,60 @@ import java.util.List;
 import java.util.Optional;
 import java.util.Optional;
 
 
 public class ScreenHelper implements ClientModInitializer {
 public class ScreenHelper implements ClientModInitializer {
-    
+
     /**
     /**
      * @deprecated Use getters instead
      * @deprecated Use getters instead
      */
      */
-    @Deprecated public static OverlaySearchField searchField;
+    @Deprecated
+    public static OverlaySearchField searchField;
     public static List<ItemStack> inventoryStacks = Lists.newArrayList();
     public static List<ItemStack> inventoryStacks = Lists.newArrayList();
     private static ContainerScreenOverlay overlay;
     private static ContainerScreenOverlay overlay;
     private static AbstractContainerScreen<?> lastContainerScreen = null;
     private static AbstractContainerScreen<?> lastContainerScreen = null;
     private static LinkedHashSet<Screen> lastRecipeScreen = Sets.newLinkedHashSetWithExpectedSize(5);
     private static LinkedHashSet<Screen> lastRecipeScreen = Sets.newLinkedHashSetWithExpectedSize(5);
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     public static OverlaySearchField getSearchField() {
     public static OverlaySearchField getSearchField() {
         return searchField;
         return searchField;
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public static void setSearchField(OverlaySearchField searchField) {
     public static void setSearchField(OverlaySearchField searchField) {
         ScreenHelper.searchField = searchField;
         ScreenHelper.searchField = searchField;
     }
     }
-    
+
     public static void storeRecipeScreen(Screen screen) {
     public static void storeRecipeScreen(Screen screen) {
         while (lastRecipeScreen.size() >= 5)
         while (lastRecipeScreen.size() >= 5)
             lastRecipeScreen.remove(Iterables.get(lastRecipeScreen, 0));
             lastRecipeScreen.remove(Iterables.get(lastRecipeScreen, 0));
         lastRecipeScreen.add(screen);
         lastRecipeScreen.add(screen);
     }
     }
-    
+
     public static boolean hasLastRecipeScreen() {
     public static boolean hasLastRecipeScreen() {
         return !lastRecipeScreen.isEmpty();
         return !lastRecipeScreen.isEmpty();
     }
     }
-    
+
     public static Screen getLastRecipeScreen() {
     public static Screen getLastRecipeScreen() {
         Screen screen = Iterables.getLast(lastRecipeScreen);
         Screen screen = Iterables.getLast(lastRecipeScreen);
         lastRecipeScreen.remove(screen);
         lastRecipeScreen.remove(screen);
         return screen;
         return screen;
     }
     }
-    
+
     public static void clearData() {
     public static void clearData() {
         lastRecipeScreen.clear();
         lastRecipeScreen.clear();
     }
     }
-    
+
     public static boolean isOverlayVisible() {
     public static boolean isOverlayVisible() {
         return ConfigObject.getInstance().isOverlayVisible();
         return ConfigObject.getInstance().isOverlayVisible();
     }
     }
-    
+
     public static void toggleOverlayVisible() {
     public static void toggleOverlayVisible() {
         ConfigObject.getInstance().setOverlayVisible(!ConfigObject.getInstance().isOverlayVisible());
         ConfigObject.getInstance().setOverlayVisible(!ConfigObject.getInstance().isOverlayVisible());
         ConfigManager.getInstance().saveConfig();
         ConfigManager.getInstance().saveConfig();
     }
     }
-    
+
     public static Optional<ContainerScreenOverlay> getOptionalOverlay() {
     public static Optional<ContainerScreenOverlay> getOptionalOverlay() {
         return Optional.ofNullable(overlay);
         return Optional.ofNullable(overlay);
     }
     }
-    
+
     public static ContainerScreenOverlay getLastOverlay(boolean reset, boolean setPage) {
     public static ContainerScreenOverlay getLastOverlay(boolean reset, boolean setPage) {
         if (overlay == null || reset) {
         if (overlay == null || reset) {
             overlay = new ContainerScreenOverlay();
             overlay = new ContainerScreenOverlay();
@@ -90,28 +91,28 @@ public class ScreenHelper implements ClientModInitializer {
         }
         }
         return overlay;
         return overlay;
     }
     }
-    
+
     public static ContainerScreenOverlay getLastOverlay() {
     public static ContainerScreenOverlay getLastOverlay() {
         return getLastOverlay(false, false);
         return getLastOverlay(false, false);
     }
     }
-    
+
     public static AbstractContainerScreen<?> getLastContainerScreen() {
     public static AbstractContainerScreen<?> getLastContainerScreen() {
         return lastContainerScreen;
         return lastContainerScreen;
     }
     }
-    
+
     public static void setLastContainerScreen(AbstractContainerScreen<?> lastContainerScreen) {
     public static void setLastContainerScreen(AbstractContainerScreen<?> lastContainerScreen) {
         ScreenHelper.lastContainerScreen = lastContainerScreen;
         ScreenHelper.lastContainerScreen = lastContainerScreen;
     }
     }
-    
+
     public static ContainerScreenHooks getLastContainerScreenHooks() {
     public static ContainerScreenHooks getLastContainerScreenHooks() {
         return (ContainerScreenHooks) lastContainerScreen;
         return (ContainerScreenHooks) lastContainerScreen;
     }
     }
-    
+
     public static void drawHoveringWidget(int x, int y, TriConsumer<Integer, Integer, Float> consumer, int width, int height, float delta) {
     public static void drawHoveringWidget(int x, int y, TriConsumer<Integer, Integer, Float> consumer, int width, int height, float delta) {
         Window window = MinecraftClient.getInstance().getWindow();
         Window window = MinecraftClient.getInstance().getWindow();
         drawHoveringWidget(window.getScaledWidth(), window.getScaledHeight(), x, y, consumer, width, height, delta);
         drawHoveringWidget(window.getScaledWidth(), window.getScaledHeight(), x, y, consumer, width, height, delta);
     }
     }
-    
+
     public static void drawHoveringWidget(int screenWidth, int screenHeight, int x, int y, TriConsumer<Integer, Integer, Float> consumer, int width, int height, float delta) {
     public static void drawHoveringWidget(int screenWidth, int screenHeight, int x, int y, TriConsumer<Integer, Integer, Float> consumer, int width, int height, float delta) {
         int actualX = Math.max(x + 12, 6);
         int actualX = Math.max(x + 12, 6);
         int actualY = Math.min(y - height / 2, screenHeight - height - 6);
         int actualY = Math.min(y - height / 2, screenHeight - height - 6);
@@ -121,11 +122,11 @@ public class ScreenHelper implements ClientModInitializer {
             actualY += 24;
             actualY += 24;
         consumer.accept(actualX, actualY, delta);
         consumer.accept(actualX, actualY, delta);
     }
     }
-    
+
     public static boolean isDarkModeEnabled() {
     public static boolean isDarkModeEnabled() {
         return ConfigObject.getInstance().isUsingDarkTheme();
         return ConfigObject.getInstance().isUsingDarkTheme();
     }
     }
-    
+
     @Override
     @Override
     public void onInitializeClient() {
     public void onInitializeClient() {
         ClothClientHooks.SCREEN_INIT_PRE.register((client, screen, screenHooks) -> {
         ClothClientHooks.SCREEN_INIT_PRE.register((client, screen, screenHooks) -> {
@@ -138,5 +139,5 @@ public class ScreenHelper implements ClientModInitializer {
                 getSearchField().tick();
                 getSearchField().tick();
         });
         });
     }
     }
-    
+
 }
 }

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

@@ -29,25 +29,26 @@ import java.util.function.Function;
 @Deprecated
 @Deprecated
 @Internal
 @Internal
 public class SearchArgument {
 public class SearchArgument {
-    
+
     public static final SearchArgument ALWAYS = new SearchArgument(ArgumentType.ALWAYS, "", true);
     public static final SearchArgument ALWAYS = new SearchArgument(ArgumentType.ALWAYS, "", true);
-    @Deprecated private static List<Item> searchBlacklisted = Lists.newArrayList();
+    @Deprecated
+    private static List<Item> searchBlacklisted = Lists.newArrayList();
     private ArgumentType argumentType;
     private ArgumentType argumentType;
     private String text;
     private String text;
     public final Function<String, Boolean> INCLUDE = s -> s.contains(text);
     public final Function<String, Boolean> INCLUDE = s -> s.contains(text);
     public final Function<String, Boolean> NOT_INCLUDE = s -> !s.contains(text);
     public final Function<String, Boolean> NOT_INCLUDE = s -> !s.contains(text);
     private boolean include;
     private boolean include;
-    
+
     public SearchArgument(ArgumentType argumentType, String text, boolean include) {
     public SearchArgument(ArgumentType argumentType, String text, boolean include) {
         this(argumentType, text, include, true);
         this(argumentType, text, include, true);
     }
     }
-    
+
     public SearchArgument(ArgumentType argumentType, String text, boolean include, boolean autoLowerCase) {
     public SearchArgument(ArgumentType argumentType, String text, boolean include, boolean autoLowerCase) {
         this.argumentType = argumentType;
         this.argumentType = argumentType;
         this.text = autoLowerCase ? text.toLowerCase(Locale.ROOT) : text;
         this.text = autoLowerCase ? text.toLowerCase(Locale.ROOT) : text;
         this.include = include;
         this.include = include;
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public static String tryGetEntryStackName(EntryStack stack) {
     public static String tryGetEntryStackName(EntryStack stack) {
         if (stack.getType() == EntryStack.Type.ITEM)
         if (stack.getType() == EntryStack.Type.ITEM)
@@ -56,7 +57,7 @@ public class SearchArgument {
             return tryGetFluidName(stack.getFluid());
             return tryGetFluidName(stack.getFluid());
         return "";
         return "";
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public static String tryGetEntryStackTooltip(EntryStack stack) {
     public static String tryGetEntryStackTooltip(EntryStack stack) {
         QueuedTooltip tooltip = stack.getTooltip(0, 0);
         QueuedTooltip tooltip = stack.getTooltip(0, 0);
@@ -64,7 +65,7 @@ public class SearchArgument {
             return CollectionUtils.joinToString(tooltip.getText(), "\n");
             return CollectionUtils.joinToString(tooltip.getText(), "\n");
         return "";
         return "";
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public static String tryGetFluidName(Fluid fluid) {
     public static String tryGetFluidName(Fluid fluid) {
         Identifier id = Registry.FLUID.getId(fluid);
         Identifier id = Registry.FLUID.getId(fluid);
@@ -72,7 +73,7 @@ public class SearchArgument {
             return I18n.translate("block." + id.toString().replaceFirst(":", "."));
             return I18n.translate("block." + id.toString().replaceFirst(":", "."));
         return CollectionUtils.mapAndJoinToString(id.getPath().split("_"), StringUtils::capitalize, " ");
         return CollectionUtils.mapAndJoinToString(id.getPath().split("_"), StringUtils::capitalize, " ");
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public static List<String> tryGetItemStackToolTip(ItemStack itemStack, boolean careAboutAdvanced) {
     public static List<String> tryGetItemStackToolTip(ItemStack itemStack, boolean careAboutAdvanced) {
         if (!searchBlacklisted.contains(itemStack.getItem()))
         if (!searchBlacklisted.contains(itemStack.getItem()))
@@ -84,7 +85,7 @@ public class SearchArgument {
             }
             }
         return Collections.singletonList(tryGetItemStackName(itemStack));
         return Collections.singletonList(tryGetItemStackName(itemStack));
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public static String tryGetItemStackName(ItemStack stack) {
     public static String tryGetItemStackName(ItemStack stack) {
         if (!searchBlacklisted.contains(stack.getItem()))
         if (!searchBlacklisted.contains(stack.getItem()))
@@ -101,28 +102,28 @@ public class SearchArgument {
         }
         }
         return "ERROR";
         return "ERROR";
     }
     }
-    
+
     public Function<String, Boolean> getFunction(boolean include) {
     public Function<String, Boolean> getFunction(boolean include) {
         return include ? INCLUDE : NOT_INCLUDE;
         return include ? INCLUDE : NOT_INCLUDE;
     }
     }
-    
+
     public ArgumentType getArgumentType() {
     public ArgumentType getArgumentType() {
         return argumentType;
         return argumentType;
     }
     }
-    
+
     public String getText() {
     public String getText() {
         return text;
         return text;
     }
     }
-    
+
     public boolean isInclude() {
     public boolean isInclude() {
         return include;
         return include;
     }
     }
-    
+
     @Override
     @Override
     public String toString() {
     public String toString() {
         return String.format("Argument[%s]: name = %s, include = %b", argumentType.name(), text, include);
         return String.format("Argument[%s]: name = %s, include = %b", argumentType.name(), text, include);
     }
     }
-    
+
     public enum ArgumentType {
     public enum ArgumentType {
         TEXT,
         TEXT,
         MOD,
         MOD,
@@ -130,20 +131,20 @@ public class SearchArgument {
         TAG,
         TAG,
         ALWAYS
         ALWAYS
     }
     }
-    
+
     @Deprecated
     @Deprecated
     @Internal
     @Internal
     public static class SearchArguments {
     public static class SearchArguments {
         public static final SearchArguments ALWAYS = new SearchArguments(new SearchArgument[]{SearchArgument.ALWAYS});
         public static final SearchArguments ALWAYS = new SearchArguments(new SearchArgument[]{SearchArgument.ALWAYS});
         private SearchArgument[] arguments;
         private SearchArgument[] arguments;
-        
+
         public SearchArguments(SearchArgument[] arguments) {
         public SearchArguments(SearchArgument[] arguments) {
             this.arguments = arguments;
             this.arguments = arguments;
         }
         }
-        
+
         public SearchArgument[] getArguments() {
         public SearchArgument[] getArguments() {
             return arguments;
             return arguments;
         }
         }
     }
     }
-    
+
 }
 }

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

@@ -9,23 +9,23 @@ public enum Weather {
     CLEAR(0, "text.rei.weather.clear"),
     CLEAR(0, "text.rei.weather.clear"),
     RAIN(1, "text.rei.weather.rain"),
     RAIN(1, "text.rei.weather.rain"),
     THUNDER(2, "text.rei.weather.thunder");
     THUNDER(2, "text.rei.weather.thunder");
-    
+
     private final int id;
     private final int id;
     private final String translateKey;
     private final String translateKey;
-    
+
     Weather(int id, String translateKey) {
     Weather(int id, String translateKey) {
         this.id = id;
         this.id = id;
         this.translateKey = translateKey;
         this.translateKey = translateKey;
     }
     }
-    
+
     public static Weather byId(int int_1) {
     public static Weather byId(int int_1) {
         return byId(int_1, CLEAR);
         return byId(int_1, CLEAR);
     }
     }
-    
+
     public static Weather byId(int int_1, Weather gameMode_1) {
     public static Weather byId(int int_1, Weather gameMode_1) {
         Weather[] var2 = values();
         Weather[] var2 = values();
         int var3 = var2.length;
         int var3 = var2.length;
-        
+
         for (int var4 = 0; var4 < var3; ++var4) {
         for (int var4 = 0; var4 < var3; ++var4) {
             Weather gameMode_2 = var2[var4];
             Weather gameMode_2 = var2[var4];
             if (gameMode_2.id == int_1)
             if (gameMode_2.id == int_1)
@@ -33,11 +33,11 @@ public enum Weather {
         }
         }
         return gameMode_1;
         return gameMode_1;
     }
     }
-    
+
     public int getId() {
     public int getId() {
         return id;
         return id;
     }
     }
-    
+
     public String getTranslateKey() {
     public String getTranslateKey() {
         return translateKey;
         return translateKey;
     }
     }

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

@@ -12,20 +12,20 @@ import org.spongepowered.asm.mixin.gen.Accessor;
 
 
 @Mixin(AbstractContainerScreen.class)
 @Mixin(AbstractContainerScreen.class)
 public interface ContainerScreenHooks {
 public interface ContainerScreenHooks {
-    
+
     @Accessor("x")
     @Accessor("x")
     int rei_getContainerLeft();
     int rei_getContainerLeft();
-    
+
     @Accessor("y")
     @Accessor("y")
     int rei_getContainerTop();
     int rei_getContainerTop();
-    
+
     @Accessor("containerWidth")
     @Accessor("containerWidth")
     int rei_getContainerWidth();
     int rei_getContainerWidth();
-    
+
     @Accessor("containerHeight")
     @Accessor("containerHeight")
     int rei_getContainerHeight();
     int rei_getContainerHeight();
-    
+
     @Accessor("focusedSlot")
     @Accessor("focusedSlot")
     Slot rei_getHoveredSlot();
     Slot rei_getHoveredSlot();
-    
+
 }
 }

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

@@ -16,14 +16,14 @@ import java.util.List;
 
 
 @Mixin(RecipeBookWidget.class)
 @Mixin(RecipeBookWidget.class)
 public interface RecipeBookGuiHooks {
 public interface RecipeBookGuiHooks {
-    
+
     @Accessor("ghostSlots")
     @Accessor("ghostSlots")
     RecipeBookGhostSlots rei_getGhostSlots();
     RecipeBookGhostSlots rei_getGhostSlots();
-    
+
     @Accessor("searchField")
     @Accessor("searchField")
     TextFieldWidget rei_getSearchField();
     TextFieldWidget rei_getSearchField();
-    
+
     @Accessor("tabButtons")
     @Accessor("tabButtons")
     List<RecipeGroupButtonWidget> rei_getTabButtons();
     List<RecipeGroupButtonWidget> rei_getTabButtons();
-    
+
 }
 }

+ 12 - 9
src/main/java/me/shedaniel/rei/mixin/MixinBrewingRecipeRegistry.java

@@ -27,23 +27,26 @@ import java.util.List;
 
 
 @Mixin(BrewingRecipeRegistry.class)
 @Mixin(BrewingRecipeRegistry.class)
 public class MixinBrewingRecipeRegistry {
 public class MixinBrewingRecipeRegistry {
-    
-    @Unique private static final List<BrewingRecipe> SELF_ITEM_RECIPES = Lists.newArrayList();
-    @Unique private static final List<Potion> REGISTERED_POTION_TYPES = Lists.newArrayList();
-    @Unique private static final List<Ingredient> SELF_POTION_TYPES = Lists.newArrayList();
-    
+
+    @Unique
+    private static final List<BrewingRecipe> SELF_ITEM_RECIPES = Lists.newArrayList();
+    @Unique
+    private static final List<Potion> REGISTERED_POTION_TYPES = Lists.newArrayList();
+    @Unique
+    private static final List<Ingredient> SELF_POTION_TYPES = Lists.newArrayList();
+
     @Inject(method = "registerPotionType", at = @At("RETURN"))
     @Inject(method = "registerPotionType", at = @At("RETURN"))
     private static void method_8080(Item item_1, CallbackInfo ci) {
     private static void method_8080(Item item_1, CallbackInfo ci) {
         if (item_1 instanceof PotionItem)
         if (item_1 instanceof PotionItem)
             SELF_POTION_TYPES.add(Ingredient.ofItems(new ItemConvertible[]{item_1}));
             SELF_POTION_TYPES.add(Ingredient.ofItems(new ItemConvertible[]{item_1}));
     }
     }
-    
+
     @Inject(method = "registerItemRecipe", at = @At("RETURN"))
     @Inject(method = "registerItemRecipe", at = @At("RETURN"))
     private static void method_8071(Item item_1, Item item_2, Item item_3, CallbackInfo ci) {
     private static void method_8071(Item item_1, Item item_2, Item item_3, CallbackInfo ci) {
         if (item_1 instanceof PotionItem && item_3 instanceof PotionItem)
         if (item_1 instanceof PotionItem && item_3 instanceof PotionItem)
             SELF_ITEM_RECIPES.add(new BrewingRecipe(item_1, Ingredient.ofItems(new ItemConvertible[]{item_2}), item_3));
             SELF_ITEM_RECIPES.add(new BrewingRecipe(item_1, Ingredient.ofItems(new ItemConvertible[]{item_2}), item_3));
     }
     }
-    
+
     @Inject(method = "registerPotionRecipe", at = @At("RETURN"))
     @Inject(method = "registerPotionRecipe", at = @At("RETURN"))
     private static void registerPotionRecipe(Potion potion_1, Item item_1, Potion potion_2, CallbackInfo ci) {
     private static void registerPotionRecipe(Potion potion_1, Item item_1, Potion potion_2, CallbackInfo ci) {
         if (!REGISTERED_POTION_TYPES.contains(potion_1))
         if (!REGISTERED_POTION_TYPES.contains(potion_1))
@@ -56,12 +59,12 @@ public class MixinBrewingRecipeRegistry {
             }
             }
         }
         }
     }
     }
-    
+
     private static void rei_registerPotionType(Potion potion) {
     private static void rei_registerPotionType(Potion potion) {
         REGISTERED_POTION_TYPES.add(potion);
         REGISTERED_POTION_TYPES.add(potion);
         for (BrewingRecipe recipe : SELF_ITEM_RECIPES) {
         for (BrewingRecipe recipe : SELF_ITEM_RECIPES) {
             DefaultPlugin.registerBrewingDisplay(new DefaultBrewingDisplay(PotionUtil.setPotion(recipe.input.getStackForRender(), potion), recipe.ingredient, PotionUtil.setPotion(recipe.output.getStackForRender(), potion)));
             DefaultPlugin.registerBrewingDisplay(new DefaultBrewingDisplay(PotionUtil.setPotion(recipe.input.getStackForRender(), potion), recipe.ingredient, PotionUtil.setPotion(recipe.output.getStackForRender(), potion)));
         }
         }
     }
     }
-    
+
 }
 }

+ 1 - 1
src/main/java/me/shedaniel/rei/mixin/MixinItemRenderer.java

@@ -18,7 +18,7 @@ import org.spongepowered.asm.mixin.Shadow;
 public abstract class MixinItemRenderer implements ItemRendererHooks {
 public abstract class MixinItemRenderer implements ItemRendererHooks {
     @Shadow
     @Shadow
     protected abstract void renderBakedItemModel(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrices, VertexConsumer vertices);
     protected abstract void renderBakedItemModel(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrices, VertexConsumer vertices);
-    
+
     @Override
     @Override
     public void rei_renderBakedItemModel(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrices, VertexConsumer vertices) {
     public void rei_renderBakedItemModel(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrices, VertexConsumer vertices) {
         this.renderBakedItemModel(model, stack, light, overlay, matrices, vertices);
         this.renderBakedItemModel(model, stack, light, overlay, matrices, vertices);

+ 3 - 3
src/main/java/me/shedaniel/rei/mixin/MixinItemStack.java

@@ -15,16 +15,16 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
 @Mixin(ItemStack.class)
 @Mixin(ItemStack.class)
 public class MixinItemStack implements ItemStackHook {
 public class MixinItemStack implements ItemStackHook {
     private boolean rei_dontRenderOverlay = false;
     private boolean rei_dontRenderOverlay = false;
-    
+
     @Override
     @Override
     public void rei_setRenderEnchantmentGlint(boolean b) {
     public void rei_setRenderEnchantmentGlint(boolean b) {
         rei_dontRenderOverlay = !b;
         rei_dontRenderOverlay = !b;
     }
     }
-    
+
     @Inject(method = "hasEnchantmentGlint", at = @At("HEAD"), cancellable = true)
     @Inject(method = "hasEnchantmentGlint", at = @At("HEAD"), cancellable = true)
     public void hasEnchantmentGlint(CallbackInfoReturnable<Boolean> callbackInfo) {
     public void hasEnchantmentGlint(CallbackInfoReturnable<Boolean> callbackInfo) {
         if (rei_dontRenderOverlay)
         if (rei_dontRenderOverlay)
             callbackInfo.setReturnValue(false);
             callbackInfo.setReturnValue(false);
     }
     }
-    
+
 }
 }

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

@@ -15,19 +15,19 @@ import net.fabricmc.loader.util.version.VersionParsingException;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.Identifier;
 
 
 public class DefaultAutoCraftingPlugin implements REIPluginV0 {
 public class DefaultAutoCraftingPlugin implements REIPluginV0 {
-    
+
     public static final Identifier PLUGIN = new Identifier("roughlyenoughitems", "default_auto_crafting_plugin");
     public static final Identifier PLUGIN = new Identifier("roughlyenoughitems", "default_auto_crafting_plugin");
-    
+
     @Override
     @Override
     public Identifier getPluginIdentifier() {
     public Identifier getPluginIdentifier() {
         return PLUGIN;
         return PLUGIN;
     }
     }
-    
+
     @Override
     @Override
     public SemanticVersion getMinimumVersion() throws VersionParsingException {
     public SemanticVersion getMinimumVersion() throws VersionParsingException {
         return SemanticVersion.parse("3.0-pre");
         return SemanticVersion.parse("3.0-pre");
     }
     }
-    
+
     @Override
     @Override
     public void registerOthers(RecipeHelper recipeHelper) {
     public void registerOthers(RecipeHelper recipeHelper) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {

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

@@ -55,7 +55,7 @@ import net.minecraft.util.registry.Registry;
 import java.util.*;
 import java.util.*;
 
 
 public class DefaultPlugin implements REIPluginV0 {
 public class DefaultPlugin implements REIPluginV0 {
-    
+
     public static final Identifier CRAFTING = new Identifier("minecraft", "plugins/crafting");
     public static final Identifier CRAFTING = new Identifier("minecraft", "plugins/crafting");
     public static final Identifier SMELTING = new Identifier("minecraft", "plugins/smelting");
     public static final Identifier SMELTING = new Identifier("minecraft", "plugins/smelting");
     public static final Identifier SMOKING = new Identifier("minecraft", "plugins/smoking");
     public static final Identifier SMOKING = new Identifier("minecraft", "plugins/smoking");
@@ -69,25 +69,25 @@ public class DefaultPlugin implements REIPluginV0 {
     private static final Identifier DISPLAY_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/display.png");
     private static final Identifier DISPLAY_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/display.png");
     private static final Identifier DISPLAY_TEXTURE_DARK = new Identifier("roughlyenoughitems", "textures/gui/display_dark.png");
     private static final Identifier DISPLAY_TEXTURE_DARK = new Identifier("roughlyenoughitems", "textures/gui/display_dark.png");
     private static final List<DefaultBrewingDisplay> BREWING_DISPLAYS = Lists.newArrayList();
     private static final List<DefaultBrewingDisplay> BREWING_DISPLAYS = Lists.newArrayList();
-    
+
     public static Identifier getDisplayTexture() {
     public static Identifier getDisplayTexture() {
         return ScreenHelper.isDarkModeEnabled() ? DISPLAY_TEXTURE_DARK : DISPLAY_TEXTURE;
         return ScreenHelper.isDarkModeEnabled() ? DISPLAY_TEXTURE_DARK : DISPLAY_TEXTURE;
     }
     }
-    
+
     public static void registerBrewingDisplay(DefaultBrewingDisplay display) {
     public static void registerBrewingDisplay(DefaultBrewingDisplay display) {
         BREWING_DISPLAYS.add(display);
         BREWING_DISPLAYS.add(display);
     }
     }
-    
+
     @Override
     @Override
     public Identifier getPluginIdentifier() {
     public Identifier getPluginIdentifier() {
         return PLUGIN;
         return PLUGIN;
     }
     }
-    
+
     @Override
     @Override
     public SemanticVersion getMinimumVersion() throws VersionParsingException {
     public SemanticVersion getMinimumVersion() throws VersionParsingException {
         return SemanticVersion.parse("3.0-pre");
         return SemanticVersion.parse("3.0-pre");
     }
     }
-    
+
     @Override
     @Override
     public void registerEntries(EntryRegistry entryRegistry) {
     public void registerEntries(EntryRegistry entryRegistry) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
@@ -124,7 +124,7 @@ public class DefaultPlugin implements REIPluginV0 {
                 entryRegistry.registerEntry(EntryStack.create(fluid));
                 entryRegistry.registerEntry(EntryStack.create(fluid));
         }
         }
     }
     }
-    
+
     @Override
     @Override
     public void registerPluginCategories(RecipeHelper recipeHelper) {
     public void registerPluginCategories(RecipeHelper recipeHelper) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
@@ -140,7 +140,7 @@ public class DefaultPlugin implements REIPluginV0 {
         recipeHelper.registerCategory(new DefaultCompostingCategory());
         recipeHelper.registerCategory(new DefaultCompostingCategory());
         recipeHelper.registerCategory(new DefaultStrippingCategory());
         recipeHelper.registerCategory(new DefaultStrippingCategory());
     }
     }
-    
+
     @Override
     @Override
     public void registerRecipeDisplays(RecipeHelper recipeHelper) {
     public void registerRecipeDisplays(RecipeHelper recipeHelper) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
@@ -194,7 +194,7 @@ public class DefaultPlugin implements REIPluginV0 {
             recipeHelper.registerDisplay(STRIPPING, new DefaultStrippingDisplay(new ItemStack(set.getKey()), new ItemStack(set.getValue())));
             recipeHelper.registerDisplay(STRIPPING, new DefaultStrippingDisplay(new ItemStack(set.getKey()), new ItemStack(set.getValue())));
         });
         });
     }
     }
-    
+
     @Override
     @Override
     public void postRegister() {
     public void postRegister() {
         // Sit tight! This will be a fast journey!
         // Sit tight! This will be a fast journey!
@@ -213,12 +213,12 @@ public class DefaultPlugin implements REIPluginV0 {
         time = System.currentTimeMillis() - time;
         time = System.currentTimeMillis() - time;
         RoughlyEnoughItemsCore.LOGGER.info("[REI] Applied Check Tags for potion in %dms.", time);
         RoughlyEnoughItemsCore.LOGGER.info("[REI] Applied Check Tags for potion in %dms.", time);
     }
     }
-    
+
     private void applyPotionTransformer(EntryStack stack) {
     private void applyPotionTransformer(EntryStack stack) {
         if (stack.getItem() instanceof PotionItem)
         if (stack.getItem() instanceof PotionItem)
             stack.addSetting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE);
             stack.addSetting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE);
     }
     }
-    
+
     @Override
     @Override
     public void registerBounds(DisplayHelper displayHelper) {
     public void registerBounds(DisplayHelper displayHelper) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
@@ -237,18 +237,18 @@ public class DefaultPlugin implements REIPluginV0 {
             public Class<?> getBaseSupportedClass() {
             public Class<?> getBaseSupportedClass() {
                 return AbstractContainerScreen.class;
                 return AbstractContainerScreen.class;
             }
             }
-            
+
             @Override
             @Override
             public Rectangle getLeftBounds(AbstractContainerScreen<?> screen) {
             public Rectangle getLeftBounds(AbstractContainerScreen<?> screen) {
                 return new Rectangle(2, 0, ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft() - 4, MinecraftClient.getInstance().getWindow().getScaledHeight());
                 return new Rectangle(2, 0, ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft() - 4, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
             }
-            
+
             @Override
             @Override
             public Rectangle getRightBounds(AbstractContainerScreen<?> screen) {
             public Rectangle getRightBounds(AbstractContainerScreen<?> screen) {
                 int startX = ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft() + ScreenHelper.getLastContainerScreenHooks().rei_getContainerWidth() + 2;
                 int startX = ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft() + ScreenHelper.getLastContainerScreenHooks().rei_getContainerWidth() + 2;
                 return new Rectangle(startX, 0, MinecraftClient.getInstance().getWindow().getScaledWidth() - startX - 2, MinecraftClient.getInstance().getWindow().getScaledHeight());
                 return new Rectangle(startX, 0, MinecraftClient.getInstance().getWindow().getScaledWidth() - startX - 2, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
             }
-            
+
             @Override
             @Override
             public float getPriority() {
             public float getPriority() {
                 return -1.0f;
                 return -1.0f;
@@ -259,18 +259,18 @@ public class DefaultPlugin implements REIPluginV0 {
             public Class<?> getBaseSupportedClass() {
             public Class<?> getBaseSupportedClass() {
                 return RecipeViewingScreen.class;
                 return RecipeViewingScreen.class;
             }
             }
-            
+
             @Override
             @Override
             public Rectangle getLeftBounds(RecipeViewingScreen screen) {
             public Rectangle getLeftBounds(RecipeViewingScreen screen) {
                 return new Rectangle(2, 0, ((RecipeViewingScreen) screen).getBounds().x - 4, MinecraftClient.getInstance().getWindow().getScaledHeight());
                 return new Rectangle(2, 0, ((RecipeViewingScreen) screen).getBounds().x - 4, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
             }
-            
+
             @Override
             @Override
             public Rectangle getRightBounds(RecipeViewingScreen screen) {
             public Rectangle getRightBounds(RecipeViewingScreen screen) {
                 int startX = ((RecipeViewingScreen) screen).getBounds().x + ((RecipeViewingScreen) screen).getBounds().width + 2;
                 int startX = ((RecipeViewingScreen) screen).getBounds().x + ((RecipeViewingScreen) screen).getBounds().width + 2;
                 return new Rectangle(startX, 0, MinecraftClient.getInstance().getWindow().getScaledWidth() - startX - 2, MinecraftClient.getInstance().getWindow().getScaledHeight());
                 return new Rectangle(startX, 0, MinecraftClient.getInstance().getWindow().getScaledWidth() - startX - 2, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
             }
-            
+
             @Override
             @Override
             public float getPriority() {
             public float getPriority() {
                 return -1.0f;
                 return -1.0f;
@@ -281,25 +281,25 @@ public class DefaultPlugin implements REIPluginV0 {
             public Class<?> getBaseSupportedClass() {
             public Class<?> getBaseSupportedClass() {
                 return VillagerRecipeViewingScreen.class;
                 return VillagerRecipeViewingScreen.class;
             }
             }
-            
+
             @Override
             @Override
             public Rectangle getLeftBounds(VillagerRecipeViewingScreen screen) {
             public Rectangle getLeftBounds(VillagerRecipeViewingScreen screen) {
                 return new Rectangle(2, 0, ((VillagerRecipeViewingScreen) screen).bounds.x - 4, MinecraftClient.getInstance().getWindow().getScaledHeight());
                 return new Rectangle(2, 0, ((VillagerRecipeViewingScreen) screen).bounds.x - 4, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
             }
-            
+
             @Override
             @Override
             public Rectangle getRightBounds(VillagerRecipeViewingScreen screen) {
             public Rectangle getRightBounds(VillagerRecipeViewingScreen screen) {
                 int startX = ((VillagerRecipeViewingScreen) screen).bounds.x + ((VillagerRecipeViewingScreen) screen).bounds.width + 2;
                 int startX = ((VillagerRecipeViewingScreen) screen).bounds.x + ((VillagerRecipeViewingScreen) screen).bounds.width + 2;
                 return new Rectangle(startX, 0, MinecraftClient.getInstance().getWindow().getScaledWidth() - startX - 2, MinecraftClient.getInstance().getWindow().getScaledHeight());
                 return new Rectangle(startX, 0, MinecraftClient.getInstance().getWindow().getScaledWidth() - startX - 2, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
             }
-            
+
             @Override
             @Override
             public float getPriority() {
             public float getPriority() {
                 return -1.0f;
                 return -1.0f;
             }
             }
         });
         });
     }
     }
-    
+
     @Override
     @Override
     public void registerOthers(RecipeHelper recipeHelper) {
     public void registerOthers(RecipeHelper recipeHelper) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
@@ -322,10 +322,10 @@ public class DefaultPlugin implements REIPluginV0 {
         recipeHelper.registerScreenClickArea(new Rectangle(78, 32, 28, 23), SmokerScreen.class, SMOKING);
         recipeHelper.registerScreenClickArea(new Rectangle(78, 32, 28, 23), SmokerScreen.class, SMOKING);
         recipeHelper.registerScreenClickArea(new Rectangle(78, 32, 28, 23), BlastFurnaceScreen.class, BLASTING);
         recipeHelper.registerScreenClickArea(new Rectangle(78, 32, 28, 23), BlastFurnaceScreen.class, BLASTING);
     }
     }
-    
+
     @Override
     @Override
     public int getPriority() {
     public int getPriority() {
         return -1;
         return -1;
     }
     }
-    
+
 }
 }

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

@@ -19,7 +19,7 @@ import java.util.List;
 import java.util.function.Supplier;
 import java.util.function.Supplier;
 
 
 public class DefaultRecipeBookExclusionZones implements Supplier<List<Rectangle>> {
 public class DefaultRecipeBookExclusionZones implements Supplier<List<Rectangle>> {
-    
+
     @Override
     @Override
     public List<Rectangle> get() {
     public List<Rectangle> get() {
         if (!MinecraftClient.getInstance().player.getRecipeBook().isGuiOpen() || !(MinecraftClient.getInstance().currentScreen instanceof RecipeBookProvider) || !(ScreenHelper.getLastContainerScreen().getContainer() instanceof CraftingContainer))
         if (!MinecraftClient.getInstance().player.getRecipeBook().isGuiOpen() || !(MinecraftClient.getInstance().currentScreen instanceof RecipeBookProvider) || !(ScreenHelper.getLastContainerScreen().getContainer() instanceof CraftingContainer))
@@ -31,5 +31,5 @@ public class DefaultRecipeBookExclusionZones implements Supplier<List<Rectangle>
             l.add(new Rectangle(screenHooks.rei_getContainerLeft() - 4 - 145 - 30, screenHooks.rei_getContainerTop(), 30, size * 27));
             l.add(new Rectangle(screenHooks.rei_getContainerLeft() - 4 - 145 - 30, screenHooks.rei_getContainerTop(), 30, size * 27));
         return l;
         return l;
     }
     }
-    
+
 }
 }

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

@@ -29,11 +29,11 @@ import net.minecraft.util.PacketByteBuf;
 import java.util.List;
 import java.util.List;
 
 
 public class DefaultCategoryHandler implements AutoTransferHandler {
 public class DefaultCategoryHandler implements AutoTransferHandler {
-    
+
     public static boolean canUseMovePackets() {
     public static boolean canUseMovePackets() {
         return ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.MOVE_ITEMS_PACKET);
         return ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.MOVE_ITEMS_PACKET);
     }
     }
-    
+
     @Override
     @Override
     public Result handle(Context context) {
     public Result handle(Context context) {
         if (!(context.getRecipe() instanceof TransferRecipeDisplay))
         if (!(context.getRecipe() instanceof TransferRecipeDisplay))
@@ -54,14 +54,14 @@ public class DefaultCategoryHandler implements AutoTransferHandler {
             return Result.createFailed("error.rei.not.on.server");
             return Result.createFailed("error.rei.not.on.server");
         if (!context.isActuallyCrafting())
         if (!context.isActuallyCrafting())
             return Result.createSuccessful();
             return Result.createSuccessful();
-        
+
         context.getMinecraft().openScreen(containerScreen);
         context.getMinecraft().openScreen(containerScreen);
         if (containerScreen instanceof RecipeBookProvider)
         if (containerScreen instanceof RecipeBookProvider)
             ((RecipeBookGuiHooks) ((RecipeBookProvider) containerScreen).getRecipeBookGui()).rei_getGhostSlots().reset();
             ((RecipeBookGuiHooks) ((RecipeBookProvider) containerScreen).getRecipeBookGui()).rei_getGhostSlots().reset();
         PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
         PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
         buf.writeIdentifier(recipe.getRecipeCategory());
         buf.writeIdentifier(recipe.getRecipeCategory());
         buf.writeBoolean(Screen.hasShiftDown());
         buf.writeBoolean(Screen.hasShiftDown());
-        
+
         buf.writeInt(input.size());
         buf.writeInt(input.size());
         for (List<EntryStack> stacks : input) {
         for (List<EntryStack> stacks : input) {
             buf.writeInt(stacks.size());
             buf.writeInt(stacks.size());
@@ -75,12 +75,12 @@ public class DefaultCategoryHandler implements AutoTransferHandler {
         ClientSidePacketRegistry.INSTANCE.sendToServer(RoughlyEnoughItemsNetwork.MOVE_ITEMS_PACKET, buf);
         ClientSidePacketRegistry.INSTANCE.sendToServer(RoughlyEnoughItemsNetwork.MOVE_ITEMS_PACKET, buf);
         return Result.createSuccessful();
         return Result.createSuccessful();
     }
     }
-    
+
     @Override
     @Override
     public double getPriority() {
     public double getPriority() {
         return -10;
         return -10;
     }
     }
-    
+
     public IntList hasItems(List<List<EntryStack>> inputs) {
     public IntList hasItems(List<List<EntryStack>> inputs) {
         // Create a clone of player's inventory, and count
         // Create a clone of player's inventory, and count
         DefaultedList<ItemStack> copyMain = DefaultedList.of();
         DefaultedList<ItemStack> copyMain = DefaultedList.of();

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

@@ -73,7 +73,7 @@ public class DefaultRecipeBookHandler implements AutoTransferHandler {
         }
         }
         return Result.createNotApplicable();
         return Result.createNotApplicable();
     }
     }
-    
+
     @Override
     @Override
     public double getPriority() {
     public double getPriority() {
         return -20;
         return -20;

+ 2 - 2
src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingDisplay.java

@@ -11,11 +11,11 @@ import net.minecraft.recipe.BlastingRecipe;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.Identifier;
 
 
 public class DefaultBlastingDisplay extends DefaultCookingDisplay {
 public class DefaultBlastingDisplay extends DefaultCookingDisplay {
-    
+
     public DefaultBlastingDisplay(BlastingRecipe recipe) {
     public DefaultBlastingDisplay(BlastingRecipe recipe) {
         super(recipe);
         super(recipe);
     }
     }
-    
+
     @Override
     @Override
     public Identifier getRecipeCategory() {
     public Identifier getRecipeCategory() {
         return DefaultPlugin.BLASTING;
         return DefaultPlugin.BLASTING;

+ 3 - 3
src/main/java/me/shedaniel/rei/plugin/brewing/BrewingRecipe.java

@@ -9,15 +9,15 @@ import net.minecraft.item.Item;
 import net.minecraft.recipe.Ingredient;
 import net.minecraft.recipe.Ingredient;
 
 
 public class BrewingRecipe {
 public class BrewingRecipe {
-    
+
     public final Item input;
     public final Item input;
     public final Ingredient ingredient;
     public final Ingredient ingredient;
     public final Item output;
     public final Item output;
-    
+
     public BrewingRecipe(Item object_1, Ingredient ingredient_1, Item object_2) {
     public BrewingRecipe(Item object_1, Ingredient ingredient_1, Item object_2) {
         this.input = object_1;
         this.input = object_1;
         this.ingredient = ingredient_1;
         this.ingredient = ingredient_1;
         this.output = object_2;
         this.output = object_2;
     }
     }
-    
+
 }
 }

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

@@ -26,22 +26,22 @@ import java.util.List;
 import java.util.function.Supplier;
 import java.util.function.Supplier;
 
 
 public class DefaultBrewingCategory implements RecipeCategory<DefaultBrewingDisplay> {
 public class DefaultBrewingCategory implements RecipeCategory<DefaultBrewingDisplay> {
-    
+
     @Override
     @Override
     public Identifier getIdentifier() {
     public Identifier getIdentifier() {
         return DefaultPlugin.BREWING;
         return DefaultPlugin.BREWING;
     }
     }
-    
+
     @Override
     @Override
     public EntryStack getLogo() {
     public EntryStack getLogo() {
         return EntryStack.create(Blocks.BREWING_STAND);
         return EntryStack.create(Blocks.BREWING_STAND);
     }
     }
-    
+
     @Override
     @Override
     public String getCategoryName() {
     public String getCategoryName() {
         return I18n.translate("category.rei.brewing");
         return I18n.translate("category.rei.brewing");
     }
     }
-    
+
     @Override
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultBrewingDisplay> recipeDisplaySupplier, Rectangle bounds) {
     public List<Widget> setupDisplay(Supplier<DefaultBrewingDisplay> recipeDisplaySupplier, Rectangle bounds) {
         final DefaultBrewingDisplay recipeDisplay = recipeDisplaySupplier.get();
         final DefaultBrewingDisplay recipeDisplay = recipeDisplaySupplier.get();
@@ -64,5 +64,5 @@ public class DefaultBrewingCategory implements RecipeCategory<DefaultBrewingDisp
         widgets.add(EntryWidget.create(startPoint.x + 86, startPoint.y + 35).entries(recipeDisplay.getOutput(2)).noBackground());
         widgets.add(EntryWidget.create(startPoint.x + 86, startPoint.y + 35).entries(recipeDisplay.getOutput(2)).noBackground());
         return widgets;
         return widgets;
     }
     }
-    
+
 }
 }

+ 7 - 7
src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java

@@ -20,10 +20,10 @@ import java.util.Collections;
 import java.util.List;
 import java.util.List;
 
 
 public class DefaultBrewingDisplay implements RecipeDisplay {
 public class DefaultBrewingDisplay implements RecipeDisplay {
-    
+
     private EntryStack input, output;
     private EntryStack input, output;
     private List<EntryStack> reactant;
     private List<EntryStack> reactant;
-    
+
     public DefaultBrewingDisplay(ItemStack input, Ingredient reactant, ItemStack output) {
     public DefaultBrewingDisplay(ItemStack input, Ingredient reactant, ItemStack output) {
         this.input = EntryStack.create(input).setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(Formatting.YELLOW.toString() + I18n.translate("category.rei.brewing.input")));
         this.input = EntryStack.create(input).setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(Formatting.YELLOW.toString() + I18n.translate("category.rei.brewing.input")));
         this.reactant = new ArrayList<>();
         this.reactant = new ArrayList<>();
@@ -34,22 +34,22 @@ public class DefaultBrewingDisplay implements RecipeDisplay {
         }
         }
         this.output = EntryStack.create(output).setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(Formatting.YELLOW.toString() + I18n.translate("category.rei.brewing.result")));
         this.output = EntryStack.create(output).setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(Formatting.YELLOW.toString() + I18n.translate("category.rei.brewing.result")));
     }
     }
-    
+
     @Override
     @Override
     public List<List<EntryStack>> getInputEntries() {
     public List<List<EntryStack>> getInputEntries() {
         return Lists.newArrayList(Collections.singletonList(input), reactant);
         return Lists.newArrayList(Collections.singletonList(input), reactant);
     }
     }
-    
+
     @Override
     @Override
     public List<EntryStack> getOutputEntries() {
     public List<EntryStack> getOutputEntries() {
         return Collections.singletonList(output);
         return Collections.singletonList(output);
     }
     }
-    
+
     @Override
     @Override
     public Identifier getRecipeCategory() {
     public Identifier getRecipeCategory() {
         return DefaultPlugin.BREWING;
         return DefaultPlugin.BREWING;
     }
     }
-    
+
     public List<EntryStack> getOutput(int slot) {
     public List<EntryStack> getOutput(int slot) {
         List<EntryStack> stack = new ArrayList<>();
         List<EntryStack> stack = new ArrayList<>();
         for (int i = 0; i < slot * 2; i++)
         for (int i = 0; i < slot * 2; i++)
@@ -58,7 +58,7 @@ public class DefaultBrewingDisplay implements RecipeDisplay {
             stack.addAll(getOutputEntries());
             stack.addAll(getOutputEntries());
         return stack;
         return stack;
     }
     }
-    
+
     @Override
     @Override
     public List<List<EntryStack>> getRequiredEntries() {
     public List<List<EntryStack>> getRequiredEntries() {
         return getInputEntries();
         return getInputEntries();

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

@@ -27,22 +27,22 @@ import java.util.List;
 import java.util.function.Supplier;
 import java.util.function.Supplier;
 
 
 public class DefaultCampfireCategory implements RecipeCategory<DefaultCampfireDisplay> {
 public class DefaultCampfireCategory implements RecipeCategory<DefaultCampfireDisplay> {
-    
+
     @Override
     @Override
     public Identifier getIdentifier() {
     public Identifier getIdentifier() {
         return DefaultPlugin.CAMPFIRE;
         return DefaultPlugin.CAMPFIRE;
     }
     }
-    
+
     @Override
     @Override
     public EntryStack getLogo() {
     public EntryStack getLogo() {
         return EntryStack.create(Blocks.CAMPFIRE);
         return EntryStack.create(Blocks.CAMPFIRE);
     }
     }
-    
+
     @Override
     @Override
     public String getCategoryName() {
     public String getCategoryName() {
         return I18n.translate("category.rei.campfire");
         return I18n.translate("category.rei.campfire");
     }
     }
-    
+
     @Override
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultCampfireDisplay> recipeDisplaySupplier, Rectangle bounds) {
     public List<Widget> setupDisplay(Supplier<DefaultCampfireDisplay> recipeDisplaySupplier, Rectangle bounds) {
         Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
         Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
@@ -64,5 +64,5 @@ public class DefaultCampfireCategory implements RecipeCategory<DefaultCampfireDi
         widgets.add(EntryWidget.create(startPoint.x + 61, startPoint.y + 19).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
         widgets.add(EntryWidget.create(startPoint.x + 61, startPoint.y + 19).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
         return widgets;
         return widgets;
     }
     }
-    
+
 }
 }

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

@@ -22,17 +22,17 @@ import java.util.Optional;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 public class DefaultCampfireDisplay implements RecipeDisplay {
 public class DefaultCampfireDisplay implements RecipeDisplay {
-    
+
     private List<List<EntryStack>> inputs;
     private List<List<EntryStack>> inputs;
     private List<EntryStack> output;
     private List<EntryStack> output;
     private int cookTime;
     private int cookTime;
     private CampfireCookingRecipe display;
     private CampfireCookingRecipe display;
-    
+
     public DefaultCampfireDisplay(CampfireCookingRecipe recipe) {
     public DefaultCampfireDisplay(CampfireCookingRecipe recipe) {
         this(recipe.getPreviewInputs(), recipe.getOutput(), recipe.getCookTime());
         this(recipe.getPreviewInputs(), recipe.getOutput(), recipe.getCookTime());
         this.display = recipe;
         this.display = recipe;
     }
     }
-    
+
     public DefaultCampfireDisplay(DefaultedList<Ingredient> ingredients, ItemStack output, int cookTime) {
     public DefaultCampfireDisplay(DefaultedList<Ingredient> ingredients, ItemStack output, int cookTime) {
         this.inputs = ingredients.stream().map(i -> {
         this.inputs = ingredients.stream().map(i -> {
             List<EntryStack> entries = new ArrayList<>();
             List<EntryStack> entries = new ArrayList<>();
@@ -44,34 +44,34 @@ public class DefaultCampfireDisplay implements RecipeDisplay {
         this.output = Collections.singletonList(EntryStack.create(output));
         this.output = Collections.singletonList(EntryStack.create(output));
         this.cookTime = cookTime;
         this.cookTime = cookTime;
     }
     }
-    
+
     public int getCookTime() {
     public int getCookTime() {
         return cookTime;
         return cookTime;
     }
     }
-    
+
     @Override
     @Override
     public Optional<Identifier> getRecipeLocation() {
     public Optional<Identifier> getRecipeLocation() {
         return Optional.ofNullable(display).map(AbstractCookingRecipe::getId);
         return Optional.ofNullable(display).map(AbstractCookingRecipe::getId);
     }
     }
-    
+
     @Override
     @Override
     public List<List<EntryStack>> getInputEntries() {
     public List<List<EntryStack>> getInputEntries() {
         return inputs;
         return inputs;
     }
     }
-    
+
     @Override
     @Override
     public List<EntryStack> getOutputEntries() {
     public List<EntryStack> getOutputEntries() {
         return output;
         return output;
     }
     }
-    
+
     @Override
     @Override
     public List<List<EntryStack>> getRequiredEntries() {
     public List<List<EntryStack>> getRequiredEntries() {
         return inputs;
         return inputs;
     }
     }
-    
+
     @Override
     @Override
     public Identifier getRecipeCategory() {
     public Identifier getRecipeCategory() {
         return DefaultPlugin.CAMPFIRE;
         return DefaultPlugin.CAMPFIRE;
     }
     }
-    
+
 }
 }

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

@@ -31,22 +31,22 @@ import java.util.Map;
 import java.util.function.Supplier;
 import java.util.function.Supplier;
 
 
 public class DefaultCompostingCategory implements RecipeCategory<DefaultCompostingDisplay> {
 public class DefaultCompostingCategory implements RecipeCategory<DefaultCompostingDisplay> {
-    
+
     @Override
     @Override
     public Identifier getIdentifier() {
     public Identifier getIdentifier() {
         return DefaultPlugin.COMPOSTING;
         return DefaultPlugin.COMPOSTING;
     }
     }
-    
+
     @Override
     @Override
     public EntryStack getLogo() {
     public EntryStack getLogo() {
         return EntryStack.create(Blocks.COMPOSTER);
         return EntryStack.create(Blocks.COMPOSTER);
     }
     }
-    
+
     @Override
     @Override
     public String getCategoryName() {
     public String getCategoryName() {
         return I18n.translate("category.rei.composting");
         return I18n.translate("category.rei.composting");
     }
     }
-    
+
     @Override
     @Override
     public RecipeEntry getSimpleRenderer(DefaultCompostingDisplay recipe) {
     public RecipeEntry getSimpleRenderer(DefaultCompostingDisplay recipe) {
         return new RecipeEntry() {
         return new RecipeEntry() {
@@ -54,20 +54,20 @@ public class DefaultCompostingCategory implements RecipeCategory<DefaultComposti
             public int getHeight() {
             public int getHeight() {
                 return 10 + MinecraftClient.getInstance().textRenderer.fontHeight;
                 return 10 + MinecraftClient.getInstance().textRenderer.fontHeight;
             }
             }
-            
+
             @Nullable
             @Nullable
             @Override
             @Override
             public QueuedTooltip getTooltip(int mouseX, int mouseY) {
             public QueuedTooltip getTooltip(int mouseX, int mouseY) {
                 return null;
                 return null;
             }
             }
-            
+
             @Override
             @Override
             public void render(Rectangle rectangle, int mouseX, int mouseY, float delta) {
             public void render(Rectangle rectangle, int mouseX, int mouseY, float delta) {
                 MinecraftClient.getInstance().textRenderer.draw(I18n.translate("text.rei.composting.page", recipe.getPage() + 1), rectangle.x + 5, rectangle.y + 6, -1);
                 MinecraftClient.getInstance().textRenderer.draw(I18n.translate("text.rei.composting.page", recipe.getPage() + 1), rectangle.x + 5, rectangle.y + 6, -1);
             }
             }
         };
         };
     }
     }
-    
+
     @Override
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultCompostingDisplay> recipeDisplaySupplier, Rectangle bounds) {
     public List<Widget> setupDisplay(Supplier<DefaultCompostingDisplay> recipeDisplaySupplier, Rectangle bounds) {
         List<Widget> widgets = Lists.newArrayList();
         List<Widget> widgets = Lists.newArrayList();
@@ -98,12 +98,12 @@ public class DefaultCompostingCategory implements RecipeCategory<DefaultComposti
         widgets.add(EntryWidget.create(startingPoint.x + 34, startingPoint.y + 5).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
         widgets.add(EntryWidget.create(startingPoint.x + 34, startingPoint.y + 5).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
         return widgets;
         return widgets;
     }
     }
-    
+
     @Override
     @Override
     public int getDisplayHeight() {
     public int getDisplayHeight() {
         return 140;
         return 140;
     }
     }
-    
+
     @SuppressWarnings("deprecation")
     @SuppressWarnings("deprecation")
     @Override
     @Override
     public int getFixedRecipesPerPage() {
     public int getFixedRecipesPerPage() {

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

@@ -16,12 +16,12 @@ import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 public class DefaultCompostingDisplay implements RecipeDisplay {
 public class DefaultCompostingDisplay implements RecipeDisplay {
-    
+
     private List<EntryStack> order, allItems;
     private List<EntryStack> order, allItems;
     private Map<ItemConvertible, Float> inputMap;
     private Map<ItemConvertible, Float> inputMap;
     private List<EntryStack> output;
     private List<EntryStack> output;
     private int page;
     private int page;
-    
+
     public DefaultCompostingDisplay(int page, List<ItemConvertible> order, Map<ItemConvertible, Float> inputMap, List<ItemConvertible> allItems, ItemStack[] output) {
     public DefaultCompostingDisplay(int page, List<ItemConvertible> order, Map<ItemConvertible, Float> inputMap, List<ItemConvertible> allItems, ItemStack[] output) {
         this.page = page;
         this.page = page;
         this.order = order.stream().map(EntryStack::create).collect(Collectors.toList());
         this.order = order.stream().map(EntryStack::create).collect(Collectors.toList());
@@ -29,11 +29,11 @@ public class DefaultCompostingDisplay implements RecipeDisplay {
         this.output = Arrays.asList(output).stream().map(EntryStack::create).collect(Collectors.toList());
         this.output = Arrays.asList(output).stream().map(EntryStack::create).collect(Collectors.toList());
         this.allItems = allItems.stream().map(EntryStack::create).collect(Collectors.toList());
         this.allItems = allItems.stream().map(EntryStack::create).collect(Collectors.toList());
     }
     }
-    
+
     public int getPage() {
     public int getPage() {
         return page;
         return page;
     }
     }
-    
+
     @Override
     @Override
     public List<List<EntryStack>> getInputEntries() {
     public List<List<EntryStack>> getInputEntries() {
         List<List<EntryStack>> lists = new ArrayList<>();
         List<List<EntryStack>> lists = new ArrayList<>();
@@ -42,28 +42,28 @@ public class DefaultCompostingDisplay implements RecipeDisplay {
         }
         }
         return lists;
         return lists;
     }
     }
-    
+
     public Map<ItemConvertible, Float> getInputMap() {
     public Map<ItemConvertible, Float> getInputMap() {
         return inputMap;
         return inputMap;
     }
     }
-    
+
     @Override
     @Override
     public List<EntryStack> getOutputEntries() {
     public List<EntryStack> getOutputEntries() {
         return output;
         return output;
     }
     }
-    
+
     @Override
     @Override
     public Identifier getRecipeCategory() {
     public Identifier getRecipeCategory() {
         return DefaultPlugin.COMPOSTING;
         return DefaultPlugin.COMPOSTING;
     }
     }
-    
+
     @Override
     @Override
     public List<List<EntryStack>> getRequiredEntries() {
     public List<List<EntryStack>> getRequiredEntries() {
         return Collections.singletonList(allItems);
         return Collections.singletonList(allItems);
     }
     }
-    
+
     public List<EntryStack> getItemsByOrder() {
     public List<EntryStack> getItemsByOrder() {
         return order;
         return order;
     }
     }
-    
+
 }
 }

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

@@ -13,40 +13,40 @@ import net.minecraft.item.ItemStack;
 
 
 public class CraftingContainerInfoWrapper<T extends CraftingContainer<?>> implements ContainerInfo<T> {
 public class CraftingContainerInfoWrapper<T extends CraftingContainer<?>> implements ContainerInfo<T> {
     private Class<? extends CraftingContainer<?>> containerClass;
     private Class<? extends CraftingContainer<?>> containerClass;
-    
+
     public <T extends CraftingContainer<?>> CraftingContainerInfoWrapper(Class<T> containerClass) {
     public <T extends CraftingContainer<?>> CraftingContainerInfoWrapper(Class<T> containerClass) {
         this.containerClass = containerClass;
         this.containerClass = containerClass;
     }
     }
-    
+
     public static <T extends CraftingContainer<?>> ContainerInfo<T> create(Class<T> containerClass) {
     public static <T extends CraftingContainer<?>> ContainerInfo<T> create(Class<T> containerClass) {
         return new CraftingContainerInfoWrapper<T>(containerClass);
         return new CraftingContainerInfoWrapper<T>(containerClass);
     }
     }
-    
+
     @Override
     @Override
     public Class<? extends Container> getContainerClass() {
     public Class<? extends Container> getContainerClass() {
         return containerClass;
         return containerClass;
     }
     }
-    
+
     @Override
     @Override
     public int getCraftingResultSlotIndex(T container) {
     public int getCraftingResultSlotIndex(T container) {
         return container.getCraftingResultSlotIndex();
         return container.getCraftingResultSlotIndex();
     }
     }
-    
+
     @Override
     @Override
     public int getCraftingWidth(T container) {
     public int getCraftingWidth(T container) {
         return container.getCraftingWidth();
         return container.getCraftingWidth();
     }
     }
-    
+
     @Override
     @Override
     public int getCraftingHeight(T container) {
     public int getCraftingHeight(T container) {
         return container.getCraftingHeight();
         return container.getCraftingHeight();
     }
     }
-    
+
     @Override
     @Override
     public void clearCraftingSlots(T container) {
     public void clearCraftingSlots(T container) {
         container.clearCraftingSlots();
         container.clearCraftingSlots();
     }
     }
-    
+
     @Override
     @Override
     public void populateRecipeFinder(T container, RecipeFinder var1) {
     public void populateRecipeFinder(T container, RecipeFinder var1) {
         container.populateRecipeFinder(new net.minecraft.recipe.RecipeFinder() {
         container.populateRecipeFinder(new net.minecraft.recipe.RecipeFinder() {

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

@@ -33,13 +33,13 @@ public class DefaultCookingCategory implements TransferRecipeCategory<DefaultCoo
     private Identifier identifier;
     private Identifier identifier;
     private EntryStack logo;
     private EntryStack logo;
     private String categoryName;
     private String categoryName;
-    
+
     public DefaultCookingCategory(Identifier identifier, EntryStack logo, String categoryName) {
     public DefaultCookingCategory(Identifier identifier, EntryStack logo, String categoryName) {
         this.identifier = identifier;
         this.identifier = identifier;
         this.logo = logo;
         this.logo = logo;
         this.categoryName = categoryName;
         this.categoryName = categoryName;
     }
     }
-    
+
     @Override
     @Override
     public void renderRedSlots(List<Widget> widgets, Rectangle bounds, DefaultCookingDisplay display, IntList redSlots) {
     public void renderRedSlots(List<Widget> widgets, Rectangle bounds, DefaultCookingDisplay display, IntList redSlots) {
         Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
         Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
@@ -49,7 +49,7 @@ public class DefaultCookingCategory implements TransferRecipeCategory<DefaultCoo
         }
         }
         RenderSystem.translatef(0, 0, -400);
         RenderSystem.translatef(0, 0, -400);
     }
     }
-    
+
     @Override
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultCookingDisplay> recipeDisplaySupplier, Rectangle bounds) {
     public List<Widget> setupDisplay(Supplier<DefaultCookingDisplay> recipeDisplaySupplier, Rectangle bounds) {
         Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
         Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
@@ -70,22 +70,22 @@ public class DefaultCookingCategory implements TransferRecipeCategory<DefaultCoo
         widgets.add(EntryWidget.create(startPoint.x + 61, startPoint.y + 19).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
         widgets.add(EntryWidget.create(startPoint.x + 61, startPoint.y + 19).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
         return widgets;
         return widgets;
     }
     }
-    
+
     @Override
     @Override
     public RecipeEntry getSimpleRenderer(DefaultCookingDisplay recipe) {
     public RecipeEntry getSimpleRenderer(DefaultCookingDisplay recipe) {
         return SimpleRecipeEntry.create(Collections.singletonList(recipe.getInputEntries().get(0)), recipe.getOutputEntries());
         return SimpleRecipeEntry.create(Collections.singletonList(recipe.getInputEntries().get(0)), recipe.getOutputEntries());
     }
     }
-    
+
     @Override
     @Override
     public Identifier getIdentifier() {
     public Identifier getIdentifier() {
         return identifier;
         return identifier;
     }
     }
-    
+
     @Override
     @Override
     public EntryStack getLogo() {
     public EntryStack getLogo() {
         return logo;
         return logo;
     }
     }
-    
+
     @Override
     @Override
     public String getCategoryName() {
     public String getCategoryName() {
         return I18n.translate(categoryName);
         return I18n.translate(categoryName);

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

@@ -28,7 +28,7 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay {
     private AbstractCookingRecipe recipe;
     private AbstractCookingRecipe recipe;
     private List<List<EntryStack>> input;
     private List<List<EntryStack>> input;
     private List<EntryStack> output;
     private List<EntryStack> output;
-    
+
     public DefaultCookingDisplay(AbstractCookingRecipe recipe) {
     public DefaultCookingDisplay(AbstractCookingRecipe recipe) {
         this.recipe = recipe;
         this.recipe = recipe;
         this.input = recipe.getPreviewInputs().stream().map(i -> {
         this.input = recipe.getPreviewInputs().stream().map(i -> {
@@ -41,49 +41,49 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay {
         this.input.add(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()));
         this.input.add(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()));
         this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
         this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
     }
     }
-    
+
     @Override
     @Override
     public Optional<Identifier> getRecipeLocation() {
     public Optional<Identifier> getRecipeLocation() {
         return Optional.ofNullable(recipe).map(AbstractCookingRecipe::getId);
         return Optional.ofNullable(recipe).map(AbstractCookingRecipe::getId);
     }
     }
-    
+
     @Override
     @Override
     public List<List<EntryStack>> getInputEntries() {
     public List<List<EntryStack>> getInputEntries() {
         return input;
         return input;
     }
     }
-    
+
     @Override
     @Override
     public List<EntryStack> getOutputEntries() {
     public List<EntryStack> getOutputEntries() {
         return output;
         return output;
     }
     }
-    
+
     public List<EntryStack> getFuel() {
     public List<EntryStack> getFuel() {
         return input.get(1);
         return input.get(1);
     }
     }
-    
+
     @Override
     @Override
     public List<List<EntryStack>> getRequiredEntries() {
     public List<List<EntryStack>> getRequiredEntries() {
         return input;
         return input;
     }
     }
-    
+
     @Deprecated
     @Deprecated
     public Optional<AbstractCookingRecipe> getOptionalRecipe() {
     public Optional<AbstractCookingRecipe> getOptionalRecipe() {
         return Optional.ofNullable(recipe);
         return Optional.ofNullable(recipe);
     }
     }
-    
+
     @Override
     @Override
     public int getWidth() {
     public int getWidth() {
         return 1;
         return 1;
     }
     }
-    
+
     @Override
     @Override
     public int getHeight() {
     public int getHeight() {
         return 1;
         return 1;
     }
     }
-    
+
     @Override
     @Override
     public List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container) {
     public List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container) {
         return CollectionUtils.map(recipe.getPreviewInputs(), i -> CollectionUtils.map(i.getMatchingStacksClient(), EntryStack::create));
         return CollectionUtils.map(recipe.getPreviewInputs(), i -> CollectionUtils.map(i.getMatchingStacksClient(), EntryStack::create));
     }
     }
-    
+
 }
 }

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

@@ -31,33 +31,33 @@ import java.util.List;
 import java.util.function.Supplier;
 import java.util.function.Supplier;
 
 
 public class DefaultCraftingCategory implements TransferRecipeCategory<DefaultCraftingDisplay> {
 public class DefaultCraftingCategory implements TransferRecipeCategory<DefaultCraftingDisplay> {
-    
+
     @Deprecated
     @Deprecated
     public static int getSlotWithSize(DefaultCraftingDisplay recipeDisplay, int num) {
     public static int getSlotWithSize(DefaultCraftingDisplay recipeDisplay, int num) {
         return getSlotWithSize(recipeDisplay, num, 3);
         return getSlotWithSize(recipeDisplay, num, 3);
     }
     }
-    
+
     public static int getSlotWithSize(DefaultCraftingDisplay recipeDisplay, int num, int craftingGridWidth) {
     public static int getSlotWithSize(DefaultCraftingDisplay recipeDisplay, int num, int craftingGridWidth) {
         int x = num % recipeDisplay.getWidth();
         int x = num % recipeDisplay.getWidth();
         int y = (num - x) / recipeDisplay.getWidth();
         int y = (num - x) / recipeDisplay.getWidth();
         return craftingGridWidth * y + x;
         return craftingGridWidth * y + x;
     }
     }
-    
+
     @Override
     @Override
     public Identifier getIdentifier() {
     public Identifier getIdentifier() {
         return DefaultPlugin.CRAFTING;
         return DefaultPlugin.CRAFTING;
     }
     }
-    
+
     @Override
     @Override
     public EntryStack getLogo() {
     public EntryStack getLogo() {
         return EntryStack.create(Blocks.CRAFTING_TABLE);
         return EntryStack.create(Blocks.CRAFTING_TABLE);
     }
     }
-    
+
     @Override
     @Override
     public String getCategoryName() {
     public String getCategoryName() {
         return I18n.translate("category.rei.crafting");
         return I18n.translate("category.rei.crafting");
     }
     }
-    
+
     @Override
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultCraftingDisplay> recipeDisplaySupplier, Rectangle bounds) {
     public List<Widget> setupDisplay(Supplier<DefaultCraftingDisplay> recipeDisplaySupplier, Rectangle bounds) {
         Point startPoint = new Point(bounds.getCenterX() - 58, bounds.getCenterY() - 27);
         Point startPoint = new Point(bounds.getCenterX() - 58, bounds.getCenterY() - 27);
@@ -85,7 +85,7 @@ public class DefaultCraftingCategory implements TransferRecipeCategory<DefaultCr
         widgets.add(EntryWidget.create(startPoint.x + 95, startPoint.y + 19).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
         widgets.add(EntryWidget.create(startPoint.x + 95, startPoint.y + 19).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
         return widgets;
         return widgets;
     }
     }
-    
+
     @Override
     @Override
     public void renderRedSlots(List<Widget> widgets, Rectangle bounds, DefaultCraftingDisplay display, IntList redSlots) {
     public void renderRedSlots(List<Widget> widgets, Rectangle bounds, DefaultCraftingDisplay display, IntList redSlots) {
         ContainerInfo info = ContainerInfoHandler.getContainerInfo(getIdentifier(), ScreenHelper.getLastContainerScreen().getContainer().getClass());
         ContainerInfo info = ContainerInfoHandler.getContainerInfo(getIdentifier(), ScreenHelper.getLastContainerScreen().getContainer().getClass());

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

@@ -19,24 +19,24 @@ import java.util.List;
 import java.util.Optional;
 import java.util.Optional;
 
 
 public interface DefaultCraftingDisplay extends TransferRecipeDisplay {
 public interface DefaultCraftingDisplay extends TransferRecipeDisplay {
-    
+
     @Override
     @Override
     default Identifier getRecipeCategory() {
     default Identifier getRecipeCategory() {
         return DefaultPlugin.CRAFTING;
         return DefaultPlugin.CRAFTING;
     }
     }
-    
+
     @Override
     @Override
     default public int getWidth() {
     default public int getWidth() {
         return 2;
         return 2;
     }
     }
-    
+
     @Override
     @Override
     default public int getHeight() {
     default public int getHeight() {
         return 2;
         return 2;
     }
     }
-    
+
     Optional<Recipe<?>> getOptionalRecipe();
     Optional<Recipe<?>> getOptionalRecipe();
-    
+
     @Override
     @Override
     default List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container) {
     default List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container) {
         List<List<EntryStack>> list = Lists.newArrayListWithCapacity(containerInfo.getCraftingWidth(container) * containerInfo.getCraftingHeight(container));
         List<List<EntryStack>> list = Lists.newArrayListWithCapacity(containerInfo.getCraftingWidth(container) * containerInfo.getCraftingHeight(container));

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

@@ -16,16 +16,16 @@ import java.util.List;
 import java.util.Optional;
 import java.util.Optional;
 
 
 public class DefaultCustomDisplay implements DefaultCraftingDisplay {
 public class DefaultCustomDisplay implements DefaultCraftingDisplay {
-    
+
     private List<List<EntryStack>> input;
     private List<List<EntryStack>> input;
     private List<EntryStack> output;
     private List<EntryStack> output;
     private Recipe<?> possibleRecipe;
     private Recipe<?> possibleRecipe;
     private int width, height;
     private int width, height;
-    
+
     public DefaultCustomDisplay(List<List<ItemStack>> input, List<ItemStack> output, Recipe<?> possibleRecipe) {
     public DefaultCustomDisplay(List<List<ItemStack>> input, List<ItemStack> output, Recipe<?> possibleRecipe) {
         this(possibleRecipe, CollectionUtils.map(input, i -> CollectionUtils.map(i, EntryStack::create)), CollectionUtils.map(output, EntryStack::create));
         this(possibleRecipe, CollectionUtils.map(input, i -> CollectionUtils.map(i, EntryStack::create)), CollectionUtils.map(output, EntryStack::create));
     }
     }
-    
+
     public DefaultCustomDisplay(Recipe<?> possibleRecipe, List<List<EntryStack>> input, List<EntryStack> output) {
     public DefaultCustomDisplay(Recipe<?> possibleRecipe, List<List<EntryStack>> input, List<EntryStack> output) {
         this.input = input;
         this.input = input;
         this.output = output;
         this.output = output;
@@ -43,48 +43,48 @@ public class DefaultCustomDisplay implements DefaultCraftingDisplay {
         this.width = (int) column.stream().filter(Boolean::booleanValue).count();
         this.width = (int) column.stream().filter(Boolean::booleanValue).count();
         this.height = (int) row.stream().filter(Boolean::booleanValue).count();
         this.height = (int) row.stream().filter(Boolean::booleanValue).count();
     }
     }
-    
+
     public DefaultCustomDisplay(List<List<ItemStack>> input, List<ItemStack> output) {
     public DefaultCustomDisplay(List<List<ItemStack>> input, List<ItemStack> output) {
         this(input, output, null);
         this(input, output, null);
     }
     }
-    
+
     public Recipe getPossibleRecipe() {
     public Recipe getPossibleRecipe() {
         return possibleRecipe;
         return possibleRecipe;
     }
     }
-    
+
     @Override
     @Override
     public Optional<Identifier> getRecipeLocation() {
     public Optional<Identifier> getRecipeLocation() {
         return Optional.ofNullable(possibleRecipe).map(Recipe::getId);
         return Optional.ofNullable(possibleRecipe).map(Recipe::getId);
     }
     }
-    
+
     @Override
     @Override
     public List<List<EntryStack>> getInputEntries() {
     public List<List<EntryStack>> getInputEntries() {
         return input;
         return input;
     }
     }
-    
+
     @Override
     @Override
     public List<EntryStack> getOutputEntries() {
     public List<EntryStack> getOutputEntries() {
         return output;
         return output;
     }
     }
-    
+
     @Override
     @Override
     public List<List<EntryStack>> getRequiredEntries() {
     public List<List<EntryStack>> getRequiredEntries() {
         return input;
         return input;
     }
     }
-    
+
     @Override
     @Override
     public int getWidth() {
     public int getWidth() {
         return width;
         return width;
     }
     }
-    
+
     @Override
     @Override
     public int getHeight() {
     public int getHeight() {
         return height;
         return height;
     }
     }
-    
+
     @Override
     @Override
     public Optional<Recipe<?>> getOptionalRecipe() {
     public Optional<Recipe<?>> getOptionalRecipe() {
         return Optional.ofNullable(possibleRecipe);
         return Optional.ofNullable(possibleRecipe);
     }
     }
-    
+
 }
 }

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov