diff options
| author | Danielshe <shekwancheung0528@gmail.com> | 2019-09-22 23:46:02 +0800 |
|---|---|---|
| committer | Danielshe <shekwancheung0528@gmail.com> | 2019-09-22 23:46:02 +0800 |
| commit | 5b6382e4eaca5febe91acaf510199f0d9ac94818 (patch) | |
| tree | 6a82026096b2f574f0392284bd006679c05de020 /src | |
| parent | 3a4d8d3ecc501b4e9e3d8dae4e352aa875533d65 (diff) | |
| download | RoughlyEnoughItems-5b6382e4eaca5febe91acaf510199f0d9ac94818.tar.gz RoughlyEnoughItems-5b6382e4eaca5febe91acaf510199f0d9ac94818.tar.bz2 RoughlyEnoughItems-5b6382e4eaca5febe91acaf510199f0d9ac94818.zip | |
Fix Vanilla Tab Container
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", |
