diff --git a/patches/server/0026-Cache-on-climbable-check.patch b/patches/server/0026-Cache-on-climbable-check.patch index 8394d13..1939b5e 100644 --- a/patches/server/0026-Cache-on-climbable-check.patch +++ b/patches/server/0026-Cache-on-climbable-check.patch @@ -31,24 +31,32 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 4ede155dc9a5f8935043f58640616c72e7898309..8fa43c612a8937b89d556c2fbfd33f6cb20225d4 100644 +index 4ede155dc9a5f8935043f58640616c72e7898309..3b3b4adc1c1a298e15c88aa115f4137742a7ab51 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1932,6 +1932,20 @@ public abstract class LivingEntity extends Entity { +@@ -143,7 +143,6 @@ import org.bukkit.event.entity.EntityTeleportEvent; + import org.bukkit.event.player.PlayerItemConsumeEvent; + // CraftBukkit end + +-import co.aikar.timings.MinecraftTimings; // Paper + + public abstract class LivingEntity extends Entity { + +@@ -1932,6 +1931,20 @@ public abstract class LivingEntity extends Entity { return this.lastClimbablePos; } + + // Gale start - Airplane - cache on climbable check -+ private boolean cachedOnClimable = false; ++ private boolean cachedOnClimbable = false; + private BlockPos lastClimbingPosition = null; + + public boolean onClimbableCached() { + if (!this.blockPosition().equals(this.lastClimbingPosition)) { -+ this.cachedOnClimable = this.onClimbable(); ++ this.cachedOnClimbable = this.onClimbable(); + this.lastClimbingPosition = this.blockPosition(); + } -+ return this.cachedOnClimable; ++ return this.cachedOnClimbable; + } + // Gale end - Airplane - cache on climbable check + diff --git a/patches/server/0044-Reduce-in-wall-checks.patch b/patches/server/0044-Reduce-in-wall-checks.patch index 35e272e..0703540 100644 --- a/patches/server/0044-Reduce-in-wall-checks.patch +++ b/patches/server/0044-Reduce-in-wall-checks.patch @@ -28,10 +28,10 @@ but is so much cheaper than the suffocation check that it's worth keeping it. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 8fa43c612a8937b89d556c2fbfd33f6cb20225d4..b3bac6c7366c27a2c31e13118a51123daab92d75 100644 +index 3b3b4adc1c1a298e15c88aa115f4137742a7ab51..c7b8c58a67a4e6f4a98730c7ef9f62072b788bc3 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -401,7 +401,10 @@ public abstract class LivingEntity extends Entity { +@@ -400,7 +400,10 @@ public abstract class LivingEntity extends Entity { boolean flag = this instanceof net.minecraft.world.entity.player.Player; if (!this.level.isClientSide) { @@ -43,7 +43,7 @@ index 8fa43c612a8937b89d556c2fbfd33f6cb20225d4..b3bac6c7366c27a2c31e13118a51123d this.hurt(DamageSource.IN_WALL, 1.0F); } else if (flag && !this.level.getWorldBorder().isWithinBounds(this.getBoundingBox())) { double d0 = this.level.getWorldBorder().getDistanceToBorder(this) + this.level.getWorldBorder().getDamageSafeZone(); -@@ -1325,6 +1328,15 @@ public abstract class LivingEntity extends Entity { +@@ -1324,6 +1327,15 @@ public abstract class LivingEntity extends Entity { return this.getHealth() <= 0.0F; } diff --git a/patches/server/0073-Reduce-array-allocations.patch b/patches/server/0073-Reduce-array-allocations.patch index 21c4cd6..d8d55ce 100644 --- a/patches/server/0073-Reduce-array-allocations.patch +++ b/patches/server/0073-Reduce-array-allocations.patch @@ -697,10 +697,10 @@ index 97ff19efa0b3943ccb7a6e02cba6ed2fea61adac..b2ae2bd8bd4ff3cb6457e8c08172e348 private EquipmentSlot(EquipmentSlot.Type type, int entityId, int armorStandId, String name) { this.type = type; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index b3bac6c7366c27a2c31e13118a51123daab92d75..c60cabeff2058663ba05d6c41ff80756b43355a4 100644 +index c7b8c58a67a4e6f4a98730c7ef9f62072b788bc3..ffbf128d95a8e19758559cc03bb4beb2b3da038c 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3103,7 +3103,7 @@ public abstract class LivingEntity extends Entity { +@@ -3102,7 +3102,7 @@ public abstract class LivingEntity extends Entity { @Nullable private Map collectEquipmentChanges() { Map map = null; diff --git a/patches/server/0087-Check-frozen-ticks-before-landing-block.patch b/patches/server/0087-Check-frozen-ticks-before-landing-block.patch index 81c13be..ed1d344 100644 --- a/patches/server/0087-Check-frozen-ticks-before-landing-block.patch +++ b/patches/server/0087-Check-frozen-ticks-before-landing-block.patch @@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index c60cabeff2058663ba05d6c41ff80756b43355a4..7a228425a973122de3d0b0e78d18586d6669e9ed 100644 +index ffbf128d95a8e19758559cc03bb4beb2b3da038c..a843f98ac406e364b75a85ef2077aad87ad162d4 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -572,11 +572,10 @@ public abstract class LivingEntity extends Entity { +@@ -571,11 +571,10 @@ public abstract class LivingEntity extends Entity { } protected void tryAddFrost() { @@ -29,7 +29,7 @@ index c60cabeff2058663ba05d6c41ff80756b43355a4..7a228425a973122de3d0b0e78d18586d if (attributemodifiable == null) { return; -@@ -586,7 +585,6 @@ public abstract class LivingEntity extends Entity { +@@ -585,7 +584,6 @@ public abstract class LivingEntity extends Entity { attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADDITION)); } diff --git a/patches/server/0101-Ignore-durability-change-equipment-updates.patch b/patches/server/0101-Ignore-durability-change-equipment-updates.patch index 9804fad..da7ffe1 100644 --- a/patches/server/0101-Ignore-durability-change-equipment-updates.patch +++ b/patches/server/0101-Ignore-durability-change-equipment-updates.patch @@ -13,10 +13,10 @@ As part of: Slice (https://github.com/Cryptite/Slice) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 7a228425a973122de3d0b0e78d18586d6669e9ed..c6488bf509178c54ac95665f96a11cfced87cd34 100644 +index a843f98ac406e364b75a85ef2077aad87ad162d4..b82786fa3ec2c42ed9f210548a15a551557466f8 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3148,7 +3148,7 @@ public abstract class LivingEntity extends Entity { +@@ -3147,7 +3147,7 @@ public abstract class LivingEntity extends Entity { } public boolean equipmentHasChanged(ItemStack stack, ItemStack stack2) { diff --git a/patches/server/0115-Don-t-load-chunks-to-activate-climbing-entities.patch b/patches/server/0115-Don-t-load-chunks-to-activate-climbing-entities.patch new file mode 100644 index 0000000..be530df --- /dev/null +++ b/patches/server/0115-Don-t-load-chunks-to-activate-climbing-entities.patch @@ -0,0 +1,103 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martijn Muijsers +Date: Sun, 25 Dec 2022 19:39:38 +0100 +Subject: [PATCH] Don't load chunks to activate climbing entities + +License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html) +Gale - https://galemc.org + +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 2929669ae099482185f1abef60c569bf00b0597f..ce33630238ccd5cccaccc1e44f8077fff79550a8 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -4304,6 +4304,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + return this.feetBlockState; + } + ++ // Gale start - don't load chunks to activate climbing entities ++ public @Nullable BlockState getFeetBlockStateIfLoaded() { ++ if (this.feetBlockState == null) { ++ this.feetBlockState = this.level.getBlockStateIfLoaded(this.blockPosition()); ++ } ++ ++ return this.feetBlockState; ++ } ++ // Gale end - don't load chunks to activate climbing entities ++ + public ChunkPos chunkPosition() { + return this.chunkPosition; + } +diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java +index b82786fa3ec2c42ed9f210548a15a551557466f8..717c677a69603809f377d37f4d3c37f71c09ab26 100644 +--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java ++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +@@ -1948,19 +1948,43 @@ public abstract class LivingEntity extends Entity { + + public boolean onClimbableCached() { + if (!this.blockPosition().equals(this.lastClimbingPosition)) { +- this.cachedOnClimbable = this.onClimbable(); +- this.lastClimbingPosition = this.blockPosition(); ++ // Gale start - don't load chunks to activate climbing entities ++ Boolean onClimbableIfLoaded = this.onClimbable(this.level.galeConfig().smallOptimizations.loadChunks.toActivateClimbingEntities); ++ if (onClimbableIfLoaded != null) { ++ this.cachedOnClimbable = onClimbableIfLoaded; ++ this.lastClimbingPosition = this.blockPosition(); ++ } else { ++ this.cachedOnClimbable = false; ++ this.lastClimbingPosition = null; ++ } ++ // Gale end - don't load chunks to activate climbing entities + } + return this.cachedOnClimbable; + } + // Gale end - Airplane - cache on climbable check + + public boolean onClimbable() { ++ // Gale start - don't load chunks to activate climbing entities ++ return onClimbable(true); ++ } ++ ++ public Boolean onClimbable(boolean loadChunk) { ++ // Gale end - don't load chunks to activate climbing entities + if (this.isSpectator()) { + return false; + } else { + BlockPos blockposition = this.blockPosition(); +- BlockState iblockdata = this.getFeetBlockState(); ++ // Gale start - don't load chunks to activate climbing entities ++ BlockState iblockdata; ++ if (loadChunk) { ++ iblockdata = this.getFeetBlockState(); ++ } else { ++ iblockdata = this.getFeetBlockStateIfLoaded(); ++ if (iblockdata == null) { ++ return null; ++ } ++ } ++ // Gale end - don't load chunks to activate climbing entities + + if (iblockdata.is(BlockTags.CLIMBABLE)) { + this.lastClimbablePos = Optional.of(blockposition); +diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +index 5b5fb89408b201bc3f73cf3dd80a5f8856b48b68..4a338bbc038f70368adc1eb85c0c94312186cd80 100644 +--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java ++++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +@@ -273,6 +273,18 @@ public class GaleWorldConfiguration extends ConfigurationPart { + public boolean toSpawnPhantoms = false; + // Gale end - MultiPaper - don't load chunks to spawn phantoms + ++ // Gale start - don't load chunks to activate climbing entities ++ /** ++ * Whether to load chunks to check whether entities are on a climbable block. If false, ++ * entities in unloaded chunks will be assumed to not be on a climbable block. ++ *
    ++ *
  • Default: false
  • ++ *
  • Vanilla: true
  • ++ *
++ */ ++ public boolean toActivateClimbingEntities = false; ++ // Gale end - don't load chunks to activate climbing entities ++ + } + + } diff --git a/patches/server/0115-Prevent-entities-random-strolling-into-non-ticking-c.patch b/patches/server/0116-Prevent-entities-random-strolling-into-non-ticking-c.patch similarity index 94% rename from patches/server/0115-Prevent-entities-random-strolling-into-non-ticking-c.patch rename to patches/server/0116-Prevent-entities-random-strolling-into-non-ticking-c.patch index 781f73d..295fe28 100644 --- a/patches/server/0115-Prevent-entities-random-strolling-into-non-ticking-c.patch +++ b/patches/server/0116-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 5b5fb89408b201bc3f73cf3dd80a5f8856b48b68..c68f384067059bb5ab92a268daffa3e406123cd7 100644 +index 4a338bbc038f70368adc1eb85c0c94312186cd80..cf9ed5ceac35ec20dc653fbe65f28d839fe04b71 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java -@@ -281,6 +281,7 @@ public class GaleWorldConfiguration extends ConfigurationPart { +@@ -293,6 +293,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/0116-CraftBukkit-UUID-to-world-map.patch b/patches/server/0117-CraftBukkit-UUID-to-world-map.patch similarity index 100% rename from patches/server/0116-CraftBukkit-UUID-to-world-map.patch rename to patches/server/0117-CraftBukkit-UUID-to-world-map.patch diff --git a/patches/server/0117-Don-t-double-save-stored-user-lists.patch b/patches/server/0118-Don-t-double-save-stored-user-lists.patch similarity index 100% rename from patches/server/0117-Don-t-double-save-stored-user-lists.patch rename to patches/server/0118-Don-t-double-save-stored-user-lists.patch diff --git a/patches/server/0118-Specific-interval-TPS-API.patch b/patches/server/0119-Specific-interval-TPS-API.patch similarity index 100% rename from patches/server/0118-Specific-interval-TPS-API.patch rename to patches/server/0119-Specific-interval-TPS-API.patch diff --git a/patches/server/0119-5-second-TPS-average.patch b/patches/server/0120-5-second-TPS-average.patch similarity index 100% rename from patches/server/0119-5-second-TPS-average.patch rename to patches/server/0120-5-second-TPS-average.patch diff --git a/patches/server/0120-Measure-last-tick-time.patch b/patches/server/0121-Measure-last-tick-time.patch similarity index 100% rename from patches/server/0120-Measure-last-tick-time.patch rename to patches/server/0121-Measure-last-tick-time.patch diff --git a/patches/server/0121-Last-tick-time-API.patch b/patches/server/0122-Last-tick-time-API.patch similarity index 100% rename from patches/server/0121-Last-tick-time-API.patch rename to patches/server/0122-Last-tick-time-API.patch diff --git a/patches/server/0122-Show-last-tick-time-in-tps-command.patch b/patches/server/0123-Show-last-tick-time-in-tps-command.patch similarity index 100% rename from patches/server/0122-Show-last-tick-time-in-tps-command.patch rename to patches/server/0123-Show-last-tick-time-in-tps-command.patch diff --git a/patches/server/0123-Increase-time-statistics-in-intervals.patch b/patches/server/0124-Increase-time-statistics-in-intervals.patch similarity index 100% rename from patches/server/0123-Increase-time-statistics-in-intervals.patch rename to patches/server/0124-Increase-time-statistics-in-intervals.patch diff --git a/patches/server/0124-For-collision-check-has-physics-before-same-vehicle.patch b/patches/server/0125-For-collision-check-has-physics-before-same-vehicle.patch similarity index 94% rename from patches/server/0124-For-collision-check-has-physics-before-same-vehicle.patch rename to patches/server/0125-For-collision-check-has-physics-before-same-vehicle.patch index 8df69cf..3b2731d 100644 --- a/patches/server/0124-For-collision-check-has-physics-before-same-vehicle.patch +++ b/patches/server/0125-For-collision-check-has-physics-before-same-vehicle.patch @@ -16,7 +16,7 @@ As part of: Akarin (https://github.com/Akarin-project/Akarin) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2929669ae099482185f1abef60c569bf00b0597f..26f06bf9b738938f47eb5707d843eec66d0edb3b 100644 +index ce33630238ccd5cccaccc1e44f8077fff79550a8..c2262201f66904036082a417a0c969bc3662747b 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1983,8 +1983,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { diff --git a/patches/server/0125-Skip-negligible-planar-movement-multiplication.patch b/patches/server/0126-Skip-negligible-planar-movement-multiplication.patch similarity index 94% rename from patches/server/0125-Skip-negligible-planar-movement-multiplication.patch rename to patches/server/0126-Skip-negligible-planar-movement-multiplication.patch index 5b2b465..b487b7b 100644 --- a/patches/server/0125-Skip-negligible-planar-movement-multiplication.patch +++ b/patches/server/0126-Skip-negligible-planar-movement-multiplication.patch @@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Gale - https://galemc.org diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 26f06bf9b738938f47eb5707d843eec66d0edb3b..271f818e2aff1e7527aad9417be848f2cfb89da6 100644 +index c2262201f66904036082a417a0c969bc3662747b..bf436193595e49e704857c4e817f53b56a763e3f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1187,9 +1187,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { diff --git a/patches/server/0126-Reduce-RandomSource-instances.patch b/patches/server/0127-Reduce-RandomSource-instances.patch similarity index 100% rename from patches/server/0126-Reduce-RandomSource-instances.patch rename to patches/server/0127-Reduce-RandomSource-instances.patch diff --git a/patches/server/0127-Server-thread-priority-environment-variable.patch b/patches/server/0128-Server-thread-priority-environment-variable.patch similarity index 100% rename from patches/server/0127-Server-thread-priority-environment-variable.patch rename to patches/server/0128-Server-thread-priority-environment-variable.patch diff --git a/patches/server/0128-Thread-safety-annotations.patch b/patches/server/0129-Thread-safety-annotations.patch similarity index 100% rename from patches/server/0128-Thread-safety-annotations.patch rename to patches/server/0129-Thread-safety-annotations.patch diff --git a/patches/server/0129-CPU-cores-estimation.patch b/patches/server/0130-CPU-cores-estimation.patch similarity index 100% rename from patches/server/0129-CPU-cores-estimation.patch rename to patches/server/0130-CPU-cores-estimation.patch diff --git a/patches/server/0130-Mutex-utility.patch b/patches/server/0131-Mutex-utility.patch similarity index 100% rename from patches/server/0130-Mutex-utility.patch rename to patches/server/0131-Mutex-utility.patch diff --git a/patches/server/0131-Paired-lock-and-condition-utility.patch b/patches/server/0132-Paired-lock-and-condition-utility.patch similarity index 100% rename from patches/server/0131-Paired-lock-and-condition-utility.patch rename to patches/server/0132-Paired-lock-and-condition-utility.patch diff --git a/patches/server/0132-Unterminable-executor-utility.patch b/patches/server/0133-Unterminable-executor-utility.patch similarity index 100% rename from patches/server/0132-Unterminable-executor-utility.patch rename to patches/server/0133-Unterminable-executor-utility.patch diff --git a/patches/server/0133-FIFO-concurrent-queue-utility.patch b/patches/server/0134-FIFO-concurrent-queue-utility.patch similarity index 100% rename from patches/server/0133-FIFO-concurrent-queue-utility.patch rename to patches/server/0134-FIFO-concurrent-queue-utility.patch diff --git a/patches/server/0134-Base-thread-pools.patch b/patches/server/0135-Base-thread-pools.patch similarity index 100% rename from patches/server/0134-Base-thread-pools.patch rename to patches/server/0135-Base-thread-pools.patch diff --git a/patches/server/0135-Non-blocking-PooledObjects.patch b/patches/server/0136-Non-blocking-PooledObjects.patch similarity index 100% rename from patches/server/0135-Non-blocking-PooledObjects.patch rename to patches/server/0136-Non-blocking-PooledObjects.patch