Skip to content

Commit

Permalink
the last commit i did at night and i wasn't thinking right i basicall…
Browse files Browse the repository at this point in the history
…y thought that i had to use the method in order to change gravity and i didnt have the speed one so i made the method set the speed so i could use the method again with the speed and i completely forgot that i could just set the gravity 😭
  • Loading branch information
xNasuni committed Jul 12, 2023
1 parent 2ed8f58 commit 693aa62
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class ProjectileEntitySimulator {
private final Vector3d velocity = new Vector3d();

private double gravity;
private double airDrag, waterDrag, speed;
private double airDrag, waterDrag;

public boolean set(Entity user, ItemStack itemStack, double simulated, boolean accurate, double tickDelta) {
Item item = itemStack.getItem();
Expand Down Expand Up @@ -134,7 +134,7 @@ public boolean set(Entity entity, boolean accurate, double tickDelta) {
}

if (entity.hasNoGravity()) {
set(entity, speed, 0, waterDrag, accurate, tickDelta);
this.gravity = 0;
}

return true;
Expand All @@ -150,7 +150,6 @@ public void set(Entity entity, double speed, double gravity, double waterDrag, b
velocity.add(vel.x, entity.isOnGround() ? 0.0D : vel.y, vel.z);
}

this.speed = speed; // so it is known in line 160
this.gravity = gravity;
this.airDrag = 0.99;
this.waterDrag = waterDrag;
Expand Down

0 comments on commit 693aa62

Please sign in to comment.