Unknown 6 lat temu
rodzic
commit
fded22a553

+ 3 - 0
CHANGELOG.md

@@ -1,4 +1,7 @@
 View full changelog [here](https://github.com/shedaniel/RoughlyEnoughItems/blob/1.14/CHANGELOG.md).
+## v2.7.6.90
+- Fixed [#63](https://github.com/shedaniel/RoughlyEnoughItems/issues/63): Pressing Space in the search bar opens the Config GUI
+- Added [#64](https://github.com/shedaniel/RoughlyEnoughItems/issues/64): Option to flip give amount
 ## v2.7.5.89
 - Fixed: Keybinds (e.g. O, R, U) working even if recipe book search field is focused
 ## v2.7.4.88

+ 1 - 1
build.gradle

@@ -11,7 +11,7 @@ targetCompatibility = 1.8
 archivesBaseName = "RoughlyEnoughItems"
 version = project.mod_version
 
-def includeDep = false
+def includeDep = true
 
 minecraft {
 }

+ 1 - 1
gradle.properties

@@ -1,4 +1,4 @@
-mod_version=2.7.5+build.89
+mod_version=2.7.6+build.90
 minecraft_version=1.14 Pre-Release 2
 yarn_version=1.14 Pre-Release 2+build.1
 fabric_version=0.2.7+build.122

+ 5 - 0
src/main/java/me/shedaniel/rei/api/ItemCheatingMode.java

@@ -0,0 +1,5 @@
+package me.shedaniel.rei.api;
+
+public enum ItemCheatingMode {
+    REI_LIKE, JEI_LIKE;
+}

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

@@ -1,6 +1,7 @@
 package me.shedaniel.rei.client;
 
 import blue.endless.jankson.Comment;
+import me.shedaniel.rei.api.ItemCheatingMode;
 import me.shedaniel.rei.api.RelativePoint;
 
 public class ConfigObject {
@@ -51,6 +52,8 @@ public class ConfigObject {
     @Comment("Force enable 2019 REI April Fools' joke")
     public boolean aprilFoolsFish2019 = false;
     
+    public ItemCheatingMode itemCheatingMode = ItemCheatingMode.REI_LIKE;
+    
     @Comment("The location of choose page dialog")
     public RelativePoint choosePageDialogPoint = new RelativePoint(.5, .5);
     

+ 1 - 1
src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java

@@ -123,7 +123,7 @@ public abstract class ButtonWidget extends HighlightableWidget {
     
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
-        if (this.enabled) {
+        if (this.enabled && focused) {
             if (int_1 != 257 && int_1 != 32 && int_1 != 335) {
                 return false;
             } else {

+ 1 - 1
src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java

@@ -48,7 +48,7 @@ public abstract class ClickableLabelWidget extends LabelWidget {
     
     @Override
     public boolean keyPressed(int int_1, int int_2, int int_3) {
-        if (!clickable)
+        if (!clickable || !focused)
             return false;
         if (int_1 != 257 && int_1 != 32 && int_1 != 335)
             return false;

+ 7 - 1
src/main/java/me/shedaniel/rei/gui/widget/ItemListOverlay.java

@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
 import me.shedaniel.cloth.api.ClientUtils;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.DisplayHelper;
+import me.shedaniel.rei.api.ItemCheatingMode;
 import me.shedaniel.rei.api.RecipeHelper;
 import me.shedaniel.rei.client.ClientHelper;
 import me.shedaniel.rei.client.ItemListOrdering;
@@ -106,7 +107,12 @@ public class ItemListOverlay extends Widget {
                         if (ClientHelper.isCheating()) {
                             if (getCurrentStack() != null && !getCurrentStack().isEmpty()) {
                                 ItemStack cheatedStack = getCurrentStack().copy();
-                                cheatedStack.setAmount(button == 0 ? 1 : button == 1 ? cheatedStack.getMaxAmount() : cheatedStack.getAmount());
+                                if (RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode == ItemCheatingMode.REI_LIKE)
+                                    cheatedStack.setAmount(button != 1 ? 1 : cheatedStack.getMaxAmount());
+                                else if (RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode == ItemCheatingMode.JEI_LIKE)
+                                    cheatedStack.setAmount(button != 0 ? 1 : cheatedStack.getMaxAmount());
+                                else
+                                    cheatedStack.setAmount(1);
                                 return ClientHelper.tryCheatingStack(cheatedStack);
                             }
                         } else if (button == 0)

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

@@ -7,6 +7,7 @@ import me.shedaniel.cloth.gui.entries.EnumListEntry;
 import me.shedaniel.cloth.gui.entries.IntegerSliderEntry;
 import me.shedaniel.cloth.gui.entries.StringListEntry;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
+import me.shedaniel.rei.api.ItemCheatingMode;
 import me.shedaniel.rei.gui.config.ItemListOrderingConfig;
 import me.shedaniel.rei.gui.credits.CreditsScreen;
 import net.minecraft.client.MinecraftClient;
@@ -62,6 +63,9 @@ public class ClothScreenRegistry {
             }
         });
         appearance.addOption(new IntegerSliderEntry("text.rei.config.max_recipes_per_page", 2, 99, RoughlyEnoughItemsCore.getConfigManager().getConfig().maxRecipePerPage, "text.cloth-config.reset_value", () -> 3, i -> RoughlyEnoughItemsCore.getConfigManager().getConfig().maxRecipePerPage = i));
+        appearance.addOption(new EnumListEntry<>("text.rei.config.item_cheating_mode", ItemCheatingMode.class, RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode, "text.cloth-config.reset_value", () -> ItemCheatingMode.REI_LIKE, i -> RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode = i, anEnum -> {
+            return I18n.translate("text.rei.config.item_cheating_mode." + anEnum.name().toLowerCase());
+        }));
         ConfigScreenBuilder.CategoryBuilder modules = builder.addCategory("text.rei.config.modules");
         modules.addOption(new BooleanListEntry("text.rei.config.enable_craftable_only", RoughlyEnoughItemsCore.getConfigManager().getConfig().enableCraftableOnlyButton, "text.cloth-config.reset_value", () -> true, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().enableCraftableOnlyButton = bool));
         modules.addOption(new BooleanListEntry("text.rei.config.enable_util_buttons", RoughlyEnoughItemsCore.getConfigManager().getConfig().showUtilsButtons, "text.cloth-config.reset_value", () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().showUtilsButtons = bool));

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

@@ -79,6 +79,9 @@
   "text.rei.config.enable_legacy_speedcraft_support": "Enable Legacy Plugin Support: ",
   "text.rei.config.april_fools": "April Fools",
   "text.rei.config.april_fools.2019": "Force 2019 REI April Fools' joke: ",
+  "text.rei.config.item_cheating_mode": "Item Cheating Amount:",
+  "text.rei.config.item_cheating_mode.rei_like": "Normal",
+  "text.rei.config.item_cheating_mode.jei_like": "Reversed",
   "text.rei.no_config_api": "Cloth Config API does not exist!\nPlease install it in order to show an in-game config screen!",
   "_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 - Danielshe\n  Traditional Chinese - hugoalh & Danielshe\n  French - Yanis48\n  German - MelanX\n  Estonian - Madis0\n  Portuguese - thiagokenis\n  LOLCAT - Danielshe\n  Upside Down - Danielshe\n  Brazilian Portuguese\n  Bulgarian - geniiii\n\n§lLicense\n§7Roughly Enough Items is using MIT."