diff --git a/patches/server/0114-Don-t-load-chunks-to-spawn-phantoms.patch b/patches/server/0114-Don-t-load-chunks-to-spawn-phantoms.patch new file mode 100644 index 0000000..645d0c4 --- /dev/null +++ b/patches/server/0114-Don-t-load-chunks-to-spawn-phantoms.patch @@ -0,0 +1,63 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martijn Muijsers +Date: Sun, 25 Dec 2022 19:31:09 +0100 +Subject: [PATCH] Don't load chunks to spawn phantoms + +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: +"Don't load chunks when spawning phantoms" +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/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java +index 1c3718d9244513d9fc795dceb564a81375734557..20249e200781daf072ee24102aba69124ca3128a 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java +@@ -73,7 +73,15 @@ public class PhantomSpawner implements CustomSpawner { + + if (randomsource.nextInt(j) >= world.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper + BlockPos blockposition1 = blockposition.above(20 + randomsource.nextInt(15)).east(-10 + randomsource.nextInt(21)).south(-10 + randomsource.nextInt(21)); +- BlockState iblockdata = world.getBlockState(blockposition1); ++ // Gale start - MultiPaper - don't load chunks to spawn phantoms ++ BlockState iblockdata; ++ if (world.galeConfig().smallOptimizations.loadChunks.toSpawnPhantoms) { ++ iblockdata = world.getBlockState(blockposition1); ++ } else { ++ iblockdata = world.getBlockStateIfLoaded(blockposition1); ++ if (iblockdata == null) continue; ++ } ++ // Gale end - MultiPaper - don't load chunks to spawn phantoms + FluidState fluid = world.getFluidState(blockposition1); + + if (NaturalSpawner.isValidEmptySpawnBlock(world, blockposition1, iblockdata, fluid, EntityType.PHANTOM)) { +diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +index c45f4b9d06956a58b4e59afe70203ee8abbfccee..5b5fb89408b201bc3f73cf3dd80a5f8856b48b68 100644 +--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java ++++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +@@ -258,6 +258,23 @@ public class GaleWorldConfiguration extends ConfigurationPart { + + } + ++ public LoadChunks loadChunks; ++ public class LoadChunks extends ConfigurationPart { ++ ++ // Gale start - MultiPaper - don't load chunks to spawn phantoms ++ /** ++ * Whether to load chunks to spawn phantoms. If false, ++ * attempts to spawn a phantom in unloaded chunks will do nothing. ++ * ++ */ ++ public boolean toSpawnPhantoms = false; ++ // Gale end - MultiPaper - don't load chunks to spawn phantoms ++ ++ } ++ + } + + public GameplayMechanics gameplayMechanics; diff --git a/patches/server/0114-Prevent-entities-random-strolling-into-non-ticking-c.patch b/patches/server/0115-Prevent-entities-random-strolling-into-non-ticking-c.patch similarity index 94% rename from patches/server/0114-Prevent-entities-random-strolling-into-non-ticking-c.patch rename to patches/server/0115-Prevent-entities-random-strolling-into-non-ticking-c.patch index dee3ea5..781f73d 100644 --- a/patches/server/0114-Prevent-entities-random-strolling-into-non-ticking-c.patch +++ b/patches/server/0115-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 c45f4b9d06956a58b4e59afe70203ee8abbfccee..b02eeb68002ed802714ade7a89fecc249d95375b 100644 +index 5b5fb89408b201bc3f73cf3dd80a5f8856b48b68..c68f384067059bb5ab92a268daffa3e406123cd7 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java -@@ -264,6 +264,7 @@ public class GaleWorldConfiguration extends ConfigurationPart { +@@ -281,6 +281,7 @@ public class GaleWorldConfiguration extends ConfigurationPart { public class GameplayMechanics extends ConfigurationPart.Post { public boolean entitiesCanEatBlocksInNonTickingChunks = false; // Gale - Purpur - prevent entities eating blocks in non-ticking chunks diff --git a/patches/server/0115-CraftBukkit-UUID-to-world-map.patch b/patches/server/0116-CraftBukkit-UUID-to-world-map.patch similarity index 100% rename from patches/server/0115-CraftBukkit-UUID-to-world-map.patch rename to patches/server/0116-CraftBukkit-UUID-to-world-map.patch diff --git a/patches/server/0116-Don-t-double-save-stored-user-lists.patch b/patches/server/0117-Don-t-double-save-stored-user-lists.patch similarity index 100% rename from patches/server/0116-Don-t-double-save-stored-user-lists.patch rename to patches/server/0117-Don-t-double-save-stored-user-lists.patch diff --git a/patches/server/0117-Specific-interval-TPS-API.patch b/patches/server/0118-Specific-interval-TPS-API.patch similarity index 100% rename from patches/server/0117-Specific-interval-TPS-API.patch rename to patches/server/0118-Specific-interval-TPS-API.patch diff --git a/patches/server/0118-5-second-TPS-average.patch b/patches/server/0119-5-second-TPS-average.patch similarity index 100% rename from patches/server/0118-5-second-TPS-average.patch rename to patches/server/0119-5-second-TPS-average.patch diff --git a/patches/server/0119-Measure-last-tick-time.patch b/patches/server/0120-Measure-last-tick-time.patch similarity index 100% rename from patches/server/0119-Measure-last-tick-time.patch rename to patches/server/0120-Measure-last-tick-time.patch diff --git a/patches/server/0120-Last-tick-time-API.patch b/patches/server/0121-Last-tick-time-API.patch similarity index 100% rename from patches/server/0120-Last-tick-time-API.patch rename to patches/server/0121-Last-tick-time-API.patch diff --git a/patches/server/0121-Show-last-tick-time-in-tps-command.patch b/patches/server/0122-Show-last-tick-time-in-tps-command.patch similarity index 100% rename from patches/server/0121-Show-last-tick-time-in-tps-command.patch rename to patches/server/0122-Show-last-tick-time-in-tps-command.patch diff --git a/patches/server/0122-Increase-time-statistics-in-intervals.patch b/patches/server/0123-Increase-time-statistics-in-intervals.patch similarity index 100% rename from patches/server/0122-Increase-time-statistics-in-intervals.patch rename to patches/server/0123-Increase-time-statistics-in-intervals.patch diff --git a/patches/server/0123-For-collision-check-has-physics-before-same-vehicle.patch b/patches/server/0124-For-collision-check-has-physics-before-same-vehicle.patch similarity index 100% rename from patches/server/0123-For-collision-check-has-physics-before-same-vehicle.patch rename to patches/server/0124-For-collision-check-has-physics-before-same-vehicle.patch diff --git a/patches/server/0124-Skip-negligible-planar-movement-multiplication.patch b/patches/server/0125-Skip-negligible-planar-movement-multiplication.patch similarity index 100% rename from patches/server/0124-Skip-negligible-planar-movement-multiplication.patch rename to patches/server/0125-Skip-negligible-planar-movement-multiplication.patch diff --git a/patches/server/0125-Reduce-RandomSource-instances.patch b/patches/server/0126-Reduce-RandomSource-instances.patch similarity index 100% rename from patches/server/0125-Reduce-RandomSource-instances.patch rename to patches/server/0126-Reduce-RandomSource-instances.patch diff --git a/patches/server/0126-Server-thread-priority-environment-variable.patch b/patches/server/0127-Server-thread-priority-environment-variable.patch similarity index 100% rename from patches/server/0126-Server-thread-priority-environment-variable.patch rename to patches/server/0127-Server-thread-priority-environment-variable.patch diff --git a/patches/server/0127-Thread-safety-annotations.patch b/patches/server/0128-Thread-safety-annotations.patch similarity index 100% rename from patches/server/0127-Thread-safety-annotations.patch rename to patches/server/0128-Thread-safety-annotations.patch diff --git a/patches/server/0128-CPU-cores-estimation.patch b/patches/server/0129-CPU-cores-estimation.patch similarity index 100% rename from patches/server/0128-CPU-cores-estimation.patch rename to patches/server/0129-CPU-cores-estimation.patch diff --git a/patches/server/0129-Mutex-utility.patch b/patches/server/0130-Mutex-utility.patch similarity index 100% rename from patches/server/0129-Mutex-utility.patch rename to patches/server/0130-Mutex-utility.patch diff --git a/patches/server/0130-Paired-lock-and-condition-utility.patch b/patches/server/0131-Paired-lock-and-condition-utility.patch similarity index 100% rename from patches/server/0130-Paired-lock-and-condition-utility.patch rename to patches/server/0131-Paired-lock-and-condition-utility.patch diff --git a/patches/server/0131-Unterminable-executor-utility.patch b/patches/server/0132-Unterminable-executor-utility.patch similarity index 100% rename from patches/server/0131-Unterminable-executor-utility.patch rename to patches/server/0132-Unterminable-executor-utility.patch diff --git a/patches/server/0132-FIFO-concurrent-queue-utility.patch b/patches/server/0133-FIFO-concurrent-queue-utility.patch similarity index 100% rename from patches/server/0132-FIFO-concurrent-queue-utility.patch rename to patches/server/0133-FIFO-concurrent-queue-utility.patch diff --git a/patches/server/0133-Base-thread-pools.patch b/patches/server/0134-Base-thread-pools.patch similarity index 100% rename from patches/server/0133-Base-thread-pools.patch rename to patches/server/0134-Base-thread-pools.patch diff --git a/patches/server/0134-Non-blocking-PooledObjects.patch b/patches/server/0135-Non-blocking-PooledObjects.patch similarity index 100% rename from patches/server/0134-Non-blocking-PooledObjects.patch rename to patches/server/0135-Non-blocking-PooledObjects.patch