mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 12:39:05 +00:00
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:
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) {
|
||||
|
||||
Reference in new issue
Block a user