Enhance ability input handling: block movement during ability locks, ensure proper input suppression, and cancel abilities on logout, dimension change, death, and respawn

This commit is contained in:
Kam committed 2026-02-15 23:15:50 -05:00
1 parent 121563ba24
commit 1ed012331b
5 files changed
+116 -7

No files matched your search

@@ -84,9 +84,20 @@ public class ClientEventHandler {
@SubscribeEvent
public void onMouse(MouseEvent event) {
if (Minecraft.getMinecraft().currentScreen != null)
Minecraft mc = Minecraft.getMinecraft();
if (mc.currentScreen != null)
return;
// Block mouse movement during ability rotation lock.
// Allow clicks (button >= 0) and scroll (dwheel != 0) to pass through.
if (mc.theWorld != null && mc.thePlayer != null
&& ClientAbilityState.shouldLockRotation()
&& (event.dx != 0 || event.dy != 0)
&& event.button == -1 && event.dwheel == 0) {
event.setCanceled(true);
return;
}
ArrayList<Integer> removeList = new ArrayList<>();
for (Map.Entry<Integer, Long> entry : disabledButtonTimes.entrySet()) {
if (entry.getValue() > 0) {