Skip to content

Commit 9bfbb56

Browse files
author
Circulate233
committed
fix #37
1 parent 26a7282 commit 9bfbb56

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ show_testing_output = false
1616

1717
# Mod Information
1818
# HIGHLY RECOMMEND complying with SemVer for mod_version: https://semver.org/
19-
mod_version = 1.9.0
19+
mod_version = 1.9.1
2020
root_package = com.circulation
2121
mod_id = random_complement
2222
mod_name = RandomComplement

src/main/java/com/circulation/random_complement/client/handler/RCInputHandler.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void onClientTick(TickEvent.ClientTickEvent event) {
6363
public static boolean work(boolean isMouse) {
6464
if (mc.player == null) return false;
6565
int eventKey;
66-
int m = 0;
66+
int m;
6767
if (isMouse) {
6868
m = Mouse.getEventButton();
6969
eventKey = m - 100;
@@ -92,16 +92,14 @@ public static boolean work(boolean isMouse) {
9292

9393
int idx = gui.getTooltip() + viewStart;
9494
if (idx < Math.min(viewEnd, gui.getVisual().size())) {
95-
Minecraft.getMinecraft().addScheduledTask(() -> {
96-
int idx2 = gui.getTooltip() + gui.invokerGetScrollBar().getCurrentScroll() * 3;
97-
if (idx2 < gui.getVisual().size()) {
98-
val item = gui.getVisual().get(idx2);
99-
if (item != null) {
100-
RandomComplement.NET_CHANNEL.sendToServer(new InterfaceTracing(item));
101-
}
95+
int idx2 = gui.getTooltip() + gui.invokerGetScrollBar().getCurrentScroll() * 3;
96+
if (idx2 >= 0 && idx2 < gui.getVisual().size()) {
97+
val item = gui.getVisual().get(idx2);
98+
if (item != null) {
99+
RandomComplement.NET_CHANNEL.sendToServer(new InterfaceTracing(item));
100+
return true;
102101
}
103-
});
104-
return true;
102+
}
105103
}
106104

107105
return false;

0 commit comments

Comments
 (0)