aboutsummaryrefslogtreecommitdiff
path: root/api/src/main/java/me
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-03-09 23:17:05 +0800
committershedaniel <daniel@shedaniel.me>2021-03-09 23:17:05 +0800
commitde461fde691f593b85ffeae837b5b419a9abf7cc (patch)
treecec6e08c99427eddf9eef5e19d04edca56d3d0d4 /api/src/main/java/me
parent64bc9937d6ec04c6d66240a84b4fb345026c0b12 (diff)
downloadRoughlyEnoughItems-de461fde691f593b85ffeae837b5b419a9abf7cc.tar.gz
RoughlyEnoughItems-de461fde691f593b85ffeae837b5b419a9abf7cc.tar.bz2
RoughlyEnoughItems-de461fde691f593b85ffeae837b5b419a9abf7cc.zip
Use AbstractRecipeViewingScreen and remove static from ScreenHelper
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'api/src/main/java/me')
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/ConfigObject.java2
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/REIHelper.java30
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/REIOverlay.java12
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/favorites/FavoriteEntry.java2
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/gui/AbstractRenderer.java1
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStack.java23
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStackProvider.java23
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStackVisitor.java23
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggingContext.java49
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/gui/widgets/Widgets.java22
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/ingredient/EntryIngredient.java2
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/ingredient/entry/EntryDefinition.java1
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/ingredient/entry/EntryRenderer.java2
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/registry/display/DisplayCategory.java2
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/registry/display/TransferDisplay.java1
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/registry/display/TransferDisplayCategory.java2
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/server/ContainerInfo.java2
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/server/RecipeFinder.java12
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/util/CollectionUtils.java1
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/view/ViewSearchBuilder.java4
-rw-r--r--api/src/main/java/me/shedaniel/rei/impl/Internals.java6
21 files changed, 173 insertions, 49 deletions
diff --git a/api/src/main/java/me/shedaniel/rei/api/ConfigObject.java b/api/src/main/java/me/shedaniel/rei/api/ConfigObject.java
index fc802346d..9558bdd1e 100644
--- a/api/src/main/java/me/shedaniel/rei/api/ConfigObject.java
+++ b/api/src/main/java/me/shedaniel/rei/api/ConfigObject.java
@@ -25,8 +25,8 @@ package me.shedaniel.rei.api;
import me.shedaniel.clothconfig2.api.ModifierKeyCode;
import me.shedaniel.rei.api.favorites.FavoriteEntry;
-import me.shedaniel.rei.api.ingredient.EntryStack;
import me.shedaniel.rei.api.gui.config.*;
+import me.shedaniel.rei.api.ingredient.EntryStack;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import org.jetbrains.annotations.ApiStatus;
diff --git a/api/src/main/java/me/shedaniel/rei/api/REIHelper.java b/api/src/main/java/me/shedaniel/rei/api/REIHelper.java
index 3a46cf03b..f02ba4024 100644
--- a/api/src/main/java/me/shedaniel/rei/api/REIHelper.java
+++ b/api/src/main/java/me/shedaniel/rei/api/REIHelper.java
@@ -23,16 +23,17 @@
package me.shedaniel.rei.api;
+import me.shedaniel.math.Rectangle;
+import me.shedaniel.rei.api.gui.config.SearchFieldLocation;
import me.shedaniel.rei.api.gui.widgets.TextField;
import me.shedaniel.rei.api.gui.widgets.Tooltip;
+import me.shedaniel.rei.api.plugins.PluginManager;
import me.shedaniel.rei.api.registry.Reloadable;
-import me.shedaniel.rei.impl.Internals;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
+import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.resources.ResourceLocation;
-import org.jetbrains.annotations.ApiStatus;
-import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Optional;
@@ -44,15 +45,25 @@ public interface REIHelper extends Reloadable {
* @return the instance of {@link REIHelper}
*/
static REIHelper getInstance() {
- return Internals.getREIHelper();
+ return PluginManager.getInstance().get(REIHelper.class);
}
- @ApiStatus.Experimental
- Optional<REIOverlay> getOverlay();
+ boolean isOverlayVisible();
+
+ void toggleOverlayVisible();
+
+ default Optional<REIOverlay> getOverlay() {
+ return getOverlay(false);
+ }
+
+ Optional<REIOverlay> getOverlay(boolean reset);
@Nullable
AbstractContainerScreen<?> getPreviousContainerScreen();
+ @Nullable
+ Screen getPreviousScreen();
+
boolean isDarkThemeEnabled();
@Nullable
@@ -60,6 +71,11 @@ public interface REIHelper extends Reloadable {
void queueTooltip(@Nullable Tooltip tooltip);
- @NotNull
ResourceLocation getDefaultDisplayTexture();
+
+ SearchFieldLocation getContextualSearchFieldLocation();
+
+ Rectangle calculateEntryListArea();
+
+ Rectangle calculateFavoritesListArea();
}
diff --git a/api/src/main/java/me/shedaniel/rei/api/REIOverlay.java b/api/src/main/java/me/shedaniel/rei/api/REIOverlay.java
index c9dc4c16e..2b66857d4 100644
--- a/api/src/main/java/me/shedaniel/rei/api/REIOverlay.java
+++ b/api/src/main/java/me/shedaniel/rei/api/REIOverlay.java
@@ -24,11 +24,17 @@
package me.shedaniel.rei.api;
import me.shedaniel.rei.api.gui.drag.DraggingContext;
+import me.shedaniel.rei.api.gui.widgets.WidgetWithBounds;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Experimental
-public interface REIOverlay {
- void queueReloadOverlay();
+public abstract class REIOverlay extends WidgetWithBounds {
+ @ApiStatus.Internal
+ public abstract void closeOverlayMenu();
- DraggingContext getDraggingContext();
+ public abstract void queueReloadOverlay();
+
+ public abstract DraggingContext getDraggingContext();
+
+ public abstract boolean isNotInExclusionZones(double mouseX, double mouseY);
}
diff --git a/api/src/main/java/me/shedaniel/rei/api/favorites/FavoriteEntry.java b/api/src/main/java/me/shedaniel/rei/api/favorites/FavoriteEntry.java
index 0f8f3dd1a..a5cc707af 100644
--- a/api/src/main/java/me/shedaniel/rei/api/favorites/FavoriteEntry.java
+++ b/api/src/main/java/me/shedaniel/rei/api/favorites/FavoriteEntry.java
@@ -24,8 +24,8 @@
package me.shedaniel.rei.api.favorites;
import com.google.gson.JsonObject;
-import me.shedaniel.rei.api.ingredient.EntryStack;
import me.shedaniel.rei.api.gui.Renderer;
+import me.shedaniel.rei.api.ingredient.EntryStack;
import me.shedaniel.rei.impl.Internals;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.NotNull;
diff --git a/api/src/main/java/me/shedaniel/rei/api/gui/AbstractRenderer.java b/api/src/main/java/me/shedaniel/rei/api/gui/AbstractRenderer.java
index b4ffb75c5..7ce38fd5f 100644
--- a/api/src/main/java/me/shedaniel/rei/api/gui/AbstractRenderer.java
+++ b/api/src/main/java/me/shedaniel/rei/api/gui/AbstractRenderer.java
@@ -23,7 +23,6 @@
package me.shedaniel.rei.api.gui;
-import me.shedaniel.rei.api.gui.Renderer;
import net.minecraft.client.gui.GuiComponent;
public abstract class AbstractRenderer extends GuiComponent implements Renderer {
diff --git a/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStack.java b/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStack.java
index 8d38fb4c8..6bd61c953 100644
--- a/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStack.java
+++ b/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStack.java
@@ -1,3 +1,26 @@
+/*
+ * This file is licensed under the MIT License, part of Roughly Enough Items.
+ * Copyright (c) 2018, 2019, 2020 shedaniel
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
package me.shedaniel.rei.api.gui.drag;
import com.mojang.blaze3d.vertex.PoseStack;
diff --git a/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStackProvider.java b/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStackProvider.java
index 7b799b26a..3a4b56afc 100644
--- a/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStackProvider.java
+++ b/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStackProvider.java
@@ -1,3 +1,26 @@
+/*
+ * This file is licensed under the MIT License, part of Roughly Enough Items.
+ * Copyright (c) 2018, 2019, 2020 shedaniel
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
package me.shedaniel.rei.api.gui.drag;
import org.jetbrains.annotations.Nullable;
diff --git a/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStackVisitor.java b/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStackVisitor.java
index e0e64bf9a..62f66de23 100644
--- a/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStackVisitor.java
+++ b/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggableStackVisitor.java
@@ -1,3 +1,26 @@
+/*
+ * This file is licensed under the MIT License, part of Roughly Enough Items.
+ * Copyright (c) 2018, 2019, 2020 shedaniel
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
package me.shedaniel.rei.api.gui.drag;
import java.util.Optional;
diff --git a/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggingContext.java b/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggingContext.java
index cd9bc3a32..1b76cbaaf 100644
--- a/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggingContext.java
+++ b/api/src/main/java/me/shedaniel/rei/api/gui/drag/DraggingContext.java
@@ -1,3 +1,26 @@
+/*
+ * This file is licensed under the MIT License, part of Roughly Enough Items.
+ * Copyright (c) 2018, 2019, 2020 shedaniel
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
package me.shedaniel.rei.api.gui.drag;
import me.shedaniel.math.Point;
@@ -6,6 +29,12 @@ import org.jetbrains.annotations.Nullable;
import java.util.function.Supplier;
+/**
+ * The context of the current dragged stack on the overlay.
+ * <p>
+ * Widgets should implement {@link DraggableStackProvider} to submit applicable stacks to drag.
+ * Widgets should implement {@link DraggableStackVisitor} to accept incoming dragged stacks.
+ */
public interface DraggingContext {
static DraggingContext getInstance() {
return REIHelper.getInstance().getOverlay().get().getDraggingContext();
@@ -15,11 +44,29 @@ public interface DraggingContext {
return getCurrentStack() != null;
}
+ /**
+ * Returns the current dragged stack, may be null.
+ *
+ * @return the current dragged stack, may be null
+ */
@Nullable
DraggableStack getCurrentStack();
+ /**
+ * Returns the current position of the dragged stack, this is usually the position of the mouse pointer,
+ * but you should use this regardless to account for future changes.
+ *
+ * @return the current position of the dragged stack
+ */
@Nullable
Point getCurrentPosition();
- void registerRenderBackToPosition(DraggableStack stack, Supplier<Point> position);
+ /**
+ * Renders the draggable stack back to the position {@code position}.
+ * This may be used to animate an unaccepted draggable stack returning to its initial position.
+ *
+ * @param stack the stack to use for render
+ * @param position the position supplier of the destination
+ */
+ void renderBackToPosition(DraggableStack stack, Supplier<Point> position);
}
diff --git a/api/src/main/java/me/shedaniel/rei/api/gui/widgets/Widgets.java b/api/src/main/java/me/shedaniel/rei/api/gui/widgets/Widgets.java
index 614c5f4ec..bd7801533 100644
--- a/api/src/main/java/me/shedaniel/rei/api/gui/widgets/Widgets.java
+++ b/api/src/main/java/me/shedaniel/rei/api/gui/widgets/Widgets.java
@@ -194,19 +194,20 @@ public final class Widgets {
}
@NotNull
- public static Panel createRecipeBase(@NotNull Rectangle rectangle) {
- return Internals.getWidgetsProvider().createPanelWidget(rectangle)
- .yTextureOffset(ConfigObject.getInstance().getRecipeBorderType().getYOffset())
- .rendering(Widgets::shouldRecipeBaseRender);
+ public static Panel createCategoryBase(@NotNull Rectangle rectangle) {
+ return Internals.getWidgetsProvider().createPanelWidget(rectangle);
}
- private static boolean shouldRecipeBaseRender(@NotNull Panel panel) {
- return ConfigObject.getInstance().getRecipeBorderType().isRendering() && Internals.getWidgetsProvider().isRenderingPanel(panel);
+ @NotNull
+ public static Panel createCategoryBase(@NotNull Rectangle rectangle, int color) {
+ return createCategoryBase(rectangle).color(color);
}
@NotNull
- public static Panel createCategoryBase(@NotNull Rectangle rectangle) {
- return Internals.getWidgetsProvider().createPanelWidget(rectangle);
+ public static Panel createRecipeBase(@NotNull Rectangle rectangle) {
+ return Internals.getWidgetsProvider().createPanelWidget(rectangle)
+ .yTextureOffset(ConfigObject.getInstance().getRecipeBorderType().getYOffset())
+ .rendering(Widgets::shouldRecipeBaseRender);
}
@NotNull
@@ -214,9 +215,8 @@ public final class Widgets {
return createRecipeBase(rectangle).color(color);
}
- @NotNull
- public static Panel createCategoryBase(@NotNull Rectangle rectangle, int color) {
- return createCategoryBase(rectangle).color(color);
+ private static boolean shouldRecipeBaseRender(@NotNull Panel panel) {
+ return ConfigObject.getInstance().getRecipeBorderType().isRendering() && Internals.getWidgetsProvider().isRenderingPanel(panel);
}
@NotNull
diff --git a/api/src/main/java/me/shedaniel/rei/api/ingredient/EntryIngredient.java b/api/src/main/java/me/shedaniel/rei/api/ingredient/EntryIngredient.java
index c19b0f01e..2d9feb9bb 100644
--- a/api/src/main/java/me/shedaniel/rei/api/ingredient/EntryIngredient.java
+++ b/api/src/main/java/me/shedaniel/rei/api/ingredient/EntryIngredient.java
@@ -45,6 +45,6 @@ public interface EntryIngredient extends List<EntryStack<?>> {
}
static <T> EntryIngredient of(Iterable<? extends EntryStack<? extends T>> stacks) {
- return Internals.getEntryIngredientProvider().of((Iterable<EntryStack<?>>) (Iterable) stacks);
+ return Internals.getEntryIngredientProvider().of((Iterable<EntryStack<?>>) stacks);
}
}
diff --git a/api/src/main/java/me/shedaniel/rei/api/ingredient/entry/EntryDefinition.java b/api/src/main/java/me/shedaniel/rei/api/ingredient/entry/EntryDefinition.java
index f2d22668f..b1380a963 100644
--- a/api/src/main/java/me/shedaniel/rei/api/ingredient/entry/EntryDefinition.java
+++ b/api/src/main/java/me/shedaniel/rei/api/ingredient/entry/EntryDefinition.java
@@ -29,7 +29,6 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.ApiStatus;
-import org.jetbrains.annotations.NotNull;
import java.util.Collection;
import java.util.Optional;
diff --git a/api/src/main/java/me/shedaniel/rei/api/ingredient/entry/EntryRenderer.java b/api/src/main/java/me/shedaniel/rei/api/ingredient/entry/EntryRenderer.java
index ea1bc15b4..3ff850bb3 100644
--- a/api/src/main/java/me/shedaniel/rei/api/ingredient/entry/EntryRenderer.java
+++ b/api/src/main/java/me/shedaniel/rei/api/ingredient/entry/EntryRenderer.java
@@ -26,8 +26,8 @@ package me.shedaniel.rei.api.ingredient.entry;
import com.mojang.blaze3d.vertex.PoseStack;
import me.shedaniel.math.Point;
import me.shedaniel.math.Rectangle;
-import me.shedaniel.rei.api.ingredient.EntryStack;
import me.shedaniel.rei.api.gui.widgets.Tooltip;
+import me.shedaniel.rei.api.ingredient.EntryStack;
import org.jetbrains.annotations.Nullable;
public interface EntryRenderer<T> {
diff --git a/api/src/main/java/me/shedaniel/rei/api/registry/display/DisplayCategory.java b/api/src/main/java/me/shedaniel/rei/api/registry/display/DisplayCategory.java
index ca57ef7b0..5e19b8d0b 100644
--- a/api/src/main/java/me/shedaniel/rei/api/registry/display/DisplayCategory.java
+++ b/api/src/main/java/me/shedaniel/rei/api/registry/display/DisplayCategory.java
@@ -29,13 +29,11 @@ import me.shedaniel.rei.api.gui.Renderer;
import me.shedaniel.rei.api.gui.SimpleDisplayRenderer;
import me.shedaniel.rei.api.gui.widgets.Widget;
import me.shedaniel.rei.api.gui.widgets.Widgets;
-import me.shedaniel.rei.api.ingredient.EntryStack;
import me.shedaniel.rei.api.util.Identifiable;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.ApiStatus;
-import org.jetbrains.annotations.NotNull;
import java.util.Collections;
import java.util.List;
diff --git a/api/src/main/java/me/shedaniel/rei/api/registry/display/TransferDisplay.java b/api/src/main/java/me/shedaniel/rei/api/registry/display/TransferDisplay.java
index 7f9e081aa..d04dea550 100644
--- a/api/src/main/java/me/shedaniel/rei/api/registry/display/TransferDisplay.java
+++ b/api/src/main/java/me/shedaniel/rei/api/registry/display/TransferDisplay.java
@@ -24,7 +24,6 @@
package me.shedaniel.rei.api.registry.display;
import me.shedaniel.rei.api.ingredient.EntryIngredient;
-import me.shedaniel.rei.api.registry.display.Display;
import me.shedaniel.rei.api.server.ContainerInfo;
import net.minecraft.world.inventory.AbstractContainerMenu;
diff --git a/api/src/main/java/me/shedaniel/rei/api/registry/display/TransferDisplayCategory.java b/api/src/main/java/me/shedaniel/rei/api/registry/display/TransferDisplayCategory.java
index 10c04d266..3c678d503 100644
--- a/api/src/main/java/me/shedaniel/rei/api/registry/display/TransferDisplayCategory.java
+++ b/api/src/main/java/me/shedaniel/rei/api/registry/display/TransferDisplayCategory.java
@@ -26,8 +26,6 @@ package me.shedaniel.rei.api.registry.display;
import com.mojang.blaze3d.vertex.PoseStack;
import it.unimi.dsi.fastutil.ints.IntList;
import me.shedaniel.math.Rectangle;
-import me.shedaniel.rei.api.registry.display.Display;
-import me.shedaniel.rei.api.registry.display.DisplayCategory;
import me.shedaniel.rei.api.gui.widgets.Widget;
import org.jetbrains.annotations.ApiStatus;
diff --git a/api/src/main/java/me/shedaniel/rei/api/server/ContainerInfo.java b/api/src/main/java/me/shedaniel/rei/api/server/ContainerInfo.java
index 23325d6a4..d3be5a022 100644
--- a/api/src/main/java/me/shedaniel/rei/api/server/ContainerInfo.java
+++ b/api/src/main/java/me/shedaniel/rei/api/server/ContainerInfo.java
@@ -47,7 +47,7 @@ public interface ContainerInfo<T extends AbstractContainerMenu> {
for (StackAccessor gridStack : getGridStacks(context)) {
GridCleanHandler.returnSlotToPlayerInventory(context, gridStack);
}
-
+
clearCraftingSlots(container);
};
}
diff --git a/api/src/main/java/me/shedaniel/rei/api/server/RecipeFinder.java b/api/src/main/java/me/shedaniel/rei/api/server/RecipeFinder.java
index cbed0a639..162def884 100644
--- a/api/src/main/java/me/shedaniel/rei/api/server/RecipeFinder.java
+++ b/api/src/main/java/me/shedaniel/rei/api/server/RecipeFinder.java
@@ -171,7 +171,7 @@ public class RecipeFinder {
this.bitSet.clear(0, this.ingredientCount + this.usableIngredientSize + this.ingredientCount);
int int_5 = 0;
List<Ingredient> list_1 = new ArrayList<>(ingredientsInput);
-
+
for (Ingredient ingredient : list_1) {
if (boolean_2 && ingredient.isEmpty()) {
intList_1.add(0);
@@ -185,7 +185,7 @@ public class RecipeFinder {
}
}
}
-
+
++int_5;
}
}
@@ -196,7 +196,7 @@ public class RecipeFinder {
private int[] getUsableIngredientItemIds() {
IntCollection intCollection_1 = new IntAVLTreeSet();
-
+
for (Ingredient ingredient_1 : this.ingredients) {
intCollection_1.addAll(ingredient_1.getStackingIds());
}
@@ -321,15 +321,15 @@ public class RecipeFinder {
@SuppressWarnings("deprecation")
private int method_7415() {
int int_1 = Integer.MAX_VALUE;
-
+
for (Ingredient ingredient_1 : this.ingredients) {
int int_2 = 0;
-
+
int int_3;
for (IntListIterator var5 = ingredient_1.getStackingIds().iterator(); var5.hasNext(); int_2 = Math.max(int_2, RecipeFinder.this.idToAmountMap.get(int_3))) {
int_3 = var5.next();
}
-
+
if (int_1 > 0) {
int_1 = Math.min(int_1, int_2);
}
diff --git a/api/src/main/java/me/shedaniel/rei/api/util/CollectionUtils.java b/api/src/main/java/me/shedaniel/rei/api/util/CollectionUtils.java
index 83a955c3c..a72891363 100644
--- a/api/src/main/java/me/shedaniel/rei/api/util/CollectionUtils.java
+++ b/api/src/main/java/me/shedaniel/rei/api/util/CollectionUtils.java
@@ -28,7 +28,6 @@ import com.google.common.collect.Sets;
import com.google.common.collect.UnmodifiableIterator;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
-import jdk.nashorn.internal.runtime.arrays.IteratorAction;
import me.shedaniel.rei.api.ingredient.EntryStack;
import me.shedaniel.rei.api.ingredient.util.EntryStacks;
import net.fabricmc.api.EnvType;
diff --git a/api/src/main/java/me/shedaniel/rei/api/view/ViewSearchBuilder.java b/api/src/main/java/me/shedaniel/rei/api/view/ViewSearchBuilder.java
index 2a61f9ff4..bc9ac9a1b 100644
--- a/api/src/main/java/me/shedaniel/rei/api/view/ViewSearchBuilder.java
+++ b/api/src/main/java/me/shedaniel/rei/api/view/ViewSearchBuilder.java
@@ -69,12 +69,12 @@ public interface ViewSearchBuilder {
ViewSearchBuilder fillPreferredOpenedCategory();
- <T> ViewSearchBuilder setInputNotice(@Nullable EntryStack<T> stack);
+ <T> ViewSearchBuilder setInputNotice(@Nullable EntryStack<T> stack);
@Nullable
EntryStack<?> getInputNotice();
- <T> ViewSearchBuilder setOutputNotice(@Nullable EntryStack<T> stack);
+ <T> ViewSearchBuilder setOutputNotice(@Nullable EntryStack<T> stack);
@Nullable
EntryStack<?> getOutputNotice();
diff --git a/api/src/main/java/me/shedaniel/rei/impl/Internals.java b/api/src/main/java/me/shedaniel/rei/impl/Internals.java
index f8763f46c..9762f4b28 100644
--- a/api/src/main/java/me/shedaniel/rei/impl/Internals.java
+++ b/api/src/main/java/me/shedaniel/rei/impl/Internals.java
@@ -27,7 +27,6 @@ import com.google.gson.JsonObject;
import me.shedaniel.math.Point;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.ClientHelper;
-import me.shedaniel.rei.api.REIHelper;
import me.shedaniel.rei.api.favorites.FavoriteEntry;
import me.shedaniel.rei.api.gui.DrawableConsumer;
import me.shedaniel.rei.api.gui.Renderer;
@@ -60,7 +59,6 @@ import java.util.function.Supplier;
@ApiStatus.Internal
public final class Internals {
private static Supplier<ClientHelper> clientHelper = Internals::throwNotSetup;
- private static Supplier<REIHelper> reiHelper = Internals::throwNotSetup;
private static Supplier<EntryStackProvider> entryStackProvider = Internals::throwNotSetup;
private static Supplier<EntryIngredientProvider> entryIngredientProvider = Internals::throwNotSetup;
private static Supplier<WidgetsProvider> widgetsProvider = Internals::throwNotSetup;
@@ -82,10 +80,6 @@ public final class Internals {
return clientHelper.get();
}
- public static REIHelper getREIHelper() {
- return reiHelper.get();
- }
-
public static EntryStackProvider getEntryStackProvider() {
return entryStackProvider.get();
}