From ea634e7ba29146d4ebc2c05b61257fa6c3b0642e Mon Sep 17 00:00:00 2001 From: shedaniel Date: Fri, 5 Feb 2021 10:08:44 +0800 Subject: More relocation Signed-off-by: shedaniel --- .../src/main/java/me/shedaniel/rei/impl/InternalWidgets.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'runtime/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java') 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 displaySupplier, List setupDisplay, RecipeCategory category) { + public static Widget createAutoCraftingButtonWidget(Rectangle displayBounds, Rectangle rectangle, Component text, Supplier displaySupplier, List setupDisplay, DisplayCategory category) { AbstractContainerScreen containerScreen = REIHelper.getInstance().getPreviousContainerScreen(); boolean[] visible = {false}; List[] 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) category).renderRedSlots(matrices, setupDisplay, displayBounds, displaySupplier.get(), redSlots); + if ((button.containsMouse(PointHelper.ofMouse()) || button.isFocused()) && category instanceof TransferDisplayCategory && redSlots != null) { + ((TransferDisplayCategory) category).renderRedSlots(matrices, setupDisplay, displayBounds, displaySupplier.get(), redSlots); } errorTooltip[0] = error == null || error.isEmpty() ? null : Lists.newArrayList(); if (errorTooltip[0] != null) { -- cgit