aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-03-21 21:15:10 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-03-21 21:15:10 +0800
commit0d7431e4981226aba9d8011d76eabfb03d134499 (patch)
treeb21f733f3c98377907358109c1011193bfd5029a /src/main/java
parentc2d28cbf7028ffed2f56169adbce3f03cc0c5b49 (diff)
downloadRoughlyEnoughItems-0d7431e4981226aba9d8011d76eabfb03d134499.tar.gz
RoughlyEnoughItems-0d7431e4981226aba9d8011d76eabfb03d134499.tar.bz2
RoughlyEnoughItems-0d7431e4981226aba9d8011d76eabfb03d134499.zip
Large v2.5 Update
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java12
-rw-r--r--src/main/java/me/shedaniel/rei/api/ConfigManager.java3
-rw-r--r--src/main/java/me/shedaniel/rei/api/DisplaySettings.java8
-rw-r--r--src/main/java/me/shedaniel/rei/api/RecipeCategory.java11
-rw-r--r--src/main/java/me/shedaniel/rei/client/ClientHelper.java10
-rw-r--r--src/main/java/me/shedaniel/rei/client/ConfigManager.java38
-rw-r--r--src/main/java/me/shedaniel/rei/client/ConfigObject.java4
-rw-r--r--src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java6
-rw-r--r--src/main/java/me/shedaniel/rei/client/ScreenHelper.java28
-rw-r--r--src/main/java/me/shedaniel/rei/client/SearchArgument.java9
-rw-r--r--src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java44
-rw-r--r--src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java30
-rw-r--r--src/main/java/me/shedaniel/rei/gui/config/ConfigEntry.java145
-rw-r--r--src/main/java/me/shedaniel/rei/gui/config/ConfigEntryListWidget.java35
-rw-r--r--src/main/java/me/shedaniel/rei/gui/config/ConfigScreen.java340
-rw-r--r--src/main/java/me/shedaniel/rei/gui/config/ItemListOrderingEntry.java94
-rw-r--r--src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java2
-rw-r--r--src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java6
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java10
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java10
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/CraftableToggleButtonWidget.java6
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/DraggableWidget.java6
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/ItemListOverlay.java12
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/ItemSlotWidget.java13
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java2
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/QueuedTooltip.java6
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java6
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java10
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/SpeedCraftingButtonWidget.java4
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java16
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java8
-rw-r--r--src/main/java/me/shedaniel/rei/mixin/MixinContainerScreen.java11
-rw-r--r--src/main/java/me/shedaniel/rei/mixin/MixinCreativePlayerInventoryScreen.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultBrewingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultCampfireCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultCraftingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultSmeltingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultSmokingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultStoneCuttingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/utils/ClothRegistry.java58
41 files changed, 337 insertions, 698 deletions
diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
index 886a5aa98..d293da2e0 100644
--- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
+++ b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
@@ -15,6 +15,7 @@ import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.network.ServerSidePacketRegistry;
import net.fabricmc.loader.api.FabricLoader;
+import net.minecraft.client.MinecraftClient;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.server.network.ServerPlayerEntity;
@@ -25,6 +26,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -99,6 +101,16 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer, ModInitiali
RoughlyEnoughItemsCore.LOGGER.fatal("[REI] Cloth NOT found! It is a dependency of REI: https://minecraft.curseforge.com/projects/cloth");
System.exit(0);
}
+
+ if (!FabricLoader.getInstance().isModLoaded("modmenu")) {
+ try {
+ Class<?> modMenuApi_ = Class.forName("io.github.prospector.modmenu.api.ModMenuApi");
+ Method addConfigOverride_ = modMenuApi_.getMethod("addConfigOverride", String.class, Runnable.class);
+ addConfigOverride_.invoke(null, "roughlyenoughitems", (Runnable) () -> getConfigManager().openConfigScreen(MinecraftClient.getInstance().currentScreen));
+ } catch (Exception e) {
+ RoughlyEnoughItemsCore.LOGGER.error("Error enabling the Mod Menu config button for Hwyla", e);
+ }
+ }
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/api/ConfigManager.java b/src/main/java/me/shedaniel/rei/api/ConfigManager.java
index 2e951f103..781c34143 100644
--- a/src/main/java/me/shedaniel/rei/api/ConfigManager.java
+++ b/src/main/java/me/shedaniel/rei/api/ConfigManager.java
@@ -1,6 +1,7 @@
package me.shedaniel.rei.api;
import me.shedaniel.rei.client.ConfigObject;
+import net.minecraft.client.gui.Screen;
import java.io.IOException;
@@ -16,4 +17,6 @@ public interface ConfigManager {
void toggleCraftableOnly();
+ void openConfigScreen(Screen parent);
+
}
diff --git a/src/main/java/me/shedaniel/rei/api/DisplaySettings.java b/src/main/java/me/shedaniel/rei/api/DisplaySettings.java
index 334d6cc6f..6eb5ef5a6 100644
--- a/src/main/java/me/shedaniel/rei/api/DisplaySettings.java
+++ b/src/main/java/me/shedaniel/rei/api/DisplaySettings.java
@@ -12,4 +12,12 @@ public interface DisplaySettings<T extends RecipeDisplay> {
return -1;
}
+ default VisableType canDisplay(T display) {
+ return VisableType.ALWAYS;
+ }
+
+ public static enum VisableType {
+ ALWAYS, PASS, NEVER;
+ }
+
}
diff --git a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java
index 9fdd35801..a20c505e2 100644
--- a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java
+++ b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java
@@ -1,5 +1,6 @@
package me.shedaniel.rei.api;
+import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.gui.RecipeViewingScreen;
import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
import me.shedaniel.rei.gui.widget.Widget;
@@ -26,7 +27,7 @@ public interface RecipeCategory<T extends RecipeDisplay> {
}
default void drawCategoryBackground(Rectangle bounds, int mouseX, int mouseY, float delta) {
- new RecipeBaseWidget(bounds).draw(mouseX, mouseY, delta);
+ new RecipeBaseWidget(bounds).render();
DrawableHelper.drawRect(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, RecipeViewingScreen.SUB_COLOR.getRGB());
DrawableHelper.drawRect(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, RecipeViewingScreen.SUB_COLOR.getRGB());
}
@@ -50,6 +51,14 @@ public interface RecipeCategory<T extends RecipeDisplay> {
};
}
+ default boolean canDisplay(RecipeDisplay display) {
+ if (getDisplaySettings().canDisplay(display) == DisplaySettings.VisableType.ALWAYS)
+ return true;
+ if (getDisplaySettings().canDisplay(display) == DisplaySettings.VisableType.NEVER)
+ return false;
+ return RoughlyEnoughItemsCore.getConfigManager().getConfig().preferVisibleRecipes;
+ }
+
default int getDisplayHeight() {
return getDisplaySettings().getDisplayHeight(this);
}
diff --git a/src/main/java/me/shedaniel/rei/client/ClientHelper.java b/src/main/java/me/shedaniel/rei/client/ClientHelper.java
index 89678caeb..dc5ae16d1 100644
--- a/src/main/java/me/shedaniel/rei/client/ClientHelper.java
+++ b/src/main/java/me/shedaniel/rei/client/ClientHelper.java
@@ -7,7 +7,6 @@ import me.shedaniel.rei.api.RecipeCategory;
import me.shedaniel.rei.api.RecipeDisplay;
import me.shedaniel.rei.api.RecipeHelper;
import me.shedaniel.rei.gui.RecipeViewingScreen;
-import me.shedaniel.rei.gui.config.ConfigScreen;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.keybinding.FabricKeyBinding;
import net.fabricmc.fabric.api.network.ClientSidePacketRegistry;
@@ -16,7 +15,6 @@ import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.fabricmc.loader.api.metadata.ModMetadata;
import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.Screen;
import net.minecraft.client.gui.ingame.CreativePlayerInventoryScreen;
import net.minecraft.client.util.InputUtil;
import net.minecraft.item.ItemStack;
@@ -110,14 +108,6 @@ public class ClientHelper implements ClientModInitializer {
return map.keySet().size() > 0;
}
- public static void openConfigWindow(Screen parent, boolean initOverlay) {
- MinecraftClient.getInstance().openScreen(new ConfigScreen(parent, initOverlay));
- }
-
- public static void openConfigWindow(Screen parent) {
- openConfigWindow(parent, true);
- }
-
public static List<ItemStack> getInventoryItemsTypes() {
List<DefaultedList<ItemStack>> field_7543 = ImmutableList.of(MinecraftClient.getInstance().player.inventory.main, MinecraftClient.getInstance().player.inventory.armor, MinecraftClient.getInstance().player.inventory.offHand);
List<ItemStack> inventoryStacks = new ArrayList<>();
diff --git a/src/main/java/me/shedaniel/rei/client/ConfigManager.java b/src/main/java/me/shedaniel/rei/client/ConfigManager.java
index 8973e5865..60020526f 100644
--- a/src/main/java/me/shedaniel/rei/client/ConfigManager.java
+++ b/src/main/java/me/shedaniel/rei/client/ConfigManager.java
@@ -4,8 +4,18 @@ import blue.endless.jankson.Jankson;
import blue.endless.jankson.JsonObject;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
+import javafx.util.Pair;
+import me.shedaniel.cloth.api.ConfigScreenBuilder;
+import me.shedaniel.cloth.gui.ClothConfigScreen;
+import me.shedaniel.cloth.gui.entries.BooleanListEntry;
+import me.shedaniel.cloth.gui.entries.IntegerListEntry;
+import me.shedaniel.cloth.gui.entries.StringListEntry;
import me.shedaniel.rei.RoughlyEnoughItemsCore;
+import me.shedaniel.rei.gui.config.ItemListOrderingEntry;
import net.fabricmc.loader.api.FabricLoader;
+import net.minecraft.client.MinecraftClient;
+import net.minecraft.client.gui.Screen;
+import net.minecraft.client.resource.language.I18n;
import java.io.File;
import java.io.FileOutputStream;
@@ -118,4 +128,32 @@ public class ConfigManager implements me.shedaniel.rei.api.ConfigManager {
craftableOnly = !craftableOnly;
}
+ @Override
+ public void openConfigScreen(Screen parent) {
+ ClothConfigScreen.Builder builder = new ClothConfigScreen.Builder(parent, I18n.translate("text.rei.config.title"), null);
+ builder.addCategory(I18n.translate("text.rei.config.general")).addOption(new BooleanListEntry("text.rei.config.cheating", config.cheating, bool -> config.cheating = bool));
+ ConfigScreenBuilder.CategoryBuilder appearance = builder.addCategory(I18n.translate("text.rei.config.appearance"));
+ appearance.addOption(new BooleanListEntry("text.rei.config.side_search_box", config.sideSearchField, bool -> config.sideSearchField = bool));
+ appearance.addOption(new ItemListOrderingEntry("text.rei.config.list_ordering", new Pair<>(config.itemListOrdering, config.isAscending)));
+ appearance.addOption(new BooleanListEntry("text.rei.config.mirror_rei", config.mirrorItemPanel, bool -> config.mirrorItemPanel = bool));
+ appearance.addOption(new IntegerListEntry("text.rei.config.max_recipes_per_page", config.maxRecipePerPage, i -> config.maxRecipePerPage = i).setMinimum(2).setMaximum(99));
+ ConfigScreenBuilder.CategoryBuilder modules = builder.addCategory(I18n.translate("text.rei.config.modules"));
+ modules.addOption(new BooleanListEntry("text.rei.config.enable_craftable_only", config.enableCraftableOnlyButton, bool -> config.enableCraftableOnlyButton = bool));
+ modules.addOption(new BooleanListEntry("text.rei.config.enable_util_buttons", config.showUtilsButtons, bool -> config.showUtilsButtons = bool));
+ modules.addOption(new BooleanListEntry("text.rei.config.disable_recipe_book", config.disableRecipeBook, bool -> config.disableRecipeBook = bool));
+ ConfigScreenBuilder.CategoryBuilder advanced = builder.addCategory(I18n.translate("text.rei.config.advanced"));
+ advanced.addOption(new StringListEntry("text.rei.give_command", config.giveCommand, s -> config.giveCommand = s));
+ advanced.addOption(new StringListEntry("text.rei.gamemode_command", config.gamemodeCommand, s -> config.gamemodeCommand = s));
+ advanced.addOption(new StringListEntry("text.rei.weather_command", config.weatherCommand, s -> config.weatherCommand = s));
+ advanced.addOption(new BooleanListEntry("text.rei.config.prefer_visible_recipes", config.preferVisibleRecipes, bool -> config.preferVisibleRecipes = bool));
+ builder.setOnSave(savedConfig -> {
+ try {
+ ConfigManager.this.saveConfig();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ });
+ MinecraftClient.getInstance().openScreen(builder.build());
+ }
+
}
diff --git a/src/main/java/me/shedaniel/rei/client/ConfigObject.java b/src/main/java/me/shedaniel/rei/client/ConfigObject.java
index b1303a697..67d81b5d4 100644
--- a/src/main/java/me/shedaniel/rei/client/ConfigObject.java
+++ b/src/main/java/me/shedaniel/rei/client/ConfigObject.java
@@ -31,7 +31,7 @@ public class ConfigObject {
@Comment("True: item panel on the left, false: on the right")
public boolean mirrorItemPanel = false;
- @Comment("To disable REI's defualt plugin, don't change this unless you understand what you are doing")
+ @Comment("To disable REI's default plugin, don't change this unless you understand what you are doing")
public boolean loadDefaultPlugin = true;
@Comment("Maximum recipes viewed at one time.")
@@ -43,6 +43,8 @@ public class ConfigObject {
@Comment("Disable Recipe Book")
public boolean disableRecipeBook = false;
+ public boolean preferVisibleRecipes = false;
+
@Comment("The location of choose page dialog")
public RelativePoint choosePageDialogPoint = new RelativePoint(.5, .5);
diff --git a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
index 161f32fc9..539897376 100644
--- a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
+++ b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
@@ -81,7 +81,7 @@ public class RecipeHelperImpl implements RecipeHelper {
Map<RecipeCategory, List<RecipeDisplay>> recipeCategoryListMap = Maps.newLinkedHashMap();
categories.forEach(category -> {
if (categoriesMap.containsKey(category.getIdentifier()) && !categoriesMap.get(category.getIdentifier()).isEmpty())
- recipeCategoryListMap.put(category, categoriesMap.get(category.getIdentifier()));
+ recipeCategoryListMap.put(category, categoriesMap.get(category.getIdentifier()).stream().filter(display -> category.canDisplay(display)).collect(Collectors.toList()));
});
return recipeCategoryListMap;
}
@@ -119,7 +119,7 @@ public class RecipeHelperImpl implements RecipeHelper {
Map<RecipeCategory, List<RecipeDisplay>> recipeCategoryListMap = Maps.newLinkedHashMap();
categories.forEach(category -> {
if (categoriesMap.containsKey(category.getIdentifier()) && !categoriesMap.get(category.getIdentifier()).isEmpty())
- recipeCategoryListMap.put(category, categoriesMap.get(category.getIdentifier()));
+ recipeCategoryListMap.put(category, categoriesMap.get(category.getIdentifier()).stream().filter(display -> category.canDisplay(display)).collect(Collectors.toList()));
});
return recipeCategoryListMap;
}
@@ -200,7 +200,7 @@ public class RecipeHelperImpl implements RecipeHelper {
recipeCategoryListMap.forEach((identifier, recipeDisplays) -> tempMap.put(identifier, new LinkedList<>(recipeDisplays)));
categories.forEach(category -> {
if (tempMap.containsKey(category.getIdentifier()))
- map.put(category, tempMap.get(category.getIdentifier()));
+ map.put(category, tempMap.get(category.getIdentifier()).stream().filter(display -> category.canDisplay(display)).collect(Collectors.toList()));
});
return map;
}
diff --git a/src/main/java/me/shedaniel/rei/client/ScreenHelper.java b/src/main/java/me/shedaniel/rei/client/ScreenHelper.java
index 5c7112d41..fa109b98d 100644
--- a/src/main/java/me/shedaniel/rei/client/ScreenHelper.java
+++ b/src/main/java/me/shedaniel/rei/client/ScreenHelper.java
@@ -1,7 +1,6 @@
package me.shedaniel.rei.client;
import com.google.common.collect.Lists;
-import com.mojang.blaze3d.platform.GlStateManager;
import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.gui.ContainerScreenOverlay;
import me.shedaniel.rei.gui.widget.TextFieldWidget;
@@ -10,13 +9,12 @@ import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.event.client.ClientTickCallback;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.ContainerScreen;
-import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.InputListener;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.RecipeBookButtonWidget;
-import net.minecraft.client.render.GuiLighting;
import net.minecraft.client.util.Window;
import net.minecraft.item.ItemStack;
+import org.apache.logging.log4j.util.TriConsumer;
import java.awt.*;
import java.util.List;
@@ -71,35 +69,19 @@ public class ScreenHelper implements ClientModInitializer {
return (ContainerScreenHooks) lastContainerScreen;
}
- public static void drawHoveringWidget(int x, int y, Drawable drawable, int width, int height, float delta) {
+ public static void drawHoveringWidget(int x, int y, TriConsumer<Integer, Integer, Float> consumer, int width, int height, float delta) {
Window window = MinecraftClient.getInstance().window;
- drawHoveringWidget(new Dimension(window.getScaledWidth(), window.getScaledHeight()), x, y, drawable, width, height, delta);
+ drawHoveringWidget(new Dimension(window.getScaledWidth(), window.getScaledHeight()), x, y, consumer, width, height, delta);
}
- public static void drawHoveringWidget(Dimension dimension, int x, int y, Drawable drawable, int width, int height, float delta) {
+ 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;
-
- drawable.draw(int_5, int_6, delta);
- // zOffset = 300.0F;
- // itemRenderer.zOffset = 300.0F;
- // int int_9 = -267386864;
- // drawGradientRect(int_5 - 3, int_6 - 4, int_5 + width + 3, int_6 - 3, -267386864, -267386864);
- // drawGradientRect(int_5 - 3, int_6 + height + 3, int_5 + width + 3, int_6 + height + 4, -267386864, -267386864);
- // drawGradientRect(int_5 - 3, int_6 - 3, int_5 + width + 3, int_6 + height + 3, -267386864, -267386864);
- // drawGradientRect(int_5 - 4, int_6 - 3, int_5 - 3, int_6 + height + 3, -267386864, -267386864);
- // drawGradientRect(int_5 + width + 3, int_6 - 3, int_5 + width + 4, int_6 + height + 3, -267386864, -267386864);
- // int int_10 = 1347420415;
- // int int_11 = 1344798847;
- // drawGradientRect(int_5 - 3, int_6 - 3 + 1, int_5 - 3 + 1, int_6 + height + 3 - 1, 1347420415, 1344798847);
- // drawGradientRect(int_5 + width + 2, int_6 - 3 + 1, int_5 + width + 3, int_6 + height + 3 - 1, 1347420415, 1344798847);
- // drawGradientRect(int_5 - 3, int_6 - 3, int_5 + width + 3, int_6 - 3 + 1, 1347420415, 1347420415);
- // drawGradientRect(int_5 - 3, int_6 + height + 2, int_5 + width + 3, int_6 + height + 3, 1344798847, 1344798847);
+ consumer.accept(int_5, int_6, delta);
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/client/SearchArgument.java b/src/main/java/me/shedaniel/rei/client/SearchArgument.java
index 445214871..f3a5a5032 100644
--- a/src/main/java/me/shedaniel/rei/client/SearchArgument.java
+++ b/src/main/java/me/shedaniel/rei/client/SearchArgument.java
@@ -2,14 +2,9 @@ package me.shedaniel.rei.client;
public class SearchArgument {
- public enum ArgumentType {
- TEXT, MOD, TOOLTIP
- }
-
private ArgumentType argumentType;
private String text;
private boolean include;
-
public SearchArgument(ArgumentType argumentType, String text, boolean include) {
this.argumentType = argumentType;
this.text = text;
@@ -33,4 +28,8 @@ public class SearchArgument {
return String.format("Argument[%s]: name = %s, include = %b", argumentType.name(), text, include);
}
+ public enum ArgumentType {
+ TEXT, MOD, TOOLTIP
+ }
+
}
diff --git a/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java b/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java
index 8692e68a9..e2039b811 100644
--- a/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java
+++ b/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java
@@ -2,7 +2,7 @@ package me.shedaniel.rei.gui;
import com.google.common.collect.Lists;
import com.mojang.blaze3d.platform.GlStateManager;
-import me.shedaniel.cloth.ClothInitializer;
+import me.shedaniel.cloth.api.ClientUtils;
import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.client.ClientHelper;
import me.shedaniel.rei.client.ScreenHelper;
@@ -77,7 +77,7 @@ public class ContainerScreenOverlay extends ScreenComponent {
}
@Override
- public void setHasFocus(boolean boolean_1) {
+ public void onFocusChanged(boolean boolean_1) {
}
});
widgets.add(buttonRight = new ButtonWidget(rectangle.x + rectangle.width - 18, rectangle.y + 5, 16, 16, new TranslatableTextComponent("text.rei.right_arrow")) {
@@ -95,7 +95,7 @@ public class ContainerScreenOverlay extends ScreenComponent {
}
@Override
- public void setHasFocus(boolean boolean_1) {
+ public void onFocusChanged(boolean boolean_1) {
}
});
if (setPage)
@@ -107,12 +107,12 @@ public class ContainerScreenOverlay extends ScreenComponent {
ClientHelper.setCheating(!ClientHelper.isCheating());
return;
}
- ClientHelper.openConfigWindow(ScreenHelper.getLastContainerScreen());
+ RoughlyEnoughItemsCore.getConfigManager().openConfigScreen(ScreenHelper.getLastContainerScreen());
}
@Override
- public void draw(int mouseX, int mouseY, float partialTicks) {
- super.draw(mouseX, mouseY, partialTicks);
+ public void render(int mouseX, int mouseY, float partialTicks) {
+ super.render(mouseX, mouseY, partialTicks);
GuiLighting.disable();
if (ClientHelper.isCheating())
drawRect(getBounds().x, getBounds().y, getBounds().x + 20, getBounds().y + 20, new Color(255, 0, 0, 42).getRGB());
@@ -133,7 +133,7 @@ public class ContainerScreenOverlay extends ScreenComponent {
}
@Override
- public void setHasFocus(boolean boolean_1) {
+ public void onFocusChanged(boolean boolean_1) {
}
});
if (RoughlyEnoughItemsCore.getConfigManager().getConfig().showUtilsButtons) {
@@ -144,9 +144,9 @@ public class ContainerScreenOverlay extends ScreenComponent {
}
@Override
- public void draw(int mouseX, int mouseY, float partialTicks) {
+ public void render(int mouseX, int mouseY, float partialTicks) {
text = getGameModeShortText(getCurrentGameMode());
- super.draw(mouseX, mouseY, partialTicks);
+ super.render(mouseX, mouseY, partialTicks);
}
@Override
@@ -155,7 +155,7 @@ public class ContainerScreenOverlay extends ScreenComponent {
}
@Override
- public void setHasFocus(boolean boolean_1) {
+ public void onFocusChanged(boolean boolean_1) {
}
});
widgets.add(new ButtonWidget(RoughlyEnoughItemsCore.getConfigManager().getConfig().mirrorItemPanel ? window.getScaledWidth() - 80 : 60, 10, 20, 20, "") {
@@ -165,8 +165,8 @@ public class ContainerScreenOverlay exten