From e9f799867cd912aa6036be5d5dff7c5b1df3f206 Mon Sep 17 00:00:00 2001
From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com>
Date: Mon, 14 Oct 2024 20:01:41 +0800
Subject: [PATCH] Remove "if zero" in moveX and moveY
---
src/client/java/minicraft/entity/Entity.java | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/client/java/minicraft/entity/Entity.java b/src/client/java/minicraft/entity/Entity.java
index 5105bb58f..f8c3b5d93 100644
--- a/src/client/java/minicraft/entity/Entity.java
+++ b/src/client/java/minicraft/entity/Entity.java
@@ -176,12 +176,10 @@ public boolean move(int xd, int yd) {
* Moves the entity a long only on X axis without "teleporting".
* Will throw exception otherwise.
* Note that this should only be invoked by {@link #move(int, int)}.
- * @param d Displacement relative to the axis.
+ * @param d Displacement relative to the axis; should be non-zero
* @return true if the move was successful, false if not.
*/
protected boolean moveX(int d) {
- if (d == 0) return true; // Was not stopped
-
//boolean interact = true;//!Game.isValidClient() || this instanceof ClientTickable;
// Taking the axis of movement (towards) as the front axis, and the horizontal axis with another axis.
@@ -210,12 +208,10 @@ protected boolean moveX(int d) {
* Moves the entity a long only on X axis without "teleporting".
* Will throw exception otherwise.
* Note that this should only be invoked by {@link #move(int, int)}.
- * @param d Displacement relative to the axis.
- * @return true if the move was successful, false if not.
+ * @param d Displacement relative to the axis; should be non-zero
+ * @return true if there is movement, false if not.
*/
protected boolean moveY(int d) {
- if (d == 0) return true; // Was not stopped
-
//boolean interact = true;//!Game.isValidClient() || this instanceof ClientTickable;
// Taking the axis of movement (towards) as the front axis, and the horizontal axis with another axis.