Skip to content

Commit

Permalink
wasNotNull boolean deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
Innokenty committed Aug 17, 2023
1 parent 58f1d63 commit bbea9b6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/main/java/io/singularitynet/Client/VereyaModClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit bbea9b6

Please sign in to comment.