aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
-rwxr-xr-xbuild.gradle1
-rw-r--r--default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java7
-rw-r--r--default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java11
-rw-r--r--default-plugin/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java22
-rw-r--r--fabric/src/main/java/me/shedaniel/rei/fabric/PluginDetectorImpl.java23
-rw-r--r--fabric/src/main/java/me/shedaniel/rei/fabric/RoughlyEnoughItemsFabric.java23
-rw-r--r--fabric/src/main/resources/fabric.mod.json10
-rw-r--r--forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java23
-rw-r--r--forge/src/main/java/me/shedaniel/rei/forge/REIPlugin.java23
-rw-r--r--forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForge.java23
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/PluginDetector.java23
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java36
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java1
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/api/gui/config/entry/FilteringScreen.java18
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/api/gui/config/entry/RecipeScreenTypeEntry.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/AbstractRecipeViewingScreen.java136
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java159
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/CurrentDraggingStack.java25
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/OverlaySearchField.java6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java9
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/RecipeDisplayExporter.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/RecipeScreen.java7
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java181
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/SearchFilterSyntaxHighlightingScreen.java6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java81
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/modules/Menu.java8
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/modules/entries/EntryStackSubsetsMenuEntry.java18
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/modules/entries/GameModeMenuEntry.java3
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/modules/entries/SubSubsetsMenuEntry.java16
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/modules/entries/WeatherMenuEntry.java3
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/plugin/DefaultRuntimePlugin.java33
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/plugin/entry/ItemEntryDefinition.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java13
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/widget/EntryWidget.java15
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/widget/FavoritesListWidget.java12
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java7
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/AbstractEntryStack.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java20
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/PluginManagerImpl.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/REIHelperImpl.java (renamed from runtime/src/main/java/me/shedaniel/rei/impl/ScreenHelper.java)150
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/SearchArgument.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/filtering/FilteringContextImpl.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/filtering/FilteringResult.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/filtering/rules/ManualFilteringRule.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/filtering/rules/SearchFilteringRule.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/registry/CategoryRegistryImpl.java19
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/search/MatchStatus.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/widgets/FillRectangleDrawableConsumer.java5
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/widgets/PanelWidget.java5
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/widgets/TextFieldWidget.java7
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/tests/plugin/REITestPlugin.java4
78 files changed, 887 insertions, 577 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 o