فهرست منبع

3.3

Fix #58
Close #134
Close #158
Fix #227
shedaniel 5 سال پیش
والد
کامیت
3dab623c64
100فایلهای تغییر یافته به همراه1818 افزوده شده و 1819 حذف شده
  1. 1 1
      build.gradle
  2. 2 2
      gradle.properties
  3. 3 3
      src/main/java/me/shedaniel/rei/REIModMenuEntryPoint.java
  4. 28 33
      src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
  5. 3 3
      src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java
  6. 39 39
      src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java
  7. 6 6
      src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java
  8. 3 3
      src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java
  9. 19 50
      src/main/java/me/shedaniel/rei/api/ClientHelper.java
  10. 9 9
      src/main/java/me/shedaniel/rei/api/ConfigManager.java
  11. 82 51
      src/main/java/me/shedaniel/rei/api/ConfigObject.java
  12. 21 20
      src/main/java/me/shedaniel/rei/api/DisplayHelper.java
  13. 3 3
      src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java
  14. 14 14
      src/main/java/me/shedaniel/rei/api/EntryRegistry.java
  15. 47 46
      src/main/java/me/shedaniel/rei/api/EntryStack.java
  16. 4 4
      src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java
  17. 7 7
      src/main/java/me/shedaniel/rei/api/ObjectHolder.java
  18. 4 4
      src/main/java/me/shedaniel/rei/api/REIPluginEntry.java
  19. 12 12
      src/main/java/me/shedaniel/rei/api/RecipeCategory.java
  20. 6 6
      src/main/java/me/shedaniel/rei/api/RecipeDisplay.java
  21. 37 37
      src/main/java/me/shedaniel/rei/api/RecipeHelper.java
  22. 4 4
      src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java
  23. 1 2
      src/main/java/me/shedaniel/rei/api/annotations/Experimental.java
  24. 1 2
      src/main/java/me/shedaniel/rei/api/annotations/Internal.java
  25. 1 2
      src/main/java/me/shedaniel/rei/api/annotations/ToBeRemoved.java
  26. 8 8
      src/main/java/me/shedaniel/rei/api/plugins/REIPluginV0.java
  27. 5 5
      src/main/java/me/shedaniel/rei/gui/ConfigReloadingScreen.java
  28. 63 61
      src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java
  29. 13 13
      src/main/java/me/shedaniel/rei/gui/OverlaySearchField.java
  30. 12 12
      src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java
  31. 42 43
      src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
  32. 31 31
      src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
  33. 1 1
      src/main/java/me/shedaniel/rei/gui/config/ItemCheatingMode.java
  34. 5 5
      src/main/java/me/shedaniel/rei/gui/config/ItemListOrdering.java
  35. 6 6
      src/main/java/me/shedaniel/rei/gui/config/ItemListOrderingConfig.java
  36. 1 1
      src/main/java/me/shedaniel/rei/gui/config/RecipeScreenType.java
  37. 1 1
      src/main/java/me/shedaniel/rei/gui/config/SearchFieldLocation.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. 11 11
      src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java
  42. 22 22
      src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
  43. 4 4
      src/main/java/me/shedaniel/rei/gui/widget/CategoryBaseWidget.java
  44. 17 17
      src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java
  45. 8 8
      src/main/java/me/shedaniel/rei/gui/widget/CraftableToggleButtonWidget.java
  46. 13 13
      src/main/java/me/shedaniel/rei/gui/widget/DraggableWidget.java
  47. 136 142
      src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java
  48. 32 31
      src/main/java/me/shedaniel/rei/gui/widget/EntryWidget.java
  49. 71 74
      src/main/java/me/shedaniel/rei/gui/widget/FavoritesListWidget.java
  50. 21 21
      src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java
  51. 16 16
      src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java
  52. 13 13
      src/main/java/me/shedaniel/rei/gui/widget/QueuedTooltip.java
  53. 5 5
      src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java
  54. 3 3
      src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
  55. 20 20
      src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java
  56. 5 5
      src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java
  57. 12 12
      src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java
  58. 94 94
      src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java
  59. 4 4
      src/main/java/me/shedaniel/rei/gui/widget/Widget.java
  60. 7 7
      src/main/java/me/shedaniel/rei/gui/widget/WidgetWithBounds.java
  61. 9 9
      src/main/java/me/shedaniel/rei/impl/AbstractEntryStack.java
  62. 15 15
      src/main/java/me/shedaniel/rei/impl/BaseBoundsHandlerImpl.java
  63. 56 79
      src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java
  64. 66 33
      src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java
  65. 136 124
      src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java
  66. 16 16
      src/main/java/me/shedaniel/rei/impl/DisplayHelperImpl.java
  67. 27 28
      src/main/java/me/shedaniel/rei/impl/EmptyEntryStack.java
  68. 18 14
      src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java
  69. 20 24
      src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java
  70. 73 73
      src/main/java/me/shedaniel/rei/impl/ItemEntryStack.java
  71. 2 2
      src/main/java/me/shedaniel/rei/impl/ObjectHolderImpl.java
  72. 58 61
      src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
  73. 21 22
      src/main/java/me/shedaniel/rei/impl/ScreenHelper.java
  74. 19 20
      src/main/java/me/shedaniel/rei/impl/SearchArgument.java
  75. 7 7
      src/main/java/me/shedaniel/rei/impl/Weather.java
  76. 4 4
      src/main/java/me/shedaniel/rei/listeners/RecipeBookGuiHooks.java
  77. 12 16
      src/main/java/me/shedaniel/rei/mixin/MixinBrewingRecipeRegistry.java
  78. 1 1
      src/main/java/me/shedaniel/rei/mixin/MixinItemRenderer.java
  79. 3 3
      src/main/java/me/shedaniel/rei/mixin/MixinItemStack.java
  80. 4 4
      src/main/java/me/shedaniel/rei/plugin/DefaultAutoCraftingPlugin.java
  81. 28 28
      src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
  82. 2 2
      src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java
  83. 2 2
      src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingDisplay.java
  84. 5 5
      src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java
  85. 7 7
      src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java
  86. 10 10
      src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireDisplay.java
  87. 9 9
      src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java
  88. 8 8
      src/main/java/me/shedaniel/rei/plugin/containers/CraftingContainerInfoWrapper.java
  89. 11 11
      src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java
  90. 7 7
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java
  91. 7 7
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingDisplay.java
  92. 13 13
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCustomDisplay.java
  93. 10 10
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapedDisplay.java
  94. 10 10
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapelessDisplay.java
  95. 2 2
      src/main/java/me/shedaniel/rei/plugin/smelting/DefaultSmeltingDisplay.java
  96. 2 2
      src/main/java/me/shedaniel/rei/plugin/smoking/DefaultSmokingDisplay.java
  97. 6 6
      src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingCategory.java
  98. 8 8
      src/main/java/me/shedaniel/rei/plugin/stripping/DefaultStrippingDisplay.java
  99. 1 1
      src/main/java/me/shedaniel/rei/plugin/stripping/DummyAxeItem.java
  100. 5 5
      src/main/java/me/shedaniel/rei/server/ContainerInfo.java

+ 1 - 1
build.gradle

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

+ 2 - 2
gradle.properties

@@ -1,9 +1,9 @@
-mod_version=3.2.33
+mod_version=3.3.0
 minecraft_version=1.15
 yarn_version=1.15+build.1
 fabricloader_version=0.7.2+build.174
 cloth_events_version=1.1.0
-cloth_config_version=2.5.3
+cloth_config_version=2.6.5
 modmenu_version=1.8.0+build.16
 fabric_api=0.4.20+build.273-1.15
 autoconfig1u=1.2.4

+ 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;
 
 public class REIModMenuEntryPoint implements ModMenuApi {
-
+    
     @Override
     public String getModId() {
         return "roughlyenoughitems";
     }
-
+    
     @Override
     public Function<Screen, ? extends Screen> getConfigScreenFactory() {
         return parent -> ConfigManager.getInstance().getConfigScreen(parent);
     }
-
+    
 }

+ 28 - 33
src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java

@@ -56,48 +56,43 @@ import java.util.concurrent.atomic.AtomicLong;
 
 @Internal
 public class RoughlyEnoughItemsCore implements ClientModInitializer {
-
-    @Internal
-    public static final Logger LOGGER;
-    @SuppressWarnings("deprecation")
-    private static final RecipeHelper RECIPE_HELPER = new RecipeHelperImpl();
-    @SuppressWarnings("deprecation")
-    private static final EntryRegistry ENTRY_REGISTRY = new EntryRegistryImpl();
-    @SuppressWarnings("deprecation")
-    private static final DisplayHelper DISPLAY_HELPER = new DisplayHelperImpl();
+    
+    @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 ExecutorService SYNC_RECIPES = Executors.newSingleThreadScheduledExecutor(r -> new Thread(r, "REI-SyncRecipes"));
     private static ConfigManager configManager;
-
+    
     static {
         LOGGER = LogManager.getFormatterLogger("REI");
     }
-
+    
     @Deprecated
     public static RecipeHelper getRecipeHelper() {
         return RECIPE_HELPER;
     }
-
+    
     @Deprecated
     public static ConfigManager getConfigManager() {
         return configManager;
     }
-
+    
     @Deprecated
     public static EntryRegistry getEntryRegistry() {
         return ENTRY_REGISTRY;
     }
-
+    
     @Deprecated
     public static DisplayHelper getDisplayHelper() {
         return DISPLAY_HELPER;
     }
-
+    
     /**
      * Registers a REI plugin
      *
-     * @param identifier the identifier of the plugin
-     * @param plugin     the plugin instance
+     * @param plugin the plugin instance
      * @return the plugin itself
      * @deprecated Check REI wiki
      */
@@ -107,18 +102,18 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
         RoughlyEnoughItemsCore.LOGGER.debug("[REI] Registered plugin %s from %s", plugin.getPluginIdentifier().toString(), plugin.getClass().getSimpleName());
         return plugin;
     }
-
+    
     public static List<REIPluginEntry> getPlugins() {
         return new LinkedList<>(plugins.values());
     }
-
+    
     public static Optional<Identifier> getPluginIdentifier(REIPluginEntry plugin) {
         for (Identifier identifier : plugins.keySet())
             if (identifier != null && plugins.get(identifier).equals(plugin))
                 return Optional.of(identifier);
         return Optional.empty();
     }
-
+    
     public static boolean hasPermissionToUsePackets() {
         try {
             MinecraftClient.getInstance().getNetworkHandler().getCommandSource().hasPermissionLevel(0);
@@ -127,7 +122,7 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
             return true;
         }
     }
-
+    
     public static boolean hasOperatorPermission() {
         try {
             return MinecraftClient.getInstance().getNetworkHandler().getCommandSource().hasPermissionLevel(1);
@@ -135,11 +130,11 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
             return true;
         }
     }
-
+    
     public static boolean canUsePackets() {
         return ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.CREATE_ITEMS_PACKET) && ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.DELETE_ITEMS_PACKET);
     }
-
+    
     @Internal
     @Deprecated
     public static void syncRecipes(AtomicLong lastSync) {
@@ -157,19 +152,19 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
             ((RecipeHelperImpl) RecipeHelper.getInstance()).recipesLoaded(recipeManager);
         }
     }
-
+    
     @SuppressWarnings("deprecation")
     @Override
     public void onInitializeClient() {
         configManager = new ConfigManagerImpl();
-
+        
         registerClothEvents();
         discoverPluginEntries();
         for (ModContainer modContainer : FabricLoader.getInstance().getAllMods()) {
             if (modContainer.getMetadata().containsCustomValue("roughlyenoughitems:plugins"))
                 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) -> {
             ItemStack stack = packetByteBuf.readItemStack();
             String player = packetByteBuf.readString(32767);
@@ -181,7 +176,7 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
                 RecipeBookWidget recipeBookGui = ((RecipeBookProvider) currentScreen).getRecipeBookGui();
                 RecipeBookGhostSlots ghostSlots = ((RecipeBookGuiHooks) recipeBookGui).rei_getGhostSlots();
                 ghostSlots.reset();
-
+                
                 List<List<ItemStack>> input = Lists.newArrayList();
                 int mapSize = packetByteBuf.readInt();
                 for (int i = 0; i < mapSize; i++) {
@@ -192,7 +187,7 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
                     }
                     input.add(list);
                 }
-
+                
                 ghostSlots.addSlot(Ingredient.ofItems(Items.STONE), 381203812, 12738291);
                 CraftingTableContainer container = ((CraftingTableScreen) currentScreen).getContainer();
                 for (int i = 0; i < input.size(); i++) {
@@ -205,7 +200,7 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
             }
         });
     }
-
+    
     @SuppressWarnings("deprecation")
     private void discoverPluginEntries() {
         for (REIPluginEntry reiPlugin : FabricLoader.getInstance().getEntrypoints("rei_plugins", REIPluginEntry.class)) {
@@ -226,18 +221,18 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
                 RoughlyEnoughItemsCore.LOGGER.error("[REI] Can't load REI plugins from %s: %s", reiPlugin.getClass(), e.getLocalizedMessage());
             }
         }
-
+        
         // Test Only
         loadTestPlugins();
     }
-
+    
     @SuppressWarnings("deprecation")
     private void loadTestPlugins() {
         if (System.getProperty("rei.test", "false").equals("true")) {
             registerPlugin(new REITestPlugin());
         }
     }
-
+    
     @SuppressWarnings("deprecation")
     private void registerClothEvents() {
         final Identifier recipeButtonTex = new Identifier("textures/gui/recipe_button.png");
@@ -317,5 +312,5 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
             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;
 
 public class RoughlyEnoughItemsNetwork implements ModInitializer {
-
+    
     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_MESSAGE_PACKET = new Identifier("roughlyenoughitems", "ci_msg");
     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");
-
+    
     @Override
     public void onInitialize() {
         FabricLoader.getInstance().getEntrypoints("rei_containers", Runnable.class).forEach(Runnable::run);
@@ -103,5 +103,5 @@ public class RoughlyEnoughItemsNetwork implements ModInitializer {
             }
         });
     }
-
+    
 }

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

@@ -16,89 +16,89 @@ import net.minecraft.container.Container;
 import java.util.function.Supplier;
 
 public interface AutoTransferHandler {
-
+    
     default double getPriority() {
         return 0d;
     }
-
+    
     Result handle(Context context);
-
-    public interface Result {
+    
+    interface Result {
         static Result createSuccessful() {
             return new ResultImpl();
         }
-
+        
         static Result createNotApplicable() {
             return new ResultImpl(false);
         }
-
+        
         static Result createFailed(String errorKey) {
             return new ResultImpl(errorKey, new IntArrayList(), 1744764928);
         }
-
+        
         static Result createFailedCustomButtonColor(String errorKey, int color) {
             return new ResultImpl(errorKey, new IntArrayList(), color);
         }
-
+        
         static Result createFailed(String errorKey, IntList redSlots) {
             return new ResultImpl(errorKey, redSlots, 1744764928);
         }
-
+        
         static Result createFailedCustomButtonColor(String errorKey, IntList redSlots, int color) {
             return new ResultImpl(errorKey, redSlots, color);
         }
-
+        
         int getColor();
-
+        
         boolean isSuccessful();
-
+        
         boolean isApplicable();
-
+        
         String getErrorKey();
-
+        
         IntList getIntegers();
     }
-
-    public interface Context {
+    
+    interface Context {
         static Context create(boolean actuallyCrafting, AbstractContainerScreen<?> containerScreen, RecipeDisplay recipeDisplay) {
             return new ContextImpl(actuallyCrafting, containerScreen, () -> recipeDisplay);
         }
-
+        
         default MinecraftClient getMinecraft() {
             return MinecraftClient.getInstance();
         }
-
+        
         boolean isActuallyCrafting();
-
+        
         AbstractContainerScreen<?> getContainerScreen();
-
+        
         RecipeDisplay getRecipe();
-
+        
         default Container getContainer() {
             return getContainerScreen().getContainer();
         }
-
+        
         default ContainerScreenOverlay getOverlay() {
             return ScreenHelper.getLastOverlay();
         }
     }
-
-    public final class ResultImpl implements Result {
+    
+    final class ResultImpl implements Result {
         private boolean successful, applicable;
         private String errorKey;
         private IntList integers = new IntArrayList();
         private int color;
-
+        
         private ResultImpl() {
             this.successful = true;
             this.applicable = true;
         }
-
+        
         public ResultImpl(boolean applicable) {
             this.successful = false;
             this.applicable = applicable;
         }
-
+        
         public ResultImpl(String errorKey, IntList integers, int color) {
             this.successful = false;
             this.applicable = true;
@@ -107,58 +107,58 @@ public interface AutoTransferHandler {
                 this.integers = integers;
             this.color = color;
         }
-
+        
         @Override
         public int getColor() {
             return color;
         }
-
+        
         @Override
         public boolean isSuccessful() {
             return successful;
         }
-
+        
         @Override
         public boolean isApplicable() {
             return applicable;
         }
-
+        
         @Override
         public String getErrorKey() {
             return errorKey;
         }
-
+        
         @Override
         public IntList getIntegers() {
             return integers;
         }
     }
-
-    public final class ContextImpl implements Context {
+    
+    final class ContextImpl implements Context {
         boolean actuallyCrafting;
         AbstractContainerScreen<?> containerScreen;
         Supplier<RecipeDisplay> recipeDisplaySupplier;
-
+        
         private ContextImpl(boolean actuallyCrafting, AbstractContainerScreen<?> containerScreen, Supplier<RecipeDisplay> recipeDisplaySupplier) {
             this.actuallyCrafting = actuallyCrafting;
             this.containerScreen = containerScreen;
             this.recipeDisplaySupplier = recipeDisplaySupplier;
         }
-
+        
         @Override
         public boolean isActuallyCrafting() {
             return actuallyCrafting;
         }
-
+        
         @Override
         public AbstractContainerScreen<?> getContainerScreen() {
             return containerScreen;
         }
-
+        
         @Override
         public RecipeDisplay getRecipe() {
             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) {
         return getExclusionZones(currentScreenClass, false);
     }
-
+    
     @Deprecated
     default List<Rectangle> getCurrentExclusionZones(Class<?> currentScreenClass, boolean isOnRightSide, boolean sort) {
         return getExclusionZones(currentScreenClass, sort);
     }
-
+    
     List<Rectangle> getExclusionZones(Class<?> currentScreenClass, boolean sort);
-
+    
     int supplierSize();
-
+    
     /**
      * Register an exclusion zone
      *
@@ -51,7 +51,7 @@ public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Sc
             return zones;
         });
     }
-
+    
     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;
 
 public interface ButtonAreaSupplier {
-
+    
     /**
      * Declares the button bounds
      *
@@ -16,7 +16,7 @@ public interface ButtonAreaSupplier {
      * @return the bounds of the button
      */
     Rectangle get(Rectangle bounds);
-
+    
     /**
      * Declares the button text
      *
@@ -25,5 +25,5 @@ public interface ButtonAreaSupplier {
     default String getButtonText() {
         return "+";
     }
-
+    
 }

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

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

+ 82 - 51
src/main/java/me/shedaniel/rei/api/ConfigObject.java

@@ -5,10 +5,12 @@
 
 package me.shedaniel.rei.api;
 
+import me.shedaniel.clothconfig2.api.ModifierKeyCode;
 import me.shedaniel.rei.gui.config.ItemCheatingMode;
 import me.shedaniel.rei.gui.config.ItemListOrdering;
 import me.shedaniel.rei.gui.config.RecipeScreenType;
 import me.shedaniel.rei.gui.config.SearchFieldLocation;
+import me.shedaniel.rei.impl.ConfigObjectImpl;
 import net.minecraft.client.util.InputUtil;
 
 import java.lang.annotation.ElementType;
@@ -17,108 +19,137 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
 public interface ConfigObject {
-
+    
     @SuppressWarnings("deprecation")
     static ConfigObject getInstance() {
         return ConfigManager.getInstance().getConfig();
     }
-
+    
     boolean isLighterButtonHover();
-
+    
     void setLighterButtonHover(boolean lighterButtonHover);
-
+    
     boolean isOverlayVisible();
-
+    
     void setOverlayVisible(boolean overlayVisible);
-
+    
     boolean isCheating();
-
+    
     void setCheating(boolean cheating);
-
+    
     ItemListOrdering getItemListOrdering();
-
+    
     boolean isItemListAscending();
-
+    
     boolean isUsingDarkTheme();
-
+    
     boolean isToastDisplayedOnCopyIdentifier();
-
+    
     @Deprecated
     default boolean doesRenderEntryExtraOverlay() {
         return doesRenderEntryEnchantmentGlint();
     }
-
+    
     boolean doesRenderEntryEnchantmentGlint();
-
+    
     boolean isEntryListWidgetScrolled();
-
+    
     boolean shouldAppendModNames();
-
+    
     RecipeScreenType getRecipeScreenType();
-
+    
     void setRecipeScreenType(RecipeScreenType recipeScreenType);
-
+    
     boolean isLoadingDefaultPlugin();
-
+    
     SearchFieldLocation getSearchFieldLocation();
-
+    
     boolean isLeftHandSidePanel();
-
+    
     boolean isCraftableFilterEnabled();
-
+    
     String getGamemodeCommand();
-
+    
     String getGiveCommand();
-
+    
     String getWeatherCommand();
-
+    
     int getMaxRecipePerPage();
-
+    
     boolean doesShowUtilsButtons();
-
+    
     boolean doesDisableRecipeBook();
-
+    
     boolean doesFixTabCloseContainer();
-
+    
     boolean areClickableRecipeArrowsEnabled();
-
+    
     ItemCheatingMode getItemCheatingMode();
-
+    
     boolean isUsingLightGrayRecipeBorder();
-
+    
     boolean doesVillagerScreenHavePermanentScrollBar();
-
+    
     boolean doesRegisterRecipesInAnotherThread();
-
+    
     boolean doesSnapToRows();
-
+    
     boolean isFavoritesEnabled();
-
+    
     boolean doDisplayFavoritesTooltip();
-
+    
     boolean doDisplayFavoritesOnTheLeft();
-
+    
     boolean doesFastEntryRendering();
-
+    
     boolean doDebugRenderTimeRequired();
-
+    
     boolean doSearchFavorites();
-
-    InputUtil.KeyCode getFavoriteKeybind();
-
+    
+    @Deprecated
+    default InputUtil.KeyCode getFavoriteKeybind() {
+        return getFavoriteKeyCode().getKeyCode();
+    }
+    
+    ModifierKeyCode getFavoriteKeyCode();
+    
+    ModifierKeyCode getRecipeKeybind();
+    
+    ModifierKeyCode getUsageKeybind();
+    
+    ModifierKeyCode getHideKeybind();
+    
+    ModifierKeyCode getPreviousPageKeybind();
+    
+    ModifierKeyCode getNextPageKeybind();
+    
+    ModifierKeyCode getFocusSearchFieldKeybind();
+    
+    ModifierKeyCode getCopyRecipeIdentifierKeybind();
+    
+    double getEntrySize();
+    
+    @Deprecated
+    abstract ConfigObjectImpl.General getGeneral();
+    
     @Retention(RetentionPolicy.RUNTIME)
     @Target({ElementType.FIELD})
-    public @interface AddInFrontKeyCode {
-    }
-
+    @interface AddInFrontKeyCode {}
+    
     @Retention(RetentionPolicy.RUNTIME)
     @Target({ElementType.FIELD})
-    public @interface DontApplyFieldName {
-    }
-
+    @interface DontApplyFieldName {}
+    
     @Retention(RetentionPolicy.RUNTIME)
     @Target({ElementType.FIELD})
-    public @interface UseEnumSelectorInstead {
+    @interface UseEnumSelectorInstead {}
+    
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target({ElementType.FIELD})
+    @interface UsePercentage {
+        double min();
+        
+        double max();
     }
-
+    
 }

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

@@ -11,16 +11,17 @@ import me.shedaniel.rei.gui.config.SearchFieldLocation;
 import net.minecraft.util.ActionResult;
 
 import java.util.List;
+import java.util.function.Supplier;
 
 import static net.minecraft.util.ActionResult.PASS;
 
 public interface DisplayHelper {
-
+    
     @SuppressWarnings("deprecation")
     static DisplayHelper getInstance() {
         return RoughlyEnoughItemsCore.getDisplayHelper();
     }
-
+    
     /**
      * Gets the sorted version of all responsible bounds handlers
      *
@@ -29,14 +30,14 @@ public interface DisplayHelper {
      * @see DisplayHelper#getResponsibleBoundsHandler(Class) for the unsorted version
      */
     List<DisplayBoundsHandler<?>> getSortedBoundsHandlers(Class<?> screenClass);
-
+    
     /**
      * Gets all registered bounds handlers
      *
      * @return the list of registered bounds handlers
      */
     List<DisplayBoundsHandler<?>> getAllBoundsHandlers();
-
+    
     /**
      * Gets all responsible bounds handlers
      *
@@ -45,29 +46,29 @@ public interface DisplayHelper {
      * @see DisplayHelper#getSortedBoundsHandlers(Class) for the sorted version
      */
     DisplayBoundsHandler<?> getResponsibleBoundsHandler(Class<?> screenClass);
-
+    
     /**
      * Registers a bounds handler
      *
      * @param handler the handler to register
      */
     void registerBoundsHandler(DisplayBoundsHandler<?> handler);
-
+    
     /**
      * Gets the base bounds handler api for exclusion zones
      *
      * @return the base bounds handler
      */
     BaseBoundsHandler getBaseBoundsHandler();
-
-    public static interface DisplayBoundsHandler<T> {
+    
+    interface DisplayBoundsHandler<T> {
         /**
          * Gets the base supported class for the bounds handler
          *
          * @return the base class
          */
         Class<?> getBaseSupportedClass();
-
+        
         /**
          * Gets the left bounds of the overlay
          *
@@ -75,7 +76,7 @@ public interface DisplayHelper {
          * @return the left bounds
          */
         Rectangle getLeftBounds(T screen);
-
+        
         /**
          * Gets the right bounds of the overlay
          *
@@ -83,7 +84,7 @@ public interface DisplayHelper {
          * @return the right bounds
          */
         Rectangle getRightBounds(T screen);
-
+        
         /**
          * Checks if item slot can fit the screen
          *
@@ -92,12 +93,12 @@ public interface DisplayHelper {
          * @param screen     the current screen
          * @param fullBounds the current bounds
          * @return whether the item slot can fit
-         * @see BaseBoundsHandler#registerExclusionZones(Class, BaseBoundsHandler.ExclusionZoneSupplier) for easier api
+         * @see BaseBoundsHandler#registerExclusionZones(Class, Supplier) for easier api
          */
         default ActionResult canItemSlotWidgetFit(int left, int top, T screen, Rectangle fullBounds) {
             return PASS;
         }
-
+        
         /**
          * Checks if item slot can fit the screen
          *
@@ -113,7 +114,7 @@ public interface DisplayHelper {
         default ActionResult canItemSlotWidgetFit(boolean isOnRightSide, int left, int top, T screen, Rectangle fullBounds) {
             return canItemSlotWidgetFit(left, top, screen, fullBounds);
         }
-
+        
         /**
          * Checks if mouse is inside the overlay
          *
@@ -127,7 +128,7 @@ public interface DisplayHelper {
         default ActionResult isInZone(boolean isOnRightSide, double mouseX, double mouseY) {
             return isInZone(mouseX, mouseY);
         }
-
+        
         /**
          * Checks if mouse is inside the overlay
          *
@@ -138,7 +139,7 @@ public interface DisplayHelper {
         default ActionResult isInZone(double mouseX, double mouseY) {
             return PASS;
         }
-
+        
         /**
          * Gets the item list bounds by the overlay bounds
          *
@@ -148,12 +149,12 @@ public interface DisplayHelper {
         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));
         }
-
+        
         default Rectangle getFavoritesListArea(Rectangle rectangle) {
             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);
         }
-
+        
         /**
          * Checks if REI should recalculate the overlay bounds
          *
@@ -164,7 +165,7 @@ public interface DisplayHelper {
         default boolean shouldRecalculateArea(boolean isOnRightSide, Rectangle rectangle) {
             return false;
         }
-
+        
         /**
          * Gets the priority of the handler, the higher it is, the earlier it is called.
          *
@@ -174,5 +175,5 @@ public interface DisplayHelper {
             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;
 
 public interface DisplayVisibilityHandler {
-
+    
     /**
      * Gets the priority of the handler
      *
@@ -17,7 +17,7 @@ public interface DisplayVisibilityHandler {
     default float getPriority() {
         return 0f;
     }
-
+    
     /**
      * Handles the visibility of the display.
      * {@link ActionResult#PASS} to pass the handling to another handler
@@ -29,5 +29,5 @@ public interface DisplayVisibilityHandler {
      * @return the visibility
      */
     ActionResult handleDisplay(RecipeCategory<?> category, RecipeDisplay display);
-
+    
 }

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

@@ -15,21 +15,21 @@ import java.util.Collection;
 import java.util.List;
 
 public interface EntryRegistry {
-
+    
     @SuppressWarnings("deprecation")
     static EntryRegistry getInstance() {
         return RoughlyEnoughItemsCore.getEntryRegistry();
     }
-
+    
     /**
      * Gets the current modifiable stacks list
      *
      * @return a stacks list
      */
     List<EntryStack> getStacksList();
-
+    
     List<ItemStack> appendStacksForItem(Item item);
-
+    
     /**
      * Gets all possible stacks from an item
      *
@@ -37,11 +37,11 @@ public interface EntryRegistry {
      * @return the array of possible stacks
      */
     ItemStack[] getAllStacksFromItem(Item item);
-
+    
     default void registerEntry(EntryStack stack) {
         registerEntryAfter(null, stack);
     }
-
+    
     /**
      * Registers an new stack to the entry list
      *
@@ -51,7 +51,7 @@ public interface EntryRegistry {
     default void registerEntryAfter(EntryStack afterEntry, EntryStack stack) {
         registerEntryAfter(afterEntry, stack, true);
     }
-
+    
     /**
      * Registers an new stack to the entry list
      *
@@ -61,10 +61,10 @@ public interface EntryRegistry {
      */
     @Deprecated
     void registerEntryAfter(EntryStack afterEntry, EntryStack stack, boolean checkAlreadyContains);
-
-
+    
+    
     void queueRegisterEntryAfter(EntryStack afterEntry, Collection<? extends EntryStack> stacks);
-
+    
     /**
      * Registers multiple stacks to the item list
      *
@@ -74,7 +74,7 @@ public interface EntryRegistry {
     default void registerEntriesAfter(EntryStack afterStack, EntryStack... stacks) {
         registerEntriesAfter(afterStack, Arrays.asList(stacks));
     }
-
+    
     /**
      * Registers multiple stacks to the item list
      *
@@ -82,7 +82,7 @@ public interface EntryRegistry {
      * @param stacks     the stacks to register
      */
     void registerEntriesAfter(EntryStack afterStack, Collection<? extends EntryStack> stacks);
-
+    
     /**
      * Registers multiple stacks to the item list
      *
@@ -91,7 +91,7 @@ public interface EntryRegistry {
     default void registerEntries(EntryStack... stacks) {
         registerEntriesAfter(null, stacks);
     }
-
+    
     /**
      * Checks if a stack is already registered
      *
@@ -101,5 +101,5 @@ public interface EntryRegistry {
     default boolean alreadyContain(EntryStack stack) {
         return CollectionUtils.anyMatchEqualsAll(getStacksList(), stack);
     }
-
+    
 }

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

@@ -32,27 +32,27 @@ import java.util.function.Supplier;
 
 @SuppressWarnings("deprecation")
 public interface EntryStack {
-
+    
     static EntryStack empty() {
         return EmptyEntryStack.EMPTY;
     }
-
+    
     static EntryStack create(Fluid fluid) {
         return new FluidEntryStack(fluid);
     }
-
+    
     static EntryStack create(Fluid fluid, int amount) {
         return new FluidEntryStack(fluid, amount);
     }
-
+    
     static EntryStack create(ItemStack stack) {
         return new ItemEntryStack(stack);
     }
-
+    
     static EntryStack create(ItemConvertible item) {
         return new ItemEntryStack(new ItemStack(item));
     }
-
+    
     @Internal
     @Deprecated
     static EntryStack readFromJson(JsonElement jsonElement) {
@@ -73,7 +73,7 @@ public interface EntryStack {
             return EntryStack.empty();
         }
     }
-
+    
     @Internal
     @Deprecated
     @Nullable
@@ -102,83 +102,85 @@ public interface EntryStack {
             return null;
         }
     }
-
+    
     Optional<Identifier> getIdentifier();
-
+    
     EntryStack.Type getType();
-
+    
     int getAmount();
-
+    
     void setAmount(int amount);
-
+    
     boolean isEmpty();
-
+    
     EntryStack copy();
-
+    
     Object getObject();
-
+    
     boolean equals(EntryStack stack, boolean ignoreTags, boolean ignoreAmount);
-
+    
     boolean equalsIgnoreTagsAndAmount(EntryStack stack);
-
+    
     boolean equalsIgnoreTags(EntryStack stack);
-
+    
     boolean equalsIgnoreAmount(EntryStack stack);
-
+    
     boolean equalsAll(EntryStack stack);
-
-    /** {@link #hashCode()} for {@link #equalsAll(EntryStack)}. */
+    
+    /**
+     * {@link #hashCode()} for {@link #equalsAll(EntryStack)}.
+     */
     default int hashOfAll() {
         return hashCode();
     }
-
+    
     int getZ();
-
+    
     void setZ(int z);
-
+    
     default ItemStack getItemStack() {
         if (getType() == Type.ITEM)
             return (ItemStack) getObject();
         return null;
     }
-
+    
     default Item getItem() {
         if (getType() == Type.ITEM)
             return ((ItemStack) getObject()).getItem();
         return null;
     }
-
+    
     default Fluid getFluid() {
         if (getType() == Type.FLUID)
             return (Fluid) getObject();
         return null;
     }
-
+    
     <T> EntryStack setting(Settings<T> settings, T value);
-
+    
     <T> EntryStack removeSetting(Settings<T> settings);
-
+    
     EntryStack clearSettings();
-
+    
     default <T> EntryStack addSetting(Settings<T> settings, T value) {
         return setting(settings, value);
     }
-
+    
     <T> ObjectHolder<T> getSetting(Settings<T> settings);
-
+    
     @Nullable
     QueuedTooltip getTooltip(int mouseX, int mouseY);
-
+    
     void render(Rectangle bounds, int mouseX, int mouseY, float delta);
-
-    public static enum Type {
+    
+    enum Type {
         ITEM,
         FLUID,
         EMPTY,
         RENDER
     }
-
-    public static class Settings<T> {
+    
+    class Settings<T> {
         public static final Supplier<Boolean> TRUE = () -> true;
         public static final Supplier<Boolean> FALSE = () -> false;
         public static final Settings<Supplier<Boolean>> RENDER = new Settings(TRUE);
@@ -188,30 +190,29 @@ public interface EntryStack {
         public static final Settings<Supplier<Boolean>> RENDER_COUNTS = new Settings(TRUE);
         public static final Settings<Function<EntryStack, List<String>>> TOOLTIP_APPEND_EXTRA = new Settings<Function<EntryStack, List<String>>>(stack -> Collections.emptyList());
         public static final Settings<Function<EntryStack, String>> COUNTS = new Settings<Function<EntryStack, String>>(stack -> null);
-
+        
         private T defaultValue;
-
+        
         public Settings(T defaultValue) {
             this.defaultValue = defaultValue;
         }
-
+        
         public T getDefaultValue() {
             return defaultValue;
         }
-
+        
         public static class Item {
             public static final Settings<Supplier<Boolean>> RENDER_ENCHANTMENT_GLINT = new Settings(TRUE);
-            @Deprecated
-            public static final Settings<Supplier<Boolean>> RENDER_OVERLAY = RENDER_ENCHANTMENT_GLINT;
-
+            @Deprecated public static final Settings<Supplier<Boolean>> RENDER_OVERLAY = RENDER_ENCHANTMENT_GLINT;
+            
             private Item() {
             }
         }
-
+        
         public static class Fluid {
             // Return null to disable
             public static final Settings<Function<EntryStack, String>> AMOUNT_TOOLTIP = new Settings<Function<EntryStack, String>>(stack -> I18n.translate("tooltip.rei.fluid_amount", stack.getAmount()));
-
+            
             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;
 
 public interface LiveRecipeGenerator<T extends RecipeDisplay> {
-
+    
     Identifier getCategoryIdentifier();
-
+    
     default Optional<List<T>> getRecipeFor(EntryStack entry) {
         return Optional.empty();
     }
-
+    
     default Optional<List<T>> getUsageFor(EntryStack entry) {
         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) {
         return new ObjectHolderImpl<>(o);
     }
-
+    
     @Deprecated
     default int intValue() {
         return (int) (Object) value();
     }
-
+    
     @Deprecated
     default long longValue() {
         return (long) (Object) value();
     }
-
+    
     @Deprecated
     default boolean booleanValue() {
         return (boolean) (Object) value();
     }
-
+    
     @Deprecated
     default float floatValue() {
         return (float) (Object) value();
     }
-
+    
     @Deprecated
     default double doubleValue() {
         return (double) (Object) value();
     }
-
+    
     @Deprecated
     default String stringValue() {
         return (String) 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.
  */
 public interface REIPluginEntry {
-
+    
     default SemanticVersion getMinimumVersion() throws VersionParsingException {
         return null;
     }
-
+    
     /**
      * Gets the priority of the plugin.
      *
@@ -26,12 +26,12 @@ public interface REIPluginEntry {
     default int getPriority() {
         return 0;
     }
-
+    
     /**
      * Get the identifier of the plugin
      *
      * @return the identifier
      */
     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> {
-
+    
     /**
      * Gets the identifier of the category, must be unique
      *
      * @return the unique identifier of the category
      */
     Identifier getIdentifier();
-
+    
     /**
      * 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() {
         return EntryStack.empty();
     }
-
+    
     /**
      * Gets the category name
      *
      * @return the name
      */
     String getCategoryName();
-
+    
     /**
      * 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) {
         return SimpleRecipeEntry.create(recipe::getInputEntries, recipe::getOutputEntries);
     }
-
+    
     /**
      * 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) {
         return Collections.singletonList(new RecipeBaseWidget(bounds));
     }
-
+    
     /**
      * 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);
         }
     }
-
+    
     /**
      * Gets the recipe display height
      *
@@ -95,7 +95,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default int getDisplayHeight() {
         return 66;
     }
-
+    
     /**
      * Gets the recipe display width
      *
@@ -105,7 +105,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default int getDisplayWidth(T display) {
         return 150;
     }
-
+    
     /**
      * Gets the maximum recipe per page.
      *
@@ -114,7 +114,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default int getMaximumRecipePerPage() {
         return 99;
     }
-
+    
     /**
      * Gets the fixed amount of recipes per page.
      *
@@ -124,7 +124,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default int getFixedRecipesPerPage() {
         return -1;
     }
-
+    
     /**
      * Gets whether the category will check tags, useful for potions
      *
@@ -135,5 +135,5 @@ public interface RecipeCategory<T extends RecipeDisplay> {
     default boolean checkTags() {
         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;
 
 public interface RecipeDisplay {
-
+    
     /**
      * @return a list of inputs
      */
     List<List<EntryStack>> getInputEntries();
-
+    
     /**
      * @return a list of outputs
      */
     List<EntryStack> getOutputEntries();
-
+    
     /**
      * Gets the required items used in craftable filters
      *
@@ -31,14 +31,14 @@ public interface RecipeDisplay {
     default List<List<EntryStack>> getRequiredEntries() {
         return Collections.emptyList();
     }
-
+    
     /**
      * Gets the recipe display category identifier
      *
      * @return the identifier of the category
      */
     Identifier getRecipeCategory();
-
+    
     /**
      * Gets the recipe location from datapack
      *
@@ -47,5 +47,5 @@ public interface RecipeDisplay {
     default Optional<Identifier> getRecipeLocation() {
         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;
 
 public interface RecipeHelper {
-
+    
     @SuppressWarnings("deprecation")
     static RecipeHelper getInstance() {
         return RoughlyEnoughItemsCore.getRecipeHelper();
     }
-
+    
     AutoTransferHandler registerAutoCraftingHandler(AutoTransferHandler handler);
-
+    
     List<AutoTransferHandler> getSortedAutoCraftingHandler();
-
+    
     /**
      * Gets the total recipe count registered
      *
      * @return the recipe count
      */
     int getRecipeCount();
-
+    
     /**
      * @return a list of sorted recipes
      */
     List<Recipe> getAllSortedRecipes();
-
+    
     /**
      * Gets all craftable items from materials.
      *
@@ -48,14 +48,14 @@ public interface RecipeHelper {
      * @return the list of craftable entries
      */
     List<EntryStack> findCraftableEntriesByItems(List<EntryStack> inventoryItems);
-
+    
     /**
      * Registers a category
      *
      * @param category the category to register
      */
     void registerCategory(RecipeCategory<?> category);
-
+    
     /**
      * Registers the working stations of a category
      *
@@ -63,7 +63,7 @@ public interface RecipeHelper {
      * @param workingStations the working stations
      */
     void registerWorkingStations(Identifier category, List<EntryStack>... workingStations);
-
+    
     /**
      * Registers the working stations of a category
      *
@@ -71,9 +71,9 @@ public interface RecipeHelper {
      * @param workingStations the working stations
      */
     void registerWorkingStations(Identifier category, EntryStack... workingStations);
-
+    
     List<List<EntryStack>> getWorkingStations(Identifier category);
-
+    
     /**
      * Registers a recipe display
      *
@@ -81,7 +81,7 @@ public interface RecipeHelper {
      * @param display            the recipe display
      */
     void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display);
-
+    
     /**
      * Gets a map of recipes for an entry
      *
@@ -89,23 +89,23 @@ public interface RecipeHelper {
      * @return the map of recipes
      */
     Map<RecipeCategory<?>, List<RecipeDisplay>> getRecipesFor(EntryStack stack);
-
+    
     RecipeCategory getCategory(Identifier identifier);
-
+    
     /**
      * Gets the vanilla recipe manager
      *
      * @return the recipe manager
      */
     RecipeManager getRecipeManager();
-
+    
     /**
      * Gets all registered categories
      *
      * @return the list of categories
      */
     List<RecipeCategory<?>> getAllCategories();
-
+    
     /**
      * Gets a map of usages for an entry
      *
@@ -113,7 +113,7 @@ public interface RecipeHelper {
      * @return the map of recipes
      */
     Map<RecipeCategory<?>, List<RecipeDisplay>> getUsagesFor(EntryStack stack);
-
+    
     /**
      * 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
      */
     Optional<ButtonAreaSupplier> getAutoCraftButtonArea(RecipeCategory<?> category);
-
+    
     /**
      * Registers a auto crafting button area
      *
@@ -129,7 +129,7 @@ public interface RecipeHelper {
      * @param rectangle the button area
      */
     void registerAutoCraftButtonArea(Identifier category, ButtonAreaSupplier rectangle);
-
+    
     /**
      * Removes the auto crafting button
      *
@@ -138,37 +138,37 @@ public interface RecipeHelper {
     default void removeAutoCraftButton(Identifier category) {
         registerAutoCraftButtonArea(category, bounds -> null);
     }
-
+    
     /**
      * Gets the map of all recipes visible to the player
      *
      * @return the map of recipes
      */
     Map<RecipeCategory<?>, List<RecipeDisplay>> getAllRecipes();
-
+    
     List<RecipeDisplay> getAllRecipesFromCategory(RecipeCategory<?> category);
-
+    
     /**
      * Registers a recipe visibility handler
      *
      * @param visibilityHandler the handler to be registered
      */
     void registerRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler);
-
+    
     /**
      * Unregisters a recipe visibility handler
      *
      * @param visibilityHandler the handler to be unregistered
      */
     void unregisterRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler);
-
+    
     /**
      * Gets an unmodifiable list of recipe visibility handlers
      *
      * @return the unmodifiable list of handlers
      */
     List<DisplayVisibilityHandler> getDisplayVisibilityHandlers();
-
+    
     /**
      * Checks if the display is visible by asking recipe visibility handlers
      *
@@ -179,7 +179,7 @@ public interface RecipeHelper {
      */
     @Deprecated
     boolean isDisplayVisible(RecipeDisplay display, boolean respectConfig);
-
+    
     /**
      * 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
      */
     boolean isDisplayVisible(RecipeDisplay display);
-
+    
     <T extends Recipe<?>> void registerRecipes(Identifier category, Predicate<Recipe> recipeFilter, Function<T, RecipeDisplay> mappingFunction);
-
+    
     /**
      * Registers a live recipe generator.
      *
@@ -197,24 +197,24 @@ public interface RecipeHelper {
      * @apiNote Still work in progress
      */
     void registerLiveRecipeGenerator(LiveRecipeGenerator<?> liveRecipeGenerator);
-
+    
     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, Function<Recipe, Boolean> recipeFilter, Function<T, RecipeDisplay> mappingFunction);
-
+    
     List<RecipeHelper.ScreenClickArea> getScreenClickAreas();
-
+    
     boolean arePluginsLoading();
-
+    
     interface ScreenClickArea {
         Class<? extends AbstractContainerScreen> getScreenClass();
-
+        
         Rectangle getRectangle();
-
+        
         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;
 
 public interface TransferRecipeDisplay extends RecipeDisplay {
-
+    
     int getWidth();
-
+    
     int getHeight();
-
+    
     List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container);
-
+    
 }

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

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

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

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

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

@@ -13,5 +13,4 @@ import static java.lang.annotation.ElementType.*;
 
 @Retention(RetentionPolicy.RUNTIME)
 @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;
 
 public interface REIPluginV0 extends REIPluginEntry {
-
+    
     /**
      * Registers entries on the item panel
      *
@@ -19,7 +19,7 @@ public interface REIPluginV0 extends REIPluginEntry {
      */
     default void registerEntries(EntryRegistry entryRegistry) {
     }
-
+    
     /**
      * Registers categories
      *
@@ -27,7 +27,7 @@ public interface REIPluginV0 extends REIPluginEntry {
      */
     default void registerPluginCategories(RecipeHelper recipeHelper) {
     }
-
+    
     /**
      * Registers displays for categories
      *
@@ -35,7 +35,7 @@ public interface REIPluginV0 extends REIPluginEntry {
      */
     default void registerRecipeDisplays(RecipeHelper recipeHelper) {
     }
-
+    
     /**
      * Registers bounds handlers
      *
@@ -43,7 +43,7 @@ public interface REIPluginV0 extends REIPluginEntry {
      */
     default void registerBounds(DisplayHelper displayHelper) {
     }
-
+    
     /**
      * Register other stuff
      *
@@ -51,11 +51,11 @@ public interface REIPluginV0 extends REIPluginEntry {
      */
     default void registerOthers(RecipeHelper recipeHelper) {
     }
-
+    
     default void preRegister() {
     }
-
+    
     default void postRegister() {
     }
-
+    
 }

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

@@ -15,19 +15,19 @@ import net.minecraft.util.Util;
 @Deprecated
 @Internal
 public class ConfigReloadingScreen extends Screen {
-
+    
     private Screen parent;
-
+    
     public ConfigReloadingScreen(Screen parent) {
         super(NarratorManager.EMPTY);
         this.parent = parent;
     }
-
+    
     @Override
     public boolean shouldCloseOnEsc() {
         return false;
     }
-
+    
     @Override
     public void render(int int_1, int int_2, float float_1) {
         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);
         super.render(int_1, int_2, float_1);
     }
-
+    
     @Override
     public boolean isPauseScreen() {
         return false;

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

@@ -42,7 +42,7 @@ import javax.annotation.Nullable;
 import java.util.*;
 
 public class ContainerScreenOverlay extends WidgetWithBounds {
-
+    
     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 EntryListWidget ENTRY_LIST_WIDGET = new EntryListWidget();
@@ -83,20 +83,20 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
     private Window window;
     private CraftableToggleButtonWidget toggleButtonWidget;
     private ButtonWidget buttonLeft, buttonRight;
-
+    
     public static EntryListWidget getEntryListWidget() {
         return ENTRY_LIST_WIDGET;
     }
-
+    
     @Nullable
     public static FavoritesListWidget getFavoritesListWidget() {
         return favoritesListWidget;
     }
-
+    
     public void init(boolean useless) {
         init();
     }
-
+    
     @SuppressWarnings("deprecation")
     public void init() {
         this.shouldReInit = false;
@@ -130,17 +130,17 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                         ENTRY_LIST_WIDGET.setPage(ENTRY_LIST_WIDGET.getTotalPages() - 1);
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                 }
-
+                
                 @Override
                 public Optional<String> getTooltips() {
                     return Optional.ofNullable(I18n.translate("text.rei.previous_page"));
                 }
-
+                
                 @Override
                 public boolean changeFocus(boolean boolean_1) {
                     return false;
                 }
-
+                
                 @Override
                 public boolean containsMouse(double mouseX, double mouseY) {
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
@@ -154,24 +154,24 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                         ENTRY_LIST_WIDGET.setPage(0);
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                 }
-
+                
                 @Override
                 public Optional<String> getTooltips() {
                     return Optional.ofNullable(I18n.translate("text.rei.next_page"));
                 }
-
+                
                 @Override
                 public boolean changeFocus(boolean boolean_1) {
                     return false;
                 }
-
+                
                 @Override
                 public boolean containsMouse(double mouseX, double mouseY) {
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
                 }
             });
         }
-
+        
         widgets.add(new ButtonWidget(new Rectangle(ConfigObject.getInstance().isLeftHandSidePanel() ? window.getScaledWidth() - 30 : 10, 10, 20, 20), "") {
             @Override
             public void onPressed() {
@@ -181,7 +181,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                 }
                 ConfigManager.getInstance().openConfigScreen(ScreenHelper.getLastContainerScreen());
             }
-
+            
             @Override
             public void render(int mouseX, int mouseY, float 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);
                 blit(bounds.x + 3, bounds.y + 3, 0, 0, 14, 14);
             }
-
+            
             @Override
             public Optional<String> getTooltips() {
                 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");
                 return Optional.ofNullable(tooltips);
             }
-
+            
             @Override
             public boolean changeFocus(boolean boolean_1) {
                 return false;
             }
-
+            
             @Override
             public boolean containsMouse(double mouseX, double mouseY) {
                 return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
@@ -228,23 +228,23 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                 public void onPressed() {
                     MinecraftClient.getInstance().player.sendChatMessage(ConfigObject.getInstance().getGamemodeCommand().replaceAll("\\{gamemode}", getNextGameMode(Screen.hasShiftDown()).getName()));
                 }
-
+                
                 @Override
                 public void render(int mouseX, int mouseY, float delta) {
                     setText(getGameModeShortText(getCurrentGameMode()));
                     super.render(mouseX, mouseY, delta);
                 }
-
+                
                 @Override
                 public Optional<String> getTooltips() {
                     return Optional.ofNullable(I18n.translate("text.rei.gamemode_button.tooltip", getGameModeText(getNextGameMode(Screen.hasShiftDown()))));
                 }
-
+                
                 @Override
                 public boolean changeFocus(boolean boolean_1) {
                     return false;
                 }
-
+                
                 @Override
                 public boolean containsMouse(double mouseX, double mouseY) {
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
@@ -257,7 +257,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                     public void onPressed() {
                         MinecraftClient.getInstance().player.sendChatMessage(ConfigObject.getInstance().getWeatherCommand().replaceAll("\\{weather}", weather.name().toLowerCase(Locale.ROOT)));
                     }
-
+                    
                     @Override
                     public void render(int mouseX, int mouseY, float 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);
                         blit(getBounds().x + 3, getBounds().y + 3, weather.getId() * 14, 14, 14, 14);
                     }
-
+                    
                     @Override
                     public Optional<String> getTooltips() {
                         return Optional.ofNullable(I18n.translate("text.rei.weather_button.tooltip", I18n.translate(weather.getTranslateKey())));
                     }
-
+                    
                     @Override
                     public boolean changeFocus(boolean boolean_1) {
                         return false;
                     }
-
+                    
                     @Override
                     public boolean containsMouse(double mouseX, double mouseY) {
                         return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
@@ -291,19 +291,19 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                     setText(String.format("%s/%s", ENTRY_LIST_WIDGET.getPage() + 1, ENTRY_LIST_WIDGET.getTotalPages()));
                     super.render(mouseX, mouseY, delta);
                 }
-
+                
                 @Override
                 public Optional<String> getTooltips() {
                     return Optional.ofNullable(I18n.translate("text.rei.go_back_first_page"));
                 }
-
+                
                 @Override
                 public void onLabelClicked() {
                     MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                     ENTRY_LIST_WIDGET.setPage(0);
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                 }
-
+                
                 @Override
                 public boolean changeFocus(boolean boolean_1) {
                     return false;
@@ -318,14 +318,14 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                     ConfigManager.getInstance().toggleCraftableOnly();
                     ENTRY_LIST_WIDGET.updateSearch(ScreenHelper.getSearchField().getText());
                 }
-
+                
                 @Override
                 public void lateRender(int mouseX, int mouseY, float delta) {
                     setBlitOffset(300);
                     super.lateRender(mouseX, mouseY, delta);
                     setBlitOffset(0);
                 }
-
+                
                 @Override
                 public boolean containsMouse(double mouseX, double mouseY) {
                     return isNotInExclusionZones(mouseX, mouseY) && super.containsMouse(mouseX, mouseY);
@@ -334,7 +334,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         else
             toggleButtonWidget = null;
     }
-
+    
     private Weather getNextWeather() {
         try {
             Weather current = getCurrentWeather();
@@ -346,7 +346,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             return Weather.CLEAR;
         }
     }
-
+    
     private Weather getCurrentWeather() {
         ClientWorld world = MinecraftClient.getInstance().world;
         if (world.isThundering())
@@ -355,15 +355,15 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             return Weather.RAIN;
         return Weather.CLEAR;
     }
-
+    
     private String getGameModeShortText(GameMode gameMode) {
         return I18n.translate("text.rei.short_gamemode." + gameMode.getName());
     }
-
+    
     private String getGameModeText(GameMode gameMode) {
         return I18n.translate("selectWorld.gameMode." + gameMode.getName());
     }
-
+    
     private GameMode getNextGameMode(boolean reverse) {
         try {
             GameMode current = getCurrentGameMode();
@@ -379,11 +379,11 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             return GameMode.NOT_SET;
         }
     }
-
+    
     private GameMode getCurrentGameMode() {
         return MinecraftClient.getInstance().getNetworkHandler().getPlayerListEntry(MinecraftClient.getInstance().player.getGameProfile().getId()).getGameMode();
     }
-
+    
     private Rectangle getTextFieldArea() {
         int widthRemoved = ConfigObject.getInstance().isCraftableFilterEnabled() ? 22 : 2;
         SearchFieldLocation searchFieldLocation = ConfigObject.getInstance().getSearchFieldLocation();
@@ -401,23 +401,23 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         }
         return new Rectangle(ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft(), window.getScaledHeight() - 22, ScreenHelper.getLastContainerScreenHooks().rei_getContainerWidth() - widthRemoved, 18);
     }
-
+    
     private Rectangle getCraftableToggleArea() {
         Rectangle searchBoxArea = getTextFieldArea();
         searchBoxArea.setLocation(searchBoxArea.x + searchBoxArea.width + 4, searchBoxArea.y - 1);
         searchBoxArea.setSize(20, 20);
         return searchBoxArea;
     }
-
+    
     private String getCheatModeText() {
         return I18n.translate(String.format("%s%s", "text.rei.", ClientHelper.getInstance().isCheating() ? "cheat" : "nocheat"));
     }
-
+    
     @Override
     public Rectangle getBounds() {
         return rectangle;
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
         List<ItemStack> currentStacks = ClientHelper.getInstance().getInventoryItemsTypes();
@@ -459,7 +459,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                     }
         }
     }
-
+    
     public void lateRender(int mouseX, int mouseY, float delta) {
         if (ScreenHelper.isOverlayVisible()) {
             ScreenHelper.getSearchField().laterRender(mouseX, mouseY, delta);
@@ -474,7 +474,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             }
         QUEUED_TOOLTIPS.clear();
     }
-
+    
     @SuppressWarnings("deprecation")
     public void renderTooltip(QueuedTooltip tooltip) {
         if (tooltip.getConsumer() == null)
@@ -482,7 +482,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         else
             tooltip.getConsumer().accept(tooltip);
     }
-
+    
     public void renderTooltip(List<String> lines, int mouseX, int mouseY) {
         if (lines.isEmpty())
             return;
@@ -491,18 +491,18 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         tooltipLines = lines;
         ScreenHelper.drawHoveringWidget(mouseX, mouseY, renderTooltipCallback, tooltipWidth, tooltipHeight, 0);
     }
-
+    
     private boolean hasSameListContent(List<ItemStack> list1, List<ItemStack> list2) {
         list1.sort(Comparator.comparing(Object::toString));
         list2.sort(Comparator.comparing(Object::toString));
         return CollectionUtils.mapAndJoinToString(list1, Object::toString, "").equals(CollectionUtils.mapAndJoinToString(list2, Object::toString, ""));
     }
-
+    
     public void addTooltip(@Nullable QueuedTooltip queuedTooltip) {
         if (queuedTooltip != null)
             QUEUED_TOOLTIPS.add(queuedTooltip);
     }
-
+    
     @SuppressWarnings("deprecation")
     public void renderWidgets(int int_1, int int_2, float float_1) {
         if (!ScreenHelper.isOverlayVisible())
@@ -513,7 +513,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             widget.render(int_1, int_2, float_1);
         }
     }
-
+    
     @Override
     public boolean mouseScrolled(double i, double j, double amount) {
         if (!ScreenHelper.isOverlayVisible())
@@ -539,7 +539,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                 return true;
         return false;
     }
-
+    
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (ScreenHelper.isOverlayVisible()) {
@@ -549,7 +549,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                 if (listener != ScreenHelper.getSearchField() && listener.keyPressed(int_1, int_2, int_3))
                     return true;
         }
-        if (ClientHelper.getInstance().getHideKeyBinding().matchesKey(int_1, int_2)) {
+        if (ConfigObject.getInstance().getHideKeybind().matchesKey(int_1, int_2)) {
             ScreenHelper.toggleOverlayVisible();
             return true;
         }
@@ -558,14 +558,14 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
             if (ScreenHelper.getLastContainerScreenHooks().rei_getHoveredSlot() != null && !ScreenHelper.getLastContainerScreenHooks().rei_getHoveredSlot().getStack().isEmpty())
                 itemStack = ScreenHelper.getLastContainerScreenHooks().rei_getHoveredSlot().getStack();
         if (itemStack != null && !itemStack.isEmpty()) {
-            if (ClientHelper.getInstance().getRecipeKeyBinding().matchesKey(int_1, int_2))
+            if (ConfigObject.getInstance().getRecipeKeybind().matchesKey(int_1, int_2))
                 return ClientHelper.getInstance().executeRecipeKeyBind(itemStack);
-            else if (ClientHelper.getInstance().getUsageKeyBinding().matchesKey(int_1, int_2))
+            else if (ConfigObject.getInstance().getUsageKeybind().matchesKey(int_1, int_2))
                 return ClientHelper.getInstance().executeUsageKeyBind(itemStack);
         }
         if (!ScreenHelper.isOverlayVisible())
             return false;
-        if (ClientHelper.getInstance().getFocusSearchFieldKeyBinding().matchesKey(int_1, int_2)) {
+        if (ConfigObject.getInstance().getFocusSearchFieldKeybind().matchesKey(int_1, int_2)) {
             ScreenHelper.getSearchField().setFocused(true);
             setFocused(ScreenHelper.getSearchField());
             ScreenHelper.getSearchField().keybindFocusTime = System.currentTimeMillis();
@@ -574,7 +574,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         }
         return false;
     }
-
+    
     @Override
     public boolean charTyped(char char_1, int int_1) {
         if (!ScreenHelper.isOverlayVisible())
@@ -586,12 +586,12 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                 return true;
         return false;
     }
-
+    
     @Override
     public List<? extends Element> children() {
         return widgets;
     }
-
+    
     @Override
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
         if (!ScreenHelper.isOverlayVisible())
@@ -611,22 +611,24 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
                 this.setFocused(element);
                 if (int_1 == 0)
                     this.setDragging(true);
+                if (!(element instanceof OverlaySearchField))
+                    ScreenHelper.getSearchField().setFocused(false);
                 return true;
             }
         return false;
     }
-
+    
     @Override
     public boolean mouseDragged(double double_1, double double_2, int int_1, double double_3, double double_4) {
         if (!ScreenHelper.isOverlayVisible())
             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);
     }
-
+    
     public boolean isInside(double mouseX, double mouseY) {
         return rectangle.contains(mouseX, mouseY) && isNotInExclusionZones(mouseX, mouseY);
     }
-
+    
     public boolean isNotInExclusionZones(double mouseX, double mouseY) {
         for (DisplayHelper.DisplayBoundsHandler<?> handler : DisplayHelper.getInstance().getSortedBoundsHandlers(MinecraftClient.getInstance().currentScreen.getClass())) {
             ActionResult in = handler.isInZone(mouseX, mouseY);
@@ -635,9 +637,9 @@ public class ContainerScreenOverlay extends WidgetWithBounds {
         }
         return true;
     }
-
+    
     public boolean isInside(Point point) {
         return isInside(point.getX(), point.getY());
     }
-
+    
 }

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

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

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

@@ -28,19 +28,19 @@ import java.util.List;
 import java.util.Map;
 
 public class PreRecipeViewingScreen extends Screen {
-
+    
     private static final Identifier IDENTIFIER = new Identifier("roughlyenoughitems", "textures/gui/screenshot.png");
     private final List<Widget> widgets;
     private boolean original;
     private Map<RecipeCategory<?>, List<RecipeDisplay>> map;
-
+    
     public PreRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map) {
         super(new TranslatableText("text.rei.recipe_screen_type.selection"));
         this.widgets = Lists.newArrayList();
         this.original = true;
         this.map = map;
     }
-
+    
     @Override
     protected void init() {
         this.children.clear();
@@ -57,7 +57,7 @@ public class PreRecipeViewingScreen extends Screen {
         this.widgets.add(new ScreenTypeSelection(width / 2 + 5, height / 2 - 112 / 2 - 10, 112));
         this.children.addAll(widgets);
     }
-
+    
     @Override
     public void render(int int_1, int int_2, float float_1) {
         this.renderBackground();
@@ -72,7 +72,7 @@ public class PreRecipeViewingScreen extends Screen {
             widget.render(int_1, int_2, float_1);
         }
     }
-
+    
     @Override
     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()) {
@@ -82,23 +82,23 @@ public class PreRecipeViewingScreen extends Screen {
         }
         return super.keyPressed(int_1, int_2, int_3);
     }
-
+    
     public class ScreenTypeSelection extends WidgetWithBounds {
-
+        
         private Rectangle bounds;
         private int u, v;
-
+        
         public ScreenTypeSelection(int x, int y, int v) {
             this.bounds = new Rectangle(x - 4, y - 4, 208, 120);
             this.u = 0;
             this.v = v;
         }
-
+        
         @Override
         public Rectangle getBounds() {
             return bounds;
         }
-
+        
         @Override
         public void render(int i, int i1, float delta) {
             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);
             }
         }
-
+        
         @Override
         public boolean mouseClicked(double double_1, double double_2, int int_1) {
             if (containsMouse(double_1, double_2)) {
@@ -120,7 +120,7 @@ public class PreRecipeViewingScreen extends Screen {
             }
             return false;
         }
-
+        
         @Override
         public List<? extends Element> children() {
             return Collections.emptyList();

+ 42 - 43
src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java

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

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

@@ -40,7 +40,7 @@ import java.util.Map;
 import java.util.Optional;
 
 public class VillagerRecipeViewingScreen extends Screen {
-
+    
     private static final int TABS_PER_PAGE = 8;
     private final Map<RecipeCategory<?>, List<RecipeDisplay>> categoryMap;
     private final List<RecipeCategory<?>> categories;
@@ -59,7 +59,7 @@ public class VillagerRecipeViewingScreen extends Screen {
     private long scrollBarAlphaFutureTime = -1;
     private boolean draggingScrollBar = false;
     private int tabsPage;
-
+    
     public VillagerRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map) {
         super(new LiteralText(""));
         this.widgets = Lists.newArrayList();
@@ -82,7 +82,7 @@ public class VillagerRecipeViewingScreen extends Screen {
             }
         });
     }
-
+    
     @Override
     protected void init() {
         super.init();
@@ -99,7 +99,7 @@ public class VillagerRecipeViewingScreen extends Screen {
         int guiWidth = MathHelper.clamp(category.getDisplayWidth(display) + 30, 0, largestWidth) + 100;
         int guiHeight = MathHelper.clamp(category.getDisplayHeight() + 40, 166, largestHeight);
         this.bounds = new Rectangle(width / 2 - guiWidth / 2, height / 2 - guiHeight / 2, guiWidth, guiHeight);
-
+        
         List<List<EntryStack>> workingStations = RecipeHelper.getInstance().getWorkingStations(category.getIdentifier());
         if (!workingStations.isEmpty()) {
             int ww = MathHelper.floor((bounds.width - 16) / 18f);
@@ -121,18 +121,18 @@ public class VillagerRecipeViewingScreen extends Screen {
                 }
             }
         }
-
+        
         this.widgets.add(new CategoryBaseWidget(bounds));
         this.scrollListBounds = new Rectangle(bounds.x + 4, bounds.y + 17, 97 + 5, guiHeight - 17 - 7);
         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());
         List<Widget> setupDisplay = category.setupDisplay(() -> display, recipeBounds);
         this.widgets.addAll(setupDisplay);
         Optional<ButtonAreaSupplier> supplier = RecipeHelper.getInstance().getAutoCraftButtonArea(category);
         if (supplier.isPresent() && supplier.get().get(recipeBounds) != null)
             this.widgets.add(new AutoCraftingButtonWidget(recipeBounds, supplier.get().get(recipeBounds), supplier.get().getButtonText(), () -> display, setupDisplay, category));
-
+        
         int index = 0;
         for (RecipeDisplay recipeDisplay : categoryMap.get(category)) {
             int finalIndex = index;
@@ -144,18 +144,18 @@ public class VillagerRecipeViewingScreen extends Screen {
                     selectedRecipeIndex = finalIndex;
                     VillagerRecipeViewingScreen.this.init();
                 }
-
+                
                 @Override
                 public boolean isHovered(int mouseX, int mouseY) {
                     return (isMouseOver(mouseX, mouseY) && scrollListBounds.contains(mouseX, mouseY)) || focused;
                 }
-
+                
                 @Override
                 protected int getTextureId(boolean boolean_1) {
                     enabled = selectedRecipeIndex != finalIndex;
                     return super.getTextureId(boolean_1);
                 }
-
+                
                 @Override
                 public boolean mouseClicked(double mouseX, double mouseY, int button) {
                     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;
-
+        
         this.widgets.add(new ClickableLabelWidget(new Point(bounds.x + 4 + scrollListBounds.width / 2, bounds.y + 6), categories.get(selectedCategoryIndex).getCategoryName()) {
             @Override
             public void onLabelClicked() {
                 MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                 ClientHelper.getInstance().executeViewAllRecipesKeyBind();
             }
-
+            
             @Override
             public Optional<String> getTooltips() {
                 return Optional.ofNullable(I18n.translate("text.rei.view_all_categories"));
             }
         });
-
+        
         this.children.addAll(buttonWidgets);
         this.widgets.addAll(tabs);
         this.children.addAll(widgets);
         this.children.add(ScreenHelper.getLastOverlay(true, false));
         ScreenHelper.getLastOverlay().init();
     }
-
+    
     private final double clamp(double v) {
         return clamp(v, 200);
     }
-
+    
     private final double clamp(double v, double clampExtension) {
         return MathHelper.clamp(v, -clampExtension, getMaxScroll() + clampExtension);
     }
-
+    
     private double getMaxScroll() {
         return Math.max(0, this.getMaxScrollPosition() - (scrollListBounds.height - 2));
     }
-
+    
     @Override
     public boolean mouseClicked(double mouseX, double mouseY, int int_1) {
         double height = getMaxScrollPosition();
@@ -259,7 +259,7 @@ public class VillagerRecipeViewingScreen extends Screen {
         this.draggingScrollBar = false;
         return super.mouseClicked(mouseX, mouseY, int_1);
     }
-
+    
     @Override
     public boolean charTyped(char char_1, int int_1) {
         for (Element listener : children())
@@ -267,25 +267,25 @@ public class VillagerRecipeViewingScreen extends Screen {
                 return true;
         return super.charTyped(char_1, int_1);
     }
-
+    
     public void offset(double value, boolean animated) {
         scrollTo(target + value, animated);
     }
-
+    
     public void scrollTo(double value, boolean animated) {
         scrollTo(value, animated, ClothConfigInitializer.getScrollDuration());
     }
-
+    
     public void scrollTo(double value, boolean animated, long duration) {
         target = clamp(value);
-
+        
         if (animated) {
             start = System.currentTimeMillis();
             this.duration = duration;
         } else
             scroll = target;
     }
-
+    
     @Override
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
         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);
     }
-
+    
     private double getMaxScrollPosition() {
         return CollectionUtils.sumInt(buttonWidgets, b -> b.getBounds().getHeight());
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
         if (ConfigObject.getInstance().doesVillagerScreenHavePermanentScrollBar()) {
@@ -408,7 +408,7 @@ public class VillagerRecipeViewingScreen extends Screen {
         RenderSystem.popMatrix();
         ScreenHelper.getLastOverlay().lateRender(mouseX, mouseY, delta);
     }
-
+    
     private void updatePosition(float delta) {
         target = clamp(target);
         if (target < 0) {
@@ -421,7 +421,7 @@ public class VillagerRecipeViewingScreen extends Screen {
         else
             scroll = target;
     }
-
+    
     @Override
     public boolean mouseDragged(double mouseX, double mouseY, int int_1, double double_3, double double_4) {
         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);
     }
-
+    
     @Override
     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()) {
@@ -452,7 +452,7 @@ public class VillagerRecipeViewingScreen extends Screen {
                 this.changeFocus(boolean_1);
             return true;
         }
-        if (ClientHelper.getInstance().getNextPageKeyBinding().matchesKey(int_1, int_2)) {
+        if (ConfigObject.getInstance().getNextPageKeybind().matchesKey(int_1, int_2)) {
             if (categoryMap.get(categories.get(selectedCategoryIndex)).size() > 1) {
                 selectedRecipeIndex++;
                 if (selectedRecipeIndex >= categoryMap.get(categories.get(selectedCategoryIndex)).size())
@@ -461,7 +461,7 @@ public class VillagerRecipeViewingScreen extends Screen {
                 return true;
             }
             return false;
-        } else if (ClientHelper.getInstance().getPreviousPageKeyBinding().matchesKey(int_1, int_2)) {
+        } else if (ConfigObject.getInstance().getPreviousPageKeybind().matchesKey(int_1, int_2)) {
             if (categoryMap.get(categories.get(selectedCategoryIndex)).size() > 1) {
                 selectedRecipeIndex--;
                 if (selectedRecipeIndex < 0)
@@ -483,5 +483,5 @@ public class VillagerRecipeViewingScreen extends Screen {
         }
         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 {
     REI_LIKE,
     JEI_LIKE;
-
+    
     @Override
     public String toString() {
         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;
 
 public enum ItemListOrdering {
-
+    
     registry("ordering.rei.registry"),
     name("ordering.rei.name"),
     item_groups("ordering.rei.item_groups");
-
+    
     private String nameTranslationKey;
-
+    
     ItemListOrdering(String nameTranslationKey) {
         this.nameTranslationKey = nameTranslationKey;
     }
-
+    
     public String getNameTranslationKey() {
         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),
     NAME_DESCENDING(ItemListOrdering.name, false),
     GROUPS_DESCENDING(ItemListOrdering.item_groups, false);
-
+    
     private ItemListOrdering ordering;
     private boolean isAscending;
-
+    
     ItemListOrderingConfig(ItemListOrdering ordering, boolean isAscending) {
         this.ordering = ordering;
         this.isAscending = isAscending;
     }
-
+    
     public static ItemListOrderingConfig from(ItemListOrdering ordering, boolean isAscending) {
         int index = ordering.ordinal() + (isAscending ? 0 : 3);
         return values()[index];
     }
-
+    
     public ItemListOrdering getOrdering() {
         return ordering;
     }
-
+    
     public boolean isAscending() {
         return isAscending;
     }
-
+    
     @Override
     public String toString() {
         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,
     ORIGINAL,
     VILLAGER;
-
+    
     @Override
     public String toString() {
         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,
     BOTTOM_SIDE,
     TOP_SIDE;
-
+    
     @Override
     public String toString() {
         return I18n.translate("config.roughlyenoughitems.searchFieldLocation.%s", name().toLowerCase(Locale.ROOT));

+ 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;
 
 public class CreditsScreen extends Screen {
-
+    
     private Screen parent;
     private AbstractPressableButtonWidget buttonDone;
     private CreditsEntryListWidget entryListWidget;
-
+    
     public CreditsScreen(Screen parent) {
         super(new LiteralText(""));
         this.parent = parent;
     }
-
+    
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (int_1 == 256 && this.shouldCloseOnEsc()) {
@@ -40,7 +40,7 @@ public class CreditsScreen extends Screen {
         }
         return super.keyPressed(int_1, int_2, int_3);
     }
-
+    
     @Override
     protected void init() {
         children.add(entryListWidget = new CreditsEntryListWidget(minecraft, width, height, 32, height - 32));
@@ -80,14 +80,14 @@ public class CreditsScreen extends Screen {
             }
         });
     }
-
+    
     @Override
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
         if (entryListWidget.mouseScrolled(double_1, double_2, double_3))
             return true;
         return super.mouseScrolled(double_1, double_2, double_3);
     }
-
+    
     @Override
     public void render(int int_1, int int_2, float float_1) {
         this.renderDirtBackground(0);
@@ -96,5 +96,5 @@ public class CreditsScreen extends Screen {
         super.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() {
         return Optional.empty();
     }
-
+    
     @Override
     public Type getType() {
         return Type.RENDER;
     }
-
+    
     @Override
     public int getAmount() {
         return 0;
     }
-
+    
     @Override
     public void setAmount(int amount) {
-
+    
     }
-
+    
     @Override
     public boolean isEmpty() {
         return false;
     }
-
+    
     @Override
     public EntryStack copy() {
         return this;
     }
-
+    
     @Override
     public Object getObject() {
         return null;
     }
-
+    
     @Override
     public boolean equals(EntryStack stack, boolean ignoreTags, boolean ignoreAmount) {
         return stack == this;
     }
-
+    
     @Override
     public boolean equalsIgnoreTagsAndAmount(EntryStack stack) {
         return stack == this;
     }
-
+    
     @Override
     public boolean equalsIgnoreTags(EntryStack stack) {
         return stack == this;
     }
-
+    
     @Override
     public boolean equalsIgnoreAmount(EntryStack stack) {
         return stack == this;
     }
-
+    
     @Override
     public boolean equalsAll(EntryStack stack) {
         return stack == this;
     }
-
+    
     @Override
     public int getZ() {
         return getBlitOffset();
     }
-
+    
     @Override
     public void setZ(int z) {
         setBlitOffset(z);
     }
-
+    
     @Override
     public <T> EntryStack setting(Settings<T> settings, T value) {
         return this;
     }
-
+    
     @Override
     public <T> EntryStack removeSetting(Settings<T> settings) {
         return this;
     }
-
+    
     @Override
     public EntryStack clearSettings() {
         return this;
     }
-
+    
     @Override
     public <T> EntryStack addSetting(Settings<T> settings, T value) {
         return this;
     }
-
+    
     @SuppressWarnings("deprecation")
     @Override
     public <T> ObjectHolder<T> getSetting(Settings<T> settings) {
         return ObjectHolder.of(settings.getDefaultValue());
     }
-
+    
     public abstract int getHeight();
-
+    
     public final int getWidth() {
         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;
 
 public class SimpleRecipeEntry extends RecipeEntry {
-
+    
     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 List<EntryWidget> inputWidgets;
     private EntryWidget outputWidget;
-
+    
     protected SimpleRecipeEntry(List<List<EntryStack>> input, List<EntryStack> output) {
         List<Pair<List<EntryStack>, AtomicInteger>> newList = Lists.newArrayList();
         List<Pair<List<EntryStack>, Integer>> a = CollectionUtils.map(input, stacks -> new Pair<>(stacks, stacks.stream().map(EntryStack::getAmount).max(Integer::compareTo).orElse(1)));
@@ -53,15 +53,15 @@ public class SimpleRecipeEntry extends RecipeEntry {
         }).collect(Collectors.toList());
         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) {
         return create(input.get(), output.get());
     }
-
+    
     public static RecipeEntry create(List<List<EntryStack>> input, List<EntryStack> output) {
         return new SimpleRecipeEntry(input, output);
     }
-
+    
     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_2 = list_2.stream().distinct().sorted(ENTRY_COMPARATOR).collect(Collectors.toList());
@@ -74,7 +74,7 @@ public class SimpleRecipeEntry extends RecipeEntry {
                 return false;
         return true;
     }
-
+    
     @Override
     public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
         int xx = bounds.x + 4, yy = bounds.y + 2;
@@ -101,7 +101,7 @@ public class SimpleRecipeEntry extends RecipeEntry {
         outputWidget.getBounds().setLocation(xx, yy);
         outputWidget.render(mouseX, mouseY, delta);
     }
-
+    
     @Nullable
     @Override
     public QueuedTooltip getTooltip(int mouseX, int mouseY) {
@@ -113,18 +113,18 @@ public class SimpleRecipeEntry extends RecipeEntry {
             return outputWidget.getCurrentTooltip(mouseX, mouseY);
         return null;
     }
-
+    
     @Override
     public int getHeight() {
         return 4 + getItemsHeight() * 18;
     }
-
+    
     public int getItemsHeight() {
         return MathHelper.ceil(((float) inputWidgets.size()) / (getItemsPerLine() - 2));
     }
-
+    
     public int getItemsPerLine() {
         return MathHelper.floor((getWidth() - 4f) / 18f);
     }
-
+    
 }

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

@@ -28,7 +28,7 @@ import java.util.function.Supplier;
 import java.util.stream.Collectors;
 
 public class AutoCraftingButtonWidget extends ButtonWidget {
-
+    
     private static final Lazy<Boolean> IS_YOG = new Lazy(() -> {
         try {
             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 RecipeCategory<?> category;
     private Rectangle displayBounds;
-
+    
     public AutoCraftingButtonWidget(Rectangle displayBounds, Rectangle rectangle, String text, Supplier<RecipeDisplay> displaySupplier, List<Widget> setupDisplay, RecipeCategory<?> recipeCategory) {
         super(rectangle, text);
         this.displayBounds = displayBounds;
@@ -58,7 +58,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
         this.setupDisplay = setupDisplay;
         this.category = recipeCategory;
     }
-
+    
     @Override
     public void onPressed() {
         AutoTransferHandler.Context context = AutoTransferHandler.Context.create(true, containerScreen, displaySupplier.get());
@@ -73,7 +73,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
         minecraft.openScreen(containerScreen);
         ScreenHelper.getLastOverlay().init();
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
         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;
         renderBackground(x, y, width, height, this.getTextureId(isHovered(mouseX, mouseY)));
-
+        
         int colour = 14737632;
         if (!this.visible) {
             colour = 10526880;
         } else if (enabled && isHovered(mouseX, mouseY)) {
             colour = 16777120;
         }
-
+        
         fillGradient(x, y, x + width, y + height, color, color);
         this.drawCenteredString(font, getText(), x + width / 2, y + (height - 8) / 2, colour);
-
+        
         if (getTooltips().isPresent())
             if (!focused && containsMouse(mouseX, mouseY))
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n")));
             else if (focused)
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(new Point(x + width / 2, y + height / 2), getTooltips().get().split("\n")));
     }
-
+    
     @Override
     protected int getTextureId(boolean boolean_1) {
         return !visible ? 0 : boolean_1 && enabled ? (ConfigObject.getInstance().isLighterButtonHover() ? 4 : 3) : 1;
     }
-
+    
     @Override
     public Optional<String> getTooltips() {
         String str = "";
@@ -168,10 +168,10 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
         }
         return Optional.of(str);
     }
-
+    
     @Override
     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() && ConfigObject.getInstance().getCopyRecipeIdentifierKeybind().matchesKey(int_1, int_2) && containsMouse(PointHelper.fromMouse())) {
             minecraft.keyboard.setClipboard(displaySupplier.get().getRecipeLocation().get().toString());
             if (ConfigObject.getInstance().isToastDisplayedOnCopyIdentifier()) {
                 CopyRecipeIdentifierToast.addToast(I18n.translate("msg.rei.copied_recipe_id"), I18n.translate("msg.rei.recipe_id_details", displaySupplier.get().getRecipeLocation().get().toString()));

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

@@ -23,36 +23,36 @@ import java.util.Objects;
 import java.util.Optional;
 
 public abstract class ButtonWidget extends WidgetWithBounds {
-
+    
     protected static final Identifier BUTTON_LOCATION = new Identifier("roughlyenoughitems", "textures/gui/button.png");
     protected static final Identifier BUTTON_LOCATION_DARK = new Identifier("roughlyenoughitems", "textures/gui/button_dark.png");
     public boolean enabled;
     public boolean focused;
     private String text;
     private Rectangle bounds;
-
+    
     public ButtonWidget(Rectangle rectangle, Text text) {
         this(rectangle, Objects.requireNonNull(text).asFormattedString());
     }
-
+    
     public ButtonWidget(Rectangle rectangle, String text) {
         this.bounds = Objects.requireNonNull(rectangle);
         this.enabled = true;
         this.text = Objects.requireNonNull(text);
     }
-
+    
     public Rectangle getBounds() {
         return bounds;
     }
-
+    
     public String getText() {
         return text;
     }
-
+    
     public void setText(String text) {
         this.text = text;
     }
-
+    
     protected int getTextureId(boolean boolean_1) {
         int int_1 = 1;
         if (!this.enabled) {
@@ -60,10 +60,10 @@ public abstract class ButtonWidget extends WidgetWithBounds {
         } 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
         }
-
+        
         return int_1;
     }
-
+    
     protected void renderBackground(int x, int y, int width, int height, int textureOffset) {
         minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? BUTTON_LOCATION_DARK : BUTTON_LOCATION);
         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, 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);
-
+        
         //Sides
         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);
@@ -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);
         }
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
         int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height;
         renderBackground(x, y, width, height, this.getTextureId(isHovered(mouseX, mouseY)));
-
+        
         int color = 14737632;
         if (!this.enabled) {
             color = 10526880;
         } else if (isHovered(mouseX, mouseY)) {
             color = 16777120;
         }
-
+        
         this.drawCenteredString(font, getText(), x + width / 2, y + (height - 8) / 2, color);
-
+        
         if (getTooltips().isPresent())
             if (!focused && containsMouse(mouseX, mouseY))
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n")));
             else if (focused)
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(new Point(x + width / 2, y + height / 2), getTooltips().get().split("\n")));
     }
-
+    
     public boolean isHovered(int mouseX, int mouseY) {
         return isMouseOver(mouseX, mouseY) || focused;
     }
-
+    
     @Override
     public boolean changeFocus(boolean boolean_1) {
         if (!enabled)
@@ -119,12 +119,12 @@ public abstract class ButtonWidget extends WidgetWithBounds {
         this.focused = !this.focused;
         return true;
     }
-
+    
     @Override
     public List<? extends Element> children() {
         return Collections.emptyList();
     }
-
+    
     @Override
     public boolean mouseClicked(double mouseX, double mouseY, int button) {
         if (isMouseOver(mouseX, mouseY) && enabled && button == 0) {
@@ -134,7 +134,7 @@ public abstract class ButtonWidget extends WidgetWithBounds {
         }
         return false;
     }
-
+    
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (this.enabled && focused) {
@@ -148,11 +148,11 @@ public abstract class ButtonWidget extends WidgetWithBounds {
         }
         return false;
     }
-
+    
     public abstract void onPressed();
-
+    
     public Optional<String> getTooltips() {
         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;
 
 public class CategoryBaseWidget extends RecipeBaseWidget {
-
+    
     public CategoryBaseWidget(Rectangle bounds) {
         super(bounds);
     }
-
+    
     @Override
     protected int getYTextureOffset() {
         return 66;
     }
-
+    
     @Override
     protected boolean isRendering() {
         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;
 
 public abstract class ClickableLabelWidget extends LabelWidget {
-
+    
     public boolean focused;
     private boolean clickable = true;
     private int hoveredColor;
-
+    
     @Deprecated
     public ClickableLabelWidget(int x, int y, String text, boolean clickable) {
         this(new Point(x, y), text, clickable);
     }
-
+    
     @Deprecated
     public ClickableLabelWidget(int x, int y, String text) {
         this(new Point(x, y), text, true);
     }
-
+    
     @Deprecated
     public ClickableLabelWidget(Point point, String text, boolean clickable) {
         this(point, text);
         clickable(clickable);
     }
-
+    
     public ClickableLabelWidget(Point point, String text) {
         super(point, text);
         this.hoveredColor = ScreenHelper.isDarkModeEnabled() ? -1 : 0xFF66FFCC;
     }
-
+    
     public LabelWidget hoveredColor(int hoveredColor) {
         this.hoveredColor = hoveredColor;
         return this;
     }
-
+    
     public LabelWidget clickable(boolean clickable) {
         this.clickable = clickable;
         return this;
     }
-
+    
     public boolean isClickable() {
         return clickable;
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
         int color = getDefaultColor();
@@ -75,11 +75,11 @@ public abstract class ClickableLabelWidget extends LabelWidget {
             else if (focused)
                 ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(pos, getTooltips().get().split("\n")));
     }
-
+    
     public int getHoveredColor() {
         return hoveredColor;
     }
-
+    
     @Override
     public boolean mouseClicked(double mouseX, double mouseY, int button) {
         if (button == 0 && isClickable() && containsMouse(mouseX, mouseY)) {
@@ -88,11 +88,11 @@ public abstract class ClickableLabelWidget extends LabelWidget {
         }
         return false;
     }
-
+    
     public Optional<String> getTooltips() {
         return Optional.empty();
     }
-
+    
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (!isClickable() || !focused)
@@ -102,7 +102,7 @@ public abstract class ClickableLabelWidget extends LabelWidget {
         this.onLabelClicked();
         return true;
     }
-
+    
     @Override
     public boolean changeFocus(boolean boolean_1) {
         if (!isClickable())
@@ -110,11 +110,11 @@ public abstract class ClickableLabelWidget extends LabelWidget {
         this.focused = !this.focused;
         return true;
     }
-
+    
     public boolean isHovered(int mouseX, int mouseY) {
         return isClickable() && (containsMouse(mouseX, mouseY) || focused);
     }
-
+    
     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;
 
 public abstract class CraftableToggleButtonWidget extends ButtonWidget {
-
+    
     public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     private ItemRenderer itemRenderer;
-
+    
     public CraftableToggleButtonWidget(Rectangle rectangle) {
         super(rectangle, "");
         this.itemRenderer = minecraft.getItemRenderer();
     }
-
+    
     public CraftableToggleButtonWidget(int x, int y, int width, int height) {
         this(new Rectangle(x, y, width, height));
     }
-
+    
     public void lateRender(int mouseX, int mouseY, float delta) {
         super.render(mouseX, mouseY, delta);
-
+        
         this.itemRenderer.zOffset = getBlitOffset();
         Rectangle bounds = getBounds();
         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);
         setBlitOffset(0);
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
     }
-
+    
     @Override
     public boolean changeFocus(boolean boolean_1) {
         return false;
     }
-
+    
     @Override
     public Optional<String> getTooltips() {
         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;
 
 public abstract class DraggableWidget extends WidgetWithBounds {
-
+    
     public boolean dragged = false;
     private Point midPoint, startPoint;
     private int relateX, relateY;
-
+    
     public DraggableWidget(Point startingPoint) {
         initWidgets(midPoint = startingPoint);
     }
-
+    
     public DraggableWidget() {
         this(new Point(MinecraftClient.getInstance().getWindow().getScaledWidth() / 2, MinecraftClient.getInstance().getWindow().getScaledHeight() / 2));
     }
-
+    
     protected abstract void initWidgets(Point midPoint);
-
+    
     public abstract void updateWidgets(Point midPoint);
-
+    
     public abstract Rectangle getGrabBounds();
-
+    
     public abstract Rectangle getDragBounds();
-
+    
     public final Point getMidPoint() {
         return midPoint;
     }
-
+    
     @Override
     public boolean mouseDragged(double double_1, double double_2, int int_1, double double_3, double double_4) {
         Point mouse = PointHelper.fromMouse();
@@ -61,9 +61,9 @@ public abstract class DraggableWidget extends WidgetWithBounds {
                 return true;
         return false;
     }
-
+    
     public abstract Point processMidPoint(Point midPoint, Point mouse, Point startPoint, Window window, int relateX, int relateY);
-
+    
     @Override
     public boolean mouseReleased(double double_1, double double_2, int int_1) {
         if (int_1 == 0)
@@ -77,8 +77,8 @@ public abstract class DraggableWidget extends WidgetWithBounds {
                 return true;
         return false;
     }
-
+    
     public void onMouseReleaseMidPoint(Point midPoint) {
     }
-
+    
 }

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

@@ -8,6 +8,7 @@ package me.shedaniel.rei.gui.widget;
 import com.google.common.collect.Lists;
 import com.mojang.blaze3d.systems.RenderSystem;
 import me.shedaniel.clothconfig2.ClothConfigInitializer;
+import me.shedaniel.clothconfig2.api.ModifierKeyCode;
 import me.shedaniel.clothconfig2.api.ScissorsHandler;
 import me.shedaniel.clothconfig2.gui.widget.DynamicNewSmoothScrollingEntryListWidget;
 import me.shedaniel.math.api.Point;
@@ -46,7 +47,7 @@ import java.util.function.Supplier;
 import java.util.stream.Collectors;
 
 public class EntryListWidget extends WidgetWithBounds {
-
+    
     static final Supplier<Boolean> RENDER_ENCHANTMENT_GLINT = ConfigObject.getInstance()::doesRenderEntryEnchantmentGlint;
     @SuppressWarnings("deprecation")
     static final Comparator<? super EntryStack> ENTRY_NAME_COMPARER = Comparator.comparing(SearchArgument::tryGetEntryStackName);
@@ -58,6 +59,7 @@ public class EntryListWidget extends WidgetWithBounds {
         }
         return Integer.MAX_VALUE;
     });
+    private static final int SIZE = 18;
     private static final boolean LAZY = true;
     private static final String SPACE = " ", EMPTY = "";
     private static int page;
@@ -72,10 +74,13 @@ public class EntryListWidget extends WidgetWithBounds {
     private List<EntryStack> favorites = null;
     private List<EntryListEntry> entries = Collections.emptyList();
     private List<Widget> widgets = Collections.emptyList();
-    @SuppressWarnings("deprecation")
-    private List<SearchArgument.SearchArguments> lastSearchArguments = Collections.emptyList();
+    @SuppressWarnings("deprecation") private List<SearchArgument.SearchArguments> lastSearchArguments = Collections.emptyList();
     private boolean draggingScrollBar = false;
-
+    
+    public static int entrySize() {
+        return MathHelper.ceil(SIZE * ConfigObject.getInstance().getEntrySize());
+    }
+    
     @SuppressWarnings("rawtypes")
     static boolean notSteppingOnExclusionZones(int left, int top, Rectangle listArea) {
         MinecraftClient instance = MinecraftClient.getInstance();
@@ -86,73 +91,73 @@ public class EntryListWidget extends WidgetWithBounds {
         }
         return true;
     }
-
+    
     private static Rectangle updateInnerBounds(Rectangle bounds) {
         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) / (float) entrySize()), 1);
             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((int) (bounds.getCenterX() - width * (entrySize() / 2f) + 3), bounds.y, width * entrySize(), bounds.height);
+            return new Rectangle((int) (bounds.getCenterX() - width * (entrySize() / 2f) - 3), bounds.y, width * entrySize(), bounds.height);
         }
-        int width = Math.max(MathHelper.floor((bounds.width - 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);
+        int width = Math.max(MathHelper.floor((bounds.width - 2) / (float) entrySize()), 1);
+        int height = Math.max(MathHelper.floor((bounds.height - 2) / (float) entrySize()), 1);
+        return new Rectangle((int) (bounds.getCenterX() - width * (entrySize() / 2f)), (int) (bounds.getCenterY() - height * (entrySize() / 2f)), width * entrySize(), height * entrySize());
     }
-
+    
     protected final int getSlotsHeightNumberForFavorites() {
         if (favorites.isEmpty())
             return 0;
         if (ConfigObject.getInstance().isEntryListWidgetScrolled())
-            return MathHelper.ceil(2 + favorites.size() / (innerBounds.width / 18f));
-        int height = MathHelper.ceil(favorites.size() / (innerBounds.width / 18f));
-        int pagesToFit = MathHelper.ceil(height / (innerBounds.height / 18f - 1));
-        if (height > (innerBounds.height / 18 - 1) && (height) % (innerBounds.height / 18) == (innerBounds.height / 18) - 2)
+            return MathHelper.ceil(2 + favorites.size() / (innerBounds.width / (float) entrySize()));
+        int height = MathHelper.ceil(favorites.size() / (innerBounds.width / (float) entrySize()));
+        int pagesToFit = MathHelper.ceil(height / (innerBounds.height / (float) entrySize() - 1));
+        if (height > (innerBounds.height / entrySize() - 1) && (height) % (innerBounds.height / entrySize()) == (innerBounds.height / entrySize()) - 2)
             height--;
         return height + pagesToFit + 1;
     }
-
+    
     protected final int getScrollNumberForFavorites() {
         if (favorites.isEmpty())
             return 0;
-        return (innerBounds.width / 18) * getSlotsHeightNumberForFavorites();
+        return (innerBounds.width / entrySize()) * getSlotsHeightNumberForFavorites();
     }
-
+    
     protected final int getMaxScrollPosition() {
         if (favorites.isEmpty())
-            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) / (innerBounds.width / (float) entrySize())) * entrySize();
+        return MathHelper.ceil((allStacks.size() + blockedCount + getScrollNumberForFavorites()) / (innerBounds.width / (float) entrySize())) * entrySize() - 12;
     }
-
+    
     protected final int getMaxScroll() {
         return Math.max(0, this.getMaxScrollPosition() - innerBounds.height);
     }
-
+    
     protected final double clamp(double v) {
         return this.clamp(v, 200.0D);
     }
-
+    
     protected final double clamp(double v, double clampExtension) {
         return MathHelper.clamp(v, -clampExtension, (double) this.getMaxScroll() + clampExtension);
     }
-
+    
     protected final void offset(double value, boolean animated) {
         scrollTo(target + value, animated);
     }
-
+    
     protected final void scrollTo(double value, boolean animated) {
         scrollTo(value, animated, ClothConfigInitializer.getScrollDuration());
     }
-
+    
     protected final void scrollTo(double value, boolean animated, long duration) {
         target = clamp(value);
-
+        
         if (animated) {
             start = System.currentTimeMillis();
             this.duration = duration;
         } else
             scroll = target;
     }
-
+    
     @Override
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled() && bounds.contains(double_1, double_2)) {
@@ -161,34 +166,34 @@ public class EntryListWidget extends WidgetWithBounds {
         }
         return super.mouseScrolled(double_1, double_2, double_3);
     }
-
+    
     @Override
     public Rectangle getBounds() {
         return bounds;
     }
-
+    
     public int getPage() {
         return page;
     }
-
+    
     public void setPage(int page) {
-        this.page = page;
+        EntryListWidget.page = page;
     }
-
+    
     public void previousPage() {
-        this.page--;
+        page--;
     }
-
+    
     public void nextPage() {
-        this.page++;
+        page++;
     }
-
+    
     public int getTotalPages() {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled())
             return 1;
         return MathHelper.ceil((allStacks.size() + getScrollNumberForFavorites()) / (float) entries.size());
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled()) {
@@ -196,8 +201,8 @@ public class EntryListWidget extends WidgetWithBounds {
                 entry.clearStacks();
             ScissorsHandler.INSTANCE.scissor(bounds);
             int sizeForFavorites = getSlotsHeightNumberForFavorites();
-            int skip = Math.max(0, MathHelper.floor(scroll / 18f) - sizeForFavorites);
-            int nextIndex = skip * innerBounds.width / 18;
+            int skip = Math.max(0, MathHelper.floor(scroll / (float) entrySize()) - sizeForFavorites);
+            int nextIndex = skip * innerBounds.width / entrySize();
             int i = nextIndex;
             blockedCount = 0;
             if (debugTime) {
@@ -205,10 +210,9 @@ public class EntryListWidget extends WidgetWithBounds {
                 long time = 0;
                 if (sizeForFavorites > 0) {
                     drawString(font, I18n.translate("text.rei.favorites"), innerBounds.x + 2, (int) (innerBounds.y + 8 - scroll), -1);
-                    nextIndex += innerBounds.width / 18;
-                    for (int i1 = 0; i1 < favorites.size(); i1++) {
-                        EntryStack stack = favorites.get(i1);
-                        back1:
+                    nextIndex += innerBounds.width / entrySize();
+                    back1:
+                    for (EntryStack stack : favorites) {
                         while (true) {
                             EntryListEntry entry = entries.get(nextIndex);
                             entry.getBounds().y = (int) (entry.backupY - scroll);
@@ -229,7 +233,7 @@ public class EntryListWidget extends WidgetWithBounds {
                             }
                         }
                     }
-                    nextIndex += innerBounds.width / -18 + getScrollNumberForFavorites() - favorites.size();
+                    nextIndex += innerBounds.width / -entrySize() + getScrollNumberForFavorites() - favorites.size();
                 }
                 int offset = sizeForFavorites > 0 ? -12 : 0;
                 back:
@@ -244,9 +248,9 @@ public class EntryListWidget extends WidgetWithBounds {
                             entry.entry(stack);
                             entry.isFavorites = false;
                             size++;
-                            long l = System.currentTimeMillis();
+                            long l = System.nanoTime();
                             entry.render(mouseX, mouseY, delta);
-                            time += (System.currentTimeMillis() - l);
+                            time += (System.nanoTime() - l);
                             nextIndex++;
                             break;
                         } else {
@@ -257,7 +261,7 @@ public class EntryListWidget extends WidgetWithBounds {
                 }
                 int z = getZ();
                 setZ(500);
-                String str = String.format("%d entries, avg. %.2fms, %s fps", size, time / (double) size, minecraft.fpsDebugString.split(" ")[0]);
+                String str = String.format("%d entries, avg. %.0fns, %s fps", size, time / (double) size, minecraft.fpsDebugString.split(" ")[0]);
                 fillGradient(bounds.x, bounds.y, bounds.x + font.getStringWidth(str) + 2, bounds.y + font.fontHeight + 2, -16777216, -16777216);
                 MatrixStack matrixStack_1 = new MatrixStack();
                 VertexConsumerProvider.Immediate immediate = VertexConsumerProvider.immediate(Tessellator.getInstance().getBuffer());
@@ -269,10 +273,9 @@ public class EntryListWidget extends WidgetWithBounds {
             } else {
                 if (sizeForFavorites > 0) {
                     drawString(font, I18n.translate("text.rei.favorites"), innerBounds.x + 2, (int) (innerBounds.y + 8 - scroll), -1);
-                    nextIndex += innerBounds.width / 18;
-                    for (int i1 = 0; i1 < favorites.size(); i1++) {
-                        EntryStack stack = favorites.get(i1);
-                        back1:
+                    nextIndex += innerBounds.width / entrySize();
+                    back1:
+                    for (EntryStack stack : favorites) {
                         while (true) {
                             EntryListEntry entry = entries.get(nextIndex);
                             entry.getBounds().y = (int) (entry.backupY - scroll);
@@ -290,7 +293,7 @@ public class EntryListWidget extends WidgetWithBounds {
                             }
                         }
                     }
-                    nextIndex += innerBounds.width / -18 + getScrollNumberForFavorites() - favorites.size();
+                    nextIndex += innerBounds.width / -entrySize() + getScrollNumberForFavorites() - favorites.size();
                 }
                 int offset = sizeForFavorites > 0 ? -12 : 0;
                 back:
@@ -324,15 +327,15 @@ public class EntryListWidget extends WidgetWithBounds {
                 for (Widget widget : widgets) {
                     if (widget instanceof EntryListEntry) {
                         size++;
-                        long l = System.currentTimeMillis();
+                        long l = System.nanoTime();
                         widget.render(mouseX, mouseY, delta);
-                        time += (System.currentTimeMillis() - l);
+                        time += (System.nanoTime() - l);
                     } else
                         widget.render(mouseX, mouseY, delta);
                 }
                 int z = getZ();
                 setZ(500);
-                String str = String.format("%d entries, avg. %.2fms, %s fps", size, time / (double) size, minecraft.fpsDebugString.split(" ")[0]);
+                String str = String.format("%d entries, avg. %.0fns, %s fps", size, time / (double) size, minecraft.fpsDebugString.split(" ")[0]);
                 fillGradient(bounds.x, bounds.y, bounds.x + font.getStringWidth(str) + 2, bounds.y + font.fontHeight + 2, -16777216, -16777216);
                 MatrixStack matrixStack_1 = new MatrixStack();
                 VertexConsumerProvider.Immediate immediate = VertexConsumerProvider.immediate(Tessellator.getInstance().getBuffer());
@@ -348,26 +351,26 @@ public class EntryListWidget extends WidgetWithBounds {
             }
         }
     }
-
+    
     private int getScrollbarMinX() {
         if (ConfigObject.getInstance().isLeftHandSidePanel())
             return bounds.x + 1;
         return bounds.getMaxX() - 7;
     }
-
+    
     @Override
     public boolean mouseDragged(double mouseX, double mouseY, int int_1, double double_3, double double_4) {
         if (int_1 == 0 && draggingScrollBar) {
             float height = getMaxScrollPosition();
             int actualHeight = innerBounds.height;
             if (height > actualHeight && mouseY >= innerBounds.y && mouseY <= innerBounds.getMaxY()) {
-                double double_5 = (double) Math.max(1, this.getMaxScroll());
+                double double_5 = Math.max(1, this.getMaxScroll());
                 int int_2 = innerBounds.height;
                 int int_3 = MathHelper.clamp((int) ((float) (int_2 * int_2) / (float) getMaxScrollPosition()), 32, int_2 - 8);
                 double double_6 = Math.max(1.0D, double_5 / (double) (int_2 - int_3));
                 float to = MathHelper.clamp((float) (scroll + double_4 * double_6), 0, height - innerBounds.height);
                 if (ConfigObject.getInstance().doesSnapToRows()) {
-                    double nearestRow = Math.round(to / 18.0) * 18.0;
+                    double nearestRow = Math.round(to / (double) entrySize()) * (double) entrySize();
                     scrollTo(nearestRow, false);
                 } else
                     scrollTo(to, false);
@@ -375,7 +378,7 @@ public class EntryListWidget extends WidgetWithBounds {
         }
         return super.mouseDragged(mouseX, mouseY, int_1, double_3, double_4);
     }
-
+    
     private void renderScrollbar() {
         int maxScroll = getMaxScroll();
         if (maxScroll > 0) {
@@ -384,13 +387,13 @@ public class EntryListWidget extends WidgetWithBounds {
             height -= Math.min((scroll < 0 ? (int) -scroll : scroll > maxScroll ? (int) scroll - maxScroll : 0), height * .95);
             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 scrollbarPositionMinX = getScrollbarMinX();
             int scrollbarPositionMaxX = scrollbarPositionMinX + 6;
             boolean hovered = (new Rectangle(scrollbarPositionMinX, minY, scrollbarPositionMaxX - scrollbarPositionMinX, height)).contains(PointHelper.fromMouse());
             float bottomC = (hovered ? .67f : .5f) * (ScreenHelper.isDarkModeEnabled() ? 0.8f : 1f);
             float topC = (hovered ? .87f : .67f) * (ScreenHelper.isDarkModeEnabled() ? 0.8f : 1f);
-
+            
             RenderSystem.disableTexture();
             RenderSystem.enableBlend();
             RenderSystem.disableAlphaTest();
@@ -416,7 +419,7 @@ public class EntryListWidget extends WidgetWithBounds {
             RenderSystem.enableTexture();
         }
     }
-
+    
     private void updatePosition(float delta) {
         target = clamp(target);
         if (target < 0) {
@@ -424,7 +427,7 @@ public class EntryListWidget extends WidgetWithBounds {
         } else if (target > getMaxScroll()) {
             target = (target - getMaxScroll()) * (1 - (1 - ClothConfigInitializer.getBounceBackMultiplier()) * delta / 3) + getMaxScroll();
         } else if (ConfigObject.getInstance().doesSnapToRows()) {
-            double nearestRow = Math.round(target / 18.0) * 18.0;
+            double nearestRow = Math.round(target / (double) entrySize()) * (double) entrySize();
             if (!DynamicNewSmoothScrollingEntryListWidget.Precision.almostEquals(target, nearestRow, DynamicNewSmoothScrollingEntryListWidget.Precision.FLOAT_EPSILON))
                 target += (nearestRow - target) * Math.min(delta / 2.0, 1.0);
             else
@@ -435,7 +438,7 @@ public class EntryListWidget extends WidgetWithBounds {
         else
             scroll = target;
     }
-
+    
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (containsMouse(PointHelper.fromMouse()))
@@ -444,7 +447,7 @@ public class EntryListWidget extends WidgetWithBounds {
                     return true;
         return false;
     }
-
+    
     public void updateArea(DisplayHelper.DisplayBoundsHandler<?> boundsHandler, @Nullable String searchTerm) {
         this.bounds = boundsHandler.getItemListArea(ScreenHelper.getLastOverlay().getBounds());
         FavoritesListWidget favoritesListWidget = ContainerScreenOverlay.getFavoritesListWidget();
@@ -457,18 +460,18 @@ public class EntryListWidget extends WidgetWithBounds {
         else
             updateEntriesPosition();
     }
-
+    
     public void updateEntriesPosition() {
         this.innerBounds = updateInnerBounds(bounds);
         if (!ConfigObject.getInstance().isEntryListWidgetScrolled()) {
             page = Math.max(page, 0);
             List<EntryListEntry> entries = Lists.newLinkedList();
-            int width = innerBounds.width / 18;
-            int height = innerBounds.height / 18;
+            int width = innerBounds.width / entrySize();
+            int height = innerBounds.height / entrySize();
             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)) {
-                        entries.add((EntryListEntry) new EntryListEntry(currentX * 18 + innerBounds.x, currentY * 18 + innerBounds.y).noBackground());
+                    if (notSteppingOnExclusionZones(currentX * entrySize() + innerBounds.x, currentY * entrySize() + innerBounds.y, innerBounds)) {
+                        entries.add((EntryListEntry) new EntryListEntry(currentX * entrySize() + innerBounds.x, currentY * entrySize() + innerBounds.y).noBackground());
                     }
                 }
             }
@@ -490,8 +493,7 @@ public class EntryListWidget extends WidgetWithBounds {
                     j += width;
                 }
                 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++) {
-                    EntryStack stack = subFavoritesList.get(i);
+                for (EntryStack stack : subFavoritesList) {
                     entries.get(j).clearStacks().entry(stack);
                     entries.get(j).isFavorites = true;
                     j++;
@@ -499,16 +501,16 @@ public class EntryListWidget extends WidgetWithBounds {
             }
         } else {
             page = 0;
-            int width = innerBounds.width / 18;
-            int pageHeight = innerBounds.height / 18;
+            int width = innerBounds.width / entrySize();
+            int pageHeight = innerBounds.height / entrySize();
             int sizeForFavorites = getScrollNumberForFavorites();
-            int slotsToPrepare = allStacks.size() * 3 + sizeForFavorites * 3;
+            int slotsToPrepare = Math.max(allStacks.size() * 3 + sizeForFavorites * 3, width * pageHeight * 3);
             int currentX = 0;
             int currentY = 0;
             List<EntryListEntry> entries = Lists.newLinkedList();
             for (int i = 0; i < slotsToPrepare; i++) {
-                int xPos = currentX * 18 + innerBounds.x;
-                int yPos = currentY * 18 + innerBounds.y;
+                int xPos = currentX * entrySize() + innerBounds.x;
+                int yPos = currentY * entrySize() + innerBounds.y;
                 entries.add((EntryListEntry) new EntryListEntry(xPos, yPos).noBackground());
                 currentX++;
                 if (currentX >= width) {
@@ -523,13 +525,12 @@ public class EntryListWidget extends WidgetWithBounds {
         if (favoritesListWidget != null)
             favoritesListWidget.updateEntriesPosition();
     }
-
+    
     @Deprecated
     public List<EntryStack> getAllStacks() {
         return allStacks;
     }
-
-    @SuppressWarnings("deprecation")
+    
     public void updateSearch(String searchTerm) {
         lastSearchArguments = processSearchTerm(searchTerm);
         {
@@ -582,17 +583,19 @@ public class EntryListWidget extends WidgetWithBounds {
             favoritesListWidget.updateSearch(this, searchTerm);
         updateEntriesPosition();
     }
-
-    @SuppressWarnings("deprecation")
+    
     public boolean canLastSearchTermsBeAppliedTo(EntryStack stack) {
         return lastSearchArguments.isEmpty() || canSearchTermsBeAppliedTo(stack, lastSearchArguments);
     }
-
+    
     @SuppressWarnings("deprecation")
     private boolean canSearchTermsBeAppliedTo(EntryStack stack, List<SearchArgument.SearchArguments> searchArguments) {
         if (searchArguments.isEmpty())
             return true;
-        String mod = null, name = null, tooltip = null, tags[] = null;
+        String mod = null;
+        String name = null;
+        String tooltip = null;
+        String[] tags = null;
         for (SearchArgument.SearchArguments arguments : searchArguments) {
             boolean applicable = true;
             for (SearchArgument argument : arguments.getArguments()) {
@@ -654,7 +657,7 @@ public class EntryListWidget extends WidgetWithBounds {
         }
         return false;
     }
-
+    
     @SuppressWarnings("deprecation")
     private List<SearchArgument.SearchArguments> processSearchTerm(String searchTerm) {
         List<SearchArgument.SearchArguments> searchArguments = Lists.newArrayList();
@@ -689,30 +692,32 @@ public class EntryListWidget extends WidgetWithBounds {
         }
         return searchArguments;
     }
-
+    
     @Override
     public List<? extends Widget> children() {
         return widgets;
     }
-
+    
     @Override
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
-        double height = getMaxScroll();
-        int actualHeight = bounds.height;
-        if (height > actualHeight && double_2 >= bounds.y && double_2 <= bounds.getMaxY()) {
-            double scrollbarPositionMinX = getScrollbarMinX();
-            if (double_1 >= scrollbarPositionMinX - 1 & double_1 <= scrollbarPositionMinX + 8) {
-                this.draggingScrollBar = true;
-                return true;
+        if (ConfigObject.getInstance().isEntryListWidgetScrolled()) {
+            double height = getMaxScroll();
+            int actualHeight = bounds.height;
+            if (height > actualHeight && double_2 >= bounds.y && double_2 <= bounds.getMaxY()) {
+                double scrollbarPositionMinX = getScrollbarMinX();
+                if (double_1 >= scrollbarPositionMinX - 1 & double_1 <= scrollbarPositionMinX + 8) {
+                    this.draggingScrollBar = true;
+                    return true;
+                }
             }
+            this.draggingScrollBar = false;
         }
-        this.draggingScrollBar = false;
-
+        
         if (containsMouse(double_1, double_2)) {
             ClientPlayerEntity player = minecraft.player;
             if (ClientHelper.getInstance().isCheating() && !player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets()) {
                 ClientHelper.getInstance().sendDeletePacket();
-                return true;
+                return false;
             }
             if (!player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets())
                 return false;
@@ -722,27 +727,28 @@ public class EntryListWidget extends WidgetWithBounds {
         }
         return false;
     }
-
+    
     private class EntryListEntry extends EntryWidget {
         private int backupY;
         private boolean isFavorites;
-
+        
         private EntryListEntry(int x, int y) {
             super(x, y);
             this.backupY = y;
+            getBounds().width = getBounds().height = entrySize();
         }
-
+        
         @Override
         public boolean containsMouse(double mouseX, double mouseY) {
             return super.containsMouse(mouseX, mouseY) && bounds.contains(mouseX, mouseY);
         }
-
+        
         @Override
         protected void drawHighlighted(int mouseX, int mouseY, float delta) {
             if (getCurrentEntry().getType() != EntryStack.Type.EMPTY)
                 super.drawHighlighted(mouseX, mouseY, delta);
         }
-
+        
         private String getLocalizedName(InputUtil.KeyCode value) {
             String string_1 = value.getName();
             int int_1 = value.getKeyCode();
@@ -755,21 +761,20 @@ public class EntryListWidget extends WidgetWithBounds {
                     string_2 = InputUtil.getScancodeName(int_1);
                     break;
                 case MOUSE:
-                    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 string_3 = I18n.translate(string_1);
+                    string_2 = Objects.equals(string_3, string_1) ? I18n.translate(InputUtil.Type.MOUSE.getName(), 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) : string_2;
         }
-
+        
         @Override
         protected void queueTooltip(int mouseX, int mouseY, float delta) {
             if (!ClientHelper.getInstance().isCheating() || minecraft.player.inventory.getCursorStack().isEmpty()) {
                 QueuedTooltip tooltip = getCurrentTooltip(mouseX, mouseY);
                 if (tooltip != null) {
-                    //                    if (ConfigObject.getInstance().doDisplayFavoritesTooltip()) {
-                    if (ConfigObject.getInstance().doDisplayFavoritesTooltip() && !ConfigObject.getInstance().doDisplayFavoritesOnTheLeft()) {
-                        String name = getLocalizedName(ConfigObject.getInstance().getFavoriteKeybind());
+                    if (ConfigObject.getInstance().doDisplayFavoritesTooltip() && !ConfigObject.getInstance().getFavoriteKeyCode().isUnknown()) {
+                        String name = ConfigObject.getInstance().getFavoriteKeyCode().getLocalizedName();
                         if (!isFavorites)
                             tooltip.getText().addAll(Arrays.asList(I18n.translate("text.rei.favorites_tooltip", name).split("\n")));
                         else
@@ -779,32 +784,19 @@ public class EntryListWidget extends WidgetWithBounds {
                 }
             }
         }
-
+        
         @Override
         public boolean keyPressed(int int_1, int int_2, int int_3) {
             if (interactable && ConfigObject.getInstance().isFavoritesEnabled() && containsMouse(PointHelper.fromMouse()) && !getCurrentEntry().isEmpty()) {
-                InputUtil.KeyCode keyCode = ConfigObject.getInstance().getFavoriteKeybind();
-                if (int_1 == InputUtil.UNKNOWN_KEYCODE.getKeyCode()) {
-                    if (keyCode.getCategory() == InputUtil.Type.SCANCODE && keyCode.getKeyCode() == int_2) {
-                        if (!isFavorites) {
-                            ConfigManager.getInstance().getFavorites().add(getCurrentEntry().copy());
-                            ContainerScreenOverlay.getEntryListWidget().updateSearch(ScreenHelper.getSearchField().getText());
-                        } else {
-                            ConfigManager.getInstance().getFavorites().remove(getCurrentEntry());
-                            ContainerScreenOverlay.getEntryListWidget().updateSearch(ScreenHelper.getSearchField().getText());
-                        }
-                        ConfigManager.getInstance().saveConfig();
-                        minecraft.getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
-                        return true;
-                    }
-                } else if (keyCode.getCategory() == InputUtil.Type.KEYSYM && keyCode.getKeyCode() == int_1) {
+                ModifierKeyCode keyCode = ConfigObject.getInstance().getFavoriteKeyCode();
+                if (keyCode.matchesKey(int_1, int_2)) {
                     if (!isFavorites) {
-                        ConfigManager.getInstance().getFavorites().add(getCurrentEntry().copy());
-                        ContainerScreenOverlay.getEntryListWidget().updateSearch(ScreenHelper.getSearchField().getText());
+                        if (!CollectionUtils.anyMatchEqualsAll(ConfigManager.getInstance().getFavorites(), getCurrentEntry()))
+                            ConfigManager.getInstance().getFavorites().add(getCurrentEntry().copy());
                     } else {
                         ConfigManager.getInstance().getFavorites().remove(getCurrentEntry());
-                        ContainerScreenOverlay.getEntryListWidget().updateSearch(ScreenHelper.getSearchField().getText());
                     }
+                    ContainerScreenOverlay.getEntryListWidget().updateSearch(ScreenHelper.getSearchField().getText());
                     ConfigManager.getInstance().saveConfig();
                     minecraft.getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                     return true;
@@ -812,23 +804,25 @@ public class EntryListWidget extends WidgetWithBounds {
             }
             return super.keyPressed(int_1, int_2, int_3);
         }
-
+        
         @Override
         public boolean mouseClicked(double mouseX, double mouseY, int button) {
             if (!interactable)
                 return super.mouseClicked(mouseX, mouseY, button);
             if (containsMouse(mouseX, mouseY) && ClientHelper.getInstance().isCheating()) {
                 EntryStack entry = getCurrentEntry().copy();
-                if (entry.getType() == EntryStack.Type.ITEM) {
-                    if (ConfigObject.getInstance().getItemCheatingMode() == ItemCheatingMode.REI_LIKE)
-                        entry.setAmount(button != 1 ? 1 : entry.getItemStack().getMaxCount());
-                    else if (ConfigObject.getInstance().getItemCheatingMode() == ItemCheatingMode.JEI_LIKE)
-                        entry.setAmount(button != 0 ? 1 : entry.getItemStack().getMaxCount());
-                    else
-                        entry.setAmount(1);
+                if (!entry.isEmpty()) {
+                    if (entry.getType() == EntryStack.Type.ITEM) {
+                        if (ConfigObject.getInstance().getItemCheatingMode() == ItemCheatingMode.REI_LIKE)
+                            entry.setAmount(button != 1 ? 1 : entry.getItemStack().getMaxCount());
+                        else if (ConfigObject.getInstance().getItemCheatingMode() == ItemCheatingMode.JEI_LIKE)
+                            entry.setAmount(button != 0 ? 1 : entry.getItemStack().getMaxCount());
+                        else
+                            entry.setAmount(1);
+                    }
+                    ClientHelper.getInstance().tryCheatingEntry(entry);
+                    return true;
                 }
-                ClientHelper.getInstance().tryCheatingEntry(entry);
-                return true;
             }
             return super.mouseClicked(mouseX, mouseY, button);
         }

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

@@ -9,6 +9,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.math.impl.PointHelper;
 import me.shedaniel.rei.api.ClientHelper;
+import me.shedaniel.rei.api.ConfigObject;
 import me.shedaniel.rei.api.EntryStack;
 import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.gui.Element;
@@ -21,77 +22,77 @@ import java.util.Collections;
 import java.util.List;
 
 public class EntryWidget extends WidgetWithBounds {
-
+    
     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 boolean highlight = true;
     protected boolean tooltips = true;
     protected boolean background = true;
     protected boolean interactable = true;
     private Rectangle bounds;
     private List<EntryStack> entryStacks;
-
+    
     protected EntryWidget(int x, int y) {
         this.bounds = new Rectangle(x - 1, y - 1, 18, 18);
         this.entryStacks = new ArrayList<>();
     }
-
+    
     public static EntryWidget create(int x, int y) {
         return new EntryWidget(x, y);
     }
-
+    
     public EntryWidget disableInteractions() {
         return interactable(false);
     }
-
+    
     public EntryWidget interactable(boolean b) {
         interactable = b;
         return this;
     }
-
+    
     public EntryWidget noHighlight() {
         return highlight(false);
     }
-
+    
     public EntryWidget highlight(boolean b) {
         highlight = b;
         return this;
     }
-
+    
     public EntryWidget noTooltips() {
         return tooltips(false);
     }
-
+    
     public EntryWidget tooltips(boolean b) {
         tooltips = b;
         return this;
     }
-
+    
     public EntryWidget noBackground() {
         return background(false);
     }
-
+    
     public EntryWidget background(boolean b) {
         background = b;
         return this;
     }
-
+    
     public EntryWidget clearStacks() {
         entryStacks.clear();
         return this;
     }
-
+    
     public EntryWidget entry(EntryStack stack) {
         entryStacks.add(stack);
         return this;
     }
-
+    
     public EntryWidget entries(Collection<EntryStack> stacks) {
         entryStacks.addAll(stacks);
         return this;
     }
-
+    
     protected EntryStack getCurrentEntry() {
         if (entryStacks.isEmpty())
             return EntryStack.empty();
@@ -99,27 +100,27 @@ public class EntryWidget extends WidgetWithBounds {
             return entryStacks.get(0);
         return entryStacks.get(MathHelper.floor((System.currentTimeMillis() / 500 % (double) entryStacks.size()) / 1f));
     }
-
+    
     public List<EntryStack> entries() {
         return entryStacks;
     }
-
+    
     @Override
     public Rectangle getBounds() {
         return bounds;
     }
-
+    
     protected Rectangle getInnerBounds() {
         return new Rectangle(bounds.x + 1, bounds.y + 1, bounds.width - 2, bounds.height - 2);
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
         if (background) {
             drawBackground(mouseX, mouseY, delta);
         }
         drawCurrentEntry(mouseX, mouseY, delta);
-
+        
         boolean highlighted = containsMouse(mouseX, mouseY);
         if (tooltips && highlighted) {
             queueTooltip(mouseX, mouseY, delta);
@@ -128,29 +129,29 @@ public class EntryWidget extends WidgetWithBounds {
             drawHighlighted(mouseX, mouseY, delta);
         }
     }
-
+    
     protected void drawBackground(int mouseX, int mouseY, float delta) {
         minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? RECIPE_GUI_DARK : RECIPE_GUI);
         blit(bounds.x, bounds.y, 0, 222, bounds.width, bounds.height);
     }
-
+    
     protected void drawCurrentEntry(int mouseX, int mouseY, float delta) {
         EntryStack entry = getCurrentEntry();
         entry.setZ(100);
         entry.render(getInnerBounds(), mouseX, mouseY, delta);
     }
-
+    
     protected void queueTooltip(int mouseX, int mouseY, float delta) {
         QueuedTooltip tooltip = getCurrentTooltip(mouseX, mouseY);
         if (tooltip != null) {
             ScreenHelper.getLastOverlay().addTooltip(tooltip);
         }
     }
-
+    
     public QueuedTooltip getCurrentTooltip(int mouseX, int mouseY) {
         return getCurrentEntry().getTooltip(mouseX, mouseY);
     }
-
+    
     protected void drawHighlighted(int mouseX, int mouseY, float delta) {
         RenderSystem.disableDepthTest();
         RenderSystem.colorMask(true, true, true, false);
@@ -162,12 +163,12 @@ public class EntryWidget extends WidgetWithBounds {
         RenderSystem.colorMask(true, true, true, true);
         RenderSystem.enableDepthTest();
     }
-
+    
     @Override
     public List<? extends Element> children() {
         return Collections.emptyList();
     }
-
+    
     @Override
     public boolean mouseClicked(double mouseX, double mouseY, int button) {
         if (!interactable)
@@ -179,15 +180,15 @@ public class EntryWidget extends WidgetWithBounds {
                 return ClientHelper.getInstance().executeUsageKeyBind(getCurrentEntry());
         return false;
     }
-
+    
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (!interactable)
             return false;
         if (containsMouse(PointHelper.fromMouse()))
-            if (ClientHelper.getInstance().getRecipeKeyBinding().matchesKey(int_1, int_2))
+            if (ConfigObject.getInstance().getRecipeKeybind().matchesKey(int_1, int_2))
                 return ClientHelper.getInstance().executeRecipeKeyBind(getCurrentEntry());
-            else if (ClientHelper.getInstance().getUsageKeyBinding().matchesKey(int_1, int_2))
+            else if (ConfigObject.getInstance().getUsageKeybind().matchesKey(int_1, int_2))
                 return ClientHelper.getInstance().executeUsageKeyBind(getCurrentEntry());
         return false;
     }

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

@@ -8,6 +8,7 @@ package me.shedaniel.rei.gui.widget;
 import com.google.common.collect.Lists;
 import com.mojang.blaze3d.systems.RenderSystem;
 import me.shedaniel.clothconfig2.ClothConfigInitializer;
+import me.shedaniel.clothconfig2.api.ModifierKeyCode;
 import me.shedaniel.clothconfig2.api.ScissorsHandler;
 import me.shedaniel.clothconfig2.gui.widget.DynamicNewSmoothScrollingEntryListWidget;
 import me.shedaniel.math.api.Rectangle;
@@ -48,48 +49,48 @@ public class FavoritesListWidget extends WidgetWithBounds {
     private Rectangle bounds, innerBounds;
     private List<EntryListEntry> entries = Collections.emptyList();
     private boolean draggingScrollBar = false;
-
+    
     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) / (float) entrySize()), 1);
         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((int) (bounds.getCenterX() - width * (entrySize() / 2f) + 3), bounds.y, width * entrySize(), bounds.height);
+        return new Rectangle((int) (bounds.getCenterX() - width * (entrySize() / 2f) - 3), bounds.y, width * entrySize(), bounds.height);
     }
-
+    
     protected final int getMaxScrollPosition() {
-        return MathHelper.ceil((favorites.size() + blockedCount) / (innerBounds.width / 18f)) * 18;
+        return MathHelper.ceil((favorites.size() + blockedCount) / (innerBounds.width / (float) entrySize())) * entrySize();
     }
-
+    
     protected final int getMaxScroll() {
         return Math.max(0, this.getMaxScrollPosition() - innerBounds.height);
     }
-
+    
     protected final double clamp(double v) {
         return this.clamp(v, 200.0D);
     }
-
+    
     protected final double clamp(double v, double clampExtension) {
         return MathHelper.clamp(v, -clampExtension, (double) this.getMaxScroll() + clampExtension);
     }
-
+    
     protected final void offset(double value, boolean animated) {
         scrollTo(target + value, animated);
     }
-
+    
     protected final void scrollTo(double value, boolean animated) {
         scrollTo(value, animated, ClothConfigInitializer.getScrollDuration());
     }
-
+    
     protected final void scrollTo(double value, boolean animated, long duration) {
         target = clamp(value);
-
+        
         if (animated) {
             start = System.currentTimeMillis();
             this.duration = duration;
         } else
             scroll = target;
     }
-
+    
     @Override
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
         if (ConfigObject.getInstance().isEntryListWidgetScrolled() && bounds.contains(double_1, double_2)) {
@@ -98,20 +99,21 @@ public class FavoritesListWidget extends WidgetWithBounds {
         }
         return super.mouseScrolled(double_1, double_2, double_3);
     }
-
+    
     @Override
     public Rectangle getBounds() {
         return bounds;
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
-        if (bounds.isEmpty()) return;
+        if (bounds.isEmpty())
+            return;
         for (EntryListEntry entry : entries)
             entry.clearStacks();
         ScissorsHandler.INSTANCE.scissor(bounds);
-        int skip = Math.max(0, MathHelper.floor(scroll / 18f));
-        int nextIndex = skip * innerBounds.width / 18;
+        int skip = Math.max(0, MathHelper.floor(scroll / (float) entrySize()));
+        int nextIndex = skip * innerBounds.width / entrySize();
         int i = nextIndex;
         blockedCount = 0;
         back:
@@ -137,26 +139,26 @@ public class FavoritesListWidget extends WidgetWithBounds {
         ScissorsHandler.INSTANCE.removeLastScissor();
         renderScrollbar();
     }
-
+    
     private int getScrollbarMinX() {
         if (!ConfigObject.getInstance().isLeftHandSidePanel())
             return bounds.x + 1;
         return bounds.getMaxX() - 7;
     }
-
+    
     @Override
     public boolean mouseDragged(double mouseX, double mouseY, int int_1, double double_3, double double_4) {
         if (int_1 == 0 && draggingScrollBar) {
             float height = getMaxScrollPosition();
             int actualHeight = innerBounds.height;
             if (height > actualHeight && mouseY >= innerBounds.y && mouseY <= innerBounds.getMaxY()) {
-                double double_5 = (double) Math.max(1, this.getMaxScroll());
+                double double_5 = Math.max(1, this.getMaxScroll());
                 int int_2 = innerBounds.height;
                 int int_3 = MathHelper.clamp((int) ((float) (int_2 * int_2) / (float) getMaxScrollPosition()), 32, int_2 - 8);
                 double double_6 = Math.max(1.0D, double_5 / (double) (int_2 - int_3));
                 float to = MathHelper.clamp((float) (scroll + double_4 * double_6), 0, height - innerBounds.height);
                 if (ConfigObject.getInstance().doesSnapToRows()) {
-                    double nearestRow = Math.round(to / 18.0) * 18.0;
+                    double nearestRow = Math.round(to / (double) entrySize()) * (double) entrySize();
                     scrollTo(nearestRow, false);
                 } else
                     scrollTo(to, false);
@@ -164,7 +166,7 @@ public class FavoritesListWidget extends WidgetWithBounds {
         }
         return super.mouseDragged(mouseX, mouseY, int_1, double_3, double_4);
     }
-
+    
     private void renderScrollbar() {
         int maxScroll = getMaxScroll();
         if (maxScroll > 0) {
@@ -173,13 +175,13 @@ public class FavoritesListWidget extends WidgetWithBounds {
             height -= Math.min((scroll < 0 ? (int) -scroll : scroll > maxScroll ? (int) scroll - maxScroll : 0), height * .95);
             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 scrollbarPositionMinX = getScrollbarMinX();
             int scrollbarPositionMaxX = scrollbarPositionMinX + 6;
             boolean hovered = (new Rectangle(scrollbarPositionMinX, minY, scrollbarPositionMaxX - scrollbarPositionMinX, height)).contains(PointHelper.fromMouse());
             float bottomC = (hovered ? .67f : .5f) * (ScreenHelper.isDarkModeEnabled() ? 0.8f : 1f);
             float topC = (hovered ? .87f : .67f) * (ScreenHelper.isDarkModeEnabled() ? 0.8f : 1f);
-
+            
             RenderSystem.disableTexture();
             RenderSystem.enableBlend();
             RenderSystem.disableAlphaTest();
@@ -205,7 +207,7 @@ public class FavoritesListWidget extends WidgetWithBounds {
             RenderSystem.enableTexture();
         }
     }
-
+    
     private void updatePosition(float delta) {
         target = clamp(target);
         if (target < 0) {
@@ -213,7 +215,7 @@ public class FavoritesListWidget extends WidgetWithBounds {
         } else if (target > getMaxScroll()) {
             target = (target - getMaxScroll()) * (1 - (1 - ClothConfigInitializer.getBounceBackMultiplier()) * delta / 3) + getMaxScroll();
         } else if (ConfigObject.getInstance().doesSnapToRows()) {
-            double nearestRow = Math.round(target / 18.0) * 18.0;
+            double nearestRow = Math.round(target / (double) entrySize()) * (double) entrySize();
             if (!DynamicNewSmoothScrollingEntryListWidget.Precision.almostEquals(target, nearestRow, DynamicNewSmoothScrollingEntryListWidget.Precision.FLOAT_EPSILON))
                 target += (nearestRow - target) * Math.min(delta / 2.0, 1.0);
             else
@@ -224,7 +226,7 @@ public class FavoritesListWidget extends WidgetWithBounds {
         else
             scroll = target;
     }
-
+    
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (containsMouse(PointHelper.fromMouse()))
@@ -233,12 +235,12 @@ public class FavoritesListWidget extends WidgetWithBounds {
                     return true;
         return false;
     }
-
+    
     @SuppressWarnings("rawtypes")
     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));
     }
-
+    
     @SuppressWarnings("deprecation")
     public void updateSearch(EntryListWidget listWidget, String searchTerm) {
         if (ConfigObject.getInstance().isFavoritesEnabled() && ConfigObject.getInstance().doDisplayFavoritesOnTheLeft()) {
@@ -282,18 +284,18 @@ public class FavoritesListWidget extends WidgetWithBounds {
         } else
             favorites = Collections.emptyList();
     }
-
+    
     public void updateEntriesPosition() {
         this.innerBounds = updateInnerBounds(bounds);
-        int width = innerBounds.width / 18;
-        int pageHeight = innerBounds.height / 18;
-        int slotsToPrepare = favorites.size() * 3;
+        int width = innerBounds.width / entrySize();
+        int pageHeight = innerBounds.height / entrySize();
+        int slotsToPrepare = Math.max(favorites.size() * 3, width * pageHeight * 3);
         int currentX = 0;
         int currentY = 0;
         List<EntryListEntry> entries = Lists.newLinkedList();
         for (int i = 0; i < slotsToPrepare; i++) {
-            int xPos = currentX * 18 + innerBounds.x;
-            int yPos = currentY * 18 + innerBounds.y;
+            int xPos = currentX * entrySize() + innerBounds.x;
+            int yPos = currentY * entrySize() + innerBounds.y;
             entries.add((EntryListEntry) new EntryListEntry(xPos, yPos).noBackground());
             currentX++;
             if (currentX >= width) {
@@ -303,12 +305,12 @@ public class FavoritesListWidget extends WidgetWithBounds {
         }
         this.entries = entries;
     }
-
+    
     @Override
     public List<? extends Widget> children() {
         return entries;
     }
-
+    
     @Override
     public boolean mouseClicked(double double_1, double double_2, int int_1) {
         double height = getMaxScroll();
@@ -321,12 +323,12 @@ public class FavoritesListWidget extends WidgetWithBounds {
             }
         }
         this.draggingScrollBar = false;
-
+        
         if (containsMouse(double_1, double_2)) {
             ClientPlayerEntity player = minecraft.player;
             if (ClientHelper.getInstance().isCheating() && !player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets()) {
                 ClientHelper.getInstance().sendDeletePacket();
-                return true;
+                return false;
             }
             if (!player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets())
                 return false;
@@ -336,26 +338,27 @@ public class FavoritesListWidget extends WidgetWithBounds {
         }
         return false;
     }
-
+    
     private class EntryListEntry extends EntryWidget {
         private int backupY;
-
+        
         private EntryListEntry(int x, int y) {
             super(x, y);
             this.backupY = y;
+            getBounds().width = getBounds().height = entrySize();
         }
-
+        
         @Override
         public boolean containsMouse(double mouseX, double mouseY) {
             return super.containsMouse(mouseX, mouseY) && bounds.contains(mouseX, mouseY);
         }
-
+        
         @Override
         protected void drawHighlighted(int mouseX, int mouseY, float delta) {
             if (getCurrentEntry().getType() != EntryStack.Type.EMPTY)
                 super.drawHighlighted(mouseX, mouseY, delta);
         }
-
+        
         private String getLocalizedName(InputUtil.KeyCode value) {
             String string_1 = value.getName();
             int int_1 = value.getKeyCode();
@@ -368,40 +371,32 @@ public class FavoritesListWidget extends WidgetWithBounds {
                     string_2 = InputUtil.getScancodeName(int_1);
                     break;
                 case MOUSE:
-                    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 string_3 = I18n.translate(string_1);
+                    string_2 = Objects.equals(string_3, string_1) ? I18n.translate(InputUtil.Type.MOUSE.getName(), 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) : string_2;
         }
-
+        
         @Override
         protected void queueTooltip(int mouseX, int mouseY, float delta) {
             if (!ClientHelper.getInstance().isCheating() || minecraft.player.inventory.getCursorStack().isEmpty()) {
                 QueuedTooltip tooltip = getCurrentTooltip(mouseX, mouseY);
                 if (tooltip != null) {
-                    if (ConfigObject.getInstance().doDisplayFavoritesTooltip()) {
-                        String name = getLocalizedName(ConfigObject.getInstance().getFavoriteKeybind());
+                    if (ConfigObject.getInstance().doDisplayFavoritesTooltip() && !ConfigObject.getInstance().getFavoriteKeyCode().isUnknown()) {
+                        String name = ConfigObject.getInstance().getFavoriteKeyCode().getLocalizedName();
                         tooltip.getText().addAll(Arrays.asList(I18n.translate("text.rei.remove_favorites_tooltip", name).split("\n")));
                     }
                     ScreenHelper.getLastOverlay().addTooltip(tooltip);
                 }
             }
         }
-
+        
         @Override
         public boolean keyPressed(int int_1, int int_2, int int_3) {
             if (interactable && ConfigObject.getInstance().isFavoritesEnabled() && containsMouse(PointHelper.fromMouse()) && !getCurrentEntry().isEmpty()) {
-                InputUtil.KeyCode keyCode = ConfigObject.getInstance().getFavoriteKeybind();
-                if (int_1 == InputUtil.UNKNOWN_KEYCODE.getKeyCode()) {
-                    if (keyCode.getCategory() == InputUtil.Type.SCANCODE && keyCode.getKeyCode() == int_2) {
-                        ConfigManager.getInstance().getFavorites().remove(getCurrentEntry());
-                        ContainerScreenOverlay.getEntryListWidget().updateSearch(ScreenHelper.getSearchField().getText());
-                        ConfigManager.getInstance().saveConfig();
-                        minecraft.getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
-                        return true;
-                    }
-                } else if (keyCode.getCategory() == InputUtil.Type.KEYSYM && keyCode.getKeyCode() == int_1) {
+                ModifierKeyCode keyCode = ConfigObject.getInstance().getFavoriteKeyCode();
+                if (keyCode.matchesKey(int_1, int_2)) {
                     ConfigManager.getInstance().getFavorites().remove(getCurrentEntry());
                     ContainerScreenOverlay.getEntryListWidget().updateSearch(ScreenHelper.getSearchField().getText());
                     ConfigManager.getInstance().saveConfig();
@@ -411,23 +406,25 @@ public class FavoritesListWidget extends WidgetWithBounds {
             }
             return super.keyPressed(int_1, int_2, int_3);
         }
-
+        
         @Override
         public boolean mouseClicked(double mouseX, double mouseY, int button) {
             if (!interactable)
                 return super.mouseClicked(mouseX, mouseY, button);
             if (containsMouse(mouseX, mouseY) && ClientHelper.getInstance().isCheating()) {
                 EntryStack entry = getCurrentEntry().copy();
-                if (entry.getType() == EntryStack.Type.ITEM) {
-                    if (ConfigObject.getInstance().getItemCheatingMode() == ItemCheatingMode.REI_LIKE)
-                        entry.setAmount(button != 1 ? 1 : entry.getItemStack().getMaxCount());
-                    else if (ConfigObject.getInstance().getItemCheatingMode() == ItemCheatingMode.JEI_LIKE)
-                        entry.setAmount(button != 0 ? 1 : entry.getItemStack().getMaxCount());
-                    else
-                        entry.setAmount(1);
+                if (!entry.isEmpty()) {
+                    if (entry.getType() == EntryStack.Type.ITEM) {
+                        if (ConfigObject.getInstance().getItemCheatingMode() == ItemCheatingMode.REI_LIKE)
+                            entry.setAmount(button != 1 ? 1 : entry.getItemStack().getMaxCount());
+                        else if (ConfigObject.getInstance().getItemCheatingMode() == ItemCheatingMode.JEI_LIKE)
+                            entry.setAmount(button != 0 ? 1 : entry.getItemStack().getMaxCount());
+                        else
+                            entry.setAmount(1);
+                    }
+                    ClientHelper.getInstance().tryCheatingEntry(entry);
+                    return true;
                 }
-                ClientHelper.getInstance().tryCheatingEntry(entry);
-                return true;
             }
             return super.mouseClicked(mouseX, mouseY, button);
         }

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

@@ -14,86 +14,86 @@ import java.util.Collections;
 import java.util.List;
 
 public class LabelWidget extends WidgetWithBounds {
-
+    
     private Point pos;
     private String text;
     private int defaultColor;
     private boolean hasShadows = true;
     private boolean centered = true;
-
+    
     @Deprecated
     public LabelWidget(int x, int y, String text) {
         this(new Point(x, y), text);
     }
-
+    
     public LabelWidget(Point point, String text) {
         this.pos = point;
         this.text = text;
         this.defaultColor = ScreenHelper.isDarkModeEnabled() ? 0xFFBBBBBB : -1;
     }
-
+    
     public boolean isCentered() {
         return centered;
     }
-
+    
     public void setCentered(boolean centered) {
         this.centered = centered;
     }
-
+    
     public LabelWidget centered() {
         setCentered(true);
         return this;
     }
-
+    
     public LabelWidget leftAligned() {
         setCentered(false);
         return this;
     }
-
+    
     public boolean isHasShadows() {
         return hasShadows;
     }
-
+    
     public void setHasShadows(boolean hasShadows) {
         this.hasShadows = hasShadows;
     }
-
+    
     public LabelWidget noShadow() {
         setHasShadows(false);
         return this;
     }
-
+    
     public int getDefaultColor() {
         return defaultColor;
     }
-
+    
     public void setDefaultColor(int defaultColor) {
         this.defaultColor = defaultColor;
     }
-
+    
     public Point getPosition() {
         return pos;
     }
-
+    
     public LabelWidget setPosition(Point position) {
         this.pos = position;
         return this;
     }
-
+    
     public String getText() {
         return text;
     }
-
+    
     public LabelWidget setText(String text) {
         this.text = text;
         return this;
     }
-
+    
     public LabelWidget color(int defaultColor) {
         this.defaultColor = defaultColor;
         return this;
     }
-
+    
     @Override
     public Rectangle getBounds() {
         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 - 1, pos.y - 5, width + 2, 14);
     }
-
+    
     @Override
     public List<? extends Element> children() {
         return Collections.emptyList();
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
         int width = font.getStringWidth(text);
@@ -124,5 +124,5 @@ public class LabelWidget extends WidgetWithBounds {
                 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;
 
 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_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
-
+    
     private Rectangle bounds;
     private int color = -1;
-
+    
     public PanelWidget(Rectangle bounds) {
         this.bounds = bounds;
     }
-
+    
     @Override
     public Rectangle getBounds() {
         return bounds;
     }
-
+    
     @Override
     public List<Widget> children() {
         return Collections.emptyList();
     }
-
+    
     public void render() {
         render(0, 0, 0);
     }
-
+    
     public int getColor() {
         return color;
     }
-
+    
     public void setColor(int color) {
         this.color = color;
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
         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 xTextureOffset = getXTextureOffset();
         int yTextureOffset = getYTextureOffset();
-
+        
         //Four Corners
         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, y + height - 4, 106 + xTextureOffset, 186 + yTextureOffset, 4, 4);
         this.blit(x + width - 4, y + height - 4, 252 + xTextureOffset, 186 + yTextureOffset, 4, 4);
-
+        
         //Sides
         for (int xx = 4; xx < width - 4; xx += 128) {
             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());
     }
-
+    
     protected boolean isRendering() {
         return ConfigObject.getInstance().getRecipeScreenType() != RecipeScreenType.VILLAGER;
     }
-
+    
     protected int getInnerColor() {
         return ScreenHelper.isDarkModeEnabled() ? -13750738 : -3750202;
     }
-
+    
     protected int getXTextureOffset() {
         return 0;
     }
-
+    
     protected int getYTextureOffset() {
         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;
 
 public class QueuedTooltip {
-
+    
     private Point location;
     private List<String> text;
     private Consumer<QueuedTooltip> consumer = null;
-
+    
     private QueuedTooltip(Point location, List<String> text) {
         this.location = location;
         this.text = Lists.newArrayList(text);
     }
-
+    
     public static QueuedTooltip create(Point location, List<String> text) {
         return new QueuedTooltip(location, text);
     }
-
+    
     public static QueuedTooltip create(Point location, String... text) {
         return QueuedTooltip.create(location, Lists.newArrayList(text));
     }
-
+    
     public static QueuedTooltip create(List<String> text) {
         return QueuedTooltip.create(PointHelper.fromMouse(), text);
     }
-
+    
     public static QueuedTooltip create(String... text) {
         return QueuedTooltip.create(PointHelper.fromMouse(), text);
     }
-
+    
     @Deprecated
     public QueuedTooltip setSpecialRenderer(Consumer<QueuedTooltip> consumer) {
         this.consumer = consumer;
         return this;
     }
-
+    
     @Deprecated
     public Consumer<QueuedTooltip> getConsumer() {
         return consumer;
     }
-
+    
     public Point getLocation() {
         return location;
     }
-
+    
     public int getX() {
         return getLocation().x;
     }
-
+    
     public int getY() {
         return getLocation().y;
     }
-
+    
     public List<String> getText() {
         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;
 
 public class RecipeArrowWidget extends WidgetWithBounds {
-
+    
     private int x, y;
     private boolean animated;
-
+    
     public RecipeArrowWidget(int x, int y, boolean animated) {
         this.x = x;
         this.y = y;
         this.animated = animated;
     }
-
+    
     @Override
     public Rectangle getBounds() {
         return new Rectangle(x, y, 24, 17);
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
         MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
@@ -39,7 +39,7 @@ public class RecipeArrowWidget extends WidgetWithBounds {
             blit(x, y, 82, 91, width, 17);
         }
     }
-
+    
     @Override
     public List<? extends Element> children() {
         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;
 
 public class RecipeBaseWidget extends PanelWidget {
-
+    
     public RecipeBaseWidget(Rectangle bounds) {
         super(bounds);
     }
-
+    
     @Override
     protected int getYTextureOffset() {
         return ConfigObject.getInstance().isUsingLightGrayRecipeBorder() ? 0 : 66;
     }
-
+    
 }

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

@@ -21,7 +21,7 @@ import java.util.List;
 import java.util.Optional;
 
 public class RecipeChoosePageWidget extends DraggableWidget {
-
+    
     private int currentPage;
     private int maxPage;
     private Rectangle bounds, grabBounds, dragBounds;
@@ -30,7 +30,7 @@ public class RecipeChoosePageWidget extends DraggableWidget {
     private TextFieldWidget textFieldWidget;
     private CategoryBaseWidget base1, base2;
     private ButtonWidget btnDone;
-
+    
     public RecipeChoosePageWidget(RecipeViewingScreen recipeViewingScreen, int currentPage, int maxPage) {
         super(getPointFromConfig());
         this.recipeViewingScreen = recipeViewingScreen;
@@ -38,32 +38,32 @@ public class RecipeChoosePageWidget extends DraggableWidget {
         this.maxPage = maxPage;
         initWidgets(getMidPoint());
     }
-
+    
     private static Point getPointFromConfig() {
         Window window = MinecraftClient.getInstance().getWindow();
         return new Point(window.getScaledWidth() * .5, window.getScaledHeight() * .5);
     }
-
+    
     @Override
     public Rectangle getBounds() {
         return bounds;
     }
-
+    
     @Override
     public Rectangle getGrabBounds() {
         return grabBounds;
     }
-
+    
     @Override
     public Rectangle getDragBounds() {
         return dragBounds;
     }
-
+    
     @Override
     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);
     }
-
+    
     @Override
     public void updateWidgets(Point midPoint) {
         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);
         btnDone.getBounds().setLocation(bounds.x + bounds.width - 45, bounds.y + bounds.height + 3);
     }
-
+    
     @Override
     protected void initWidgets(Point midPoint) {
         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() {
                 return Collections.emptyList();
             }
-
+            
             @Override
             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);
@@ -105,13 +105,13 @@ public class RecipeChoosePageWidget extends DraggableWidget {
             StringBuilder stringBuilder_1 = new StringBuilder();
             char[] var2 = s.toCharArray();
             int var3 = var2.length;
-
+            
             for (int var4 = 0; var4 < var3; ++var4) {
                 char char_1 = var2[var4];
                 if (Character.isDigit(char_1))
                     stringBuilder_1.append(char_1);
             }
-
+            
             return stringBuilder_1.toString();
         };
         textFieldWidget.setText(String.valueOf(currentPage + 1));
@@ -125,17 +125,17 @@ public class RecipeChoosePageWidget extends DraggableWidget {
         });
         textFieldWidget.setFocused(true);
     }
-
+    
     @Override
     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));
     }
-
+    
     @Override
     public List<Widget> children() {
         return widgets;
     }
-
+    
     @Override
     public void render(int i, int i1, float v) {
         RenderSystem.translatef(0, 0, 800);
@@ -144,7 +144,7 @@ public class RecipeChoosePageWidget extends DraggableWidget {
         }
         RenderSystem.translatef(0, 0, -800);
     }
-
+    
     @Override
     public boolean charTyped(char char_1, int int_1) {
         for (Widget widget : widgets)
@@ -152,7 +152,7 @@ public class RecipeChoosePageWidget extends DraggableWidget {
                 return true;
         return false;
     }
-
+    
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (int_1 == 335 || int_1 == 257) {
@@ -166,7 +166,7 @@ public class RecipeChoosePageWidget extends DraggableWidget {
                 return true;
         return false;
     }
-
+    
     public Optional<Integer> getIntFromString(String s) {
         try {
             return Optional.of(Integer.valueOf(s));
@@ -174,9 +174,9 @@ public class RecipeChoosePageWidget extends DraggableWidget {
         }
         return Optional.empty();
     }
-
+    
     @Override
     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;
 
 public class SlotBaseWidget extends RecipeBaseWidget {
-
+    
     public SlotBaseWidget(Rectangle bounds) {
         super(bounds);
     }
-
+    
     @Override
     public int getInnerColor() {
         return ScreenHelper.isDarkModeEnabled() ? -13619152 : -7631989;
     }
-
+    
     @Override
     protected int getYTextureOffset() {
         return -66;
     }
-
+    
     @Override
     protected boolean isRendering() {
         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;
 
 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_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
-
+    
     public boolean shown = false, selected = false;
     public EntryStack logo;
     public int id;
     public String categoryName;
     public Rectangle bounds;
     public RecipeCategory category;
-
+    
     public TabWidget(int id, Rectangle bounds) {
         this.id = id;
         this.bounds = bounds;
     }
-
+    
     public void setRenderer(RecipeCategory category, EntryStack logo, String categoryName, boolean selected) {
         if (logo == null) {
             shown = false;
@@ -45,24 +45,24 @@ public class TabWidget extends WidgetWithBounds {
         this.selected = selected;
         this.categoryName = categoryName;
     }
-
+    
     public boolean isSelected() {
         return selected;
     }
-
+    
     public int getId() {
         return id;
     }
-
+    
     public boolean isShown() {
         return shown;
     }
-
+    
     @Override
     public List<Widget> children() {
         return Collections.emptyList();
     }
-
+    
     @Override
     public void render(int mouseX, int mouseY, float delta) {
         if (shown) {
@@ -75,7 +75,7 @@ public class TabWidget extends WidgetWithBounds {
             }
         }
     }
-
+    
     @SuppressWarnings("deprecation")
     private void drawTooltip() {
         if (this.minecraft.options.advancedItemTooltips)
@@ -83,10 +83,10 @@ public class TabWidget extends WidgetWithBounds {
         else
             ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(categoryName, ClientHelper.getInstance().getFormattedModFromIdentifier(category.getIdentifier())));
     }
-
+    
     @Override
     public Rectangle getBounds() {
         return bounds;
     }
-
+    
 }

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

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

+ 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
  */
 public abstract class Widget extends AbstractParentElement implements Drawable {
-
+    
     /**
      * The Minecraft Client instance
      */
@@ -25,13 +25,13 @@ public abstract class Widget extends AbstractParentElement implements Drawable {
      * The font for rendering text
      */
     protected final TextRenderer font = minecraft.textRenderer;
-
+    
     public int getZ() {
         return this.getBlitOffset();
     }
-
+    
     public void setZ(int z) {
         this.setBlitOffset(z);
     }
-
+    
 }

+ 7 - 7
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;
 
 public abstract class WidgetWithBounds extends Widget {
-
+    
     abstract public Rectangle getBounds();
-
+    
     public final boolean containsMouse(int mouseX, int mouseY) {
         return containsMouse((double) mouseX, (double) mouseY);
     }
-
+    
     public final boolean containsMouse(Point point) {
         return containsMouse(point.x, point.y);
     }
-
+    
     public boolean containsMouse(double mouseX, double mouseY) {
         return getBounds().contains(mouseX, mouseY);
     }
-
+    
     @Override
-    public boolean isMouseOver(double double_1, double double_2) {
+    public final boolean isMouseOver(double double_1, double 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
 public abstract class AbstractEntryStack extends DrawableHelper implements EntryStack {
     private Map<Settings, Object> settings = new HashMap<>();
-
+    
     @Override
     public <T> EntryStack setting(Settings<T> settings, T value) {
         this.settings.put(settings, value);
         return this;
     }
-
+    
     @Override
     public <T> EntryStack removeSetting(Settings<T> settings) {
         this.settings.remove(settings);
         return this;
     }
-
+    
     @Override
     public EntryStack clearSettings() {
         this.settings.clear();
         return this;
     }
-
+    
     protected Map<Settings, Object> getSettings() {
         return settings;
     }
-
+    
     @Override
     public <T> ObjectHolder<T> getSetting(Settings<T> 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((T) o);
     }
-
+    
     @Override
     public boolean equals(EntryStack stack, boolean ignoreTags, boolean ignoreAmount) {
         if (ignoreTags && ignoreAmount)
@@ -56,7 +56,7 @@ public abstract class AbstractEntryStack extends DrawableHelper implements Entry
             return equalsIgnoreTags(stack);
         return equalsAll(stack);
     }
-
+    
     @Override
     public boolean equals(Object obj) {
         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();
         return equals(stack, !checkTags, true);
     }
-
+    
     @Override
     public int getZ() {
         return getBlitOffset();
     }
-
+    
     @Override
     public void setZ(int z) {
         setBlitOffset(z);

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

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

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

@@ -8,6 +8,8 @@ package me.shedaniel.rei.impl;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Maps;
 import io.netty.buffer.Unpooled;
+import me.shedaniel.clothconfig2.api.FakeModifierKeyCodeAdder;
+import me.shedaniel.clothconfig2.api.ModifierKeyCode;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.RoughlyEnoughItemsNetwork;
 import me.shedaniel.rei.api.*;
@@ -17,7 +19,6 @@ import me.shedaniel.rei.gui.RecipeViewingScreen;
 import me.shedaniel.rei.gui.VillagerRecipeViewingScreen;
 import me.shedaniel.rei.gui.config.RecipeScreenType;
 import net.fabricmc.api.ClientModInitializer;
-import net.fabricmc.fabric.api.client.keybinding.FabricKeyBinding;
 import net.fabricmc.fabric.api.network.ClientSidePacketRegistry;
 import net.fabricmc.fabric.impl.client.keybinding.KeyBindingRegistryImpl;
 import net.fabricmc.loader.api.FabricLoader;
@@ -26,7 +27,6 @@ import net.fabricmc.loader.api.metadata.ModMetadata;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.screen.Screen;
 import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
-import net.minecraft.client.util.InputUtil;
 import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
 import net.minecraft.item.Items;
@@ -37,6 +37,7 @@ import net.minecraft.util.Identifier;
 import net.minecraft.util.PacketByteBuf;
 import net.minecraft.util.registry.Registry;
 
+import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -45,19 +46,10 @@ import java.util.Optional;
 @Deprecated
 @Internal
 public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
-
+    
     public static ClientHelperImpl instance;
-    private final Identifier recipeKeybind = new Identifier("roughlyenoughitems", "recipe_keybind");
-    private final Identifier usageKeybind = new Identifier("roughlyenoughitems", "usage_keybind");
-    private final Identifier hideKeybind = new Identifier("roughlyenoughitems", "hide_keybind");
-    private final Identifier previousPageKeybind = new Identifier("roughlyenoughitems", "previous_page");
-    private final Identifier nextPageKeybind = new Identifier("roughlyenoughitems", "next_page");
-    private final Identifier focusSearchFieldKeybind = new Identifier("roughlyenoughitems", "focus_search");
-    private final Identifier copyRecipeIdentifierKeybind = new Identifier("roughlyenoughitems", "copy_recipe_id");
-    private final Identifier favoriteEntryKeybind = new Identifier("roughlyenoughitems", "favorite_entry");
     private final Map<String, String> modNameCache = Maps.newHashMap();
-    public FabricKeyBinding recipe, usage, hide, previousPage, nextPage, focusSearchField, copyRecipeIdentifier;
-
+    
     @Override
     public String getFormattedModFromItem(Item item) {
         String mod = getModFromItem(item);
@@ -65,7 +57,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             return "";
         return Formatting.BLUE.toString() + Formatting.ITALIC.toString() + mod;
     }
-
+    
     @Override
     public String getFormattedModFromIdentifier(Identifier identifier) {
         String mod = getModFromIdentifier(identifier);
@@ -73,54 +65,14 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             return "";
         return Formatting.BLUE.toString() + Formatting.ITALIC.toString() + mod;
     }
-
-    @Override
-    public FabricKeyBinding[] getREIKeyBindings() {
-        return new FabricKeyBinding[]{recipe, usage, hide, previousPage, nextPage, focusSearchField, copyRecipeIdentifier};
-    }
-
-    @Override
-    public FabricKeyBinding getRecipeKeyBinding() {
-        return recipe;
-    }
-
-    @Override
-    public FabricKeyBinding getUsageKeyBinding() {
-        return usage;
-    }
-
-    @Override
-    public FabricKeyBinding getHideKeyBinding() {
-        return hide;
-    }
-
-    @Override
-    public FabricKeyBinding getPreviousPageKeyBinding() {
-        return previousPage;
-    }
-
-    @Override
-    public FabricKeyBinding getNextPageKeyBinding() {
-        return nextPage;
-    }
-
-    @Override
-    public FabricKeyBinding getFocusSearchFieldKeyBinding() {
-        return focusSearchField;
-    }
-
-    @Override
-    public FabricKeyBinding getCopyRecipeIdentifierKeyBinding() {
-        return copyRecipeIdentifier;
-    }
-
+    
     @Override
     public String getModFromItem(Item item) {
         if (item.equals(Items.AIR))
             return "";
         return getModFromIdentifier(Registry.ITEM.getId(item));
     }
-
+    
     @Override
     public String getModFromIdentifier(Identifier identifier) {
         if (identifier == null)
@@ -133,18 +85,18 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
         modNameCache.put(modid, s);
         return s;
     }
-
+    
     @Override
     public boolean isCheating() {
         return ConfigObject.getInstance().isCheating();
     }
-
+    
     @Override
     public void setCheating(boolean cheating) {
         ConfigObject.getInstance().setCheating(cheating);
         ConfigManager.getInstance().saveConfig();
     }
-
+    
     @Override
     public void sendDeletePacket() {
         if (ScreenHelper.getLastContainerScreen() instanceof CreativeInventoryScreen) {
@@ -153,7 +105,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
         }
         ClientSidePacketRegistry.INSTANCE.sendToServer(RoughlyEnoughItemsNetwork.DELETE_ITEMS_PACKET, new PacketByteBuf(Unpooled.buffer()));
     }
-
+    
     @Override
     public boolean tryCheatingEntry(EntryStack entry) {
         if (entry.getType() != EntryStack.Type.ITEM)
@@ -181,7 +133,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             return true;
         }
     }
-
+    
     @Override
     public boolean executeRecipeKeyBind(EntryStack stack) {
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = RecipeHelper.getInstance().getRecipesFor(stack);
@@ -189,7 +141,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             openRecipeViewingScreen(map);
         return map.keySet().size() > 0;
     }
-
+    
     @Override
     public boolean executeUsageKeyBind(EntryStack stack) {
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = RecipeHelper.getInstance().getUsagesFor(stack);
@@ -197,7 +149,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             openRecipeViewingScreen(map);
         return map.keySet().size() > 0;
     }
-
+    
     @Override
     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);
@@ -208,7 +160,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
         }));
         return inventoryStacks;
     }
-
+    
     @Override
     public boolean executeViewAllRecipesKeyBind() {
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = RecipeHelper.getInstance().getAllRecipes();
@@ -216,7 +168,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             openRecipeViewingScreen(map);
         return map.keySet().size() > 0;
     }
-
+    
     @Override
     public boolean executeViewAllRecipesFromCategory(Identifier category) {
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = Maps.newLinkedHashMap();
@@ -229,7 +181,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             openRecipeViewingScreen(map);
         return map.keySet().size() > 0;
     }
-
+    
     @Override
     public boolean executeViewAllRecipesFromCategories(List<Identifier> categories) {
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = Maps.newLinkedHashMap();
@@ -244,7 +196,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
             openRecipeViewingScreen(map);
         return map.keySet().size() > 0;
     }
-
+    
     @Override
     public void openRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map) {
         Screen screen = null;
@@ -257,26 +209,51 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
         ScreenHelper.storeRecipeScreen(MinecraftClient.getInstance().currentScreen);
         MinecraftClient.getInstance().openScreen(screen);
     }
-
+    
     @Override
     public void onInitializeClient() {
-        ClientHelperImpl.instance = (ClientHelperImpl) this;
+        ClientHelperImpl.instance = this;
         registerFabricKeyBinds();
         modNameCache.put("minecraft", "Minecraft");
         modNameCache.put("c", "Common");
     }
-
+    
     @Override
     public void registerFabricKeyBinds() {
         String category = "key.rei.category";
-        KeyBindingRegistryImpl.INSTANCE.addCategory(category);
-        KeyBindingRegistryImpl.INSTANCE.register(recipe = FabricKeyBinding.Builder.create(recipeKeybind, InputUtil.Type.KEYSYM, 82, category).build());
-        KeyBindingRegistryImpl.INSTANCE.register(usage = FabricKeyBinding.Builder.create(usageKeybind, InputUtil.Type.KEYSYM, 85, category).build());
-        KeyBindingRegistryImpl.INSTANCE.register(hide = FabricKeyBinding.Builder.create(hideKeybind, InputUtil.Type.KEYSYM, 79, category).build());
-        KeyBindingRegistryImpl.INSTANCE.register(previousPage = FabricKeyBinding.Builder.create(previousPageKeybind, InputUtil.Type.KEYSYM, -1, category).build());
-        KeyBindingRegistryImpl.INSTANCE.register(nextPage = FabricKeyBinding.Builder.create(nextPageKeybind, 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());
+        if (!FabricLoader.getInstance().isModLoaded("amecs")) {
+            try {
+                ConfigObjectImpl.General general = ConfigObject.getInstance().getGeneral();
+                ConfigObjectImpl.General instance = general.getClass().newInstance();
+                for (Field declaredField : general.getClass().getDeclaredFields()) {
+                    if (declaredField.getType() == ModifierKeyCode.class) {
+                        declaredField.setAccessible(true);
+                        FakeModifierKeyCodeAdder.INSTANCE.registerModifierKeyCode(category, "config.roughlyenoughitems." + declaredField.getName(), () -> {
+                            try {
+                                return (ModifierKeyCode) declaredField.get(general);
+                            } catch (Exception e) {
+                                throw new RuntimeException(e);
+                            }
+                        }, () -> {
+                            try {
+                                return (ModifierKeyCode) declaredField.get(instance);
+                            } catch (IllegalAccessException e) {
+                                throw new RuntimeException(e);
+                            }
+                        }, keyCode -> {
+                            try {
+                                declaredField.set(general, keyCode);
+                            } catch (IllegalAccessException e) {
+                                throw new RuntimeException(e);
+                            }
+                        });
+                    }
+                }
+                KeyBindingRegistryImpl.INSTANCE.addCategory(category);
+            } catch (Throwable throwable) {
+                throwable.printStackTrace();
+            }
+        }
     }
-
+    
 }

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

@@ -13,25 +13,31 @@ import me.sargunvohra.mcmods.autoconfig1u.gui.ConfigScreenProvider;
 import me.sargunvohra.mcmods.autoconfig1u.gui.registry.GuiRegistry;
 import me.sargunvohra.mcmods.autoconfig1u.serializer.JanksonConfigSerializer;
 import me.sargunvohra.mcmods.autoconfig1u.shadowed.blue.endless.jankson.Jankson;
+import me.sargunvohra.mcmods.autoconfig1u.shadowed.blue.endless.jankson.JsonObject;
 import me.sargunvohra.mcmods.autoconfig1u.shadowed.blue.endless.jankson.JsonPrimitive;
+import me.sargunvohra.mcmods.autoconfig1u.util.Utils;
 import me.shedaniel.cloth.hooks.ScreenHooks;
-import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
+import me.shedaniel.clothconfig2.api.Modifier;
+import me.shedaniel.clothconfig2.api.ModifierKeyCode;
 import me.shedaniel.clothconfig2.gui.entries.KeyCodeEntry;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
-import me.shedaniel.rei.api.*;
+import me.shedaniel.rei.api.ConfigManager;
+import me.shedaniel.rei.api.ConfigObject;
+import me.shedaniel.rei.api.EntryStack;
+import me.shedaniel.rei.api.RecipeHelper;
 import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.ConfigReloadingScreen;
 import me.shedaniel.rei.gui.ContainerScreenOverlay;
 import me.shedaniel.rei.gui.credits.CreditsScreen;
 import me.shedaniel.rei.gui.widget.ReloadConfigButtonWidget;
-import net.fabricmc.fabric.api.client.keybinding.FabricKeyBinding;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.screen.Screen;
 import net.minecraft.client.gui.widget.AbstractPressableButtonWidget;
 import net.minecraft.client.resource.language.I18n;
 import net.minecraft.client.util.InputUtil;
 import net.minecraft.text.LiteralText;
+import net.minecraft.util.math.MathHelper;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -43,45 +49,72 @@ import static me.sargunvohra.mcmods.autoconfig1u.util.Utils.setUnsafely;
 @Deprecated
 @Internal
 public class ConfigManagerImpl implements ConfigManager {
-
+    
     private boolean craftableOnly;
     private List<EntryStack> favorites = new ArrayList<>();
-
+    
     public ConfigManagerImpl() {
         this.craftableOnly = false;
-        AutoConfig.register(ConfigObjectImpl.class, (definition, configClass) -> {
-            return new JanksonConfigSerializer<ConfigObjectImpl>(definition, configClass, Jankson.builder().registerPrimitiveTypeAdapter(InputUtil.KeyCode.class, it -> {
-                return it instanceof String ? InputUtil.fromName((String) it) : null;
-            }).registerSerializer(InputUtil.KeyCode.class, (it, marshaller) -> new JsonPrimitive(it.getName())).build());
-        });
+        AutoConfig.register(ConfigObjectImpl.class, (definition, configClass) -> new JanksonConfigSerializer<>(definition, configClass, Jankson.builder().registerPrimitiveTypeAdapter(InputUtil.KeyCode.class, it -> {
+            return it instanceof String ? InputUtil.fromName((String) it) : null;
+        }).registerSerializer(InputUtil.KeyCode.class, (it, marshaller) -> new JsonPrimitive(it.getName())).registerTypeAdapter(ModifierKeyCode.class, o -> {
+            InputUtil.KeyCode keyCode = InputUtil.fromName(((JsonPrimitive) o.get("keyCode")).asString());
+            Modifier modifier = Modifier.of(((Number) ((JsonPrimitive) o.get("modifier")).getValue()).shortValue());
+            return ModifierKeyCode.of(keyCode, modifier);
+        }).registerSerializer(ModifierKeyCode.class, (keyCode, marshaller) -> {
+            JsonObject object = new JsonObject();
+            object.put("keyCode", new JsonPrimitive(keyCode.getKeyCode().getName()));
+            object.put("modifier", new JsonPrimitive(keyCode.getModifier().getValue()));
+            return object;
+        }).build()));
         GuiRegistry guiRegistry = AutoConfig.getGuiRegistry(ConfigObjectImpl.class);
         //noinspection rawtypes
         guiRegistry.registerAnnotationProvider((i13n, field, config, defaults, guiProvider) -> Collections.singletonList(ConfigEntryBuilder.create().startEnumSelector(i13n, (Class) field.getType(), getUnsafely(field, config, null)).setDefaultValue(() -> getUnsafely(field, defaults)).setSaveConsumer(newValue -> setUnsafely(field, config, newValue)).build()), field -> field.getType().isEnum(), ConfigObject.UseEnumSelectorInstead.class);
         loadFavoredEntries();
-        guiRegistry.registerAnnotationProvider((i13n, field, config, defaults, guiProvider) -> {
-            @SuppressWarnings("rawtypes") List<AbstractConfigListEntry> entries = new ArrayList<>();
-            for (FabricKeyBinding binding : ClientHelper.getInstance().getREIKeyBindings()) {
-                entries.add(ConfigEntryBuilder.create().fillKeybindingField(I18n.translate(binding.getId()) + ":", binding).build());
-            }
-            KeyCodeEntry entry = ConfigEntryBuilder.create().startKeyCodeField(i13n, getUnsafely(field, config, InputUtil.UNKNOWN_KEYCODE)).setDefaultValue(() -> getUnsafely(field, defaults)).setSaveConsumer(newValue -> setUnsafely(field, config, newValue)).build();
-            entry.setAllowMouse(false);
-            entries.add(entry);
-            return entries;
-        }, field -> field.getType() == InputUtil.KeyCode.class, ConfigObject.AddInFrontKeyCode.class);
+        //        guiRegistry.registerAnnotationProvider((i13n, field, config, defaults, guiProvider) -> {
+        //            @SuppressWarnings("rawtypes") List<AbstractConfigListEntry> entries = new ArrayList<>();
+        //            for (FabricKeyBinding binding : ClientHelper.getInstance().getREIKeyBindings()) {
+        //                entries.add(ConfigEntryBuilder.create().fillKeybindingField(I18n.translate(binding.getId()) + ":", binding).build());
+        //            }
+        //            KeyCodeEntry entry = ConfigEntryBuilder.create().startKeyCodeField(i13n, getUnsafely(field, config, InputUtil.UNKNOWN_KEYCODE)).setDefaultValue(() -> getUnsafely(field, defaults)).setSaveConsumer(newValue -> setUnsafely(field, config, newValue)).build();
+        //            entry.setAllowMouse(false);
+        //            entries.add(entry);
+        //            return entries;
+        //        }, field -> field.getType() == InputUtil.KeyCode.class, ConfigObject.AddInFrontKeyCode.class);
+        //        guiRegistry.registerPredicateProvider((i13n, field, config, defaults, guiProvider) -> {
+        //            KeyCodeEntry entry = ConfigEntryBuilder.create().startKeyCodeField(i13n, getUnsafely(field, config, InputUtil.UNKNOWN_KEYCODE)).setDefaultValue(() -> getUnsafely(field, defaults)).setSaveConsumer(newValue -> setUnsafely(field, config, newValue)).build();
+        //            entry.setAllowMouse(false);
+        //            return Collections.singletonList(entry);
+        //        }, field -> field.getType() == InputUtil.KeyCode.class);
         guiRegistry.registerPredicateProvider((i13n, field, config, defaults, guiProvider) -> {
-            KeyCodeEntry entry = ConfigEntryBuilder.create().startKeyCodeField(i13n, getUnsafely(field, config, InputUtil.UNKNOWN_KEYCODE)).setDefaultValue(() -> getUnsafely(field, defaults)).setSaveConsumer(newValue -> setUnsafely(field, config, newValue)).build();
+            KeyCodeEntry entry = ConfigEntryBuilder.create().startModifierKeyCodeField(i13n, getUnsafely(field, config, ModifierKeyCode.unknown())).setModifierDefaultValue(() -> getUnsafely(field, defaults)).setModifierSaveConsumer(newValue -> setUnsafely(field, config, newValue)).build();
             entry.setAllowMouse(false);
             return Collections.singletonList(entry);
-        }, field -> field.getType() == InputUtil.KeyCode.class);
+        }, field -> field.getType() == ModifierKeyCode.class);
+        guiRegistry.registerAnnotationProvider((i13n, field, config, defaults, guiProvider) -> {
+            KeyCodeEntry entry = ConfigEntryBuilder.create().startModifierKeyCodeField(i13n, getUnsafely(field, config, ModifierKeyCode.unknown())).setModifierDefaultValue(() -> getUnsafely(field, defaults)).setModifierSaveConsumer(newValue -> setUnsafely(field, config, newValue)).build();
+            entry.setAllowMouse(false);
+            return Collections.singletonList(entry);
+        }, field -> field.getType() == ModifierKeyCode.class, ConfigObject.UsePercentage.class);
+        guiRegistry.registerAnnotationProvider((i13n, field, config, defaults, guiProvider) -> {
+            ConfigObject.UsePercentage bounds = field.getAnnotation(ConfigObject.UsePercentage.class);
+            return Collections.singletonList(ConfigEntryBuilder.create().startIntSlider(i13n, MathHelper.ceil(Utils.getUnsafely(field, config, 0.0) * 100), MathHelper.ceil(bounds.min() * 100), MathHelper.ceil(bounds.max() * 100)).setDefaultValue(() -> {
+                return MathHelper.ceil((double) Utils.getUnsafely(field, defaults) * 100);
+            }).setSaveConsumer((newValue) -> {
+                Utils.setUnsafely(field, config, newValue / 100d);
+            }).setTextGetter(integer -> String.format("Size: %d%%", integer)).build());
+        }, (field) -> {
+            return field.getType() == Double.TYPE || field.getType() == Double.class;
+        }, ConfigObject.UsePercentage.class);
         loadFavoredEntries();
         RoughlyEnoughItemsCore.LOGGER.info("[REI] Config is loaded.");
     }
-
+    
     @Override
     public List<EntryStack> getFavorites() {
         return favorites;
     }
-
+    
     public void loadFavoredEntries() {
         favorites.clear();
         Gson gson = new GsonBuilder().create();
@@ -92,7 +125,7 @@ public class ConfigManagerImpl implements ConfigManager {
         }
         saveConfig();
     }
-
+    
     @Override
     public void saveConfig() {
         Gson gson = new GsonBuilder().create();
@@ -105,27 +138,27 @@ public class ConfigManagerImpl implements ConfigManager {
         }
         ((me.sargunvohra.mcmods.autoconfig1u.ConfigManager<ConfigObjectImpl>) AutoConfig.getConfigHolder(ConfigObjectImpl.class)).save();
     }
-
+    
     @Override
     public ConfigObject getConfig() {
         return AutoConfig.getConfigHolder(ConfigObjectImpl.class).getConfig();
     }
-
+    
     @Override
     public boolean isCraftableOnlyEnabled() {
         return craftableOnly;
     }
-
+    
     @Override
     public void toggleCraftableOnly() {
         craftableOnly = !craftableOnly;
     }
-
+    
     @Override
     public void openConfigScreen(Screen parent) {
         MinecraftClient.getInstance().openScreen(getConfigScreen(parent));
     }
-
+    
     @Override
     public Screen getConfigScreen(Screen parent) {
         try {
@@ -177,7 +210,7 @@ public class ConfigManagerImpl implements ConfigManager {
                 }
                 super.render(int_1, int_2, float_1);
             }
-
+            
             @Override
             protected void init() {
                 super.init();
@@ -185,7 +218,7 @@ public class ConfigManagerImpl implements ConfigManager {
                     this.minecraft.openScreen(parent);
                 }));
             }
-
+            
             @Override
             public boolean keyPressed(int int_1, int int_2, int int_3) {
                 if (int_1 == 256 && this.shouldCloseOnEsc()) {
@@ -196,5 +229,5 @@ public class ConfigManagerImpl implements ConfigManager {
             }
         };
     }
-
+    
 }

+ 136 - 124
src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java

@@ -9,6 +9,8 @@ import me.sargunvohra.mcmods.autoconfig1u.ConfigData;
 import me.sargunvohra.mcmods.autoconfig1u.annotation.Config;
 import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry;
 import me.sargunvohra.mcmods.autoconfig1u.shadowed.blue.endless.jankson.Comment;
+import me.shedaniel.clothconfig2.api.Modifier;
+import me.shedaniel.clothconfig2.api.ModifierKeyCode;
 import me.shedaniel.rei.api.ConfigObject;
 import me.shedaniel.rei.api.annotations.Internal;
 import me.shedaniel.rei.gui.config.*;
@@ -21,302 +23,312 @@ import java.util.List;
 @Internal
 @Config(name = "roughlyenoughitems/config")
 public class ConfigObjectImpl implements ConfigObject, ConfigData {
-
-    @ConfigEntry.Category("!general")
-    @ConfigEntry.Gui.TransitiveObject
-    @DontApplyFieldName
-    public General general = new General();
-    @ConfigEntry.Category("appearance")
-    @ConfigEntry.Gui.TransitiveObject
-    @DontApplyFieldName
-    private Appearance appearance = new Appearance();
-    @ConfigEntry.Category("modules")
-    @ConfigEntry.Gui.TransitiveObject
-    @DontApplyFieldName
-    private Modules modules = new Modules();
-    @ConfigEntry.Category("technical")
-    @ConfigEntry.Gui.TransitiveObject
-    @DontApplyFieldName
-    private Technical technical = new Technical();
-    @ConfigEntry.Category("performance")
-    @ConfigEntry.Gui.TransitiveObject
-    @DontApplyFieldName
-    private Performance performance = new Performance();
-
+    
+    @ConfigEntry.Category("!general") @ConfigEntry.Gui.TransitiveObject @DontApplyFieldName public General general = new General();
+    @ConfigEntry.Category("appearance") @ConfigEntry.Gui.TransitiveObject @DontApplyFieldName private Appearance appearance = new Appearance();
+    @ConfigEntry.Category("modules") @ConfigEntry.Gui.TransitiveObject @DontApplyFieldName private Modules modules = new Modules();
+    @ConfigEntry.Category("technical") @ConfigEntry.Gui.TransitiveObject @DontApplyFieldName private Technical technical = new Technical();
+    @ConfigEntry.Category("performance") @ConfigEntry.Gui.TransitiveObject @DontApplyFieldName private Performance performance = new Performance();
+    
     @Override
     public boolean isLighterButtonHover() {
         return appearance.lighterButtonHover;
     }
-
+    
     @Override
     public void setLighterButtonHover(boolean lighterButtonHover) {
         appearance.lighterButtonHover = lighterButtonHover;
     }
-
+    
     @Override
     public boolean isOverlayVisible() {
         return general.overlayVisible;
     }
-
+    
     @Override
     public void setOverlayVisible(boolean overlayVisible) {
         general.overlayVisible = overlayVisible;
     }
-
+    
     @Override
     public boolean isCheating() {
         return general.cheating;
     }
-
+    
     @Override
     public void setCheating(boolean cheating) {
         general.cheating = cheating;
     }
-
+    
     @Override
     public ItemListOrdering getItemListOrdering() {
         return appearance.itemListOrdering.getOrdering();
     }
-
+    
     @Override
     public boolean isItemListAscending() {
         return appearance.itemListOrdering.isAscending();
     }
-
+    
     @Override
     public boolean isUsingDarkTheme() {
         return appearance.darkTheme;
     }
-
+    
     @Override
     public boolean isToastDisplayedOnCopyIdentifier() {
         return modules.toastDisplayedOnCopyIdentifier;
     }
-
+    
     @Override
     public boolean doesRenderEntryEnchantmentGlint() {
         return performance.renderEntryEnchantmentGlint;
     }
-
+    
     @Override
     public boolean isEntryListWidgetScrolled() {
         return appearance.scrollingEntryListWidget;
     }
-
+    
     @Override
     public boolean shouldAppendModNames() {
         return appearance.appendModNames;
     }
-
+    
     @Override
     public RecipeScreenType getRecipeScreenType() {
         return appearance.recipeScreenType;
     }
-
+    
     @Override
     public void setRecipeScreenType(RecipeScreenType recipeScreenType) {
         appearance.recipeScreenType = recipeScreenType;
     }
-
+    
     @Override
     public boolean isLoadingDefaultPlugin() {
         return technical.loadDefaultPlugin;
     }
-
+    
     @Override
     public SearchFieldLocation getSearchFieldLocation() {
         return appearance.searchFieldLocation;
     }
-
+    
     @Override
     public boolean isLeftHandSidePanel() {
         return appearance.mirrorItemPanel;
     }
-
+    
     @Override
     public boolean isCraftableFilterEnabled() {
         return modules.enableCraftableOnlyButton;
     }
-
+    
     @Override
     public String getGamemodeCommand() {
         return technical.gamemodeCommand;
     }
-
+    
     @Override
     public String getGiveCommand() {
         return technical.giveCommand;
     }
-
+    
     @Override
     public String getWeatherCommand() {
         return technical.weatherCommand;
     }
-
+    
     @Override
     public int getMaxRecipePerPage() {
         return appearance.maxRecipePerPage;
     }
-
+    
     @Override
     public boolean doesShowUtilsButtons() {
         return modules.showUtilsButtons;
     }
-
+    
     @Override
     public boolean doesDisableRecipeBook() {
         return modules.disableRecipeBook;
     }
-
+    
     @Override
     public boolean doesFixTabCloseContainer() {
         return modules.fixTabCloseContainer;
     }
-
+    
     @Override
     public boolean areClickableRecipeArrowsEnabled() {
         return appearance.clickableRecipeArrows;
     }
-
+    
     @Override
     public ItemCheatingMode getItemCheatingMode() {
         return appearance.itemCheatingMode;
     }
-
+    
     @Override
     public boolean isUsingLightGrayRecipeBorder() {
         return appearance.lightGrayRecipeBorder;
     }
-
+    
     @Override
     public boolean doesVillagerScreenHavePermanentScrollBar() {
         return appearance.villagerScreenPermanentScrollBar;
     }
-
+    
     @Override
     public boolean doesRegisterRecipesInAnotherThread() {
         return technical.registerRecipesInAnotherThread;
     }
-
+    
     @Override
     public boolean doesSnapToRows() {
         return appearance.snapToRows;
     }
-
+    
     @Override
     public boolean isFavoritesEnabled() {
         return general.favoritesEnabled;
     }
-
+    
     @Override
     public boolean doDisplayFavoritesTooltip() {
         return isFavoritesEnabled() && appearance.displayFavoritesTooltip;
     }
-
+    
     @Override
     public boolean doDisplayFavoritesOnTheLeft() {
         return appearance.displayFavoritesOnTheLeft;
     }
-
+    
     @Override
     public boolean doesFastEntryRendering() {
         return performance.fastEntryRendering;
     }
-
+    
     @Override
     public boolean doDebugRenderTimeRequired() {
         return technical.debugRenderTimeRequired;
     }
-
+    
     @Override
     public boolean doSearchFavorites() {
         return appearance.searchFavorites;
     }
-
+    
     @Override
-    public InputUtil.KeyCode getFavoriteKeybind() {
-        return general.favoriteKeybind == null ? InputUtil.UNKNOWN_KEYCODE : general.favoriteKeybind;
+    public ModifierKeyCode getFavoriteKeyCode() {
+        return general.favoriteKeybind == null ? ModifierKeyCode.unknown() : general.favoriteKeybind;
     }
-
+    
+    @Override
+    public ModifierKeyCode getRecipeKeybind() {
+        return general.recipeKeybind == null ? ModifierKeyCode.unknown() : general.recipeKeybind;
+    }
+    
+    @Override
+    public ModifierKeyCode getUsageKeybind() {
+        return general.usageKeybind == null ? ModifierKeyCode.unknown() : general.usageKeybind;
+    }
+    
+    @Override
+    public ModifierKeyCode getHideKeybind() {
+        return general.hideKeybind == null ? ModifierKeyCode.unknown() : general.hideKeybind;
+    }
+    
+    @Override
+    public ModifierKeyCode getPreviousPageKeybind() {
+        return general.previousPageKeybind == null ? ModifierKeyCode.unknown() : general.previousPageKeybind;
+    }
+    
+    @Override
+    public ModifierKeyCode getNextPageKeybind() {
+        return general.nextPageKeybind == null ? ModifierKeyCode.unknown() : general.nextPageKeybind;
+    }
+    
+    @Override
+    public ModifierKeyCode getFocusSearchFieldKeybind() {
+        return general.focusSearchFieldKeybind == null ? ModifierKeyCode.unknown() : general.focusSearchFieldKeybind;
+    }
+    
+    @Override
+    public ModifierKeyCode getCopyRecipeIdentifierKeybind() {
+        return general.copyRecipeIdentifierKeybind == null ? ModifierKeyCode.unknown() : general.copyRecipeIdentifierKeybind;
+    }
+    
+    @Override
+    public double getEntrySize() {
+        return appearance.entrySize;
+    }
+    
+    @Deprecated
+    @Override
+    public General getGeneral() {
+        return 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;
-        @AddInFrontKeyCode
-        private InputUtil.KeyCode favoriteKeybind = InputUtil.Type.KEYSYM.createFromCode(65);
-    }
-
+        private ModifierKeyCode recipeKeybind = ModifierKeyCode.of(InputUtil.Type.KEYSYM.createFromCode(82), Modifier.none());
+        private ModifierKeyCode usageKeybind = ModifierKeyCode.of(InputUtil.Type.KEYSYM.createFromCode(85), Modifier.none());
+        private ModifierKeyCode hideKeybind = ModifierKeyCode.of(InputUtil.Type.KEYSYM.createFromCode(79), Modifier.of(false, true, false));
+        private ModifierKeyCode previousPageKeybind = ModifierKeyCode.unknown();
+        private ModifierKeyCode nextPageKeybind = ModifierKeyCode.unknown();
+        private ModifierKeyCode focusSearchFieldKeybind = ModifierKeyCode.unknown();
+        private ModifierKeyCode copyRecipeIdentifierKeybind = ModifierKeyCode.unknown();
+        private ModifierKeyCode favoriteKeybind = ModifierKeyCode.of(InputUtil.Type.KEYSYM.createFromCode(65), Modifier.none());
+    }
+    
     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;
-        @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;
-        @Comment("Declares the position of the search field.")
-        @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;
+        @Comment("Declares the position of the search field.") @UseEnumSelectorInstead
         private SearchFieldLocation searchFieldLocation = SearchFieldLocation.CENTER;
-        @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.")
-        @ConfigEntry.BoundedDiscrete(min = 2, max = 99)
+        @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.") @ConfigEntry.BoundedDiscrete(min = 2, max = 99)
         private int maxRecipePerPage = 3;
-        @Comment("Declares whether REI should lighten the button if hovered.")
-        private boolean lighterButtonHover = true;
+        @Comment("Declares whether REI should lighten the button if hovered.") private boolean lighterButtonHover = 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;
-        @Comment("Declares how the scrollbar in villager screen should act.")
-        private boolean villagerScreenPermanentScrollBar = false;
-        @Comment("Declares whether entry list widget is scrolled.")
-        private boolean scrollingEntryListWidget = false;
+        @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.") private boolean villagerScreenPermanentScrollBar = false;
+        @Comment("Declares whether entry list widget is scrolled.") private boolean scrollingEntryListWidget = false;
         private boolean snapToRows = false;
         private boolean displayFavoritesOnTheLeft = true;
         private boolean displayFavoritesTooltip = true;
-        @Comment("Declares whether favorites will be searched.")
-        private boolean searchFavorites = true;
+        @Comment("Declares whether favorites will be searched.") private boolean searchFavorites = true;
+        @UsePercentage(min = 0.5, max = 4.0) private double entrySize = 1.0;
     }
-
+    
     public static class Technical {
-        @Comment("To disable REI's default plugin.\nDon't change this unless you understand what you are doing!")
-        private boolean loadDefaultPlugin = true;
-        @Comment("Declares the command used to change gamemode.")
-        private String gamemodeCommand = "/gamemode {gamemode}";
-        @Comment("Declares the command used in servers to cheat items.")
-        private String giveCommand = "/give {player_name} {item_identifier}{nbt} {count}";
-        @Comment("Declares the command used to change weather.")
-        private String weatherCommand = "/weather {weather}";
+        @Comment("To disable REI's default plugin.\nDon't change this unless you understand what you are doing!") private boolean loadDefaultPlugin = true;
+        @Comment("Declares the command used to change gamemode.") private String gamemodeCommand = "/gamemode {gamemode}";
+        @Comment("Declares the command used in servers to cheat items.") private String giveCommand = "/give {player_name} {item_identifier}{nbt} {count}";
+        @Comment("Declares the command used to change weather.") private String weatherCommand = "/weather {weather}";
         private boolean registerRecipesInAnotherThread = true;
         private boolean debugRenderTimeRequired = false;
     }
-
+    
     public static class Modules {
-        @Comment("Declares whether the craftable filter button is enabled.")
-        private boolean enableCraftableOnlyButton = true;
+        @Comment("Declares whether the craftable filter button is enabled.") private boolean enableCraftableOnlyButton = 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 REI should fix closing container with tab.")
-        private boolean fixTabCloseContainer = 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.") private boolean fixTabCloseContainer = false;
     }
-
+    
     public static class Performance {
-        @Comment("Whether REI should render entry's enchantment glint")
-        private boolean renderEntryEnchantmentGlint = true;
-        @ConfigEntry.Gui.Excluded
-        private boolean fastEntryRendering = false;
+        @Comment("Whether REI should render entry's enchantment glint") private boolean renderEntryEnchantmentGlint = true;
+        @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
 @Internal
 public class DisplayHelperImpl implements DisplayHelper {
-
+    
     private static final Comparator<DisplayBoundsHandler<?>> BOUNDS_HANDLER_COMPARATOR;
     private static final DisplayBoundsHandler<Object> EMPTY = new DisplayBoundsHandler() {
         @Override
         public Class getBaseSupportedClass() {
             return null;
         }
-
+        
         @Override
         public Rectangle getLeftBounds(Object screen) {
             return new Rectangle();
         }
-
+        
         @Override
         public Rectangle getRightBounds(Object screen) {
             return new Rectangle();
         }
-
+        
         @Override
         public float getPriority() {
             return -10f;
         }
     };
-
+    
     static {
         Comparator<DisplayBoundsHandler<?>> comparator = Comparator.comparingDouble(DisplayBoundsHandler::getPriority);
         BOUNDS_HANDLER_COMPARATOR = comparator.reversed();
     }
-
+    
     private List<DisplayBoundsHandler<?>> screenDisplayBoundsHandlers = Lists.newArrayList();
     private Map<Class<?>, DisplayBoundsHandler<?>> handlerCache = Maps.newHashMap();
     private Map<Class, List<DisplayBoundsHandler<?>>> handlerSortedCache = Maps.newHashMap();
     private BaseBoundsHandler baseBoundsHandler;
     private Class<?> tempScreen;
-
+    
     @Override
     public List<DisplayBoundsHandler<?>> getSortedBoundsHandlers(Class<?> 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()));
         return handlerSortedCache.get(screenClass);
     }
-
+    
     @Override
     public List<DisplayBoundsHandler<?>> getAllBoundsHandlers() {
         return screenDisplayBoundsHandlers;
     }
-
+    
     @Override
     public DisplayBoundsHandler<?> getResponsibleBoundsHandler(Class<?> screenClass) {
         DisplayBoundsHandler<?> possibleCached = handlerCache.get(screenClass);
@@ -79,36 +79,36 @@ public class DisplayHelperImpl implements DisplayHelper {
         handlerCache.put(screenClass, handlers.isEmpty() ? EMPTY : handlers.get(0));
         return handlerCache.get(screenClass);
     }
-
+    
     @Deprecated
     public boolean filterResponsible(DisplayBoundsHandler<?> handler) {
         return handler.getBaseSupportedClass().isAssignableFrom(tempScreen);
     }
-
+    
     @Override
     public void registerBoundsHandler(DisplayBoundsHandler<?> handler) {
         screenDisplayBoundsHandlers.add(handler);
     }
-
+    
     @Override
     public BaseBoundsHandler getBaseBoundsHandler() {
         return baseBoundsHandler;
     }
-
+    
     @Deprecated
     public void setBaseBoundsHandler(BaseBoundsHandler baseBoundsHandler) {
         this.baseBoundsHandler = baseBoundsHandler;
     }
-
+    
     @Deprecated
     public void resetData() {
         screenDisplayBoundsHandlers.clear();
     }
-
+    
     @Deprecated
     public void resetCache() {
         handlerCache.clear();
         handlerSortedCache.clear();
     }
-
+    
 }

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

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

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

@@ -23,11 +23,11 @@ import java.util.concurrent.CopyOnWriteArrayList;
 @Deprecated
 @Internal
 public class EntryRegistryImpl implements EntryRegistry {
-
+    
     private final CopyOnWriteArrayList<EntryStack> entries = Lists.newCopyOnWriteArrayList();
     private final Queue<Pair<EntryStack, Collection<? extends EntryStack>>> queueRegisterEntryStackAfter = Queues.newConcurrentLinkedQueue();
     private List<EntryStack> reloadList;
-
+    
     public void distinct() {
         TreeSet<EntryStack> set = new TreeSet<>((i, j) -> i.equalsAll(j) ? 0 : 1);
         set.addAll(reloadList);
@@ -37,31 +37,33 @@ public class EntryRegistryImpl implements EntryRegistry {
         reloadList.clear();
         while (true) {
             Pair<EntryStack, Collection<? extends EntryStack>> pair = queueRegisterEntryStackAfter.poll();
-            if (pair == null) break;
+            if (pair == null)
+                break;
             registerEntriesAfter(pair.getLeft(), pair.getRight());
         }
     }
-
+    
     @Override
     public List<EntryStack> getStacksList() {
         return RecipeHelper.getInstance().arePluginsLoading() ? reloadList : entries;
     }
-
+    
     public void reset() {
         reloadList = Lists.newArrayList();
         queueRegisterEntryStackAfter.clear();
         entries.clear();
         reloadList.clear();
     }
-
+    
     @Override
     public List<ItemStack> appendStacksForItem(Item item) {
         DefaultedList<ItemStack> list = new DefaultedLinkedList(Lists.newLinkedList(), null);
         item.appendStacks(item.getGroup(), list);
-        if (list.isEmpty()) list.add(item.getStackForRender());
+        if (list.isEmpty())
+            list.add(item.getStackForRender());
         return list;
     }
-
+    
     @Override
     public ItemStack[] getAllStacksFromItem(Item item) {
         List<ItemStack> list = appendStacksForItem(item);
@@ -69,11 +71,12 @@ public class EntryRegistryImpl implements EntryRegistry {
         Arrays.sort(array, (a, b) -> ItemStack.areEqualIgnoreDamage(a, b) ? 0 : 1);
         return array;
     }
-
+    
     @Override
     @Deprecated
     public void registerEntryAfter(EntryStack afterEntry, EntryStack stack, boolean checkAlreadyContains) {
-        if (stack.isEmpty()) return;
+        if (stack.isEmpty())
+            return;
         if (afterEntry == null) {
             getStacksList().add(stack);
         } else {
@@ -86,7 +89,7 @@ public class EntryRegistryImpl implements EntryRegistry {
             getStacksList().add(last, stack);
         }
     }
-
+    
     @Override
     public void queueRegisterEntryAfter(EntryStack afterEntry, Collection<? extends EntryStack> stacks) {
         if (RecipeHelper.getInstance().arePluginsLoading()) {
@@ -94,7 +97,7 @@ public class EntryRegistryImpl implements EntryRegistry {
         } else
             registerEntriesAfter(afterEntry, stacks);
     }
-
+    
     @Override
     public void registerEntriesAfter(EntryStack afterStack, Collection<? extends EntryStack> stacks) {
         if (afterStack != null) {
@@ -106,9 +109,10 @@ public class EntryRegistryImpl implements EntryRegistry {
                 }
             }
             getStacksList().addAll(index, stacks);
-        } else getStacksList().addAll(stacks);
+        } else
+            getStacksList().addAll(stacks);
     }
-
+    
     private class DefaultedLinkedList<E> extends DefaultedList<E> {
         public DefaultedLinkedList(List<E> delegate, @Nullable E initialElement) {
             super(delegate, initialElement);

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

@@ -27,10 +27,7 @@ import net.minecraft.util.math.BlockPos;
 import net.minecraft.util.registry.Registry;
 
 import javax.annotation.Nullable;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import java.util.*;
 
 @Deprecated
 public class FluidEntryStack extends AbstractEntryStack {
@@ -38,21 +35,21 @@ public class FluidEntryStack extends AbstractEntryStack {
     private static final int EMPTY_AMOUNT = -1319182373;
     private Fluid fluid;
     private int amount;
-
+    
     public FluidEntryStack(Fluid fluid) {
         this(fluid, EMPTY_AMOUNT);
     }
-
+    
     public FluidEntryStack(Fluid fluid, int amount) {
         this.fluid = fluid;
         this.amount = amount;
     }
-
+    
     protected static Pair<Sprite, Integer> getOrLoadSprite(Fluid fluid) {
         Pair<Sprite, Integer> possibleCached = FLUID_SPRITE_CACHE.get(fluid);
         if (possibleCached != null)
             return possibleCached;
-
+        
         FluidRenderHandler fluidRenderHandler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
         if (fluidRenderHandler == null)
             return null;
@@ -64,22 +61,22 @@ public class FluidEntryStack extends AbstractEntryStack {
         FLUID_SPRITE_CACHE.put(fluid, pair);
         return pair;
     }
-
+    
     @Override
     public Optional<Identifier> getIdentifier() {
         return Optional.ofNullable(Registry.FLUID.getId(getFluid()));
     }
-
+    
     @Override
     public Type getType() {
         return Type.FLUID;
     }
-
+    
     @Override
     public int getAmount() {
         return amount;
     }
-
+    
     @Override
     public void setAmount(int amount) {
         this.amount = amount == EMPTY_AMOUNT ? EMPTY_AMOUNT : Math.max(amount, 0);
@@ -87,12 +84,12 @@ public class FluidEntryStack extends AbstractEntryStack {
             fluid = Fluids.EMPTY;
         }
     }
-
+    
     @Override
     public boolean isEmpty() {
         return (amount != EMPTY_AMOUNT && amount <= 0) || fluid == Fluids.EMPTY;
     }
-
+    
     @Override
     public EntryStack copy() {
         EntryStack stack = EntryStack.create(fluid, amount);
@@ -101,40 +98,40 @@ public class FluidEntryStack extends AbstractEntryStack {
         }
         return stack;
     }
-
+    
     @Override
     public Object getObject() {
         return fluid;
     }
-
+    
     @Override
     public boolean equalsIgnoreTagsAndAmount(EntryStack stack) {
         if (stack.getType() != Type.FLUID)
             return false;
         return fluid == stack.getFluid();
     }
-
+    
     @Override
     public boolean equalsIgnoreTags(EntryStack stack) {
         if (stack.getType() != Type.FLUID)
             return false;
         return fluid == stack.getFluid() && amount == stack.getAmount();
     }
-
+    
     @Override
     public boolean equalsIgnoreAmount(EntryStack stack) {
         if (stack.getType() != Type.FLUID)
             return false;
         return fluid == stack.getFluid();
     }
-
+    
     @Override
     public boolean equalsAll(EntryStack stack) {
         if (stack.getType() != Type.FLUID)
             return false;
         return fluid == stack.getFluid() && amount == stack.getAmount();
     }
-
+    
     @Override
     public int hashCode() {
         int result = 1;
@@ -144,7 +141,7 @@ public class FluidEntryStack extends AbstractEntryStack {
         result = 31 * result;
         return result;
     }
-
+    
     @Nullable
     @Override
     public QueuedTooltip getTooltip(int mouseX, int mouseY) {
@@ -154,8 +151,7 @@ public class FluidEntryStack extends AbstractEntryStack {
         if (amount >= 0) {
             String amountTooltip = getSetting(Settings.Fluid.AMOUNT_TOOLTIP).value().apply(this);
             if (amountTooltip != null)
-                for (String s : amountTooltip.split("\n"))
-                    toolTip.add(s);
+                toolTip.addAll(Arrays.asList(amountTooltip.split("\n")));
         }
         toolTip.addAll(getSetting(Settings.TOOLTIP_APPEND_EXTRA).value().apply(this));
         if (getSetting(Settings.TOOLTIP_APPEND_MOD).value().get() && ConfigObject.getInstance().shouldAppendModNames()) {
@@ -171,7 +167,7 @@ public class FluidEntryStack extends AbstractEntryStack {
         }
         return QueuedTooltip.create(toolTip);
     }
-
+    
     @Override
     public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
         if (getSetting(Settings.RENDER).value().get()) {

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

@@ -8,7 +8,10 @@ package me.shedaniel.rei.impl;
 import com.google.common.collect.Lists;
 import com.mojang.blaze3d.platform.GlStateManager;
 import me.shedaniel.math.api.Rectangle;
-import me.shedaniel.rei.api.*;
+import me.shedaniel.rei.api.ClientHelper;
+import me.shedaniel.rei.api.ConfigObject;
+import me.shedaniel.rei.api.EntryStack;
+import me.shedaniel.rei.api.ItemRendererHooks;
 import me.shedaniel.rei.gui.widget.QueuedTooltip;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.render.*;
@@ -18,9 +21,7 @@ import net.minecraft.client.render.model.BakedModel;
 import net.minecraft.client.render.model.json.ModelTransformation;
 import net.minecraft.client.texture.SpriteAtlasTexture;
 import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
-import net.minecraft.item.Items;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.registry.Registry;
 
@@ -32,40 +33,40 @@ import java.util.Optional;
 
 @Deprecated
 public class ItemEntryStack extends AbstractEntryStack {
-
+    
     private ItemStack itemStack;
     private int hash = -1;
-
+    
     public ItemEntryStack(ItemStack itemStack) {
         this.itemStack = itemStack;
     }
-
+    
     @Override
     public Optional<Identifier> getIdentifier() {
         return Optional.ofNullable(Registry.ITEM.getId(getItem()));
     }
-
+    
     @Override
     public Type getType() {
         return Type.ITEM;
     }
-
+    
     @Override
     public int getAmount() {
         return itemStack.getCount();
     }
-
+    
     @Override
     public void setAmount(int amount) {
         itemStack.setCount(amount);
         hash = -1;
     }
-
+    
     @Override
     public boolean isEmpty() {
         return itemStack.isEmpty();
     }
-
+    
     @Override
     public EntryStack copy() {
         EntryStack stack = EntryStack.create(getItemStack().copy());
@@ -74,19 +75,19 @@ public class ItemEntryStack extends AbstractEntryStack {
         }
         return stack;
     }
-
+    
     @Override
     public Object getObject() {
         return itemStack;
     }
-
+    
     @Override
     public boolean equalsIgnoreTagsAndAmount(EntryStack stack) {
         if (stack.getType() != Type.ITEM)
             return false;
         return itemStack.getItem() == stack.getItem();
     }
-
+    
     @Override
     public boolean equalsAll(EntryStack stack) {
         if (stack.getType() != Type.ITEM)
@@ -95,7 +96,7 @@ public class ItemEntryStack extends AbstractEntryStack {
             return false;
         return ItemStack.areTagsEqual(itemStack, stack.getItemStack());
     }
-
+    
     @Override
     public boolean equalsIgnoreAmount(EntryStack stack) {
         if (stack.getType() != Type.ITEM)
@@ -104,7 +105,7 @@ public class ItemEntryStack extends AbstractEntryStack {
             return false;
         return ItemStack.areTagsEqual(itemStack, stack.getItemStack());
     }
-
+    
     @Override
     public boolean equalsIgnoreTags(EntryStack stack) {
         if (stack.getType() != Type.ITEM)
@@ -113,23 +114,23 @@ public class ItemEntryStack extends AbstractEntryStack {
             return false;
         return getAmount() == stack.getAmount();
     }
-
+    
     @Override
     public int hashCode() {
-//        if (hash == -1) {
-            int result = 1;
-            result = 31 * result + getType().hashCode();
-            result = 31 * result + itemStack.getItem().hashCode();
-            result = 31 * result + itemStack.getCount();
-            result = 31 * result + (itemStack.hasTag() ? itemStack.getTag().hashCode() : 0);
-            hash = result;
-//            if (hash == -1) {
-//                hash = -2;
-//            }
-//        }
+        //        if (hash == -1) {
+        int result = 1;
+        result = 31 * result + getType().hashCode();
+        result = 31 * result + itemStack.getItem().hashCode();
+        result = 31 * result + itemStack.getCount();
+        result = 31 * result + (itemStack.hasTag() ? itemStack.getTag().hashCode() : 0);
+        hash = result;
+        //            if (hash == -1) {
+        //                hash = -2;
+        //            }
+        //        }
         return hash;
     }
-
+    
     @Nullable
     @Override
     public QueuedTooltip getTooltip(int mouseX, int mouseY) {
@@ -150,56 +151,55 @@ public class ItemEntryStack extends AbstractEntryStack {
         }
         return QueuedTooltip.create(toolTip);
     }
-
+    
     @Override
     public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
         if (!isEmpty() && getSetting(Settings.RENDER).value().get()) {
             ItemStack stack = getItemStack();
-            if (ConfigObject.getInstance().doesFastEntryRendering()) {
-                ItemRenderer itemRenderer = MinecraftClient.getInstance().getItemRenderer();
-                BakedModel model = itemRenderer.getModels().getModel(stack);
-                if (stack.getItem().hasPropertyGetters())
-                    model = model.getItemPropertyOverrides().apply(model, stack, null, null);
-                if (model != null) {
-                    GlStateManager.pushMatrix();
-                    MinecraftClient.getInstance().getTextureManager().bindTexture(SpriteAtlasTexture.BLOCK_ATLAS_TEX);
-                    GlStateManager.enableRescaleNormal();
-                    GlStateManager.translatef(bounds.getCenterX(), bounds.getCenterY(), 100.0F + getZ());
-                    GlStateManager.scalef(16.0F, -16.0F, 16.0F);
-                    MatrixStack matrices = new MatrixStack();
-                    VertexConsumerProvider.Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers();
-                    Item item = stack.getItem();
-                    boolean bl = !model.hasDepthInGui() || item == Items.SHIELD || item == Items.TRIDENT;
-                    if (bl)
-                        GlStateManager.method_24221();
-                    model.getTransformation().getTransformation(ModelTransformation.Type.GUI).apply(false, matrices);
-                    matrices.translate(-0.5D, -0.5D, -0.5D);
-                    if (!model.isBuiltin()) {
-                        RenderLayer renderLayer = RenderLayers.getItemLayer(stack);
-                        if (Objects.equals(renderLayer, TexturedRenderLayers.getEntityTranslucent()))
-                            renderLayer = TexturedRenderLayers.getEntityTranslucentCull();
-                        VertexConsumer vertexConsumer = stack.hasEnchantmentGlint() && getSetting(Settings.Item.RENDER_ENCHANTMENT_GLINT).value().get() ? VertexConsumers.dual(immediate.getBuffer(RenderLayer.getGlint()), immediate.getBuffer(renderLayer)) : immediate.getBuffer(renderLayer);
-                        ((ItemRendererHooks) itemRenderer).rei_renderBakedItemModel(model, stack, 15728880, OverlayTexture.DEFAULT_UV, matrices, vertexConsumer);
-                    } else {
-                        BuiltinModelItemRenderer.INSTANCE.render(stack, matrices, immediate, 15728880, OverlayTexture.DEFAULT_UV);
-                    }
-                    immediate.draw();
-                    if (bl)
-                        GlStateManager.method_24222();
-                    GlStateManager.disableRescaleNormal();
-                    GlStateManager.popMatrix();
+            //            if (true) {
+            ItemRenderer itemRenderer = MinecraftClient.getInstance().getItemRenderer();
+            itemRenderer.zOffset = getZ();
+            BakedModel model = itemRenderer.getModels().getModel(stack);
+            model = model.getItemPropertyOverrides().apply(model, stack, null, null);
+            if (model != null) {
+                MinecraftClient.getInstance().getTextureManager().bindTexture(SpriteAtlasTexture.BLOCK_ATLAS_TEX);
+                GlStateManager.enableRescaleNormal();
+                MatrixStack matrices = new MatrixStack();
+                matrices.translate(bounds.getCenterX(), bounds.getCenterY(), 100.0F + getZ());
+                matrices.scale(bounds.getWidth(), (bounds.getWidth() + bounds.getHeight()) / -2f, bounds.getHeight());
+                VertexConsumerProvider.Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers();
+                boolean bl = !model.hasDepthInGui();
+                if (bl)
+                    GlStateManager.method_24221();
+                model.getTransformation().getTransformation(ModelTransformation.Type.GUI).apply(false, matrices);
+                matrices.translate(-0.5D, -0.5D, -0.5D);
+                if (!model.isBuiltin()) {
+                    RenderLayer renderLayer = RenderLayers.getItemLayer(stack);
+                    if (Objects.equals(renderLayer, TexturedRenderLayers.getEntityTranslucent()))
+                        renderLayer = TexturedRenderLayers.getEntityTranslucentCull();
+                    VertexConsumer vertexConsumer = stack.hasEnchantmentGlint() && getSetting(Settings.Item.RENDER_ENCHANTMENT_GLINT).value().get() ? VertexConsumers.dual(immediate.getBuffer(RenderLayer.getGlint()), immediate.getBuffer(renderLayer)) : immediate.getBuffer(renderLayer);
+                    ((ItemRendererHooks) itemRenderer).rei_renderBakedItemModel(model, stack, 15728880, OverlayTexture.DEFAULT_UV, matrices, vertexConsumer);
+                } else {
+                    BuiltinModelItemRenderer.INSTANCE.render(stack, matrices, immediate, 15728880, OverlayTexture.DEFAULT_UV);
                 }
-            } else {
-                ((ItemStackHook) (Object) stack).rei_setRenderEnchantmentGlint(getSetting(Settings.Item.RENDER_ENCHANTMENT_GLINT).value().get());
-                ItemRenderer itemRenderer = MinecraftClient.getInstance().getItemRenderer();
-                itemRenderer.zOffset = getZ();
-                int i1 = bounds.getCenterX() - 8;
-                int i2 = bounds.getCenterY() - 8;
-                itemRenderer.renderGuiItemIcon(stack, i1, i2);
-                itemRenderer.renderGuiItemOverlay(MinecraftClient.getInstance().textRenderer, stack, i1, i2, getSetting(Settings.RENDER_COUNTS).value().get() ? getSetting(Settings.COUNTS).value().apply(this) : "");
-                itemRenderer.zOffset = 0.0F;
-                ((ItemStackHook) (Object) stack).rei_setRenderEnchantmentGlint(true);
+                immediate.draw();
+                if (bl)
+                    GlStateManager.method_24222();
+                GlStateManager.disableRescaleNormal();
             }
+            itemRenderer.renderGuiItemOverlay(MinecraftClient.getInstance().textRenderer, stack, bounds.x, bounds.y, getSetting(Settings.RENDER_COUNTS).value().get() ? getSetting(Settings.COUNTS).value().apply(this) : "");
+            itemRenderer.zOffset = 0.0F;
+            //            } else {
+            //                ((ItemStackHook) (Object) stack).rei_setRenderEnchantmentGlint(getSetting(Settings.Item.RENDER_ENCHANTMENT_GLINT).value().get());
+            //                ItemRenderer itemRenderer = MinecraftClient.getInstance().getItemRenderer();
+            //                itemRenderer.zOffset = getZ();
+            //                int i1 = bounds.x + 1;
+            //                int i2 = bounds.y + 1;
+            //                itemRenderer.renderGuiItemIcon(stack, i1, i2);
+            //                itemRenderer.renderGuiItemOverlay(MinecraftClient.getInstance().textRenderer, stack, i1, i2, getSetting(Settings.RENDER_COUNTS).value().get() ? getSetting(Settings.COUNTS).value().apply(this) : "");
+            //                itemRenderer.zOffset = 0.0F;
+            //                ((ItemStackHook) (Object) stack).rei_setRenderEnchantmentGlint(true);
+            //            }
         }
     }
 }

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

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

+ 58 - 61
src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java

@@ -24,7 +24,6 @@ import net.minecraft.util.ActionResult;
 import net.minecraft.util.Identifier;
 
 import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
@@ -32,21 +31,20 @@ import java.util.stream.Collectors;
 @Deprecated
 @Internal
 public class RecipeHelperImpl implements RecipeHelper {
-
+    
     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());
         if (int_1 == 0)
             int_1 = o1.getId().getPath().compareTo(o2.getId().getPath());
         return int_1;
     };
-
+    
     static {
         Comparator<DisplayVisibilityHandler> comparator = Comparator.comparingDouble(DisplayVisibilityHandler::getPriority);
         VISIBILITY_HANDLER_COMPARATOR = comparator.reversed();
     }
-
+    
     private final List<AutoTransferHandler> autoTransferHandlers = Lists.newLinkedList();
     private final List<RecipeFunction> recipeFunctions = Lists.newLinkedList();
     private final List<ScreenClickArea> screenClickAreas = Lists.newLinkedList();
@@ -59,14 +57,14 @@ public class RecipeHelperImpl implements RecipeHelper {
     private final List<LiveRecipeGenerator<RecipeDisplay>> liveRecipeGenerators = Lists.newLinkedList();
     private RecipeManager recipeManager;
     private boolean arePluginsLoading = false;
-
+    
     @Override
     public List<EntryStack> findCraftableEntriesByItems(List<EntryStack> inventoryItems) {
         List<EntryStack> craftables = new ArrayList<>();
         for (List<RecipeDisplay> value : recipeCategoryListMap.values())
             for (RecipeDisplay recipeDisplay : value) {
                 int slotsCraftable = 0;
-                List<List<EntryStack>> requiredInput = (List<List<EntryStack>>) recipeDisplay.getRequiredEntries();
+                List<List<EntryStack>> requiredInput = recipeDisplay.getRequiredEntries();
                 for (List<EntryStack> slot : requiredInput) {
                     if (slot.isEmpty()) {
                         slotsCraftable++;
@@ -82,38 +80,38 @@ public class RecipeHelperImpl implements RecipeHelper {
                     }
                 }
                 if (slotsCraftable == recipeDisplay.getRequiredEntries().size())
-                    craftables.addAll((List<EntryStack>) recipeDisplay.getOutputEntries());
+                    craftables.addAll(recipeDisplay.getOutputEntries());
             }
         return craftables.stream().distinct().collect(Collectors.toList());
     }
-
+    
     @Override
     public boolean arePluginsLoading() {
         return arePluginsLoading;
     }
-
+    
     @Override
     public void registerCategory(RecipeCategory<?> category) {
         categories.add(category);
         recipeCategoryListMap.put(category.getIdentifier(), Lists.newLinkedList());
         categoryWorkingStations.put(category.getIdentifier(), Lists.newLinkedList());
     }
-
+    
     @Override
     public void registerWorkingStations(Identifier category, List<EntryStack>... workingStations) {
         categoryWorkingStations.get(category).addAll(Arrays.asList(workingStations));
     }
-
+    
     @Override
     public void registerWorkingStations(Identifier category, EntryStack... workingStations) {
         categoryWorkingStations.get(category).addAll(Arrays.asList(workingStations).stream().map(Collections::singletonList).collect(Collectors.toList()));
     }
-
+    
     @Override
     public List<List<EntryStack>> getWorkingStations(Identifier category) {
         return categoryWorkingStations.get(category);
     }
-
+    
     @Override
     public void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display) {
         if (!recipeCategoryListMap.containsKey(categoryIdentifier))
@@ -121,14 +119,14 @@ public class RecipeHelperImpl implements RecipeHelper {
         recipeCount[0]++;
         recipeCategoryListMap.get(categoryIdentifier).add(display);
     }
-
+    
     private void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display, int index) {
         if (!recipeCategoryListMap.containsKey(categoryIdentifier))
             return;
         recipeCount[0]++;
         recipeCategoryListMap.get(categoryIdentifier).add(index, display);
     }
-
+    
     @Override
     public Map<RecipeCategory<?>, List<RecipeDisplay>> getRecipesFor(EntryStack stack) {
         Map<Identifier, List<RecipeDisplay>> categoriesMap = new HashMap<>();
@@ -153,17 +151,17 @@ public class RecipeHelperImpl implements RecipeHelper {
                 recipeCategoryListMap.remove(category);
         return recipeCategoryListMap;
     }
-
+    
     @Override
     public RecipeCategory<?> getCategory(Identifier identifier) {
         return CollectionUtils.findFirstOrNull(categories, category -> category.getIdentifier().equals(identifier));
     }
-
+    
     @Override
     public RecipeManager getRecipeManager() {
         return recipeManager;
     }
-
+    
     private boolean isStackWorkStationOfCategory(Identifier category, EntryStack stack) {
         for (List<EntryStack> stacks : getWorkingStations(category)) {
             for (EntryStack entryStack : stacks) {
@@ -173,7 +171,7 @@ public class RecipeHelperImpl implements RecipeHelper {
         }
         return false;
     }
-
+    
     @Override
     public Map<RecipeCategory<?>, List<RecipeDisplay>> getUsagesFor(EntryStack stack) {
         Map<Identifier, Set<RecipeDisplay>> categoriesMap = new HashMap<>();
@@ -222,28 +220,27 @@ public class RecipeHelperImpl implements RecipeHelper {
                 recipeCategoryListMap.remove(category);
         return recipeCategoryListMap;
     }
-
+    
     @Override
     public List<RecipeCategory<?>> getAllCategories() {
         return Collections.unmodifiableList(categories);
     }
-
+    
     @Override
     public Optional<ButtonAreaSupplier> getAutoCraftButtonArea(RecipeCategory<?> category) {
         if (!autoCraftAreaSupplierMap.containsKey(category.getIdentifier()))
             return Optional.ofNullable(bounds -> new Rectangle(bounds.getMaxX() - 16, bounds.getMaxY() - 16, 10, 10));
         return Optional.ofNullable(autoCraftAreaSupplierMap.get(category.getIdentifier()));
     }
-
+    
     @Override
     public void registerAutoCraftButtonArea(Identifier category, ButtonAreaSupplier rectangle) {
         if (rectangle == null) {
-            if (autoCraftAreaSupplierMap.containsKey(category))
-                autoCraftAreaSupplierMap.remove(category);
+            autoCraftAreaSupplierMap.remove(category);
         } else
             autoCraftAreaSupplierMap.put(category, rectangle);
     }
-
+    
     @SuppressWarnings("deprecation")
     public void recipesLoaded(RecipeManager recipeManager) {
         long startTime = System.currentTimeMillis();
@@ -302,7 +299,7 @@ public class RecipeHelperImpl implements RecipeHelper {
                 RoughlyEnoughItemsCore.LOGGER.error("[REI] " + identifier.toString() + " plugin failed to load!", e);
             }
         }
-
+        
         for (REIPluginV0 plugin : reiPluginV0s) {
             Identifier identifier = plugin.getPluginIdentifier();
             try {
@@ -330,51 +327,51 @@ public class RecipeHelperImpl implements RecipeHelper {
                 public ActionResult handleDisplay(RecipeCategory<?> category, RecipeDisplay display) {
                     return ActionResult.SUCCESS;
                 }
-
+                
                 @Override
                 public float getPriority() {
                     return -1f;
                 }
             });
-
+        
         // Clear Cache
         ((DisplayHelperImpl) DisplayHelper.getInstance()).resetCache();
         ScreenHelper.getOptionalOverlay().ifPresent(overlay -> overlay.shouldReInit = true);
-
+        
         arePluginsLoading = false;
         // Remove duplicate entries
         ((EntryRegistryImpl) EntryRegistry.getInstance()).distinct();
-
+        
         // Clear Cache Again!
         ((DisplayHelperImpl) DisplayHelper.getInstance()).resetCache();
         ScreenHelper.getOptionalOverlay().ifPresent(overlay -> overlay.shouldReInit = true);
-
+        
         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[0], DisplayHelper.getInstance().getBaseBoundsHandler().supplierSize(), DisplayHelper.getInstance().getAllBoundsHandlers().size(), getDisplayVisibilityHandlers().size(), categories.size(), String.join(", ", categories.stream().map(RecipeCategory::getCategoryName).collect(Collectors.toList())), usedTime);
     }
-
+    
     @Override
     public AutoTransferHandler registerAutoCraftingHandler(AutoTransferHandler handler) {
         autoTransferHandlers.add(handler);
         return handler;
     }
-
+    
     @Override
     public List<AutoTransferHandler> getSortedAutoCraftingHandler() {
         return autoTransferHandlers.stream().sorted(Comparator.comparingDouble(AutoTransferHandler::getPriority).reversed()).collect(Collectors.toList());
     }
-
+    
     @Override
     public int getRecipeCount() {
         return recipeCount[0];
     }
-
+    
     @Override
     @SuppressWarnings("rawtypes")
     public List<Recipe> getAllSortedRecipes() {
         return getRecipeManager().values().stream().sorted(RECIPE_COMPARATOR).collect(Collectors.toList());
     }
-
+    
     @Override
     public Map<RecipeCategory<?>, List<RecipeDisplay>> getAllRecipes() {
         Map<RecipeCategory<?>, List<RecipeDisplay>> map = Maps.newLinkedHashMap();
@@ -387,33 +384,33 @@ public class RecipeHelperImpl implements RecipeHelper {
         }
         return map;
     }
-
+    
     @Override
     public List<RecipeDisplay> getAllRecipesFromCategory(RecipeCategory<?> category) {
         return recipeCategoryListMap.get(category.getIdentifier());
     }
-
+    
     @Override
     public void registerRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler) {
         displayVisibilityHandlers.add(visibilityHandler);
     }
-
+    
     @Override
     public void unregisterRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler) {
         displayVisibilityHandlers.remove(visibilityHandler);
     }
-
+    
     @Override
     public List<DisplayVisibilityHandler> getDisplayVisibilityHandlers() {
         return Collections.unmodifiableList(displayVisibilityHandlers);
     }
-
+    
     @SuppressWarnings("deprecation")
     @Override
     public boolean isDisplayVisible(RecipeDisplay display, boolean respectConfig) {
         return isDisplayVisible(display);
     }
-
+    
     @SuppressWarnings("deprecation")
     @Override
     public boolean isDisplayVisible(RecipeDisplay display) {
@@ -430,74 +427,74 @@ public class RecipeHelperImpl implements RecipeHelper {
         }
         return true;
     }
-
+    
     @Override
     public void registerScreenClickArea(Rectangle rectangle, Class<? extends AbstractContainerScreen<?>> screenClass, Identifier... categories) {
         this.screenClickAreas.add(new ScreenClickAreaImpl(screenClass, rectangle, categories));
     }
-
+    
     @Override
     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));
     }
-
+    
     @Override
-    public <T extends Recipe<?>> void registerRecipes(Identifier category, @SuppressWarnings("rawtypes")
-            Function<Recipe, Boolean> recipeFilter, Function<T, RecipeDisplay> mappingFunction) {
+    public <T extends Recipe<?>> void registerRecipes(Identifier category,
+            @SuppressWarnings("rawtypes") Function<Recipe, Boolean> recipeFilter, Function<T, RecipeDisplay> mappingFunction) {
         recipeFunctions.add(new RecipeFunction(category, recipeFilter::apply, mappingFunction));
     }
-
+    
     @Override
     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));
     }
-
+    
     @Override
     public void registerLiveRecipeGenerator(LiveRecipeGenerator<?> liveRecipeGenerator) {
         liveRecipeGenerators.add((LiveRecipeGenerator<RecipeDisplay>) liveRecipeGenerator);
     }
-
+    
     @Override
     public List<ScreenClickArea> getScreenClickAreas() {
         return screenClickAreas;
     }
-
+    
     private class ScreenClickAreaImpl implements ScreenClickArea {
         Class<? extends AbstractContainerScreen<?>> screenClass;
         Rectangle rectangle;
         Identifier[] categories;
-
+        
         private ScreenClickAreaImpl(Class<? extends AbstractContainerScreen<?>> screenClass, Rectangle rectangle, Identifier[] categories) {
             this.screenClass = screenClass;
             this.rectangle = rectangle;
             this.categories = categories;
         }
-
+        
         public Class<? extends AbstractContainerScreen<?>> getScreenClass() {
             return screenClass;
         }
-
+        
         public Rectangle getRectangle() {
             return rectangle;
         }
-
+        
         public Identifier[] getCategories() {
             return categories;
         }
     }
-
+    
     @SuppressWarnings("rawtypes")
     private class RecipeFunction {
         Identifier category;
         Predicate<Recipe> recipeFilter;
         Function mappingFunction;
-
+        
         public RecipeFunction(Identifier category, Predicate<Recipe> recipeFilter, Function<?, RecipeDisplay> mappingFunction) {
             this.category = category;
             this.recipeFilter = recipeFilter;
             this.mappingFunction = mappingFunction;
         }
     }
-
+    
 }

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

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

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

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

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

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

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

@@ -10,7 +10,6 @@ import me.shedaniel.rei.plugin.DefaultPlugin;
 import me.shedaniel.rei.plugin.brewing.BrewingRecipe;
 import me.shedaniel.rei.plugin.brewing.DefaultBrewingDisplay;
 import net.minecraft.item.Item;
-import net.minecraft.item.ItemConvertible;
 import net.minecraft.item.ItemStack;
 import net.minecraft.item.PotionItem;
 import net.minecraft.potion.Potion;
@@ -27,26 +26,23 @@ import java.util.List;
 
 @Mixin(BrewingRecipeRegistry.class)
 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"))
     private static void method_8080(Item item_1, CallbackInfo ci) {
         if (item_1 instanceof PotionItem)
-            SELF_POTION_TYPES.add(Ingredient.ofItems(new ItemConvertible[]{item_1}));
+            SELF_POTION_TYPES.add(Ingredient.ofItems(item_1));
     }
-
+    
     @Inject(method = "registerItemRecipe", at = @At("RETURN"))
     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)
-            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(item_2), item_3));
     }
-
+    
     @Inject(method = "registerPotionRecipe", at = @At("RETURN"))
     private static void registerPotionRecipe(Potion potion_1, Item item_1, Potion potion_2, CallbackInfo ci) {
         if (!REGISTERED_POTION_TYPES.contains(potion_1))
@@ -55,16 +51,16 @@ public class MixinBrewingRecipeRegistry {
             rei_registerPotionType(potion_2);
         for (Ingredient type : SELF_POTION_TYPES) {
             for (ItemStack stack : type.getMatchingStacksClient()) {
-                DefaultPlugin.registerBrewingDisplay(new DefaultBrewingDisplay(PotionUtil.setPotion(stack.copy(), potion_1), Ingredient.ofItems(new ItemConvertible[]{item_1}), PotionUtil.setPotion(stack.copy(), potion_2)));
+                DefaultPlugin.registerBrewingDisplay(new DefaultBrewingDisplay(PotionUtil.setPotion(stack.copy(), potion_1), Ingredient.ofItems(item_1), PotionUtil.setPotion(stack.copy(), potion_2)));
             }
         }
     }
-
+    
     private static void rei_registerPotionType(Potion potion) {
         REGISTERED_POTION_TYPES.add(potion);
         for (BrewingRecipe recipe : SELF_ITEM_RECIPES) {
             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 {
     @Shadow
     protected abstract void renderBakedItemModel(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrices, VertexConsumer vertices);
-
+    
     @Override
     public void rei_renderBakedItemModel(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrices, VertexConsumer 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)
 public class MixinItemStack implements ItemStackHook {
     private boolean rei_dontRenderOverlay = false;
-
+    
     @Override
     public void rei_setRenderEnchantmentGlint(boolean b) {
         rei_dontRenderOverlay = !b;
     }
-
+    
     @Inject(method = "hasEnchantmentGlint", at = @At("HEAD"), cancellable = true)
     public void hasEnchantmentGlint(CallbackInfoReturnable<Boolean> callbackInfo) {
         if (rei_dontRenderOverlay)
             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;
 
 public class DefaultAutoCraftingPlugin implements REIPluginV0 {
-
+    
     public static final Identifier PLUGIN = new Identifier("roughlyenoughitems", "default_auto_crafting_plugin");
-
+    
     @Override
     public Identifier getPluginIdentifier() {
         return PLUGIN;
     }
-
+    
     @Override
     public SemanticVersion getMinimumVersion() throws VersionParsingException {
         return SemanticVersion.parse("3.0-pre");
     }
-
+    
     @Override
     public void registerOthers(RecipeHelper recipeHelper) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {

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

@@ -55,7 +55,7 @@ import net.minecraft.util.registry.Registry;
 import java.util.*;
 
 public class DefaultPlugin implements REIPluginV0 {
-
+    
     public static final Identifier CRAFTING = new Identifier("minecraft", "plugins/crafting");
     public static final Identifier SMELTING = new Identifier("minecraft", "plugins/smelting");
     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_DARK = new Identifier("roughlyenoughitems", "textures/gui/display_dark.png");
     private static final List<DefaultBrewingDisplay> BREWING_DISPLAYS = Lists.newArrayList();
-
+    
     public static Identifier getDisplayTexture() {
         return ScreenHelper.isDarkModeEnabled() ? DISPLAY_TEXTURE_DARK : DISPLAY_TEXTURE;
     }
-
+    
     public static void registerBrewingDisplay(DefaultBrewingDisplay display) {
         BREWING_DISPLAYS.add(display);
     }
-
+    
     @Override
     public Identifier getPluginIdentifier() {
         return PLUGIN;
     }
-
+    
     @Override
     public SemanticVersion getMinimumVersion() throws VersionParsingException {
         return SemanticVersion.parse("3.2.33");
     }
-
+    
     @Override
     public void registerEntries(EntryRegistry entryRegistry) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
@@ -107,7 +107,7 @@ public class DefaultPlugin implements REIPluginV0 {
                 entryRegistry.registerEntry(EntryStack.create(item));
         }
         EntryStack stack = EntryStack.create(Items.ENCHANTED_BOOK);
-        List<EntryStack> enchantments = new ArrayList<>(); 
+        List<EntryStack> enchantments = new ArrayList<>();
         for (Enchantment enchantment : Registry.ENCHANTMENT) {
             for (int i = enchantment.getMinimumLevel(); i <= enchantment.getMaximumLevel(); i++) {
                 Map<Enchantment, Integer> map = new HashMap<>();
@@ -123,7 +123,7 @@ public class DefaultPlugin implements REIPluginV0 {
                 entryRegistry.registerEntry(EntryStack.create(fluid));
         }
     }
-
+    
     @Override
     public void registerPluginCategories(RecipeHelper recipeHelper) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
@@ -139,7 +139,7 @@ public class DefaultPlugin implements REIPluginV0 {
         recipeHelper.registerCategory(new DefaultCompostingCategory());
         recipeHelper.registerCategory(new DefaultStrippingCategory());
     }
-
+    
     @Override
     public void registerRecipeDisplays(RecipeHelper recipeHelper) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
@@ -193,7 +193,7 @@ public class DefaultPlugin implements REIPluginV0 {
             recipeHelper.registerDisplay(STRIPPING, new DefaultStrippingDisplay(new ItemStack(set.getKey()), new ItemStack(set.getValue())));
         });
     }
-
+    
     @Override
     public void postRegister() {
         // Sit tight! This will be a fast journey!
@@ -212,12 +212,12 @@ public class DefaultPlugin implements REIPluginV0 {
         time = System.currentTimeMillis() - time;
         RoughlyEnoughItemsCore.LOGGER.info("[REI] Applied Check Tags for potion in %dms.", time);
     }
-
+    
     private void applyPotionTransformer(EntryStack stack) {
         if (stack.getItem() instanceof PotionItem)
             stack.addSetting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE);
     }
-
+    
     @Override
     public void registerBounds(DisplayHelper displayHelper) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
@@ -236,18 +236,18 @@ public class DefaultPlugin implements REIPluginV0 {
             public Class<?> getBaseSupportedClass() {
                 return AbstractContainerScreen.class;
             }
-
+            
             @Override
             public Rectangle getLeftBounds(AbstractContainerScreen<?> screen) {
                 return new Rectangle(2, 0, ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft() - 4, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
-
+            
             @Override
             public Rectangle getRightBounds(AbstractContainerScreen<?> screen) {
                 int startX = ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft() + ScreenHelper.getLastContainerScreenHooks().rei_getContainerWidth() + 2;
                 return new Rectangle(startX, 0, MinecraftClient.getInstance().getWindow().getScaledWidth() - startX - 2, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
-
+            
             @Override
             public float getPriority() {
                 return -1.0f;
@@ -258,18 +258,18 @@ public class DefaultPlugin implements REIPluginV0 {
             public Class<?> getBaseSupportedClass() {
                 return RecipeViewingScreen.class;
             }
-
+            
             @Override
             public Rectangle getLeftBounds(RecipeViewingScreen screen) {
-                return new Rectangle(2, 0, ((RecipeViewingScreen) screen).getBounds().x - 4, MinecraftClient.getInstance().getWindow().getScaledHeight());
+                return new Rectangle(2, 0, screen.getBounds().x - 4, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
-
+            
             @Override
             public Rectangle getRightBounds(RecipeViewingScreen screen) {
-                int startX = ((RecipeViewingScreen) screen).getBounds().x + ((RecipeViewingScreen) screen).getBounds().width + 2;
+                int startX = screen.getBounds().x + screen.getBounds().width + 2;
                 return new Rectangle(startX, 0, MinecraftClient.getInstance().getWindow().getScaledWidth() - startX - 2, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
-
+            
             @Override
             public float getPriority() {
                 return -1.0f;
@@ -280,25 +280,25 @@ public class DefaultPlugin implements REIPluginV0 {
             public Class<?> getBaseSupportedClass() {
                 return VillagerRecipeViewingScreen.class;
             }
-
+            
             @Override
             public Rectangle getLeftBounds(VillagerRecipeViewingScreen screen) {
-                return new Rectangle(2, 0, ((VillagerRecipeViewingScreen) screen).bounds.x - 4, MinecraftClient.getInstance().getWindow().getScaledHeight());
+                return new Rectangle(2, 0, screen.bounds.x - 4, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
-
+            
             @Override
             public Rectangle getRightBounds(VillagerRecipeViewingScreen screen) {
-                int startX = ((VillagerRecipeViewingScreen) screen).bounds.x + ((VillagerRecipeViewingScreen) screen).bounds.width + 2;
+                int startX = screen.bounds.x + screen.bounds.width + 2;
                 return new Rectangle(startX, 0, MinecraftClient.getInstance().getWindow().getScaledWidth() - startX - 2, MinecraftClient.getInstance().getWindow().getScaledHeight());
             }
-
+            
             @Override
             public float getPriority() {
                 return -1.0f;
             }
         });
     }
-
+    
     @Override
     public void registerOthers(RecipeHelper recipeHelper) {
         if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
@@ -321,10 +321,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), BlastFurnaceScreen.class, BLASTING);
     }
-
+    
     @Override
     public int getPriority() {
         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;
 
 public class DefaultRecipeBookExclusionZones implements Supplier<List<Rectangle>> {
-
+    
     @Override
     public List<Rectangle> get() {
         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));
         return l;
     }
-
+    
 }

+ 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;
 
 public class DefaultBlastingDisplay extends DefaultCookingDisplay {
-
+    
     public DefaultBlastingDisplay(BlastingRecipe recipe) {
         super(recipe);
     }
-
+    
     @Override
     public Identifier getRecipeCategory() {
         return DefaultPlugin.BLASTING;

+ 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;
 
 public class DefaultBrewingCategory implements RecipeCategory<DefaultBrewingDisplay> {
-
+    
     @Override
     public Identifier getIdentifier() {
         return DefaultPlugin.BREWING;
     }
-
+    
     @Override
     public EntryStack getLogo() {
         return EntryStack.create(Blocks.BREWING_STAND);
     }
-
+    
     @Override
     public String getCategoryName() {
         return I18n.translate("category.rei.brewing");
     }
-
+    
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultBrewingDisplay> recipeDisplaySupplier, Rectangle bounds) {
         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());
         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;
 
 public class DefaultBrewingDisplay implements RecipeDisplay {
-
+    
     private EntryStack input, output;
     private List<EntryStack> reactant;
-
+    
     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.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")));
     }
-
+    
     @Override
     public List<List<EntryStack>> getInputEntries() {
         return Lists.newArrayList(Collections.singletonList(input), reactant);
     }
-
+    
     @Override
     public List<EntryStack> getOutputEntries() {
         return Collections.singletonList(output);
     }
-
+    
     @Override
     public Identifier getRecipeCategory() {
         return DefaultPlugin.BREWING;
     }
-
+    
     public List<EntryStack> getOutput(int slot) {
         List<EntryStack> stack = new ArrayList<>();
         for (int i = 0; i < slot * 2; i++)
@@ -58,7 +58,7 @@ public class DefaultBrewingDisplay implements RecipeDisplay {
             stack.addAll(getOutputEntries());
         return stack;
     }
-
+    
     @Override
     public List<List<EntryStack>> getRequiredEntries() {
         return getInputEntries();

+ 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;
 
 public class DefaultCampfireDisplay implements RecipeDisplay {
-
+    
     private List<List<EntryStack>> inputs;
     private List<EntryStack> output;
     private int cookTime;
     private CampfireCookingRecipe display;
-
+    
     public DefaultCampfireDisplay(CampfireCookingRecipe recipe) {
         this(recipe.getPreviewInputs(), recipe.getOutput(), recipe.getCookTime());
         this.display = recipe;
     }
-
+    
     public DefaultCampfireDisplay(DefaultedList<Ingredient> ingredients, ItemStack output, int cookTime) {
         this.inputs = ingredients.stream().map(i -> {
             List<EntryStack> entries = new ArrayList<>();
@@ -44,34 +44,34 @@ public class DefaultCampfireDisplay implements RecipeDisplay {
         this.output = Collections.singletonList(EntryStack.create(output));
         this.cookTime = cookTime;
     }
-
+    
     public int getCookTime() {
         return cookTime;
     }
-
+    
     @Override
     public Optional<Identifier> getRecipeLocation() {
         return Optional.ofNullable(display).map(AbstractCookingRecipe::getId);
     }
-
+    
     @Override
     public List<List<EntryStack>> getInputEntries() {
         return inputs;
     }
-
+    
     @Override
     public List<EntryStack> getOutputEntries() {
         return output;
     }
-
+    
     @Override
     public List<List<EntryStack>> getRequiredEntries() {
         return inputs;
     }
-
+    
     @Override
     public Identifier getRecipeCategory() {
         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;
 
 public class DefaultCompostingCategory implements RecipeCategory<DefaultCompostingDisplay> {
-
+    
     @Override
     public Identifier getIdentifier() {
         return DefaultPlugin.COMPOSTING;
     }
-
+    
     @Override
     public EntryStack getLogo() {
         return EntryStack.create(Blocks.COMPOSTER);
     }
-
+    
     @Override
     public String getCategoryName() {
         return I18n.translate("category.rei.composting");
     }
-
+    
     @Override
     public RecipeEntry getSimpleRenderer(DefaultCompostingDisplay recipe) {
         return new RecipeEntry() {
@@ -54,20 +54,20 @@ public class DefaultCompostingCategory implements RecipeCategory<DefaultComposti
             public int getHeight() {
                 return 10 + MinecraftClient.getInstance().textRenderer.fontHeight;
             }
-
+            
             @Nullable
             @Override
             public QueuedTooltip getTooltip(int mouseX, int mouseY) {
                 return null;
             }
-
+            
             @Override
             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);
             }
         };
     }
-
+    
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultCompostingDisplay> recipeDisplaySupplier, Rectangle bounds) {
         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());
         return widgets;
     }
-
+    
     @Override
     public int getDisplayHeight() {
         return 140;
     }
-
+    
     @SuppressWarnings("deprecation")
     @Override
     public int getFixedRecipesPerPage() {

+ 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> {
     private Class<? extends CraftingContainer<?>> containerClass;
-
+    
     public <T extends CraftingContainer<?>> CraftingContainerInfoWrapper(Class<T> containerClass) {
         this.containerClass = containerClass;
     }
-
+    
     public static <T extends CraftingContainer<?>> ContainerInfo<T> create(Class<T> containerClass) {
         return new CraftingContainerInfoWrapper<T>(containerClass);
     }
-
+    
     @Override
     public Class<? extends Container> getContainerClass() {
         return containerClass;
     }
-
+    
     @Override
     public int getCraftingResultSlotIndex(T container) {
         return container.getCraftingResultSlotIndex();
     }
-
+    
     @Override
     public int getCraftingWidth(T container) {
         return container.getCraftingWidth();
     }
-
+    
     @Override
     public int getCraftingHeight(T container) {
         return container.getCraftingHeight();
     }
-
+    
     @Override
     public void clearCraftingSlots(T container) {
         container.clearCraftingSlots();
     }
-
+    
     @Override
     public void populateRecipeFinder(T container, RecipeFinder var1) {
         container.populateRecipeFinder(new net.minecraft.recipe.RecipeFinder() {

+ 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 List<List<EntryStack>> input;
     private List<EntryStack> output;
-
+    
     public DefaultCookingDisplay(AbstractCookingRecipe recipe) {
         this.recipe = recipe;
         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.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
     }
-
+    
     @Override
     public Optional<Identifier> getRecipeLocation() {
         return Optional.ofNullable(recipe).map(AbstractCookingRecipe::getId);
     }
-
+    
     @Override
     public List<List<EntryStack>> getInputEntries() {
         return input;
     }
-
+    
     @Override
     public List<EntryStack> getOutputEntries() {
         return output;
     }
-
+    
     public List<EntryStack> getFuel() {
         return input.get(1);
     }
-
+    
     @Override
     public List<List<EntryStack>> getRequiredEntries() {
         return input;
     }
-
+    
     @Deprecated
     public Optional<AbstractCookingRecipe> getOptionalRecipe() {
         return Optional.ofNullable(recipe);
     }
-
+    
     @Override
     public int getWidth() {
         return 1;
     }
-
+    
     @Override
     public int getHeight() {
         return 1;
     }
-
+    
     @Override
     public List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container) {
         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;
 
 public class DefaultCraftingCategory implements TransferRecipeCategory<DefaultCraftingDisplay> {
-
+    
     @Deprecated
     public static int getSlotWithSize(DefaultCraftingDisplay recipeDisplay, int num) {
         return getSlotWithSize(recipeDisplay, num, 3);
     }
-
+    
     public static int getSlotWithSize(DefaultCraftingDisplay recipeDisplay, int num, int craftingGridWidth) {
         int x = num % recipeDisplay.getWidth();
         int y = (num - x) / recipeDisplay.getWidth();
         return craftingGridWidth * y + x;
     }
-
+    
     @Override
     public Identifier getIdentifier() {
         return DefaultPlugin.CRAFTING;
     }
-
+    
     @Override
     public EntryStack getLogo() {
         return EntryStack.create(Blocks.CRAFTING_TABLE);
     }
-
+    
     @Override
     public String getCategoryName() {
         return I18n.translate("category.rei.crafting");
     }
-
+    
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultCraftingDisplay> recipeDisplaySupplier, Rectangle bounds) {
         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());
         return widgets;
     }
-
+    
     @Override
     public void renderRedSlots(List<Widget> widgets, Rectangle bounds, DefaultCraftingDisplay display, IntList redSlots) {
         ContainerInfo info = ContainerInfoHandler.getContainerInfo(getIdentifier(), ScreenHelper.getLastContainerScreen().getContainer().getClass());

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

@@ -19,24 +19,24 @@ import java.util.List;
 import java.util.Optional;
 
 public interface DefaultCraftingDisplay extends TransferRecipeDisplay {
-
+    
     @Override
     default Identifier getRecipeCategory() {
         return DefaultPlugin.CRAFTING;
     }
-
+    
     @Override
-    default public int getWidth() {
+    default int getWidth() {
         return 2;
     }
-
+    
     @Override
-    default public int getHeight() {
+    default int getHeight() {
         return 2;
     }
-
+    
     Optional<Recipe<?>> getOptionalRecipe();
-
+    
     @Override
     default List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container 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;
 
 public class DefaultCustomDisplay implements DefaultCraftingDisplay {
-
+    
     private List<List<EntryStack>> input;
     private List<EntryStack> output;
     private Recipe<?> possibleRecipe;
     private int width, height;
-
+    
     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));
     }
-
+    
     public DefaultCustomDisplay(Recipe<?> possibleRecipe, List<List<EntryStack>> input, List<EntryStack> output) {
         this.input = input;
         this.output = output;
@@ -43,48 +43,48 @@ public class DefaultCustomDisplay implements DefaultCraftingDisplay {
         this.width = (int) column.stream().filter(Boolean::booleanValue).count();
         this.height = (int) row.stream().filter(Boolean::booleanValue).count();
     }
-
+    
     public DefaultCustomDisplay(List<List<ItemStack>> input, List<ItemStack> output) {
         this(input, output, null);
     }
-
+    
     public Recipe getPossibleRecipe() {
         return possibleRecipe;
     }
-
+    
     @Override
     public Optional<Identifier> getRecipeLocation() {
         return Optional.ofNullable(possibleRecipe).map(Recipe::getId);
     }
-
+    
     @Override
     public List<List<EntryStack>> getInputEntries() {
         return input;
     }
-
+    
     @Override
     public List<EntryStack> getOutputEntries() {
         return output;
     }
-
+    
     @Override
     public List<List<EntryStack>> getRequiredEntries() {
         return input;
     }
-
+    
     @Override
     public int getWidth() {
         return width;
     }
-
+    
     @Override
     public int getHeight() {
         return height;
     }
-
+    
     @Override
     public Optional<Recipe<?>> getOptionalRecipe() {
         return Optional.ofNullable(possibleRecipe);
     }
-
+    
 }

+ 10 - 10
src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapedDisplay.java

@@ -18,11 +18,11 @@ import java.util.Optional;
 import java.util.stream.Collectors;
 
 public class DefaultShapedDisplay implements DefaultCraftingDisplay {
-
+    
     private ShapedRecipe display;
     private List<List<EntryStack>> input;
     private List<EntryStack> output;
-
+    
     public DefaultShapedDisplay(ShapedRecipe recipe) {
         this.display = recipe;
         this.input = recipe.getPreviewInputs().stream().map(i -> {
@@ -34,40 +34,40 @@ public class DefaultShapedDisplay implements DefaultCraftingDisplay {
         }).collect(Collectors.toList());
         this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
     }
-
+    
     @Override
     public Optional<Identifier> getRecipeLocation() {
         return Optional.ofNullable(display).map(ShapedRecipe::getId);
     }
-
+    
     @Override
     public List<List<EntryStack>> getInputEntries() {
         return input;
     }
-
+    
     @Override
     public List<EntryStack> getOutputEntries() {
         return output;
     }
-
+    
     @Override
     public List<List<EntryStack>> getRequiredEntries() {
         return input;
     }
-
+    
     @Override
     public int getHeight() {
         return display.getHeight();
     }
-
+    
     @Override
     public Optional<Recipe<?>> getOptionalRecipe() {
         return Optional.ofNullable(display);
     }
-
+    
     @Override
     public int getWidth() {
         return display.getWidth();
     }
-
+    
 }

+ 10 - 10
src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapelessDisplay.java

@@ -18,11 +18,11 @@ import java.util.Optional;
 import java.util.stream.Collectors;
 
 public class DefaultShapelessDisplay implements DefaultCraftingDisplay {
-
+    
     private ShapelessRecipe display;
     private List<List<EntryStack>> input;
     private List<EntryStack> output;
-
+    
     public DefaultShapelessDisplay(ShapelessRecipe recipe) {
         this.display = recipe;
         this.input = recipe.getPreviewInputs().stream().map(i -> {
@@ -34,44 +34,44 @@ public class DefaultShapelessDisplay implements DefaultCraftingDisplay {
         }).collect(Collectors.toList());
         this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
     }
-
+    
     @Override
     public Optional<Recipe<?>> getOptionalRecipe() {
         return Optional.ofNullable(display);
     }
-
+    
     @Override
     public Optional<Identifier> getRecipeLocation() {
         return Optional.ofNullable(display).map(ShapelessRecipe::getId);
     }
-
+    
     @Override
     public List<List<EntryStack>> getInputEntries() {
         return input;
     }
-
+    
     @Override
     public List<EntryStack> getOutputEntries() {
         return output;
     }
-
+    
     @Override
     public List<List<EntryStack>> getRequiredEntries() {
         return input;
     }
-
+    
     @Override
     public int getWidth() {
         if (display.getPreviewInputs().size() > 4)
             return 3;
         return 2;
     }
-
+    
     @Override
     public int getHeight() {
         if (display.getPreviewInputs().size() > 4)
             return 3;
         return 2;
     }
-
+    
 }

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

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

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

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

+ 6 - 6
src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingCategory.java

@@ -24,22 +24,22 @@ import java.util.List;
 import java.util.function.Supplier;
 
 public class DefaultStoneCuttingCategory implements RecipeCategory<DefaultStoneCuttingDisplay> {
-
+    
     @Override
     public Identifier getIdentifier() {
         return DefaultPlugin.STONE_CUTTING;
     }
-
+    
     @Override
     public EntryStack getLogo() {
         return EntryStack.create(Blocks.STONECUTTER);
     }
-
+    
     @Override
     public String getCategoryName() {
         return I18n.translate("category.rei.stone_cutting");
     }
-
+    
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultStoneCuttingDisplay> recipeDisplaySupplier, Rectangle bounds) {
         Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 13);
@@ -55,10 +55,10 @@ public class DefaultStoneCuttingCategory implements RecipeCategory<DefaultStoneC
         widgets.add(EntryWidget.create(startPoint.x + 61, startPoint.y + 5).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
         return widgets;
     }
-
+    
     @Override
     public int getDisplayHeight() {
         return 36;
     }
-
+    
 }

+ 8 - 8
src/main/java/me/shedaniel/rei/plugin/stripping/DefaultStrippingDisplay.java

@@ -15,37 +15,37 @@ import java.util.Collections;
 import java.util.List;
 
 public class DefaultStrippingDisplay implements RecipeDisplay {
-
+    
     private EntryStack in, out;
-
+    
     public DefaultStrippingDisplay(ItemStack in, ItemStack out) {
         this.in = EntryStack.create(in);
         this.out = EntryStack.create(out);
     }
-
+    
     public final EntryStack getIn() {
         return in;
     }
-
+    
     public final EntryStack getOut() {
         return out;
     }
-
+    
     @Override
     public List<List<EntryStack>> getInputEntries() {
         return Collections.singletonList(Collections.singletonList(in));
     }
-
+    
     @Override
     public List<EntryStack> getOutputEntries() {
         return Collections.singletonList(out);
     }
-
+    
     @Override
     public Identifier getRecipeCategory() {
         return DefaultPlugin.STRIPPING;
     }
-
+    
     @Override
     public List<List<EntryStack>> getRequiredEntries() {
         return getInputEntries();

+ 1 - 1
src/main/java/me/shedaniel/rei/plugin/stripping/DummyAxeItem.java

@@ -15,7 +15,7 @@ public class DummyAxeItem extends AxeItem {
     protected DummyAxeItem(ToolMaterial toolMaterial_1, float float_1, float float_2, Settings item$Settings_1) {
         super(toolMaterial_1, float_1, float_2, item$Settings_1);
     }
-
+    
     public static Map<Block, Block> getStrippedBlocksMap() {
         return STRIPPED_BLOCKS;
     }

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

@@ -9,14 +9,14 @@ import net.minecraft.container.Container;
 
 public interface ContainerInfo<T extends Container> {
     Class<? extends Container> getContainerClass();
-
+    
     int getCraftingResultSlotIndex(T container);
-
+    
     int getCraftingWidth(T container);
-
+    
     int getCraftingHeight(T container);
-
+    
     void clearCraftingSlots(T container);
-
+    
     void populateRecipeFinder(T container, RecipeFinder var1);
 }

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است