aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-02-05 10:08:44 +0800
committershedaniel <daniel@shedaniel.me>2021-02-05 10:08:44 +0800
commitea634e7ba29146d4ebc2c05b61257fa6c3b0642e (patch)
treecd6caf4e9b77e13b21d1c890bf38604109fd93f2 /runtime/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java
parentf5b59076cece9e95e76158b17b64fec27616b68b (diff)
downloadRoughlyEnoughItems-ea634e7ba29146d4ebc2c05b61257fa6c3b0642e.tar.gz
RoughlyEnoughItems-ea634e7ba29146d4ebc2c05b61257fa6c3b0642e.tar.bz2
RoughlyEnoughItems-ea634e7ba29146d4ebc2c05b61257fa6c3b0642e.zip
More relocation
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'runtime/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java b/runtime/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java
index 9256367e0..1f241c0fb 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java
@@ -29,6 +29,7 @@ import it.unimi.dsi.fastutil.ints.IntList;
import me.shedaniel.math.Rectangle;
import me.shedaniel.math.impl.PointHelper;
import me.shedaniel.rei.api.*;
+import me.shedaniel.rei.api.registry.category.DisplayCategory;
import me.shedaniel.rei.api.widgets.Button;
import me.shedaniel.rei.api.widgets.Widgets;
import me.shedaniel.rei.gui.toast.CopyRecipeIdentifierToast;
@@ -57,7 +58,7 @@ import java.util.function.Supplier;
public final class InternalWidgets {
private InternalWidgets() {}
- public static Widget createAutoCraftingButtonWidget(Rectangle displayBounds, Rectangle rectangle, Component text, Supplier<RecipeDisplay> displaySupplier, List<Widget> setupDisplay, RecipeCategory<?> category) {
+ public static Widget createAutoCraftingButtonWidget(Rectangle displayBounds, Rectangle rectangle, Component text, Supplier<Display> displaySupplier, List<Widget> setupDisplay, DisplayCategory<?> category) {
AbstractContainerScreen<?> containerScreen = REIHelper.getInstance().getPreviousContainerScreen();
boolean[] visible = {false};
List<String>[] errorTooltip = new List[]{null};
@@ -65,7 +66,7 @@ public final class InternalWidgets {
.focusable(false)
.onClick(button -> {
AutoTransferHandler.Context context = AutoTransferHandler.Context.create(true, containerScreen, displaySupplier.get());
- for (AutoTransferHandler autoTransferHandler : RecipeHelper.getInstance().getSortedAutoCraftingHandler())
+ for (AutoTransferHandler autoTransferHandler : RecipeRegistry.getInstance().getSortedAutoCraftingHandler())
try {
AutoTransferHandler.Result result = autoTransferHandler.handle(context);
if (result.isBlocking()) {
@@ -87,7 +88,7 @@ public final class InternalWidgets {
visible[0] = false;
IntList redSlots = null;
AutoTransferHandler.Context context = AutoTransferHandler.Context.create(false, containerScreen, displaySupplier.get());
- for (AutoTransferHandler autoTransferHandler : RecipeHelper.getInstance().getSortedAutoCraftingHandler()) {
+ for (AutoTransferHandler autoTransferHandler : RecipeRegistry.getInstance().getSortedAutoCraftingHandler()) {
try {
AutoTransferHandler.Result result = autoTransferHandler.handle(context);
if (result.isApplicable())
@@ -121,8 +122,8 @@ public final class InternalWidgets {
}
error.add("error.rei.no.handlers.applicable");
}
- if ((button.containsMouse(PointHelper.ofMouse()) || button.isFocused()) && category instanceof TransferRecipeCategory && redSlots != null) {
- ((TransferRecipeCategory<RecipeDisplay>) category).renderRedSlots(matrices, setupDisplay, displayBounds, displaySupplier.get(), redSlots);
+ if ((button.containsMouse(PointHelper.ofMouse()) || button.isFocused()) && category instanceof TransferDisplayCategory && redSlots != null) {
+ ((TransferDisplayCategory<Display>) category).renderRedSlots(matrices, setupDisplay, displayBounds, displaySupplier.get(), redSlots);
}
errorTooltip[0] = error == null || error.isEmpty() ? null : Lists.newArrayList();
if (errorTooltip[0] != null) {