Disable vertical air friction when item entities have friction disabled (#10369)

This commit is contained in:
Noah van der Aa 2024-04-07 01:36:59 +02:00 committed by GitHub
parent 3d31e45e7e
commit 8e75001cb8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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