Explorar el Código

Bye Bye java.awt

Unknown hace 5 años
padre
commit
1d90835448
Se han modificado 44 ficheros con 107 adiciones y 103 borrados
  1. 1 1
      gradle.properties
  2. 1 1
      src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java
  3. 1 1
      src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java
  4. 1 1
      src/main/java/me/shedaniel/rei/api/DisplayHelper.java
  5. 1 1
      src/main/java/me/shedaniel/rei/api/RecipeCategory.java
  6. 1 1
      src/main/java/me/shedaniel/rei/api/RecipeHelper.java
  7. 1 1
      src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java
  8. 4 4
      src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java
  9. 1 1
      src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java
  10. 11 12
      src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
  11. 4 7
      src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
  12. 2 1
      src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java
  13. 2 1
      src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
  14. 1 1
      src/main/java/me/shedaniel/rei/gui/widget/CategoryBaseWidget.java
  15. 1 1
      src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java
  16. 1 1
      src/main/java/me/shedaniel/rei/gui/widget/CraftableToggleButtonWidget.java
  17. 1 2
      src/main/java/me/shedaniel/rei/gui/widget/DetailedButtonWidget.java
  18. 4 4
      src/main/java/me/shedaniel/rei/gui/widget/DraggableWidget.java
  19. 7 8
      src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java
  20. 1 1
      src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java
  21. 4 4
      src/main/java/me/shedaniel/rei/gui/widget/QueuedTooltip.java
  22. 1 1
      src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
  23. 3 2
      src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java
  24. 1 2
      src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java
  25. 3 3
      src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java
  26. 2 2
      src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java
  27. 1 1
      src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java
  28. 3 2
      src/main/java/me/shedaniel/rei/gui/widget/WidgetWithBounds.java
  29. 1 1
      src/main/java/me/shedaniel/rei/impl/BaseBoundsHandlerImpl.java
  30. 1 1
      src/main/java/me/shedaniel/rei/impl/DisplayHelperImpl.java
  31. 3 4
      src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
  32. 2 3
      src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
  33. 1 1
      src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java
  34. 1 1
      src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java
  35. 4 3
      src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingCategory.java
  36. 3 2
      src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java
  37. 3 2
      src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java
  38. 4 3
      src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java
  39. 4 3
      src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java
  40. 4 3
      src/main/java/me/shedaniel/rei/plugin/smelting/DefaultSmeltingCategory.java
  41. 4 3
      src/main/java/me/shedaniel/rei/plugin/smoking/DefaultSmokingCategory.java
  42. 3 2
      src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingCategory.java
  43. 3 2
      src/main/java/me/shedaniel/rei/plugin/stripping/DefaultStrippingCategory.java
  44. 1 1
      src/main/java/me/shedaniel/rei/server/RecipeFinder.java

+ 1 - 1
gradle.properties

@@ -4,6 +4,6 @@ yarn_version=1.14.3+build.1
 fabricloader_version=0.4.8+build.155
 jankson_version=1.1.0
 cloth_events_version=0.4.0
-cloth_config_version=0.5.2
+cloth_config_version=1.0.0
 modmenu_version=1.5.4-85
 fabric_api=0.3.0+build.198

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

@@ -5,9 +5,9 @@
 
 package me.shedaniel.rei.api;
 
+import me.shedaniel.math.api.Rectangle;
 import net.minecraft.client.gui.screen.Screen;
 
-import java.awt.*;
 import java.util.List;
 import java.util.function.Function;
 

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

@@ -5,7 +5,7 @@
 
 package me.shedaniel.rei.api;
 
-import java.awt.*;
+import me.shedaniel.math.api.Rectangle;
 
 public interface ButtonAreaSupplier {
     

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

@@ -5,10 +5,10 @@
 
 package me.shedaniel.rei.api;
 
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import net.minecraft.util.ActionResult;
 
-import java.awt.*;
 import java.util.List;
 
 import static net.minecraft.util.ActionResult.PASS;

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

@@ -5,6 +5,7 @@
 
 package me.shedaniel.rei.api;
 
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.gui.RecipeViewingScreen;
 import me.shedaniel.rei.gui.renderers.RecipeRenderer;
 import me.shedaniel.rei.gui.widget.CategoryBaseWidget;
@@ -14,7 +15,6 @@ import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.gui.DrawableHelper;
 import net.minecraft.util.Identifier;
 
-import java.awt.*;
 import java.util.Collections;
 import java.util.List;
 import java.util.function.Supplier;

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

@@ -5,6 +5,7 @@
 
 package me.shedaniel.rei.api;
 
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
 import net.minecraft.item.ItemStack;
@@ -12,7 +13,6 @@ import net.minecraft.recipe.Recipe;
 import net.minecraft.recipe.RecipeManager;
 import net.minecraft.util.Identifier;
 
-import java.awt.*;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;

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

@@ -6,9 +6,9 @@
 package me.shedaniel.rei.api;
 
 import it.unimi.dsi.fastutil.ints.IntList;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.gui.widget.Widget;
 
-import java.awt.*;
 import java.util.List;
 
 public interface TransferRecipeCategory<T extends RecipeDisplay> extends RecipeCategory<T> {

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

@@ -7,7 +7,9 @@ package me.shedaniel.rei.gui;
 
 import com.google.common.collect.Lists;
 import com.mojang.blaze3d.platform.GlStateManager;
-import me.shedaniel.cloth.api.ClientUtils;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
+import me.shedaniel.math.impl.PointHelper;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.ClientHelper;
 import me.shedaniel.rei.api.DisplayHelper;
@@ -37,8 +39,6 @@ import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 import net.minecraft.world.GameMode;
 
-import java.awt.*;
-import java.util.List;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -478,7 +478,7 @@ public class ContainerScreenOverlay extends Widget {
     public boolean mouseScrolled(double i, double j, double amount) {
         if (!ScreenHelper.isOverlayVisible())
             return false;
-        if (isInside(ClientUtils.getMouseLocation())) {
+        if (isInside(PointHelper.fromMouse())) {
             if (!RoughlyEnoughItemsCore.getConfigManager().getConfig().isEntryListWidgetScrolled()) {
                 if (amount > 0 && buttonLeft.enabled)
                     buttonLeft.onPressed();

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

@@ -6,6 +6,7 @@
 package me.shedaniel.rei.gui;
 
 import com.google.common.collect.Lists;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.ClientHelper;
 import me.shedaniel.rei.api.RecipeCategory;
@@ -27,7 +28,6 @@ import net.minecraft.text.TranslatableText;
 import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 
-import java.awt.*;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.List;

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

@@ -7,7 +7,8 @@ package me.shedaniel.rei.gui;
 
 import com.google.common.collect.Lists;
 import com.mojang.blaze3d.platform.GlStateManager;
-import me.shedaniel.cloth.api.ClientUtils;
+import me.shedaniel.math.api.Rectangle;
+import me.shedaniel.math.impl.PointHelper;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.*;
 import me.shedaniel.rei.gui.widget.*;
@@ -27,8 +28,6 @@ import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
-import java.awt.*;
-import java.util.List;
 import java.util.*;
 import java.util.function.Supplier;
 
@@ -143,7 +142,7 @@ public class RecipeViewingScreen extends Screen {
             }
         });
         w.enabled = w2.enabled = categories.size() > TABS_PER_PAGE;
-        widgets.add(categoryBack = new ButtonWidget((int) bounds.getX() + 5, (int) bounds.getY() + 5, 12, 12, new TranslatableText("text.rei.left_arrow")) {
+        widgets.add(categoryBack = new ButtonWidget(bounds.getX() + 5, bounds.getY() + 5, 12, 12, new TranslatableText("text.rei.left_arrow")) {
             @Override
             public void onPressed() {
                 int currentCategoryIndex = categories.indexOf(selectedCategory);
@@ -161,7 +160,7 @@ public class RecipeViewingScreen extends Screen {
                 return Optional.ofNullable(I18n.translate("text.rei.previous_category"));
             }
         });
-        widgets.add(new ClickableLabelWidget((int) bounds.getCenterX(), (int) bounds.getY() + 7, "") {
+        widgets.add(new ClickableLabelWidget(bounds.getCenterX(), bounds.getY() + 7, "") {
             @Override
             public void render(int mouseX, int mouseY, float delta) {
                 this.text = selectedCategory.getCategoryName();
@@ -179,7 +178,7 @@ public class RecipeViewingScreen extends Screen {
                 ClientHelper.getInstance().executeViewAllRecipesKeyBind();
             }
         });
-        widgets.add(categoryNext = new ButtonWidget((int) bounds.getMaxX() - 17, (int) bounds.getY() + 5, 12, 12, new TranslatableText("text.rei.right_arrow")) {
+        widgets.add(categoryNext = new ButtonWidget(bounds.getMaxX() - 17, bounds.getY() + 5, 12, 12, new TranslatableText("text.rei.right_arrow")) {
             @Override
             public void onPressed() {
                 int currentCategoryIndex = categories.indexOf(selectedCategory);
@@ -200,7 +199,7 @@ public class RecipeViewingScreen extends Screen {
         categoryBack.enabled = categories.size() > 1;
         categoryNext.enabled = categories.size() > 1;
         
-        widgets.add(recipeBack = new ButtonWidget((int) bounds.getX() + 5, (int) bounds.getY() + 21, 12, 12, new TranslatableText("text.rei.left_arrow")) {
+        widgets.add(recipeBack = new ButtonWidget(bounds.getX() + 5, bounds.getY() + 21, 12, 12, new TranslatableText("text.rei.left_arrow")) {
             @Override
             public void onPressed() {
                 page--;
@@ -214,7 +213,7 @@ public class RecipeViewingScreen extends Screen {
                 return Optional.ofNullable(I18n.translate("text.rei.previous_page"));
             }
         });
-        widgets.add(new ClickableLabelWidget((int) bounds.getCenterX(), (int) bounds.getY() + 23, "", categoriesMap.get(selectedCategory).size() > getRecipesPerPageByHeight()) {
+        widgets.add(new ClickableLabelWidget(bounds.getCenterX(), bounds.getY() + 23, "", categoriesMap.get(selectedCategory).size() > getRecipesPerPageByHeight()) {
             @Override
             public void render(int mouseX, int mouseY, float delta) {
                 this.text = String.format("%d/%d", page + 1, getTotalPages(selectedCategory));
@@ -233,7 +232,7 @@ public class RecipeViewingScreen extends Screen {
                 RecipeViewingScreen.this.init();
             }
         });
-        widgets.add(recipeNext = new ButtonWidget((int) bounds.getMaxX() - 17, (int) bounds.getY() + 21, 12, 12, new TranslatableText("text.rei.right_arrow")) {
+        widgets.add(recipeNext = new ButtonWidget(bounds.getMaxX() - 17, bounds.getY() + 21, 12, 12, new TranslatableText("text.rei.right_arrow")) {
             @Override
             public void onPressed() {
                 page++;
@@ -277,7 +276,7 @@ public class RecipeViewingScreen extends Screen {
             int finalI = i;
             final Supplier<RecipeDisplay> displaySupplier = () -> currentDisplayed.get(finalI);
             int displayWidth = selectedCategory.getDisplayWidth(displaySupplier.get());
-            final Rectangle displayBounds = new Rectangle((int) getBounds().getCenterX() - displayWidth / 2, getBounds().y + 40 + recipeHeight * i + 7 * i, displayWidth, recipeHeight);
+            final Rectangle displayBounds = new Rectangle(getBounds().getCenterX() - displayWidth / 2, getBounds().y + 40 + recipeHeight * i + 7 * i, displayWidth, recipeHeight);
             List<Widget> setupDisplay = selectedCategory.setupDisplay(displaySupplier, displayBounds);
             this.widgets.addAll(setupDisplay);
             if (supplier.isPresent() && supplier.get().get(displayBounds) != null)
@@ -439,13 +438,13 @@ public class RecipeViewingScreen extends Screen {
         for (Element listener : children())
             if (listener.mouseScrolled(i, j, amount))
                 return true;
-        if (getBounds().contains(ClientUtils.getMouseLocation())) {
+        if (getBounds().contains(PointHelper.fromMouse())) {
             if (amount > 0 && recipeBack.enabled)
                 recipeBack.onPressed();
             else if (amount < 0 && recipeNext.enabled)
                 recipeNext.onPressed();
         }
-        if ((new Rectangle(bounds.x, bounds.y - 28, bounds.width, 28)).contains(ClientUtils.getMouseLocation())) {
+        if ((new Rectangle(bounds.x, bounds.y - 28, bounds.width, 28)).contains(PointHelper.fromMouse())) {
             if (amount > 0 && categoryBack.enabled)
                 categoryBack.onPressed();
             else if (amount < 0 && categoryNext.enabled)

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

@@ -9,7 +9,9 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.mojang.blaze3d.platform.GlStateManager;
 import com.zeitheron.hammercore.client.utils.Scissors;
-import me.shedaniel.cloth.api.ClientUtils;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
+import me.shedaniel.math.impl.PointHelper;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.*;
 import me.shedaniel.rei.gui.renderers.RecipeRenderer;
@@ -31,7 +33,6 @@ import net.minecraft.text.TranslatableText;
 import net.minecraft.util.Formatting;
 import net.minecraft.util.math.MathHelper;
 
-import java.awt.*;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -276,7 +277,7 @@ public class VillagerRecipeViewingScreen extends Screen {
         for (Element listener : children())
             if (listener.mouseScrolled(double_1, double_2, double_3))
                 return true;
-        if (bounds.contains(ClientUtils.getMouseLocation())) {
+        if (bounds.contains(PointHelper.fromMouse())) {
             if (double_3 < 0 && categoryMap.get(categories.get(selectedCategoryIndex)).size() > 1) {
                 selectedRecipeIndex++;
                 if (selectedRecipeIndex >= categoryMap.get(categories.get(selectedCategoryIndex)).size())
@@ -395,10 +396,6 @@ public class VillagerRecipeViewingScreen extends Screen {
         return super.mouseDragged(mouseX, mouseY, int_1, double_3, double_4);
     }
     
-    private int getReal(int i) {
-        return (int) (i / ((double) minecraft.window.getScaledWidth() / (double) minecraft.window.getWidth()));
-    }
-    
     @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()) {

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

@@ -7,6 +7,8 @@ package me.shedaniel.rei.gui.widget;
 
 import com.mojang.blaze3d.platform.GlStateManager;
 import it.unimi.dsi.fastutil.ints.IntList;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.*;
 import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
@@ -15,7 +17,6 @@ import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
-import java.awt.*;
 import java.util.List;
 import java.util.Optional;
 import java.util.function.Supplier;

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

@@ -6,6 +6,8 @@
 package me.shedaniel.rei.gui.widget;
 
 import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.gui.Element;
 import net.minecraft.client.sound.PositionedSoundInstance;
@@ -14,7 +16,6 @@ import net.minecraft.text.Text;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
-import java.awt.*;
 import java.util.Collections;
 import java.util.List;
 import java.util.Optional;

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

@@ -5,7 +5,7 @@
 
 package me.shedaniel.rei.gui.widget;
 
-import java.awt.*;
+import me.shedaniel.math.api.Rectangle;
 
 public class CategoryBaseWidget extends RecipeBaseWidget {
     

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

@@ -5,10 +5,10 @@
 
 package me.shedaniel.rei.gui.widget;
 
+import me.shedaniel.math.api.Point;
 import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.util.Formatting;
 
-import java.awt.*;
 import java.util.Optional;
 
 public abstract class ClickableLabelWidget extends LabelWidget {

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

@@ -6,6 +6,7 @@
 package me.shedaniel.rei.gui.widget;
 
 import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import net.minecraft.block.Blocks;
 import net.minecraft.client.MinecraftClient;
@@ -15,7 +16,6 @@ import net.minecraft.client.resource.language.I18n;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.Identifier;
 
-import java.awt.*;
 import java.util.Optional;
 
 public abstract class CraftableToggleButtonWidget extends ButtonWidget {

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

@@ -5,10 +5,9 @@
 
 package me.shedaniel.rei.gui.widget;
 
+import me.shedaniel.math.api.Rectangle;
 import net.minecraft.text.Text;
 
-import java.awt.*;
-
 public class DetailedButtonWidget extends ButtonWidget {
     
     private DetailedButtonWidget.PressAction pressAction;

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

@@ -5,13 +5,13 @@
 
 package me.shedaniel.rei.gui.widget;
 
-import me.shedaniel.cloth.api.ClientUtils;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
+import me.shedaniel.math.impl.PointHelper;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.Element;
 import net.minecraft.client.util.Window;
 
-import java.awt.*;
-
 public abstract class DraggableWidget extends WidgetWithBounds {
     
     public boolean dragged = false;
@@ -40,7 +40,7 @@ public abstract class DraggableWidget extends WidgetWithBounds {
     
     @Override
     public boolean mouseDragged(double double_1, double double_2, int int_1, double double_3, double double_4) {
-        Point mouse = ClientUtils.getMouseLocation();
+        Point mouse = PointHelper.fromMouse();
         if (int_1 == 0) {
             if (!dragged) {
                 if (getGrabBounds().contains(mouse)) {

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

@@ -8,8 +8,9 @@ package me.shedaniel.rei.gui.widget;
 import com.google.common.collect.Lists;
 import com.mojang.blaze3d.platform.GlStateManager;
 import com.zeitheron.hammercore.client.utils.Scissors;
-import me.shedaniel.cloth.api.ClientUtils;
 import me.shedaniel.clothconfig2.api.RunSixtyTimesEverySec;
+import me.shedaniel.math.api.Rectangle;
+import me.shedaniel.math.impl.PointHelper;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.*;
 import me.shedaniel.rei.gui.config.ItemCheatingMode;
@@ -31,8 +32,6 @@ import net.minecraft.util.math.MathHelper;
 import net.minecraft.util.registry.Registry;
 import org.apache.commons.lang3.StringUtils;
 
-import java.awt.*;
-import java.util.List;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
@@ -265,7 +264,7 @@ public class EntryListWidget extends Widget {
             Scissors.end();
         GlStateManager.popMatrix();
         ClientPlayerEntity player = minecraft.player;
-        if (rectangle.contains(ClientUtils.getMouseLocation()) && ClientHelper.getInstance().isCheating() && !player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets())
+        if (rectangle.contains(PointHelper.fromMouse()) && ClientHelper.getInstance().isCheating() && !player.inventory.getCursorStack().isEmpty() && RoughlyEnoughItemsCore.hasPermissionToUsePackets())
             ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(I18n.translate("text.rei.delete_items")));
     }
     
@@ -276,9 +275,9 @@ public class EntryListWidget extends Widget {
         calculateListSize(rectangle);
         if (currentDisplayed.isEmpty() || processSearchTerm)
             currentDisplayed = processSearchTerm(searchTerm, RoughlyEnoughItemsCore.getEntryRegistry().getEntryList(), new ArrayList<>(ScreenHelper.inventoryStacks));
-        int startX = (int) rectangle.getCenterX() - width * 9;
-        int startY = (int) rectangle.getCenterY() - height * 9;
-        this.listArea = new Rectangle((int) startX, (int) startY, width * 18, height * 18);
+        int startX = rectangle.getCenterX() - width * 9;
+        int startY = rectangle.getCenterY() - height * 9;
+        this.listArea = new Rectangle(startX, startY, width * 18, height * 18);
         int fitSlotsPerPage = getTotalFitSlotsPerPage(startX, startY, listArea);
         int j = page * fitSlotsPerPage;
         if (RoughlyEnoughItemsCore.getConfigManager().getConfig().isEntryListWidgetScrolled()) {
@@ -371,7 +370,7 @@ public class EntryListWidget extends Widget {
     
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
-        if (rectangle.contains(ClientUtils.getMouseLocation()))
+        if (rectangle.contains(PointHelper.fromMouse()))
             for (Widget widget : widgets)
                 if (widget.keyPressed(int_1, int_2, int_3))
                     return true;

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

@@ -5,9 +5,9 @@
 
 package me.shedaniel.rei.gui.widget;
 
+import me.shedaniel.math.api.Rectangle;
 import net.minecraft.client.gui.Element;
 
-import java.awt.*;
 import java.util.Collections;
 import java.util.List;
 

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

@@ -7,9 +7,9 @@ package me.shedaniel.rei.gui.widget;
 
 
 import com.google.common.collect.Lists;
-import me.shedaniel.cloth.api.ClientUtils;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.impl.PointHelper;
 
-import java.awt.*;
 import java.util.Collections;
 import java.util.List;
 import java.util.function.Consumer;
@@ -34,11 +34,11 @@ public class QueuedTooltip {
     }
     
     public static QueuedTooltip create(List<String> text) {
-        return QueuedTooltip.create(ClientUtils.getMouseLocation(), text);
+        return QueuedTooltip.create(PointHelper.fromMouse(), text);
     }
     
     public static QueuedTooltip create(String... text) {
-        return QueuedTooltip.create(ClientUtils.getMouseLocation(), text);
+        return QueuedTooltip.create(PointHelper.fromMouse(), text);
     }
     
     @Deprecated

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

@@ -6,13 +6,13 @@
 package me.shedaniel.rei.gui.widget;
 
 import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.gui.config.RecipeScreenType;
 import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.client.render.GuiLighting;
 import net.minecraft.util.Identifier;
 
-import java.awt.*;
 import java.util.Collections;
 import java.util.List;
 

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

@@ -7,6 +7,8 @@ package me.shedaniel.rei.gui.widget;
 
 import com.google.common.collect.Lists;
 import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.ConfigManager;
 import me.shedaniel.rei.gui.RecipeViewingScreen;
@@ -19,7 +21,6 @@ import net.minecraft.client.resource.language.I18n;
 import net.minecraft.client.util.Window;
 import net.minecraft.util.math.MathHelper;
 
-import java.awt.*;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.List;
@@ -47,7 +48,7 @@ public class RecipeChoosePageWidget extends DraggableWidget {
     private static Point getPointFromConfig() {
         Window window = MinecraftClient.getInstance().window;
         ConfigObjectImpl.RelativePoint point = RoughlyEnoughItemsCore.getConfigManager().getConfig().getChoosePageDialogPoint();
-        return new Point((int) point.getX(window.getScaledWidth()), (int) point.getY(window.getScaledHeight()));
+        return new Point(point.getX(window.getScaledWidth()), point.getY(window.getScaledHeight()));
     }
     
     @Override

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

@@ -5,10 +5,9 @@
 
 package me.shedaniel.rei.gui.widget;
 
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.impl.ScreenHelper;
 
-import java.awt.*;
-
 public class SlotBaseWidget extends RecipeBaseWidget {
     
     public SlotBaseWidget(Rectangle bounds) {

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

@@ -7,7 +7,8 @@ package me.shedaniel.rei.gui.widget;
 
 import com.google.common.collect.Lists;
 import com.mojang.blaze3d.platform.GlStateManager;
-import me.shedaniel.cloth.api.ClientUtils;
+import me.shedaniel.math.api.Rectangle;
+import me.shedaniel.math.impl.PointHelper;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.ClientHelper;
 import me.shedaniel.rei.api.Renderer;
@@ -21,7 +22,6 @@ import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 import net.minecraft.util.registry.Registry;
 
-import java.awt.*;
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
@@ -253,7 +253,7 @@ public class SlotWidget extends WidgetWithBounds {
     public boolean keyPressed(int int_1, int int_2, int int_3) {
         if (!clickToMoreRecipes)
             return false;
-        if (isCurrentRendererItem() && getBounds().contains(ClientUtils.getMouseLocation()))
+        if (isCurrentRendererItem() && getBounds().contains(PointHelper.fromMouse()))
             if (ClientHelper.getInstance().getRecipeKeyBinding().matchesKey(int_1, int_2))
                 return ClientHelper.getInstance().executeRecipeKeyBind(getCurrentItemStack());
             else if (ClientHelper.getInstance().getUsageKeyBinding().matchesKey(int_1, int_2))

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

@@ -6,6 +6,7 @@
 package me.shedaniel.rei.gui.widget;
 
 import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.ClientHelper;
 import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.Renderer;
@@ -14,7 +15,6 @@ import net.minecraft.client.render.GuiLighting;
 import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 
-import java.awt.*;
 import java.util.Collections;
 import java.util.List;
 
@@ -77,7 +77,7 @@ public class TabWidget extends WidgetWithBounds {
             minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? CHEST_GUI_TEXTURE_DARK : CHEST_GUI_TEXTURE);
             this.blit(bounds.x, bounds.y + 2, selected ? 28 : 0, 192, 28, (selected ? 30 : 27));
             renderer.setBlitOffset(100);
-            renderer.render((int) bounds.getCenterX(), (int) bounds.getCenterY(), mouseX, mouseY, delta);
+            renderer.render(bounds.getCenterX(), bounds.getCenterY(), mouseX, mouseY, delta);
             if (containsMouse(mouseX, mouseY)) {
                 drawTooltip();
             }

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

@@ -7,6 +7,7 @@ package me.shedaniel.rei.gui.widget;
 
 import com.google.common.base.Predicates;
 import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.math.api.Rectangle;
 import net.minecraft.SharedConstants;
 import net.minecraft.client.gui.screen.Screen;
 import net.minecraft.client.render.BufferBuilder;
@@ -14,7 +15,6 @@ import net.minecraft.client.render.Tessellator;
 import net.minecraft.client.render.VertexFormats;
 import net.minecraft.util.math.MathHelper;
 
-import java.awt.*;
 import java.util.Collections;
 import java.util.List;
 import java.util.function.BiFunction;

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

@@ -5,11 +5,12 @@
 
 package me.shedaniel.rei.gui.widget;
 
-import java.awt.*;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 
 public abstract class WidgetWithBounds extends Widget {
     
-    abstract public Shape getBounds();
+    abstract public Rectangle getBounds();
     
     public final boolean containsMouse(int mouseX, int mouseY) {
         return containsMouse((double) mouseX, (double) mouseY);

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

@@ -6,6 +6,7 @@
 package me.shedaniel.rei.impl;
 
 import com.google.common.collect.Lists;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.BaseBoundsHandler;
 import me.shedaniel.rei.api.DisplayHelper;
@@ -14,7 +15,6 @@ import net.minecraft.client.gui.screen.Screen;
 import net.minecraft.util.ActionResult;
 import net.minecraft.util.Pair;
 
-import java.awt.*;
 import java.util.Comparator;
 import java.util.List;
 import java.util.function.Function;

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

@@ -7,10 +7,10 @@ package me.shedaniel.rei.impl;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.BaseBoundsHandler;
 import me.shedaniel.rei.api.DisplayHelper;
 
-import java.awt.*;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Map;

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

@@ -7,6 +7,7 @@ package me.shedaniel.rei.impl;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.*;
 import me.shedaniel.rei.api.plugins.REIPluginV0;
@@ -20,8 +21,6 @@ import net.minecraft.recipe.RecipeManager;
 import net.minecraft.util.ActionResult;
 import net.minecraft.util.Identifier;
 
-import java.awt.*;
-import java.util.List;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Function;
@@ -198,7 +197,7 @@ public class RecipeHelperImpl implements RecipeHelper {
     @Override
     public Optional<ButtonAreaSupplier> getSpeedCraftButtonArea(RecipeCategory category) {
         if (!speedCraftAreaSupplierMap.containsKey(category.getIdentifier()))
-            return Optional.ofNullable(bounds -> new Rectangle((int) bounds.getMaxX() - 16, (int) bounds.getMaxY() - 16, 10, 10));
+            return Optional.ofNullable(bounds -> new Rectangle(bounds.getMaxX() - 16, bounds.getMaxY() - 16, 10, 10));
         return Optional.ofNullable(speedCraftAreaSupplierMap.get(category.getIdentifier()));
     }
     
@@ -214,7 +213,7 @@ public class RecipeHelperImpl implements RecipeHelper {
     @SuppressWarnings("deprecation")
     @Override
     public void registerDefaultSpeedCraftButtonArea(Identifier category) {
-        registerSpeedCraftButtonArea(category, bounds -> new Rectangle((int) bounds.getMaxX() - 16, (int) bounds.getMaxY() - 16, 10, 10));
+        registerSpeedCraftButtonArea(category, bounds -> new Rectangle(bounds.getMaxX() - 16, bounds.getMaxY() - 16, 10, 10));
     }
     
     @SuppressWarnings("deprecation")

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

@@ -7,6 +7,7 @@ package me.shedaniel.rei.plugin;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.DisplayHelper;
 import me.shedaniel.rei.api.Entry;
@@ -55,8 +56,6 @@ import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 import net.minecraft.util.registry.Registry;
 
-import java.awt.*;
-import java.util.List;
 import java.util.*;
 
 public class DefaultPlugin implements REIPluginV0 {
@@ -303,7 +302,7 @@ public class DefaultPlugin implements REIPluginV0 {
         recipeHelper.registerWorkingStations(STONE_CUTTING, new ItemStack(Items.STONECUTTER));
         recipeHelper.registerWorkingStations(COMPOSTING, new ItemStack(Items.COMPOSTER));
         recipeHelper.registerSpeedCraftButtonArea(COMPOSTING, bounds -> null);
-        recipeHelper.registerSpeedCraftButtonArea(DefaultPlugin.CAMPFIRE, bounds -> new Rectangle((int) bounds.getMaxX() - 16, bounds.y + 6, 10, 10));
+        recipeHelper.registerSpeedCraftButtonArea(DefaultPlugin.CAMPFIRE, bounds -> new Rectangle(bounds.getMaxX() - 16, bounds.y + 6, 10, 10));
         recipeHelper.registerScreenClickArea(new Rectangle(88, 32, 28, 23), CraftingTableScreen.class, CRAFTING);
         recipeHelper.registerScreenClickArea(new Rectangle(137, 29, 10, 13), InventoryScreen.class, CRAFTING);
         recipeHelper.registerScreenClickArea(new Rectangle(97, 16, 14, 30), BrewingStandScreen.class, BREWING);

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

@@ -6,6 +6,7 @@
 package me.shedaniel.rei.plugin;
 
 import com.google.common.collect.Ordering;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.impl.ScreenHelper;
 import me.shedaniel.rei.listeners.AbstractInventoryScreenHooks;
 import me.shedaniel.rei.listeners.ContainerScreenHooks;
@@ -13,7 +14,6 @@ import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen;
 import net.minecraft.entity.effect.StatusEffectInstance;
 
-import java.awt.*;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;

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

@@ -6,6 +6,7 @@
 package me.shedaniel.rei.plugin;
 
 import com.google.common.collect.Lists;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.impl.ScreenHelper;
 import me.shedaniel.rei.listeners.ContainerScreenHooks;
 import net.minecraft.client.MinecraftClient;
@@ -13,7 +14,6 @@ import net.minecraft.client.gui.screen.recipebook.RecipeBookProvider;
 import net.minecraft.client.recipe.book.ClientRecipeBook;
 import net.minecraft.container.CraftingContainer;
 
-import java.awt.*;
 import java.util.Collections;
 import java.util.List;
 import java.util.function.Function;

+ 4 - 3
src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingCategory.java

@@ -7,6 +7,8 @@ package me.shedaniel.rei.plugin.blasting;
 
 import com.mojang.blaze3d.platform.GlStateManager;
 import it.unimi.dsi.fastutil.ints.IntList;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.Renderer;
 import me.shedaniel.rei.api.TransferRecipeCategory;
 import me.shedaniel.rei.gui.renderers.RecipeRenderer;
@@ -24,7 +26,6 @@ import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
-import java.awt.*;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.LinkedList;
@@ -56,7 +57,7 @@ public class DefaultBlastingCategory implements TransferRecipeCategory<DefaultBl
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultBlastingDisplay> recipeDisplaySupplier, Rectangle bounds) {
         final DefaultBlastingDisplay recipeDisplay = recipeDisplaySupplier.get();
-        Point startPoint = new Point((int) bounds.getCenterX() - 41, (int) bounds.getCenterY() - 27);
+        Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
         List<Widget> widgets = new LinkedList<>(Arrays.asList(new RecipeBaseWidget(bounds) {
             @Override
             public void render(int mouseX, int mouseY, float delta) {
@@ -85,7 +86,7 @@ public class DefaultBlastingCategory implements TransferRecipeCategory<DefaultBl
     
     @Override
     public void renderRedSlots(List<Widget> widgets, Rectangle bounds, DefaultBlastingDisplay display, IntList redSlots) {
-        Point startPoint = new Point((int) bounds.getCenterX() - 41, (int) bounds.getCenterY() - 27);
+        Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
         GlStateManager.translatef(0, 0, 400);
         if (redSlots.contains(0)) {
             DrawableHelper.fill(startPoint.x + 1, startPoint.y + 1, startPoint.x + 1 + 16, startPoint.y + 1 + 16, 0x30ff0000);

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

@@ -6,6 +6,8 @@
 package me.shedaniel.rei.plugin.brewing;
 
 import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.Renderer;
 import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
@@ -22,7 +24,6 @@ import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
-import java.awt.*;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.LinkedList;
@@ -49,7 +50,7 @@ public class DefaultBrewingCategory implements RecipeCategory<DefaultBrewingDisp
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultBrewingDisplay> recipeDisplaySupplier, Rectangle bounds) {
         final DefaultBrewingDisplay recipeDisplay = recipeDisplaySupplier.get();
-        Point startPoint = new Point((int) bounds.getCenterX() - 52, (int) bounds.getCenterY() - 29);
+        Point startPoint = new Point(bounds.getCenterX() - 52, bounds.getCenterY() - 29);
         List<Widget> widgets = new LinkedList<>(Arrays.asList(new RecipeBaseWidget(bounds) {
             @Override
             public void render(int mouseX, int mouseY, float delta) {

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

@@ -6,6 +6,8 @@
 package me.shedaniel.rei.plugin.campfire;
 
 import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.Renderer;
 import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
@@ -21,7 +23,6 @@ import net.minecraft.item.ItemStack;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
-import java.awt.*;
 import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
@@ -46,7 +47,7 @@ public class DefaultCampfireCategory implements RecipeCategory<DefaultCampfireDi
     
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultCampfireDisplay> recipeDisplaySupplier, Rectangle bounds) {
-        Point startPoint = new Point((int) bounds.getCenterX() - 41, (int) bounds.getCenterY() - 27);
+        Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
         List<Widget> widgets = new LinkedList<>(Arrays.asList(new RecipeBaseWidget(bounds) {
             @Override
             public void render(int mouseX, int mouseY, float delta) {

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

@@ -7,6 +7,8 @@ package me.shedaniel.rei.plugin.composting;
 
 import com.google.common.collect.Lists;
 import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.Renderer;
 import me.shedaniel.rei.gui.renderers.RecipeRenderer;
@@ -23,7 +25,6 @@ import net.minecraft.item.ItemStack;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
-import java.awt.*;
 import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
@@ -78,7 +79,7 @@ public class DefaultCompostingCategory implements RecipeCategory<DefaultComposti
         int i = 0;
         for (int y = 0; y < 6; y++)
             for (int x = 0; x < 8; x++) {
-                widgets.add(new SlotWidget((int) bounds.getCenterX() - 72 + x * 18, bounds.y + y * 18, stacks.size() > i ? Renderer.fromItemStack(stacks.get(i).asItem().getStackForRender()) : Renderer.empty(), true, true, true) {
+                widgets.add(new SlotWidget(bounds.getCenterX() - 72 + x * 18, bounds.y + y * 18, stacks.size() > i ? Renderer.fromItemStack(stacks.get(i).asItem().getStackForRender()) : Renderer.empty(), true, true, true) {
                     @Override
                     protected List<String> getExtraItemToolTips(ItemStack stack) {
                         final List<String>[] thing = new List[]{null};
@@ -93,7 +94,7 @@ public class DefaultCompostingCategory implements RecipeCategory<DefaultComposti
                 });
                 i++;
             }
-        widgets.add(new SlotWidget((int) startingPoint.x + 34, startingPoint.y + 5, Renderer.fromItemStacks(recipeDisplaySupplier.get().getOutput()), false, true, true));
+        widgets.add(new SlotWidget(startingPoint.x + 34, startingPoint.y + 5, Renderer.fromItemStacks(recipeDisplaySupplier.get().getOutput()), false, true, true));
         return widgets;
     }
     

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

@@ -8,6 +8,8 @@ package me.shedaniel.rei.plugin.crafting;
 import com.google.common.collect.Lists;
 import com.mojang.blaze3d.platform.GlStateManager;
 import it.unimi.dsi.fastutil.ints.IntList;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.Renderer;
 import me.shedaniel.rei.api.TransferRecipeCategory;
 import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
@@ -22,7 +24,6 @@ import net.minecraft.client.resource.language.I18n;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.Identifier;
 
-import java.awt.*;
 import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
@@ -68,7 +69,7 @@ public class DefaultCraftingCategory implements TransferRecipeCategory<DefaultCr
     
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultCraftingDisplay> recipeDisplaySupplier, Rectangle bounds) {
-        Point startPoint = new Point((int) bounds.getCenterX() - 58, (int) bounds.getCenterY() - 27);
+        Point startPoint = new Point(bounds.getCenterX() - 58, bounds.getCenterY() - 27);
         List<Widget> widgets = new LinkedList<>(Arrays.asList(new RecipeBaseWidget(bounds) {
             @Override
             public void render(int mouseX, int mouseY, float delta) {
@@ -98,7 +99,7 @@ public class DefaultCraftingCategory implements TransferRecipeCategory<DefaultCr
     
     @Override
     public void renderRedSlots(List<Widget> widgets, Rectangle bounds, DefaultCraftingDisplay display, IntList redSlots) {
-        Point startPoint = new Point((int) bounds.getCenterX() - 58, (int) bounds.getCenterY() - 27);
+        Point startPoint = new Point(bounds.getCenterX() - 58, bounds.getCenterY() - 27);
         GlStateManager.translatef(0, 0, 400);
         for (Integer slot : redSlots) {
             int i = getSlotWithSize(display, slot);

+ 4 - 3
src/main/java/me/shedaniel/rei/plugin/smelting/DefaultSmeltingCategory.java

@@ -7,6 +7,8 @@ package me.shedaniel.rei.plugin.smelting;
 
 import com.mojang.blaze3d.platform.GlStateManager;
 import it.unimi.dsi.fastutil.ints.IntList;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.Renderer;
 import me.shedaniel.rei.api.TransferRecipeCategory;
 import me.shedaniel.rei.gui.renderers.RecipeRenderer;
@@ -24,7 +26,6 @@ import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
-import java.awt.*;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.LinkedList;
@@ -55,7 +56,7 @@ public class DefaultSmeltingCategory implements TransferRecipeCategory<DefaultSm
     
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultSmeltingDisplay> recipeDisplaySupplier, Rectangle bounds) {
-        Point startPoint = new Point((int) bounds.getCenterX() - 41, (int) bounds.getCenterY() - 27);
+        Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
         List<Widget> widgets = new LinkedList<>(Arrays.asList(new RecipeBaseWidget(bounds) {
             @Override
             public void render(int mouseX, int mouseY, float delta) {
@@ -84,7 +85,7 @@ public class DefaultSmeltingCategory implements TransferRecipeCategory<DefaultSm
     
     @Override
     public void renderRedSlots(List<Widget> widgets, Rectangle bounds, DefaultSmeltingDisplay display, IntList redSlots) {
-        Point startPoint = new Point((int) bounds.getCenterX() - 41, (int) bounds.getCenterY() - 27);
+        Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
         GlStateManager.translatef(0, 0, 400);
         if (redSlots.contains(0)) {
             DrawableHelper.fill(startPoint.x + 1, startPoint.y + 1, startPoint.x + 1 + 16, startPoint.y + 1 + 16, 0x30ff0000);

+ 4 - 3
src/main/java/me/shedaniel/rei/plugin/smoking/DefaultSmokingCategory.java

@@ -7,6 +7,8 @@ package me.shedaniel.rei.plugin.smoking;
 
 import com.mojang.blaze3d.platform.GlStateManager;
 import it.unimi.dsi.fastutil.ints.IntList;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.Renderer;
 import me.shedaniel.rei.api.TransferRecipeCategory;
 import me.shedaniel.rei.gui.renderers.RecipeRenderer;
@@ -24,7 +26,6 @@ import net.minecraft.util.Formatting;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
-import java.awt.*;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.LinkedList;
@@ -55,7 +56,7 @@ public class DefaultSmokingCategory implements TransferRecipeCategory<DefaultSmo
     
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultSmokingDisplay> recipeDisplaySupplier, Rectangle bounds) {
-        Point startPoint = new Point((int) bounds.getCenterX() - 41, (int) bounds.getCenterY() - 27);
+        Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
         List<Widget> widgets = new LinkedList<>(Arrays.asList(new RecipeBaseWidget(bounds) {
             @Override
             public void render(int mouseX, int mouseY, float delta) {
@@ -84,7 +85,7 @@ public class DefaultSmokingCategory implements TransferRecipeCategory<DefaultSmo
     
     @Override
     public void renderRedSlots(List<Widget> widgets, Rectangle bounds, DefaultSmokingDisplay display, IntList redSlots) {
-        Point startPoint = new Point((int) bounds.getCenterX() - 41, (int) bounds.getCenterY() - 27);
+        Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
         GlStateManager.translatef(0, 0, 400);
         if (redSlots.contains(0)) {
             DrawableHelper.fill(startPoint.x + 1, startPoint.y + 1, startPoint.x + 1 + 16, startPoint.y + 1 + 16, 0x30ff0000);

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

@@ -6,6 +6,8 @@
 package me.shedaniel.rei.plugin.stonecutting;
 
 import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.Renderer;
 import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
@@ -19,7 +21,6 @@ import net.minecraft.client.resource.language.I18n;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.Identifier;
 
-import java.awt.*;
 import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
@@ -44,7 +45,7 @@ public class DefaultStoneCuttingCategory implements RecipeCategory<DefaultStoneC
     
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultStoneCuttingDisplay> recipeDisplaySupplier, Rectangle bounds) {
-        Point startPoint = new Point((int) bounds.getCenterX() - 41, (int) bounds.getCenterY() - 13);
+        Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 13);
         List<Widget> widgets = new LinkedList<>(Arrays.asList(new RecipeBaseWidget(bounds) {
             @Override
             public void render(int mouseX, int mouseY, float delta) {

+ 3 - 2
src/main/java/me/shedaniel/rei/plugin/stripping/DefaultStrippingCategory.java

@@ -6,6 +6,8 @@
 package me.shedaniel.rei.plugin.stripping;
 
 import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.math.api.Point;
+import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.Renderer;
 import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
@@ -19,7 +21,6 @@ import net.minecraft.item.ItemStack;
 import net.minecraft.item.Items;
 import net.minecraft.util.Identifier;
 
-import java.awt.*;
 import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
@@ -44,7 +45,7 @@ public class DefaultStrippingCategory implements RecipeCategory<DefaultStripping
     
     @Override
     public List<Widget> setupDisplay(Supplier<DefaultStrippingDisplay> recipeDisplaySupplier, Rectangle bounds) {
-        Point startPoint = new Point((int) bounds.getCenterX() - 41, (int) bounds.getCenterY() - 13);
+        Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 13);
         List<Widget> widgets = new LinkedList<>(Arrays.asList(new RecipeBaseWidget(bounds) {
             @Override
             public void render(int mouseX, int mouseY, float delta) {

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

@@ -300,7 +300,7 @@ public class RecipeFinder {
                 }
             }
         }
-    
+        
         @SuppressWarnings("deprecation")
         private int method_7415() {
             int int_1 = Integer.MAX_VALUE;