From 20620d557c8a47d7af8c70f046af16817d4634fb Mon Sep 17 00:00:00 2001 From: MartijnMuijsers Date: Wed, 30 Nov 2022 20:44:17 +0100 Subject: [PATCH] Prevent random strolling into non-ticking chunks --- ...om-strolling-into-non-ticking-chunks.patch | 48 +++++++++++++++++++ ...h => 0084-Specific-interval-TPS-API.patch} | 0 ....patch => 0085-5-second-TPS-average.patch} | 0 ...atch => 0086-Measure-last-tick-time.patch} | 0 ...PI.patch => 0087-Last-tick-time-API.patch} | 0 ...-Show-last-tick-time-in-tps-command.patch} | 0 ...eck-has-physics-before-same-vehicle.patch} | 0 ...090-Variable-main-thread-task-delay.patch} | 0 ... 0091-Reduce-RandomSource-instances.patch} | 0 ....patch => 0092-CPU-cores-estimation.patch} | 0 ... 0093-Add-centralized-AsyncExecutor.patch} | 0 ...=> 0094-Remove-Paper-async-executor.patch} | 0 ... 0095-Remove-Paper-cleaner-executor.patch} | 0 ... => 0096-Remove-background-executor.patch} | 0 ...h => 0097-Remove-bootstrap-executor.patch} | 0 ...0098-Remove-world-upgrade-executors.patch} | 0 ...> 0099-Remove-tab-complete-executor.patch} | 0 ...=> 0100-Remove-text-filter-executor.patch} | 0 18 files changed, 48 insertions(+) create mode 100644 patches/server/0083-Prevent-random-strolling-into-non-ticking-chunks.patch rename patches/server/{0083-Specific-interval-TPS-API.patch => 0084-Specific-interval-TPS-API.patch} (100%) rename patches/server/{0084-5-second-TPS-average.patch => 0085-5-second-TPS-average.patch} (100%) rename patches/server/{0085-Measure-last-tick-time.patch => 0086-Measure-last-tick-time.patch} (100%) rename patches/server/{0086-Last-tick-time-API.patch => 0087-Last-tick-time-API.patch} (100%) rename patches/server/{0087-Show-last-tick-time-in-tps-command.patch => 0088-Show-last-tick-time-in-tps-command.patch} (100%) rename patches/server/{0088-For-collision-check-has-physics-before-same-vehicle.patch => 0089-For-collision-check-has-physics-before-same-vehicle.patch} (100%) rename patches/server/{0089-Variable-main-thread-task-delay.patch => 0090-Variable-main-thread-task-delay.patch} (100%) rename patches/server/{0090-Reduce-RandomSource-instances.patch => 0091-Reduce-RandomSource-instances.patch} (100%) rename patches/server/{0091-CPU-cores-estimation.patch => 0092-CPU-cores-estimation.patch} (100%) rename patches/server/{0092-Add-centralized-AsyncExecutor.patch => 0093-Add-centralized-AsyncExecutor.patch} (100%) rename patches/server/{0093-Remove-Paper-async-executor.patch => 0094-Remove-Paper-async-executor.patch} (100%) rename patches/server/{0094-Remove-Paper-cleaner-executor.patch => 0095-Remove-Paper-cleaner-executor.patch} (100%) rename patches/server/{0095-Remove-background-executor.patch => 0096-Remove-background-executor.patch} (100%) rename patches/server/{0096-Remove-bootstrap-executor.patch => 0097-Remove-bootstrap-executor.patch} (100%) rename patches/server/{0097-Remove-world-upgrade-executors.patch => 0098-Remove-world-upgrade-executors.patch} (100%) rename patches/server/{0098-Remove-tab-complete-executor.patch => 0099-Remove-tab-complete-executor.patch} (100%) rename patches/server/{0099-Remove-text-filter-executor.patch => 0100-Remove-text-filter-executor.patch} (100%) diff --git a/patches/server/0083-Prevent-random-strolling-into-non-ticking-chunks.patch b/patches/server/0083-Prevent-random-strolling-into-non-ticking-chunks.patch new file mode 100644 index 0000000..c1ecad9 --- /dev/null +++ b/patches/server/0083-Prevent-random-strolling-into-non-ticking-chunks.patch @@ -0,0 +1,48 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MartijnMuijsers +Date: Wed, 30 Nov 2022 20:38:15 +0100 +Subject: [PATCH] Prevent random strolling into non-ticking chunks + +License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) + +This patch is based on the following patch: +"Don't wander into non-ticking chunks" +By: PureGero +As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper) +Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) + +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java +index 216929c838446c3c14d9b9906ffa625ef35fcbc8..2c728037c561a834cb3ec485655c904d2e78430e 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java +@@ -2,6 +2,9 @@ package net.minecraft.world.entity.ai.goal; + + import java.util.EnumSet; + import javax.annotation.Nullable; ++ ++import net.minecraft.core.BlockPos; ++import net.minecraft.server.level.ServerLevel; + import net.minecraft.world.entity.PathfinderMob; + import net.minecraft.world.entity.ai.util.DefaultRandomPos; + import net.minecraft.world.phys.Vec3; +@@ -49,7 +52,7 @@ public class RandomStrollGoal extends Goal { + } + + Vec3 vec3 = this.getPosition(); +- if (vec3 == null) { ++ if (vec3 == null || (!this.mob.level.galeConfig().gameplayMechanics.entitiesCanRandomStrollIntoNonTickingChunks && !((ServerLevel) this.mob.level).isPositionEntityTicking(new BlockPos(vec3)))) { // Gale - MultiPaper - prevent random strolling into non-ticking chunks + return false; + } 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 4c499898191b2017508b9550e5f769f2d0c97c59..9b4cebdfb75e1272417d207771807e9951badf70 100644 +--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java ++++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +@@ -248,6 +248,7 @@ public class GaleWorldConfiguration extends ConfigurationPart { + + public boolean arrowMovementResetsDespawnCounter = true; // Gale - Purpur - make arrow movement resetting despawn counter configurable + public boolean hideFlamesOnEntitiesWithFireResistance = false; // Gale - Slice - hide flames on entities with fire resistance ++ public boolean entitiesCanRandomStrollIntoNonTickingChunks = true; // Gale - MultiPaper - prevent random strolling into non-ticking chunks + + public Fixes fixes; + public class Fixes extends ConfigurationPart { diff --git a/patches/server/0083-Specific-interval-TPS-API.patch b/patches/server/0084-Specific-interval-TPS-API.patch similarity index 100% rename from patches/server/0083-Specific-interval-TPS-API.patch rename to patches/server/0084-Specific-interval-TPS-API.patch diff --git a/patches/server/0084-5-second-TPS-average.patch b/patches/server/0085-5-second-TPS-average.patch similarity index 100% rename from patches/server/0084-5-second-TPS-average.patch rename to patches/server/0085-5-second-TPS-average.patch diff --git a/patches/server/0085-Measure-last-tick-time.patch b/patches/server/0086-Measure-last-tick-time.patch similarity index 100% rename from patches/server/0085-Measure-last-tick-time.patch rename to patches/server/0086-Measure-last-tick-time.patch diff --git a/patches/server/0086-Last-tick-time-API.patch b/patches/server/0087-Last-tick-time-API.patch similarity index 100% rename from patches/server/0086-Last-tick-time-API.patch rename to patches/server/0087-Last-tick-time-API.patch diff --git a/patches/server/0087-Show-last-tick-time-in-tps-command.patch b/patches/server/0088-Show-last-tick-time-in-tps-command.patch similarity index 100% rename from patches/server/0087-Show-last-tick-time-in-tps-command.patch rename to patches/server/0088-Show-last-tick-time-in-tps-command.patch diff --git a/patches/server/0088-For-collision-check-has-physics-before-same-vehicle.patch b/patches/server/0089-For-collision-check-has-physics-before-same-vehicle.patch similarity index 100% rename from patches/server/0088-For-collision-check-has-physics-before-same-vehicle.patch rename to patches/server/0089-For-collision-check-has-physics-before-same-vehicle.patch diff --git a/patches/server/0089-Variable-main-thread-task-delay.patch b/patches/server/0090-Variable-main-thread-task-delay.patch similarity index 100% rename from patches/server/0089-Variable-main-thread-task-delay.patch rename to patches/server/0090-Variable-main-thread-task-delay.patch diff --git a/patches/server/0090-Reduce-RandomSource-instances.patch b/patches/server/0091-Reduce-RandomSource-instances.patch similarity index 100% rename from patches/server/0090-Reduce-RandomSource-instances.patch rename to patches/server/0091-Reduce-RandomSource-instances.patch diff --git a/patches/server/0091-CPU-cores-estimation.patch b/patches/server/0092-CPU-cores-estimation.patch similarity index 100% rename from patches/server/0091-CPU-cores-estimation.patch rename to patches/server/0092-CPU-cores-estimation.patch diff --git a/patches/server/0092-Add-centralized-AsyncExecutor.patch b/patches/server/0093-Add-centralized-AsyncExecutor.patch similarity index 100% rename from patches/server/0092-Add-centralized-AsyncExecutor.patch rename to patches/server/0093-Add-centralized-AsyncExecutor.patch diff --git a/patches/server/0093-Remove-Paper-async-executor.patch b/patches/server/0094-Remove-Paper-async-executor.patch similarity index 100% rename from patches/server/0093-Remove-Paper-async-executor.patch rename to patches/server/0094-Remove-Paper-async-executor.patch diff --git a/patches/server/0094-Remove-Paper-cleaner-executor.patch b/patches/server/0095-Remove-Paper-cleaner-executor.patch similarity index 100% rename from patches/server/0094-Remove-Paper-cleaner-executor.patch rename to patches/server/0095-Remove-Paper-cleaner-executor.patch diff --git a/patches/server/0095-Remove-background-executor.patch b/patches/server/0096-Remove-background-executor.patch similarity index 100% rename from patches/server/0095-Remove-background-executor.patch rename to patches/server/0096-Remove-background-executor.patch diff --git a/patches/server/0096-Remove-bootstrap-executor.patch b/patches/server/0097-Remove-bootstrap-executor.patch similarity index 100% rename from patches/server/0096-Remove-bootstrap-executor.patch rename to patches/server/0097-Remove-bootstrap-executor.patch diff --git a/patches/server/0097-Remove-world-upgrade-executors.patch b/patches/server/0098-Remove-world-upgrade-executors.patch similarity index 100% rename from patches/server/0097-Remove-world-upgrade-executors.patch rename to patches/server/0098-Remove-world-upgrade-executors.patch diff --git a/patches/server/0098-Remove-tab-complete-executor.patch b/patches/server/0099-Remove-tab-complete-executor.patch similarity index 100% rename from patches/server/0098-Remove-tab-complete-executor.patch rename to patches/server/0099-Remove-tab-complete-executor.patch diff --git a/patches/server/0099-Remove-text-filter-executor.patch b/patches/server/0100-Remove-text-filter-executor.patch similarity index 100% rename from patches/server/0099-Remove-text-filter-executor.patch rename to patches/server/0100-Remove-text-filter-executor.patch