From a6900532610247cae49f1c782442d07d8f7b1d2d Mon Sep 17 00:00:00 2001 From: shedaniel Date: Fri, 26 Aug 2022 16:48:42 +0900 Subject: It compiles now --- .../rei/api/client/gui/SimpleDisplayRenderer.java | 14 +-- .../shedaniel/rei/api/client/gui/widgets/Slot.java | 94 ++++++++++++++++++- .../rei/api/client/gui/widgets/TextField.java | 4 + .../rei/api/client/gui/widgets/Tooltip.java | 20 +++- .../rei/api/client/gui/widgets/TooltipContext.java | 2 +- .../rei/api/client/gui/widgets/Widgets.java | 6 +- .../registry/display/DisplayCategoryView.java | 2 +- .../shedaniel/rei/impl/client/ClientInternals.java | 16 +++- .../client/provider/AutoCraftingEvaluator.java | 103 +++++++++++++++++++++ .../provider/DelegatingFavoriteEntryProvider.java | 3 + .../provider/FavoritesEntriesListProvider.java | 2 + .../provider/MissingStacksTooltipProvider.java | 2 + .../rei/impl/client/provider/OverlayTicker.java | 31 +++++++ .../rei/impl/client/provider/WidgetsProvider.java | 2 + .../provider/CategoryIdentifierConstructor.java | 2 + .../provider/DeferringEntryTypeProvider.java | 2 + .../common/provider/EntryIngredientProvider.java | 2 + .../impl/common/provider/EntryStackProvider.java | 2 + .../impl/common/provider/NbtHasherProvider.java | 2 + .../common/provider/PluginManagerConstructor.java | 2 + 20 files changed, 289 insertions(+), 24 deletions(-) create mode 100644 api/src/main/java/me/shedaniel/rei/impl/client/provider/AutoCraftingEvaluator.java create mode 100644 api/src/main/java/me/shedaniel/rei/impl/client/provider/OverlayTicker.java (limited to 'api/src/main/java/me') diff --git a/api/src/main/java/me/shedaniel/rei/api/client/gui/SimpleDisplayRenderer.java b/api/src/main/java/me/shedaniel/rei/api/client/gui/SimpleDisplayRenderer.java index 92646aa0d..2270a8ab9 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/gui/SimpleDisplayRenderer.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/gui/SimpleDisplayRenderer.java @@ -66,9 +66,9 @@ public class SimpleDisplayRenderer extends DisplayRenderer implements WidgetHold protected Slot createSlot(EntryIngredient ingredient) { return Widgets.createSlot(new Point(0, 0)) .entries(CollectionUtils.filterToList(ingredient, stack -> !stack.isEmpty())) - .disableBackground() - .disableHighlight() - .disableTooltips(); + .noBackground() + .noHighlight() + .noTooltips(); } public static List simplify(List original) { @@ -123,10 +123,10 @@ public class SimpleDisplayRenderer extends DisplayRenderer implements WidgetHold int xx = bounds.x + 4, yy = bounds.y + 2; int j = 0; int itemsPerLine = getItemsPerLine(); - for (Slot entryWidget : inputWidgets) { - entryWidget.setZ(getZ() + 50); - entryWidget.getBounds().setLocation(xx, yy); - entryWidget.render(matrices, mouseX, mouseY, delta); + for (Slot slot : inputWidgets) { + slot.setZ(getZ() + 50); + slot.getBounds().setLocation(xx, yy); + slot.render(matrices, mouseX, mouseY, delta); xx += 18; j++; if (j >= getItemsPerLine() - 2) { diff --git a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Slot.java b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Slot.java index 88220ecf2..71fa8f49c 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Slot.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Slot.java @@ -26,17 +26,22 @@ package me.shedaniel.rei.api.client.gui.widgets; import com.mojang.blaze3d.vertex.PoseStack; import me.shedaniel.math.Point; import me.shedaniel.math.Rectangle; +import me.shedaniel.rei.api.client.entry.renderer.EntryRenderer; +import me.shedaniel.rei.api.client.favorites.FavoriteEntry; import me.shedaniel.rei.api.common.entry.EntryStack; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; import java.util.Collection; import java.util.List; -import java.util.function.UnaryOperator; +import java.util.function.*; public abstract class Slot extends WidgetWithBounds { public static final byte UN_MARKED = 0; public static final byte INPUT = 1; public static final byte OUTPUT = 2; + @ApiStatus.Experimental + public static final byte FAVORITE = 4; public final Slot unmarkInputOrOutput() { setNoticeMark(UN_MARKED); @@ -53,6 +58,14 @@ public abstract class Slot extends WidgetWithBounds { return this; } + public final void size(float size) { + this.getBounds().setSize(size, size); + } + + public final void size(float width, float height) { + this.getBounds().setSize(width, height); + } + public abstract void setNoticeMark(byte mark); public abstract byte getNoticeMark(); @@ -70,6 +83,7 @@ public abstract class Slot extends WidgetWithBounds { return interactable(false); } + @Deprecated(forRemoval = true) public final Slot notInteractable() { return interactable(false); } @@ -87,11 +101,16 @@ public abstract class Slot extends WidgetWithBounds { return interactableFavorites(false); } + @Deprecated(forRemoval = true) public final Slot notFavoritesInteractable() { return interactableFavorites(false); } - public abstract void setHighlightEnabled(boolean highlights); + public final void setHighlightEnabled(boolean highlights) { + setHighlightEnabled(slot -> highlights); + } + + public abstract void setHighlightEnabled(Predicate highlights); public abstract boolean isHighlightEnabled(); @@ -100,11 +119,27 @@ public abstract class Slot extends WidgetWithBounds { return this; } + public abstract Slot highlightEnabled(Predicate highlight); + + public final Slot noHighlight() { + return highlightEnabled(false); + } + + public final Slot noHighlightIfEmpty() { + setHighlightEnabled(slot -> !slot.isEmpty()); + return this; + } + + @Deprecated(forRemoval = true) public final Slot disableHighlight() { return highlightEnabled(false); } - public abstract void setTooltipsEnabled(boolean tooltipsEnabled); + public void setTooltipsEnabled(boolean tooltipsEnabled) { + setTooltipsEnabled(slot -> tooltipsEnabled); + } + + public abstract void setTooltipsEnabled(Predicate tooltipsEnabled); public abstract boolean isTooltipsEnabled(); @@ -113,11 +148,22 @@ public abstract class Slot extends WidgetWithBounds { return this; } + public abstract Slot tooltipsEnabled(Predicate tooltipsEnabled); + + public final Slot noTooltips() { + return tooltipsEnabled(false); + } + + @Deprecated(forRemoval = true) public final Slot disableTooltips() { return tooltipsEnabled(false); } - public abstract void setBackgroundEnabled(boolean backgroundEnabled); + public void setBackgroundEnabled(boolean backgroundEnabled) { + setBackgroundEnabled(slot -> backgroundEnabled); + } + + public abstract void setBackgroundEnabled(Predicate backgroundEnabled); public abstract boolean isBackgroundEnabled(); @@ -126,10 +172,26 @@ public abstract class Slot extends WidgetWithBounds { return this; } + public abstract Slot backgroundEnabled(Predicate backgroundEnabled); + + public final Slot noBackground() { + return backgroundEnabled(false); + } + + @Deprecated(forRemoval = true) public final Slot disableBackground() { return backgroundEnabled(false); } + public abstract void setCyclingInterval(long cyclingInterval); + + public abstract long getCyclingInterval(); + + public final Slot cyclingInterval(long cyclingInterval) { + setCyclingInterval(cyclingInterval); + return this; + } + public abstract Slot clearEntries(); public abstract Slot entry(EntryStack stack); @@ -140,6 +202,10 @@ public abstract class Slot extends WidgetWithBounds { public abstract List> getEntries(); + public final boolean isEmpty() { + return getEntries().isEmpty(); + } + public abstract Rectangle getInnerBounds(); public abstract void drawBackground(PoseStack matrices, int mouseX, int mouseY, float delta); @@ -160,4 +226,24 @@ public abstract class Slot extends WidgetWithBounds { public abstract void drawHighlighted(PoseStack matrices, int mouseX, int mouseY, float delta); public abstract void tooltipProcessor(UnaryOperator operator); + + public abstract void action(ActionPredicate predicate); + + @ApiStatus.Experimental + public abstract void setFavoriteEntryFunction(Function, FavoriteEntry> function); + + @ApiStatus.Experimental + public abstract Function, FavoriteEntry> getFavoriteEntryFunction(); + + @ApiStatus.Experimental + public abstract void setContainsPointFunction(BiPredicate function); + + @ApiStatus.Experimental + public abstract void appendContainsPointFunction(BiPredicate function); + + public interface ActionPredicate { + boolean doMouse(Slot slot, double mouseX, double mouseY, int button); + + boolean doKey(Slot slot, int keyCode, int scanCode, int modifiers); + } } diff --git a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/TextField.java b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/TextField.java index 803502972..1757e77b5 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/TextField.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/TextField.java @@ -38,8 +38,12 @@ import static me.shedaniel.rei.api.client.gui.widgets.Widget.mouse; public interface TextField extends TickableWidget { void setFormatter(TextFormatter formatter); + TextFormatter getFormatter(); + void setSuggestionRenderer(SuggestionRenderer renderer); + SuggestionRenderer getSuggestionRenderer(); + String getText(); void setText(String text); diff --git a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Tooltip.java b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Tooltip.java index 550c9b226..848e853de 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Tooltip.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Tooltip.java @@ -66,8 +66,16 @@ public interface Tooltip { return create(point, Arrays.asList(texts)); } + static Tooltip create(@Nullable TooltipContext context, Collection texts) { + return from(context, CollectionUtils.map(texts, Tooltip::entry)); + } + + static Tooltip create(@Nullable TooltipContext context, Component... texts) { + return create(context, Arrays.asList(texts)); + } + static Tooltip create(Collection texts) { - return create(null, texts); + return create((TooltipContext) null, texts); } static Tooltip create(Component... texts) { @@ -82,8 +90,16 @@ public interface Tooltip { return from(point, Arrays.asList(entries)); } + static Tooltip from(@Nullable TooltipContext context, Collection entries) { + return ClientInternals.createTooltip(context == null ? null : context.getPoint(), entries); + } + + static Tooltip from(@Nullable TooltipContext context, Entry... entries) { + return from(context, Arrays.asList(entries)); + } + static Tooltip from(Collection entries) { - return from(null, entries); + return from((TooltipContext) null, entries); } static Tooltip from(Entry... entries) { diff --git a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/TooltipContext.java b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/TooltipContext.java index cb20f2bd2..b2cabe322 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/TooltipContext.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/TooltipContext.java @@ -52,7 +52,7 @@ public interface TooltipContext { } static TooltipContext ofMouse() { - return TooltipContext.of(PointHelper.ofMouse()); + return TooltipContext.of(Widget.mouse()); } TooltipFlag getFlag(); diff --git a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Widgets.java b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Widgets.java index 4e7e2d336..67dfe7cbb 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Widgets.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Widgets.java @@ -260,11 +260,7 @@ public final class Widgets { public static Panel createSlotBase(Rectangle rectangle) { - return ClientInternals.getWidgetsProvider().createPanelWidget(rectangle).yTextureOffset(-66).rendering(Widgets::shouldSlotBaseRender); - } - - private static boolean shouldSlotBaseRender(Panel panel) { - return true; + return ClientInternals.getWidgetsProvider().createPanelWidget(rectangle).yTextureOffset(-66); } public static Panel createSlotBase(Rectangle rectangle, int color) { diff --git a/api/src/main/java/me/shedaniel/rei/api/client/registry/display/DisplayCategoryView.java b/api/src/main/java/me/shedaniel/rei/api/client/registry/display/DisplayCategoryView.java index 47f3b9803..e78ac4ff4 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/registry/display/DisplayCategoryView.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/registry/display/DisplayCategoryView.java @@ -66,7 +66,7 @@ public interface DisplayCategoryView { * for how the tooltip is resolved. *

* It is recommended to mark these slots for I/O using {@link Slot#markInput()} and {@link Slot#markOutput()}, - * and the background of the slots may be disabled using {@link Slot#disableBackground()}. + * and the background of the slots may be disabled using {@link Slot#noBackground()}. *

* Arbitrary text may be added to the widgets list with {@link Widgets#createLabel(Point, Component)}, * you may configure the horizontal alignment of the text using {@link Label#centered()}, diff --git a/api/src/main/java/me/shedaniel/rei/impl/client/ClientInternals.java b/api/src/main/java/me/shedaniel/rei/impl/client/ClientInternals.java index b684d3554..706ea27ad 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/client/ClientInternals.java +++ b/api/src/main/java/me/shedaniel/rei/impl/client/ClientInternals.java @@ -33,12 +33,10 @@ import me.shedaniel.rei.api.client.plugins.REIClientPlugin; import me.shedaniel.rei.api.client.registry.entry.PreFilteredEntryList; import me.shedaniel.rei.api.client.registry.screen.ClickArea; import me.shedaniel.rei.api.client.view.ViewSearchBuilder; +import me.shedaniel.rei.api.common.display.Display; import me.shedaniel.rei.api.common.entry.EntryIngredient; import me.shedaniel.rei.api.common.plugins.PluginManager; -import me.shedaniel.rei.impl.client.provider.DelegatingFavoriteEntryProvider; -import me.shedaniel.rei.impl.client.provider.FavoritesEntriesListProvider; -import me.shedaniel.rei.impl.client.provider.MissingStacksTooltipProvider; -import me.shedaniel.rei.impl.client.provider.WidgetsProvider; +import me.shedaniel.rei.impl.client.provider.*; import me.shedaniel.rei.impl.common.Internals; import net.minecraft.ReportedException; import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; @@ -64,6 +62,8 @@ public final class ClientInternals { UnaryOperator.identity()); private static final DelegatingFavoriteEntryProvider DELEGATE_FAVORITE_ENTRY = resolveService(DelegatingFavoriteEntryProvider.class); private static final FavoritesEntriesListProvider FAVORITES_ENTRIES_LIST = resolveService(FavoritesEntriesListProvider.class); + private static final List OVERLAY_TICKERS = resolveServices(OverlayTicker.class); + private static final AutoCraftingEvaluator AUTO_CRAFTING_EVALUATOR = resolveService(AutoCraftingEvaluator.class); private static Function> favoriteEntryFromJson = (object) -> throwNotSetup(); private static Function clickAreaHandlerResult = (result) -> throwNotSetup(); private static BiConsumer, TooltipComponent> clientTooltipComponentProvider = (tooltip, result) -> throwNotSetup(); @@ -157,6 +157,14 @@ public final class ClientInternals { return FAVORITES_ENTRIES_LIST.get(); } + public static List getOverlayTickers() { + return OVERLAY_TICKERS; + } + + public static AutoCraftingEvaluator.Builder getAutoCraftingEvaluator(Display display) { + return AUTO_CRAFTING_EVALUATOR.builder(display); + } + public static DataResult favoriteEntryFromJson(CompoundTag tag) { return favoriteEntryFromJson.apply(tag); } diff --git a/api/src/main/java/me/shedaniel/rei/impl/client/provider/AutoCraftingEvaluator.java b/api/src/main/java/me/shedaniel/rei/impl/client/provider/AutoCraftingEvaluator.java new file mode 100644 index 000000000..413c13d8c --- /dev/null +++ b/api/src/main/java/me/shedaniel/rei/impl/client/provider/AutoCraftingEvaluator.java @@ -0,0 +1,103 @@ +/* + * This file is licensed under the MIT License, part of Roughly Enough Items. + * Copyright (c) 2018, 2019, 2020, 2021, 2022 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.impl.client.provider; + +import me.shedaniel.math.Point; +import me.shedaniel.rei.api.client.gui.widgets.Tooltip; +import me.shedaniel.rei.api.client.registry.transfer.TransferHandler; +import me.shedaniel.rei.api.client.registry.transfer.TransferHandlerRenderer; +import me.shedaniel.rei.api.common.display.Display; +import net.minecraft.resources.ResourceLocation; +import org.jetbrains.annotations.Nullable; + +import java.util.Collection; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +public interface AutoCraftingEvaluator { + Builder builder(Display display); + + interface Builder { + Builder actuallyCraft(); + + default Builder actuallyCraft(boolean build) { + if (build) { + return actuallyCraft(); + } else { + return this; + } + } + + Builder stacked(); + + default Builder stacked(boolean build) { + if (build) { + return stacked(); + } else { + return this; + } + } + + Builder ids(@Nullable Collection ids); + + Builder buildRenderer(); + + default Builder buildRenderer(boolean build) { + if (build) { + return buildRenderer(); + } else { + return this; + } + } + + Builder buildTooltipRenderer(); + + default Builder buildTooltipRenderer(boolean build) { + if (build) { + return buildTooltipRenderer(); + } else { + return this; + } + } + + Result get(); + } + + interface Result { + int getTint(); + + boolean isSuccessful(); + + @Nullable + TransferHandler getSuccessfulHandler(); + + boolean isApplicable(); + + @Nullable + TransferHandlerRenderer getRenderer(); + + @Nullable + BiConsumer> getTooltipRenderer(); + } +} diff --git a/api/src/main/java/me/shedaniel/rei/impl/client/provider/DelegatingFavoriteEntryProvider.java b/api/src/main/java/me/shedaniel/rei/impl/client/provider/DelegatingFavoriteEntryProvider.java index 2eec919f8..48a773dca 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/client/provider/DelegatingFavoriteEntryProvider.java +++ b/api/src/main/java/me/shedaniel/rei/impl/client/provider/DelegatingFavoriteEntryProvider.java @@ -26,9 +26,12 @@ package me.shedaniel.rei.impl.client.provider; import com.mojang.serialization.DataResult; import me.shedaniel.rei.api.client.favorites.FavoriteEntry; import net.minecraft.nbt.CompoundTag; +import org.jetbrains.annotations.ApiStatus; +import org.spongepowered.asm.mixin.injection.Inject; import java.util.function.Supplier; +@ApiStatus.Internal public interface DelegatingFavoriteEntryProvider { FavoriteEntry delegate(Supplier> result, Supplier tag); } diff --git a/api/src/main/java/me/shedaniel/rei/impl/client/provider/FavoritesEntriesListProvider.java b/api/src/main/java/me/shedaniel/rei/impl/client/provider/FavoritesEntriesListProvider.java index d2c1ec23c..05205b1da 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/client/provider/FavoritesEntriesListProvider.java +++ b/api/src/main/java/me/shedaniel/rei/impl/client/provider/FavoritesEntriesListProvider.java @@ -24,9 +24,11 @@ package me.shedaniel.rei.impl.client.provider; import me.shedaniel.rei.api.client.favorites.FavoriteEntry; +import org.jetbrains.annotations.ApiStatus; import java.util.List; +@ApiStatus.Internal public interface FavoritesEntriesListProvider { List get(); } diff --git a/api/src/main/java/me/shedaniel/rei/impl/client/provider/MissingStacksTooltipProvider.java b/api/src/main/java/me/shedaniel/rei/impl/client/provider/MissingStacksTooltipProvider.java index b10675f1f..1d07c370f 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/client/provider/MissingStacksTooltipProvider.java +++ b/api/src/main/java/me/shedaniel/rei/impl/client/provider/MissingStacksTooltipProvider.java @@ -25,9 +25,11 @@ package me.shedaniel.rei.impl.client.provider; import me.shedaniel.rei.api.common.entry.EntryIngredient; import net.minecraft.world.inventory.tooltip.TooltipComponent; +import org.jetbrains.annotations.ApiStatus; import java.util.List; +@ApiStatus.Internal public interface MissingStacksTooltipProvider { TooltipComponent provide(List stacks); } diff --git a/api/src/main/java/me/shedaniel/rei/impl/client/provider/OverlayTicker.java b/api/src/main/java/me/shedaniel/rei/impl/client/provider/OverlayTicker.java new file mode 100644 index 000000000..5f8fd1877 --- /dev/null +++ b/api/src/main/java/me/shedaniel/rei/impl/client/provider/OverlayTicker.java @@ -0,0 +1,31 @@ +/* + * This file is licensed under the MIT License, part of Roughly Enough Items. + * Copyright (c) 2018, 2019, 2020, 2021, 2022 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.impl.client.provider; + +import org.jetbrains.annotations.ApiStatus; + +@ApiStatus.Internal +public interface OverlayTicker { + void tick(); +} diff --git a/api/src/main/java/me/shedaniel/rei/impl/client/provider/WidgetsProvider.java b/api/src/main/java/me/shedaniel/rei/impl/client/provider/WidgetsProvider.java index 6d985e4a2..28d38c24c 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/client/provider/WidgetsProvider.java +++ b/api/src/main/java/me/shedaniel/rei/impl/client/provider/WidgetsProvider.java @@ -33,10 +33,12 @@ import net.minecraft.client.gui.components.events.GuiEventListener; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.FormattedText; import net.minecraft.resources.ResourceLocation; +import org.jetbrains.annotations.ApiStatus; import java.util.List; import java.util.function.Supplier; +@ApiStatus.Internal public interface WidgetsProvider { boolean isRenderingPanel(Panel panel); diff --git a/api/src/main/java/me/shedaniel/rei/impl/common/provider/CategoryIdentifierConstructor.java b/api/src/main/java/me/shedaniel/rei/impl/common/provider/CategoryIdentifierConstructor.java index 11b3b4928..a316f7605 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/common/provider/CategoryIdentifierConstructor.java +++ b/api/src/main/java/me/shedaniel/rei/impl/common/provider/CategoryIdentifierConstructor.java @@ -25,7 +25,9 @@ package me.shedaniel.rei.impl.common.provider; import me.shedaniel.rei.api.common.category.CategoryIdentifier; import me.shedaniel.rei.api.common.display.Display; +import org.jetbrains.annotations.ApiStatus; +@ApiStatus.Internal public interface CategoryIdentifierConstructor { CategoryIdentifier create(String location); } diff --git a/api/src/main/java/me/shedaniel/rei/impl/common/provider/DeferringEntryTypeProvider.java b/api/src/main/java/me/shedaniel/rei/impl/common/provider/DeferringEntryTypeProvider.java index 3abf02a90..eb2240988 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/common/provider/DeferringEntryTypeProvider.java +++ b/api/src/main/java/me/shedaniel/rei/impl/common/provider/DeferringEntryTypeProvider.java @@ -25,7 +25,9 @@ package me.shedaniel.rei.impl.common.provider; import me.shedaniel.rei.api.common.entry.type.EntryType; import net.minecraft.resources.ResourceLocation; +import org.jetbrains.annotations.ApiStatus; +@ApiStatus.Internal public interface DeferringEntryTypeProvider { EntryType get(ResourceLocation id); } diff --git a/api/src/main/java/me/shedaniel/rei/impl/common/provider/EntryIngredientProvider.java b/api/src/main/java/me/shedaniel/rei/impl/common/provider/EntryIngredientProvider.java index 2a0ead5ab..5d86576a1 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/common/provider/EntryIngredientProvider.java +++ b/api/src/main/java/me/shedaniel/rei/impl/common/provider/EntryIngredientProvider.java @@ -25,7 +25,9 @@ package me.shedaniel.rei.impl.common.provider; import me.shedaniel.rei.api.common.entry.EntryIngredient; import me.shedaniel.rei.api.common.entry.EntryStack; +import org.jetbrains.annotations.ApiStatus; +@ApiStatus.Internal public interface EntryIngredientProvider { EntryIngredient empty(); diff --git a/api/src/main/java/me/shedaniel/rei/impl/common/provider/EntryStackProvider.java b/api/src/main/java/me/shedaniel/rei/impl/common/provider/EntryStackProvider.java index cc01fc8ff..91629b0ae 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/common/provider/EntryStackProvider.java +++ b/api/src/main/java/me/shedaniel/rei/impl/common/provider/EntryStackProvider.java @@ -26,7 +26,9 @@ package me.shedaniel.rei.impl.common.provider; import me.shedaniel.rei.api.common.entry.EntryStack; import me.shedaniel.rei.api.common.entry.type.EntryDefinition; import net.minecraft.util.Unit; +import org.jetbrains.annotations.ApiStatus; +@ApiStatus.Internal public interface EntryStackProvider { EntryStack empty(); diff --git a/api/src/main/java/me/shedaniel/rei/impl/common/provider/NbtHasherProvider.java b/api/src/main/java/me/shedaniel/rei/impl/common/provider/NbtHasherProvider.java index b12d6910d..8cd56cc6e 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/common/provider/NbtHasherProvider.java +++ b/api/src/main/java/me/shedaniel/rei/impl/common/provider/NbtHasherProvider.java @@ -25,7 +25,9 @@ package me.shedaniel.rei.impl.common.provider; import me.shedaniel.rei.api.common.entry.comparison.EntryComparator; import net.minecraft.nbt.Tag; +import org.jetbrains.annotations.ApiStatus; +@ApiStatus.Internal public interface NbtHasherProvider { EntryComparator provide(String... ignoredKeys); } diff --git a/api/src/main/java/me/shedaniel/rei/impl/common/provider/PluginManagerConstructor.java b/api/src/main/java/me/shedaniel/rei/impl/common/provider/PluginManagerConstructor.java index b31d4bc45..ce530af90 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/common/provider/PluginManagerConstructor.java +++ b/api/src/main/java/me/shedaniel/rei/impl/common/provider/PluginManagerConstructor.java @@ -26,9 +26,11 @@ package me.shedaniel.rei.impl.common.provider; 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 org.jetbrains.annotations.ApiStatus; import java.util.function.UnaryOperator; +@ApiStatus.Internal public interface PluginManagerConstructor {

> PluginManager

create(Class

clazz, UnaryOperator> constructor); } -- cgit