Browse Source

Migrate from yarn to mojmap

Signed-off-by: shedaniel <daniel@shedaniel.me>
shedaniel 4 years ago
parent
commit
4439a24489
100 changed files with 875 additions and 884 deletions
  1. 14 14
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java
  2. 22 22
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/BuiltinPlugin.java
  3. 14 14
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java
  4. 3 3
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigManager.java
  5. 12 12
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java
  6. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java
  7. 3 3
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java
  8. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryRegistry.java
  9. 24 24
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryStack.java
  10. 3 3
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/FocusedStackProvider.java
  11. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java
  12. 5 5
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/OverlayDecider.java
  13. 6 6
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIHelper.java
  14. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java
  15. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeCategory.java
  16. 3 3
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java
  17. 18 18
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeHelper.java
  18. 6 6
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java
  19. 4 4
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextTest.java
  20. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java
  21. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java
  22. 8 8
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/widgets/Button.java
  23. 14 14
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/widgets/Label.java
  24. 6 6
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/widgets/Tooltip.java
  25. 29 30
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/widgets/Widgets.java
  26. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/AppearanceTheme.java
  27. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/ConfigButtonPosition.java
  28. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/DisplayPanelLocation.java
  29. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/EntryPanelOrderingConfig.java
  30. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/ItemCheatingMode.java
  31. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/ItemCheatingStyle.java
  32. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/RecipeBorderType.java
  33. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/RecipeScreenType.java
  34. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/SearchFieldLocation.java
  35. 10 10
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/entries/SimpleRecipeEntry.java
  36. 43 43
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java
  37. 8 9
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/widget/Widget.java
  38. 10 10
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/impl/Internals.java
  39. 6 6
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/impl/RenderingEntry.java
  40. 4 4
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/ContainerContext.java
  41. 16 16
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/ContainerInfo.java
  42. 9 9
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/ContainerInfoHandler.java
  43. 4 4
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/DumpHandler.java
  44. 4 4
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/GridCleanHandler.java
  45. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/GridStacksProvider.java
  46. 7 7
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/InventoryStackAccessor.java
  47. 17 19
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/RecipeFinder.java
  48. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/RecipeFinderPopulator.java
  49. 5 5
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/SlotStackAccessor.java
  50. 1 1
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/StackAccessor.java
  51. 2 2
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/utils/CollectionUtils.java
  52. 18 14
      RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/utils/ImmutableLiteralText.java
  53. 1 1
      RoughlyEnoughItems-default-plugin/build.gradle
  54. 78 77
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
  55. 10 10
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java
  56. 11 11
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java
  57. 7 7
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultServerContainerPlugin.java
  58. 22 22
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java
  59. 16 16
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/beacon/DefaultBeaconBaseCategory.java
  60. 3 3
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/beacon/DefaultBeaconBaseDisplay.java
  61. 3 3
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingDisplay.java
  62. 2 2
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/brewing/BrewingRecipe.java
  63. 12 12
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java
  64. 10 10
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java
  65. 2 2
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/brewing/RegisteredBrewingRecipe.java
  66. 7 7
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java
  67. 10 10
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireDisplay.java
  68. 16 16
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java
  69. 7 7
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingDisplay.java
  70. 13 13
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/containers/CraftingContainerInfoWrapper.java
  71. 14 14
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java
  72. 13 13
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java
  73. 16 16
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java
  74. 5 5
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingDisplay.java
  75. 4 4
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCustomDisplay.java
  76. 6 6
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapedDisplay.java
  77. 8 8
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapelessDisplay.java
  78. 12 12
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/fuel/DefaultFuelCategory.java
  79. 2 2
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/fuel/DefaultFuelDisplay.java
  80. 38 42
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationCategory.java
  81. 13 13
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationDisplay.java
  82. 21 20
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/mixin/MixinPotionBrewing.java
  83. 6 7
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/pathing/DefaultPathingCategory.java
  84. 5 7
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/pathing/DefaultPathingDisplay.java
  85. 6 7
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/pathing/DummyShovelItem.java
  86. 3 3
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/smelting/DefaultSmeltingDisplay.java
  87. 5 5
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/smithing/DefaultSmithingCategory.java
  88. 8 8
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/smithing/DefaultSmithingDisplay.java
  89. 3 3
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/smoking/DefaultSmokingDisplay.java
  90. 5 5
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingCategory.java
  91. 13 13
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingDisplay.java
  92. 5 5
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/stripping/DefaultStrippingCategory.java
  93. 3 3
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/stripping/DefaultStrippingDisplay.java
  94. 5 5
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/stripping/DummyAxeItem.java
  95. 6 7
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/tilling/DefaultTillingCategory.java
  96. 5 7
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/tilling/DefaultTillingDisplay.java
  97. 6 6
      RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/tilling/DummyHoeItem.java
  98. 1 1
      RoughlyEnoughItems-default-plugin/src/main/resources/mixin.roughlyenoughitems-default-plugin.json
  99. 13 13
      RoughlyEnoughItems-default-plugin/src/main/resources/roughlyenoughitems-default-plugin.accessWidener
  100. 1 1
      RoughlyEnoughItems-runtime/build.gradle

+ 14 - 14
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<RecipeDisplay> recipeDisplaySupplier;
         
-        private ContextImpl(boolean actuallyCrafting, ContainerScreen<?> containerScreen, Supplier<RecipeDisplay> recipeDisplaySupplier) {
+        private ContextImpl(boolean actuallyCrafting, AbstractContainerScreen<?> containerScreen, Supplier<RecipeDisplay> 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;
         }
         

+ 22 - 22
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<EntryStack> entryStacks, Text name, UnaryOperator<List<Text>> textBuilder);
+    void registerInformation(List<EntryStack> entryStacks, Component name, UnaryOperator<List<Component>> textBuilder);
     
-    default void registerInformation(EntryStack entryStack, Text name, UnaryOperator<List<Text>> textBuilder) {
+    default void registerInformation(EntryStack entryStack, Component name, UnaryOperator<List<Component>> textBuilder) {
         registerInformation(Collections.singletonList(entryStack), name, textBuilder);
     }
 }

+ 14 - 14
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<Identifier> categories) {
+    default boolean executeViewAllRecipesFromCategories(List<ResourceLocation> 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<Identifier> categories);
+        ViewSearchBuilder addCategories(Collection<ResourceLocation> categories);
         
         default ViewSearchBuilder addAllCategories() {
             return addCategories(CollectionUtils.map(RecipeHelper.getInstance().getAllCategories(), RecipeCategory::getIdentifier));
         }
         
-        @NotNull Set<Identifier> getCategories();
+        @NotNull Set<ResourceLocation> getCategories();
         
         ViewSearchBuilder addRecipesFor(EntryStack stack);
         
@@ -226,10 +226,10 @@ public interface ClientHelper {
         
         @NotNull List<EntryStack> getUsagesFor();
         
-        ViewSearchBuilder setPreferredOpenedCategory(@Nullable Identifier category);
+        ViewSearchBuilder setPreferredOpenedCategory(@Nullable ResourceLocation category);
         
         @Nullable
-        Identifier getPreferredOpenedCategory();
+        ResourceLocation getPreferredOpenedCategory();
         
         ViewSearchBuilder fillPreferredOpenedCategory();
         

+ 3 - 3
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));
     }
     
     /**

+ 12 - 12
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);
         }
         

+ 2 - 2
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);
     
 }

+ 3 - 3
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);
 }

+ 2 - 2
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;

+ 24 - 24
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<EntryStack> ofItems(Collection<ItemConvertible> stacks) {
+    static List<EntryStack> ofItems(Collection<ItemLike> stacks) {
         List<EntryStack> 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<EntryStack> ofIngredient(Ingredient ingredient) {
-        ItemStack[] matchingStacks = ingredient.getMatchingStacksClient();
+        ItemStack[] matchingStacks = ingredient.getItems();
         List<EntryStack> 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<Identifier> optionalIdentifier = getIdentifier();
+                    Optional<ResourceLocation> 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<Identifier> getIdentifier();
+    Optional<ResourceLocation> 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<Supplier<Boolean>> TOOLTIP_ENABLED = new Settings<>(TRUE);
         public static final Settings<Supplier<Boolean>> TOOLTIP_APPEND_MOD = new Settings<>(TRUE);
         public static final Settings<Supplier<Boolean>> RENDER_COUNTS = new Settings<>(TRUE);
-        public static final Settings<Function<EntryStack, List<Text>>> TOOLTIP_APPEND_EXTRA = new Settings<>(stack -> Collections.emptyList());
+        public static final Settings<Function<EntryStack, List<Component>>> TOOLTIP_APPEND_EXTRA = new Settings<>(stack -> Collections.emptyList());
         public static final Settings<Function<EntryStack, String>> 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<Function<EntryStack, String>> AMOUNT_TOOLTIP = new Settings<>(stack -> I18n.translate("tooltip.rei.fluid_amount", stack.simplifyAmount().getAccurateAmount()));
+            public static final Settings<Function<EntryStack, String>> AMOUNT_TOOLTIP = new Settings<>(stack -> I18n.get("tooltip.rei.fluid_amount", stack.simplifyAmount().getAccurateAmount()));
             
             private Fluid() {
             }

+ 3 - 3
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<EntryStack> provide(Screen screen);
+    InteractionResultHolder<EntryStack> provide(Screen screen);
 }

+ 2 - 2
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<T extends RecipeDisplay> {
     /**
      * @return the identifier of the category the recipes goes to.
      */
-    Identifier getCategoryIdentifier();
+    ResourceLocation getCategoryIdentifier();
     
     default Optional<List<T>> getRecipeFor(EntryStack entry) {
         return Optional.empty();

+ 5 - 5
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;
     }
 }

+ 6 - 6
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<REIOverlay> 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();
 }

+ 2 - 2
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();
     
 }

+ 2 - 2
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<T extends RecipeDisplay> {
      *
      * @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

+ 3 - 3
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<Identifier> getRecipeLocation() {
+    default Optional<ResourceLocation> getRecipeLocation() {
         return Optional.empty();
     }
     

+ 18 - 18
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<EntryStack>... workingStations);
+    void registerWorkingStations(ResourceLocation category, List<EntryStack>... 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<List<EntryStack>> getWorkingStations(Identifier category);
+    List<List<EntryStack>> 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<RecipeCategory<?>, List<RecipeDisplay>> 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);
     
-    <T extends Recipe<?>> void registerRecipes(Identifier category, Predicate<Recipe> recipeFilter, Function<T, RecipeDisplay> mappingFunction);
+    <T extends Recipe<?>> void registerRecipes(ResourceLocation category, Predicate<Recipe> recipeFilter, Function<T, RecipeDisplay> mappingFunction);
     
     /**
      * Registers a live recipe generator.
@@ -251,11 +251,11 @@ public interface RecipeHelper {
      */
     void registerLiveRecipeGenerator(LiveRecipeGenerator<?> liveRecipeGenerator);
     
-    void registerScreenClickArea(Rectangle rectangle, Class<? extends ContainerScreen<?>> screenClass, Identifier... categories);
+    void registerScreenClickArea(Rectangle rectangle, Class<? extends AbstractContainerScreen<?>> screenClass, ResourceLocation... categories);
     
-    <T extends Recipe<?>> void registerRecipes(Identifier category, Class<T> recipeClass, Function<T, RecipeDisplay> mappingFunction);
+    <T extends Recipe<?>> void registerRecipes(ResourceLocation category, Class<T> recipeClass, Function<T, RecipeDisplay> mappingFunction);
     
-    <T extends Recipe<?>> void registerRecipes(Identifier category, Function<Recipe, Boolean> recipeFilter, Function<T, RecipeDisplay> mappingFunction);
+    <T extends Recipe<?>> void registerRecipes(ResourceLocation category, Function<Recipe, Boolean> recipeFilter, Function<T, RecipeDisplay> mappingFunction);
     
     List<RecipeHelper.ScreenClickArea> getScreenClickAreas();
     
@@ -263,11 +263,11 @@ public interface RecipeHelper {
     boolean arePluginsLoading();
     
     interface ScreenClickArea {
-        Class<? extends ContainerScreen> getScreenClass();
+        Class<? extends AbstractContainerScreen> getScreenClass();
         
         Rectangle getRectangle();
         
-        Identifier[] getCategories();
+        ResourceLocation[] getCategories();
     }
     
 }

+ 6 - 6
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()));
     }
 }

+ 4 - 4
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());
     }

+ 2 - 2
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<T extends RecipeDisplay> extends RecipeCategory<T> {
     @ApiStatus.OverrideOnly
-    void renderRedSlots(MatrixStack matrices, List<Widget> widgets, Rectangle bounds, T display, IntList redSlots);
+    void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, T display, IntList redSlots);
 }

+ 2 - 2
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<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container);
+    List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<AbstractContainerMenu> containerInfo, AbstractContainerMenu container);
     
 }

+ 8 - 8
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<Button> {
     }
     
     @NotNull
-    public abstract Text getText();
+    public abstract Component getText();
     
-    public abstract void setText(@NotNull Text text);
+    public abstract void setText(@NotNull Component text);
     
     @NotNull
-    public final Button text(@NotNull Text text) {
+    public final Button text(@NotNull Component text) {
         setText(text);
         return this;
     }
@@ -101,12 +101,12 @@ public abstract class Button extends BaseWidget<Button> {
     }
     
     @Nullable
-    public abstract BiConsumer<MatrixStack, Button> getOnRender();
+    public abstract BiConsumer<PoseStack, Button> getOnRender();
     
-    public abstract void setOnRender(@Nullable BiConsumer<MatrixStack, Button> onRender);
+    public abstract void setOnRender(@Nullable BiConsumer<PoseStack, Button> onRender);
     
     @NotNull
-    public final Button onRender(@Nullable BiConsumer<MatrixStack, Button> onRender) {
+    public final Button onRender(@Nullable BiConsumer<PoseStack, Button> onRender) {
         setOnRender(onRender);
         return this;
     }

+ 14 - 14
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/widgets/Label.java

@@ -23,13 +23,13 @@
 
 package me.shedaniel.rei.api.widgets;
 
+import com.mojang.blaze3d.vertex.PoseStack;
 import me.shedaniel.math.Point;
 import me.shedaniel.rei.api.REIHelper;
 import me.shedaniel.rei.gui.widget.WidgetWithBounds;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.text.LiteralText;
-import net.minecraft.text.StringVisitable;
-import net.minecraft.text.Text;
+import net.minecraft.network.chat.Component;
+import net.minecraft.network.chat.FormattedText;
+import net.minecraft.network.chat.TextComponent;
 import org.jetbrains.annotations.ApiStatus;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -106,14 +106,14 @@ public abstract class Label extends WidgetWithBounds {
      * @return the consumer before render, null if not set.
      */
     @Nullable
-    public abstract BiConsumer<MatrixStack, Label> getOnRender();
+    public abstract BiConsumer<PoseStack, Label> getOnRender();
     
     /**
      * Sets the consumer before render.
      *
      * @param onRender the consumer before render.
      */
-    public abstract void setOnRender(@Nullable BiConsumer<MatrixStack, Label> onRender);
+    public abstract void setOnRender(@Nullable BiConsumer<PoseStack, Label> onRender);
     
     /**
      * Sets the consumer before render.
@@ -122,7 +122,7 @@ public abstract class Label extends WidgetWithBounds {
      * @return the label itself.
      */
     @NotNull
-    public final Label onRender(@Nullable BiConsumer<MatrixStack, Label> onRender) {
+    public final Label onRender(@Nullable BiConsumer<PoseStack, Label> onRender) {
         setOnRender(onRender);
         return this;
     }
@@ -299,26 +299,26 @@ public abstract class Label extends WidgetWithBounds {
     @NotNull
     @ApiStatus.ScheduledForRemoval
     @Deprecated
-    public Text getText() {
-        return new LiteralText("");
+    public Component getText() {
+        return new TextComponent("");
     }
     
-    public abstract StringVisitable getMessage();
+    public abstract FormattedText getMessage();
     
-    public final void setText(@NotNull Text text) {
+    public final void setText(@NotNull Component text) {
         setMessage(text);
     }
     
-    public abstract void setMessage(@NotNull StringVisitable message);
+    public abstract void setMessage(@NotNull FormattedText message);
     
     @NotNull
-    public final Label text(@NotNull Text text) {
+    public final Label text(@NotNull Component text) {
         setText(text);
         return this;
     }
     
     @NotNull
-    public final Label message(@NotNull StringVisitable message) {
+    public final Label message(@NotNull FormattedText message) {
         setMessage(message);
         return this;
     }

+ 6 - 6
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/widgets/Tooltip.java

@@ -28,7 +28,7 @@ import me.shedaniel.math.api.Executor;
 import me.shedaniel.rei.api.REIHelper;
 import me.shedaniel.rei.impl.Internals;
 import net.fabricmc.api.EnvType;
-import net.minecraft.text.Text;
+import net.minecraft.network.chat.Component;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -38,22 +38,22 @@ import java.util.List;
 
 public interface Tooltip {
     @NotNull
-    static Tooltip create(@Nullable Point point, Collection<Text> texts) {
+    static Tooltip create(@Nullable Point point, Collection<Component> texts) {
         return Internals.createTooltip(point, texts);
     }
     
     @NotNull
-    static Tooltip create(@Nullable Point point, Text... texts) {
+    static Tooltip create(@Nullable Point point, Component... texts) {
         return create(point, Arrays.asList(texts));
     }
     
     @NotNull
-    static Tooltip create(Collection<Text> texts) {
+    static Tooltip create(Collection<Component> texts) {
         return create(null, texts);
     }
     
     @NotNull
-    static Tooltip create(Text... texts) {
+    static Tooltip create(Component... texts) {
         return create(Arrays.asList(texts));
     }
     
@@ -61,7 +61,7 @@ public interface Tooltip {
     
     int getY();
     
-    List<Text> getText();
+    List<Component> getText();
     
     default void queue() {
         Executor.runIfEnv(EnvType.CLIENT, () -> () -> REIHelper.getInstance().queueTooltip(this));

+ 29 - 30
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/widgets/Widgets.java

@@ -23,6 +23,7 @@
 
 package me.shedaniel.rei.api.widgets;
 
+import com.mojang.blaze3d.vertex.PoseStack;
 import me.shedaniel.math.Dimension;
 import me.shedaniel.math.Point;
 import me.shedaniel.math.Rectangle;
@@ -32,15 +33,13 @@ import me.shedaniel.rei.gui.widget.Widget;
 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.Drawable;
-import net.minecraft.client.gui.DrawableHelper;
-import net.minecraft.client.gui.Element;
-import net.minecraft.client.sound.PositionedSoundInstance;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.sound.SoundEvents;
-import net.minecraft.text.Text;
-import net.minecraft.util.Identifier;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiComponent;
+import net.minecraft.client.gui.components.events.GuiEventListener;
+import net.minecraft.client.resources.sounds.SimpleSoundInstance;
+import net.minecraft.network.chat.Component;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.sounds.SoundEvents;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -59,68 +58,68 @@ public final class Widgets {
     }
     
     @NotNull
-    public static Widget wrapVanillaWidget(@NotNull Element element) {
+    public static Widget wrapVanillaWidget(@NotNull GuiEventListener element) {
         return new VanillaWrappedWidget(element);
     }
     
     private static class VanillaWrappedWidget extends Widget {
-        private Element element;
+        private GuiEventListener element;
         
-        public VanillaWrappedWidget(Element element) {
+        public VanillaWrappedWidget(GuiEventListener element) {
             this.element = Objects.requireNonNull(element);
         }
         
         @Override
-        public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
-            if (element instanceof DrawableHelper)
-                ((DrawableHelper) element).setZOffset(getZ());
-            if (element instanceof Drawable)
-                ((Drawable) element).render(matrices, mouseX, mouseY, delta);
+        public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
+            if (element instanceof GuiComponent)
+                ((GuiComponent) element).setBlitOffset(getZ());
+            if (element instanceof net.minecraft.client.gui.components.Widget)
+                ((net.minecraft.client.gui.components.Widget) element).render(matrices, mouseX, mouseY, delta);
         }
         
         @Override
-        public List<? extends Element> children() {
+        public List<? extends GuiEventListener> children() {
             return Collections.singletonList(element);
         }
     }
     
     @NotNull
-    public static Widget createTexturedWidget(@NotNull Identifier identifier, @NotNull Rectangle bounds) {
+    public static Widget createTexturedWidget(@NotNull ResourceLocation identifier, @NotNull Rectangle bounds) {
         return createTexturedWidget(identifier, bounds, 0, 0);
     }
     
     @NotNull
-    public static Widget createTexturedWidget(@NotNull Identifier identifier, int x, int y, int width, int height) {
+    public static Widget createTexturedWidget(@NotNull ResourceLocation identifier, int x, int y, int width, int height) {
         return createTexturedWidget(identifier, x, y, 0, 0, width, height);
     }
     
     @NotNull
-    public static Widget createTexturedWidget(@NotNull Identifier identifier, @NotNull Rectangle bounds, float u, float v) {
+    public static Widget createTexturedWidget(@NotNull ResourceLocation identifier, @NotNull Rectangle bounds, float u, float v) {
         return createTexturedWidget(identifier, bounds, u, v, 256, 256);
     }
     
     @NotNull
-    public static Widget createTexturedWidget(@NotNull Identifier identifier, int x, int y, float u, float v, int width, int height) {
+    public static Widget createTexturedWidget(@NotNull ResourceLocation identifier, int x, int y, float u, float v, int width, int height) {
         return createTexturedWidget(identifier, x, y, u, v, width, height, 256, 256);
     }
     
     @NotNull
-    public static Widget createTexturedWidget(@NotNull Identifier identifier, @NotNull Rectangle bounds, float u, float v, int textureWidth, int textureHeight) {
+    public static Widget createTexturedWidget(@NotNull ResourceLocation identifier, @NotNull Rectangle bounds, float u, float v, int textureWidth, int textureHeight) {
         return createTexturedWidget(identifier, bounds.x, bounds.y, u, v, bounds.width, bounds.height, bounds.width, bounds.height, textureWidth, textureHeight);
     }
     
     @NotNull
-    public static Widget createTexturedWidget(@NotNull Identifier identifier, int x, int y, float u, float v, int width, int height, int textureWidth, int textureHeight) {
+    public static Widget createTexturedWidget(@NotNull ResourceLocation identifier, int x, int y, float u, float v, int width, int height, int textureWidth, int textureHeight) {
         return createTexturedWidget(identifier, x, y, u, v, width, height, width, height, textureWidth, textureHeight);
     }
     
     @NotNull
-    public static Widget createTexturedWidget(@NotNull Identifier identifier, @NotNull Rectangle bounds, float u, float v, int uWidth, int vHeight, int textureWidth, int textureHeight) {
+    public static Widget createTexturedWidget(@NotNull ResourceLocation identifier, @NotNull Rectangle bounds, float u, float v, int uWidth, int vHeight, int textureWidth, int textureHeight) {
         return createTexturedWidget(identifier, bounds.x, bounds.y, u, v, bounds.width, bounds.height, uWidth, vHeight, textureWidth, textureHeight);
     }
     
     @NotNull
-    public static Widget createTexturedWidget(@NotNull Identifier identifier, int x, int y, float u, float v, int width, int height, int uWidth, int vHeight, int textureWidth, int textureHeight) {
+    public static Widget createTexturedWidget(@NotNull ResourceLocation identifier, int x, int y, float u, float v, int width, int height, int uWidth, int vHeight, int textureWidth, int textureHeight) {
         return createDrawableWidget(Internals.getWidgetsProvider().createTexturedConsumer(identifier, x, y, width, height, u, v, uWidth, vHeight, textureWidth, textureHeight));
     }
     
@@ -130,12 +129,12 @@ public final class Widgets {
     }
     
     @NotNull
-    public static Label createLabel(@NotNull Point point, @NotNull Text text) {
+    public static Label createLabel(@NotNull Point point, @NotNull Component text) {
         return Internals.getWidgetsProvider().createLabel(point, text);
     }
     
     @NotNull
-    public static Label createClickableLabel(@NotNull Point point, @NotNull Text text, @Nullable Consumer<Label> onClick) {
+    public static Label createClickableLabel(@NotNull Point point, @NotNull Component text, @Nullable Consumer<Label> onClick) {
         return createLabel(point, text).clickable().onClick(onClick);
     }
     
@@ -203,11 +202,11 @@ public final class Widgets {
     }
     
     @NotNull
-    public static Button createButton(@NotNull Rectangle bounds, @NotNull Text text) {
+    public static Button createButton(@NotNull Rectangle bounds, @NotNull Component text) {
         return Internals.getWidgetsProvider().createButton(bounds, text);
     }
     
     public static void produceClickSound() {
-        MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
+        Minecraft.getInstance().getSoundManager().play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK, 1.0F));
     }
 }

+ 2 - 2
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/AppearanceTheme.java

@@ -26,7 +26,7 @@ package me.shedaniel.rei.gui.config;
 import me.shedaniel.clothconfig2.gui.entries.SelectionListEntry;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.resource.language.I18n;
+import net.minecraft.client.resources.language.I18n;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.Locale;
@@ -38,6 +38,6 @@ public enum AppearanceTheme implements SelectionListEntry.Translatable {
     
     @Override
     public @NotNull String getKey() {
-        return I18n.translate("config.roughlyenoughitems.theme." + name().toLowerCase(Locale.ROOT));
+        return I18n.get("config.roughlyenoughitems.theme." + name().toLowerCase(Locale.ROOT));
     }
 }

+ 2 - 2
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/ConfigButtonPosition.java

@@ -26,7 +26,7 @@ package me.shedaniel.rei.gui.config;
 import me.shedaniel.clothconfig2.gui.entries.SelectionListEntry;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.resource.language.I18n;
+import net.minecraft.client.resources.language.I18n;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.Locale;
@@ -38,6 +38,6 @@ public enum ConfigButtonPosition implements SelectionListEntry.Translatable {
     
     @Override
     public @NotNull String getKey() {
-        return I18n.translate("config.roughlyenoughitems.layout.configButtonLocation." + name().toLowerCase(Locale.ROOT));
+        return I18n.get("config.roughlyenoughitems.layout.configButtonLocation." + name().toLowerCase(Locale.ROOT));
     }
 }

+ 2 - 2
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/DisplayPanelLocation.java

@@ -26,7 +26,7 @@ package me.shedaniel.rei.gui.config;
 import me.shedaniel.clothconfig2.gui.entries.SelectionListEntry;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.resource.language.I18n;
+import net.minecraft.client.resources.language.I18n;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.Locale;
@@ -43,6 +43,6 @@ public enum DisplayPanelLocation implements SelectionListEntry.Translatable {
     
     @Override
     public @NotNull String getKey() {
-        return I18n.translate("config.roughlyenoughitems.accessibility.displayPanelLocation." + name().toLowerCase(Locale.ROOT));
+        return I18n.get("config.roughlyenoughitems.accessibility.displayPanelLocation." + name().toLowerCase(Locale.ROOT));
     }
 }

+ 2 - 2
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/EntryPanelOrderingConfig.java

@@ -25,7 +25,7 @@ package me.shedaniel.rei.gui.config;
 
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.resource.language.I18n;
+import net.minecraft.client.resources.language.I18n;
 
 @Environment(EnvType.CLIENT)
 public enum EntryPanelOrderingConfig {
@@ -59,6 +59,6 @@ public enum EntryPanelOrderingConfig {
     
     @Override
     public String toString() {
-        return I18n.translate("config.roughlyenoughitems.list_ordering_button", I18n.translate(getOrdering().getNameTranslationKey()), I18n.translate(isAscending ? "ordering.rei.ascending" : "ordering.rei.descending"));
+        return I18n.get("config.roughlyenoughitems.list_ordering_button", I18n.get(getOrdering().getNameTranslationKey()), I18n.get(isAscending ? "ordering.rei.ascending" : "ordering.rei.descending"));
     }
 }

+ 2 - 2
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/ItemCheatingMode.java

@@ -25,7 +25,7 @@ package me.shedaniel.rei.gui.config;
 
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.resource.language.I18n;
+import net.minecraft.client.resources.language.I18n;
 
 import java.util.Locale;
 
@@ -36,6 +36,6 @@ public enum ItemCheatingMode {
     
     @Override
     public String toString() {
-        return I18n.translate("config.roughlyenoughitems.itemCheatingMode." + name().toLowerCase(Locale.ROOT));
+        return I18n.get("config.roughlyenoughitems.itemCheatingMode." + name().toLowerCase(Locale.ROOT));
     }
 }

+ 2 - 2
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/ItemCheatingStyle.java

@@ -26,7 +26,7 @@ package me.shedaniel.rei.gui.config;
 import me.shedaniel.clothconfig2.gui.entries.SelectionListEntry;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.resource.language.I18n;
+import net.minecraft.client.resources.language.I18n;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.Locale;
@@ -38,6 +38,6 @@ public enum ItemCheatingStyle implements SelectionListEntry.Translatable {
     
     @Override
     public @NotNull String getKey() {
-        return I18n.translate("config.roughlyenoughitems.cheatingStyle." + name().toLowerCase(Locale.ROOT));
+        return I18n.get("config.roughlyenoughitems.cheatingStyle." + name().toLowerCase(Locale.ROOT));
     }
 }

+ 2 - 2
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/RecipeBorderType.java

@@ -25,7 +25,7 @@ package me.shedaniel.rei.gui.config;
 
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.resource.language.I18n;
+import net.minecraft.client.resources.language.I18n;
 
 import java.util.Locale;
 
@@ -57,6 +57,6 @@ public enum RecipeBorderType {
     
     @Override
     public String toString() {
-        return I18n.translate("config.roughlyenoughitems.recipeBorder." + name().toLowerCase(Locale.ROOT));
+        return I18n.get("config.roughlyenoughitems.recipeBorder." + name().toLowerCase(Locale.ROOT));
     }
 }

+ 2 - 2
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/RecipeScreenType.java

@@ -25,7 +25,7 @@ package me.shedaniel.rei.gui.config;
 
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.resource.language.I18n;
+import net.minecraft.client.resources.language.I18n;
 import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Locale;
@@ -39,6 +39,6 @@ public enum RecipeScreenType {
     
     @Override
     public String toString() {
-        return I18n.translate("config.roughlyenoughitems.recipeScreenType." + name().toLowerCase(Locale.ROOT));
+        return I18n.get("config.roughlyenoughitems.recipeScreenType." + name().toLowerCase(Locale.ROOT));
     }
 }

+ 2 - 2
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/config/SearchFieldLocation.java

@@ -25,7 +25,7 @@ package me.shedaniel.rei.gui.config;
 
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.resource.language.I18n;
+import net.minecraft.client.resources.language.I18n;
 
 import java.util.Locale;
 
@@ -37,6 +37,6 @@ public enum SearchFieldLocation {
     
     @Override
     public String toString() {
-        return I18n.translate("config.roughlyenoughitems.layout.searchFieldLocation.%s", name().toLowerCase(Locale.ROOT));
+        return I18n.get("config.roughlyenoughitems.layout.searchFieldLocation.%s", name().toLowerCase(Locale.ROOT));
     }
 }

+ 10 - 10
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/entries/SimpleRecipeEntry.java

@@ -24,6 +24,7 @@
 package me.shedaniel.rei.gui.entries;
 
 import com.google.common.collect.Maps;
+import com.mojang.blaze3d.vertex.PoseStack;
 import me.shedaniel.math.Point;
 import me.shedaniel.math.Rectangle;
 import me.shedaniel.rei.api.EntryStack;
@@ -32,10 +33,9 @@ import me.shedaniel.rei.api.widgets.Slot;
 import me.shedaniel.rei.api.widgets.Tooltip;
 import me.shedaniel.rei.api.widgets.Widgets;
 import me.shedaniel.rei.utils.CollectionUtils;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.math.MathHelper;
+import net.minecraft.client.Minecraft;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.util.Mth;
 import org.jetbrains.annotations.ApiStatus;
 import org.jetbrains.annotations.Nullable;
 
@@ -50,7 +50,7 @@ import java.util.stream.Collectors;
 public class SimpleRecipeEntry extends RecipeEntry {
     
     private static final Comparator<EntryStack> ENTRY_COMPARATOR = Comparator.comparingLong(EntryStack::hashCode);
-    private static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
+    private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("roughlyenoughitems", "textures/gui/recipecontainer.png");
     private List<Slot> inputWidgets;
     private List<Slot> outputWidgets;
     
@@ -114,7 +114,7 @@ public class SimpleRecipeEntry extends RecipeEntry {
     }
     
     @Override
-    public void render(MatrixStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta) {
+    public void render(PoseStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta) {
         int xx = bounds.x + 4, yy = bounds.y + 2;
         int j = 0;
         int itemsPerLine = getItemsPerLine();
@@ -132,8 +132,8 @@ public class SimpleRecipeEntry extends RecipeEntry {
         }
         xx = bounds.x + 4 + 18 * (getItemsPerLine() - 2);
         yy = bounds.y + getHeight() / 2 - 8;
-        MinecraftClient.getInstance().getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
-        drawTexture(matrices, xx, yy, 0, 28, 18, 18);
+        Minecraft.getInstance().getTextureManager().bind(CHEST_GUI_TEXTURE);
+        blit(matrices, xx, yy, 0, 28, 18, 18);
         xx += 18;
         yy += outputWidgets.size() * -9 + 9;
         for (Slot outputWidget : outputWidgets) {
@@ -163,11 +163,11 @@ public class SimpleRecipeEntry extends RecipeEntry {
     }
     
     public int getItemsHeight() {
-        return MathHelper.ceil(((float) inputWidgets.size()) / (getItemsPerLine() - 2));
+        return Mth.ceil(((float) inputWidgets.size()) / (getItemsPerLine() - 2));
     }
     
     public int getItemsPerLine() {
-        return MathHelper.floor((getWidth() - 4f) / 18f);
+        return Mth.floor((getWidth() - 4f) / 18f);
     }
     
 }

+ 43 - 43
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java

@@ -24,19 +24,19 @@
 package me.shedaniel.rei.gui.widget;
 
 import com.mojang.blaze3d.systems.RenderSystem;
+import com.mojang.blaze3d.vertex.BufferBuilder;
+import com.mojang.blaze3d.vertex.DefaultVertexFormat;
+import com.mojang.blaze3d.vertex.PoseStack;
+import com.mojang.blaze3d.vertex.Tesselator;
+import com.mojang.math.Matrix4f;
 import me.shedaniel.math.Rectangle;
 import me.shedaniel.math.impl.PointHelper;
 import me.shedaniel.rei.api.REIHelper;
 import net.minecraft.SharedConstants;
-import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.render.BufferBuilder;
-import net.minecraft.client.render.Tessellator;
-import net.minecraft.client.render.VertexFormats;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.util.Tickable;
-import net.minecraft.util.Util;
-import net.minecraft.util.math.MathHelper;
-import net.minecraft.util.math.Matrix4f;
+import net.minecraft.Util;
+import net.minecraft.client.gui.screens.Screen;
+import net.minecraft.util.Mth;
+import net.minecraft.world.level.block.entity.TickableBlockEntity;
 import org.jetbrains.annotations.ApiStatus;
 import org.jetbrains.annotations.NotNull;
 
@@ -51,7 +51,7 @@ import java.util.function.Predicate;
  * @see net.minecraft.client.gui.widget.TextFieldWidget
  */
 @ApiStatus.Internal
-public class TextFieldWidget extends WidgetWithBounds implements Tickable {
+public class TextFieldWidget extends WidgetWithBounds implements TickableBlockEntity {
     
     public Function<String, String> stripInvalid;
     protected int focusedTicks;
@@ -88,7 +88,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             return string_1;
         };
         this.bounds = rectangle;
-        this.stripInvalid = SharedConstants::stripInvalidChars;
+        this.stripInvalid = SharedConstants::filterText;
     }
     
     public TextFieldWidget(int x, int y, int width, int height) {
@@ -268,7 +268,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
     }
     
     private int getMovedCursorIndex(int i) {
-        return Util.moveCursor(this.text, this.selectionStart, i);
+        return Util.offsetByCodepoints(this.text, this.selectionStart, i);
     }
     
     public void setCursor(int int_1) {
@@ -294,16 +294,16 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
                 this.setSelectionEnd(0);
                 return true;
             } else if (Screen.isCopy(int_1)) {
-                minecraft.keyboard.setClipboard(this.getSelectedText());
+                minecraft.keyboardHandler.setClipboard(this.getSelectedText());
                 return true;
             } else if (Screen.isPaste(int_1)) {
                 if (this.editable) {
-                    this.addText(minecraft.keyboard.getClipboard());
+                    this.addText(minecraft.keyboardHandler.getClipboard());
                 }
                 
                 return true;
             } else if (Screen.isCut(int_1)) {
-                minecraft.keyboard.setClipboard(this.getSelectedText());
+                minecraft.keyboardHandler.setClipboard(this.getSelectedText());
                 if (this.editable) {
                     this.addText("");
                 }
@@ -366,7 +366,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
     @Override
     public boolean charTyped(char char_1, int int_1) {
         if (this.isVisible() && this.isFocused()) {
-            if (SharedConstants.isValidChar(char_1) && !(
+            if (SharedConstants.isAllowedChatCharacter(char_1) && !(
                     Screen.hasControlDown() && !Screen.hasShiftDown() && !Screen.hasAltDown() && (
                             char_1 == 'a' || char_1 == 'c' || char_1 == 'v'
                     )
@@ -400,13 +400,13 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             }
             
             if (this.focused && boolean_1 && int_1 == 0) {
-                int int_2 = MathHelper.floor(double_1) - this.bounds.x;
+                int int_2 = Mth.floor(double_1) - this.bounds.x;
                 if (this.hasBorder) {
                     int_2 -= 4;
                 }
                 
-                String string_1 = this.font.trimToWidth(this.text.substring(this.firstCharacterIndex), this.getWidth());
-                this.setCursor(this.font.trimToWidth(string_1, int_2).length() + this.firstCharacterIndex);
+                String string_1 = this.font.plainSubstrByWidth(this.text.substring(this.firstCharacterIndex), this.getWidth());
+                this.setCursor(this.font.plainSubstrByWidth(string_1, int_2).length() + this.firstCharacterIndex);
                 return true;
             } else {
                 return false;
@@ -414,7 +414,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
         }
     }
     
-    public void renderBorder(MatrixStack matrices) {
+    public void renderBorder(PoseStack matrices) {
         if (this.hasBorder()) {
             if (containsMouse(PointHelper.ofMouse()) || focused)
                 fill(matrices, this.bounds.x - 1, this.bounds.y - 1, this.bounds.x + this.bounds.width + 1, this.bounds.y + this.bounds.height + 1, REIHelper.getInstance().isDarkThemeEnabled() ? -17587 : -1);
@@ -425,14 +425,14 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
     }
     
     @Override
-    public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
+    public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
         if (this.isVisible()) {
             renderBorder(matrices);
             
             int color = this.editable ? this.editableColor : this.notEditableColor;
             int int_4 = this.selectionStart - this.firstCharacterIndex;
             int int_5 = this.selectionEnd - this.firstCharacterIndex;
-            String string_1 = this.font.trimToWidth(this.text.substring(this.firstCharacterIndex), this.getWidth());
+            String string_1 = this.font.plainSubstrByWidth(this.text.substring(this.firstCharacterIndex), this.getWidth());
             boolean boolean_1 = int_4 >= 0 && int_4 <= string_1.length();
             boolean boolean_2 = this.focused && this.focusedTicks / 6 % 2 == 0 && boolean_1;
             int x = this.hasBorder ? this.bounds.x + 4 : this.bounds.x;
@@ -444,7 +444,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             
             if (!string_1.isEmpty()) {
                 String string_2 = boolean_1 ? string_1.substring(0, int_4) : string_1;
-                int_8 = this.font.drawWithShadow(matrices, this.renderTextProvider.apply(string_2, this.firstCharacterIndex), (float) x, (float) y, color);
+                int_8 = this.font.drawShadow(matrices, this.renderTextProvider.apply(string_2, this.firstCharacterIndex), (float) x, (float) y, color);
             }
             
             boolean isCursorInsideText = this.selectionStart < this.text.length() || this.text.length() >= this.getMaxLength();
@@ -457,7 +457,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             int_9--;
             
             if (!string_1.isEmpty() && boolean_1 && int_4 < string_1.length()) {
-                this.font.drawWithShadow(matrices, this.renderTextProvider.apply(string_1.substring(int_4), this.selectionStart), (float) int_8, (float) y, color);
+                this.font.drawShadow(matrices, this.renderTextProvider.apply(string_1.substring(int_4), this.selectionStart), (float) int_8, (float) y, color);
             }
             
             if (!isCursorInsideText && text.isEmpty() && this.suggestion != null) {
@@ -471,17 +471,17 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
             
             // Render selection overlay
             if (int_5 != int_4) {
-                int int_10 = x + this.font.getStringWidth(string_1.substring(0, int_5));
+                int int_10 = x + this.font.width(string_1.substring(0, int_5));
                 this.renderSelection(matrices, int_9, y - 1, int_10 - 1, y + 9, color);
             }
         }
     }
     
-    protected void renderSuggestion(MatrixStack matrices, int x, int y) {
-        this.font.drawWithShadow(matrices, this.font.trimToWidth(this.suggestion, this.getWidth()), x, y, -8355712);
+    protected void renderSuggestion(PoseStack matrices, int x, int y) {
+        this.font.drawShadow(matrices, this.font.plainSubstrByWidth(this.suggestion, this.getWidth()), x, y, -8355712);
     }
     
-    protected void renderSelection(MatrixStack matrices, int x1, int y1, int x2, int y2, int color) {
+    protected void renderSelection(PoseStack matrices, int x1, int y1, int x2, int y2, int color) {
         int tmp;
         if (x1 < x2) {
             tmp = x1;
@@ -506,20 +506,20 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
         int r = (color >> 16 & 255);
         int g = (color >> 8 & 255);
         int b = (color & 255);
-        Tessellator tessellator = Tessellator.getInstance();
-        BufferBuilder buffer = tessellator.getBuffer();
+        Tesselator tessellator = Tesselator.getInstance();
+        BufferBuilder buffer = tessellator.getBuilder();
         RenderSystem.disableTexture();
         RenderSystem.enableBlend();
         RenderSystem.disableAlphaTest();
         RenderSystem.blendFuncSeparate(770, 771, 1, 0);
         RenderSystem.shadeModel(7425);
-        Matrix4f matrix = matrices.peek().getModel();
-        buffer.begin(7, VertexFormats.POSITION_COLOR);
-        buffer.vertex(matrix, x1, y2, getZOffset() + 50f).color(r, g, b, 120).next();
-        buffer.vertex(matrix, x2, y2, getZOffset() + 50f).color(r, g, b, 120).next();
-        buffer.vertex(matrix, x2, y1, getZOffset() + 50f).color(r, g, b, 120).next();
-        buffer.vertex(matrix, x1, y1, getZOffset() + 50f).color(r, g, b, 120).next();
-        tessellator.draw();
+        Matrix4f matrix = matrices.last().pose();
+        buffer.begin(7, DefaultVertexFormat.POSITION_COLOR);
+        buffer.vertex(matrix, x1, y2, getBlitOffset() + 50f).color(r, g, b, 120).endVertex();
+        buffer.vertex(matrix, x2, y2, getBlitOffset() + 50f).color(r, g, b, 120).endVertex();
+        buffer.vertex(matrix, x2, y1, getBlitOffset() + 50f).color(r, g, b, 120).endVertex();
+        buffer.vertex(matrix, x1, y1, getBlitOffset() + 50f).color(r, g, b, 120).endVertex();
+        tessellator.end();
         RenderSystem.shadeModel(7424);
         RenderSystem.disableBlend();
         RenderSystem.enableAlphaTest();
@@ -543,7 +543,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
     }
     
     public void setSelectionStart(int int_1) {
-        this.selectionStart = MathHelper.clamp(int_1, 0, this.text.length());
+        this.selectionStart = Mth.clamp(int_1, 0, this.text.length());
     }
     
     public boolean hasBorder() {
@@ -591,17 +591,17 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
     
     public void setSelectionEnd(int i) {
         int j = this.text.length();
-        this.selectionEnd = MathHelper.clamp(i, 0, j);
+        this.selectionEnd = Mth.clamp(i, 0, j);
         if (this.font != null) {
             if (this.firstCharacterIndex > j) {
                 this.firstCharacterIndex = j;
             }
             
             int int_3 = this.getWidth();
-            String string_1 = this.font.trimToWidth(this.text.substring(this.firstCharacterIndex), int_3);
+            String string_1 = this.font.plainSubstrByWidth(this.text.substring(this.firstCharacterIndex), int_3);
             int int_4 = string_1.length() + this.firstCharacterIndex;
             if (this.selectionEnd == this.firstCharacterIndex) {
-                this.firstCharacterIndex -= this.font.trimToWidth(this.text, int_3, true).length();
+                this.firstCharacterIndex -= this.font.plainSubstrByWidth(this.text, int_3, true).length();
             }
             
             if (this.selectionEnd > int_4) {
@@ -610,7 +610,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
                 this.firstCharacterIndex -= this.firstCharacterIndex - this.selectionEnd;
             }
             
-            this.firstCharacterIndex = MathHelper.clamp(this.firstCharacterIndex, 0, j);
+            this.firstCharacterIndex = Mth.clamp(this.firstCharacterIndex, 0, j);
         }
         
     }
@@ -628,7 +628,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable {
     }
     
     public int getCharacterX(int index) {
-        return index > this.text.length() ? this.bounds.x : this.bounds.x + this.font.getStringWidth(this.text.substring(0, index));
+        return index > this.text.length() ? this.bounds.x : this.bounds.x + this.font.width(this.text.substring(0, index));
     }
     
 }

+ 8 - 9
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/gui/widget/Widget.java

@@ -24,33 +24,32 @@
 package me.shedaniel.rei.gui.widget;
 
 import me.shedaniel.math.Point;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.font.TextRenderer;
-import net.minecraft.client.gui.AbstractParentElement;
-import net.minecraft.client.gui.Drawable;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.Font;
+import net.minecraft.client.gui.components.events.AbstractContainerEventHandler;
 
 /**
  * The base class for a screen widget
  *
  * @see WidgetWithBounds for a widget with bounds
  */
-public abstract class Widget extends AbstractParentElement implements Drawable {
+public abstract class Widget extends AbstractContainerEventHandler implements net.minecraft.client.gui.components.Widget {
     
     /**
      * The Minecraft Client instance
      */
-    protected final MinecraftClient minecraft = MinecraftClient.getInstance();
+    protected final Minecraft minecraft = Minecraft.getInstance();
     /**
      * The font for rendering text
      */
-    protected final TextRenderer font = minecraft.textRenderer;
+    protected final Font font = minecraft.font;
     
     public int getZ() {
-        return this.getZOffset();
+        return this.getBlitOffset();
     }
     
     public void setZ(int z) {
-        this.setZOffset(z);
+        this.setBlitOffset(z);
     }
     
     public boolean containsMouse(double mouseX, double mouseY) {

+ 10 - 10
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/impl/Internals.java

@@ -33,11 +33,11 @@ import me.shedaniel.rei.api.widgets.*;
 import me.shedaniel.rei.gui.widget.Widget;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.fluid.Fluid;
-import net.minecraft.item.ItemStack;
-import net.minecraft.text.StringVisitable;
-import net.minecraft.text.Text;
-import net.minecraft.util.Identifier;
+import net.minecraft.network.chat.Component;
+import net.minecraft.network.chat.FormattedText;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.level.material.Fluid;
 import org.jetbrains.annotations.ApiStatus;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -60,7 +60,7 @@ public final class Internals {
     private static Supplier<DisplayHelper> displayHelper = Internals::throwNotSetup;
     private static Supplier<WidgetsProvider> widgetsProvider = Internals::throwNotSetup;
     private static Supplier<ClientHelper.ViewSearchBuilder> viewSearchBuilder = Internals::throwNotSetup;
-    private static BiFunction<@Nullable Point, Collection<Text>, Tooltip> tooltipProvider = (point, texts) -> throwNotSetup();
+    private static BiFunction<@Nullable Point, Collection<Component>, Tooltip> tooltipProvider = (point, texts) -> throwNotSetup();
     private static Supplier<BuiltinPlugin> builtinPlugin = Internals::throwNotSetup;
     
     private static <T> T throwNotSetup() {
@@ -124,7 +124,7 @@ public final class Internals {
     }
     
     @NotNull
-    public static Tooltip createTooltip(@Nullable Point point, Collection<Text> texts) {
+    public static Tooltip createTooltip(@Nullable Point point, Collection<Component> texts) {
         return tooltipProvider.apply(point, texts);
     }
     
@@ -172,17 +172,17 @@ public final class Internals {
         
         Slot createSlot(Point point);
         
-        Button createButton(Rectangle bounds, Text text);
+        Button createButton(Rectangle bounds, Component text);
         
         Panel createPanelWidget(Rectangle bounds);
         
-        Label createLabel(Point point, StringVisitable text);
+        Label createLabel(Point point, FormattedText text);
         
         Arrow createArrow(Rectangle rectangle);
         
         BurningFire createBurningFire(Rectangle rectangle);
         
-        DrawableConsumer createTexturedConsumer(Identifier texture, int x, int y, int width, int height, float u, float v, int uWidth, int vHeight, int textureWidth, int textureHeight);
+        DrawableConsumer createTexturedConsumer(ResourceLocation texture, int x, int y, int width, int height, float u, float v, int uWidth, int vHeight, int textureWidth, int textureHeight);
         
         DrawableConsumer createFillRectangleConsumer(Rectangle rectangle, int color);
     }

+ 6 - 6
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/impl/RenderingEntry.java

@@ -25,16 +25,16 @@ package me.shedaniel.rei.impl;
 
 import me.shedaniel.rei.api.EntryStack;
 import me.shedaniel.rei.api.fractions.Fraction;
-import net.minecraft.client.gui.DrawableHelper;
-import net.minecraft.util.Identifier;
+import net.minecraft.client.gui.GuiComponent;
+import net.minecraft.resources.ResourceLocation;
 import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Optional;
 
 @ApiStatus.OverrideOnly
-public abstract class RenderingEntry extends DrawableHelper implements EntryStack {
+public abstract class RenderingEntry extends GuiComponent implements EntryStack {
     @Override
-    public Optional<Identifier> getIdentifier() {
+    public Optional<ResourceLocation> getIdentifier() {
         return Optional.empty();
     }
     
@@ -105,12 +105,12 @@ public abstract class RenderingEntry extends DrawableHelper implements EntryStac
     
     @Override
     public int getZ() {
-        return getZOffset();
+        return getBlitOffset();
     }
     
     @Override
     public void setZ(int z) {
-        setZOffset(z);
+        setBlitOffset(z);
     }
     
     @Override

+ 4 - 4
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/ContainerContext.java

@@ -23,13 +23,13 @@
 
 package me.shedaniel.rei.server;
 
-import net.minecraft.container.Container;
-import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.world.entity.player.Player;
+import net.minecraft.world.inventory.AbstractContainerMenu;
 
-public interface ContainerContext<T extends Container> {
+public interface ContainerContext<T extends AbstractContainerMenu> {
     T getContainer();
     
-    PlayerEntity getPlayerEntity();
+    Player getPlayerEntity();
     
     ContainerInfo<T> getContainerInfo();
     

+ 16 - 16
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/ContainerInfo.java

@@ -23,19 +23,19 @@
 
 package me.shedaniel.rei.server;
 
-import net.minecraft.container.Container;
-import net.minecraft.entity.player.PlayerInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.screen.slot.Slot;
-import net.minecraft.server.network.ServerPlayerEntity;
-import net.minecraft.util.collection.DefaultedList;
+import net.minecraft.core.NonNullList;
+import net.minecraft.server.level.ServerPlayer;
+import net.minecraft.world.entity.player.Inventory;
+import net.minecraft.world.inventory.AbstractContainerMenu;
+import net.minecraft.world.inventory.Slot;
+import net.minecraft.world.item.ItemStack;
 
 import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 
-public interface ContainerInfo<T extends Container> {
-    Class<? extends Container> getContainerClass();
+public interface ContainerInfo<T extends AbstractContainerMenu> {
+    Class<? extends AbstractContainerMenu> getContainerClass();
     
     default StackAccessor getStack(ContainerContext<T> context, int slotIndex) {
         return new SlotStackAccessor(context.getContainer().getSlot(slotIndex));
@@ -88,22 +88,22 @@ public interface ContainerInfo<T extends Container> {
     }
     
     default List<StackAccessor> getInventoryStacks(ContainerContext<T> context) {
-        PlayerInventory inventory = context.getPlayerEntity().inventory;
-        return IntStream.range(0, inventory.main.size())
+        Inventory inventory = context.getPlayerEntity().inventory;
+        return IntStream.range(0, inventory.items.size())
                 .mapToObj(index -> (StackAccessor) new InventoryStackAccessor(inventory, index))
                 .collect(Collectors.toList());
     }
     
     default void markDirty(ContainerContext<T> context) {
-        context.getPlayerEntity().inventory.markDirty();
-        context.getContainer().sendContentUpdates();
+        context.getPlayerEntity().inventory.setChanged();
+        context.getContainer().broadcastChanges();
         
-        DefaultedList<ItemStack> defaultedList = DefaultedList.of();
-        for (Slot slot : context.getPlayerEntity().container.slots) {
-            defaultedList.add(slot.getStack());
+        NonNullList<ItemStack> defaultedList = NonNullList.create();
+        for (Slot slot : context.getPlayerEntity().containerMenu.slots) {
+            defaultedList.add(slot.getItem());
         }
         
-        ((ServerPlayerEntity) context.getPlayerEntity()).onContainerRegistered(context.getPlayerEntity().container, defaultedList);
+        ((ServerPlayer) context.getPlayerEntity()).refreshContainer(context.getPlayerEntity().containerMenu, defaultedList);
     }
     
     int getCraftingResultSlotIndex(T container);

+ 9 - 9
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/ContainerInfoHandler.java

@@ -24,16 +24,16 @@
 package me.shedaniel.rei.server;
 
 import com.google.common.collect.Maps;
-import net.minecraft.container.Container;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.inventory.AbstractContainerMenu;
 import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Map;
 
 public class ContainerInfoHandler {
-    private static final Map<String, Map<Class<? extends Container>, ContainerInfo<? extends Container>>> containerInfoMap = Maps.newLinkedHashMap();
+    private static final Map<String, Map<Class<? extends AbstractContainerMenu>, ContainerInfo<? extends AbstractContainerMenu>>> containerInfoMap = Maps.newLinkedHashMap();
     
-    public static void registerContainerInfo(Identifier category, ContainerInfo<? extends Container> containerInfo) {
+    public static void registerContainerInfo(ResourceLocation category, ContainerInfo<? extends AbstractContainerMenu> containerInfo) {
         registerScreenWithHandlerInfo(category, containerInfo);
     }
     
@@ -42,23 +42,23 @@ public class ContainerInfoHandler {
      */
     @Deprecated
     @ApiStatus.ScheduledForRemoval
-    public static void registerScreenWithHandlerInfo(Identifier category, ContainerInfo<? extends Container> containerInfo) {
+    public static void registerScreenWithHandlerInfo(ResourceLocation category, ContainerInfo<? extends AbstractContainerMenu> containerInfo) {
         if (!containerInfoMap.containsKey(category.toString()))
             containerInfoMap.put(category.toString(), Maps.newLinkedHashMap());
         containerInfoMap.get(category.toString()).put(containerInfo.getContainerClass(), containerInfo);
     }
     
-    public static boolean isCategoryHandled(Identifier category) {
+    public static boolean isCategoryHandled(ResourceLocation category) {
         return containerInfoMap.containsKey(category.toString()) && !containerInfoMap.get(category.toString()).isEmpty();
     }
     
-    public static ContainerInfo<? extends Container> getContainerInfo(Identifier category, Class<?> containerClass) {
+    public static ContainerInfo<? extends AbstractContainerMenu> getContainerInfo(ResourceLocation category, Class<?> containerClass) {
         if (!isCategoryHandled(category))
             return null;
-        Map<Class<? extends Container>, ContainerInfo<? extends Container>> infoMap = containerInfoMap.get(category.toString());
+        Map<Class<? extends AbstractContainerMenu>, ContainerInfo<? extends AbstractContainerMenu>> infoMap = containerInfoMap.get(category.toString());
         if (infoMap.containsKey(containerClass))
             return infoMap.get(containerClass);
-        for (Map.Entry<Class<? extends Container>, ContainerInfo<? extends Container>> entry : infoMap.entrySet())
+        for (Map.Entry<Class<? extends AbstractContainerMenu>, ContainerInfo<? extends AbstractContainerMenu>> entry : infoMap.entrySet())
             if (entry.getKey().isAssignableFrom(containerClass))
                 return entry.getValue();
         return null;

+ 4 - 4
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/DumpHandler.java

@@ -23,13 +23,13 @@
 
 package me.shedaniel.rei.server;
 
-import net.minecraft.container.Container;
-import net.minecraft.item.ItemStack;
+import net.minecraft.world.inventory.AbstractContainerMenu;
+import net.minecraft.world.item.ItemStack;
 
 import java.util.List;
 
 @FunctionalInterface
-public interface DumpHandler<T extends Container> {
+public interface DumpHandler<T extends AbstractContainerMenu> {
     boolean dump(ContainerContext<T> context, ItemStack stackToInsert);
     
     static StackAccessor getOccupiedSlotWithRoomForStack(ItemStack stack, List<StackAccessor> inventoryStacks) {
@@ -53,6 +53,6 @@ public interface DumpHandler<T extends Container> {
     }
     
     static boolean canStackAddMore(ItemStack existingStack, ItemStack stack) {
-        return !existingStack.isEmpty() && ItemStack.areItemsEqual(existingStack, stack) && existingStack.isStackable() && existingStack.getCount() + stack.getCount() <= existingStack.getMaxCount();
+        return !existingStack.isEmpty() && ItemStack.isSameIgnoreDurability(existingStack, stack) && existingStack.isStackable() && existingStack.getCount() + stack.getCount() <= existingStack.getMaxStackSize();
     }
 }

+ 4 - 4
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/GridCleanHandler.java

@@ -23,18 +23,18 @@
 
 package me.shedaniel.rei.server;
 
-import net.minecraft.container.Container;
-import net.minecraft.item.ItemStack;
+import net.minecraft.world.inventory.AbstractContainerMenu;
+import net.minecraft.world.item.ItemStack;
 
 @FunctionalInterface
-public interface GridCleanHandler<T extends Container> {
+public interface GridCleanHandler<T extends AbstractContainerMenu> {
     void clean(ContainerContext<T> context);
     
     static void error(String translationKey) {
         throw new IllegalStateException(translationKey);
     }
     
-    static <T extends Container> void returnSlotToPlayerInventory(ContainerContext<T> context, StackAccessor stackAccessor) {
+    static <T extends AbstractContainerMenu> void returnSlotToPlayerInventory(ContainerContext<T> context, StackAccessor stackAccessor) {
         DumpHandler<T> dumpHandler = context.getContainerInfo().getDumpHandler();
         ItemStack stackToReturn = stackAccessor.getItemStack();
         if (!stackToReturn.isEmpty()) {

+ 2 - 2
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/GridStacksProvider.java

@@ -23,9 +23,9 @@
 
 package me.shedaniel.rei.server;
 
-import net.minecraft.container.Container;
+import net.minecraft.world.inventory.AbstractContainerMenu;
 
 @FunctionalInterface
-public interface GridStacksProvider<T extends Container> {
+public interface GridStacksProvider<T extends AbstractContainerMenu> {
     Iterable<StackAccessor> getStacks(ContainerContext<T> context);
 }

+ 7 - 7
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/InventoryStackAccessor.java

@@ -23,30 +23,30 @@
 
 package me.shedaniel.rei.server;
 
-import net.minecraft.inventory.Inventory;
-import net.minecraft.item.ItemStack;
+import net.minecraft.world.Container;
+import net.minecraft.world.item.ItemStack;
 
 public class InventoryStackAccessor implements StackAccessor {
-    protected Inventory inventory;
+    protected Container inventory;
     protected int index;
     
-    public InventoryStackAccessor(Inventory inventory, int index) {
+    public InventoryStackAccessor(Container inventory, int index) {
         this.inventory = inventory;
         this.index = index;
     }
     
     @Override
     public ItemStack getItemStack() {
-        return inventory.getInvStack(index);
+        return inventory.getItem(index);
     }
     
     @Override
     public void setItemStack(ItemStack stack) {
-        this.inventory.setInvStack(index, stack);
+        this.inventory.setItem(index, stack);
     }
     
     @Override
     public ItemStack takeStack(int amount) {
-        return this.inventory.takeInvStack(index, amount);
+        return this.inventory.removeItem(index, amount);
     }
 }

+ 17 - 19
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/RecipeFinder.java

@@ -25,34 +25,32 @@ package me.shedaniel.rei.server;
 
 import com.google.common.collect.Lists;
 import it.unimi.dsi.fastutil.ints.*;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.recipe.Ingredient;
-import net.minecraft.util.collection.DefaultedList;
-import net.minecraft.util.registry.Registry;
+import net.minecraft.core.NonNullList;
+import net.minecraft.core.Registry;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.crafting.Ingredient;
 import org.jetbrains.annotations.ApiStatus;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.ArrayList;
 import java.util.BitSet;
-import java.util.Iterator;
 import java.util.List;
-import java.util.stream.Collectors;
 
 @ApiStatus.Internal
 public class RecipeFinder {
     public final Int2IntMap idToAmountMap = new Int2IntOpenHashMap();
     
     public static int getItemId(ItemStack itemStack_1) {
-        return Registry.ITEM.getRawId(itemStack_1.getItem());
+        return Registry.ITEM.getId(itemStack_1.getItem());
     }
     
     public static ItemStack getStackFromId(int int_1) {
-        return int_1 == 0 ? ItemStack.EMPTY : new ItemStack(Item.byRawId(int_1));
+        return int_1 == 0 ? ItemStack.EMPTY : new ItemStack(Item.byId(int_1));
     }
     
     public void addNormalItem(ItemStack itemStack_1) {
-        if (!itemStack_1.isDamaged() && !itemStack_1.hasEnchantments() && !itemStack_1.hasCustomName()) {
+        if (!itemStack_1.isDamaged() && !itemStack_1.isEnchanted() && !itemStack_1.hasCustomHoverName()) {
             this.addItem(itemStack_1);
         }
         
@@ -94,19 +92,19 @@ public class RecipeFinder {
         this.idToAmountMap.put(itemId, this.idToAmountMap.get(itemId) + itemCount);
     }
     
-    public boolean findRecipe(DefaultedList<Ingredient> ingredients, @Nullable IntList intList_1) {
+    public boolean findRecipe(NonNullList<Ingredient> ingredients, @Nullable IntList intList_1) {
         return this.findRecipe(ingredients, intList_1, 1);
     }
     
-    public boolean findRecipe(DefaultedList<Ingredient> ingredients, @Nullable IntList intList_1, int int_1) {
+    public boolean findRecipe(NonNullList<Ingredient> ingredients, @Nullable IntList intList_1, int int_1) {
         return (new RecipeFinder.Filter(ingredients)).find(int_1, intList_1);
     }
     
-    public int countRecipeCrafts(DefaultedList<Ingredient> ingredients, @Nullable IntList intList_1) {
+    public int countRecipeCrafts(NonNullList<Ingredient> ingredients, @Nullable IntList intList_1) {
         return this.countRecipeCrafts(ingredients, Integer.MAX_VALUE, intList_1);
     }
     
-    public int countRecipeCrafts(DefaultedList<Ingredient> ingredients, int int_1, @Nullable IntList intList_1) {
+    public int countRecipeCrafts(NonNullList<Ingredient> ingredients, int int_1, @Nullable IntList intList_1) {
         return (new RecipeFinder.Filter(ingredients)).countCrafts(int_1, intList_1);
     }
     
@@ -121,9 +119,9 @@ public class RecipeFinder {
         private final int usableIngredientSize;
         private final BitSet bitSet;
         private final IntList field_7557 = new IntArrayList();
-        private final DefaultedList<Ingredient> ingredientsInput;
+        private final NonNullList<Ingredient> ingredientsInput;
         
-        public Filter(DefaultedList<Ingredient> ingredientsInput) {
+        public Filter(NonNullList<Ingredient> ingredientsInput) {
             this.ingredientsInput = ingredientsInput;
             this.ingredients.addAll(new ArrayList<>(ingredientsInput));
             this.ingredients.removeIf(Ingredient::isEmpty);
@@ -133,7 +131,7 @@ public class RecipeFinder {
             this.bitSet = new BitSet(this.ingredientCount + this.usableIngredientSize + this.ingredientCount + this.ingredientCount * this.usableIngredientSize);
             
             for (int ingredientIndex = 0; ingredientIndex < this.ingredients.size(); ++ingredientIndex) {
-                IntList possibleStacks = this.ingredients.get(ingredientIndex).getIds();
+                IntList possibleStacks = this.ingredients.get(ingredientIndex).getStackingIds();
                 
                 // Loops over usable ingredients
                 for (int usableIngredientIndex = 0; usableIngredientIndex < this.usableIngredientSize; ++usableIngredientIndex) {
@@ -200,7 +198,7 @@ public class RecipeFinder {
             IntCollection intCollection_1 = new IntAVLTreeSet();
     
             for (Ingredient ingredient_1 : this.ingredients) {
-                intCollection_1.addAll(ingredient_1.getIds());
+                intCollection_1.addAll(ingredient_1.getStackingIds());
             }
             
             IntIterator intIterator_1 = intCollection_1.iterator();
@@ -328,7 +326,7 @@ public class RecipeFinder {
                 int int_2 = 0;
         
                 int int_3;
-                for (IntListIterator var5 = ingredient_1.getIds().iterator(); var5.hasNext(); int_2 = Math.max(int_2, RecipeFinder.this.idToAmountMap.get(int_3))) {
+                for (IntListIterator var5 = ingredient_1.getStackingIds().iterator(); var5.hasNext(); int_2 = Math.max(int_2, RecipeFinder.this.idToAmountMap.get(int_3))) {
                     int_3 = var5.next();
                 }
         

+ 2 - 2
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/RecipeFinderPopulator.java

@@ -23,13 +23,13 @@
 
 package me.shedaniel.rei.server;
 
-import net.minecraft.container.Container;
+import net.minecraft.world.inventory.AbstractContainerMenu;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.function.Consumer;
 
 @FunctionalInterface
-public interface RecipeFinderPopulator<T extends Container> {
+public interface RecipeFinderPopulator<T extends AbstractContainerMenu> {
     @NotNull
     Consumer<RecipeFinder> populate(ContainerContext<T> context);
 }

+ 5 - 5
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/SlotStackAccessor.java

@@ -23,8 +23,8 @@
 
 package me.shedaniel.rei.server;
 
-import net.minecraft.item.ItemStack;
-import net.minecraft.screen.slot.Slot;
+import net.minecraft.world.inventory.Slot;
+import net.minecraft.world.item.ItemStack;
 
 public class SlotStackAccessor implements StackAccessor {
     protected Slot slot;
@@ -35,16 +35,16 @@ public class SlotStackAccessor implements StackAccessor {
     
     @Override
     public ItemStack getItemStack() {
-        return slot.getStack();
+        return slot.getItem();
     }
     
     @Override
     public void setItemStack(ItemStack stack) {
-        this.slot.setStack(stack);
+        this.slot.set(stack);
     }
     
     @Override
     public ItemStack takeStack(int amount) {
-        return slot.takeStack(amount);
+        return slot.remove(amount);
     }
 }

+ 1 - 1
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/server/StackAccessor.java

@@ -23,7 +23,7 @@
 
 package me.shedaniel.rei.server;
 
-import net.minecraft.item.ItemStack;
+import net.minecraft.world.item.ItemStack;
 
 public interface StackAccessor {
     ItemStack getItemStack();

+ 2 - 2
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/utils/CollectionUtils.java

@@ -29,7 +29,7 @@ import com.google.common.collect.UnmodifiableIterator;
 import me.shedaniel.rei.api.EntryStack;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.util.math.MathHelper;
+import net.minecraft.util.Mth;
 
 import java.util.*;
 import java.util.function.Function;
@@ -281,7 +281,7 @@ public class CollectionUtils {
     public static <T> Iterable<Iterable<T>> partition(List<T> list, int size) {
         return () -> new UnmodifiableIterator<Iterable<T>>() {
             int i = 0;
-            int partitionSize = MathHelper.ceil(list.size() / (float) size);
+            int partitionSize = Mth.ceil(list.size() / (float) size);
             
             @Override
             public boolean hasNext() {

+ 18 - 14
RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/utils/ImmutableLiteralText.java

@@ -23,17 +23,21 @@
 
 package me.shedaniel.rei.utils;
 
-import net.minecraft.text.*;
-import net.minecraft.util.Language;
+import net.minecraft.locale.Language;
+import net.minecraft.network.chat.Component;
+import net.minecraft.network.chat.MutableComponent;
+import net.minecraft.network.chat.Style;
+import net.minecraft.network.chat.TextComponent;
+import net.minecraft.util.FormattedCharSequence;
 
 import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 
-public final class ImmutableLiteralText implements Text {
+public final class ImmutableLiteralText implements Component {
     public static final ImmutableLiteralText EMPTY = new ImmutableLiteralText("");
     private final String content;
-    private OrderedText orderedText;
+    private FormattedCharSequence orderedText;
     
     public ImmutableLiteralText(String content) {
         this.content = content;
@@ -45,39 +49,39 @@ public final class ImmutableLiteralText implements Text {
     }
     
     @Override
-    public String asString() {
+    public String getContents() {
         return content;
     }
     
     @Override
-    public List<Text> getSiblings() {
+    public List<Component> getSiblings() {
         return Collections.emptyList();
     }
     
     @Override
-    public MutableText copy() {
-        return new LiteralText(content);
+    public MutableComponent plainCopy() {
+        return new TextComponent(content);
     }
     
     @Override
-    public MutableText shallowCopy() {
-        return copy();
+    public MutableComponent copy() {
+        return plainCopy();
     }
     
     @Override
-    public <T> Optional<T> visit(Visitor<T> visitor) {
+    public <T> Optional<T> visit(ContentConsumer<T> visitor) {
         return visitSelf(visitor);
     }
     
     @Override
-    public <T> Optional<T> visit(StyledVisitor<T> styledVisitor, Style style) {
+    public <T> Optional<T> visit(StyledContentConsumer<T> styledVisitor, Style style) {
         return visitSelf(styledVisitor, style);
     }
     
     @Override
-    public OrderedText asOrderedText() {
+    public FormattedCharSequence getVisualOrderText() {
         if (orderedText == null) {
-            orderedText = Language.getInstance().reorder(this);
+            orderedText = Language.getInstance().getVisualOrder(this);
         }
         return orderedText;
     }

+ 1 - 1
RoughlyEnoughItems-default-plugin/build.gradle

@@ -1,6 +1,6 @@
 archivesBaseName = "RoughlyEnoughItems-default-plugin"
 
-minecraft {
+loom {
     accessWidener = file("src/main/resources/roughlyenoughitems-default-plugin.accessWidener")
 }
 

+ 78 - 77
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java

@@ -68,24 +68,25 @@ import me.shedaniel.rei.plugin.tilling.DummyHoeItem;
 import me.shedaniel.rei.utils.CollectionUtils;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.block.ComposterBlock;
-import net.minecraft.block.entity.AbstractFurnaceBlockEntity;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.screen.ingame.*;
-import net.minecraft.client.gui.screen.recipebook.RecipeBookProvider;
-import net.minecraft.enchantment.Enchantment;
-import net.minecraft.enchantment.EnchantmentHelper;
-import net.minecraft.fluid.Fluid;
-import net.minecraft.item.*;
-import net.minecraft.potion.PotionUtil;
-import net.minecraft.recipe.*;
-import net.minecraft.tag.BlockTags;
-import net.minecraft.tag.Tag;
-import net.minecraft.text.Text;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.Lazy;
-import net.minecraft.util.math.MathHelper;
-import net.minecraft.util.registry.Registry;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.screens.inventory.*;
+import net.minecraft.client.gui.screens.recipebook.RecipeUpdateListener;
+import net.minecraft.core.Registry;
+import net.minecraft.network.chat.Component;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.tags.BlockTags;
+import net.minecraft.tags.Tag;
+import net.minecraft.util.LazyLoadedValue;
+import net.minecraft.util.Mth;
+import net.minecraft.world.item.*;
+import net.minecraft.world.item.alchemy.PotionUtils;
+import net.minecraft.world.item.crafting.*;
+import net.minecraft.world.item.enchantment.Enchantment;
+import net.minecraft.world.item.enchantment.EnchantmentHelper;
+import net.minecraft.world.level.ItemLike;
+import net.minecraft.world.level.block.ComposterBlock;
+import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
+import net.minecraft.world.level.material.Fluid;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.jetbrains.annotations.ApiStatus;
@@ -99,28 +100,28 @@ import static me.shedaniel.rei.impl.Internals.attachInstance;
 @Environment(EnvType.CLIENT)
 public class DefaultPlugin implements REIPluginV0, BuiltinPlugin {
     private static final Logger LOGGER = LogManager.getFormatterLogger("REI/DefaultPlugin");
-    public static final Identifier CRAFTING = BuiltinPlugin.CRAFTING;
-    public static final Identifier SMELTING = BuiltinPlugin.SMELTING;
-    public static final Identifier SMOKING = BuiltinPlugin.SMOKING;
-    public static final Identifier BLASTING = BuiltinPlugin.BLASTING;
-    public static final Identifier CAMPFIRE = BuiltinPlugin.CAMPFIRE;
-    public static final Identifier STONE_CUTTING = BuiltinPlugin.STONE_CUTTING;
-    public static final Identifier STRIPPING = BuiltinPlugin.STRIPPING;
-    public static final Identifier BREWING = BuiltinPlugin.BREWING;
-    public static final Identifier PLUGIN = BuiltinPlugin.PLUGIN;
-    public static final Identifier COMPOSTING = BuiltinPlugin.COMPOSTING;
-    public static final Identifier FUEL = BuiltinPlugin.FUEL;
-    public static final Identifier SMITHING = BuiltinPlugin.SMITHING;
-    public static final Identifier BEACON = BuiltinPlugin.BEACON;
-    public static final Identifier TILLING = BuiltinPlugin.TILLING;
-    public static final Identifier PATHING = BuiltinPlugin.PATHING;
-    public static final Identifier INFO = BuiltinPlugin.INFO;
-    private static final Identifier DISPLAY_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/display.png");
-    private static final Identifier DISPLAY_TEXTURE_DARK = new Identifier("roughlyenoughitems", "textures/gui/display_dark.png");
-    private static final List<Lazy<DefaultBrewingDisplay>> BREWING_DISPLAYS = Lists.newArrayList();
+    public static final ResourceLocation CRAFTING = BuiltinPlugin.CRAFTING;
+    public static final ResourceLocation SMELTING = BuiltinPlugin.SMELTING;
+    public static final ResourceLocation SMOKING = BuiltinPlugin.SMOKING;
+    public static final ResourceLocation BLASTING = BuiltinPlugin.BLASTING;
+    public static final ResourceLocation CAMPFIRE = BuiltinPlugin.CAMPFIRE;
+    public static final ResourceLocation STONE_CUTTING = BuiltinPlugin.STONE_CUTTING;
+    public static final ResourceLocation STRIPPING = BuiltinPlugin.STRIPPING;
+    public static final ResourceLocation BREWING = BuiltinPlugin.BREWING;
+    public static final ResourceLocation PLUGIN = BuiltinPlugin.PLUGIN;
+    public static final ResourceLocation COMPOSTING = BuiltinPlugin.COMPOSTING;
+    public static final ResourceLocation FUEL = BuiltinPlugin.FUEL;
+    public static final ResourceLocation SMITHING = BuiltinPlugin.SMITHING;
+    public static final ResourceLocation BEACON = BuiltinPlugin.BEACON;
+    public static final ResourceLocation TILLING = BuiltinPlugin.TILLING;
+    public static final ResourceLocation PATHING = BuiltinPlugin.PATHING;
+    public static final ResourceLocation INFO = BuiltinPlugin.INFO;
+    private static final ResourceLocation DISPLAY_TEXTURE = new ResourceLocation("roughlyenoughitems", "textures/gui/display.png");
+    private static final ResourceLocation DISPLAY_TEXTURE_DARK = new ResourceLocation("roughlyenoughitems", "textures/gui/display_dark.png");
+    private static final List<LazyLoadedValue<DefaultBrewingDisplay>> BREWING_DISPLAYS = Lists.newArrayList();
     private static final List<DefaultInformationDisplay> INFO_DISPLAYS = Lists.newArrayList();
     
-    public static Identifier getDisplayTexture() {
+    public static ResourceLocation getDisplayTexture() {
         return REIHelper.getInstance().getDefaultDisplayTexture();
     }
     
@@ -131,11 +132,11 @@ public class DefaultPlugin implements REIPluginV0, BuiltinPlugin {
     @Deprecated
     @ApiStatus.ScheduledForRemoval
     public static void registerBrewingDisplay(DefaultBrewingDisplay recipe) {
-        BREWING_DISPLAYS.add(new Lazy<>(() -> recipe));
+        BREWING_DISPLAYS.add(new LazyLoadedValue<>(() -> recipe));
     }
     
     public static void registerBrewingRecipe(RegisteredBrewingRecipe recipe) {
-        BREWING_DISPLAYS.add(new Lazy<>(() -> new DefaultBrewingDisplay(recipe.input, recipe.ingredient, recipe.output)));
+        BREWING_DISPLAYS.add(new LazyLoadedValue<>(() -> new DefaultBrewingDisplay(recipe.input, recipe.ingredient, recipe.output)));
     }
     
     public static void registerInfoDisplay(DefaultInformationDisplay display) {
@@ -148,12 +149,12 @@ public class DefaultPlugin implements REIPluginV0, BuiltinPlugin {
     }
     
     @Override
-    public void registerInformation(List<EntryStack> entryStacks, Text name, UnaryOperator<List<Text>> textBuilder) {
+    public void registerInformation(List<EntryStack> entryStacks, Component name, UnaryOperator<List<Component>> textBuilder) {
         registerInfoDisplay(DefaultInformationDisplay.createFromEntries(entryStacks, name).lines(textBuilder.apply(Lists.newArrayList())));
     }
     
     @Override
-    public Identifier getPluginIdentifier() {
+    public ResourceLocation getPluginIdentifier() {
         return PLUGIN;
     }
     
@@ -180,17 +181,17 @@ public class DefaultPlugin implements REIPluginV0, BuiltinPlugin {
         EntryStack stack = EntryStack.create(Items.ENCHANTED_BOOK);
         List<EntryStack> enchantments = new ArrayList<>();
         for (Enchantment enchantment : Registry.ENCHANTMENT) {
-            for (int i = enchantment.getMinimumLevel(); i <= enchantment.getMaximumLevel(); i++) {
+            for (int i = enchantment.getMinLevel(); i <= enchantment.getMaxLevel(); i++) {
                 Map<Enchantment, Integer> map = new HashMap<>();
                 map.put(enchantment, i);
                 ItemStack itemStack = new ItemStack(Items.ENCHANTED_BOOK);
-                EnchantmentHelper.set(map, itemStack);
+                EnchantmentHelper.setEnchantments(map, itemStack);
                 enchantments.add(EntryStack.create(itemStack).setting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE));
             }
         }
         entryRegistry.registerEntriesAfter(stack, enchantments);
         for (Fluid fluid : Registry.FLUID) {
-            if (!fluid.getDefaultState().isEmpty() && fluid.getDefaultState().isStill())
+            if (!fluid.defaultFluidState().isEmpty() && fluid.defaultFluidState().isSource())
                 entryRegistry.registerEntry(EntryStack.create(fluid));
         }
     }
@@ -223,12 +224,12 @@ public class DefaultPlugin implements REIPluginV0, BuiltinPlugin {
         recipeHelper.registerRecipes(SMOKING, SmokingRecipe.class, DefaultSmokingDisplay::new);
         recipeHelper.registerRecipes(BLASTING, BlastingRecipe.class, DefaultBlastingDisplay::new);
         recipeHelper.registerRecipes(CAMPFIRE, CampfireCookingRecipe.class, DefaultCampfireDisplay::new);
-        recipeHelper.registerRecipes(STONE_CUTTING, StonecuttingRecipe.class, DefaultStoneCuttingDisplay::new);
-        recipeHelper.registerRecipes(SMITHING, SmithingRecipe.class, DefaultSmithingDisplay::new);
-        for (Lazy<DefaultBrewingDisplay> display : BREWING_DISPLAYS) {
+        recipeHelper.registerRecipes(STONE_CUTTING, StonecutterRecipe.class, DefaultStoneCuttingDisplay::new);
+        recipeHelper.registerRecipes(SMITHING, UpgradeRecipe.class, DefaultSmithingDisplay::new);
+        for (LazyLoadedValue<DefaultBrewingDisplay> display : BREWING_DISPLAYS) {
             recipeHelper.registerDisplay(display.get());
         }
-        for (Map.Entry<Item, Integer> entry : AbstractFurnaceBlockEntity.createFuelTimeMap().entrySet()) {
+        for (Map.Entry<Item, Integer> entry : AbstractFurnaceBlockEntity.getFuel().entrySet()) {
             recipeHelper.registerDisplay(new DefaultFuelDisplay(EntryStack.create(entry.getKey()), entry.getValue()));
         }
         List<EntryStack> arrowStack = Collections.singletonList(EntryStack.create(Items.ARROW));
@@ -240,37 +241,37 @@ public class DefaultPlugin implements REIPluginV0, BuiltinPlugin {
             for (int i = 0; i < 4; i++)
                 input.add(arrowStack);
             ItemStack outputStack = new ItemStack(Items.TIPPED_ARROW, 8);
-            PotionUtil.setPotion(outputStack, PotionUtil.getPotion(entry.getItemStack()));
-            PotionUtil.setCustomPotionEffects(outputStack, PotionUtil.getCustomPotionEffects(entry.getItemStack()));
+            PotionUtils.setPotion(outputStack, PotionUtils.getPotion(entry.getItemStack()));
+            PotionUtils.setCustomEffects(outputStack, PotionUtils.getCustomEffects(entry.getItemStack()));
             List<EntryStack> output = Collections.singletonList(EntryStack.create(outputStack).addSetting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE));
             recipeHelper.registerDisplay(new DefaultCustomDisplay(null, input, output));
         });
-        Map<ItemConvertible, Float> map = Maps.newLinkedHashMap();
-        if (ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.isEmpty())
-            ComposterBlock.registerDefaultCompostableItems();
-        for (Object2FloatMap.Entry<ItemConvertible> entry : ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.object2FloatEntrySet()) {
+        Map<ItemLike, Float> map = Maps.newLinkedHashMap();
+        if (ComposterBlock.COMPOSTABLES.isEmpty())
+            ComposterBlock.bootStrap();
+        for (Object2FloatMap.Entry<ItemLike> entry : ComposterBlock.COMPOSTABLES.object2FloatEntrySet()) {
             if (entry.getFloatValue() > 0)
                 map.put(entry.getKey(), entry.getFloatValue());
         }
-        List<ItemConvertible> stacks = Lists.newArrayList(map.keySet());
+        List<ItemLike> stacks = Lists.newArrayList(map.keySet());
         stacks.sort(Comparator.comparing(map::get));
-        for (int i = 0; i < stacks.size(); i += MathHelper.clamp(48, 1, stacks.size() - i)) {
-            List<ItemConvertible> thisStacks = Lists.newArrayList();
+        for (int i = 0; i < stacks.size(); i += Mth.clamp(48, 1, stacks.size() - i)) {
+            List<ItemLike> thisStacks = Lists.newArrayList();
             for (int j = i; j < i + 48; j++)
                 if (j < stacks.size())
                     thisStacks.add(stacks.get(j));
-            recipeHelper.registerDisplay(new DefaultCompostingDisplay(MathHelper.floor(i / 48f), thisStacks, map, new ItemStack(Items.BONE_MEAL)));
+            recipeHelper.registerDisplay(new DefaultCompostingDisplay(Mth.floor(i / 48f), thisStacks, map, new ItemStack(Items.BONE_MEAL)));
         }
-        DummyAxeItem.getStrippedBlocksMap().entrySet().stream().sorted(Comparator.comparing(b -> Registry.BLOCK.getId(b.getKey()))).forEach(set -> {
+        DummyAxeItem.getStrippedBlocksMap().entrySet().stream().sorted(Comparator.comparing(b -> Registry.BLOCK.getKey(b.getKey()))).forEach(set -> {
             recipeHelper.registerDisplay(new DefaultStrippingDisplay(EntryStack.create(set.getKey()), EntryStack.create(set.getValue())));
         });
-        DummyHoeItem.getTilledBlocksMap().entrySet().stream().sorted(Comparator.comparing(b -> Registry.BLOCK.getId(b.getKey()))).forEach(set -> {
+        DummyHoeItem.getTilledBlocksMap().entrySet().stream().sorted(Comparator.comparing(b -> Registry.BLOCK.getKey(b.getKey()))).forEach(set -> {
             recipeHelper.registerDisplay(new DefaultTillingDisplay(EntryStack.create(set.getKey()), EntryStack.create(set.getValue().getBlock())));
         });
-        DummyShovelItem.getPathBlocksMap().entrySet().stream().sorted(Comparator.comparing(b -> Registry.BLOCK.getId(b.getKey()))).forEach(set -> {
+        DummyShovelItem.getPathBlocksMap().entrySet().stream().sorted(Comparator.comparing(b -> Registry.BLOCK.getKey(b.getKey()))).forEach(set -> {
             recipeHelper.registerDisplay(new DefaultPathingDisplay(EntryStack.create(set.getKey()), EntryStack.create(set.getValue().getBlock())));
         });
-        recipeHelper.registerDisplay(new DefaultBeaconBaseDisplay(CollectionUtils.map(Lists.newArrayList(BlockTags.BEACON_BASE_BLOCKS.values()), ItemStack::new)));
+        recipeHelper.registerDisplay(new DefaultBeaconBaseDisplay(CollectionUtils.map(Lists.newArrayList(BlockTags.BEACON_BASE_BLOCKS.getValues()), ItemStack::new)));
     }
     
     @Override
@@ -303,17 +304,17 @@ public class DefaultPlugin implements REIPluginV0, BuiltinPlugin {
     @Override
     public void registerBounds(DisplayHelper displayHelper) {
         BaseBoundsHandler baseBoundsHandler = BaseBoundsHandler.getInstance();
-        baseBoundsHandler.registerExclusionZones(AbstractInventoryScreen.class, new DefaultPotionEffectExclusionZones());
-        baseBoundsHandler.registerExclusionZones(RecipeBookProvider.class, new DefaultRecipeBookExclusionZones());
-        displayHelper.registerProvider(new DisplayHelper.DisplayBoundsProvider<ContainerScreen<?>>() {
+        baseBoundsHandler.registerExclusionZones(EffectRenderingInventoryScreen.class, new DefaultPotionEffectExclusionZones());
+        baseBoundsHandler.registerExclusionZones(RecipeUpdateListener.class, new DefaultRecipeBookExclusionZones());
+        displayHelper.registerProvider(new DisplayHelper.DisplayBoundsProvider<AbstractContainerScreen<?>>() {
             @Override
-            public Rectangle getScreenBounds(ContainerScreen<?> screen) {
-                return new Rectangle(screen.x, screen.y, screen.containerWidth, screen.containerHeight);
+            public Rectangle getScreenBounds(AbstractContainerScreen<?> screen) {
+                return new Rectangle(screen.leftPos, screen.topPos, screen.imageWidth, screen.imageHeight);
             }
             
             @Override
             public Class<?> getBaseSupportedClass() {
-                return ContainerScreen.class;
+                return AbstractContainerScreen.class;
             }
         });
     }
@@ -333,21 +334,21 @@ public class DefaultPlugin implements REIPluginV0, BuiltinPlugin {
         recipeHelper.registerWorkingStations(COMPOSTING, EntryStack.create(Items.COMPOSTER));
         recipeHelper.registerWorkingStations(SMITHING, EntryStack.create(Items.SMITHING_TABLE));
         recipeHelper.registerWorkingStations(BEACON, EntryStack.create(Items.BEACON));
-        Tag<Item> axes = MinecraftClient.getInstance().getNetworkHandler().getTagManager().getItems().getTag(new Identifier("fabric", "axes"));
+        Tag<Item> axes = Minecraft.getInstance().getConnection().getTags().getItems().getTag(new ResourceLocation("fabric", "axes"));
         if (axes != null) {
-            for (Item item : axes.values()) {
+            for (Item item : axes.getValues()) {
                 recipeHelper.registerWorkingStations(STRIPPING, EntryStack.create(item));
             }
         }
-        Tag<Item> hoes = MinecraftClient.getInstance().getNetworkHandler().getTagManager().getItems().getTag(new Identifier("fabric", "hoes"));
+        Tag<Item> hoes = Minecraft.getInstance().getConnection().getTags().getItems().getTag(new ResourceLocation("fabric", "hoes"));
         if (hoes != null) {
-            for (Item item : hoes.values()) {
+            for (Item item : hoes.getValues()) {
                 recipeHelper.registerWorkingStations(TILLING, EntryStack.create(item));
             }
         }
-        Tag<Item> shovels = MinecraftClient.getInstance().getNetworkHandler().getTagManager().getItems().getTag(new Identifier("fabric", "shovels"));
+        Tag<Item> shovels = Minecraft.getInstance().getConnection().getTags().getItems().getTag(new ResourceLocation("fabric", "shovels"));
         if (shovels != null) {
-            for (Item item : shovels.values()) {
+            for (Item item : shovels.getValues()) {
                 recipeHelper.registerWorkingStations(PATHING, EntryStack.create(item));
             }
         }
@@ -355,7 +356,7 @@ public class DefaultPlugin implements REIPluginV0, BuiltinPlugin {
         recipeHelper.removeAutoCraftButton(COMPOSTING);
         recipeHelper.removeAutoCraftButton(BEACON);
         recipeHelper.removeAutoCraftButton(INFO);
-        recipeHelper.registerScreenClickArea(new Rectangle(88, 32, 28, 23), CraftingTableScreen.class, CRAFTING);
+        recipeHelper.registerScreenClickArea(new Rectangle(88, 32, 28, 23), CraftingScreen.class, CRAFTING);
         recipeHelper.registerScreenClickArea(new Rectangle(137, 29, 10, 13), InventoryScreen.class, CRAFTING);
         recipeHelper.registerScreenClickArea(new Rectangle(97, 16, 14, 30), BrewingStandScreen.class, BREWING);
         recipeHelper.registerScreenClickArea(new Rectangle(78, 32, 28, 23), FurnaceScreen.class, SMELTING);
@@ -366,7 +367,7 @@ public class DefaultPlugin implements REIPluginV0, BuiltinPlugin {
             public @NotNull EntryStack itemToFluid(@NotNull EntryStack itemStack) {
                 Item item = itemStack.getItem();
                 if (item instanceof BucketItem)
-                    return EntryStack.create(((BucketItem) item).fluid, 1000);
+                    return EntryStack.create(((BucketItem) item).content, 1000);
                 return EntryStack.empty();
             }
         });

+ 10 - 10
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java

@@ -28,10 +28,10 @@ import me.shedaniel.math.Rectangle;
 import me.shedaniel.rei.api.REIHelper;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen;
-import net.minecraft.client.gui.screen.ingame.ContainerScreen;
-import net.minecraft.entity.effect.StatusEffectInstance;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
+import net.minecraft.client.gui.screens.inventory.EffectRenderingInventoryScreen;
+import net.minecraft.world.effect.MobEffectInstance;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -43,19 +43,19 @@ import java.util.function.Supplier;
 public class DefaultPotionEffectExclusionZones implements Supplier<List<Rectangle>> {
     @Override
     public List<Rectangle> get() {
-        if (!(REIHelper.getInstance().getPreviousContainerScreen() instanceof AbstractInventoryScreen) || !((AbstractInventoryScreen<?>) REIHelper.getInstance().getPreviousContainerScreen()).offsetGuiForEffects)
+        if (!(REIHelper.getInstance().getPreviousContainerScreen() instanceof EffectRenderingInventoryScreen) || !((EffectRenderingInventoryScreen<?>) REIHelper.getInstance().getPreviousContainerScreen()).doRenderEffects)
             return Collections.emptyList();
-        Collection<StatusEffectInstance> activePotionEffects = MinecraftClient.getInstance().player.getStatusEffects();
+        Collection<MobEffectInstance> activePotionEffects = Minecraft.getInstance().player.getActiveEffects();
         if (activePotionEffects.isEmpty())
             return Collections.emptyList();
-        ContainerScreen<?> containerScreen = REIHelper.getInstance().getPreviousContainerScreen();
+        AbstractContainerScreen<?> containerScreen = REIHelper.getInstance().getPreviousContainerScreen();
         List<Rectangle> list = new ArrayList<>();
-        int x = containerScreen.x - 124;
-        int y = containerScreen.y;
+        int x = containerScreen.leftPos - 124;
+        int y = containerScreen.topPos;
         int height = 33;
         if (activePotionEffects.size() > 5)
             height = 132 / (activePotionEffects.size() - 1);
-        for (StatusEffectInstance instance : Ordering.natural().sortedCopy(activePotionEffects)) {
+        for (MobEffectInstance instance : Ordering.natural().sortedCopy(activePotionEffects)) {
             list.add(new Rectangle(x, y, 166, height));
             y += height;
         }

+ 11 - 11
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java

@@ -28,11 +28,11 @@ import me.shedaniel.math.Rectangle;
 import me.shedaniel.rei.api.REIHelper;
 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.client.gui.screen.recipebook.RecipeBookProvider;
-import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget;
-import net.minecraft.container.CraftingContainer;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
+import net.minecraft.client.gui.screens.recipebook.RecipeBookComponent;
+import net.minecraft.client.gui.screens.recipebook.RecipeUpdateListener;
+import net.minecraft.world.inventory.RecipeBookMenu;
 
 import java.util.Collections;
 import java.util.List;
@@ -43,15 +43,15 @@ public class DefaultRecipeBookExclusionZones implements Supplier<List<Rectangle>
     
     @Override
     public List<Rectangle> get() {
-        if (!(MinecraftClient.getInstance().currentScreen instanceof RecipeBookProvider) || !(REIHelper.getInstance().getPreviousContainerScreen().getContainer() instanceof CraftingContainer) ||
-            !MinecraftClient.getInstance().player.getRecipeBook().isGuiOpen(((CraftingContainer<?>) REIHelper.getInstance().getPreviousContainerScreen().getContainer()).getCategory()))
+        if (!(Minecraft.getInstance().screen instanceof RecipeUpdateListener) || !(REIHelper.getInstance().getPreviousContainerScreen().getMenu() instanceof RecipeBookMenu) ||
+            !Minecraft.getInstance().player.getRecipeBook().isOpen(((RecipeBookMenu<?>) REIHelper.getInstance().getPreviousContainerScreen().getMenu()).getRecipeBookType()))
             return Collections.emptyList();
-        RecipeBookWidget recipeBookWidget = ((RecipeBookProvider) MinecraftClient.getInstance().currentScreen).getRecipeBookWidget();
-        ContainerScreen<?> containerScreen = REIHelper.getInstance().getPreviousContainerScreen();
-        List<Rectangle> l = Lists.newArrayList(new Rectangle(containerScreen.x - 4 - 145, containerScreen.y, 4 + 145 + 30, containerScreen.containerHeight));
+        RecipeBookComponent recipeBookWidget = ((RecipeUpdateListener) Minecraft.getInstance().screen).getRecipeBookComponent();
+        AbstractContainerScreen<?> containerScreen = REIHelper.getInstance().getPreviousContainerScreen();
+        List<Rectangle> l = Lists.newArrayList(new Rectangle(containerScreen.leftPos - 4 - 145, containerScreen.topPos, 4 + 145 + 30, containerScreen.imageHeight));
         int size = recipeBookWidget.tabButtons.size();
         if (size > 0)
-            l.add(new Rectangle(containerScreen.x - 4 - 145 - 30, containerScreen.y, 30, size * 27));
+            l.add(new Rectangle(containerScreen.leftPos - 4 - 145 - 30, containerScreen.topPos, 30, size * 27));
         return l;
     }
     

+ 7 - 7
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultServerContainerPlugin.java

@@ -25,16 +25,16 @@ package me.shedaniel.rei.plugin;
 
 import me.shedaniel.rei.plugin.containers.CraftingContainerInfoWrapper;
 import me.shedaniel.rei.server.ContainerInfoHandler;
-import net.minecraft.container.*;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.inventory.*;
 
 public class DefaultServerContainerPlugin implements Runnable {
     @Override
     public void run() {
-        ContainerInfoHandler.registerContainerInfo(new Identifier("minecraft", "plugins/crafting"), CraftingContainerInfoWrapper.create(CraftingTableContainer.class));
-        ContainerInfoHandler.registerContainerInfo(new Identifier("minecraft", "plugins/crafting"), CraftingContainerInfoWrapper.create(PlayerContainer.class));
-        ContainerInfoHandler.registerContainerInfo(new Identifier("minecraft", "plugins/smelting"), CraftingContainerInfoWrapper.create(FurnaceContainer.class));
-        ContainerInfoHandler.registerContainerInfo(new Identifier("minecraft", "plugins/smoking"), CraftingContainerInfoWrapper.create(SmokerContainer.class));
-        ContainerInfoHandler.registerContainerInfo(new Identifier("minecraft", "plugins/blasting"), CraftingContainerInfoWrapper.create(BlastFurnaceContainer.class));
+        ContainerInfoHandler.registerContainerInfo(new ResourceLocation("minecraft", "plugins/crafting"), CraftingContainerInfoWrapper.create(CraftingMenu.class));
+        ContainerInfoHandler.registerContainerInfo(new ResourceLocation("minecraft", "plugins/crafting"), CraftingContainerInfoWrapper.create(InventoryMenu.class));
+        ContainerInfoHandler.registerContainerInfo(new ResourceLocation("minecraft", "plugins/smelting"), CraftingContainerInfoWrapper.create(FurnaceMenu.class));
+        ContainerInfoHandler.registerContainerInfo(new ResourceLocation("minecraft", "plugins/smoking"), CraftingContainerInfoWrapper.create(SmokerMenu.class));
+        ContainerInfoHandler.registerContainerInfo(new ResourceLocation("minecraft", "plugins/blasting"), CraftingContainerInfoWrapper.create(BlastFurnaceMenu.class));
     }
 }

+ 22 - 22
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java

@@ -31,13 +31,13 @@ import me.shedaniel.rei.plugin.cooking.DefaultCookingDisplay;
 import me.shedaniel.rei.plugin.crafting.DefaultCraftingDisplay;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.recipebook.RecipeBookProvider;
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.container.CraftingContainer;
-import net.minecraft.container.CraftingTableContainer;
-import net.minecraft.container.PlayerContainer;
-import net.minecraft.recipe.Recipe;
+import net.minecraft.client.gui.screens.Screen;
+import net.minecraft.client.gui.screens.recipebook.RecipeUpdateListener;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.world.inventory.CraftingMenu;
+import net.minecraft.world.inventory.InventoryMenu;
+import net.minecraft.world.inventory.RecipeBookMenu;
+import net.minecraft.world.item.crafting.Recipe;
 import org.jetbrains.annotations.NotNull;
 
 @Environment(EnvType.CLIENT)
@@ -48,17 +48,17 @@ public class DefaultRecipeBookHandler implements AutoTransferHandler {
         if (context.getRecipe() instanceof TransferRecipeDisplay && ClientHelper.getInstance().canUseMovePackets())
             return Result.createNotApplicable();
         RecipeDisplay display = context.getRecipe();
-        if (!(context.getContainer() instanceof CraftingContainer))
+        if (!(context.getContainer() instanceof RecipeBookMenu))
             return Result.createNotApplicable();
-        CraftingContainer<?> container = (CraftingContainer<?>) context.getContainer();
+        RecipeBookMenu<?> container = (RecipeBookMenu<?>) context.getContainer();
         if (display instanceof DefaultCraftingDisplay) {
             DefaultCraftingDisplay craftingDisplay = (DefaultCraftingDisplay) display;
             if (craftingDisplay.getOptionalRecipe().isPresent()) {
                 int h = -1, w = -1;
-                if (container instanceof CraftingTableContainer) {
+                if (container instanceof CraftingMenu) {
                     h = 3;
                     w = 3;
-                } else if (container instanceof PlayerContainer) {
+                } else if (container instanceof InventoryMenu) {
                     h = 2;
                     w = 2;
                 }
@@ -66,15 +66,15 @@ public class DefaultRecipeBookHandler implements AutoTransferHandler {
                     return Result.createNotApplicable();
                 Recipe<?> recipe = (craftingDisplay).getOptionalRecipe().get();
                 if (craftingDisplay.getHeight() > h || craftingDisplay.getWidth() > w)
-                    return Result.createFailed(I18n.translate("error.rei.transfer.too_small", h, w));
+                    return Result.createFailed(I18n.get("error.rei.transfer.too_small", h, w));
                 if (!context.getMinecraft().player.getRecipeBook().contains(recipe))
-                    return Result.createFailed(I18n.translate("error.rei.recipe.not.unlocked"));
+                    return Result.createFailed(I18n.get("error.rei.recipe.not.unlocked"));
                 if (!context.isActuallyCrafting())
                     return Result.createSuccessful();
-                context.getMinecraft().openScreen(context.getContainerScreen());
-                if (context.getContainerScreen() instanceof RecipeBookProvider)
-                    ((RecipeBookProvider) context.getContainerScreen()).getRecipeBookWidget().ghostSlots.reset();
-                context.getMinecraft().interactionManager.clickRecipe(container.syncId, recipe, Screen.hasShiftDown());
+                context.getMinecraft().setScreen(context.getContainerScreen());
+                if (context.getContainerScreen() instanceof RecipeUpdateListener)
+                    ((RecipeUpdateListener) context.getContainerScreen()).getRecipeBookComponent().ghostRecipe.clear();
+                context.getMinecraft().gameMode.handlePlaceRecipe(container.containerId, recipe, Screen.hasShiftDown());
                 return Result.createSuccessful();
             }
         } else if (display instanceof DefaultCookingDisplay) {
@@ -82,13 +82,13 @@ public class DefaultRecipeBookHandler implements AutoTransferHandler {
             if (defaultDisplay.getOptionalRecipe().isPresent()) {
                 Recipe<?> recipe = (defaultDisplay).getOptionalRecipe().get();
                 if (!context.getMinecraft().player.getRecipeBook().contains(recipe))
-                    return Result.createFailed(I18n.translate("error.rei.recipe.not.unlocked"));
+                    return Result.createFailed(I18n.get("error.rei.recipe.not.unlocked"));
                 if (!context.isActuallyCrafting())
                     return Result.createSuccessful();
-                context.getMinecraft().openScreen(context.getContainerScreen());
-                if (context.getContainerScreen() instanceof RecipeBookProvider)
-                    ((RecipeBookProvider) context.getContainerScreen()).getRecipeBookWidget().ghostSlots.reset();
-                context.getMinecraft().interactionManager.clickRecipe(container.syncId, recipe, Screen.hasShiftDown());
+                context.getMinecraft().setScreen(context.getContainerScreen());
+                if (context.getContainerScreen() instanceof RecipeUpdateListener)
+                    ((RecipeUpdateListener) context.getContainerScreen()).getRecipeBookComponent().ghostRecipe.clear();
+                context.getMinecraft().gameMode.handlePlaceRecipe(container.containerId, recipe, Screen.hasShiftDown());
                 return Result.createSuccessful();
             }
         }

+ 16 - 16
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/beacon/DefaultBeaconBaseCategory.java

@@ -24,6 +24,7 @@
 package me.shedaniel.rei.plugin.beacon;
 
 import com.google.common.collect.Lists;
+import com.mojang.blaze3d.vertex.PoseStack;
 import me.shedaniel.clothconfig2.ClothConfigInitializer;
 import me.shedaniel.clothconfig2.api.ScissorsHandler;
 import me.shedaniel.clothconfig2.api.ScrollingContainer;
@@ -39,13 +40,12 @@ import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.gui.widget.WidgetWithBounds;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import me.shedaniel.rei.utils.CollectionUtils;
-import net.minecraft.block.Blocks;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.Element;
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.math.MathHelper;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.components.events.GuiEventListener;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.util.Mth;
+import net.minecraft.world.level.block.Blocks;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.List;
@@ -53,13 +53,13 @@ import java.util.Objects;
 
 public class DefaultBeaconBaseCategory implements RecipeCategory<DefaultBeaconBaseDisplay> {
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return DefaultPlugin.BEACON;
     }
     
     @Override
     public String getCategoryName() {
-        return I18n.translate("category.rei.beacon_base");
+        return I18n.get("category.rei.beacon_base");
     }
     
     @Override
@@ -73,12 +73,12 @@ public class DefaultBeaconBaseCategory implements RecipeCategory<DefaultBeaconBa
         return new RecipeEntry() {
             @Override
             public int getHeight() {
-                return 10 + MinecraftClient.getInstance().textRenderer.fontHeight;
+                return 10 + Minecraft.getInstance().font.lineHeight;
             }
             
             @Override
-            public void render(MatrixStack matrices, Rectangle rectangle, int mouseX, int mouseY, float delta) {
-                MinecraftClient.getInstance().textRenderer.draw(matrices, name, rectangle.x + 5, rectangle.y + 6, -1);
+            public void render(PoseStack matrices, Rectangle rectangle, int mouseX, int mouseY, float delta) {
+                Minecraft.getInstance().font.draw(matrices, name, rectangle.x + 5, rectangle.y + 6, -1);
             }
         };
     }
@@ -115,7 +115,7 @@ public class DefaultBeaconBaseCategory implements RecipeCategory<DefaultBeaconBa
             
             @Override
             public int getMaxScrollHeight() {
-                return MathHelper.ceil(widgets.size() / 8f) * 18;
+                return Mth.ceil(widgets.size() / 8f) * 18;
             }
         };
         
@@ -154,11 +154,11 @@ public class DefaultBeaconBaseCategory implements RecipeCategory<DefaultBeaconBa
         }
         
         @Override
-        public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
+        public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
             scrolling.updatePosition(delta);
             Rectangle innerBounds = scrolling.getScissorBounds();
             ScissorsHandler.INSTANCE.scissor(innerBounds);
-            for (int y = 0; y < MathHelper.ceil(widgets.size() / 8f); y++) {
+            for (int y = 0; y < Mth.ceil(widgets.size() / 8f); y++) {
                 for (int x = 0; x < 8; x++) {
                     int index = y * 8 + x;
                     if (widgets.size() <= index)
@@ -175,7 +175,7 @@ public class DefaultBeaconBaseCategory implements RecipeCategory<DefaultBeaconBa
         }
         
         @Override
-        public List<? extends Element> children() {
+        public List<? extends GuiEventListener> children() {
             return widgets;
         }
     }

+ 3 - 3
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/beacon/DefaultBeaconBaseDisplay.java

@@ -28,8 +28,8 @@ import me.shedaniel.rei.api.RecipeDisplay;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.ItemStack;
 
 import java.util.Collections;
 import java.util.List;
@@ -58,7 +58,7 @@ public class DefaultBeaconBaseDisplay implements RecipeDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.BEACON;
     }
 }

+ 3 - 3
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingDisplay.java

@@ -27,8 +27,8 @@ import me.shedaniel.rei.plugin.DefaultPlugin;
 import me.shedaniel.rei.plugin.cooking.DefaultCookingDisplay;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.recipe.BlastingRecipe;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.crafting.BlastingRecipe;
 
 @Environment(EnvType.CLIENT)
 public class DefaultBlastingDisplay extends DefaultCookingDisplay {
@@ -38,7 +38,7 @@ public class DefaultBlastingDisplay extends DefaultCookingDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.BLASTING;
     }
 }

+ 2 - 2
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/brewing/BrewingRecipe.java

@@ -23,8 +23,8 @@
 
 package me.shedaniel.rei.plugin.brewing;
 
-import net.minecraft.item.Item;
-import net.minecraft.recipe.Ingredient;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.crafting.Ingredient;
 
 public class BrewingRecipe {
     

+ 12 - 12
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java

@@ -34,12 +34,12 @@ import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.block.Blocks;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.item.Items;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.math.MathHelper;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.util.Mth;
+import net.minecraft.world.item.Items;
+import net.minecraft.world.level.block.Blocks;
 
 import java.util.List;
 
@@ -47,7 +47,7 @@ import java.util.List;
 public class DefaultBrewingCategory implements RecipeCategory<DefaultBrewingDisplay> {
     
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return DefaultPlugin.BREWING;
     }
     
@@ -58,7 +58,7 @@ public class DefaultBrewingCategory implements RecipeCategory<DefaultBrewingDisp
     
     @Override
     public String getCategoryName() {
-        return I18n.translate("category.rei.brewing");
+        return I18n.get("category.rei.brewing");
     }
     
     @Override
@@ -67,10 +67,10 @@ public class DefaultBrewingCategory implements RecipeCategory<DefaultBrewingDisp
         List<Widget> widgets = Lists.newArrayList();
         widgets.add(Widgets.createRecipeBase(bounds));
         widgets.add(Widgets.createDrawableWidget((helper, matrices, mouseX, mouseY, delta) -> {
-            MinecraftClient.getInstance().getTextureManager().bindTexture(REIHelper.getInstance().getDefaultDisplayTexture());
-            helper.drawTexture(matrices, startPoint.x, startPoint.y, 0, 108, 103, 59);
-            int width = MathHelper.ceil(System.currentTimeMillis() / 250d % 18d);
-            helper.drawTexture(matrices, startPoint.x + 44, startPoint.y + 28, 103, 163, width, 4);
+            Minecraft.getInstance().getTextureManager().bind(REIHelper.getInstance().getDefaultDisplayTexture());
+            helper.blit(matrices, startPoint.x, startPoint.y, 0, 108, 103, 59);
+            int width = Mth.ceil(System.currentTimeMillis() / 250d % 18d);
+            helper.blit(matrices, startPoint.x + 44, startPoint.y + 28, 103, 163, width, 4);
         }));
         widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)).entry(EntryStack.create(Items.BLAZE_POWDER)).disableBackground().markInput());
         widgets.add(Widgets.createSlot(new Point(startPoint.x + 40, startPoint.y + 1)).entries(display.getInputEntries().get(0)).disableBackground().markInput());

+ 10 - 10
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java

@@ -29,11 +29,11 @@ import me.shedaniel.rei.api.RecipeDisplay;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.item.ItemStack;
-import net.minecraft.recipe.Ingredient;
-import net.minecraft.text.TranslatableText;
-import net.minecraft.util.Formatting;
-import net.minecraft.util.Identifier;
+import net.minecraft.ChatFormatting;
+import net.minecraft.network.chat.TranslatableComponent;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.crafting.Ingredient;
 import org.jetbrains.annotations.ApiStatus;
 
 import java.util.ArrayList;
@@ -48,15 +48,15 @@ public class DefaultBrewingDisplay implements RecipeDisplay {
     
     @ApiStatus.Internal
     public DefaultBrewingDisplay(ItemStack input, Ingredient reactant, ItemStack output) {
-        this.input = EntryStack.create(input).setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableText("category.rei.brewing.input").formatted(Formatting.YELLOW)));
-        ItemStack[] reactantStacks = reactant.getMatchingStacksClient();
+        this.input = EntryStack.create(input).setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableComponent("category.rei.brewing.input").withStyle(ChatFormatting.YELLOW)));
+        ItemStack[] reactantStacks = reactant.getItems();
         this.reactant = new ArrayList<>(reactantStacks.length);
         for (ItemStack stack : reactantStacks) {
             EntryStack entryStack = EntryStack.create(stack);
-            entryStack.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, s -> Collections.singletonList(new TranslatableText("category.rei.brewing.reactant").formatted(Formatting.YELLOW)));
+            entryStack.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, s -> Collections.singletonList(new TranslatableComponent("category.rei.brewing.reactant").withStyle(ChatFormatting.YELLOW)));
             this.reactant.add(entryStack);
         }
-        this.output = EntryStack.create(output).setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableText("category.rei.brewing.result").formatted(Formatting.YELLOW)));
+        this.output = EntryStack.create(output).setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableComponent("category.rei.brewing.result").withStyle(ChatFormatting.YELLOW)));
     }
     
     @Override
@@ -70,7 +70,7 @@ public class DefaultBrewingDisplay implements RecipeDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.BREWING;
     }
     

+ 2 - 2
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/brewing/RegisteredBrewingRecipe.java

@@ -23,8 +23,8 @@
 
 package me.shedaniel.rei.plugin.brewing;
 
-import net.minecraft.item.ItemStack;
-import net.minecraft.recipe.Ingredient;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.crafting.Ingredient;
 
 public class RegisteredBrewingRecipe {
     

+ 7 - 7
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java

@@ -31,10 +31,10 @@ import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.widgets.Widgets;
 import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.plugin.DefaultPlugin;
-import net.minecraft.block.Blocks;
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.text.TranslatableText;
-import net.minecraft.util.Identifier;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.network.chat.TranslatableComponent;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.level.block.Blocks;
 
 import java.text.DecimalFormat;
 import java.util.List;
@@ -42,7 +42,7 @@ import java.util.List;
 public class DefaultCampfireCategory implements RecipeCategory<DefaultCampfireDisplay> {
     
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return DefaultPlugin.CAMPFIRE;
     }
     
@@ -53,7 +53,7 @@ public class DefaultCampfireCategory implements RecipeCategory<DefaultCampfireDi
     
     @Override
     public String getCategoryName() {
-        return I18n.translate("category.rei.campfire");
+        return I18n.get("category.rei.campfire");
     }
     
     @Override
@@ -66,7 +66,7 @@ public class DefaultCampfireCategory implements RecipeCategory<DefaultCampfireDi
         widgets.add(Widgets.createResultSlotBackground(new Point(startPoint.x + 61, startPoint.y + 9)));
         widgets.add(Widgets.createBurningFire(new Point(startPoint.x + 1, startPoint.y + 20)).animationDurationMS(10000));
         widgets.add(Widgets.createLabel(new Point(bounds.x + bounds.width - 5, bounds.y + 5),
-                new TranslatableText("category.rei.campfire.time", df.format(cookingTime / 20d))).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
+                new TranslatableComponent("category.rei.campfire.time", df.format(cookingTime / 20d))).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
         widgets.add(Widgets.createArrow(new Point(startPoint.x + 24, startPoint.y + 8)).animationDurationTicks(cookingTime));
         widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)).entries(display.getInputEntries().get(0)).markInput());
         widgets.add(Widgets.createSlot(new Point(startPoint.x + 61, startPoint.y + 9)).entries(display.getResultingEntries().get(0)).disableBackground().markOutput());

+ 10 - 10
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireDisplay.java

@@ -28,12 +28,12 @@ import me.shedaniel.rei.api.RecipeDisplay;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.item.ItemStack;
-import net.minecraft.recipe.AbstractCookingRecipe;
-import net.minecraft.recipe.CampfireCookingRecipe;
-import net.minecraft.recipe.Ingredient;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.collection.DefaultedList;
+import net.minecraft.core.NonNullList;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.crafting.AbstractCookingRecipe;
+import net.minecraft.world.item.crafting.CampfireCookingRecipe;
+import net.minecraft.world.item.crafting.Ingredient;
 
 import java.util.Collections;
 import java.util.List;
@@ -48,11 +48,11 @@ public class DefaultCampfireDisplay implements RecipeDisplay {
     private CampfireCookingRecipe display;
     
     public DefaultCampfireDisplay(CampfireCookingRecipe recipe) {
-        this(recipe.getPreviewInputs(), recipe.getOutput(), recipe.getCookTime());
+        this(recipe.getIngredients(), recipe.getResultItem(), recipe.getCookingTime());
         this.display = recipe;
     }
     
-    public DefaultCampfireDisplay(DefaultedList<Ingredient> ingredients, ItemStack output, int cookTime) {
+    public DefaultCampfireDisplay(NonNullList<Ingredient> ingredients, ItemStack output, int cookTime) {
         this.inputs = EntryStack.ofIngredients(ingredients);
         this.output = Collections.singletonList(EntryStack.create(output));
         this.cookTime = cookTime;
@@ -63,7 +63,7 @@ public class DefaultCampfireDisplay implements RecipeDisplay {
     }
     
     @Override
-    public Optional<Identifier> getRecipeLocation() {
+    public Optional<ResourceLocation> getRecipeLocation() {
         return Optional.ofNullable(display).map(AbstractCookingRecipe::getId);
     }
     
@@ -83,7 +83,7 @@ public class DefaultCampfireDisplay implements RecipeDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.CAMPFIRE;
     }
     

+ 16 - 16
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java

@@ -24,6 +24,7 @@
 package me.shedaniel.rei.plugin.composting;
 
 import com.google.common.collect.Lists;
+import com.mojang.blaze3d.vertex.PoseStack;
 import me.shedaniel.math.Point;
 import me.shedaniel.math.Rectangle;
 import me.shedaniel.rei.api.EntryStack;
@@ -34,15 +35,14 @@ import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.block.Blocks;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.text.Text;
-import net.minecraft.text.TranslatableText;
-import net.minecraft.util.Formatting;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.math.MathHelper;
+import net.minecraft.ChatFormatting;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.network.chat.Component;
+import net.minecraft.network.chat.TranslatableComponent;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.util.Mth;
+import net.minecraft.world.level.block.Blocks;
 
 import java.util.*;
 
@@ -50,7 +50,7 @@ import java.util.*;
 public class DefaultCompostingCategory implements RecipeCategory<DefaultCompostingDisplay> {
     
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return DefaultPlugin.COMPOSTING;
     }
     
@@ -61,22 +61,22 @@ public class DefaultCompostingCategory implements RecipeCategory<DefaultComposti
     
     @Override
     public String getCategoryName() {
-        return I18n.translate("category.rei.composting");
+        return I18n.get("category.rei.composting");
     }
     
     @Override
     public RecipeEntry getSimpleRenderer(DefaultCompostingDisplay recipe) {
         return new RecipeEntry() {
-            private Text text = new TranslatableText("text.rei.composting.page", recipe.getPage() + 1);
+            private Component text = new TranslatableComponent("text.rei.composting.page", recipe.getPage() + 1);
             
             @Override
             public int getHeight() {
-                return 10 + MinecraftClient.getInstance().textRenderer.fontHeight;
+                return 10 + Minecraft.getInstance().font.lineHeight;
             }
             
             @Override
-            public void render(MatrixStack matrices, Rectangle rectangle, int mouseX, int mouseY, float delta) {
-                MinecraftClient.getInstance().textRenderer.draw(matrices, text.asOrderedText(), rectangle.x + 5, rectangle.y + 6, -1);
+            public void render(PoseStack matrices, Rectangle rectangle, int mouseX, int mouseY, float delta) {
+                Minecraft.getInstance().font.draw(matrices, text.getVisualOrderText(), rectangle.x + 5, rectangle.y + 6, -1);
             }
         };
     }
@@ -92,7 +92,7 @@ public class DefaultCompostingCategory implements RecipeCategory<DefaultComposti
                 EntryStack[] entryStack = {stacks.size() > i ? stacks.get(i) : EntryStack.empty()};
                 if (!entryStack[0].isEmpty()) {
                     display.getInputMap().entrySet().parallelStream().filter(entry -> entry.getKey() != null && Objects.equals(entry.getKey().asItem(), entryStack[0].getItem())).findAny().map(Map.Entry::getValue).ifPresent(chance -> {
-                        entryStack[0] = entryStack[0].setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, s -> Collections.singletonList(new TranslatableText("text.rei.composting.chance", MathHelper.fastFloor(chance * 100)).formatted(Formatting.YELLOW)));
+                        entryStack[0] = entryStack[0].setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, s -> Collections.singletonList(new TranslatableComponent("text.rei.composting.chance", Mth.fastFloor(chance * 100)).withStyle(ChatFormatting.YELLOW)));
                     });
                 }
                 widgets.add(Widgets.createSlot(new Point(bounds.getCenterX() - 72 + x * 18, bounds.y + 3 + y * 18)).entry(entryStack[0]).markInput());

+ 7 - 7
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingDisplay.java

@@ -29,9 +29,9 @@ import me.shedaniel.rei.plugin.DefaultPlugin;
 import me.shedaniel.rei.utils.CollectionUtils;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.item.ItemConvertible;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.level.ItemLike;
 
 import java.util.Collections;
 import java.util.List;
@@ -40,11 +40,11 @@ import java.util.Map;
 @Environment(EnvType.CLIENT)
 public class DefaultCompostingDisplay implements RecipeDisplay {
     private List<EntryStack> order;
-    private Map<ItemConvertible, Float> inputMap;
+    private Map<ItemLike, Float> inputMap;
     private List<EntryStack> output;
     private int page;
     
-    public DefaultCompostingDisplay(int page, List<ItemConvertible> order, Map<ItemConvertible, Float> inputMap, ItemStack output) {
+    public DefaultCompostingDisplay(int page, List<ItemLike> order, Map<ItemLike, Float> inputMap, ItemStack output) {
         this.page = page;
         this.order = EntryStack.ofItems(order);
         this.inputMap = inputMap;
@@ -60,7 +60,7 @@ public class DefaultCompostingDisplay implements RecipeDisplay {
         return CollectionUtils.map(order, Collections::singletonList);
     }
     
-    public Map<ItemConvertible, Float> getInputMap() {
+    public Map<ItemLike, Float> getInputMap() {
         return inputMap;
     }
     
@@ -70,7 +70,7 @@ public class DefaultCompostingDisplay implements RecipeDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.COMPOSTING;
     }
     

+ 13 - 13
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/containers/CraftingContainerInfoWrapper.java

@@ -25,51 +25,51 @@ package me.shedaniel.rei.plugin.containers;
 
 import me.shedaniel.rei.server.ContainerInfo;
 import me.shedaniel.rei.server.RecipeFinder;
-import net.minecraft.container.Container;
-import net.minecraft.container.CraftingContainer;
-import net.minecraft.item.ItemStack;
+import net.minecraft.world.inventory.AbstractContainerMenu;
+import net.minecraft.world.inventory.RecipeBookMenu;
+import net.minecraft.world.item.ItemStack;
 
-public class CraftingContainerInfoWrapper<T extends CraftingContainer<?>> implements ContainerInfo<T> {
-    private Class<? extends CraftingContainer<?>> containerClass;
+public class CraftingContainerInfoWrapper<T extends RecipeBookMenu<?>> implements ContainerInfo<T> {
+    private Class<? extends RecipeBookMenu<?>> containerClass;
     
     public CraftingContainerInfoWrapper(Class<T> containerClass) {
         this.containerClass = containerClass;
     }
     
-    public static <R extends CraftingContainer<?>> ContainerInfo<R> create(Class<R> containerClass) {
+    public static <R extends RecipeBookMenu<?>> ContainerInfo<R> create(Class<R> containerClass) {
         return new CraftingContainerInfoWrapper<>(containerClass);
     }
     
     @Override
-    public Class<? extends Container> getContainerClass() {
+    public Class<? extends AbstractContainerMenu> getContainerClass() {
         return containerClass;
     }
     
     @Override
     public int getCraftingResultSlotIndex(T container) {
-        return container.getCraftingResultSlotIndex();
+        return container.getResultSlotIndex();
     }
     
     @Override
     public int getCraftingWidth(T container) {
-        return container.getCraftingWidth();
+        return container.getGridWidth();
     }
     
     @Override
     public int getCraftingHeight(T container) {
-        return container.getCraftingHeight();
+        return container.getGridHeight();
     }
     
     @Override
     public void clearCraftingSlots(T container) {
-        container.clearCraftingSlots();
+        container.clearCraftingContent();
     }
     
     @Override
     public void populateRecipeFinder(T container, RecipeFinder var1) {
-        container.populateRecipeFinder(new net.minecraft.recipe.RecipeFinder() {
+        container.fillCraftSlotsStackedContents(new net.minecraft.world.entity.player.StackedContents() {
             @Override
-            public void addNormalItem(ItemStack itemStack_1) {
+            public void accountSimpleStack(ItemStack itemStack_1) {
                 var1.addNormalItem(itemStack_1);
             }
         });

+ 14 - 14
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java

@@ -24,6 +24,7 @@
 package me.shedaniel.rei.plugin.cooking;
 
 import com.google.common.collect.Lists;
+import com.mojang.blaze3d.vertex.PoseStack;
 import it.unimi.dsi.fastutil.ints.IntList;
 import me.shedaniel.math.Point;
 import me.shedaniel.math.Rectangle;
@@ -33,36 +34,35 @@ import me.shedaniel.rei.api.widgets.Widgets;
 import me.shedaniel.rei.gui.entries.RecipeEntry;
 import me.shedaniel.rei.gui.entries.SimpleRecipeEntry;
 import me.shedaniel.rei.gui.widget.Widget;
-import net.minecraft.client.gui.DrawableHelper;
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.text.TranslatableText;
-import net.minecraft.util.Identifier;
+import net.minecraft.client.gui.GuiComponent;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.network.chat.TranslatableComponent;
+import net.minecraft.resources.ResourceLocation;
 
 import java.text.DecimalFormat;
 import java.util.Collections;
 import java.util.List;
 
 public class DefaultCookingCategory implements TransferRecipeCategory<DefaultCookingDisplay> {
-    private Identifier identifier;
+    private ResourceLocation identifier;
     private EntryStack logo;
     private String categoryName;
     
-    public DefaultCookingCategory(Identifier identifier, EntryStack logo, String categoryName) {
+    public DefaultCookingCategory(ResourceLocation identifier, EntryStack logo, String categoryName) {
         this.identifier = identifier;
         this.logo = logo;
         this.categoryName = categoryName;
     }
     
     @Override
-    public void renderRedSlots(MatrixStack matrices, List<Widget> widgets, Rectangle bounds, DefaultCookingDisplay display, IntList redSlots) {
+    public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, DefaultCookingDisplay display, IntList redSlots) {
         Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
-        matrices.push();
+        matrices.pushPose();
         matrices.translate(0, 0, 400);
         if (redSlots.contains(0)) {
-            DrawableHelper.fill(matrices, startPoint.x + 1, startPoint.y + 1, startPoint.x + 1 + 16, startPoint.y + 1 + 16, 1090453504);
+            GuiComponent.fill(matrices, startPoint.x + 1, startPoint.y + 1, startPoint.x + 1 + 16, startPoint.y + 1 + 16, 1090453504);
         }
-        matrices.pop();
+        matrices.popPose();
     }
     
     @Override
@@ -75,7 +75,7 @@ public class DefaultCookingCategory implements TransferRecipeCategory<DefaultCoo
         widgets.add(Widgets.createResultSlotBackground(new Point(startPoint.x + 61, startPoint.y + 9)));
         widgets.add(Widgets.createBurningFire(new Point(startPoint.x + 1, startPoint.y + 20)).animationDurationMS(10000));
         widgets.add(Widgets.createLabel(new Point(bounds.x + bounds.width - 5, bounds.y + 5),
-                new TranslatableText("category.rei.cooking.time&xp", df.format(display.getXp()), df.format(cookingTime / 20d))).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
+                new TranslatableComponent("category.rei.cooking.time&xp", df.format(display.getXp()), df.format(cookingTime / 20d))).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
         widgets.add(Widgets.createArrow(new Point(startPoint.x + 24, startPoint.y + 8)).animationDurationTicks(cookingTime));
         widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)).entries(display.getInputEntries().get(0)).markInput());
         widgets.add(Widgets.createSlot(new Point(startPoint.x + 61, startPoint.y + 9)).entries(display.getResultingEntries().get(0)).disableBackground().markOutput());
@@ -93,7 +93,7 @@ public class DefaultCookingCategory implements TransferRecipeCategory<DefaultCoo
     }
     
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return identifier;
     }
     
@@ -104,6 +104,6 @@ public class DefaultCookingCategory implements TransferRecipeCategory<DefaultCoo
     
     @Override
     public String getCategoryName() {
-        return I18n.translate(categoryName);
+        return I18n.get(categoryName);
     }
 }

+ 13 - 13
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java

@@ -28,13 +28,13 @@ import me.shedaniel.rei.api.TransferRecipeDisplay;
 import me.shedaniel.rei.server.ContainerInfo;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.block.entity.FurnaceBlockEntity;
-import net.minecraft.container.Container;
-import net.minecraft.item.Item;
-import net.minecraft.recipe.AbstractCookingRecipe;
-import net.minecraft.text.TranslatableText;
-import net.minecraft.util.Formatting;
-import net.minecraft.util.Identifier;
+import net.minecraft.ChatFormatting;
+import net.minecraft.network.chat.TranslatableComponent;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.inventory.AbstractContainerMenu;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.crafting.AbstractCookingRecipe;
+import net.minecraft.world.level.block.entity.FurnaceBlockEntity;
 import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Collections;
@@ -47,7 +47,7 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay {
     private static List<EntryStack> fuel;
     
     static {
-        fuel = FurnaceBlockEntity.createFuelTimeMap().keySet().stream().map(Item::getStackForRender).map(EntryStack::create).map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableText("category.rei.smelting.fuel").formatted(Formatting.YELLOW)))).collect(Collectors.toList());
+        fuel = FurnaceBlockEntity.getFuel().keySet().stream().map(Item::getDefaultInstance).map(EntryStack::create).map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableComponent("category.rei.smelting.fuel").withStyle(ChatFormatting.YELLOW)))).collect(Collectors.toList());
     }
     
     private AbstractCookingRecipe recipe;
@@ -58,10 +58,10 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay {
     
     public DefaultCookingDisplay(AbstractCookingRecipe recipe) {
         this.recipe = recipe;
-        this.input = EntryStack.ofIngredients(recipe.getPreviewInputs());
-        this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
+        this.input = EntryStack.ofIngredients(recipe.getIngredients());
+        this.output = Collections.singletonList(EntryStack.create(recipe.getResultItem()));
         this.xp = recipe.getExperience();
-        this.cookTime = recipe.getCookTime();
+        this.cookTime = recipe.getCookingTime();
     }
     
     public static List<EntryStack> getFuel() {
@@ -69,7 +69,7 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay {
     }
     
     @Override
-    public Optional<Identifier> getRecipeLocation() {
+    public Optional<ResourceLocation> getRecipeLocation() {
         return Optional.ofNullable(recipe).map(AbstractCookingRecipe::getId);
     }
     
@@ -112,7 +112,7 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay {
     }
     
     @Override
-    public List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container) {
+    public List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<AbstractContainerMenu> containerInfo, AbstractContainerMenu container) {
         return input;
     }
     

+ 16 - 16
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java

@@ -24,6 +24,7 @@
 package me.shedaniel.rei.plugin.crafting;
 
 import com.google.common.collect.Lists;
+import com.mojang.blaze3d.vertex.PoseStack;
 import it.unimi.dsi.fastutil.ints.IntList;
 import me.shedaniel.math.Point;
 import me.shedaniel.math.Rectangle;
@@ -36,13 +37,12 @@ import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import me.shedaniel.rei.server.ContainerInfo;
 import me.shedaniel.rei.server.ContainerInfoHandler;
-import net.minecraft.block.Blocks;
-import net.minecraft.client.gui.DrawableHelper;
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.container.Container;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.math.MathHelper;
+import net.minecraft.client.gui.GuiComponent;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.util.Mth;
+import net.minecraft.world.inventory.AbstractContainerMenu;
+import net.minecraft.world.level.block.Blocks;
 
 import java.util.List;
 
@@ -55,7 +55,7 @@ public class DefaultCraftingCategory implements TransferRecipeCategory<DefaultCr
     }
     
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return DefaultPlugin.CRAFTING;
     }
     
@@ -66,7 +66,7 @@ public class DefaultCraftingCategory implements TransferRecipeCategory<DefaultCr
     
     @Override
     public String getCategoryName() {
-        return I18n.translate("category.rei.crafting");
+        return I18n.get("category.rei.crafting");
     }
     
     @Override
@@ -94,20 +94,20 @@ public class DefaultCraftingCategory implements TransferRecipeCategory<DefaultCr
     }
     
     @Override
-    public void renderRedSlots(MatrixStack matrices, List<Widget> widgets, Rectangle bounds, DefaultCraftingDisplay display, IntList redSlots) {
-        ContainerInfo<Container> info = (ContainerInfo<Container>) ContainerInfoHandler.getContainerInfo(getIdentifier(), REIHelper.getInstance().getPreviousContainerScreen().getContainer().getClass());
+    public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, DefaultCraftingDisplay display, IntList redSlots) {
+        ContainerInfo<AbstractContainerMenu> info = (ContainerInfo<AbstractContainerMenu>) ContainerInfoHandler.getContainerInfo(getIdentifier(), REIHelper.getInstance().getPreviousContainerScreen().getMenu().getClass());
         if (info == null)
             return;
-        matrices.push();
+        matrices.pushPose();
         matrices.translate(0, 0, 400);
         Point startPoint = new Point(bounds.getCenterX() - 58, bounds.getCenterY() - 27);
-        int width = info.getCraftingWidth(REIHelper.getInstance().getPreviousContainerScreen().getContainer());
+        int width = info.getCraftingWidth(REIHelper.getInstance().getPreviousContainerScreen().getMenu());
         for (Integer slot : redSlots) {
             int i = slot;
             int x = i % width;
-            int y = MathHelper.floor(i / (float) width);
-            DrawableHelper.fill(matrices, startPoint.x + 1 + x * 18, startPoint.y + 1 + y * 18, startPoint.x + 1 + x * 18 + 16, startPoint.y + 1 + y * 18 + 16, 0x60ff0000);
+            int y = Mth.floor(i / (float) width);
+            GuiComponent.fill(matrices, startPoint.x + 1 + x * 18, startPoint.y + 1 + y * 18, startPoint.x + 1 + x * 18 + 16, startPoint.y + 1 + y * 18 + 16, 0x60ff0000);
         }
-        matrices.pop();
+        matrices.popPose();
     }
 }

+ 5 - 5
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingDisplay.java

@@ -30,9 +30,9 @@ import me.shedaniel.rei.plugin.DefaultPlugin;
 import me.shedaniel.rei.server.ContainerInfo;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.container.Container;
-import net.minecraft.recipe.Recipe;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.inventory.AbstractContainerMenu;
+import net.minecraft.world.item.crafting.Recipe;
 
 import java.util.Collections;
 import java.util.List;
@@ -42,7 +42,7 @@ import java.util.Optional;
 public interface DefaultCraftingDisplay extends TransferRecipeDisplay {
     
     @Override
-    default Identifier getRecipeCategory() {
+    default ResourceLocation getRecipeCategory() {
         return DefaultPlugin.CRAFTING;
     }
     
@@ -59,7 +59,7 @@ public interface DefaultCraftingDisplay extends TransferRecipeDisplay {
     Optional<Recipe<?>> getOptionalRecipe();
     
     @Override
-    default List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container) {
+    default List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<AbstractContainerMenu> containerInfo, AbstractContainerMenu container) {
         List<List<EntryStack>> list = Lists.newArrayListWithCapacity(containerInfo.getCraftingWidth(container) * containerInfo.getCraftingHeight(container));
         for (int i = 0; i < containerInfo.getCraftingWidth(container) * containerInfo.getCraftingHeight(container); i++) {
             list.add(Collections.emptyList());

+ 4 - 4
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCustomDisplay.java

@@ -28,9 +28,9 @@ import me.shedaniel.rei.api.EntryStack;
 import me.shedaniel.rei.utils.CollectionUtils;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.item.ItemStack;
-import net.minecraft.recipe.Recipe;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.crafting.Recipe;
 
 import java.util.Collections;
 import java.util.List;
@@ -75,7 +75,7 @@ public class DefaultCustomDisplay implements DefaultCraftingDisplay {
     }
     
     @Override
-    public Optional<Identifier> getRecipeLocation() {
+    public Optional<ResourceLocation> getRecipeLocation() {
         return getRecipe().map(Recipe::getId);
     }
     

+ 6 - 6
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapedDisplay.java

@@ -26,9 +26,9 @@ package me.shedaniel.rei.plugin.crafting;
 import me.shedaniel.rei.api.EntryStack;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.recipe.Recipe;
-import net.minecraft.recipe.ShapedRecipe;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.crafting.Recipe;
+import net.minecraft.world.item.crafting.ShapedRecipe;
 
 import java.util.Collections;
 import java.util.List;
@@ -43,12 +43,12 @@ public class DefaultShapedDisplay implements DefaultCraftingDisplay {
     
     public DefaultShapedDisplay(ShapedRecipe recipe) {
         this.display = recipe;
-        this.input = EntryStack.ofIngredients(recipe.getPreviewInputs());
-        this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
+        this.input = EntryStack.ofIngredients(recipe.getIngredients());
+        this.output = Collections.singletonList(EntryStack.create(recipe.getResultItem()));
     }
     
     @Override
-    public Optional<Identifier> getRecipeLocation() {
+    public Optional<ResourceLocation> getRecipeLocation() {
         return Optional.ofNullable(display).map(ShapedRecipe::getId);
     }
     

+ 8 - 8
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapelessDisplay.java

@@ -26,9 +26,9 @@ package me.shedaniel.rei.plugin.crafting;
 import me.shedaniel.rei.api.EntryStack;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.recipe.Recipe;
-import net.minecraft.recipe.ShapelessRecipe;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.crafting.Recipe;
+import net.minecraft.world.item.crafting.ShapelessRecipe;
 
 import java.util.Collections;
 import java.util.List;
@@ -43,8 +43,8 @@ public class DefaultShapelessDisplay implements DefaultCraftingDisplay {
     
     public DefaultShapelessDisplay(ShapelessRecipe recipe) {
         this.display = recipe;
-        this.input = EntryStack.ofIngredients(recipe.getPreviewInputs());
-        this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
+        this.input = EntryStack.ofIngredients(recipe.getIngredients());
+        this.output = Collections.singletonList(EntryStack.create(recipe.getResultItem()));
     }
     
     @Override
@@ -53,7 +53,7 @@ public class DefaultShapelessDisplay implements DefaultCraftingDisplay {
     }
     
     @Override
-    public Optional<Identifier> getRecipeLocation() {
+    public Optional<ResourceLocation> getRecipeLocation() {
         return Optional.ofNullable(display).map(ShapelessRecipe::getId);
     }
     
@@ -74,14 +74,14 @@ public class DefaultShapelessDisplay implements DefaultCraftingDisplay {
     
     @Override
     public int getWidth() {
-        if (display.getPreviewInputs().size() > 4)
+        if (display.getIngredients().size() > 4)
             return 3;
         return 2;
     }
     
     @Override
     public int getHeight() {
-        if (display.getPreviewInputs().size() > 4)
+        if (display.getIngredients().size() > 4)
             return 3;
         return 2;
     }

+ 12 - 12
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/fuel/DefaultFuelCategory.java

@@ -24,6 +24,7 @@
 package me.shedaniel.rei.plugin.fuel;
 
 import com.google.common.collect.Lists;
+import com.mojang.blaze3d.vertex.PoseStack;
 import me.shedaniel.math.Point;
 import me.shedaniel.math.Rectangle;
 import me.shedaniel.rei.api.EntryStack;
@@ -36,12 +37,11 @@ import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.item.Items;
-import net.minecraft.text.TranslatableText;
-import net.minecraft.util.Identifier;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.network.chat.TranslatableComponent;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.Items;
 import org.jetbrains.annotations.Nullable;
 
 import java.text.DecimalFormat;
@@ -53,13 +53,13 @@ public class DefaultFuelCategory implements RecipeCategory<DefaultFuelDisplay> {
     private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#.##");
     
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return DefaultPlugin.FUEL;
     }
     
     @Override
     public String getCategoryName() {
-        return I18n.translate("category.rei.fuel");
+        return I18n.get("category.rei.fuel");
     }
     
     @Override
@@ -78,7 +78,7 @@ public class DefaultFuelCategory implements RecipeCategory<DefaultFuelDisplay> {
         String burnItems = DECIMAL_FORMAT.format(recipeDisplay.getFuelTime() / 200d);
         List<Widget> widgets = Lists.newArrayList();
         widgets.add(Widgets.createRecipeBase(bounds));
-        widgets.add(Widgets.createLabel(new Point(bounds.x + 26, bounds.getMaxY() - 15), new TranslatableText("category.rei.fuel.time.items", burnItems))
+        widgets.add(Widgets.createLabel(new Point(bounds.x + 26, bounds.getMaxY() - 15), new TranslatableComponent("category.rei.fuel.time.items", burnItems))
                 .color(0xFF404040, 0xFFBBBBBB).noShadow().leftAligned());
         widgets.add(Widgets.createBurningFire(new Point(bounds.x + 6, startPoint.y + 1)).animationDurationTicks(recipeDisplay.getFuelTime()));
         widgets.add(Widgets.createSlot(new Point(bounds.x + 6, startPoint.y + 18)).entries(recipeDisplay.getInputEntries().get(0)).markInput());
@@ -90,7 +90,7 @@ public class DefaultFuelCategory implements RecipeCategory<DefaultFuelDisplay> {
         Slot slot = Widgets.createSlot(new Point(0, 0)).entries(recipe.getInputEntries().get(0)).disableBackground().disableHighlight();
         String burnItems = DECIMAL_FORMAT.format(recipe.getFuelTime() / 200d);
         return new RecipeEntry() {
-            private TranslatableText text = new TranslatableText("category.rei.fuel.time_short.items", burnItems);
+            private TranslatableComponent text = new TranslatableComponent("category.rei.fuel.time_short.items", burnItems);
             
             @Override
             public int getHeight() {
@@ -106,11 +106,11 @@ public class DefaultFuelCategory implements RecipeCategory<DefaultFuelDisplay> {
             }
             
             @Override
-            public void render(MatrixStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta) {
+            public void render(PoseStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta) {
                 slot.setZ(getZ() + 50);
                 slot.getBounds().setLocation(bounds.x + 4, bounds.y + 2);
                 slot.render(matrices, mouseX, mouseY, delta);
-                MinecraftClient.getInstance().textRenderer.drawWithShadow(matrices, text.asOrderedText(), bounds.x + 25, bounds.y + 8, -1);
+                Minecraft.getInstance().font.drawShadow(matrices, text.getVisualOrderText(), bounds.x + 25, bounds.y + 8, -1);
             }
         };
     }

+ 2 - 2
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/fuel/DefaultFuelDisplay.java

@@ -28,7 +28,7 @@ import me.shedaniel.rei.api.RecipeDisplay;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
 
 import java.util.Collections;
 import java.util.List;
@@ -54,7 +54,7 @@ public class DefaultFuelDisplay implements RecipeDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.FUEL;
     }
     

+ 38 - 42
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationCategory.java

@@ -25,6 +25,8 @@ package me.shedaniel.rei.plugin.information;
 
 import com.google.common.collect.Lists;
 import com.mojang.blaze3d.systems.RenderSystem;
+import com.mojang.blaze3d.vertex.*;
+import com.mojang.math.Matrix4f;
 import me.shedaniel.clothconfig2.ClothConfigInitializer;
 import me.shedaniel.clothconfig2.api.ScissorsHandler;
 import me.shedaniel.clothconfig2.api.ScrollingContainer;
@@ -41,19 +43,13 @@ import me.shedaniel.rei.impl.RenderingEntry;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.Element;
-import net.minecraft.client.render.BufferBuilder;
-import net.minecraft.client.render.BufferRenderer;
-import net.minecraft.client.render.Tessellator;
-import net.minecraft.client.render.VertexFormats;
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.text.OrderedText;
-import net.minecraft.text.StringVisitable;
-import net.minecraft.text.Text;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.math.Matrix4f;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.components.events.GuiEventListener;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.network.chat.Component;
+import net.minecraft.network.chat.FormattedText;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.util.FormattedCharSequence;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.Collections;
@@ -63,39 +59,39 @@ import java.util.Objects;
 @Environment(EnvType.CLIENT)
 public class DefaultInformationCategory implements RecipeCategory<DefaultInformationDisplay> {
     protected static void innerBlit(Matrix4f matrix4f, int xStart, int xEnd, int yStart, int yEnd, int z, float uStart, float uEnd, float vStart, float vEnd) {
-        BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
-        bufferBuilder.begin(7, VertexFormats.POSITION_TEXTURE);
-        bufferBuilder.vertex(matrix4f, xStart, yEnd, z).texture(uStart, vEnd).next();
-        bufferBuilder.vertex(matrix4f, xEnd, yEnd, z).texture(uEnd, vEnd).next();
-        bufferBuilder.vertex(matrix4f, xEnd, yStart, z).texture(uEnd, vStart).next();
-        bufferBuilder.vertex(matrix4f, xStart, yStart, z).texture(uStart, vStart).next();
+        BufferBuilder bufferBuilder = Tesselator.getInstance().getBuilder();
+        bufferBuilder.begin(7, DefaultVertexFormat.POSITION_TEX);
+        bufferBuilder.vertex(matrix4f, xStart, yEnd, z).uv(uStart, vEnd).endVertex();
+        bufferBuilder.vertex(matrix4f, xEnd, yEnd, z).uv(uEnd, vEnd).endVertex();
+        bufferBuilder.vertex(matrix4f, xEnd, yStart, z).uv(uEnd, vStart).endVertex();
+        bufferBuilder.vertex(matrix4f, xStart, yStart, z).uv(uStart, vStart).endVertex();
         bufferBuilder.end();
         RenderSystem.enableAlphaTest();
-        BufferRenderer.draw(bufferBuilder);
+        BufferUploader.end(bufferBuilder);
     }
     
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return DefaultPlugin.INFO;
     }
     
     @Override
     public String getCategoryName() {
-        return I18n.translate("category.rei.information");
+        return I18n.get("category.rei.information");
     }
     
     @Override
     public RecipeEntry getSimpleRenderer(DefaultInformationDisplay recipe) {
-        OrderedText name = recipe.getName().asOrderedText();
+        FormattedCharSequence name = recipe.getName().getVisualOrderText();
         return new RecipeEntry() {
             @Override
             public int getHeight() {
-                return 10 + MinecraftClient.getInstance().textRenderer.fontHeight;
+                return 10 + Minecraft.getInstance().font.lineHeight;
             }
             
             @Override
-            public void render(MatrixStack matrices, Rectangle rectangle, int mouseX, int mouseY, float delta) {
-                MinecraftClient.getInstance().textRenderer.draw(matrices, name, rectangle.x + 5, rectangle.y + 6, -1);
+            public void render(PoseStack matrices, Rectangle rectangle, int mouseX, int mouseY, float delta) {
+                Minecraft.getInstance().font.draw(matrices, name, rectangle.x + 5, rectangle.y + 6, -1);
             }
         };
     }
@@ -104,13 +100,13 @@ public class DefaultInformationCategory implements RecipeCategory<DefaultInforma
     public EntryStack getLogo() {
         return new RenderingEntry() {
             @Override
-            public void render(MatrixStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta) {
-                MinecraftClient.getInstance().getTextureManager().bindTexture(REIHelper.getInstance().getDefaultDisplayTexture());
-                matrices.push();
+            public void render(PoseStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta) {
+                Minecraft.getInstance().getTextureManager().bind(REIHelper.getInstance().getDefaultDisplayTexture());
+                matrices.pushPose();
                 matrices.translate(-1.2f, -1, 0);
-                Matrix4f matrix = matrices.peek().getModel();
+                Matrix4f matrix = matrices.last().pose();
                 DefaultInformationCategory.innerBlit(matrix, bounds.getCenterX() - 8, bounds.getCenterX() + 8, bounds.getCenterY() - 8, bounds.getCenterY() + 8, 0, 116f / 256f, (116f + 16f) / 256f, 0f, 16f / 256f);
-                matrices.pop();
+                matrices.popPose();
             }
         };
     }
@@ -138,7 +134,7 @@ public class DefaultInformationCategory implements RecipeCategory<DefaultInforma
     
     private static class ScrollableTextWidget extends WidgetWithBounds {
         private Rectangle bounds;
-        private List<OrderedText> texts;
+        private List<FormattedCharSequence> texts;
         private final ScrollingContainer scrolling = new ScrollingContainer() {
             @Override
             public Rectangle getBounds() {
@@ -149,20 +145,20 @@ public class DefaultInformationCategory implements RecipeCategory<DefaultInforma
             @Override
             public int getMaxScrollHeight() {
                 int i = 2;
-                for (OrderedText entry : texts) {
-                    i += entry == null ? 4 : font.fontHeight;
+                for (FormattedCharSequence entry : texts) {
+                    i += entry == null ? 4 : font.lineHeight;
                 }
                 return i;
             }
         };
         
-        public ScrollableTextWidget(Rectangle bounds, List<Text> texts) {
+        public ScrollableTextWidget(Rectangle bounds, List<Component> texts) {
             this.bounds = Objects.requireNonNull(bounds);
             this.texts = Lists.newArrayList();
-            for (StringVisitable text : texts) {
+            for (FormattedText text : texts) {
                 if (!this.texts.isEmpty())
                     this.texts.add(null);
-                this.texts.addAll(MinecraftClient.getInstance().textRenderer.wrapStringToWidthAsList(text, bounds.width - 11));
+                this.texts.addAll(Minecraft.getInstance().font.split(text, bounds.width - 11));
             }
         }
         
@@ -196,16 +192,16 @@ public class DefaultInformationCategory implements RecipeCategory<DefaultInforma
         }
         
         @Override
-        public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
+        public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
             scrolling.updatePosition(delta);
             Rectangle innerBounds = scrolling.getScissorBounds();
             ScissorsHandler.INSTANCE.scissor(innerBounds);
             int currentY = (int) -scrolling.scrollAmount + innerBounds.y;
-            for (OrderedText text : texts) {
-                if (text != null && currentY + font.fontHeight >= innerBounds.y && currentY <= innerBounds.getMaxY()) {
+            for (FormattedCharSequence text : texts) {
+                if (text != null && currentY + font.lineHeight >= innerBounds.y && currentY <= innerBounds.getMaxY()) {
                     font.draw(matrices, text, innerBounds.x + 2, currentY + 2, REIHelper.getInstance().isDarkThemeEnabled() ? 0xFFBBBBBB : 0xFF090909);
                 }
-                currentY += text == null ? 4 : font.fontHeight;
+                currentY += text == null ? 4 : font.lineHeight;
             }
             ScissorsHandler.INSTANCE.removeLastScissor();
             ScissorsHandler.INSTANCE.scissor(scrolling.getBounds());
@@ -214,7 +210,7 @@ public class DefaultInformationCategory implements RecipeCategory<DefaultInforma
         }
         
         @Override
-        public List<? extends Element> children() {
+        public List<? extends GuiEventListener> children() {
             return Collections.emptyList();
         }
     }

+ 13 - 13
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationDisplay.java

@@ -29,8 +29,8 @@ import me.shedaniel.rei.api.RecipeDisplay;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.text.Text;
-import net.minecraft.util.Identifier;
+import net.minecraft.network.chat.Component;
+import net.minecraft.resources.ResourceLocation;
 
 import java.util.Arrays;
 import java.util.Collection;
@@ -40,20 +40,20 @@ import java.util.List;
 @Environment(EnvType.CLIENT)
 public class DefaultInformationDisplay implements RecipeDisplay {
     private List<EntryStack> entryStacks;
-    private List<Text> texts;
-    private Text name;
+    private List<Component> texts;
+    private Component name;
     
-    protected DefaultInformationDisplay(List<EntryStack> entryStacks, Text name) {
+    protected DefaultInformationDisplay(List<EntryStack> entryStacks, Component name) {
         this.entryStacks = entryStacks;
         this.name = name;
         this.texts = Lists.newArrayList();
     }
     
-    public static DefaultInformationDisplay createFromEntries(List<EntryStack> entryStacks, Text name) {
+    public static DefaultInformationDisplay createFromEntries(List<EntryStack> entryStacks, Component name) {
         return new DefaultInformationDisplay(entryStacks, name);
     }
     
-    public static DefaultInformationDisplay createFromEntry(EntryStack entryStack, Text name) {
+    public static DefaultInformationDisplay createFromEntry(EntryStack entryStack, Component name) {
         return createFromEntries(Collections.singletonList(entryStack), name);
     }
     
@@ -67,17 +67,17 @@ public class DefaultInformationDisplay implements RecipeDisplay {
         return Collections.singletonList(entryStacks);
     }
     
-    public DefaultInformationDisplay line(Text line) {
+    public DefaultInformationDisplay line(Component line) {
         texts.add(line);
         return this;
     }
     
-    public DefaultInformationDisplay lines(Text... lines) {
+    public DefaultInformationDisplay lines(Component... lines) {
         texts.addAll(Arrays.asList(lines));
         return this;
     }
     
-    public DefaultInformationDisplay lines(Collection<Text> lines) {
+    public DefaultInformationDisplay lines(Collection<Component> lines) {
         texts.addAll(lines);
         return this;
     }
@@ -86,16 +86,16 @@ public class DefaultInformationDisplay implements RecipeDisplay {
         return entryStacks;
     }
     
-    Text getName() {
+    Component getName() {
         return name;
     }
     
-    List<Text> getTexts() {
+    List<Component> getTexts() {
         return texts;
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.INFO;
     }
 }

+ 21 - 20
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/mixin/MixinBrewingRecipeRegistry.java → RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/mixin/MixinPotionBrewing.java

@@ -29,13 +29,13 @@ import me.shedaniel.rei.plugin.brewing.BrewingRecipe;
 import me.shedaniel.rei.plugin.brewing.RegisteredBrewingRecipe;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.PotionItem;
-import net.minecraft.potion.Potion;
-import net.minecraft.potion.PotionUtil;
-import net.minecraft.recipe.BrewingRecipeRegistry;
-import net.minecraft.recipe.Ingredient;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.PotionItem;
+import net.minecraft.world.item.alchemy.Potion;
+import net.minecraft.world.item.alchemy.PotionBrewing;
+import net.minecraft.world.item.alchemy.PotionUtils;
+import net.minecraft.world.item.crafting.Ingredient;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Unique;
 import org.spongepowered.asm.mixin.injection.At;
@@ -44,43 +44,44 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
 
 import java.util.List;
 
-@Mixin(BrewingRecipeRegistry.class)
+@Mixin(PotionBrewing.class)
 @Environment(EnvType.CLIENT)
-public class MixinBrewingRecipeRegistry {
+public class MixinPotionBrewing {
     
     @Unique private static final List<BrewingRecipe> SELF_ITEM_RECIPES = Lists.newArrayList();
     @Unique private static final List<Potion> REGISTERED_POTION_TYPES = Lists.newArrayList();
     @Unique private static final List<Ingredient> SELF_POTION_TYPES = Lists.newArrayList();
     
-    @Inject(method = "registerPotionType", at = @At("RETURN"))
-    private static void method_8080(Item item_1, CallbackInfo ci) {
+    @Inject(method = "addContainer", at = @At("RETURN"))
+    private static void addContainer(Item item_1, CallbackInfo ci) {
         if (item_1 instanceof PotionItem)
-            SELF_POTION_TYPES.add(Ingredient.ofItems(item_1));
+            SELF_POTION_TYPES.add(Ingredient.of(item_1));
     }
     
-    @Inject(method = "registerItemRecipe", at = @At("RETURN"))
-    private static void method_8071(Item item_1, Item item_2, Item item_3, CallbackInfo ci) {
+    @Inject(method = "addContainerRecipe", at = @At("RETURN"))
+    private static void addContainerRecipe(Item item_1, Item item_2, Item item_3, CallbackInfo ci) {
         if (item_1 instanceof PotionItem && item_3 instanceof PotionItem)
-            SELF_ITEM_RECIPES.add(new BrewingRecipe(item_1, Ingredient.ofItems(item_2), item_3));
+            SELF_ITEM_RECIPES.add(new BrewingRecipe(item_1, Ingredient.of(item_2), item_3));
     }
     
-    @Inject(method = "registerPotionRecipe", at = @At("RETURN"))
-    private static void registerPotionRecipe(Potion potion_1, Item item_1, Potion potion_2, CallbackInfo ci) {
+    @Inject(method = "addMix", at = @At("RETURN"))
+    private static void addMix(Potion potion_1, Item item_1, Potion potion_2, CallbackInfo ci) {
         if (!REGISTERED_POTION_TYPES.contains(potion_1))
             rei_registerPotionType(potion_1);
         if (!REGISTERED_POTION_TYPES.contains(potion_2))
             rei_registerPotionType(potion_2);
         for (Ingredient type : SELF_POTION_TYPES) {
-            for (ItemStack stack : type.getMatchingStacksClient()) {
-                DefaultPlugin.registerBrewingRecipe(new RegisteredBrewingRecipe(PotionUtil.setPotion(stack.copy(), potion_1), Ingredient.ofItems(item_1), PotionUtil.setPotion(stack.copy(), potion_2)));
+            for (ItemStack stack : type.getItems()) {
+                DefaultPlugin.registerBrewingRecipe(new RegisteredBrewingRecipe(PotionUtils.setPotion(stack.copy(), potion_1), Ingredient.of(item_1), PotionUtils.setPotion(stack.copy(), potion_2)));
             }
         }
     }
     
+    @Unique
     private static void rei_registerPotionType(Potion potion) {
         REGISTERED_POTION_TYPES.add(potion);
         for (BrewingRecipe recipe : SELF_ITEM_RECIPES) {
-            DefaultPlugin.registerBrewingRecipe(new RegisteredBrewingRecipe(PotionUtil.setPotion(recipe.input.getStackForRender(), potion), recipe.ingredient, PotionUtil.setPotion(recipe.output.getStackForRender(), potion)));
+            DefaultPlugin.registerBrewingRecipe(new RegisteredBrewingRecipe(PotionUtils.setPotion(recipe.input.getDefaultInstance(), potion), recipe.ingredient, PotionUtils.setPotion(recipe.output.getDefaultInstance(), potion)));
         }
     }
     

+ 6 - 7
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/pathing/DefaultPathingCategory.java

@@ -23,10 +23,7 @@
 
 package me.shedaniel.rei.plugin.pathing;
 
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.item.Items;
-import net.minecraft.util.Identifier;
-
+import com.google.common.collect.Lists;
 import me.shedaniel.math.Point;
 import me.shedaniel.math.Rectangle;
 import me.shedaniel.rei.api.EntryStack;
@@ -34,14 +31,16 @@ import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.widgets.Widgets;
 import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.plugin.DefaultPlugin;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.Items;
 
-import com.google.common.collect.Lists;
 import java.util.List;
 
 public class DefaultPathingCategory implements RecipeCategory<DefaultPathingDisplay> {
     
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return DefaultPlugin.PATHING;
     }
     
@@ -52,7 +51,7 @@ public class DefaultPathingCategory implements RecipeCategory<DefaultPathingDisp
     
     @Override
     public String getCategoryName() {
-        return I18n.translate("category.rei.pathing");
+        return I18n.get("category.rei.pathing");
     }
     
     @Override

+ 5 - 7
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/pathing/DefaultPathingDisplay.java

@@ -23,15 +23,13 @@
 
 package me.shedaniel.rei.plugin.pathing;
 
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.Identifier;
-
 import me.shedaniel.rei.api.EntryStack;
 import me.shedaniel.rei.api.RecipeDisplay;
 import me.shedaniel.rei.plugin.DefaultPlugin;
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.ItemStack;
 
 import java.util.Collections;
 import java.util.List;
@@ -69,7 +67,7 @@ public class DefaultPathingDisplay implements RecipeDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.PATHING;
     }
     

+ 6 - 7
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/pathing/DummyShovelItem.java

@@ -23,20 +23,19 @@
 
 package me.shedaniel.rei.plugin.pathing;
 
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockState;
-import net.minecraft.item.HoeItem;
-import net.minecraft.item.ShovelItem;
-import net.minecraft.item.ToolMaterial;
+import net.minecraft.world.item.ShovelItem;
+import net.minecraft.world.item.Tier;
+import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.state.BlockState;
 
 import java.util.Map;
 
 public class DummyShovelItem extends ShovelItem {
-    protected DummyShovelItem(ToolMaterial toolMaterial_1, float float_1, float float_2, Settings item$Settings_1) {
+    protected DummyShovelItem(Tier toolMaterial_1, float float_1, float float_2, Properties item$Settings_1) {
         super(toolMaterial_1, float_1, float_2, item$Settings_1);
     }
     
     public static Map<Block, BlockState> getPathBlocksMap() {
-        return PATH_BLOCKSTATES;
+        return FLATTENABLES;
     }
 }

+ 3 - 3
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/smelting/DefaultSmeltingDisplay.java

@@ -27,8 +27,8 @@ import me.shedaniel.rei.plugin.DefaultPlugin;
 import me.shedaniel.rei.plugin.cooking.DefaultCookingDisplay;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.recipe.SmeltingRecipe;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.crafting.SmeltingRecipe;
 
 @Environment(EnvType.CLIENT)
 public class DefaultSmeltingDisplay extends DefaultCookingDisplay {
@@ -38,7 +38,7 @@ public class DefaultSmeltingDisplay extends DefaultCookingDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.SMELTING;
     }
 }

+ 5 - 5
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/smithing/DefaultSmithingCategory.java

@@ -31,21 +31,21 @@ import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.widgets.Widgets;
 import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.plugin.DefaultPlugin;
-import net.minecraft.block.Blocks;
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.util.Identifier;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.level.block.Blocks;
 
 import java.util.List;
 
 public class DefaultSmithingCategory implements RecipeCategory<DefaultSmithingDisplay> {
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return DefaultPlugin.SMITHING;
     }
     
     @Override
     public String getCategoryName() {
-        return I18n.translate("category.rei.smithing");
+        return I18n.get("category.rei.smithing");
     }
     
     @Override

+ 8 - 8
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/smithing/DefaultSmithingDisplay.java

@@ -29,8 +29,8 @@ import me.shedaniel.rei.api.RecipeDisplay;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.recipe.SmithingRecipe;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.crafting.UpgradeRecipe;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -45,20 +45,20 @@ public class DefaultSmithingDisplay implements RecipeDisplay {
     @NotNull
     private List<EntryStack> output;
     @Nullable
-    private Identifier location;
+    private ResourceLocation location;
     
-    public DefaultSmithingDisplay(@NotNull SmithingRecipe recipe) {
+    public DefaultSmithingDisplay(@NotNull UpgradeRecipe recipe) {
         this(
                 Lists.newArrayList(
                         EntryStack.ofIngredient(recipe.base),
                         EntryStack.ofIngredient(recipe.addition)
                 ),
-                Collections.singletonList(EntryStack.create(recipe.getOutput())),
+                Collections.singletonList(EntryStack.create(recipe.getResultItem())),
                 recipe.getId()
         );
     }
     
-    public DefaultSmithingDisplay(@NotNull List<List<EntryStack>> input, @NotNull List<EntryStack> output, @Nullable Identifier location) {
+    public DefaultSmithingDisplay(@NotNull List<List<EntryStack>> input, @NotNull List<EntryStack> output, @Nullable ResourceLocation location) {
         this.input = input;
         this.output = output;
         if (this.input.size() != 2) throw new IllegalArgumentException("input must have 2 entries.");
@@ -81,12 +81,12 @@ public class DefaultSmithingDisplay implements RecipeDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.SMITHING;
     }
     
     @Override
-    public Optional<Identifier> getRecipeLocation() {
+    public Optional<ResourceLocation> getRecipeLocation() {
         return Optional.ofNullable(location);
     }
 }

+ 3 - 3
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/smoking/DefaultSmokingDisplay.java

@@ -25,8 +25,8 @@ package me.shedaniel.rei.plugin.smoking;
 
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import me.shedaniel.rei.plugin.cooking.DefaultCookingDisplay;
-import net.minecraft.recipe.SmokingRecipe;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.crafting.SmokingRecipe;
 
 public class DefaultSmokingDisplay extends DefaultCookingDisplay {
     
@@ -35,7 +35,7 @@ public class DefaultSmokingDisplay extends DefaultCookingDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.SMOKING;
     }
 }

+ 5 - 5
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingCategory.java

@@ -31,16 +31,16 @@ import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.widgets.Widgets;
 import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.plugin.DefaultPlugin;
-import net.minecraft.block.Blocks;
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.util.Identifier;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.level.block.Blocks;
 
 import java.util.List;
 
 public class DefaultStoneCuttingCategory implements RecipeCategory<DefaultStoneCuttingDisplay> {
     
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return DefaultPlugin.STONE_CUTTING;
     }
     
@@ -51,7 +51,7 @@ public class DefaultStoneCuttingCategory implements RecipeCategory<DefaultStoneC
     
     @Override
     public String getCategoryName() {
-        return I18n.translate("category.rei.stone_cutting");
+        return I18n.get("category.rei.stone_cutting");
     }
     
     @Override

+ 13 - 13
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingDisplay.java

@@ -28,12 +28,12 @@ import me.shedaniel.rei.api.RecipeDisplay;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.item.ItemStack;
-import net.minecraft.recipe.CuttingRecipe;
-import net.minecraft.recipe.Ingredient;
-import net.minecraft.recipe.StonecuttingRecipe;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.collection.DefaultedList;
+import net.minecraft.core.NonNullList;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.crafting.Ingredient;
+import net.minecraft.world.item.crafting.SingleItemRecipe;
+import net.minecraft.world.item.crafting.StonecutterRecipe;
 
 import java.util.Collections;
 import java.util.List;
@@ -44,21 +44,21 @@ public class DefaultStoneCuttingDisplay implements RecipeDisplay {
     
     private List<List<EntryStack>> inputs;
     private List<EntryStack> output;
-    private StonecuttingRecipe display;
+    private StonecutterRecipe display;
     
-    public DefaultStoneCuttingDisplay(StonecuttingRecipe recipe) {
-        this(recipe.getPreviewInputs(), recipe.getOutput());
+    public DefaultStoneCuttingDisplay(StonecutterRecipe recipe) {
+        this(recipe.getIngredients(), recipe.getResultItem());
         this.display = recipe;
     }
     
-    public DefaultStoneCuttingDisplay(DefaultedList<Ingredient> ingredients, ItemStack output) {
+    public DefaultStoneCuttingDisplay(NonNullList<Ingredient> ingredients, ItemStack output) {
         this.inputs = EntryStack.ofIngredients(ingredients);
         this.output = Collections.singletonList(EntryStack.create(output));
     }
     
     @Override
-    public Optional<Identifier> getRecipeLocation() {
-        return Optional.ofNullable(display).map(CuttingRecipe::getId);
+    public Optional<ResourceLocation> getRecipeLocation() {
+        return Optional.ofNullable(display).map(SingleItemRecipe::getId);
     }
     
     @Override
@@ -72,7 +72,7 @@ public class DefaultStoneCuttingDisplay implements RecipeDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.STONE_CUTTING;
     }
     

+ 5 - 5
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/stripping/DefaultStrippingCategory.java

@@ -31,16 +31,16 @@ import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.widgets.Widgets;
 import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.plugin.DefaultPlugin;
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.item.Items;
-import net.minecraft.util.Identifier;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.Items;
 
 import java.util.List;
 
 public class DefaultStrippingCategory implements RecipeCategory<DefaultStrippingDisplay> {
     
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return DefaultPlugin.STRIPPING;
     }
     
@@ -51,7 +51,7 @@ public class DefaultStrippingCategory implements RecipeCategory<DefaultStripping
     
     @Override
     public String getCategoryName() {
-        return I18n.translate("category.rei.stripping");
+        return I18n.get("category.rei.stripping");
     }
     
     @Override

+ 3 - 3
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/stripping/DefaultStrippingDisplay.java

@@ -28,8 +28,8 @@ import me.shedaniel.rei.api.RecipeDisplay;
 import me.shedaniel.rei.plugin.DefaultPlugin;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.Identifier;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.ItemStack;
 
 import java.util.Collections;
 import java.util.List;
@@ -67,7 +67,7 @@ public class DefaultStrippingDisplay implements RecipeDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.STRIPPING;
     }
     

+ 5 - 5
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/stripping/DummyAxeItem.java

@@ -23,18 +23,18 @@
 
 package me.shedaniel.rei.plugin.stripping;
 
-import net.minecraft.block.Block;
-import net.minecraft.item.AxeItem;
-import net.minecraft.item.ToolMaterial;
+import net.minecraft.world.item.AxeItem;
+import net.minecraft.world.item.Tier;
+import net.minecraft.world.level.block.Block;
 
 import java.util.Map;
 
 public class DummyAxeItem extends AxeItem {
-    protected DummyAxeItem(ToolMaterial toolMaterial_1, float float_1, float float_2, Settings item$Settings_1) {
+    protected DummyAxeItem(Tier toolMaterial_1, float float_1, float float_2, Properties item$Settings_1) {
         super(toolMaterial_1, float_1, float_2, item$Settings_1);
     }
     
     public static Map<Block, Block> getStrippedBlocksMap() {
-        return STRIPPED_BLOCKS;
+        return STRIPABLES;
     }
 }

+ 6 - 7
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/tilling/DefaultTillingCategory.java

@@ -23,10 +23,7 @@
 
 package me.shedaniel.rei.plugin.tilling;
 
-import net.minecraft.client.resource.language.I18n;
-import net.minecraft.item.Items;
-import net.minecraft.util.Identifier;
-
+import com.google.common.collect.Lists;
 import me.shedaniel.math.Point;
 import me.shedaniel.math.Rectangle;
 import me.shedaniel.rei.api.EntryStack;
@@ -34,14 +31,16 @@ import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.widgets.Widgets;
 import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.plugin.DefaultPlugin;
+import net.minecraft.client.resources.language.I18n;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.Items;
 
-import com.google.common.collect.Lists;
 import java.util.List;
 
 public class DefaultTillingCategory implements RecipeCategory<DefaultTillingDisplay> {
     
     @Override
-    public Identifier getIdentifier() {
+    public ResourceLocation getIdentifier() {
         return DefaultPlugin.TILLING;
     }
     
@@ -52,7 +51,7 @@ public class DefaultTillingCategory implements RecipeCategory<DefaultTillingDisp
     
     @Override
     public String getCategoryName() {
-        return I18n.translate("category.rei.tilling");
+        return I18n.get("category.rei.tilling");
     }
     
     @Override

+ 5 - 7
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/tilling/DefaultTillingDisplay.java

@@ -23,15 +23,13 @@
 
 package me.shedaniel.rei.plugin.tilling;
 
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.Identifier;
-
 import me.shedaniel.rei.api.EntryStack;
 import me.shedaniel.rei.api.RecipeDisplay;
 import me.shedaniel.rei.plugin.DefaultPlugin;
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.ItemStack;
 
 import java.util.Collections;
 import java.util.List;
@@ -69,7 +67,7 @@ public class DefaultTillingDisplay implements RecipeDisplay {
     }
     
     @Override
-    public Identifier getRecipeCategory() {
+    public ResourceLocation getRecipeCategory() {
         return DefaultPlugin.TILLING;
     }
     

+ 6 - 6
RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/tilling/DummyHoeItem.java

@@ -23,19 +23,19 @@
 
 package me.shedaniel.rei.plugin.tilling;
 
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockState;
-import net.minecraft.item.HoeItem;
-import net.minecraft.item.ToolMaterial;
+import net.minecraft.world.item.HoeItem;
+import net.minecraft.world.item.Tier;
+import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.state.BlockState;
 
 import java.util.Map;
 
 public class DummyHoeItem extends HoeItem {
-    protected DummyHoeItem(ToolMaterial toolMaterial_1, int int_1, float float_1, Settings item$Settings_1) {
+    protected DummyHoeItem(Tier toolMaterial_1, int int_1, float float_1, Properties item$Settings_1) {
         super(toolMaterial_1, int_1, float_1, item$Settings_1);
     }
     
     public static Map<Block, BlockState> getTilledBlocksMap() {
-        return TILLED_BLOCKS;
+        return TILLABLES;
     }
 }

+ 1 - 1
RoughlyEnoughItems-default-plugin/src/main/resources/mixin.roughlyenoughitems-default-plugin.json

@@ -5,7 +5,7 @@
   "compatibilityLevel": "JAVA_8",
   "mixins": [],
   "client": [
-    "MixinBrewingRecipeRegistry"
+    "MixinPotionBrewing"
   ],
   "injectors": {
     "defaultRequire": 1

+ 13 - 13
RoughlyEnoughItems-default-plugin/src/main/resources/roughlyenoughitems-default-plugin.accessWidener

@@ -1,14 +1,14 @@
 accessWidener   v1  named
-accessible field net/minecraft/item/BucketItem fluid Lnet/minecraft/fluid/Fluid;
-accessible field net/minecraft/client/gui/screen/ingame/AbstractInventoryScreen offsetGuiForEffects Z
-accessible field net/minecraft/client/gui/screen/recipebook/RecipeBookWidget ghostSlots Lnet/minecraft/client/gui/screen/recipebook/RecipeBookGhostSlots;
-accessible field net/minecraft/client/gui/screen/recipebook/RecipeBookWidget searchField Lnet/minecraft/client/gui/widget/TextFieldWidget;
-accessible field net/minecraft/client/gui/screen/recipebook/RecipeBookWidget tabButtons Ljava/util/List;
-accessible field net/minecraft/client/gui/screen/ingame/ContainerScreen x I
-accessible field net/minecraft/client/gui/screen/ingame/ContainerScreen y I
-accessible field net/minecraft/client/gui/screen/ingame/ContainerScreen containerWidth I
-accessible field net/minecraft/client/gui/screen/ingame/ContainerScreen containerHeight I
-accessible field net/minecraft/client/gui/screen/ingame/ContainerScreen focusedSlot Lnet/minecraft/screen/slot/Slot;
-accessible method net/minecraft/client/gui/DrawableHelper drawTexturedQuad (Lnet/minecraft/util/math/Matrix4f;IIIIIFFFF)V
-accessible field net/minecraft/recipe/SmithingRecipe base Lnet/minecraft/recipe/Ingredient;
-accessible field net/minecraft/recipe/SmithingRecipe addition Lnet/minecraft/recipe/Ingredient;
+accessible field net/minecraft/world/item/BucketItem content Lnet/minecraft/world/level/material/Fluid;
+accessible field net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen doRenderEffects Z
+accessible field net/minecraft/client/gui/screens/recipebook/RecipeBookComponent ghostRecipe Lnet/minecraft/client/gui/screens/recipebook/GhostRecipe;
+accessible field net/minecraft/client/gui/screens/recipebook/RecipeBookComponent searchBox Lnet/minecraft/client/gui/components/EditBox;
+accessible field net/minecraft/client/gui/screens/recipebook/RecipeBookComponent tabButtons Ljava/util/List;
+accessible field net/minecraft/client/gui/screens/inventory/AbstractContainerScreen leftPos I
+accessible field net/minecraft/client/gui/screens/inventory/AbstractContainerScreen topPos I
+accessible field net/minecraft/client/gui/screens/inventory/AbstractContainerScreen imageWidth I
+accessible field net/minecraft/client/gui/screens/inventory/AbstractContainerScreen imageHeight I
+accessible field net/minecraft/client/gui/screens/inventory/AbstractContainerScreen hoveredSlot Lnet/minecraft/world/inventory/Slot;
+accessible method net/minecraft/client/gui/GuiComponent innerBlit (Lcom/mojang/math/Matrix4f;IIIIIFFFF)V
+accessible field net/minecraft/world/item/crafting/UpgradeRecipe base Lnet/minecraft/world/item/crafting/Ingredient;
+accessible field net/minecraft/world/item/crafting/UpgradeRecipe addition Lnet/minecraft/world/item/crafting/Ingredient;

+ 1 - 1
RoughlyEnoughItems-runtime/build.gradle

@@ -1,6 +1,6 @@
 archivesBaseName = "RoughlyEnoughItems-runtime"
 
-minecraft {
+loom {
     accessWidener = file("src/main/resources/roughlyenoughitems-runtime.accessWidener")
 }
 

Some files were not shown because too many files changed in this diff