From bbea9b67ab129acbc2f6b03b42393d66b36b8982 Mon Sep 17 00:00:00 2001 From: Innokenty Date: Thu, 17 Aug 2023 17:35:28 +0300 Subject: [PATCH] wasNotNull boolean deleted --- .../io/singularitynet/Client/VereyaModClient.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/singularitynet/Client/VereyaModClient.java b/src/main/java/io/singularitynet/Client/VereyaModClient.java index da189f1..a391a21 100644 --- a/src/main/java/io/singularitynet/Client/VereyaModClient.java +++ b/src/main/java/io/singularitynet/Client/VereyaModClient.java @@ -33,9 +33,7 @@ public class VereyaModClient implements ClientModInitializer, IMalmoModClient, S public static final String AGENT_UNRESPONSIVE_CODE = "MALMO_AGENT_NOT_RESPONDING"; public static final String VIDEO_UNRESPONSIVE_CODE = "MALMO_VIDEO_NOT_RESPONDING"; private static final Logger LOGGER = LogManager.getLogger(VereyaModClient.class.getName()); - - private boolean wasNotNull = false; - + public interface MouseEventListener { public void onXYChange(double deltaX, double deltaY); @@ -83,12 +81,10 @@ public MyMouse(MinecraftClient client) { @Override public void lockCursor(){ - if (wasNotNull) - { + if (MinecraftClient.getInstance().attackCooldown > 1000){ //since our agent can spam attack and therefore after opening inventory or chat or advancements attack // won't work we need to manually set attackCooldown to 0. - MinecraftClient.getInstance().attackCooldown=0; - wasNotNull = false; + MinecraftClient.getInstance().attackCooldown = 0; } if(VereyaModClient.this.inputType == InputType.AI) { return; @@ -253,7 +249,6 @@ private void onKey(long window, int key, int scancode, int action, int modifiers // do default thing if any screen is open Screen screen = MinecraftClient.getInstance().currentScreen; if (screen != null) { - wasNotNull = true; return; }