diff options
author | Noah van der Aa <[email protected]> | 2024-04-07 01:36:59 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-04-06 19:36:59 -0400 |
commit | 8e75001cb8ffd0dc6abb12ee8a35164b8349d6aa (patch) | |
tree | 029d7a95892c9ed2013368a42c2ce0747e598f09 | |
parent | 3d31e45e7eb3c528e9309f6e600f67b21dd3c297 (diff) | |
download | Paper-8e75001cb8ffd0dc6abb12ee8a35164b8349d6aa.tar.gz Paper-8e75001cb8ffd0dc6abb12ee8a35164b8349d6aa.zip |
Disable vertical air friction when item entities have friction disabled (#10369)
-rw-r--r-- | patches/server/0816-Friction-API.patch | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/patches/server/0816-Friction-API.patch b/patches/server/0816-Friction-API.patch index 2b74be2e4e..7da72213c7 100644 --- a/patches/server/0816-Friction-API.patch +++ b/patches/server/0816-Friction-API.patch @@ -55,7 +55,7 @@ index 0708502b46ec55d533c7d890b892a57779678854..834607dde3841105b3524b43f5938029 this.getAttributes().load(nbt.getList("Attributes", 10)); } diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index d0dac3dc89b9bb645a1d8498802fb8c6bff6a78e..c7f06c3cfb737bd17a706798bf9cf0e1af5f0cc0 100644 +index d0dac3dc89b9bb645a1d8498802fb8c6bff6a78e..29ce703a79f7893ac990ad80e0f1c1cf63546e6c 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java @@ -58,6 +58,7 @@ public class ItemEntity extends Entity implements TraceableEntity { @@ -66,7 +66,7 @@ index d0dac3dc89b9bb645a1d8498802fb8c6bff6a78e..c7f06c3cfb737bd17a706798bf9cf0e1 public ItemEntity(EntityType<? extends ItemEntity> type, Level world) { super(type, world); -@@ -179,7 +180,11 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -179,11 +180,15 @@ public class ItemEntity extends Entity implements TraceableEntity { this.move(MoverType.SELF, this.getDeltaMovement()); float f1 = 0.98F; @@ -79,6 +79,11 @@ index d0dac3dc89b9bb645a1d8498802fb8c6bff6a78e..c7f06c3cfb737bd17a706798bf9cf0e1 f1 = this.level().getBlockState(this.getBlockPosBelowThatAffectsMyMovement()).getBlock().getFriction() * 0.98F; } +- this.setDeltaMovement(this.getDeltaMovement().multiply((double) f1, 0.98D, (double) f1)); ++ this.setDeltaMovement(this.getDeltaMovement().multiply((double) f1, frictionState == net.kyori.adventure.util.TriState.FALSE ? 1D : 0.98D, (double) f1)); // Paper - Friction API + if (this.onGround()) { + Vec3 vec3d1 = this.getDeltaMovement(); + @@ -388,6 +393,11 @@ public class ItemEntity extends Entity implements TraceableEntity { @Override |