From 7ec71bdcc97ed5c61ab9adc934bdf946032d62a9 Mon Sep 17 00:00:00 2001 From: Meegoo Date: Sun, 20 Oct 2024 14:41:35 +0500 Subject: [PATCH] Reset fall damage when holding shift or space with wings (#85) Co-authored-by: Martin Robertz --- .../item/armor/chestplate/ItemInfusedQuantumChestplate.java | 4 +--- src/main/java/emt/item/armor/wings/ItemFeatherWing.java | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/emt/item/armor/chestplate/ItemInfusedQuantumChestplate.java b/src/main/java/emt/item/armor/chestplate/ItemInfusedQuantumChestplate.java index 065ce29..88df371 100644 --- a/src/main/java/emt/item/armor/chestplate/ItemInfusedQuantumChestplate.java +++ b/src/main/java/emt/item/armor/chestplate/ItemInfusedQuantumChestplate.java @@ -534,6 +534,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I if (isJumping && !player.onGround && player.motionY < 0) { player.motionY *= f1; + player.fallDistance = 0; } if (player.isInWater() && !player.capabilities.isCreativeMode) { @@ -555,9 +556,6 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I if (player.isSneaking() && !player.onGround && player.motionY < 0) { player.motionY *= 0.6; - } - - if (player.fallDistance > 0.0F) { player.fallDistance = 0; } } diff --git a/src/main/java/emt/item/armor/wings/ItemFeatherWing.java b/src/main/java/emt/item/armor/wings/ItemFeatherWing.java index 2ab99d9..072228b 100644 --- a/src/main/java/emt/item/armor/wings/ItemFeatherWing.java +++ b/src/main/java/emt/item/armor/wings/ItemFeatherWing.java @@ -107,6 +107,7 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor { if (isJumping && !player.onGround && player.motionY < 0) { player.motionY *= f1; + player.fallDistance = 0; } if (player.isInWater() && !player.capabilities.isCreativeMode) { @@ -124,6 +125,7 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor { if (player.isSneaking() && !player.onGround && player.motionY < 0) { player.motionY *= 0.6; + player.fallDistance = 0; } }