aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-05-23 23:53:08 +0800
committershedaniel <daniel@shedaniel.me>2022-05-23 23:53:08 +0800
commit68b4c256d113b49a0857515f6edf41496e4920e1 (patch)
treec4aeaf1a65358209ea2e7e42512a2715cd990df7
parentfc513305d045356b2d484bb6300e3bad9de8e2bf (diff)
parentf3bbb3beb0faa4b2abf4d6946129e520a75ec86d (diff)
downloadRoughlyEnoughItems-68b4c256d113b49a0857515f6edf41496e4920e1.tar.gz
RoughlyEnoughItems-68b4c256d113b49a0857515f6edf41496e4920e1.tar.bz2
RoughlyEnoughItems-68b4c256d113b49a0857515f6edf41496e4920e1.zip
Merge remote-tracking branch 'origin/8.x-1.18.2' into 9.x-1.19
-rw-r--r--fabric/src/main/java/me/shedaniel/rei/fabric/RoughlyEnoughItemsInitializerImpl.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/DisplayedEntryWidget.java19
2 files changed, 12 insertions, 11 deletions
diff --git a/fabric/src/main/java/me/shedaniel/rei/fabric/RoughlyEnoughItemsInitializerImpl.java b/fabric/src/main/java/me/shedaniel/rei/fabric/RoughlyEnoughItemsInitializerImpl.java
index b3bf9196b..8efe7e91f 100644
--- a/fabric/src/main/java/me/shedaniel/rei/fabric/RoughlyEnoughItemsInitializerImpl.java
+++ b/fabric/src/main/java/me/shedaniel/rei/fabric/RoughlyEnoughItemsInitializerImpl.java
@@ -59,13 +59,13 @@ public class RoughlyEnoughItemsInitializerImpl {
}
}
if (!FabricLoader.getInstance().isModLoaded("architectury")) {
- RoughlyEnoughItemsState.error("Architectury API is not installed!", "https://www.curseforge.com/minecraft/mc-mods/architectury-forge/files/all");
+ RoughlyEnoughItemsState.error("Architectury API is not installed!", "https://www.curseforge.com/minecraft/mc-mods/architectury-api/files/all");
} else {
Version version = FabricLoader.getInstance().getModContainer("architectury").get().getMetadata().getVersion();
try {
if (version instanceof SemanticVersion && SemanticVersion.parse("2.6.0").compareTo((SemanticVersion) version) > 0) {
- RoughlyEnoughItemsState.error("Architectury API is too old, please update!", "https://www.curseforge.com/minecraft/mc-mods/architectury-forge/files/all");
+ RoughlyEnoughItemsState.error("Architectury API is too old, please update!", "https://www.curseforge.com/minecraft/mc-mods/architectury-api/files/all");
}
} catch (VersionParsingException e) {
e.printStackTrace();
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);