diff options
Diffstat (limited to 'src')
4 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java index 768c97dbd..40b56a5b8 100644 --- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java +++ b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java @@ -282,6 +282,11 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer { if (screen instanceof AbstractContainerScreen) if (ScreenHelper.getLastOverlay().keyPressed(i, i1, i2)) return ActionResult.SUCCESS; + if (screen instanceof AbstractContainerScreen && configManager.getConfig().doesDisableRecipeBook() && configManager.getConfig().doesFixTabCloseContainer()) + if (i == 258 && minecraftClient.options.keyInventory.matchesKey(i, i1)) { + minecraftClient.player.closeContainer(); + return ActionResult.SUCCESS; + } return ActionResult.PASS; }); } diff --git a/src/main/java/me/shedaniel/rei/api/ConfigObject.java b/src/main/java/me/shedaniel/rei/api/ConfigObject.java index f529d4581..c037b612c 100644 --- a/src/main/java/me/shedaniel/rei/api/ConfigObject.java +++ b/src/main/java/me/shedaniel/rei/api/ConfigObject.java @@ -58,6 +58,8 @@ public interface ConfigObject { boolean doesDisableRecipeBook(); + boolean doesFixTabCloseContainer(); + boolean areClickableRecipeArrowsEnabled(); ItemCheatingMode getItemCheatingMode(); diff --git a/src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java b/src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java index 910d1aeb5..12521e09e 100644 --- a/src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java +++ b/src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java @@ -130,6 +130,13 @@ public class ConfigObjectImpl implements ConfigObject { .withName("disableRecipeBook") .build(); + private ConfigValue<Boolean> fixTabCloseContainer = ConfigValue.builder(Boolean.class) + .withParent(modules) + .withDefaultValue(false) + .withComment("Declares whether REI should fix closing container with tab.") + .withName("fixTabCloseContainer") + .build(); + private ConfigValue<Boolean> clickableRecipeArrows = ConfigValue.builder(Boolean.class) .withParent(appearance) .withDefaultValue(true) @@ -297,6 +304,11 @@ public class ConfigObjectImpl implements ConfigObject { } @Override + public boolean doesFixTabCloseContainer() { + return fixTabCloseContainer.getValue().booleanValue(); + } + + @Override public boolean areClickableRecipeArrowsEnabled() { return clickableRecipeArrows.getValue().booleanValue(); } diff --git a/src/main/resources/assets/roughlyenoughitems/lang/en_us.json b/src/main/resources/assets/roughlyenoughitems/lang/en_us.json index 1a2da4c9e..8a11a3565 100755 --- a/src/main/resources/assets/roughlyenoughitems/lang/en_us.json +++ b/src/main/resources/assets/roughlyenoughitems/lang/en_us.json @@ -109,6 +109,7 @@ "config.roughlyenoughitems.disableRecipeBook": "Vanilla Recipe Book:", "config.roughlyenoughitems.disableRecipeBook.boolean.true": "Disabled", "config.roughlyenoughitems.disableRecipeBook.boolean.false": "Enabled", + "config.roughlyenoughitems.fixTabCloseContainer": "Fix Vanilla Tab Container (When Recipe Book Disabled):", "config.roughlyenoughitems.enableCraftableOnlyButton": "Craftable Filter:", "config.roughlyenoughitems.enableCraftableOnlyButton.boolean.true": "Enabled", "config.roughlyenoughitems.enableCraftableOnlyButton.boolean.false": "Disabled", |
