diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-05-23 23:52:39 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-05-23 23:52:39 +0800 |
| commit | 0b96ddb449b0c5382553c843b4df89f4beff1af1 (patch) | |
| tree | d5b31430458c7b0c960778f4eadf521cdb4e6a65 | |
| parent | 8589dfa9b7e382c2eff22bb1c5bea5d7759007d5 (diff) | |
| download | RoughlyEnoughItems-0b96ddb449b0c5382553c843b4df89f4beff1af1.tar.gz RoughlyEnoughItems-0b96ddb449b0c5382553c843b4df89f4beff1af1.tar.bz2 RoughlyEnoughItems-0b96ddb449b0c5382553c843b4df89f4beff1af1.zip | |
Fix #861
| -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 867e3002f..d0643c592 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); |
