Skip to content

Commit

Permalink
Infinity Armor upwards and downward speed update
Browse files Browse the repository at this point in the history
  • Loading branch information
mak8427 committed Jan 21, 2025
1 parent 37ea9bf commit fcb3cef
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 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,16 @@ 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 *= 1.5;
} else if (player.motionY < 0) {
player.motionY *= 1.5;
}
}
}
} else {
playersWithFoot.remove(key);
Expand Down

0 comments on commit fcb3cef

Please sign in to comment.