Skip to content

Commit

Permalink
Infinity Armor upwards and downward speed update (#48)
Browse files Browse the repository at this point in the history
Co-authored-by: Maya <[email protected]>
  • Loading branch information
mak8427 and serenibyss authored Feb 3, 2025
1 parent 37ea9bf commit 8644f7b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main/java/fox/spiteful/avaritia/items/ItemArmorInfinity.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,7 @@ public void updatePlayerAbilityStatus(LivingUpdateEvent event) {
boolean sneaking = player.isSneaking();
player.stepHeight = sneaking ? 0.5f : 1.0f;

float speed = 0.15f * (flying ? 1.1f : 1.0f)
// * (swimming ? 1.2f : 1.0f)
* (sneaking ? 0.1f : 1.0f);
float speed = 0.15f * (flying ? 1.1f : 1.0f) * (sneaking ? 0.1f : 1.0f);

if (player.moveForward > 0f) {
player.moveFlying(0f, 1f, speed);
Expand All @@ -333,6 +331,15 @@ public void updatePlayerAbilityStatus(LivingUpdateEvent event) {
if (player.moveStrafing != 0f) {
player.moveFlying(1f, 0f, speed * 0.5f * Math.signum(player.moveStrafing));
}

// +50% speed up and down when flying
if (flying) {
if (player.motionY > 0 && player.motionY < 2) {
player.motionY *= 1.5f;
} else if (player.motionY < 0 && player.motionY > -2) {
player.motionY *= 1.5f;
}
}
}
} else {
playersWithFoot.remove(key);
Expand Down

0 comments on commit 8644f7b

Please sign in to comment.