Skip to content

Commit

Permalink
Remove "if zero" in moveX and moveY
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCheung0422 committed Oct 14, 2024
1 parent d5ccab5 commit e9f7998
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/client/java/minicraft/entity/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br>
* 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.
Expand Down Expand Up @@ -210,12 +208,10 @@ protected boolean moveX(int d) {
* Moves the entity a long only on X axis without "teleporting".
* Will throw exception otherwise.<br>
* 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.
Expand Down

0 comments on commit e9f7998

Please sign in to comment.