aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-08-08 17:13:01 +0800
committerDaniel She <shekwancheung0528@gmail.com>2019-08-08 17:13:39 +0800
commit47c7c18456493bc584835dcc3dd19d5dc444cc23 (patch)
tree1f7b02a511751c7e258144ddf9b5ddd5b4fdb086 /src/main
parent417b8df4d94d5e85a76933a9e4ea354f099749de (diff)
downloadRoughlyEnoughItems-47c7c18456493bc584835dcc3dd19d5dc444cc23.tar.gz
RoughlyEnoughItems-47c7c18456493bc584835dcc3dd19d5dc444cc23.tar.bz2
RoughlyEnoughItems-47c7c18456493bc584835dcc3dd19d5dc444cc23.zip
Append Mod Names Config
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/me/shedaniel/rei/client/ConfigObject.java23
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java13
-rw-r--r--src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java5
-rwxr-xr-xsrc/main/resources/assets/roughlyenoughitems/lang/en_us.json1
4 files changed, 30 insertions, 12 deletions
diff --git a/src/main/java/me/shedaniel/rei/client/ConfigObject.java b/src/main/java/me/shedaniel/rei/client/ConfigObject.java
index 252d630f6..c2d55dbb3 100644
--- a/src/main/java/me/shedaniel/rei/client/ConfigObject.java
+++ b/src/main/java/me/shedaniel/rei/client/ConfigObject.java
@@ -13,10 +13,13 @@ public class ConfigObject {
public boolean cheating = false;
+ public boolean appendModNames = true;
+
@Comment("The ordering of the items on the item panel.")
public ItemListOrdering itemListOrdering = ItemListOrdering.registry;
- @Comment("The ordering of the items on the item panel.") public boolean isAscending = true;
+ @Comment("The ordering of the items on the item panel.")
+ public boolean isAscending = true;
@Comment("To toggle the craftable button next to the search field.")
public boolean enableCraftableOnlyButton = true;
@@ -27,20 +30,26 @@ public class ConfigObject {
@Comment("The command used in servers to cheat items")
public String giveCommand = "/minecraft:give {player_name} {item_identifier}{nbt} {count}";
- @Comment("The command used to change gamemode") public String gamemodeCommand = "/gamemode {gamemode}";
+ @Comment("The command used to change gamemode")
+ public String gamemodeCommand = "/gamemode {gamemode}";
- @Comment("The command used to change weather") public String weatherCommand = "/weather {weather}";
+ @Comment("The command used to change weather")
+ public String weatherCommand = "/weather {weather}";
- @Comment("True: item panel on the left, false: on the right") public boolean mirrorItemPanel = false;
+ @Comment("True: item panel on the left, false: on the right")
+ public boolean mirrorItemPanel = false;
@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.") public int maxRecipePerPage = 3;
+ @Comment("Maximum recipes viewed at one time.")
+ public int maxRecipePerPage = 3;
- @Comment("Toggle utils buttons") public boolean showUtilsButtons = false;
+ @Comment("Toggle utils buttons")
+ public boolean showUtilsButtons = false;
- @Comment("Disable Recipe Book") public boolean disableRecipeBook = false;
+ @Comment("Disable Recipe Book")
+ public boolean disableRecipeBook = false;
public ItemCheatingMode itemCheatingMode = ItemCheatingMode.REI_LIKE;
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 bbca45b9c..513c5bffe 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java
@@ -8,6 +8,7 @@ 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;
@@ -150,13 +151,15 @@ public class SlotWidget extends HighlightableWidget {
}
protected List<String> getTooltip(ItemStack itemStack) {
- final String modString = ClientHelper.getInstance().getFormattedModFromItem(itemStack.getItem());
List<String> toolTip = Lists.newArrayList(ItemListOverlay.tryGetItemStackToolTip(itemStack, true));
- String s1 = ClientHelper.getInstance().getModFromItem(itemStack.getItem()).toLowerCase(Locale.ROOT);
toolTip.addAll(getExtraToolTips(itemStack));
- if (!modString.isEmpty()) {
- toolTip.removeIf(s -> s.toLowerCase(Locale.ROOT).contains(s1));
- toolTip.add(modString);
+ if (RoughlyEnoughItemsCore.getConfigManager().getConfig().appendModNames) {
+ final String modString = ClientHelper.getInstance().getFormattedModFromItem(itemStack.getItem());
+ String s1 = ClientHelper.getInstance().getModFromItem(itemStack.getItem()).toLowerCase(Locale.ROOT);
+ if (!modString.isEmpty()) {
+ toolTip.removeIf(s -> s.toLowerCase(Locale.ROOT).contains(s1));
+ toolTip.add(modString);
+ }
}
return toolTip;
}
diff --git a/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java b/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java
index c72916a5c..2dfa1d4e7 100644
--- a/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java
+++ b/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java
@@ -60,6 +60,11 @@ public class ClothScreenRegistry {
});
ConfigCategory appearance = builder.getOrCreateCategory("text.rei.config.appearance");
appearance.addEntry(entryBuilder.startBooleanToggle("text.rei.config.dark_theme", ScreenHelper.isDarkModeEnabled()).setDefaultValue(() -> false).setSaveConsumer(bool -> configManager.getConfig().darkTheme = bool).setTooltipSupplier(() -> getConfigTooltip("dark_theme")).buildEntry());
+ appearance.addEntry(entryBuilder.startBooleanToggle("text.rei.config.appendModNames", configManager.getConfig().appendModNames)
+ .setDefaultValue(true)
+ .setSaveConsumer(bool -> configManager.getConfig().appendModNames = bool)
+ .setTooltip(getConfigTooltip("appendModNames"))
+ .build());
appearance.addEntry(new EnumListEntry<>("text.rei.config.recipe_screen_type", RecipeScreenType.class, configManager.getConfig().screenType, RESET, () -> RecipeScreenType.UNSET, bool -> configManager.getConfig().screenType = bool, EnumListEntry.DEFAULT_NAME_PROVIDER, () -> getConfigTooltip("recipe_screen_type")));
appearance.addEntry(entryBuilder.startBooleanToggle("text.rei.config.side_search_box", configManager.getConfig().sideSearchField).setDefaultValue(() -> false).setSaveConsumer(bool -> configManager.getConfig().sideSearchField = bool).setTooltipSupplier(() -> getConfigTooltip("side_search_box")).buildEntry());
appearance.addEntry(new EnumListEntry<>("text.rei.config.list_ordering", ItemListOrderingConfig.class, ItemListOrderingConfig.from(configManager.getConfig().itemListOrdering, configManager.getConfig().isAscending), RESET, () -> ItemListOrderingConfig.REGISTRY_ASCENDING, config -> {
diff --git a/src/main/resources/assets/roughlyenoughitems/lang/en_us.json b/src/main/resources/assets/roughlyenoughitems/lang/en_us.json
index 91649687e..5c07e34d3 100755
--- a/src/main/resources/assets/roughlyenoughitems/lang/en_us.json
+++ b/src/main/resources/assets/roughlyenoughitems/lang/en_us.json
@@ -98,6 +98,7 @@
"text.rei.config.light_gray_recipe_border": "Light Gray Recipe Border: ",
"text.rei.config_api_failed": "You arrived here either if Cloth Config v2 API failed or you don't have it installed!\nUpdate / Install the API and report to the bug tracker.",
"text.rei.back": "Back",
+ "text.rei.config.appendModNames": "Append Mod Names: ",
"text.rei.config.recipe_screen_type": "Screen Type: ",
"text.rei.config.recipe_screen_type.unset": "Not Set",
"text.rei.config.recipe_screen_type.original": "Original",