diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-05-23 23:52:39 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2023-05-29 20:31:15 +0800 |
| commit | a041dda6e64571412b0875800e8beddea70702d0 (patch) | |
| tree | e68c17a1485db15da77b67944f82692a08afd9a0 /runtime/src | |
| parent | dddf57781454c5031cd84a43c05b757a4216ac80 (diff) | |
| download | RoughlyEnoughItems-a041dda6e64571412b0875800e8beddea70702d0.tar.gz RoughlyEnoughItems-a041dda6e64571412b0875800e8beddea70702d0.tar.bz2 RoughlyEnoughItems-a041dda6e64571412b0875800e8beddea70702d0.zip | |
Fix #861
Diffstat (limited to 'runtime/src')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/DisplayedEntryWidget.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/DisplayedEntryWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/DisplayedEntryWidget.java index 1680750d8..f94cc433c 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/DisplayedEntryWidget.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/DisplayedEntryWidget.java @@ -61,16 +61,17 @@ public abstract class DisplayedEntryWidget extends EntryWidget { @Override protected boolean doAction(double mouseX, double mouseY, int button) { - if (!(ClientHelper.getInstance().isCheating() && !(Minecraft.getInstance().screen instanceof DisplayScreen))) return false; - EntryStack<?> entry = getCurrentEntry().copy(); - if (!entry.isEmpty()) { - if (entry.getType() != VanillaEntryTypes.ITEM) { - EntryStack<ItemStack> cheatsAs = entry.cheatsAs(); - entry = cheatsAs.isEmpty() ? entry : cheatsAs; + if (ClientHelper.getInstance().isCheating() && !(Minecraft.getInstance().screen instanceof DisplayScreen)) { + EntryStack<?> entry = getCurrentEntry().copy(); + if (!entry.isEmpty()) { + if (entry.getType() != VanillaEntryTypes.ITEM) { + EntryStack<ItemStack> cheatsAs = entry.cheatsAs(); + entry = cheatsAs.isEmpty() ? entry : cheatsAs; + } + if (entry.getValueType() == ItemStack.class) + entry.<ItemStack>castValue().setCount(button != 1 && !Screen.hasShiftDown() == (ConfigObject.getInstance().getItemCheatingMode() == ItemCheatingMode.REI_LIKE) ? 1 : entry.<ItemStack>castValue().getMaxStackSize()); + return ClientHelper.getInstance().tryCheatingEntry(entry); } - if (entry.getValueType() == ItemStack.class) - entry.<ItemStack>castValue().setCount(button != 1 && !Screen.hasShiftDown() == (ConfigObject.getInstance().getItemCheatingMode() == ItemCheatingMode.REI_LIKE) ? 1 : entry.<ItemStack>castValue().getMaxStackSize()); - return ClientHelper.getInstance().tryCheatingEntry(entry); } return super.doAction(mouseX, mouseY, button); |
