diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-05-28 21:32:59 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-05-28 21:34:16 +0800 |
| commit | f644c84c664c9bc64e08d100e799caee6750e796 (patch) | |
| tree | ce49adc1884259899dddae338449b1582476ddcb | |
| parent | e82ab958bc7d13e556d7426b7a1862ec76e23eba (diff) | |
| parent | c16a70a0f43a96b6dd2afa86b4fe35f501530aa2 (diff) | |
| download | RoughlyEnoughItems-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
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 |
