mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-19 15:09:27 +00:00
Not all patches are migrated yet, I'm commiting right now to avoid losing my progress This time I've moved the patches to file patches instead of feature patches, this DOES NOT include the parallel world ticking patch yet
19 lines
1.0 KiB
Diff
19 lines
1.0 KiB
Diff
--- a/net/minecraft/server/level/ServerEntity.java
|
|
+++ b/net/minecraft/server/level/ServerEntity.java
|
|
@@ -205,6 +_,7 @@
|
|
|
|
if (this.entity.hasImpulse || this.trackDelta || this.entity instanceof LivingEntity && ((LivingEntity)this.entity).isFallFlying()) {
|
|
Vec3 deltaMovement = this.entity.getDeltaMovement();
|
|
+ if (deltaMovement != this.lastSentMovement) { // SparklyPaper start - skip distanceToSqr call in ServerEntity#sendChanges if the delta movement hasn't changed
|
|
double d = deltaMovement.distanceToSqr(this.lastSentMovement);
|
|
if (d > 1.0E-7 || d > 0.0 && deltaMovement.lengthSqr() == 0.0) {
|
|
this.lastSentMovement = deltaMovement;
|
|
@@ -222,6 +_,7 @@
|
|
this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
|
|
}
|
|
}
|
|
+ } // SparklyPaper end
|
|
}
|
|
|
|
if (packet != null) {
|