Browse Source

this is still not working

Unknown 6 năm trước cách đây
mục cha
commit
1781de617b

+ 5 - 1
src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java

@@ -42,6 +42,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 
 public class RoughlyEnoughItemsCore implements ClientModInitializer {
@@ -206,7 +207,10 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
     
     private void registerClothEvents() {
         ClothClientHooks.SYNC_RECIPES.register((minecraftClient, recipeManager, synchronizeRecipesS2CPacket) -> {
-            ((RecipeHelperImpl) RoughlyEnoughItemsCore.getRecipeHelper()).recipesLoaded(recipeManager);
+            if (RoughlyEnoughItemsCore.getConfigManager().getConfig().registerRecipesInAnotherThread)
+                CompletableFuture.runAsync(() -> ((RecipeHelperImpl) RoughlyEnoughItemsCore.getRecipeHelper()).recipesLoaded(recipeManager));
+            else
+                ((RecipeHelperImpl) RoughlyEnoughItemsCore.getRecipeHelper()).recipesLoaded(recipeManager);
         });
         ClothClientHooks.SCREEN_ADD_BUTTON.register((minecraftClient, screen, abstractButtonWidget) -> {
             if (RoughlyEnoughItemsCore.getConfigManager().getConfig().disableRecipeBook && screen instanceof AbstractContainerScreen && abstractButtonWidget instanceof RecipeBookButtonWidget)

+ 1 - 0
src/main/java/me/shedaniel/rei/api/RecipeDisplay.java

@@ -35,6 +35,7 @@ public interface RecipeDisplay<T extends Recipe> {
      *
      * @return the list of required items
      */
+    @Deprecated
     default List<List<ItemStack>> getRequiredItems() {
         return Lists.newArrayList();
     }

+ 10 - 0
src/main/java/me/shedaniel/rei/api/RecipeHelper.java

@@ -52,6 +52,16 @@ public interface RecipeHelper {
      */
     void registerCategory(RecipeCategory category);
     
+    /**
+     * Registers the working stations of a category
+     *
+     * @param category        the category
+     * @param workingStations the working stations
+     */
+    void registerWorkingStations(Identifier category, ItemStack... workingStations);
+    
+    List<ItemStack> getWorkingStations(Identifier category);
+    
     /**
      * Registers a recipe display
      *

+ 2 - 0
src/main/java/me/shedaniel/rei/client/ConfigObject.java

@@ -50,6 +50,8 @@ public class ConfigObject {
     
     public boolean darkTheme = false;
     
+    public boolean registerRecipesInAnotherThread = true;
+    
     public RecipeScreenType screenType = RecipeScreenType.UNSET;
     
     @Comment(

+ 13 - 0
src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java

@@ -43,6 +43,7 @@ public class RecipeHelperImpl implements RecipeHelper {
     private final List<RecipeCategory> categories = Lists.newArrayList();
     private final Map<Identifier, ButtonAreaSupplier> speedCraftAreaSupplierMap = Maps.newHashMap();
     private final Map<Identifier, List<SpeedCraftFunctional>> speedCraftFunctionalMap = Maps.newHashMap();
+    private final Map<Identifier, List<ItemStack>> categoryWorkingStations = Maps.newHashMap();
     private final List<DisplayVisibilityHandler> displayVisibilityHandlers = Lists.newArrayList();
     private final List<LiveRecipeGenerator> liveRecipeGenerators = Lists.newArrayList();
     private RecipeManager recipeManager;
@@ -82,6 +83,17 @@ public class RecipeHelperImpl implements RecipeHelper {
         categories.add(category);
         categoryDisplaySettingsMap.put(category.getIdentifier(), category.getDisplaySettings());
         recipeCategoryListMap.put(category.getIdentifier(), Lists.newLinkedList());
+        categoryWorkingStations.put(category.getIdentifier(), Lists.newLinkedList());
+    }
+    
+    @Override
+    public void registerWorkingStations(Identifier category, ItemStack... workingStations) {
+        categoryWorkingStations.get(category).addAll(Arrays.asList(workingStations));
+    }
+    
+    @Override
+    public List<ItemStack> getWorkingStations(Identifier category) {
+        return categoryWorkingStations.get(category);
     }
     
     @Override
@@ -213,6 +225,7 @@ public class RecipeHelperImpl implements RecipeHelper {
         this.recipeCategoryListMap.clear();
         this.categories.clear();
         this.speedCraftAreaSupplierMap.clear();
+        this.categoryWorkingStations.clear();
         this.speedCraftFunctionalMap.clear();
         this.categoryDisplaySettingsMap.clear();
         this.recipeFunctions.clear();

+ 7 - 7
src/main/java/me/shedaniel/rei/client/ScreenHelper.java

@@ -66,13 +66,13 @@ public class ScreenHelper implements ClientModInitializer {
     }
     
     public static void drawHoveringWidget(Dimension dimension, int x, int y, TriConsumer<Integer, Integer, Float> consumer, int width, int height, float delta) {
-        int int_5 = x + 12;
-        int int_6 = y - 12;
-        if (int_5 + width > dimension.width)
-            int_5 -= 28 + width;
-        if (int_6 + height + 6 > dimension.height)
-            int_6 = dimension.height - height - 6;
-        consumer.accept(int_5, int_6, delta);
+        int actualX = Math.max(x + 12, 6);
+        int actualY = Math.min(y - height / 2, dimension.height - height - 6);
+        if (actualX + width > dimension.width)
+            actualX -= 24 + width;
+        if (actualY < 6)
+            actualY += 24;
+        consumer.accept(actualX, actualY, delta);
     }
     
     @Override

+ 11 - 16
src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java

@@ -373,28 +373,24 @@ public class ContainerScreenOverlay extends AbstractParentElement implements Dra
         QUEUED_TOOLTIPS.clear();
     }
     
+    @SuppressWarnings("deprecation")
     public void renderTooltip(QueuedTooltip tooltip) {
-        renderTooltip(tooltip.getText(), tooltip.getX(), tooltip.getY());
+        if (tooltip.getConsumer() == null)
+            renderTooltip(tooltip.getText(), tooltip.getX(), tooltip.getY());
+        else
+            tooltip.getConsumer().accept(tooltip);
     }
     
     public void renderTooltip(List<String> lines, int mouseX, int mouseY) {
+        if (lines.isEmpty())
+            return;
         TextRenderer font = MinecraftClient.getInstance().textRenderer;
-        if (!lines.isEmpty()) {
+        int width = lines.stream().map(font::getStringWidth).max(Integer::compareTo).get();
+        int height = lines.size() <= 1 ? 8 : lines.size() * 10;
+        ScreenHelper.drawHoveringWidget(mouseX, mouseY, (x, y, aFloat) -> {
             GlStateManager.disableRescaleNormal();
             GuiLighting.disable();
             GlStateManager.disableLighting();
-            int width = 0;
-            for(String line : lines)
-                if (font.getStringWidth(line) > width)
-                    width = font.getStringWidth(line);
-            int height = lines.size() <= 1 ? 8 : lines.size() * 10;
-            int x = Math.max(mouseX + 12, 6);
-            int y = Math.min(mouseY - 12, window.getScaledHeight() - height - 6);
-            if (x + width > window.getScaledWidth())
-                x -= 24 + width;
-            if (y < 6)
-                y += 24;
-            
             this.blitOffset = 1000;
             this.fillGradient(x - 3, y - 4, x + width + 3, y - 3, -267386864, -267386864);
             this.fillGradient(x - 3, y + height + 3, x + width + 3, y + height + 4, -267386864, -267386864);
@@ -405,7 +401,6 @@ public class ContainerScreenOverlay extends AbstractParentElement implements Dra
             this.fillGradient(x + width + 2, y - 3 + 1, x + width + 3, y + height + 3 - 1, 1347420415, 1344798847);
             this.fillGradient(x - 3, y - 3, x + width + 3, y - 3 + 1, 1347420415, 1347420415);
             this.fillGradient(x - 3, y + height + 2, x + width + 3, y + height + 3, 1344798847, 1344798847);
-            
             int currentY = y;
             for(int lineIndex = 0; lineIndex < lines.size(); lineIndex++) {
                 GlStateManager.disableDepthTest();
@@ -417,7 +412,7 @@ public class ContainerScreenOverlay extends AbstractParentElement implements Dra
             GlStateManager.enableLighting();
             GuiLighting.enable();
             GlStateManager.enableRescaleNormal();
-        }
+        }, width, height, 0);
     }
     
     private boolean hasSameListContent(List<ItemStack> list1, List<ItemStack> list2) {

+ 13 - 0
src/main/java/me/shedaniel/rei/gui/widget/QueuedTooltip.java

@@ -12,11 +12,13 @@ import me.shedaniel.cloth.api.ClientUtils;
 import java.awt.*;
 import java.util.Collections;
 import java.util.List;
+import java.util.function.Consumer;
 
 public class QueuedTooltip {
     
     private Point location;
     private List<String> text;
+    private Consumer<QueuedTooltip> consumer = null;
     
     private QueuedTooltip(Point location, List<String> text) {
         this.location = location;
@@ -39,6 +41,17 @@ public class QueuedTooltip {
         return QueuedTooltip.create(ClientUtils.getMouseLocation(), text);
     }
     
+    @Deprecated
+    public QueuedTooltip setSpecialRenderer(Consumer<QueuedTooltip> consumer) {
+        this.consumer = consumer;
+        return this;
+    }
+    
+    @Deprecated
+    public Consumer<QueuedTooltip> getConsumer() {
+        return consumer;
+    }
+    
     public Point getLocation() {
         return location;
     }

+ 8 - 0
src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java

@@ -28,6 +28,14 @@ public class RecipeBaseWidget extends HighlightableWidget {
             throw new IllegalArgumentException("Base too small, at least 8x8!");
     }
     
+    public int getBlitOffset() {
+        return this.blitOffset;
+    }
+    
+    public void setBlitOffset(int offset) {
+        this.blitOffset = offset;
+    }
+    
     @Override
     public Rectangle getBounds() {
         return bounds;

+ 26 - 3
src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java

@@ -17,7 +17,6 @@ import me.shedaniel.rei.client.ScreenHelper;
 import me.shedaniel.rei.gui.renderables.ItemStackRenderer;
 import net.minecraft.client.gui.Element;
 import net.minecraft.item.ItemStack;
-import net.minecraft.item.Items;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.math.MathHelper;
 
@@ -30,8 +29,8 @@ import java.util.stream.Collectors;
 
 public class SlotWidget extends HighlightableWidget {
     
-    private static final Identifier RECIPE_GUI = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
-    private static final Identifier RECIPE_GUI_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
+    public static final Identifier RECIPE_GUI = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
+    public static final Identifier RECIPE_GUI_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
     private List<Renderer> renderers = new LinkedList<>();
     private boolean drawBackground, showToolTips, clickToMoreRecipes, drawHighlightedBackground;
     private int x, y;
@@ -59,6 +58,22 @@ public class SlotWidget extends HighlightableWidget {
         this.clickToMoreRecipes = clickToMoreRecipes;
     }
     
+    public int getX() {
+        return x;
+    }
+    
+    public void setX(int x) {
+        this.x = x;
+    }
+    
+    public int getY() {
+        return y;
+    }
+    
+    public void setY(int y) {
+        this.y = y;
+    }
+    
     public boolean isShowToolTips() {
         return showToolTips;
     }
@@ -126,6 +141,14 @@ public class SlotWidget extends HighlightableWidget {
         }
     }
     
+    public int getBlitOffset() {
+        return this.blitOffset;
+    }
+    
+    public void setBlitOffset(int offset) {
+        this.blitOffset = offset;
+    }
+    
     protected void queueTooltip(ItemStack itemStack, float delta) {
         ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltip(itemStack)));
     }

+ 99 - 3
src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java

@@ -5,6 +5,7 @@
 
 package me.shedaniel.rei.gui.widget;
 
+import com.google.common.collect.Lists;
 import com.mojang.blaze3d.platform.GlStateManager;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.ClientHelper;
@@ -12,18 +13,27 @@ import me.shedaniel.rei.api.RecipeCategory;
 import me.shedaniel.rei.api.Renderer;
 import me.shedaniel.rei.client.ScreenHelper;
 import net.minecraft.ChatFormat;
+import net.minecraft.client.MinecraftClient;
+import net.minecraft.client.font.TextRenderer;
 import net.minecraft.client.render.GuiLighting;
+import net.minecraft.client.render.item.ItemRenderer;
+import net.minecraft.item.ItemStack;
 import net.minecraft.util.Identifier;
+import net.minecraft.util.Pair;
+import net.minecraft.util.math.MathHelper;
 
 import java.awt.*;
 import java.util.Collections;
 import java.util.List;
+import java.util.function.Consumer;
 
 public class TabWidget extends HighlightableWidget {
     
     public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
     public static final Identifier CHEST_GUI_TEXTURE_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
     
+    private final Consumer<QueuedTooltip> tooltipRenderer;
+    private final List<ItemStack> slots;
     public boolean shown = false, selected = false;
     public Renderer renderer;
     public int id;
@@ -34,15 +44,99 @@ public class TabWidget extends HighlightableWidget {
     public TabWidget(int id, Rectangle bounds) {
         this.id = id;
         this.bounds = bounds;
+        this.slots = Lists.newArrayList();
+        this.tooltipRenderer = tooltip -> {
+            MinecraftClient client = MinecraftClient.getInstance();
+            int specWidth = MathHelper.clamp(slots.size(), 1, 9) * 18 + 10;
+            int specHeight = Math.max(1, MathHelper.ceil(slots.size() / 9)) * 18 + 10;
+            List<String> lines = tooltip.getText();
+            TextRenderer font = client.textRenderer;
+            int width = Math.max(lines.stream().map(font::getStringWidth).max(Integer::compareTo).get(), specWidth);
+            int tooltipHeight = lines.size() <= 1 ? 8 : lines.size() * 10;
+            int height = (lines.isEmpty() ? 0 : (tooltipHeight + 10)) + specHeight;
+            ScreenHelper.drawHoveringWidget(tooltip.getX(), tooltip.getY(), (x, y, aFloat) -> {
+                int currentY = y;
+                if (!lines.isEmpty()) {
+                    GlStateManager.disableRescaleNormal();
+                    GuiLighting.disable();
+                    GlStateManager.disableLighting();
+                    this.blitOffset = 1000;
+                    this.fillGradient(x - 3, y - 4, x + width + 3, y - 3, -267386864, -267386864);
+                    this.fillGradient(x - 3, y + tooltipHeight + 3, x + width + 3, y + tooltipHeight + 4, -267386864, -267386864);
+                    this.fillGradient(x - 3, y - 3, x + width + 3, y + tooltipHeight + 3, -267386864, -267386864);
+                    this.fillGradient(x - 4, y - 3, x - 3, y + tooltipHeight + 3, -267386864, -267386864);
+                    this.fillGradient(x + width + 3, y - 3, x + width + 4, y + tooltipHeight + 3, -267386864, -267386864);
+                    this.fillGradient(x - 3, y - 3 + 1, x - 3 + 1, y + tooltipHeight + 3 - 1, 1347420415, 1344798847);
+                    this.fillGradient(x + width + 2, y - 3 + 1, x + width + 3, y + tooltipHeight + 3 - 1, 1347420415, 1344798847);
+                    this.fillGradient(x - 3, y - 3, x + width + 3, y - 3 + 1, 1347420415, 1347420415);
+                    this.fillGradient(x - 3, y + tooltipHeight + 2, x + width + 3, y + tooltipHeight + 3, 1344798847, 1344798847);
+                    for(int lineIndex = 0; lineIndex < lines.size(); lineIndex++) {
+                        GlStateManager.disableDepthTest();
+                        font.drawWithShadow(lines.get(lineIndex), x, currentY, -1);
+                        GlStateManager.enableDepthTest();
+                        currentY += lineIndex == 0 ? 12 : 10;
+                    }
+                    this.blitOffset = 0;
+                    GlStateManager.enableLighting();
+                    GuiLighting.enable();
+                    GlStateManager.enableRescaleNormal();
+                    currentY += 6;
+                }
+                List<Pair<Point, ItemStack>> pairs = Lists.newArrayList();
+                GlStateManager.pushMatrix();
+                GlStateManager.translatef(x, currentY, 1000f);
+                new CategoryBaseWidget(new Rectangle(specWidth, specHeight)).render();
+                GlStateManager.popMatrix();
+                GlStateManager.pushMatrix();
+                GlStateManager.translatef(x, currentY, 0f);
+                int currentX = 5;
+                int currentYY = 5;
+                int i = 0;
+                this.blitOffset = 1000;
+                for(ItemStack itemStack : slots) {
+                    i++;
+                    minecraft.getTextureManager().bindTexture(RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? SlotWidget.RECIPE_GUI_DARK : SlotWidget.RECIPE_GUI);
+                    blit(currentX, currentYY, 0, 222, 18, 18);
+                    pairs.add(new Pair<>(new Point(x + currentX + 1, currentY + currentYY + 1), itemStack));
+                    currentX += 18;
+                    if (i > 9) {
+                        i = 1;
+                        currentX = 5;
+                        currentYY += 18;
+                    }
+                }
+                this.blitOffset = 0;
+                GlStateManager.popMatrix();
+                ItemRenderer itemRenderer = MinecraftClient.getInstance().getItemRenderer();
+                pairs.forEach(pair -> {
+                    ItemStack stack = pair.getRight();
+                    itemRenderer.zOffset = 1300;
+                    GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
+                    GuiLighting.enableForItems();
+                    int x1 = pair.getLeft().x;
+                    int y1 = pair.getLeft().y;
+                    blitOffset = 1300;
+                    GlStateManager.disableDepthTest();
+                    fillGradient(x1, y1, x1 + 16, y1 + 16, 0xFFFFFFFF, 0xFFFFFFFF);
+                    GlStateManager.enableDepthTest();
+                    blitOffset = 0;
+                    itemRenderer.renderGuiItem(stack, x1, y1);
+                    itemRenderer.renderGuiItemOverlay(font, stack, x1, y1);
+                    itemRenderer.zOffset = 0;
+                });
+            }, width, height, 0);
+        };
     }
     
     public void setRenderer(RecipeCategory category, Renderer renderable, String categoryName, boolean selected) {
+        slots.clear();
         if (renderable == null) {
             shown = false;
             this.renderer = null;
         } else {
             shown = true;
             this.renderer = renderable;
+            this.slots.addAll(RoughlyEnoughItemsCore.getRecipeHelper().getWorkingStations(category.getIdentifier()));
         }
         this.category = category;
         this.selected = selected;
@@ -79,16 +173,18 @@ public class TabWidget extends HighlightableWidget {
             this.blit(bounds.x, bounds.y + 2, selected ? 28 : 0, 192, 28, (selected ? 30 : 27));
             renderer.setBlitOffset(100);
             renderer.render((int) bounds.getCenterX(), (int) bounds.getCenterY(), mouseX, mouseY, delta);
-            if (isHighlighted(mouseX, mouseY))
+            if (isHighlighted(mouseX, mouseY)) {
                 drawTooltip();
+            }
         }
     }
     
+    @SuppressWarnings("deprecation")
     private void drawTooltip() {
         if (this.minecraft.options.advancedItemTooltips)
-            ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(categoryName, ChatFormat.DARK_GRAY.toString() + category.getIdentifier().toString(), ClientHelper.getInstance().getFormattedModFromIdentifier(category.getIdentifier())));
+            ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(categoryName, ChatFormat.DARK_GRAY.toString() + category.getIdentifier().toString(), ClientHelper.getInstance().getFormattedModFromIdentifier(category.getIdentifier())).setSpecialRenderer(tooltipRenderer));
         else
-            ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(categoryName, ClientHelper.getInstance().getFormattedModFromIdentifier(category.getIdentifier())));
+            ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(categoryName, ClientHelper.getInstance().getFormattedModFromIdentifier(category.getIdentifier())).setSpecialRenderer(tooltipRenderer));
     }
     
     @Override

+ 7 - 0
src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java

@@ -235,6 +235,13 @@ public class DefaultPlugin implements REIPluginEntry {
     
     @Override
     public void registerOthers(RecipeHelper recipeHelper) {
+        recipeHelper.registerWorkingStations(CRAFTING, Items.CRAFTING_TABLE.getDefaultStack(), Items.CAKE.getDefaultStack());
+        recipeHelper.registerWorkingStations(SMELTING, Items.FURNACE.getDefaultStack());
+        recipeHelper.registerWorkingStations(SMOKING, Items.SMOKER.getDefaultStack());
+        recipeHelper.registerWorkingStations(BLASTING, Items.BLAST_FURNACE.getDefaultStack());
+        recipeHelper.registerWorkingStations(CAMPFIRE, Items.CAMPFIRE.getDefaultStack());
+        recipeHelper.registerWorkingStations(BREWING, Items.BREWING_STAND.getDefaultStack());
+        recipeHelper.registerWorkingStations(STONE_CUTTING, Items.STONECUTTER.getDefaultStack());
         recipeHelper.registerRecipeVisibilityHandler(new DisplayVisibilityHandler() {
             @Override
             public DisplayVisibility handleDisplay(RecipeCategory category, RecipeDisplay display) {

+ 1 - 0
src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java

@@ -75,6 +75,7 @@ public class ClothScreenRegistry {
         action.addOption(new StringListEntry("text.rei.give_command", RoughlyEnoughItemsCore.getConfigManager().getConfig().giveCommand, RESET, () -> "/give {player_name} {item_identifier}{nbt} {count}", s -> RoughlyEnoughItemsCore.getConfigManager().getConfig().giveCommand = s, () -> getConfigTooltip("give_command")));
         action.addOption(new StringListEntry("text.rei.gamemode_command", RoughlyEnoughItemsCore.getConfigManager().getConfig().gamemodeCommand, RESET, () -> "/gamemode {gamemode}", s -> RoughlyEnoughItemsCore.getConfigManager().getConfig().gamemodeCommand = s, () -> getConfigTooltip("gamemode_command")));
         action.addOption(new StringListEntry("text.rei.weather_command", RoughlyEnoughItemsCore.getConfigManager().getConfig().weatherCommand, RESET, () -> "/weather {weather}", s -> RoughlyEnoughItemsCore.getConfigManager().getConfig().weatherCommand = s, () -> getConfigTooltip("weather_command")));
+        action.addOption(new BooleanListEntry("text.rei.config.register_in_other_thread", RoughlyEnoughItemsCore.getConfigManager().getConfig().registerRecipesInAnotherThread, RESET, () -> true, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().registerRecipesInAnotherThread = bool, () -> getConfigTooltip("register_in_other_thread")));
         ConfigScreenBuilder.CategoryBuilder modules = builder.addCategory("text.rei.config.modules");
         modules.addOption(new BooleanListEntry("text.rei.config.enable_craftable_only", RoughlyEnoughItemsCore.getConfigManager().getConfig().enableCraftableOnlyButton, RESET, () -> true, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().enableCraftableOnlyButton = bool, () -> getConfigTooltip("enable_craftable_only")));
         modules.addOption(new BooleanListEntry("text.rei.config.enable_util_buttons", RoughlyEnoughItemsCore.getConfigManager().getConfig().showUtilsButtons, RESET, () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().showUtilsButtons = bool, () -> getConfigTooltip("enable_util_buttons")));

+ 2 - 0
src/main/resources/assets/roughlyenoughitems/lang/en_us.json

@@ -101,6 +101,7 @@
   "text.rei.config.recipe_screen_type.villager": "Villager",
   "text.rei.select": "Select",
   "text.rei.recipe_id": "\n%sRecipe Id: %s",
+  "text.rei.config.register_in_other_thread": "Register Recipes in other thread:",
   "text.rei.recipe_screen_type.selection": "Recipe Screen Type Selection",
   "text.rei.recipe_screen_type.selection.sub": "You can always edit this setting again via the config screen.",
   "_comment": "Config Tooltips",
@@ -110,6 +111,7 @@
   "tooltip.rei.config.max_recipes_per_page": "Declares the maximum possible displayed recipes:\nValues: 2 - 99\n \nDefaulted: 3",
   "tooltip.rei.config.light_gray_recipe_border": "Declares the appearance of the recipe border:\nYes: Light Gray\nNo: Hard Black\n \nDefaulted: No",
   "tooltip.rei.config.april_fools.2019": "Forcefully enables the 2019 april fools joke:\nValues: Yes / No\n \nDefaulted: No",
+  "tooltip.rei.config.register_in_other_thread": "Requires datapacks to be reloaded.\nCan be done by rejoin the world / server",
   "_comment": "Don't change / translate the credit down below if you are doing it :)",
   "text.rei.credit.text": "§lRoughly Enough Items\n§7Originally a fork for Almost Enough Items.\n\n§lDevelopers\n  - Originally by ZenDarva\n  - Created by Danielshe\n  - Plugin Support by TehNut\n\n§lLanguage Translation\n  English - Danielshe\n  Simplified Chinese - XuyuEre & Danielshe\n  Traditional Chinese - hugoalh, gxy17886 & Danielshe\n  French - Yanis48\n  German - MelanX\n  Estonian - Madis0\n  Portuguese - thiagokenis\n  LOLCAT - Danielshe\n  Upside Down - Danielshe\n  Brazilian Portuguese - thiagokenis\n  Bulgarian - geniiii\n\n§lLicense\n§7Roughly Enough Items is using MIT."
 }