From 6104964f60bac00a4ac1359bd244d361e50786bd Mon Sep 17 00:00:00 2001 From: shedaniel Date: Thu, 27 Aug 2020 19:36:00 +0800 Subject: Migrate from yarn to mojmap Signed-off-by: shedaniel --- .../me/shedaniel/rei/api/AutoTransferHandler.java | 28 +-- .../java/me/shedaniel/rei/api/BuiltinPlugin.java | 44 ++-- .../java/me/shedaniel/rei/api/ClientHelper.java | 28 +-- .../java/me/shedaniel/rei/api/ConfigManager.java | 6 +- .../java/me/shedaniel/rei/api/DisplayHelper.java | 24 +- .../rei/api/DisplayVisibilityHandler.java | 4 +- .../me/shedaniel/rei/api/DrawableConsumer.java | 6 +- .../java/me/shedaniel/rei/api/EntryRegistry.java | 4 +- .../main/java/me/shedaniel/rei/api/EntryStack.java | 48 ++-- .../me/shedaniel/rei/api/FocusedStackProvider.java | 6 +- .../me/shedaniel/rei/api/LiveRecipeGenerator.java | 4 +- .../java/me/shedaniel/rei/api/OverlayDecider.java | 10 +- .../main/java/me/shedaniel/rei/api/REIHelper.java | 12 +- .../java/me/shedaniel/rei/api/REIPluginEntry.java | 4 +- .../java/me/shedaniel/rei/api/RecipeCategory.java | 4 +- .../java/me/shedaniel/rei/api/RecipeDisplay.java | 6 +- .../java/me/shedaniel/rei/api/RecipeHelper.java | 36 +-- .../me/shedaniel/rei/api/TextRepresentable.java | 12 +- .../main/java/me/shedaniel/rei/api/TextTest.java | 8 +- .../shedaniel/rei/api/TransferRecipeCategory.java | 4 +- .../shedaniel/rei/api/TransferRecipeDisplay.java | 4 +- .../java/me/shedaniel/rei/api/widgets/Button.java | 16 +- .../java/me/shedaniel/rei/api/widgets/Label.java | 28 +-- .../java/me/shedaniel/rei/api/widgets/Tooltip.java | 12 +- .../java/me/shedaniel/rei/api/widgets/Widgets.java | 59 +++-- .../shedaniel/rei/gui/config/AppearanceTheme.java | 4 +- .../rei/gui/config/ConfigButtonPosition.java | 4 +- .../rei/gui/config/DisplayPanelLocation.java | 4 +- .../rei/gui/config/EntryPanelOrderingConfig.java | 4 +- .../shedaniel/rei/gui/config/ItemCheatingMode.java | 4 +- .../rei/gui/config/ItemCheatingStyle.java | 4 +- .../shedaniel/rei/gui/config/RecipeBorderType.java | 4 +- .../shedaniel/rei/gui/config/RecipeScreenType.java | 4 +- .../rei/gui/config/SearchFieldLocation.java | 4 +- .../rei/gui/entries/SimpleRecipeEntry.java | 20 +- .../shedaniel/rei/gui/widget/TextFieldWidget.java | 86 +++---- .../java/me/shedaniel/rei/gui/widget/Widget.java | 17 +- .../main/java/me/shedaniel/rei/impl/Internals.java | 20 +- .../java/me/shedaniel/rei/impl/RenderingEntry.java | 12 +- .../me/shedaniel/rei/server/ContainerContext.java | 8 +- .../me/shedaniel/rei/server/ContainerInfo.java | 32 +-- .../shedaniel/rei/server/ContainerInfoHandler.java | 18 +- .../java/me/shedaniel/rei/server/DumpHandler.java | 8 +- .../me/shedaniel/rei/server/GridCleanHandler.java | 8 +- .../shedaniel/rei/server/GridStacksProvider.java | 4 +- .../rei/server/InventoryStackAccessor.java | 14 +- .../java/me/shedaniel/rei/server/RecipeFinder.java | 36 ++- .../rei/server/RecipeFinderPopulator.java | 4 +- .../me/shedaniel/rei/server/SlotStackAccessor.java | 10 +- .../me/shedaniel/rei/server/StackAccessor.java | 2 +- .../me/shedaniel/rei/utils/CollectionUtils.java | 4 +- .../shedaniel/rei/utils/ImmutableLiteralText.java | 32 +-- RoughlyEnoughItems-default-plugin/build.gradle | 2 +- .../me/shedaniel/rei/plugin/DefaultPlugin.java | 155 ++++++------ .../plugin/DefaultPotionEffectExclusionZones.java | 20 +- .../plugin/DefaultRecipeBookExclusionZones.java | 22 +- .../rei/plugin/DefaultServerContainerPlugin.java | 14 +- .../autocrafting/DefaultRecipeBookHandler.java | 44 ++-- .../plugin/beacon/DefaultBeaconBaseCategory.java | 32 +-- .../plugin/beacon/DefaultBeaconBaseDisplay.java | 6 +- .../plugin/blasting/DefaultBlastingDisplay.java | 6 +- .../rei/plugin/brewing/BrewingRecipe.java | 4 +- .../rei/plugin/brewing/DefaultBrewingCategory.java | 24 +- .../rei/plugin/brewing/DefaultBrewingDisplay.java | 20 +- .../plugin/brewing/RegisteredBrewingRecipe.java | 4 +- .../plugin/campfire/DefaultCampfireCategory.java | 14 +- .../plugin/campfire/DefaultCampfireDisplay.java | 20 +- .../composting/DefaultCompostingCategory.java | 32 +-- .../composting/DefaultCompostingDisplay.java | 14 +- .../containers/CraftingContainerInfoWrapper.java | 26 +- .../rei/plugin/cooking/DefaultCookingCategory.java | 28 +-- .../rei/plugin/cooking/DefaultCookingDisplay.java | 26 +- .../plugin/crafting/DefaultCraftingCategory.java | 32 +-- .../plugin/crafting/DefaultCraftingDisplay.java | 10 +- .../rei/plugin/crafting/DefaultCustomDisplay.java | 8 +- .../rei/plugin/crafting/DefaultShapedDisplay.java | 12 +- .../plugin/crafting/DefaultShapelessDisplay.java | 16 +- .../rei/plugin/fuel/DefaultFuelCategory.java | 24 +- .../rei/plugin/fuel/DefaultFuelDisplay.java | 4 +- .../information/DefaultInformationCategory.java | 80 +++---- .../information/DefaultInformationDisplay.java | 26 +- .../plugin/mixin/MixinBrewingRecipeRegistry.java | 87 ------- .../rei/plugin/mixin/MixinPotionBrewing.java | 88 +++++++ .../rei/plugin/pathing/DefaultPathingCategory.java | 13 +- .../rei/plugin/pathing/DefaultPathingDisplay.java | 12 +- .../rei/plugin/pathing/DummyShovelItem.java | 13 +- .../plugin/smelting/DefaultSmeltingDisplay.java | 6 +- .../plugin/smithing/DefaultSmithingCategory.java | 10 +- .../plugin/smithing/DefaultSmithingDisplay.java | 16 +- .../rei/plugin/smoking/DefaultSmokingDisplay.java | 6 +- .../stonecutting/DefaultStoneCuttingCategory.java | 10 +- .../stonecutting/DefaultStoneCuttingDisplay.java | 26 +- .../plugin/stripping/DefaultStrippingCategory.java | 10 +- .../plugin/stripping/DefaultStrippingDisplay.java | 6 +- .../rei/plugin/stripping/DummyAxeItem.java | 10 +- .../rei/plugin/tilling/DefaultTillingCategory.java | 13 +- .../rei/plugin/tilling/DefaultTillingDisplay.java | 12 +- .../shedaniel/rei/plugin/tilling/DummyHoeItem.java | 12 +- .../mixin.roughlyenoughitems-default-plugin.json | 2 +- ...roughlyenoughitems-default-plugin.accessWidener | 26 +- RoughlyEnoughItems-runtime/build.gradle | 2 +- .../me/shedaniel/rei/RoughlyEnoughItemsCore.java | 169 +++++++------ .../shedaniel/rei/RoughlyEnoughItemsNetwork.java | 108 ++++----- .../me/shedaniel/rei/RoughlyEnoughItemsState.java | 18 +- .../shedaniel/rei/gui/ConfigReloadingScreen.java | 24 +- .../shedaniel/rei/gui/ContainerScreenOverlay.java | 262 ++++++++++----------- .../me/shedaniel/rei/gui/OverlaySearchField.java | 42 ++-- .../shedaniel/rei/gui/PreRecipeViewingScreen.java | 60 ++--- .../shedaniel/rei/gui/RecipeDisplayExporter.java | 62 ++--- .../java/me/shedaniel/rei/gui/RecipeScreen.java | 4 +- .../me/shedaniel/rei/gui/RecipeViewingScreen.java | 146 ++++++------ .../rei/gui/VillagerRecipeViewingScreen.java | 82 +++---- .../shedaniel/rei/gui/WarningAndErrorScreen.java | 120 +++++----- .../gui/config/entry/FilteringAddRuleScreen.java | 70 +++--- .../rei/gui/config/entry/FilteringEntry.java | 32 +-- .../config/entry/FilteringRuleOptionsScreen.java | 80 +++---- .../rei/gui/config/entry/FilteringRulesScreen.java | 98 ++++---- .../rei/gui/config/entry/FilteringScreen.java | 130 +++++----- .../rei/gui/config/entry/NoFilteringEntry.java | 28 +-- .../gui/config/entry/RecipeScreenTypeEntry.java | 38 +-- .../rei/gui/config/entry/ReloadPluginsEntry.java | 34 +-- .../rei/gui/credits/CreditsEntryListWidget.java | 38 +-- .../shedaniel/rei/gui/credits/CreditsScreen.java | 62 ++--- .../java/me/shedaniel/rei/gui/modules/Menu.java | 26 +- .../entries/EntryStackSubsetsMenuEntry.java | 14 +- .../rei/gui/modules/entries/GameModeMenuEntry.java | 32 +-- .../gui/modules/entries/SubSubsetsMenuEntry.java | 48 ++-- .../rei/gui/modules/entries/WeatherMenuEntry.java | 28 +-- .../rei/gui/plugin/DefaultRuntimePlugin.java | 24 +- .../rei/gui/toast/CopyRecipeIdentifierToast.java | 28 +-- .../rei/gui/toast/ExportRecipeIdentifierToast.java | 28 +-- .../me/shedaniel/rei/gui/widget/ButtonWidget.java | 62 ++--- .../rei/gui/widget/ClickableLabelWidget.java | 24 +- .../shedaniel/rei/gui/widget/DraggableWidget.java | 12 +- .../rei/gui/widget/EntryListEntryWidget.java | 18 +- .../shedaniel/rei/gui/widget/EntryListWidget.java | 98 ++++---- .../me/shedaniel/rei/gui/widget/EntryWidget.java | 48 ++-- .../rei/gui/widget/FavoritesListWidget.java | 36 +-- .../me/shedaniel/rei/gui/widget/LabelWidget.java | 36 +-- .../me/shedaniel/rei/gui/widget/PanelWidget.java | 30 +-- .../me/shedaniel/rei/gui/widget/QueuedTooltip.java | 20 +- .../rei/gui/widget/RecipeArrowWidget.java | 20 +- .../rei/gui/widget/RecipeChoosePageWidget.java | 40 ++-- .../me/shedaniel/rei/gui/widget/TabWidget.java | 22 +- .../me/shedaniel/rei/impl/AbstractEntryStack.java | 8 +- .../shedaniel/rei/impl/BaseBoundsHandlerImpl.java | 34 +-- .../me/shedaniel/rei/impl/ClientHelperImpl.java | 152 ++++++------ .../me/shedaniel/rei/impl/ConfigManagerImpl.java | 64 ++--- .../me/shedaniel/rei/impl/ConfigObjectImpl.java | 10 +- .../me/shedaniel/rei/impl/DisplayHelperImpl.java | 10 +- .../me/shedaniel/rei/impl/EmptyEntryStack.java | 8 +- .../me/shedaniel/rei/impl/EntryRegistryImpl.java | 14 +- .../me/shedaniel/rei/impl/FluidEntryStack.java | 74 +++--- .../me/shedaniel/rei/impl/InternalWidgets.java | 64 ++--- .../java/me/shedaniel/rei/impl/ItemEntryStack.java | 108 ++++----- .../me/shedaniel/rei/impl/OptimalEntryStack.java | 12 +- .../me/shedaniel/rei/impl/RecipeHelperImpl.java | 124 +++++----- .../java/me/shedaniel/rei/impl/ScreenHelper.java | 54 ++--- .../java/me/shedaniel/rei/impl/SearchArgument.java | 8 +- .../me/shedaniel/rei/impl/SimpleFluidRenderer.java | 22 +- .../rei/impl/filtering/FilteringRule.java | 32 +-- .../impl/filtering/rules/ManualFilteringRule.java | 12 +- .../impl/filtering/rules/SearchFilteringRule.java | 28 +-- .../me/shedaniel/rei/impl/search/ModArgument.java | 4 +- .../me/shedaniel/rei/impl/search/TagArgument.java | 14 +- .../rei/impl/subsets/SubsetsRegistryImpl.java | 4 +- .../me/shedaniel/rei/impl/widgets/ArrowWidget.java | 20 +- .../rei/impl/widgets/BurningFireWidget.java | 20 +- .../shedaniel/rei/impl/widgets/ButtonWidget.java | 74 +++--- .../shedaniel/rei/impl/widgets/DrawableWidget.java | 8 +- .../widgets/FillRectangleDrawableConsumer.java | 28 +-- .../me/shedaniel/rei/impl/widgets/LabelWidget.java | 46 ++-- .../me/shedaniel/rei/impl/widgets/PanelWidget.java | 42 ++-- .../rei/impl/widgets/TexturedDrawableConsumer.java | 38 ++- .../me/shedaniel/rei/mixin/MixinItemStack.java | 4 +- .../autocrafting/DefaultCategoryHandler.java | 53 ++--- .../me/shedaniel/rei/server/InputSlotCrafter.java | 56 ++--- .../shedaniel/rei/tests/plugin/REITestPlugin.java | 12 +- .../roughlyenoughitems-runtime.accessWidener | 24 +- build.gradle | 7 +- gradle.properties | 4 +- src/main/resources/fabric.mod.json | 2 +- 182 files changed, 2790 insertions(+), 2802 deletions(-) delete mode 100644 RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/mixin/MixinBrewingRecipeRegistry.java create mode 100644 RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/mixin/MixinPotionBrewing.java diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java index 45341c88e..809165a8f 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java @@ -27,9 +27,9 @@ import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.screen.ingame.ContainerScreen; -import net.minecraft.container.Container; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; +import net.minecraft.world.inventory.AbstractContainerMenu; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; @@ -170,21 +170,21 @@ public interface AutoTransferHandler { } interface Context { - static Context create(boolean actuallyCrafting, ContainerScreen containerScreen, RecipeDisplay recipeDisplay) { + static Context create(boolean actuallyCrafting, AbstractContainerScreen containerScreen, RecipeDisplay recipeDisplay) { return new ContextImpl(actuallyCrafting, containerScreen, () -> recipeDisplay); } - default MinecraftClient getMinecraft() { - return MinecraftClient.getInstance(); + default Minecraft getMinecraft() { + return Minecraft.getInstance(); } boolean isActuallyCrafting(); - ContainerScreen getContainerScreen(); + AbstractContainerScreen getContainerScreen(); @Deprecated @ApiStatus.ScheduledForRemoval - default ContainerScreen getHandledScreen() { + default AbstractContainerScreen getHandledScreen() { return getContainerScreen(); } @@ -192,12 +192,12 @@ public interface AutoTransferHandler { @Deprecated @ApiStatus.ScheduledForRemoval - default Container getScreenHandler() { + default AbstractContainerMenu getScreenHandler() { return getContainer(); } - default Container getContainer() { - return getHandledScreen().getContainer(); + default AbstractContainerMenu getContainer() { + return getHandledScreen().getMenu(); } } @@ -276,10 +276,10 @@ public interface AutoTransferHandler { @ApiStatus.Internal final class ContextImpl implements Context { private boolean actuallyCrafting; - private ContainerScreen containerScreen; + private AbstractContainerScreen containerScreen; private Supplier recipeDisplaySupplier; - private ContextImpl(boolean actuallyCrafting, ContainerScreen containerScreen, Supplier recipeDisplaySupplier) { + private ContextImpl(boolean actuallyCrafting, AbstractContainerScreen containerScreen, Supplier recipeDisplaySupplier) { this.actuallyCrafting = actuallyCrafting; this.containerScreen = containerScreen; this.recipeDisplaySupplier = recipeDisplaySupplier; @@ -291,7 +291,7 @@ public interface AutoTransferHandler { } @Override - public ContainerScreen getContainerScreen() { + public AbstractContainerScreen getContainerScreen() { return containerScreen; } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/BuiltinPlugin.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/BuiltinPlugin.java index f33a1953e..49a9b7746 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/BuiltinPlugin.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/BuiltinPlugin.java @@ -24,32 +24,32 @@ package me.shedaniel.rei.api; import me.shedaniel.rei.impl.Internals; -import net.minecraft.item.ItemStack; -import net.minecraft.recipe.Ingredient; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; import java.util.Collections; import java.util.List; import java.util.function.UnaryOperator; public interface BuiltinPlugin { - Identifier CRAFTING = new Identifier("minecraft", "plugins/crafting"); - Identifier SMELTING = new Identifier("minecraft", "plugins/smelting"); - Identifier SMOKING = new Identifier("minecraft", "plugins/smoking"); - Identifier BLASTING = new Identifier("minecraft", "plugins/blasting"); - Identifier CAMPFIRE = new Identifier("minecraft", "plugins/campfire"); - Identifier STONE_CUTTING = new Identifier("minecraft", "plugins/stone_cutting"); - Identifier STRIPPING = new Identifier("minecraft", "plugins/stripping"); - Identifier BREWING = new Identifier("minecraft", "plugins/brewing"); - Identifier PLUGIN = new Identifier("roughlyenoughitems", "default_plugin"); - Identifier COMPOSTING = new Identifier("minecraft", "plugins/composting"); - Identifier FUEL = new Identifier("minecraft", "plugins/fuel"); - Identifier SMITHING = new Identifier("minecraft", "plugins/smithing"); - Identifier BEACON = new Identifier("minecraft", "plugins/beacon"); - Identifier TILLING = new Identifier("minecraft", "plugins/tilling"); - Identifier PATHING = new Identifier("minecraft", "plugins/pathing"); - Identifier INFO = new Identifier("roughlyenoughitems", "plugins/information"); + ResourceLocation CRAFTING = new ResourceLocation("minecraft", "plugins/crafting"); + ResourceLocation SMELTING = new ResourceLocation("minecraft", "plugins/smelting"); + ResourceLocation SMOKING = new ResourceLocation("minecraft", "plugins/smoking"); + ResourceLocation BLASTING = new ResourceLocation("minecraft", "plugins/blasting"); + ResourceLocation CAMPFIRE = new ResourceLocation("minecraft", "plugins/campfire"); + ResourceLocation STONE_CUTTING = new ResourceLocation("minecraft", "plugins/stone_cutting"); + ResourceLocation STRIPPING = new ResourceLocation("minecraft", "plugins/stripping"); + ResourceLocation BREWING = new ResourceLocation("minecraft", "plugins/brewing"); + ResourceLocation PLUGIN = new ResourceLocation("roughlyenoughitems", "default_plugin"); + ResourceLocation COMPOSTING = new ResourceLocation("minecraft", "plugins/composting"); + ResourceLocation FUEL = new ResourceLocation("minecraft", "plugins/fuel"); + ResourceLocation SMITHING = new ResourceLocation("minecraft", "plugins/smithing"); + ResourceLocation BEACON = new ResourceLocation("minecraft", "plugins/beacon"); + ResourceLocation TILLING = new ResourceLocation("minecraft", "plugins/tilling"); + ResourceLocation PATHING = new ResourceLocation("minecraft", "plugins/pathing"); + ResourceLocation INFO = new ResourceLocation("roughlyenoughitems", "plugins/information"); static BuiltinPlugin getInstance() { return Internals.getBuiltinPlugin(); @@ -57,9 +57,9 @@ public interface BuiltinPlugin { void registerBrewingRecipe(ItemStack input, Ingredient ingredient, ItemStack output); - void registerInformation(List entryStacks, Text name, UnaryOperator> textBuilder); + void registerInformation(List entryStacks, Component name, UnaryOperator> textBuilder); - default void registerInformation(EntryStack entryStack, Text name, UnaryOperator> textBuilder) { + default void registerInformation(EntryStack entryStack, Component name, UnaryOperator> textBuilder) { registerInformation(Collections.singletonList(entryStack), name, textBuilder); } } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java index 2cfcf3ff7..e6b67ff3c 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java @@ -27,10 +27,10 @@ import me.shedaniel.rei.impl.Internals; import me.shedaniel.rei.utils.CollectionUtils; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -146,7 +146,7 @@ public interface ClientHelper { * @param item the item to find * @return the mod name with blue and italic formatting */ - Text getFormattedModFromItem(Item item); + Component getFormattedModFromItem(Item item); /** * Gets the formatted mod from an identifier @@ -154,7 +154,7 @@ public interface ClientHelper { * @param identifier the identifier to find * @return the mod name with blue and italic formatting */ - Text getFormattedModFromIdentifier(Identifier identifier); + Component getFormattedModFromIdentifier(ResourceLocation identifier); /** * Gets the mod from an identifier @@ -162,7 +162,7 @@ public interface ClientHelper { * @param identifier the identifier to find * @return the mod name */ - default String getModFromIdentifier(Identifier identifier) { + default String getModFromIdentifier(ResourceLocation identifier) { if (identifier == null) return ""; return getModFromModId(identifier.getNamespace()); @@ -189,13 +189,13 @@ public interface ClientHelper { @Deprecated @ApiStatus.ScheduledForRemoval - default boolean executeViewAllRecipesFromCategory(Identifier category) { + default boolean executeViewAllRecipesFromCategory(ResourceLocation category) { return openView(ViewSearchBuilder.builder().addCategory(category).fillPreferredOpenedCategory()); } @Deprecated @ApiStatus.ScheduledForRemoval - default boolean executeViewAllRecipesFromCategories(List categories) { + default boolean executeViewAllRecipesFromCategories(List categories) { return openView(ViewSearchBuilder.builder().addCategories(categories).fillPreferredOpenedCategory()); } @@ -208,15 +208,15 @@ public interface ClientHelper { return Internals.createViewSearchBuilder(); } - ViewSearchBuilder addCategory(Identifier category); + ViewSearchBuilder addCategory(ResourceLocation category); - ViewSearchBuilder addCategories(Collection categories); + ViewSearchBuilder addCategories(Collection categories); default ViewSearchBuilder addAllCategories() { return addCategories(CollectionUtils.map(RecipeHelper.getInstance().getAllCategories(), RecipeCategory::getIdentifier)); } - @NotNull Set getCategories(); + @NotNull Set getCategories(); ViewSearchBuilder addRecipesFor(EntryStack stack); @@ -226,10 +226,10 @@ public interface ClientHelper { @NotNull List getUsagesFor(); - ViewSearchBuilder setPreferredOpenedCategory(@Nullable Identifier category); + ViewSearchBuilder setPreferredOpenedCategory(@Nullable ResourceLocation category); @Nullable - Identifier getPreferredOpenedCategory(); + ResourceLocation getPreferredOpenedCategory(); ViewSearchBuilder fillPreferredOpenedCategory(); diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigManager.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigManager.java index 011b53a12..85565a53c 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigManager.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigManager.java @@ -26,8 +26,8 @@ package me.shedaniel.rei.api; import me.shedaniel.rei.impl.Internals; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.screens.Screen; import org.jetbrains.annotations.NotNull; @Environment(EnvType.CLIENT) @@ -64,7 +64,7 @@ public interface ConfigManager { * @param parent the screen shown before */ default void openConfigScreen(Screen parent) { - MinecraftClient.getInstance().openScreen(getConfigScreen(parent)); + Minecraft.getInstance().setScreen(getConfigScreen(parent)); } /** diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java index 94d3cf9d6..6693189ea 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java @@ -29,14 +29,14 @@ import me.shedaniel.rei.gui.config.SearchFieldLocation; import me.shedaniel.rei.impl.Internals; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.util.ActionResult; +import net.minecraft.world.InteractionResult; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.function.Supplier; -import static net.minecraft.util.ActionResult.PASS; +import static net.minecraft.world.InteractionResult.PASS; @Environment(EnvType.CLIENT) public interface DisplayHelper { @@ -166,20 +166,20 @@ public interface DisplayHelper { * @return whether the item slot can fit * @see BaseBoundsHandler#registerExclusionZones(Class, Supplier) for easier api */ - default ActionResult canItemSlotWidgetFit(int left, int top, T screen, Rectangle fullBounds) { - ActionResult fit = isInZone(left, top); - if (fit == ActionResult.FAIL) - return ActionResult.FAIL; - ActionResult fit2 = isInZone(left + 18, top + 18); - if (fit2 == ActionResult.FAIL) - return ActionResult.FAIL; - if (fit == ActionResult.SUCCESS && fit2 == ActionResult.SUCCESS) - return ActionResult.SUCCESS; + default InteractionResult canItemSlotWidgetFit(int left, int top, T screen, Rectangle fullBounds) { + InteractionResult fit = isInZone(left, top); + if (fit == InteractionResult.FAIL) + return InteractionResult.FAIL; + InteractionResult fit2 = isInZone(left + 18, top + 18); + if (fit2 == InteractionResult.FAIL) + return InteractionResult.FAIL; + if (fit == InteractionResult.SUCCESS && fit2 == InteractionResult.SUCCESS) + return InteractionResult.SUCCESS; return PASS; } @Override - default ActionResult isInZone(double mouseX, double mouseY) { + default InteractionResult isInZone(double mouseX, double mouseY) { return OverlayDecider.super.isInZone(mouseX, mouseY); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java index 732e95949..82d5c901f 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java @@ -23,7 +23,7 @@ package me.shedaniel.rei.api; -import net.minecraft.util.ActionResult; +import net.minecraft.world.InteractionResult; public interface DisplayVisibilityHandler { @@ -46,6 +46,6 @@ public interface DisplayVisibilityHandler { * @param display the display of the recipe * @return the visibility */ - ActionResult handleDisplay(RecipeCategory category, RecipeDisplay display); + InteractionResult handleDisplay(RecipeCategory category, RecipeDisplay display); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java index 3aaf05ba6..30d65028a 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java @@ -23,13 +23,13 @@ package me.shedaniel.rei.api; -import net.minecraft.client.gui.DrawableHelper; -import net.minecraft.client.util.math.MatrixStack; +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.gui.GuiComponent; import org.jetbrains.annotations.NotNull; /** * Consumer of a {@link DrawableHelper} and information of mouse and delta. */ public interface DrawableConsumer { - void render(@NotNull DrawableHelper helper, @NotNull MatrixStack matrices, int mouseX, int mouseY, float delta); + void render(@NotNull GuiComponent helper, @NotNull PoseStack matrices, int mouseX, int mouseY, float delta); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryRegistry.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryRegistry.java index fd7fac2d8..7d32ccf40 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryRegistry.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryRegistry.java @@ -26,8 +26,8 @@ package me.shedaniel.rei.api; import me.shedaniel.rei.impl.Internals; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryStack.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryStack.java index 716257e13..0b1431a35 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryStack.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryStack.java @@ -25,6 +25,7 @@ package me.shedaniel.rei.api; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.mojang.blaze3d.vertex.PoseStack; import me.shedaniel.math.Point; import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.fluid.FluidSupportProvider; @@ -33,18 +34,17 @@ import me.shedaniel.rei.api.widgets.Tooltip; import me.shedaniel.rei.impl.Internals; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.resource.language.I18n; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.fluid.Fluid; -import net.minecraft.item.Item; -import net.minecraft.item.ItemConvertible; -import net.minecraft.item.ItemStack; +import net.minecraft.client.resources.language.I18n; +import net.minecraft.core.Registry; import net.minecraft.nbt.CompoundTag; -import net.minecraft.nbt.StringNbtReader; -import net.minecraft.recipe.Ingredient; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; +import net.minecraft.nbt.TagParser; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.level.ItemLike; +import net.minecraft.world.level.material.Fluid; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; @@ -79,13 +79,13 @@ public interface EntryStack extends TextRepresentable { return Internals.getEntryStackProvider().item(stack); } - static EntryStack create(ItemConvertible item) { + static EntryStack create(ItemLike item) { return create(new ItemStack(item)); } - static List ofItems(Collection stacks) { + static List ofItems(Collection stacks) { List result = new ArrayList<>(stacks.size()); - for (ItemConvertible stack : stacks) { + for (ItemLike stack : stacks) { result.add(create(stack)); } return result; @@ -100,7 +100,7 @@ public interface EntryStack extends TextRepresentable { } static List ofIngredient(Ingredient ingredient) { - ItemStack[] matchingStacks = ingredient.getMatchingStacksClient(); + ItemStack[] matchingStacks = ingredient.getItems(); List result = new ArrayList<>(matchingStacks.length); for (ItemStack matchingStack : matchingStacks) { result.add(create(matchingStack)); @@ -140,9 +140,9 @@ public interface EntryStack extends TextRepresentable { JsonObject obj = jsonElement.getAsJsonObject(); switch (obj.getAsJsonPrimitive("type").getAsString()) { case "stack": - return EntryStack.create(ItemStack.fromTag(StringNbtReader.parse(obj.get("nbt").getAsString()))); + return EntryStack.create(ItemStack.of(TagParser.parseTag(obj.get("nbt").getAsString()))); case "fluid": - return EntryStack.create(Registry.FLUID.get(Identifier.tryParse(obj.get("id").getAsString()))); + return EntryStack.create(Registry.FLUID.get(ResourceLocation.tryParse(obj.get("id").getAsString()))); case "empty": return EntryStack.empty(); default: @@ -162,10 +162,10 @@ public interface EntryStack extends TextRepresentable { case ITEM: JsonObject obj1 = new JsonObject(); obj1.addProperty("type", "stack"); - obj1.addProperty("nbt", getItemStack().toTag(new CompoundTag()).toString()); + obj1.addProperty("nbt", getItemStack().save(new CompoundTag()).toString()); return obj1; case FLUID: - Optional optionalIdentifier = getIdentifier(); + Optional optionalIdentifier = getIdentifier(); if (!optionalIdentifier.isPresent()) throw new NullPointerException("Invalid Fluid: " + toString()); JsonObject obj2 = new JsonObject(); @@ -194,7 +194,7 @@ public interface EntryStack extends TextRepresentable { @Deprecated @ApiStatus.ScheduledForRemoval static EntryStack copyFluidToItem(EntryStack stack) { - Item bucketItem = stack.getFluid().getBucketItem(); + Item bucketItem = stack.getFluid().getBucket(); if (bucketItem != null) { return EntryStack.create(bucketItem); } @@ -211,7 +211,7 @@ public interface EntryStack extends TextRepresentable { return FluidSupportProvider.getInstance().itemToFluid(stack); } - Optional getIdentifier(); + Optional getIdentifier(); EntryStack.Type getType(); @@ -318,7 +318,7 @@ public interface EntryStack extends TextRepresentable { return null; } - void render(MatrixStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta); + void render(PoseStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta); enum Type { ITEM, @@ -336,7 +336,7 @@ public interface EntryStack extends TextRepresentable { public static final Settings> TOOLTIP_ENABLED = new Settings<>(TRUE); public static final Settings> TOOLTIP_APPEND_MOD = new Settings<>(TRUE); public static final Settings> RENDER_COUNTS = new Settings<>(TRUE); - public static final Settings>> TOOLTIP_APPEND_EXTRA = new Settings<>(stack -> Collections.emptyList()); + public static final Settings>> TOOLTIP_APPEND_EXTRA = new Settings<>(stack -> Collections.emptyList()); public static final Settings> COUNTS = new Settings<>(stack -> null); private T defaultValue; @@ -358,7 +358,7 @@ public interface EntryStack extends TextRepresentable { public static class Fluid { // Return null to disable - public static final Settings> AMOUNT_TOOLTIP = new Settings<>(stack -> I18n.translate("tooltip.rei.fluid_amount", stack.simplifyAmount().getAccurateAmount())); + public static final Settings> AMOUNT_TOOLTIP = new Settings<>(stack -> I18n.get("tooltip.rei.fluid_amount", stack.simplifyAmount().getAccurateAmount())); private Fluid() { } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/FocusedStackProvider.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/FocusedStackProvider.java index ec13a37cc..6fc26ca55 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/FocusedStackProvider.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/FocusedStackProvider.java @@ -23,8 +23,8 @@ package me.shedaniel.rei.api; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.util.TypedActionResult; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.world.InteractionResultHolder; import org.jetbrains.annotations.NotNull; public interface FocusedStackProvider { @@ -36,5 +36,5 @@ public interface FocusedStackProvider { } @NotNull - TypedActionResult provide(Screen screen); + InteractionResultHolder provide(Screen screen); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java index 05aa96ddf..6c57bda5a 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java @@ -23,7 +23,7 @@ package me.shedaniel.rei.api; -import net.minecraft.util.Identifier; +import net.minecraft.resources.ResourceLocation; import java.util.List; import java.util.Optional; @@ -33,7 +33,7 @@ public interface LiveRecipeGenerator { /** * @return the identifier of the category the recipes goes to. */ - Identifier getCategoryIdentifier(); + ResourceLocation getCategoryIdentifier(); default Optional> getRecipeFor(EntryStack entry) { return Optional.empty(); diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/OverlayDecider.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/OverlayDecider.java index 500d9f058..a4907147d 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/OverlayDecider.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/OverlayDecider.java @@ -25,15 +25,15 @@ package me.shedaniel.rei.api; import me.shedaniel.math.Rectangle; import me.shedaniel.rei.gui.config.DisplayPanelLocation; -import net.minecraft.util.ActionResult; +import net.minecraft.world.InteractionResult; -import static net.minecraft.util.ActionResult.PASS; +import static net.minecraft.world.InteractionResult.PASS; public interface OverlayDecider { boolean isHandingScreen(Class screen); - default ActionResult shouldScreenBeOverlayed(Class screen) { - return ActionResult.PASS; + default InteractionResult shouldScreenBeOverlayed(Class screen) { + return InteractionResult.PASS; } /** @@ -63,7 +63,7 @@ public interface OverlayDecider { * @param mouseY mouse's y coordinates * @return whether mouse is inside the overlay */ - default ActionResult isInZone(double mouseX, double mouseY) { + default InteractionResult isInZone(double mouseX, double mouseY) { return PASS; } } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIHelper.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIHelper.java index 007ac6e6c..f6df5ab92 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIHelper.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIHelper.java @@ -28,9 +28,9 @@ import me.shedaniel.rei.gui.widget.TextFieldWidget; import me.shedaniel.rei.impl.Internals; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.gui.screen.ingame.ContainerScreen; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Identifier; +import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; @@ -50,10 +50,10 @@ public interface REIHelper { @ApiStatus.Experimental Optional getOverlay(); - ContainerScreen getPreviousContainerScreen(); + AbstractContainerScreen getPreviousContainerScreen(); @Deprecated - default ContainerScreen getPreviousHandledScreen() { + default AbstractContainerScreen getPreviousHandledScreen() { return getPreviousContainerScreen(); } @@ -65,5 +65,5 @@ public interface REIHelper { void queueTooltip(@Nullable Tooltip tooltip); - Identifier getDefaultDisplayTexture(); + ResourceLocation getDefaultDisplayTexture(); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java index 220318753..6bf43e5a5 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java @@ -25,7 +25,7 @@ package me.shedaniel.rei.api; import net.fabricmc.loader.api.SemanticVersion; import net.fabricmc.loader.util.version.VersionParsingException; -import net.minecraft.util.Identifier; +import net.minecraft.resources.ResourceLocation; import org.jetbrains.annotations.ApiStatus; /** @@ -53,6 +53,6 @@ public interface REIPluginEntry { /** * @return the unique identifier of the plugin. */ - Identifier getPluginIdentifier(); + ResourceLocation getPluginIdentifier(); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeCategory.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeCategory.java index 809a7e171..4136f3aa9 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeCategory.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeCategory.java @@ -30,7 +30,7 @@ import me.shedaniel.rei.gui.entries.SimpleRecipeEntry; import me.shedaniel.rei.gui.widget.Widget; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.util.Identifier; +import net.minecraft.resources.ResourceLocation; import org.jetbrains.annotations.ApiStatus; import java.util.Collections; @@ -44,7 +44,7 @@ public interface RecipeCategory { * * @return the unique identifier of the category */ - Identifier getIdentifier(); + ResourceLocation getIdentifier(); /** * Gets the renderer of the icon, allowing developers to render things other than items diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java index 32177e121..a22dea125 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java @@ -24,7 +24,7 @@ package me.shedaniel.rei.api; import me.shedaniel.rei.utils.CollectionUtils; -import net.minecraft.util.Identifier; +import net.minecraft.resources.ResourceLocation; import org.jetbrains.annotations.ApiStatus; import java.util.Collections; @@ -68,14 +68,14 @@ public interface RecipeDisplay { * * @return the identifier of the category */ - Identifier getRecipeCategory(); + ResourceLocation getRecipeCategory(); /** * Gets the recipe location from datapack. * * @return the recipe location */ - default Optional getRecipeLocation() { + default Optional getRecipeLocation() { return Optional.empty(); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeHelper.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeHelper.java index b199c7e8f..79bff2d4c 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeHelper.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeHelper.java @@ -27,11 +27,11 @@ import me.shedaniel.math.Rectangle; import me.shedaniel.rei.impl.Internals; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.screen.ingame.ContainerScreen; -import net.minecraft.recipe.Recipe; -import net.minecraft.recipe.RecipeManager; -import net.minecraft.util.Identifier; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeManager; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -108,7 +108,7 @@ public interface RecipeHelper { * @param category the category * @param workingStations the working stations */ - void registerWorkingStations(Identifier category, List... workingStations); + void registerWorkingStations(ResourceLocation category, List... workingStations); /** * Registers the working stations of a category @@ -116,9 +116,9 @@ public interface RecipeHelper { * @param category the category * @param workingStations the working stations */ - void registerWorkingStations(Identifier category, EntryStack... workingStations); + void registerWorkingStations(ResourceLocation category, EntryStack... workingStations); - List> getWorkingStations(Identifier category); + List> getWorkingStations(ResourceLocation category); /** * Registers a recipe display. @@ -136,7 +136,7 @@ public interface RecipeHelper { */ @ApiStatus.ScheduledForRemoval @Deprecated - default void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display) { + default void registerDisplay(ResourceLocation categoryIdentifier, RecipeDisplay display) { registerDisplay(display); } @@ -150,7 +150,7 @@ public interface RecipeHelper { */ Map, List> getRecipesFor(EntryStack stack); - RecipeCategory getCategory(Identifier identifier); + RecipeCategory getCategory(ResourceLocation identifier); /** * Gets the vanilla recipe manager @@ -188,14 +188,14 @@ public interface RecipeHelper { * @param category the category of the button area * @param rectangle the button area */ - void registerAutoCraftButtonArea(Identifier category, ButtonAreaSupplier rectangle); + void registerAutoCraftButtonArea(ResourceLocation category, ButtonAreaSupplier rectangle); /** * Removes the auto crafting button * * @param category the category of the button */ - default void removeAutoCraftButton(Identifier category) { + default void removeAutoCraftButton(ResourceLocation category) { registerAutoCraftButtonArea(category, bounds -> null); } @@ -241,7 +241,7 @@ public interface RecipeHelper { */ boolean isDisplayVisible(RecipeDisplay display); - > void registerRecipes(Identifier category, Predicate recipeFilter, Function mappingFunction); + > void registerRecipes(ResourceLocation category, Predicate recipeFilter, Function mappingFunction); /** * Registers a live recipe generator. @@ -251,11 +251,11 @@ public interface RecipeHelper { */ void registerLiveRecipeGenerator(LiveRecipeGenerator liveRecipeGenerator); - void registerScreenClickArea(Rectangle rectangle, Class> screenClass, Identifier... categories); + void registerScreenClickArea(Rectangle rectangle, Class> screenClass, ResourceLocation... categories); - > void registerRecipes(Identifier category, Class recipeClass, Function mappingFunction); + > void registerRecipes(ResourceLocation category, Class recipeClass, Function mappingFunction); - > void registerRecipes(Identifier category, Function recipeFilter, Function mappingFunction); + > void registerRecipes(ResourceLocation category, Function recipeFilter, Function mappingFunction); List getScreenClickAreas(); @@ -263,11 +263,11 @@ public interface RecipeHelper { boolean arePluginsLoading(); interface ScreenClickArea { - Class getScreenClass(); + Class getScreenClass(); Rectangle getRectangle(); - Identifier[] getCategories(); + ResourceLocation[] getCategories(); } } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java index 168098f72..96ca2c7af 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java @@ -28,24 +28,24 @@ import me.shedaniel.rei.api.widgets.Tooltip; import me.shedaniel.rei.utils.FormattingUtils; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.text.LiteralText; -import net.minecraft.text.Text; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TextComponent; import org.jetbrains.annotations.NotNull; @Environment(EnvType.CLIENT) public interface TextRepresentable { @NotNull - default Text asFormattedText() { + default Component asFormattedText() { if (this instanceof EntryStack) { Tooltip tooltip = ((EntryStack) this).getTooltip(PointHelper.ofMouse()); if (tooltip != null && !tooltip.getText().isEmpty()) return tooltip.getText().get(0); } - return new LiteralText(""); + return new TextComponent(""); } @NotNull - default Text asFormatStrippedText() { - return new LiteralText(FormattingUtils.stripFormatting(asFormattedText().getString())); + default Component asFormatStrippedText() { + return new TextComponent(FormattingUtils.stripFormatting(asFormattedText().getString())); } } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextTest.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextTest.java index ab5289f78..b4c7554ef 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextTest.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextTest.java @@ -23,16 +23,16 @@ package me.shedaniel.rei.api; -import net.minecraft.text.LiteralText; -import net.minecraft.text.MutableText; -import net.minecraft.util.Formatting; +import net.minecraft.ChatFormatting; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.network.chat.TextComponent; import org.jetbrains.annotations.ApiStatus; @ApiStatus.ScheduledForRemoval(inVersion = "1.17") @Deprecated public class TextTest { public static void main(String[] args) { - MutableText text = new LiteralText("adaw").append("dawdwdaw").formatted(Formatting.RED); + MutableComponent text = new TextComponent("adaw").append("dawdwdaw").withStyle(ChatFormatting.RED); System.out.println(text.getString()); System.out.println(text.getString()); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java index 72fd09335..b2a9798f5 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java @@ -23,15 +23,15 @@ package me.shedaniel.rei.api; +import com.mojang.blaze3d.vertex.PoseStack; import it.unimi.dsi.fastutil.ints.IntList; import me.shedaniel.math.Rectangle; import me.shedaniel.rei.gui.widget.Widget; -import net.minecraft.client.util.math.MatrixStack; import org.jetbrains.annotations.ApiStatus; import java.util.List; public interface TransferRecipeCategory extends RecipeCategory { @ApiStatus.OverrideOnly - void renderRedSlots(MatrixStack matrices, List widgets, Rectangle bounds, T display, IntList redSlots); + void renderRedSlots(PoseStack matrices, List widgets, Rectangle bounds, T display, IntList redSlots); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java index 900faa39e..d3f937410 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java @@ -24,7 +24,7 @@ package me.shedaniel.rei.api; import me.shedaniel.rei.server.ContainerInfo; -import net.minecraft.container.Container; +import net.minecraft.world.inventory.AbstractContainerMenu; import java.util.List; @@ -40,6 +40,6 @@ public interface TransferRecipeDisplay extends RecipeDisplay { */ int getHeight(); - List> getOrganisedInputEntries(ContainerInfo containerInfo, Container container); + List> getOrganisedInputEntries(ContainerInfo containerInfo, AbstractContainerMenu container); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/widgets/Button.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/widgets/Button.java index 0a39cf91d..4df05b656 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/widgets/Button.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/widgets/Button.java @@ -23,9 +23,9 @@ package me.shedaniel.rei.api.widgets; +import com.mojang.blaze3d.vertex.PoseStack; import me.shedaniel.math.Point; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.text.Text; +import net.minecraft.network.chat.Component; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -79,12 +79,12 @@ public abstract class Button extends BaseWidget