diff --git a/patches/server/0064-Optimize-sun-burn-tick.patch b/patches/server/0064-Optimize-sun-burn-tick.patch new file mode 100644 index 0000000..170af4a --- /dev/null +++ b/patches/server/0064-Optimize-sun-burn-tick.patch @@ -0,0 +1,82 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MartijnMuijsers +Date: Wed, 30 Nov 2022 23:04:59 +0100 +Subject: [PATCH] Optimize sun burn tick + +License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) + +This patch is based on the following patch: +"some entity micro opts" +By: Simon Gardling +As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack) +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 c73f2a697bcb4a670df37879dfc3e140290325bd..2a2e66449e816494a6c52cb771c63f60220e82fc 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -290,7 +290,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + public double xo; + public double yo; + public double zo; +- private Vec3 position; ++ public Vec3 position; // Gale - JettPack - optimize sun burn tick - private -> public + public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public + private ChunkPos chunkPosition; + private Vec3 deltaMovement; +@@ -1861,9 +1861,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + /** @deprecated */ + @Deprecated + public float getLightLevelDependentMagicValue() { +- return this.level.hasChunkAt(this.getBlockX(), this.getBlockZ()) ? this.level.getLightLevelDependentMagicValue(new BlockPos(this.getX(), this.getEyeY(), this.getZ())) : 0.0F; ++ return this.level.getLightLevelDependentMagicValue(new BlockPos(this.getX(), this.getEyeY(), this.getZ())); // Gale - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue + } + ++ // Gale start - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue ++ /** @deprecated */ ++ @Deprecated ++ public float getLightLevelDependentMagicValue(BlockPos pos) { ++ return this.level.hasChunkAt(this.getBlockX(), this.getBlockZ()) ? this.level.getLightLevelDependentMagicValue(pos) : 0.0F; ++ } ++ // Gale end - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue ++ + public void absMoveTo(double x, double y, double z, float yaw, float pitch) { + this.absMoveTo(x, y, z); + this.setYRot(yaw % 360.0F); +diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java +index 6d9e63060ea43d8b19c723bb97c1c92ec3a63193..4b17ea0a27beb4c66d6915a3bd762f14a8548d92 100644 +--- a/src/main/java/net/minecraft/world/entity/Mob.java ++++ b/src/main/java/net/minecraft/world/entity/Mob.java +@@ -1641,13 +1641,29 @@ public abstract class Mob extends LivingEntity { + + } + ++ // Gale start - JettPack - optimize sun burn tick - cache eye blockpos ++ private BlockPos cached_eye_blockpos; ++ private int cached_position_hashcode; ++ // Gale end - JettPack - optimize sun burn tick - cache eye blockpos ++ + public boolean isSunBurnTick() { + if (this.level.isDay() && !this.level.isClientSide) { +- float f = this.getLightLevelDependentMagicValue(); +- BlockPos blockposition = new BlockPos(this.getX(), this.getEyeY(), this.getZ()); ++ // Gale start - JettPack - optimize sun burn tick - optimizations and cache eye blockpos ++ int positionHashCode = this.position.hashCode(); ++ if (this.cached_position_hashcode != positionHashCode) { ++ this.cached_eye_blockpos = new BlockPos(this.getX(), this.getEyeY(), this.getZ()); ++ this.cached_position_hashcode = positionHashCode; ++ } ++ ++ float f = this.getLightLevelDependentMagicValue(cached_eye_blockpos); // Pass BlockPos to getBrightness ++ ++ // Check brightness first ++ if (f <= 0.5F) return false; ++ if (this.random.nextFloat() * 30.0F >= (f - 0.4F) * 2.0F) return false; ++ // Gale end - JettPack - optimize sun burn tick - optimizations and cache eye blockpos + boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow; + +- if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && !flag && this.level.canSeeSky(blockposition)) { ++ if (!flag && this.level.canSeeSky(this.cached_eye_blockpos)) { // Gale - JettPack - optimize sun burn tick - optimizations and cache eye blockpos + return true; + } + } diff --git a/patches/server/0064-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch b/patches/server/0065-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch similarity index 100% rename from patches/server/0064-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch rename to patches/server/0065-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch diff --git a/patches/server/0065-Replace-AI-goal-set-with-optimized-collection.patch b/patches/server/0066-Replace-AI-goal-set-with-optimized-collection.patch similarity index 100% rename from patches/server/0065-Replace-AI-goal-set-with-optimized-collection.patch rename to patches/server/0066-Replace-AI-goal-set-with-optimized-collection.patch diff --git a/patches/server/0066-Replace-game-rules-map-with-optimized-collection.patch b/patches/server/0067-Replace-game-rules-map-with-optimized-collection.patch similarity index 100% rename from patches/server/0066-Replace-game-rules-map-with-optimized-collection.patch rename to patches/server/0067-Replace-game-rules-map-with-optimized-collection.patch diff --git a/patches/server/0067-Replace-AI-attributes-with-optimized-collections.patch b/patches/server/0068-Replace-AI-attributes-with-optimized-collections.patch similarity index 100% rename from patches/server/0067-Replace-AI-attributes-with-optimized-collections.patch rename to patches/server/0068-Replace-AI-attributes-with-optimized-collections.patch diff --git a/patches/server/0068-Replace-class-map-with-optimized-collection.patch b/patches/server/0069-Replace-class-map-with-optimized-collection.patch similarity index 100% rename from patches/server/0068-Replace-class-map-with-optimized-collection.patch rename to patches/server/0069-Replace-class-map-with-optimized-collection.patch diff --git a/patches/server/0069-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch b/patches/server/0070-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch similarity index 100% rename from patches/server/0069-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch rename to patches/server/0070-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch diff --git a/patches/server/0070-Cache-BlockStatePairKey-hash.patch b/patches/server/0071-Cache-BlockStatePairKey-hash.patch similarity index 100% rename from patches/server/0070-Cache-BlockStatePairKey-hash.patch rename to patches/server/0071-Cache-BlockStatePairKey-hash.patch diff --git a/patches/server/0071-Cache-CubeVoxelShape-shape-array.patch b/patches/server/0072-Cache-CubeVoxelShape-shape-array.patch similarity index 100% rename from patches/server/0071-Cache-CubeVoxelShape-shape-array.patch rename to patches/server/0072-Cache-CubeVoxelShape-shape-array.patch diff --git a/patches/server/0072-Replace-division-by-multiplication-in-CubePointRange.patch b/patches/server/0073-Replace-division-by-multiplication-in-CubePointRange.patch similarity index 100% rename from patches/server/0072-Replace-division-by-multiplication-in-CubePointRange.patch rename to patches/server/0073-Replace-division-by-multiplication-in-CubePointRange.patch diff --git a/patches/server/0073-Replace-parts-by-size-in-CubePointRange.patch b/patches/server/0074-Replace-parts-by-size-in-CubePointRange.patch similarity index 100% rename from patches/server/0073-Replace-parts-by-size-in-CubePointRange.patch rename to patches/server/0074-Replace-parts-by-size-in-CubePointRange.patch diff --git a/patches/server/0074-Check-frozen-ticks-before-landing-block.patch b/patches/server/0075-Check-frozen-ticks-before-landing-block.patch similarity index 100% rename from patches/server/0074-Check-frozen-ticks-before-landing-block.patch rename to patches/server/0075-Check-frozen-ticks-before-landing-block.patch diff --git a/patches/server/0075-Faster-chunk-serialization.patch b/patches/server/0076-Faster-chunk-serialization.patch similarity index 100% rename from patches/server/0075-Faster-chunk-serialization.patch rename to patches/server/0076-Faster-chunk-serialization.patch diff --git a/patches/server/0076-Skip-entity-move-if-movement-is-zero.patch b/patches/server/0077-Skip-entity-move-if-movement-is-zero.patch similarity index 93% rename from patches/server/0076-Skip-entity-move-if-movement-is-zero.patch rename to patches/server/0077-Skip-entity-move-if-movement-is-zero.patch index ac69f38..8c0cc43 100644 --- a/patches/server/0076-Skip-entity-move-if-movement-is-zero.patch +++ b/patches/server/0077-Skip-entity-move-if-movement-is-zero.patch @@ -12,7 +12,7 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index c73f2a697bcb4a670df37879dfc3e140290325bd..aa3b6f085e370079883d9928962bff8e9b187246 100644 +index 2a2e66449e816494a6c52cb771c63f60220e82fc..d6526c075bc82ae2d79e3e786bc469966f4cf92d 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -299,6 +299,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -35,7 +35,7 @@ index c73f2a697bcb4a670df37879dfc3e140290325bd..aa3b6f085e370079883d9928962bff8e // Paper start - detailed watchdog information io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main"); synchronized (this.posLock) { -@@ -3750,6 +3756,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3758,6 +3764,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public final void setBoundingBox(AABB boundingBox) { diff --git a/patches/server/0077-Store-mob-counts-in-an-array.patch b/patches/server/0078-Store-mob-counts-in-an-array.patch similarity index 100% rename from patches/server/0077-Store-mob-counts-in-an-array.patch rename to patches/server/0078-Store-mob-counts-in-an-array.patch diff --git a/patches/server/0078-Optimize-noise-generation.patch b/patches/server/0079-Optimize-noise-generation.patch similarity index 100% rename from patches/server/0078-Optimize-noise-generation.patch rename to patches/server/0079-Optimize-noise-generation.patch diff --git a/patches/server/0079-Ignore-durability-change-equipment-updates.patch b/patches/server/0080-Ignore-durability-change-equipment-updates.patch similarity index 100% rename from patches/server/0079-Ignore-durability-change-equipment-updates.patch rename to patches/server/0080-Ignore-durability-change-equipment-updates.patch diff --git a/patches/server/0080-Hide-flames-on-entities-with-fire-resistance.patch b/patches/server/0081-Hide-flames-on-entities-with-fire-resistance.patch similarity index 96% rename from patches/server/0080-Hide-flames-on-entities-with-fire-resistance.patch rename to patches/server/0081-Hide-flames-on-entities-with-fire-resistance.patch index 22fbbee..89b2afe 100644 --- a/patches/server/0080-Hide-flames-on-entities-with-fire-resistance.patch +++ b/patches/server/0081-Hide-flames-on-entities-with-fire-resistance.patch @@ -12,7 +12,7 @@ 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/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index aa3b6f085e370079883d9928962bff8e9b187246..f76a16b40c9d365a618797b7f7bf09938b672b87 100644 +index d6526c075bc82ae2d79e3e786bc469966f4cf92d..552198bd1a08d0967dba90104777105fafc67e35 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -869,7 +869,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { diff --git a/patches/server/0081-Skip-cloning-advancement-criteria.patch b/patches/server/0082-Skip-cloning-advancement-criteria.patch similarity index 100% rename from patches/server/0081-Skip-cloning-advancement-criteria.patch rename to patches/server/0082-Skip-cloning-advancement-criteria.patch diff --git a/patches/server/0082-Player-canSee-by-entity-UUID.patch b/patches/server/0083-Player-canSee-by-entity-UUID.patch similarity index 100% rename from patches/server/0082-Player-canSee-by-entity-UUID.patch rename to patches/server/0083-Player-canSee-by-entity-UUID.patch diff --git a/patches/server/0083-Spread-out-sending-all-player-info.patch b/patches/server/0084-Spread-out-sending-all-player-info.patch similarity index 100% rename from patches/server/0083-Spread-out-sending-all-player-info.patch rename to patches/server/0084-Spread-out-sending-all-player-info.patch diff --git a/patches/server/0084-Optimize-player-list-for-sending-player-info.patch b/patches/server/0085-Optimize-player-list-for-sending-player-info.patch similarity index 100% rename from patches/server/0084-Optimize-player-list-for-sending-player-info.patch rename to patches/server/0085-Optimize-player-list-for-sending-player-info.patch diff --git a/patches/server/0085-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch b/patches/server/0086-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch similarity index 100% rename from patches/server/0085-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch rename to patches/server/0086-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch diff --git a/patches/server/0086-Send-multiple-keep-alive-packets.patch b/patches/server/0087-Send-multiple-keep-alive-packets.patch similarity index 100% rename from patches/server/0086-Send-multiple-keep-alive-packets.patch rename to patches/server/0087-Send-multiple-keep-alive-packets.patch diff --git a/patches/server/0087-Prevent-random-strolling-into-non-ticking-chunks.patch b/patches/server/0088-Prevent-random-strolling-into-non-ticking-chunks.patch similarity index 100% rename from patches/server/0087-Prevent-random-strolling-into-non-ticking-chunks.patch rename to patches/server/0088-Prevent-random-strolling-into-non-ticking-chunks.patch diff --git a/patches/server/0088-Specific-interval-TPS-API.patch b/patches/server/0089-Specific-interval-TPS-API.patch similarity index 100% rename from patches/server/0088-Specific-interval-TPS-API.patch rename to patches/server/0089-Specific-interval-TPS-API.patch diff --git a/patches/server/0089-5-second-TPS-average.patch b/patches/server/0090-5-second-TPS-average.patch similarity index 100% rename from patches/server/0089-5-second-TPS-average.patch rename to patches/server/0090-5-second-TPS-average.patch diff --git a/patches/server/0090-Measure-last-tick-time.patch b/patches/server/0091-Measure-last-tick-time.patch similarity index 100% rename from patches/server/0090-Measure-last-tick-time.patch rename to patches/server/0091-Measure-last-tick-time.patch diff --git a/patches/server/0091-Last-tick-time-API.patch b/patches/server/0092-Last-tick-time-API.patch similarity index 100% rename from patches/server/0091-Last-tick-time-API.patch rename to patches/server/0092-Last-tick-time-API.patch diff --git a/patches/server/0092-Show-last-tick-time-in-tps-command.patch b/patches/server/0093-Show-last-tick-time-in-tps-command.patch similarity index 100% rename from patches/server/0092-Show-last-tick-time-in-tps-command.patch rename to patches/server/0093-Show-last-tick-time-in-tps-command.patch diff --git a/patches/server/0093-Increase-time-statistics-in-intervals.patch b/patches/server/0094-Increase-time-statistics-in-intervals.patch similarity index 100% rename from patches/server/0093-Increase-time-statistics-in-intervals.patch rename to patches/server/0094-Increase-time-statistics-in-intervals.patch diff --git a/patches/server/0094-For-collision-check-has-physics-before-same-vehicle.patch b/patches/server/0095-For-collision-check-has-physics-before-same-vehicle.patch similarity index 90% rename from patches/server/0094-For-collision-check-has-physics-before-same-vehicle.patch rename to patches/server/0095-For-collision-check-has-physics-before-same-vehicle.patch index 9746144..d411dbd 100644 --- a/patches/server/0094-For-collision-check-has-physics-before-same-vehicle.patch +++ b/patches/server/0095-For-collision-check-has-physics-before-same-vehicle.patch @@ -15,10 +15,10 @@ 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 f76a16b40c9d365a618797b7f7bf09938b672b87..b4fc491db95b4d6a7db74f2da6dcbf853e820b88 100644 +index 552198bd1a08d0967dba90104777105fafc67e35..f6b9c9c55effdc169d8226308b3163bc5c54b3ed 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1970,8 +1970,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1978,8 +1978,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { public void playerTouch(Player player) {} public void push(Entity entity) { diff --git a/patches/server/0095-Variable-main-thread-task-delay.patch b/patches/server/0096-Variable-main-thread-task-delay.patch similarity index 100% rename from patches/server/0095-Variable-main-thread-task-delay.patch rename to patches/server/0096-Variable-main-thread-task-delay.patch diff --git a/patches/server/0096-Reduce-RandomSource-instances.patch b/patches/server/0097-Reduce-RandomSource-instances.patch similarity index 100% rename from patches/server/0096-Reduce-RandomSource-instances.patch rename to patches/server/0097-Reduce-RandomSource-instances.patch diff --git a/patches/server/0097-CPU-cores-estimation.patch b/patches/server/0098-CPU-cores-estimation.patch similarity index 100% rename from patches/server/0097-CPU-cores-estimation.patch rename to patches/server/0098-CPU-cores-estimation.patch diff --git a/patches/server/0098-Add-centralized-AsyncExecutor.patch b/patches/server/0099-Add-centralized-AsyncExecutor.patch similarity index 100% rename from patches/server/0098-Add-centralized-AsyncExecutor.patch rename to patches/server/0099-Add-centralized-AsyncExecutor.patch diff --git a/patches/server/0099-Remove-Paper-async-executor.patch b/patches/server/0100-Remove-Paper-async-executor.patch similarity index 100% rename from patches/server/0099-Remove-Paper-async-executor.patch rename to patches/server/0100-Remove-Paper-async-executor.patch diff --git a/patches/server/0100-Remove-Paper-cleaner-executor.patch b/patches/server/0101-Remove-Paper-cleaner-executor.patch similarity index 100% rename from patches/server/0100-Remove-Paper-cleaner-executor.patch rename to patches/server/0101-Remove-Paper-cleaner-executor.patch diff --git a/patches/server/0101-Remove-background-executor.patch b/patches/server/0102-Remove-background-executor.patch similarity index 100% rename from patches/server/0101-Remove-background-executor.patch rename to patches/server/0102-Remove-background-executor.patch diff --git a/patches/server/0102-Remove-bootstrap-executor.patch b/patches/server/0103-Remove-bootstrap-executor.patch similarity index 100% rename from patches/server/0102-Remove-bootstrap-executor.patch rename to patches/server/0103-Remove-bootstrap-executor.patch diff --git a/patches/server/0103-Remove-world-upgrade-executors.patch b/patches/server/0104-Remove-world-upgrade-executors.patch similarity index 100% rename from patches/server/0103-Remove-world-upgrade-executors.patch rename to patches/server/0104-Remove-world-upgrade-executors.patch diff --git a/patches/server/0104-Remove-tab-complete-executor.patch b/patches/server/0105-Remove-tab-complete-executor.patch similarity index 100% rename from patches/server/0104-Remove-tab-complete-executor.patch rename to patches/server/0105-Remove-tab-complete-executor.patch diff --git a/patches/server/0105-Remove-text-filter-executor.patch b/patches/server/0106-Remove-text-filter-executor.patch similarity index 100% rename from patches/server/0105-Remove-text-filter-executor.patch rename to patches/server/0106-Remove-text-filter-executor.patch