diff options
Diffstat (limited to 'src/main/java')
18 files changed, 40 insertions, 30 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java index 9db9a349f..0f39b7205 100644 --- a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java +++ b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java @@ -5,7 +5,7 @@ package me.shedaniel.rei.api; -import me.shedaniel.rei.RoughlyEnoughItemsCore; +import me.shedaniel.rei.client.ScreenHelper; import me.shedaniel.rei.gui.RecipeViewingScreen; import me.shedaniel.rei.gui.renderables.RecipeRenderer; import me.shedaniel.rei.gui.widget.CategoryBaseWidget; @@ -46,6 +46,7 @@ public interface RecipeCategory<T extends RecipeDisplay> { * * @return the renderer of the icon */ + @SuppressWarnings("deprecation") default Renderer getIcon() { return Renderable.fromItemStackSupplier(this::getCategoryIcon); } @@ -63,6 +64,7 @@ public interface RecipeCategory<T extends RecipeDisplay> { * @param recipe the recipe to render * @return the recipe renderer */ + @SuppressWarnings("unchecked") default RecipeRenderer getSimpleRenderer(T recipe) { return Renderable.fromRecipe(recipe::getInput, recipe::getOutput); } @@ -88,7 +90,7 @@ public interface RecipeCategory<T extends RecipeDisplay> { */ default void drawCategoryBackground(Rectangle bounds, int mouseX, int mouseY, float delta) { new CategoryBaseWidget(bounds).render(); - if (RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme) { + if (ScreenHelper.isDarkModeEnabled()) { DrawableHelper.fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, 0xFF404040); DrawableHelper.fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, 0xFF404040); } else { diff --git a/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java b/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java index cd8ab6efb..d77e2c9ab 100644 --- a/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java +++ b/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java @@ -35,7 +35,6 @@ public interface RecipeDisplay<T extends Recipe> { * * @return the list of required items */ - @Deprecated default List<List<ItemStack>> getRequiredItems() { return Lists.newArrayList(); } diff --git a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java index cfbda23f0..ca0202d1f 100644 --- a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java +++ b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java @@ -15,6 +15,7 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.function.Function; +import java.util.function.Predicate; public interface RecipeHelper { @@ -194,6 +195,8 @@ public interface RecipeHelper { */ boolean isDisplayVisible(RecipeDisplay display); + <T extends Recipe<?>> void registerRecipes(Identifier category, Predicate<Recipe> recipeFilter, Function<T, RecipeDisplay> mappingFunction); + /** * Gets the cached category setting by the category identifier * diff --git a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java index 7f4a0ee80..83ee91458 100644 --- a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java +++ b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java @@ -19,6 +19,7 @@ import java.util.List; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; +import java.util.function.Predicate; import java.util.stream.Collectors; public class RecipeHelperImpl implements RecipeHelper { @@ -204,6 +205,7 @@ public class RecipeHelperImpl implements RecipeHelper { speedCraftAreaSupplierMap.put(category, rectangle); } + @SuppressWarnings("deprecation") @Override public void registerDefaultSpeedCraftButtonArea(Identifier category) { registerSpeedCraftButtonArea(category, bounds -> new Rectangle((int) bounds.getMaxX() - 16, (int) bounds.getMaxY() - 16, 10, 10)); @@ -271,7 +273,7 @@ public class RecipeHelperImpl implements RecipeHelper { Collections.reverse(allSortedRecipes); recipeFunctions.forEach(recipeFunction -> { try { - allSortedRecipes.stream().filter(recipe -> recipeFunction.recipeFilter.apply(recipe)).forEach(t -> registerDisplay(recipeFunction.category, (RecipeDisplay) recipeFunction.mappingFunction.apply(t), 0)); + allSortedRecipes.stream().filter(recipe -> recipeFunction.recipeFilter.test(recipe)).forEach(t -> registerDisplay(recipeFunction.category, (RecipeDisplay) recipeFunction.mappingFunction.apply(t), 0)); } catch (Exception e) { RoughlyEnoughItemsCore.LOGGER.error("[REI] Failed to add recipes!", e); } @@ -361,6 +363,11 @@ public class RecipeHelperImpl implements RecipeHelper { @Override public <T extends Recipe<?>> void registerRecipes(Identifier category, Function<Recipe, Boolean> recipeFilter, Function<T, RecipeDisplay> mappingFunction) { + recipeFunctions.add(new RecipeFunction(category, recipeFilter::apply, mappingFunction)); + } + + @Override + public <T extends Recipe<?>> void registerRecipes(Identifier category, Predicate<Recipe> recipeFilter, Function<T, RecipeDisplay> mappingFunction) { recipeFunctions.add(new RecipeFunction(category, recipeFilter, mappingFunction)); } @@ -376,10 +383,10 @@ public class RecipeHelperImpl implements RecipeHelper { private class RecipeFunction { Identifier category; - Function<Recipe, Boolean> recipeFilter; + Predicate<Recipe> recipeFilter; Function mappingFunction; - public RecipeFunction(Identifier category, Function<Recipe, Boolean> recipeFilter, Function<?, RecipeDisplay> mappingFunction) { + public RecipeFunction(Identifier category, Predicate<Recipe> recipeFilter, Function<?, RecipeDisplay> mappingFunction) { this.category = category; this.recipeFilter = recipeFilter; this.mappingFunction = mappingFunction; diff --git a/src/main/java/me/shedaniel/rei/client/RecipeScreenType.java b/src/main/java/me/shedaniel/rei/client/RecipeScreenType.java index 107e1e5fd..78158419f 100644 --- a/src/main/java/me/shedaniel/rei/client/RecipeScreenType.java +++ b/src/main/java/me/shedaniel/rei/client/RecipeScreenType.java @@ -7,8 +7,6 @@ package me.shedaniel.rei.client; import net.minecraft.client.resource.language.I18n; -import java.util.Locale; - public enum RecipeScreenType { UNSET, ORIGINAL, diff --git a/src/main/java/me/shedaniel/rei/client/ScreenHelper.java b/src/main/java/me/shedaniel/rei/client/ScreenHelper.java index 4b6572fd4..7c8085c1b 100644 --- a/src/main/java/me/shedaniel/rei/client/ScreenHelper.java +++ b/src/main/java/me/shedaniel/rei/client/ScreenHelper.java @@ -6,6 +6,7 @@ package me.shedaniel.rei.client; import com.google.common.collect.Lists; +import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.gui.ContainerScreenOverlay; import me.shedaniel.rei.gui.widget.SearchFieldWidget; import me.shedaniel.rei.listeners.ContainerScreenHooks; @@ -75,6 +76,10 @@ public class ScreenHelper implements ClientModInitializer { consumer.accept(actualX, actualY, delta); } + public static boolean isDarkModeEnabled() { + return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme; + } + @Override public void onInitializeClient() { ClientTickCallback.EVENT.register(client -> { diff --git a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java index 5dd88c61e..4d0ec388a 100644 --- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java @@ -306,7 +306,7 @@ public class RecipeViewingScreen extends Screen { int yy = bounds.y + 16; preWidgets.add(new CategoryBaseWidget(new Rectangle(xx - 6, yy - 6, 15 + innerWidth * 18, 11 + actualHeight * 18))); int index = 0; - List list = Collections.singletonList(ChatFormat.YELLOW.toString() + I18n.translate("text.rei.working_station")); + List<String> list = Collections.singletonList(ChatFormat.YELLOW.toString() + I18n.translate("text.rei.working_station")); xx += (innerWidth - 1) * 18; for(List<ItemStack> workingStation : workingStations) { preWidgets.add(new SlotWidget(xx, yy, workingStation, true, true, true) { @@ -379,7 +379,7 @@ public class RecipeViewingScreen extends Screen { selectedCategory.drawCategoryBackground(bounds, mouseX, mouseY, delta); else { new CategoryBaseWidget(bounds).render(); - if (RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme) { + if (ScreenHelper.isDarkModeEnabled()) { fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, 0xFF404040); fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, 0xFF404040); } else { diff --git a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java index 6a4208a93..5d754fb91 100644 --- a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java @@ -107,7 +107,7 @@ public class VillagerRecipeViewingScreen extends Screen { int yy = bounds.y + bounds.height + 5; widgets.add(new CategoryBaseWidget(new Rectangle(xx - 6, bounds.y + bounds.height - 5, 11 + w * 18, 15 + h * 18))); int index = 0; - List list = Collections.singletonList(ChatFormat.YELLOW.toString() + I18n.translate("text.rei.working_station")); + List<String> list = Collections.singletonList(ChatFormat.YELLOW.toString() + I18n.translate("text.rei.working_station")); for(List<ItemStack> workingStation : workingStations) { widgets.add(new SlotWidget(xx, yy, workingStation, true, true, true) { @Override @@ -225,7 +225,7 @@ public class VillagerRecipeViewingScreen extends Screen { @Override public int getDefaultColor() { - return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? 0xFFBBBBBB : 4210752; + return ScreenHelper.isDarkModeEnabled() ? 0xFFBBBBBB : 4210752; } }); @@ -355,7 +355,7 @@ public class VillagerRecipeViewingScreen extends Screen { GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.shadeModel(7425); buffer.begin(7, VertexFormats.POSITION_COLOR); - float b = RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? 0.37f : 1f; + float b = ScreenHelper.isDarkModeEnabled() ? 0.37f : 1f; buffer.vertex(scrollbarPositionMinX, minY + scrollBarHeight, 1000D).color(b, b, b, scrollBarAlpha).next(); buffer.vertex(scrollbarPositionMaxX, minY + scrollBarHeight, 1000D).color(b, b, b, scrollBarAlpha).next(); buffer.vertex(scrollbarPositionMaxX, minY, 1000D).color(b, b, b, scrollBarAlpha).next(); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java index 28ed82e41..e9fa8753b 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java @@ -6,7 +6,6 @@ package me.shedaniel.rei.gui.widget; import com.mojang.blaze3d.platform.GlStateManager; -import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.client.ScreenHelper; import net.minecraft.client.gui.Element; import net.minecraft.client.sound.PositionedSoundInstance; @@ -65,7 +64,7 @@ public abstract class ButtonWidget extends HighlightableWidget { @Override public void render(int mouseX, int mouseY, float delta) { int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; - minecraft.getTextureManager().bindTexture(RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? BUTTON_LOCATION_DARK : BUTTON_LOCATION); + minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? BUTTON_LOCATION_DARK : BUTTON_LOCATION); GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); int textureOffset = this.getTextureId(isHovered(mouseX, mouseY)); GlStateManager.enableBlend(); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java index 67d263fd9..4cd90b5e4 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java @@ -5,7 +5,6 @@ package me.shedaniel.rei.gui.widget; -import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.client.ScreenHelper; import net.minecraft.ChatFormat; @@ -40,11 +39,11 @@ public abstract class ClickableLabelWidget extends LabelWidget { } public int getDefaultColor() { - return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? 0xFFBBBBBB : -1; + return ScreenHelper.isDarkModeEnabled() ? 0xFFBBBBBB : -1; } public int getHoveredColor() { - return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? -1 : 0xFF66FFCC; + return ScreenHelper.isDarkModeEnabled() ? -1 : 0xFF66FFCC; } @Override diff --git a/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java index 2ae427e19..af452579d 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java @@ -8,6 +8,7 @@ package me.shedaniel.rei.gui.widget; import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.client.RecipeScreenType; +import me.shedaniel.rei.client.ScreenHelper; import net.minecraft.client.render.GuiLighting; import net.minecraft.util.Identifier; @@ -56,7 +57,7 @@ public class RecipeBaseWidget extends HighlightableWidget { return; GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); GuiLighting.disable(); - minecraft.getTextureManager().bindTexture(RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? CHEST_GUI_TEXTURE_DARK : CHEST_GUI_TEXTURE); + minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? CHEST_GUI_TEXTURE_DARK : CHEST_GUI_TEXTURE); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; int textureOffset = getTextureOffset(); @@ -85,7 +86,7 @@ public class RecipeBaseWidget extends HighlightableWidget { } protected int getInnerColor() { - return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? 0xFF2E2E2E : -3750202; + return ScreenHelper.isDarkModeEnabled() ? 0xFF2E2E2E : -3750202; } protected int getTextureOffset() { diff --git a/src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java index d00098e65..072ce5196 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java @@ -5,7 +5,7 @@ package me.shedaniel.rei.gui.widget; -import me.shedaniel.rei.RoughlyEnoughItemsCore; +import me.shedaniel.rei.client.ScreenHelper; import java.awt.*; @@ -17,7 +17,7 @@ public class SlotBaseWidget extends RecipeBaseWidget { @Override public int getInnerColor() { - return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? 0xFF303030 : -7631989; + return ScreenHelper.isDarkModeEnabled() ? 0xFF303030 : -7631989; } @Override diff --git a/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java index 9bb20a201..796bfcd1b 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java @@ -8,7 +8,6 @@ package me.shedaniel.rei.gui.widget; import com.google.common.collect.Lists; import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.cloth.api.ClientUtils; -import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.ClientHelper; import me.shedaniel.rei.api.Renderable; import me.shedaniel.rei.api.Renderer; @@ -114,7 +113,7 @@ public class SlotWidget extends HighlightableWidget { @Override public void render(int mouseX, int mouseY, float delta) { Renderer renderer = getCurrentRenderer(); - boolean darkTheme = RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme; + boolean darkTheme = ScreenHelper.isDarkModeEnabled(); if (drawBackground) { minecraft.getTextureManager().bindTexture(darkTheme ? RECIPE_GUI_DARK : RECIPE_GUI); blit(this.x - 1, this.y - 1, 0, 222, 18, 18); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java index 0ca0849d9..86d7c61f7 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java @@ -6,7 +6,6 @@ package me.shedaniel.rei.gui.widget; import com.mojang.blaze3d.platform.GlStateManager; -import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.ClientHelper; import me.shedaniel.rei.api.RecipeCategory; import me.shedaniel.rei.api.Renderer; @@ -75,7 +74,7 @@ public class TabWidget extends HighlightableWidget { if (shown) { GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); GuiLighting.disable(); - minecraft.getTextureManager().bindTexture(RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? CHEST_GUI_TEXTURE_DARK : CHEST_GUI_TEXTURE); + minecraft.getTextureManager().bindTexture(ScreenHelper.isDarkModeEnabled() ? CHEST_GUI_TEXTURE_DARK : CHEST_GUI_TEXTURE); 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); diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java b/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java index 3861735c1..9455eb65a 100644 --- a/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java +++ b/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java @@ -6,7 +6,6 @@ package me.shedaniel.rei.plugin; import com.mojang.blaze3d.platform.GlStateManager; -import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.RecipeCategory; import me.shedaniel.rei.api.Renderable; import me.shedaniel.rei.api.Renderer; diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java b/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java index 3815b35b9..ea4b21d43 100644 --- a/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java +++ b/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java @@ -47,7 +47,7 @@ public class DefaultPlugin implements REIPluginEntry { private static final List<DefaultBrewingDisplay> BREWING_DISPLAYS = Lists.newArrayList(); public static Identifier getDisplayTexture() { - return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? DISPLAY_TEXTURE_DARK : DISPLAY_TEXTURE; + return ScreenHelper.isDarkModeEnabled() ? DISPLAY_TEXTURE_DARK : DISPLAY_TEXTURE; } public static void registerBrewingDisplay(DefaultBrewingDisplay display) { diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultShapelessDisplay.java b/src/main/java/me/shedaniel/rei/plugin/DefaultShapelessDisplay.java index f927c1a3c..b3c4fe323 100644 --- a/src/main/java/me/shedaniel/rei/plugin/DefaultShapelessDisplay.java +++ b/src/main/java/me/shedaniel/rei/plugin/DefaultShapelessDisplay.java @@ -5,7 +5,6 @@ package me.shedaniel.rei.plugin; -import com.google.common.collect.Lists; import net.minecraft.item.ItemStack; import net.minecraft.recipe.ShapelessRecipe; diff --git a/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java b/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java index 2e16d5cce..29f8e4d2f 100644 --- a/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java +++ b/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java @@ -14,6 +14,7 @@ import me.shedaniel.cloth.hooks.ScreenHooks; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.ItemCheatingMode; import me.shedaniel.rei.client.RecipeScreenType; +import me.shedaniel.rei.client.ScreenHelper; import me.shedaniel.rei.gui.config.ItemListOrderingConfig; import me.shedaniel.rei.gui.credits.CreditsScreen; import net.minecraft.client.MinecraftClient; @@ -52,7 +53,7 @@ public class ClothScreenRegistry { } }); ConfigScreenBuilder.CategoryBuilder appearance = builder.addCategory("text.rei.config.appearance"); - appearance.addOption(new BooleanListEntry("text.rei.config.dark_theme", RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme, RESET, () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme = bool, () -> getConfigTooltip("dark_theme"))); + appearance.addOption(new BooleanListEntry("text.rei.config.dark_theme", ScreenHelper.isDarkModeEnabled(), RESET, () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme = bool, () -> getConfigTooltip("dark_theme"))); appearance.addOption(new EnumListEntry<>("text.rei.config.recipe_screen_type", RecipeScreenType.class, RoughlyEnoughItemsCore.getConfigManager().getConfig().screenType, RESET, () -> RecipeScreenType.UNSET, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().screenType = bool, EnumListEntry.DEFAULT_NAME_PROVIDER, () -> getConfigTooltip("recipe_screen_type"))); appearance.addOption(new BooleanListEntry("text.rei.config.side_search_box", RoughlyEnoughItemsCore.getConfigManager().getConfig().sideSearchField, RESET, () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().sideSearchField = bool, () -> getConfigTooltip("side_search_box"))); appearance.addOption(new EnumListEntry<>("text.rei.config.list_ordering", ItemListOrderingConfig.class, ItemListOrderingConfig.from(RoughlyEnoughItemsCore.getConfigManager().getConfig().itemListOrdering, RoughlyEnoughItemsCore.getConfigManager().getConfig().isAscending), RESET, () -> ItemListOrderingConfig.REGISTRY_ASCENDING, config -> { |
