Paper/patches/server/0941-Flying-Fall-Damage.patch
Jake Potrebic ea0b63992c
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9228)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
4727d326 Don't let Sign extend SignSide, mark API as experimental
9b29bdcc PR-845: Add preliminary support for multi sided signs

CraftBukkit Changes:
b346a5f6d PR-1170: Add preliminary support for multi sided signs
86c816189 Update SQLite version
d9324b4bc Fix addition of custom smithing trim / transform recipes

Spigot Changes:
7d7b241e Rebuild patches
2023-05-31 16:36:57 -07:00

52 lines
2.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: TreyRuffy <TreyRuffy@users.noreply.github.com>
Date: Fri, 27 May 2022 02:26:08 -0600
Subject: [PATCH] Flying Fall Damage
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 5b772b3caeafe98aa45a01bffe215a5dd33323b6..0629c471d38a77c44fc1c86ccdfcb0690f61ca17 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -184,6 +184,7 @@ public abstract class Player extends LivingEntity {
public float hurtDir; // Paper - protected -> public
// Paper start
public boolean affectsSpawning = true;
+ public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET;
// Paper end
// CraftBukkit start
@@ -1754,7 +1755,7 @@ public abstract class Player extends LivingEntity {
@Override
public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) {
- if (this.abilities.mayfly) {
+ if (this.abilities.mayfly && !this.flyingFallDamage.toBooleanOrElse(false)) { // Paper - flying fall damage
return false;
} else {
if (fallDistance >= 2.0F) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 53f2c187d6a16ba5566d74619bfaf058c684c0b7..e167872b279a59b348218a535555e563a9faaf3f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2330,6 +2330,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().onUpdateAbilities();
}
+ // Paper start - flying fall damage
+ @Override
+ public void setFlyingFallDamage(@NotNull net.kyori.adventure.util.TriState flyingFallDamage) {
+ getHandle().flyingFallDamage = flyingFallDamage;
+ }
+
+ @NotNull
+ @Override
+ public net.kyori.adventure.util.TriState hasFlyingFallDamage() {
+ return getHandle().flyingFallDamage;
+ }
+ // Paper end
+
@Override
public int getNoDamageTicks() {
if (this.getHandle().spawnInvulnerableTime > 0) {