make midclick not spam events

This commit is contained in:
Daniella / Tove 2024-05-31 20:41:34 +02:00
parent 535b3a06a4
commit 605fe8deeb
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -99,8 +99,13 @@ public class MidClick extends Feature {
doCheck();
}
boolean down = false;
private void doCheck() {
if(Mouse.isButtonDown(2)) {
if(down)
return;
down = true;
RayTraceResult hover = mc.objectMouseOver;
if(hover.entityHit != null) {
if(hover.entityHit instanceof EntityPlayer) {
@ -113,7 +118,8 @@ public class MidClick extends Feature {
}
}
blockAction.action.accept(hover.getBlockPos());
}
} else down = false;
}
@Override