From 9c340cab1a56dd4d711dee1e12f7db676562cc72 Mon Sep 17 00:00:00 2001 From: MartijnMuijsers Date: Tue, 29 Nov 2022 21:39:39 +0100 Subject: [PATCH] Make arrow movement resetting despawn counter configurable --- ...ent-resetting-despawn-counter-config.patch | 44 +++++++++++++++++++ ...ch => 0063-Reduce-array-allocations.patch} | 0 ...-Optional-allocation-in-EntityBased.patch} | 0 ...atch => 0065-Measure-last-tick-time.patch} | 0 ...PI.patch => 0066-Last-tick-time-API.patch} | 0 ...-Show-last-tick-time-in-tps-command.patch} | 0 ...-physics-check-before-vehicle-check.patch} | 0 ...069-Variable-main-thread-task-delay.patch} | 0 ... 0070-Reduce-RandomSource-instances.patch} | 0 ....patch => 0071-CPU-cores-estimation.patch} | 0 ... 0072-Add-centralized-AsyncExecutor.patch} | 0 ...=> 0073-Remove-Paper-async-executor.patch} | 0 ... 0074-Remove-Paper-cleaner-executor.patch} | 0 ... => 0075-Remove-background-executor.patch} | 0 ...h => 0076-Remove-bootstrap-executor.patch} | 0 ...0077-Remove-world-upgrade-executors.patch} | 0 ...> 0078-Remove-tab-complete-executor.patch} | 0 ...=> 0079-Remove-text-filter-executor.patch} | 0 18 files changed, 44 insertions(+) create mode 100644 patches/server/0062-Make-arrow-movement-resetting-despawn-counter-config.patch rename patches/server/{0062-Reduce-array-allocations.patch => 0063-Reduce-array-allocations.patch} (100%) rename patches/server/{0063-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch => 0064-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch} (100%) rename patches/server/{0064-Measure-last-tick-time.patch => 0065-Measure-last-tick-time.patch} (100%) rename patches/server/{0065-Last-tick-time-API.patch => 0066-Last-tick-time-API.patch} (100%) rename patches/server/{0066-Show-last-tick-time-in-tps-command.patch => 0067-Show-last-tick-time-in-tps-command.patch} (100%) rename patches/server/{0067-Collision-physics-check-before-vehicle-check.patch => 0068-Collision-physics-check-before-vehicle-check.patch} (100%) rename patches/server/{0068-Variable-main-thread-task-delay.patch => 0069-Variable-main-thread-task-delay.patch} (100%) rename patches/server/{0069-Reduce-RandomSource-instances.patch => 0070-Reduce-RandomSource-instances.patch} (100%) rename patches/server/{0070-CPU-cores-estimation.patch => 0071-CPU-cores-estimation.patch} (100%) rename patches/server/{0071-Add-centralized-AsyncExecutor.patch => 0072-Add-centralized-AsyncExecutor.patch} (100%) rename patches/server/{0072-Remove-Paper-async-executor.patch => 0073-Remove-Paper-async-executor.patch} (100%) rename patches/server/{0073-Remove-Paper-cleaner-executor.patch => 0074-Remove-Paper-cleaner-executor.patch} (100%) rename patches/server/{0074-Remove-background-executor.patch => 0075-Remove-background-executor.patch} (100%) rename patches/server/{0075-Remove-bootstrap-executor.patch => 0076-Remove-bootstrap-executor.patch} (100%) rename patches/server/{0076-Remove-world-upgrade-executors.patch => 0077-Remove-world-upgrade-executors.patch} (100%) rename patches/server/{0077-Remove-tab-complete-executor.patch => 0078-Remove-tab-complete-executor.patch} (100%) rename patches/server/{0078-Remove-text-filter-executor.patch => 0079-Remove-text-filter-executor.patch} (100%) diff --git a/patches/server/0062-Make-arrow-movement-resetting-despawn-counter-config.patch b/patches/server/0062-Make-arrow-movement-resetting-despawn-counter-config.patch new file mode 100644 index 0000000..6fd98ff --- /dev/null +++ b/patches/server/0062-Make-arrow-movement-resetting-despawn-counter-config.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MartijnMuijsers +Date: Tue, 29 Nov 2022 21:37:22 +0100 +Subject: [PATCH] Make arrow movement resetting despawn counter configurable + +License: MIT (https://opensource.org/licenses/MIT) + +This patch is based on the following patch: +"Arrows should not reset despawn counter" +By: William Blake Galbreath +As part of: Purpur (https://github.com/PurpurMC/Purpur) +Licensed under: MIT (https://opensource.org/licenses/MIT) + +* Purpur description * + +This prevents keeping arrows alive indefinitely (such as when the block +the arrow is stuck in gets removed, like a piston head going up/down) + +diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +index def3b3f8dac4b28eaaafdd9bc2e7f4b9ec9d6855..ca28f41a5a0405adf07cc2898d53a77f5c7b3e8c 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +@@ -322,7 +322,7 @@ public abstract class AbstractArrow extends Projectile { + Vec3 vec3d = this.getDeltaMovement(); + + this.setDeltaMovement(vec3d.multiply((double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F))); +- this.life = 0; ++ if (this.level.galeConfig().gameplayMechanics.arrowMovementResetsDespawnCounter) this.life = 0; // Gale - Purpur - make arrow movement resetting despawn counter configurable + } + + @Override +diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +index 3b023cbd132c6aa263dbbe54ed7d30e1049d3875..345ce3a53e3e7ee5a4dd9a632231edfe161cd821 100644 +--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java ++++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +@@ -244,6 +244,8 @@ public class GaleWorldConfiguration extends ConfigurationPart { + public GameplayMechanics gameplayMechanics; + public class GameplayMechanics extends ConfigurationPart { + ++ public boolean arrowMovementResetsDespawnCounter = true; // Gale - Purpur - make arrow movement resetting despawn counter configurable ++ + public Fixes fixes; + public class Fixes extends ConfigurationPart { + diff --git a/patches/server/0062-Reduce-array-allocations.patch b/patches/server/0063-Reduce-array-allocations.patch similarity index 100% rename from patches/server/0062-Reduce-array-allocations.patch rename to patches/server/0063-Reduce-array-allocations.patch diff --git a/patches/server/0063-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch b/patches/server/0064-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch similarity index 100% rename from patches/server/0063-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch rename to patches/server/0064-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch diff --git a/patches/server/0064-Measure-last-tick-time.patch b/patches/server/0065-Measure-last-tick-time.patch similarity index 100% rename from patches/server/0064-Measure-last-tick-time.patch rename to patches/server/0065-Measure-last-tick-time.patch diff --git a/patches/server/0065-Last-tick-time-API.patch b/patches/server/0066-Last-tick-time-API.patch similarity index 100% rename from patches/server/0065-Last-tick-time-API.patch rename to patches/server/0066-Last-tick-time-API.patch diff --git a/patches/server/0066-Show-last-tick-time-in-tps-command.patch b/patches/server/0067-Show-last-tick-time-in-tps-command.patch similarity index 100% rename from patches/server/0066-Show-last-tick-time-in-tps-command.patch rename to patches/server/0067-Show-last-tick-time-in-tps-command.patch diff --git a/patches/server/0067-Collision-physics-check-before-vehicle-check.patch b/patches/server/0068-Collision-physics-check-before-vehicle-check.patch similarity index 100% rename from patches/server/0067-Collision-physics-check-before-vehicle-check.patch rename to patches/server/0068-Collision-physics-check-before-vehicle-check.patch diff --git a/patches/server/0068-Variable-main-thread-task-delay.patch b/patches/server/0069-Variable-main-thread-task-delay.patch similarity index 100% rename from patches/server/0068-Variable-main-thread-task-delay.patch rename to patches/server/0069-Variable-main-thread-task-delay.patch diff --git a/patches/server/0069-Reduce-RandomSource-instances.patch b/patches/server/0070-Reduce-RandomSource-instances.patch similarity index 100% rename from patches/server/0069-Reduce-RandomSource-instances.patch rename to patches/server/0070-Reduce-RandomSource-instances.patch diff --git a/patches/server/0070-CPU-cores-estimation.patch b/patches/server/0071-CPU-cores-estimation.patch similarity index 100% rename from patches/server/0070-CPU-cores-estimation.patch rename to patches/server/0071-CPU-cores-estimation.patch diff --git a/patches/server/0071-Add-centralized-AsyncExecutor.patch b/patches/server/0072-Add-centralized-AsyncExecutor.patch similarity index 100% rename from patches/server/0071-Add-centralized-AsyncExecutor.patch rename to patches/server/0072-Add-centralized-AsyncExecutor.patch diff --git a/patches/server/0072-Remove-Paper-async-executor.patch b/patches/server/0073-Remove-Paper-async-executor.patch similarity index 100% rename from patches/server/0072-Remove-Paper-async-executor.patch rename to patches/server/0073-Remove-Paper-async-executor.patch diff --git a/patches/server/0073-Remove-Paper-cleaner-executor.patch b/patches/server/0074-Remove-Paper-cleaner-executor.patch similarity index 100% rename from patches/server/0073-Remove-Paper-cleaner-executor.patch rename to patches/server/0074-Remove-Paper-cleaner-executor.patch diff --git a/patches/server/0074-Remove-background-executor.patch b/patches/server/0075-Remove-background-executor.patch similarity index 100% rename from patches/server/0074-Remove-background-executor.patch rename to patches/server/0075-Remove-background-executor.patch diff --git a/patches/server/0075-Remove-bootstrap-executor.patch b/patches/server/0076-Remove-bootstrap-executor.patch similarity index 100% rename from patches/server/0075-Remove-bootstrap-executor.patch rename to patches/server/0076-Remove-bootstrap-executor.patch diff --git a/patches/server/0076-Remove-world-upgrade-executors.patch b/patches/server/0077-Remove-world-upgrade-executors.patch similarity index 100% rename from patches/server/0076-Remove-world-upgrade-executors.patch rename to patches/server/0077-Remove-world-upgrade-executors.patch diff --git a/patches/server/0077-Remove-tab-complete-executor.patch b/patches/server/0078-Remove-tab-complete-executor.patch similarity index 100% rename from patches/server/0077-Remove-tab-complete-executor.patch rename to patches/server/0078-Remove-tab-complete-executor.patch diff --git a/patches/server/0078-Remove-text-filter-executor.patch b/patches/server/0079-Remove-text-filter-executor.patch similarity index 100% rename from patches/server/0078-Remove-text-filter-executor.patch rename to patches/server/0079-Remove-text-filter-executor.patch