From 542eb5154ebce387312ca3691f743b89e4aef99e Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sat, 27 Feb 2021 17:14:08 +0800 Subject: Remove depending on Cloth API, switching to architectury Signed-off-by: shedaniel --- .../main/java/me/shedaniel/rei/impl/InternalWidgets.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 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 d15cef562..938e996bf 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java @@ -33,7 +33,10 @@ import me.shedaniel.rei.api.registry.display.Display; import me.shedaniel.rei.api.registry.display.DisplayCategory; import me.shedaniel.rei.api.gui.widgets.Button; import me.shedaniel.rei.api.gui.widgets.Widgets; +import me.shedaniel.rei.api.registry.display.DisplayRegistry; import me.shedaniel.rei.api.registry.display.TransferDisplayCategory; +import me.shedaniel.rei.api.registry.transfer.TransferHandler; +import me.shedaniel.rei.api.registry.transfer.TransferHandlerRegistry; import me.shedaniel.rei.gui.toast.CopyRecipeIdentifierToast; import me.shedaniel.rei.gui.widget.LateRenderable; import me.shedaniel.rei.api.gui.widgets.Widget; @@ -67,10 +70,10 @@ public final class InternalWidgets { Button autoCraftingButton = Widgets.createButton(rectangle, text) .focusable(false) .onClick(button -> { - AutoTransferHandler.Context context = AutoTransferHandler.Context.create(true, containerScreen, displaySupplier.get()); - for (AutoTransferHandler autoTransferHandler : DisplayRegistry.getInstance().getSortedAutoCraftingHandler()) + TransferHandler.Context context = TransferHandler.Context.create(true, containerScreen, displaySupplier.get()); + for (TransferHandler autoTransferHandler : TransferHandlerRegistry.getInstance()) try { - AutoTransferHandler.Result result = autoTransferHandler.handle(context); + TransferHandler.Result result = autoTransferHandler.handle(context); if (result.isBlocking()) { if (result.isReturningToScreen()) { break; @@ -89,10 +92,10 @@ public final class InternalWidgets { int color = 0; visible[0] = false; IntList redSlots = null; - AutoTransferHandler.Context context = AutoTransferHandler.Context.create(false, containerScreen, displaySupplier.get()); - for (AutoTransferHandler autoTransferHandler : DisplayRegistry.getInstance().getSortedAutoCraftingHandler()) { + TransferHandler.Context context = TransferHandler.Context.create(false, containerScreen, displaySupplier.get()); + for (TransferHandler autoTransferHandler : TransferHandlerRegistry.getInstance()) { try { - AutoTransferHandler.Result result = autoTransferHandler.handle(context); + TransferHandler.Result result = autoTransferHandler.handle(context); if (result.isApplicable()) visible[0] = true; if (result.isSuccessful()) { -- cgit