From 976c329c8354ee4b918850e0f192dbbcd5570a73 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Sat, 24 Dec 2022 00:46:43 +0100 Subject: [PATCH] Send set head rotation packets only for living entities --- ...tation-packets-only-for-living-entit.patch | 41 +++++++++++++++++++ ...> 0101-Player-canSee-by-entity-UUID.patch} | 0 ...-Spread-out-sending-all-player-info.patch} | 0 ...player-list-for-sending-player-info.patch} | 0 ...dSendEvent-if-there-are-no-listener.patch} | 0 ...05-Send-multiple-keep-alive-packets.patch} | 0 ...random-strolling-into-non-ticking-c.patch} | 4 +- ...h => 0107-Specific-interval-TPS-API.patch} | 0 ....patch => 0108-5-second-TPS-average.patch} | 0 ...atch => 0109-Measure-last-tick-time.patch} | 0 ...PI.patch => 0110-Last-tick-time-API.patch} | 0 ...-Show-last-tick-time-in-tps-command.patch} | 0 ...crease-time-statistics-in-intervals.patch} | 0 ...eck-has-physics-before-same-vehicle.patch} | 0 ...ible-planar-movement-multiplication.patch} | 0 ... 0115-Reduce-RandomSource-instances.patch} | 0 ...hread-priority-environment-variable.patch} | 0 ...h => 0117-Thread-safety-annotations.patch} | 0 ....patch => 0118-CPU-cores-estimation.patch} | 0 ...utility.patch => 0119-Mutex-utility.patch} | 0 ...0-Paired-lock-and-condition-utility.patch} | 0 ... 0121-Unterminable-executor-utility.patch} | 0 ... 0122-FIFO-concurrent-queue-utility.patch} | 0 ...ols.patch => 0123-Base-thread-pools.patch} | 0 ... => 0124-Non-blocking-PooledObjects.patch} | 0 25 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 patches/server/0100-Send-set-head-rotation-packets-only-for-living-entit.patch rename patches/server/{0100-Player-canSee-by-entity-UUID.patch => 0101-Player-canSee-by-entity-UUID.patch} (100%) rename patches/server/{0101-Spread-out-sending-all-player-info.patch => 0102-Spread-out-sending-all-player-info.patch} (100%) rename patches/server/{0102-Optimize-player-list-for-sending-player-info.patch => 0103-Optimize-player-list-for-sending-player-info.patch} (100%) rename patches/server/{0103-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch => 0104-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch} (100%) rename patches/server/{0104-Send-multiple-keep-alive-packets.patch => 0105-Send-multiple-keep-alive-packets.patch} (100%) rename patches/server/{0105-Prevent-entities-random-strolling-into-non-ticking-c.patch => 0106-Prevent-entities-random-strolling-into-non-ticking-c.patch} (94%) rename patches/server/{0106-Specific-interval-TPS-API.patch => 0107-Specific-interval-TPS-API.patch} (100%) rename patches/server/{0107-5-second-TPS-average.patch => 0108-5-second-TPS-average.patch} (100%) rename patches/server/{0108-Measure-last-tick-time.patch => 0109-Measure-last-tick-time.patch} (100%) rename patches/server/{0109-Last-tick-time-API.patch => 0110-Last-tick-time-API.patch} (100%) rename patches/server/{0110-Show-last-tick-time-in-tps-command.patch => 0111-Show-last-tick-time-in-tps-command.patch} (100%) rename patches/server/{0111-Increase-time-statistics-in-intervals.patch => 0112-Increase-time-statistics-in-intervals.patch} (100%) rename patches/server/{0112-For-collision-check-has-physics-before-same-vehicle.patch => 0113-For-collision-check-has-physics-before-same-vehicle.patch} (100%) rename patches/server/{0113-Skip-negligible-planar-movement-multiplication.patch => 0114-Skip-negligible-planar-movement-multiplication.patch} (100%) rename patches/server/{0114-Reduce-RandomSource-instances.patch => 0115-Reduce-RandomSource-instances.patch} (100%) rename patches/server/{0115-Server-thread-priority-environment-variable.patch => 0116-Server-thread-priority-environment-variable.patch} (100%) rename patches/server/{0116-Thread-safety-annotations.patch => 0117-Thread-safety-annotations.patch} (100%) rename patches/server/{0117-CPU-cores-estimation.patch => 0118-CPU-cores-estimation.patch} (100%) rename patches/server/{0118-Mutex-utility.patch => 0119-Mutex-utility.patch} (100%) rename patches/server/{0119-Paired-lock-and-condition-utility.patch => 0120-Paired-lock-and-condition-utility.patch} (100%) rename patches/server/{0120-Unterminable-executor-utility.patch => 0121-Unterminable-executor-utility.patch} (100%) rename patches/server/{0121-FIFO-concurrent-queue-utility.patch => 0122-FIFO-concurrent-queue-utility.patch} (100%) rename patches/server/{0122-Base-thread-pools.patch => 0123-Base-thread-pools.patch} (100%) rename patches/server/{0123-Non-blocking-PooledObjects.patch => 0124-Non-blocking-PooledObjects.patch} (100%) diff --git a/patches/server/0100-Send-set-head-rotation-packets-only-for-living-entit.patch b/patches/server/0100-Send-set-head-rotation-packets-only-for-living-entit.patch new file mode 100644 index 0000000..9238067 --- /dev/null +++ b/patches/server/0100-Send-set-head-rotation-packets-only-for-living-entit.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martijn Muijsers +Date: Sat, 24 Dec 2022 00:33:27 +0100 +Subject: [PATCH] Send set head rotation packets only for living entities + +License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) +Gale - https://galemc.org + +This patch is based on the following patch: +"Fix head rotation packet spam" +By: cswhite2000 <18whitechristop@gmail.com> +As part of: SportPaper (https://github.com/Electroid/SportPaper) +Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) + +diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java +index ce7f36f38165a58e3fab7a98bece75df2d0ec6ed..46dc2deb8eb066e51a03a010a7bd920486914bb2 100644 +--- a/src/main/java/net/minecraft/server/level/ServerEntity.java ++++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +@@ -331,7 +331,9 @@ public class ServerEntity { + + // CraftBukkit start - Fix for nonsensical head yaw + this.yHeadRotp = Mth.floor(this.entity.getYHeadRot() * 256.0F / 360.0F); ++ if (!this.level.galeConfig().smallOptimizations.sendSetHeadRotationPacketsOnlyForLivingEntities || this.entity instanceof LivingEntity) { // Gale - SportPaper - send set head rotation packets only for living entities + consumer.accept(new ClientboundRotateHeadPacket(this.entity, (byte) this.yHeadRotp)); ++ } // Gale - SportPaper - send set head rotation packets only for living entities + // CraftBukkit end + + if (this.entity instanceof LivingEntity) { +diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +index 3274742f667c9b0bec5f1bf8d03b2fd3165eb807..ffc39061f2363b979590888e736dd7a53a0d256a 100644 +--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java ++++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +@@ -50,6 +50,8 @@ public class GaleWorldConfiguration extends ConfigurationPart { + + public boolean processFullEquipmentChangeIfOnlyDurabilityChanged = false; // Gale - Slice - ignore durability change equipment updates + ++ public boolean sendSetHeadRotationPacketsOnlyForLivingEntities = true; // Gale - SportPaper - send set head rotation packets only for living entities ++ + // Gale start - Airplane - reduce projectile chunk loading + public MaxProjectileChunkLoads maxProjectileChunkLoads; + public class MaxProjectileChunkLoads extends ConfigurationPart { diff --git a/patches/server/0100-Player-canSee-by-entity-UUID.patch b/patches/server/0101-Player-canSee-by-entity-UUID.patch similarity index 100% rename from patches/server/0100-Player-canSee-by-entity-UUID.patch rename to patches/server/0101-Player-canSee-by-entity-UUID.patch diff --git a/patches/server/0101-Spread-out-sending-all-player-info.patch b/patches/server/0102-Spread-out-sending-all-player-info.patch similarity index 100% rename from patches/server/0101-Spread-out-sending-all-player-info.patch rename to patches/server/0102-Spread-out-sending-all-player-info.patch diff --git a/patches/server/0102-Optimize-player-list-for-sending-player-info.patch b/patches/server/0103-Optimize-player-list-for-sending-player-info.patch similarity index 100% rename from patches/server/0102-Optimize-player-list-for-sending-player-info.patch rename to patches/server/0103-Optimize-player-list-for-sending-player-info.patch diff --git a/patches/server/0103-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch b/patches/server/0104-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch similarity index 100% rename from patches/server/0103-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch rename to patches/server/0104-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch diff --git a/patches/server/0104-Send-multiple-keep-alive-packets.patch b/patches/server/0105-Send-multiple-keep-alive-packets.patch similarity index 100% rename from patches/server/0104-Send-multiple-keep-alive-packets.patch rename to patches/server/0105-Send-multiple-keep-alive-packets.patch diff --git a/patches/server/0105-Prevent-entities-random-strolling-into-non-ticking-c.patch b/patches/server/0106-Prevent-entities-random-strolling-into-non-ticking-c.patch similarity index 94% rename from patches/server/0105-Prevent-entities-random-strolling-into-non-ticking-c.patch rename to patches/server/0106-Prevent-entities-random-strolling-into-non-ticking-c.patch index e81e0df..c79867c 100644 --- a/patches/server/0105-Prevent-entities-random-strolling-into-non-ticking-c.patch +++ b/patches/server/0106-Prevent-entities-random-strolling-into-non-ticking-c.patch @@ -36,10 +36,10 @@ index 216929c838446c3c14d9b9906ffa625ef35fcbc8..29c7f53a4fa88a77c4076a6294e689e4 } else { this.wantedX = vec3.x; diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java -index 3274742f667c9b0bec5f1bf8d03b2fd3165eb807..c77ccc1e91756223bc8ced2d7648464dc33aa892 100644 +index ffc39061f2363b979590888e736dd7a53a0d256a..aeca83bc1fb000716508c9c4b66b0bc41e481f2c 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java -@@ -262,6 +262,7 @@ public class GaleWorldConfiguration extends ConfigurationPart { +@@ -264,6 +264,7 @@ public class GaleWorldConfiguration extends ConfigurationPart { public class GameplayMechanics extends ConfigurationPart { public boolean entitiesCanEatBlocksInNonTickingChunks = false; // Gale - Purpur - prevent entities eating blocks in non-ticking chunks diff --git a/patches/server/0106-Specific-interval-TPS-API.patch b/patches/server/0107-Specific-interval-TPS-API.patch similarity index 100% rename from patches/server/0106-Specific-interval-TPS-API.patch rename to patches/server/0107-Specific-interval-TPS-API.patch diff --git a/patches/server/0107-5-second-TPS-average.patch b/patches/server/0108-5-second-TPS-average.patch similarity index 100% rename from patches/server/0107-5-second-TPS-average.patch rename to patches/server/0108-5-second-TPS-average.patch diff --git a/patches/server/0108-Measure-last-tick-time.patch b/patches/server/0109-Measure-last-tick-time.patch similarity index 100% rename from patches/server/0108-Measure-last-tick-time.patch rename to patches/server/0109-Measure-last-tick-time.patch diff --git a/patches/server/0109-Last-tick-time-API.patch b/patches/server/0110-Last-tick-time-API.patch similarity index 100% rename from patches/server/0109-Last-tick-time-API.patch rename to patches/server/0110-Last-tick-time-API.patch diff --git a/patches/server/0110-Show-last-tick-time-in-tps-command.patch b/patches/server/0111-Show-last-tick-time-in-tps-command.patch similarity index 100% rename from patches/server/0110-Show-last-tick-time-in-tps-command.patch rename to patches/server/0111-Show-last-tick-time-in-tps-command.patch diff --git a/patches/server/0111-Increase-time-statistics-in-intervals.patch b/patches/server/0112-Increase-time-statistics-in-intervals.patch similarity index 100% rename from patches/server/0111-Increase-time-statistics-in-intervals.patch rename to patches/server/0112-Increase-time-statistics-in-intervals.patch diff --git a/patches/server/0112-For-collision-check-has-physics-before-same-vehicle.patch b/patches/server/0113-For-collision-check-has-physics-before-same-vehicle.patch similarity index 100% rename from patches/server/0112-For-collision-check-has-physics-before-same-vehicle.patch rename to patches/server/0113-For-collision-check-has-physics-before-same-vehicle.patch diff --git a/patches/server/0113-Skip-negligible-planar-movement-multiplication.patch b/patches/server/0114-Skip-negligible-planar-movement-multiplication.patch similarity index 100% rename from patches/server/0113-Skip-negligible-planar-movement-multiplication.patch rename to patches/server/0114-Skip-negligible-planar-movement-multiplication.patch diff --git a/patches/server/0114-Reduce-RandomSource-instances.patch b/patches/server/0115-Reduce-RandomSource-instances.patch similarity index 100% rename from patches/server/0114-Reduce-RandomSource-instances.patch rename to patches/server/0115-Reduce-RandomSource-instances.patch diff --git a/patches/server/0115-Server-thread-priority-environment-variable.patch b/patches/server/0116-Server-thread-priority-environment-variable.patch similarity index 100% rename from patches/server/0115-Server-thread-priority-environment-variable.patch rename to patches/server/0116-Server-thread-priority-environment-variable.patch diff --git a/patches/server/0116-Thread-safety-annotations.patch b/patches/server/0117-Thread-safety-annotations.patch similarity index 100% rename from patches/server/0116-Thread-safety-annotations.patch rename to patches/server/0117-Thread-safety-annotations.patch diff --git a/patches/server/0117-CPU-cores-estimation.patch b/patches/server/0118-CPU-cores-estimation.patch similarity index 100% rename from patches/server/0117-CPU-cores-estimation.patch rename to patches/server/0118-CPU-cores-estimation.patch diff --git a/patches/server/0118-Mutex-utility.patch b/patches/server/0119-Mutex-utility.patch similarity index 100% rename from patches/server/0118-Mutex-utility.patch rename to patches/server/0119-Mutex-utility.patch diff --git a/patches/server/0119-Paired-lock-and-condition-utility.patch b/patches/server/0120-Paired-lock-and-condition-utility.patch similarity index 100% rename from patches/server/0119-Paired-lock-and-condition-utility.patch rename to patches/server/0120-Paired-lock-and-condition-utility.patch diff --git a/patches/server/0120-Unterminable-executor-utility.patch b/patches/server/0121-Unterminable-executor-utility.patch similarity index 100% rename from patches/server/0120-Unterminable-executor-utility.patch rename to patches/server/0121-Unterminable-executor-utility.patch diff --git a/patches/server/0121-FIFO-concurrent-queue-utility.patch b/patches/server/0122-FIFO-concurrent-queue-utility.patch similarity index 100% rename from patches/server/0121-FIFO-concurrent-queue-utility.patch rename to patches/server/0122-FIFO-concurrent-queue-utility.patch diff --git a/patches/server/0122-Base-thread-pools.patch b/patches/server/0123-Base-thread-pools.patch similarity index 100% rename from patches/server/0122-Base-thread-pools.patch rename to patches/server/0123-Base-thread-pools.patch diff --git a/patches/server/0123-Non-blocking-PooledObjects.patch b/patches/server/0124-Non-blocking-PooledObjects.patch similarity index 100% rename from patches/server/0123-Non-blocking-PooledObjects.patch rename to patches/server/0124-Non-blocking-PooledObjects.patch