aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-06-28 01:36:29 +0800
committerGitHub <noreply@github.com>2022-06-28 01:36:29 +0800
commit0f4b089286eb0349f5b1b1c1b6f9ebd861fa0ba4 (patch)
treeeb623bddf5045f83909eba930ee48058859b5ab7 /runtime/src/main/java
parent85ecd54de2309184b1cbc0153236b67426c17cb7 (diff)
parent8e69d8f9a5101b7518aecd2d4576688653c884bb (diff)
downloadRoughlyEnoughItems-0f4b089286eb0349f5b1b1c1b6f9ebd861fa0ba4.tar.gz
RoughlyEnoughItems-0f4b089286eb0349f5b1b1c1b6f9ebd861fa0ba4.tar.bz2
RoughlyEnoughItems-0f4b089286eb0349f5b1b1c1b6f9ebd861fa0ba4.zip
Merge pull request #931 from shedaniel/feature/rei_8.3
REI 8.3
Diffstat (limited to 'runtime/src/main/java')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCoreClient.java69
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java18
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/ClientHelperImpl.java49
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/REIRuntimeImpl.java7
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigManagerImpl.java21
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java13
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/addon/ConfigAddonRegistryImpl.java54
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/addon/ConfigAddonsScreen.java193
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/ConfigAddonsEntry.java96
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/entry/type/types/RenderingEntryDefinition.java15
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/favorites/FavoriteEntryTypeRegistryImpl.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/RecipeDisplayExporter.java1
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java202
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/dragging/CurrentDraggingStack.java10
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/modules/Menu.java1
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/modules/MenuEntry.java1
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/modules/entries/SubSubsetsMenuEntry.java1
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/AbstractDisplayViewingScreen.java74
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/CompositeDisplayViewingScreen.java9
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java75
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/AutoCraftingEvaluator.java51
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/BatchedEntryRendererManager.java15
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/CachedEntryListRender.java15
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/DelegateWidgetWithTranslate.java58
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/DisplayTooltipComponent.java82
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/DisplayedEntryWidget.java26
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryWidget.java56
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/InternalWidgets.java17
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/MergedWidget.java9
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/NoOpWidget.java53
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/OverflowWidget.java159
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/PaddedCenterWidget.java58
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/PaddedWidget.java51
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/TabWidget.java5
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/TooltipContextImpl.java9
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/basewidgets/ButtonWidget.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/basewidgets/TextFieldWidget.java9
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/CachingEntryRenderer.java102
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/CollapsedEntriesTooltip.java88
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/CollapsingEntryListWidget.java114
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListSearchManager.java56
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListStackEntry.java134
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListWidget.java251
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/PaginatedEntryListWidget.java153
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/ScrolledEntryListWidget.java198
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/FavoritesEntriesManager.java46
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/FavoritesListWidget.java3
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayEntry.java62
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayHistoryManager.java142
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayHistoryWidget.java61
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesPanel.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/rows/FavoritesPanelEmptyRow.java3
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/rows/FavoritesPanelEntriesRow.java3
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/rows/FavoritesPanelRow.java3
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/rows/FavoritesPanelSectionRow.java53
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/rows/FavoritesPanelSeparatorRow.java3
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/search/OverlaySearchField.java15
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/registry/display/DisplayRegistryImpl.java10
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/search/argument/type/TextArgumentType.java7
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/search/argument/type/TooltipArgumentType.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/transfer/MissingStacksTooltip.java107
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/transfer/TransferHandlerRegistryImpl.java8
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/view/ViewsImpl.java46
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/AbstractEntryStack.java7
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/EntryIngredientImpl.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java278
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryList.java60
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryListener.java45
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/NormalEntryRegistryList.java115
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/PreFilteredEntryList.java200
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/ReloadingEntryRegistryList.java107
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/collapsed/CollapsedStack.java59
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/collapsed/CollapsibleEntryRegistryImpl.java128
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java16
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/util/HashedEntryStackWrapper.java6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultCategoryHandler.java7
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/plugin/client/entry/FluidEntryDefinition.java6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/plugin/client/entry/ItemEntryDefinition.java16
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/plugin/client/runtime/DefaultClientRuntimePlugin.java17
79 files changed, 3581 insertions, 748 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCoreClient.java b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCoreClient.java
index 07ce4f764..005d80570 100644
--- a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCoreClient.java
+++ b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCoreClient.java
@@ -32,13 +32,13 @@ import dev.architectury.event.events.client.ClientGuiEvent;
import dev.architectury.event.events.client.ClientRecipeUpdateEvent;
import dev.architectury.event.events.client.ClientScreenInputEvent;
import dev.architectury.networking.NetworkManager;
-import dev.architectury.platform.Platform;
import me.shedaniel.math.Point;
import me.shedaniel.rei.api.client.REIRuntime;
import me.shedaniel.rei.api.client.config.ConfigObject;
import me.shedaniel.rei.api.client.entry.renderer.EntryRenderer;
import me.shedaniel.rei.api.client.favorites.FavoriteEntry;
import me.shedaniel.rei.api.client.favorites.FavoriteEntryType;
+import me.shedaniel.rei.api.client.gui.screen.DisplayScreen;
import me.shedaniel.rei.api.client.gui.widgets.Tooltip;
import me.shedaniel.rei.api.client.gui.widgets.TooltipContext;
import me.shedaniel.rei.api.client.overlay.ScreenOverlay;
@@ -51,7 +51,9 @@ import me.shedaniel.rei.api.client.registry.screen.ClickArea;
import me.shedaniel.rei.api.client.registry.screen.OverlayDecider;
import me.shedaniel.rei.api.client.registry.screen.ScreenRegistry;
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
+import me.shedaniel.rei.api.common.plugins.PluginManager;
import me.shedaniel.rei.api.common.plugins.PluginView;
+import me.shedaniel.rei.api.common.plugins.REIPlugin;
import me.shedaniel.rei.api.common.registry.ReloadStage;
import me.shedaniel.rei.api.common.util.CollectionUtils;
import me.shedaniel.rei.api.common.util.EntryStacks;
@@ -59,6 +61,7 @@ import me.shedaniel.rei.api.common.util.ImmutableTextComponent;
import me.shedaniel.rei.impl.ClientInternals;
import me.shedaniel.rei.impl.client.REIRuntimeImpl;
import me.shedaniel.rei.impl.client.config.ConfigManagerImpl;
+import me.shedaniel.rei.impl.client.config.addon.ConfigAddonRegistryImpl;
import me.shedaniel.rei.impl.client.entry.renderer.EntryRendererRegistryImpl;
import me.shedaniel.rei.impl.client.favorites.DelegatingFavoriteEntryProviderImpl;
import me.shedaniel.rei.impl.client.favorites.FavoriteEntryTypeRegistryImpl;
@@ -75,6 +78,7 @@ import me.shedaniel.rei.impl.client.subsets.SubsetsRegistryImpl;
import me.shedaniel.rei.impl.client.transfer.TransferHandlerRegistryImpl;
import me.shedaniel.rei.impl.client.view.ViewsImpl;
import me.shedaniel.rei.impl.common.entry.type.EntryRegistryImpl;
+import me.shedaniel.rei.impl.common.entry.type.collapsed.CollapsibleEntryRegistryImpl;
import me.shedaniel.rei.impl.common.entry.type.types.EmptyEntryDefinition;
import me.shedaniel.rei.impl.common.plugins.PluginManagerImpl;
import me.shedaniel.rei.impl.common.util.IssuesDetector;
@@ -102,6 +106,7 @@ import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.crafting.Ingredient;
+import org.apache.commons.lang3.function.TriFunction;
import org.apache.commons.lang3.mutable.MutableLong;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
@@ -109,9 +114,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.List;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
+import java.util.concurrent.*;
import java.util.function.BiFunction;
import java.util.function.BooleanSupplier;
import java.util.function.Function;
@@ -122,7 +125,6 @@ import java.util.stream.Stream;
@Environment(EnvType.CLIENT)
public class RoughlyEnoughItemsCoreClient {
public static final Event<ClientRecipeUpdateEvent> PRE_UPDATE_RECIPES = EventFactory.createLoop();
- @ApiStatus.Experimental
public static boolean isLeftMousePressed = false;
private static final ExecutorService RELOAD_PLUGINS = Executors.newSingleThreadScheduledExecutor(task -> {
Thread thread = new Thread(task, "REI-ReloadPlugins");
@@ -132,6 +134,7 @@ public class RoughlyEnoughItemsCoreClient {
});
return thread;
});
+ private static final List<Future<?>> RELOAD_TASKS = new CopyOnWriteArrayList<>();
public static void attachClientInternals() {
InternalWidgets.attach();
@@ -146,7 +149,7 @@ public class RoughlyEnoughItemsCoreClient {
return entryType.read(object);
}, "favoriteEntryFromJson");
ClientInternals.attachInstance((BiFunction<@Nullable Point, Collection<Tooltip.Entry>, Tooltip>) QueuedTooltip::impl, "tooltipProvider");
- ClientInternals.attachInstance((BiFunction<Point, @Nullable TooltipFlag, TooltipContext>) TooltipContextImpl::new, "tooltipContextProvider");
+ ClientInternals.attachInstance((TriFunction<Point, @Nullable TooltipFlag, Boolean, TooltipContext>) TooltipContextImpl::new, "tooltipContextProvider");
ClientInternals.attachInstance((Function<Object, Tooltip.Entry>) QueuedTooltip.TooltipEntryImpl::new, "tooltipEntryProvider");
ClientInternals.attachInstance((Function<@Nullable Boolean, ClickArea.Result>) successful -> new ClickArea.Result() {
private List<CategoryIdentifier<?>> categories = Lists.newArrayList();
@@ -227,13 +230,15 @@ public class RoughlyEnoughItemsCoreClient {
new SearchProviderImpl(),
new ConfigManagerImpl(),
new EntryRegistryImpl(),
+ new CollapsibleEntryRegistryImpl(),
new CategoryRegistryImpl(),
new DisplayRegistryImpl(),
new ScreenRegistryImpl(),
new FavoriteEntryTypeRegistryImpl(),
new SubsetsRegistryImpl(),
new TransferHandlerRegistryImpl(),
- new REIRuntimeImpl()), "clientPluginManager");
+ new REIRuntimeImpl(),
+ new ConfigAddonRegistryImpl()), "clientPluginManager");
}
public void onInitializeClient() {
@@ -321,8 +326,24 @@ public class RoughlyEnoughItemsCoreClient {
reloadPlugins(startReload, ReloadStage.START);
});
ClientRecipeUpdateEvent.EVENT.register(recipeManager -> {
- if (!Platform.isFabric()) RoughlyEnoughItemsCore.PERFORMANCE_LOGGER.clear();
- reloadPlugins(endReload, Platform.isFabric() ? ReloadStage.END : null);
+ reloadPlugins(endReload, ReloadStage.END);
+ });
+ ClientGuiEvent.INIT_PRE.register((screen, access) -> {
+ List<ReloadStage> stages = ((PluginManagerImpl<REIPlugin<?>>) PluginManager.getInstance()).getObservedStages();
+
+ if (Min