From 866a775b643b1d729ccaf79e5e1772d481046246 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 18 Aug 2019 19:19:14 +0800 Subject: Close #140 --- src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java') diff --git a/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java b/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java index dfda85b2b..df4cb4c0c 100644 --- a/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java +++ b/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java @@ -12,6 +12,7 @@ import me.shedaniel.rei.api.ConfigManager; import me.shedaniel.rei.gui.config.ItemCheatingMode; import me.shedaniel.rei.gui.config.ItemListOrderingConfig; import me.shedaniel.rei.gui.config.RecipeScreenType; +import me.shedaniel.rei.gui.config.SearchFieldLocation; import me.zeroeightsix.fiber.exception.FiberException; import me.zeroeightsix.fiber.tree.ConfigValue; import net.minecraft.client.gui.screen.Screen; @@ -57,6 +58,14 @@ public class ClothScreenRegistry { .setSaveConsumer(var -> configValue.setValue((ItemCheatingMode) var)) .setErrorSupplier(var -> error((List) configValue.getConstraints(), var, ItemCheatingMode.class)) .build(); + }).registerConfigEntryFunction(SearchFieldLocation.class, o -> { + ConfigValue configValue = (ConfigValue) o; + return configEntryBuilder.startEnumSelector("config.roughlyenoughitems." + configValue.getName(), SearchFieldLocation.class, configValue.getValue()) + .setDefaultValue(configValue.getDefaultValue()) + .setTooltip(splitLine(configValue.getComment())) + .setSaveConsumer(var -> configValue.setValue((SearchFieldLocation) var)) + .setErrorSupplier(var -> error((List) configValue.getConstraints(), var, SearchFieldLocation.class)) + .build(); }).build().getScreen(); } -- cgit