aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-05-28 21:32:59 +0800
committershedaniel <daniel@shedaniel.me>2021-05-28 21:34:16 +0800
commitf644c84c664c9bc64e08d100e799caee6750e796 (patch)
treece49adc1884259899dddae338449b1582476ddcb
parente82ab958bc7d13e556d7426b7a1862ec76e23eba (diff)
parentc16a70a0f43a96b6dd2afa86b4fe35f501530aa2 (diff)
downloadRoughlyEnoughItems-f644c84c664c9bc64e08d100e799caee6750e796.tar.gz
RoughlyEnoughItems-f644c84c664c9bc64e08d100e799caee6750e796.tar.bz2
RoughlyEnoughItems-f644c84c664c9bc64e08d100e799caee6750e796.zip
Merge remote-tracking branch 'origin/6.x' into 6.x-1.17
# Conflicts: # runtime/src/main/java/me/shedaniel/rei/impl/client/ClientHelperImpl.java # runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigManagerImpl.java # runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java # runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java # runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DelegateScreen.java # runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/TransformingScreen.java # settings.gradle
-rw-r--r--api/build.gradle2
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/config/ConfigObject.java6
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/registry/category/CategoryRegistry.java9
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/registry/display/DisplayRegistry.java40
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/registry/display/DynamicDisplayGenerator.java (renamed from api/src/main/java/me/shedaniel/rei/api/client/registry/display/LiveDisplayGenerator.java)11
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/registry/display/visibility/DisplayVisibilityPredicate.java6
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/registry/entry/EntryRegistry.java18
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/registry/transfer/TransferHandler.java1
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/view/Views.java3
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/display/DisplaySerializerRegistry.java19
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/entry/comparison/FluidComparatorRegistry.java5
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/entry/comparison/ItemComparatorRegistry.java5
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/entry/type/EntryDefinition.java1
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/entry/type/EntryTypeBridge.java8
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/entry/type/EntryTypeRegistry.java29
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/plugins/REIPlugin.java17
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/plugins/REIPluginProvider.java16
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/transfer/info/MenuInfo.java2
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/transfer/info/MenuInfoRegistry.java2
-rwxr-xr-xbuild.gradle4
-rw-r--r--crowdin.yml4
-rw-r--r--default-plugin/build.gradle2
-rw-r--r--default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java6
-rw-r--r--default-plugin/src/main/java/me/shedaniel/rei/plugin/common/DefaultPlugin.java8
-rw-r--r--forge/build.gradle3
-rw-r--r--runtime/build.gradle8
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/PluginDetector.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/ClientHelperImpl.java8
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/ErrorDisplayer.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/REIHelperImpl.java16
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigManagerImpl.java94
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java18
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringScreen.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java (renamed from runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ContainerScreenOverlay.java)84
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/craftable/CraftableFilter.java50
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/credits/CreditsScreen.java15
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/modules/entries/EntryStackSubsetsMenuEntry.java6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/modules/entries/SubSubsetsMenuEntry.java6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DelegateScreen.java302
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/TransformingScreen.java151
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryListWidget.java8
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryWidget.java7
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/FavoritesListWidget.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/search/OverlaySearchField.java6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/registry/category/CategoryRegistryImpl.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/registry/display/DisplayRegistryImpl.java14
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/search/AsyncSearchManager.java5
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/view/ViewsImpl.java72
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/display/DisplaySerializerRegistryImpl.java30
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java8
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/transfer/MenuInfoRegistryImpl.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientRuntimePlugin.java6
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/bg_bg.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/bg_bg.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/cs_cz.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/cs_cz.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/de_de.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/de_de.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/en_gb.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/en_gb.json)0
-rwxr-xr-xruntime/src/main/resources/assets/roughlyenoughitems/lang/en_ud.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/en_ud.json)0
-rwxr-xr-xruntime/src/main/resources/assets/roughlyenoughitems/lang/en_us.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/en_us.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/eo_uy.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/eo_uy.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/es_es.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/es_es.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/et_ee.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/et_ee.json)0
-rwxr-xr-xruntime/src/main/resources/assets/roughlyenoughitems/lang/fr_fr.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/fr_fr.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/it_it.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/it_it.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/ja_jp.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/ja_jp.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/lol_us.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/lol_us.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/nn_no.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/nn_no.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/pl_pl.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/pl_pl.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/pt_br.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/pt_br.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/pt_pt.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/pt_pt.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/ru_ru.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/ru_ru.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/tr_tr.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/tr_tr.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/uk_ua.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/uk_ua.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/zh_cn.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/zh_cn.json)0
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/lang/zh_tw.json (renamed from src/main/resources/assets/roughlyenoughitems/lang/zh_tw.json)0
-rwxr-xr-xsettings.gradle1
77 files changed, 378 insertions, 786 deletions
diff --git a/api/build.gradle b/api/build.gradle
index 40ea8f83d..8a5f988f3 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -1,4 +1,4 @@
-archivesBaseName = rootProject.name + "-" + project.name
+archivesBaseName = rootProject.name + "-" + project.name
dependencies {
modCompileOnly("net.fabricmc:fabric-loader:${project.fabricloader_version}")
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/config/ConfigObject.java b/api/src/main/java/me/shedaniel/rei/api/client/config/ConfigObject.java
index 20bfdd767..571b6022a 100644
--- a/api/src/main/java/me/shedaniel/rei/api/client/config/ConfigObject.java
+++ b/api/src/main/java/me/shedaniel/rei/api/client/config/ConfigObject.java
@@ -58,10 +58,6 @@ public interface ConfigObject {
boolean isGrabbingItems();
- boolean isConfigScreenAnimated();
-
- boolean isCreditsScreenAnimated();
-
boolean isFavoritesAnimated();
boolean isToastDisplayedOnCopyIdentifier();
@@ -92,8 +88,6 @@ public interface ConfigObject {
int getMaxRecipePerPage();
- boolean doesShowUtilsButtons();
-
boolean doesDisableRecipeBook();
boolean doesFixTabCloseContainer();
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/registry/category/CategoryRegistry.java b/api/src/main/java/me/shedaniel/rei/api/client/registry/category/CategoryRegistry.java
index 44f185f4c..6061e28b0 100644
--- a/api/src/main/java/me/shedaniel/rei/api/client/registry/category/CategoryRegistry.java
+++ b/api/src/main/java/me/shedaniel/rei/api/client/registry/category/CategoryRegistry.java
@@ -33,6 +33,8 @@ import me.shedaniel.rei.api.common.plugins.PluginManager;
import me.shedaniel.rei.api.common.registry.Reloadable;
import me.shedaniel.rei.api.common.util.CollectionUtils;
import me.shedaniel.rei.api.common.util.Identifiable;
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
import net.minecraft.resources.ResourceLocation;
import java.util.List;
@@ -41,6 +43,13 @@ import java.util.function.Consumer;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
+/**
+ * Registry for registering new categories for displays.
+ * Relies on {@link CategoryIdentifier}, and is reset per plugin reload.
+ *
+ * @see REIClientPlugin#registerCategories(CategoryRegistry)
+ */
+@Environment(EnvType.CLIENT)
public interface CategoryRegistry extends Reloadable<REIClientPlugin>, Iterable<CategoryRegistry.CategoryConfiguration<?>> {
/**
* @return the instance of {@link CategoryRegistry}
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/registry/display/DisplayRegistry.java b/api/src/main/java/me/shedaniel/rei/api/client/registry/display/DisplayRegistry.java
index 07412c76c..14204c920 100644
--- a/api/src/main/java/me/shedaniel/rei/api/client/registry/display/DisplayRegistry.java
+++ b/api/src/main/java/me/shedaniel/rei/api/client/registry/display/DisplayRegistry.java
@@ -32,6 +32,7 @@ import me.shedaniel.rei.api.common.plugins.PluginManager;
import me.shedaniel.rei.api.common.registry.RecipeManagerContext;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
+import net.minecraft.world.item.crafting.Recipe;
import java.util.Collection;
import java.util.Collections;
@@ -40,6 +41,27 @@ import java.util.Map;
import java.util.function.Function;
import java.util.function.Predicate;
+/**
+ * Registry for registering displays for categories, this is called right after
+ * {@link me.shedaniel.rei.api.client.registry.category.CategoryRegistry}.
+ *
+ * <p>Each display should have a category associated with it that's registered,
+ * For any dynamic displays, you may want to look at {@link DynamicDisplayGenerator}.
+ *
+ * <p>Plugins may also determine the visibility of the displays dynamically via
+ * {@link DisplayVisibilityPredicate}, these predicates are preferred comparing to
+ * removing the displays from the registry.
+ *
+ * <p>Displays filler may be used for automatically registering displays from {@link Recipe},
+ * these are filled after client recipe manager sync, and are invoked with one cycle.
+ * Additionally, display filters allow other mods to easily register additional displays
+ * for your mod.
+ *
+ * @see Display
+ * @see DynamicDisplayGenerator
+ * @see DisplayVisibilityPredicate
+ * @see REIClientPlugin#registerDisplays(DisplayRegistry)
+ */
@Environment(EnvType.CLIENT)
public interface DisplayRegistry extends RecipeManagerContext<REIClientPlugin> {
/**
@@ -85,7 +107,7 @@ public interface DisplayRegistry extends RecipeManagerContext<REIClientPlugin> {
*
* @param generator the generator to register
*/
- <A extends Display> void registerGlobalDisplayGenerator(LiveDisplayGenerator<A> generator);
+ <A extends Display> void registerGlobalDisplayGenerator(DynamicDisplayGenerator<A> generator);
/**
* Registers a display generator
@@ -93,28 +115,28 @@ public interface DisplayRegistry extends RecipeManagerContext<REIClientPlugin> {
* @param categoryId the identifier of the category
* @param generator the generator to register
*/
- <A extends Display> void registerDisplayGenerator(CategoryIdentifier<A> categoryId, LiveDisplayGenerator<A> generator);
+ <A extends Display> void registerDisplayGenerator(CategoryIdentifier<A> categoryId, DynamicDisplayGenerator<A> generator);
/**
* Returns an unmodifiable map of display generators
*
* @return an unmodifiable map of display generators
*/
- Map<CategoryIdentifier<?>, List<LiveDisplayGenerator<?>>> getCategoryDisplayGenerators();
+ Map<CategoryIdentifier<?>, List<DynamicDisplayGenerator<?>>> getCategoryDisplayGenerators();
/**
* Returns an unmodifiable list of category-less display generators
*
* @return an unmodifiable list of category-less display generators
*/
- List<LiveDisplayGenerator<?>> getGlobalDisplayGenerators();
+ List<DynamicDisplayGenerator<?>> getGlobalDisplayGenerators();
/**
* Returns the list of display generators for a category
*
* @return the list of display generators
*/
- default <D extends Display> List<LiveDisplayGenerator<?>> getCategoryDisplayGenerators(CategoryIdentifier<D> categoryId) {
+ default <D extends Display> List<DynamicDisplayGenerator<?>> getCategoryDisplayGenerators(CategoryIdentifier<D> categoryId) {
return getCategoryDisplayGenerators().getOrDefault(categoryId, Collections.emptyList());
}
@@ -153,8 +175,8 @@ public interface DisplayRegistry extends RecipeManagerContext<REIClientPlugin> {
/**
* Registers a display filler, to be filled during {@link #tryFillDisplay(Object)}.
* <p>
- * Vanilla {@link net.minecraft.world.item.crafting.Recipe} are by default filled, display filters
- * can be used to automatically generate displaies for vanilla {@link net.minecraft.world.item.crafting.Recipe}.
+ * Vanilla {@link Recipe} are by default filled, display filters
+ * can be used to automatically generate displaies for vanilla {@link Recipe}.
*
* @param typeClass the type of {@code T}
* @param filler the filler, taking a {@code T} and returning a {@code D}
@@ -168,8 +190,8 @@ public interface DisplayRegistry extends RecipeManagerContext<REIClientPlugin> {
/**
* Registers a display filler, to be filled during {@link #tryFillDisplay(Object)}.
* <p>
- * Vanilla {@link net.minecraft.world.item.crafting.Recipe} are by default filled, display filters
- * can be used to automatically generate displaies for vanilla {@link net.minecraft.world.item.crafting.Recipe}.
+ * Vanilla {@link Recipe} are by default filled, display filters
+ * can be used to automatically generate displaies for vanilla {@link Recipe}.
*
* @param typeClass the type of {@code T}
* @param predicate the predicate of {@code T}
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/registry/display/LiveDisplayGenerator.java b/api/src/main/java/me/shedaniel/rei/api/client/registry/display/DynamicDisplayGenerator.java
index 04cfe3198..9c088e5e5 100644
--- a/api/src/main/java/me/shedaniel/rei/api/client/registry/display/LiveDisplayGenerator.java
+++ b/api/src/main/java/me/shedaniel/rei/api/client/registry/display/DynamicDisplayGenerator.java
@@ -24,13 +24,22 @@
package me.shedaniel.rei.api.client.registry.display;
import me.shedaniel.rei.api.client.view.ViewSearchBuilder;
+import me.shedaniel.rei.api.common.category.CategoryIdentifier;
import me.shedaniel.rei.api.common.display.Display;
import me.shedaniel.rei.api.common.entry.EntryStack;
import java.util.List;
import java.util.Optional;
-public inter