diff --git a/patches/removed/server/0023-Optimize-random-calls-in-chunk-ticking.patch b/patches/server/0017-Optimize-random-calls-in-chunk-ticking.patch similarity index 63% rename from patches/removed/server/0023-Optimize-random-calls-in-chunk-ticking.patch rename to patches/server/0017-Optimize-random-calls-in-chunk-ticking.patch index 80b69a7..8a5b1c7 100644 --- a/patches/removed/server/0023-Optimize-random-calls-in-chunk-ticking.patch +++ b/patches/server/0017-Optimize-random-calls-in-chunk-ticking.patch @@ -3,8 +3,6 @@ From: Martijn Muijsers Date: Wed, 23 Nov 2022 16:45:45 +0100 Subject: [PATCH] Optimize random calls in chunk ticking -Removed since 1.21 - License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Gale - https://galemc.org @@ -53,31 +51,11 @@ GNU General Public License for more details. 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/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index ccd6a21e502bfd25a0a84fdf1b6d6f2606cf7156..4c4f4d862b898837e498486ae9e710891158702e 100644 ---- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java -+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -430,6 +430,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - } - } - -+ this.level.resetIceAndSnowTick(); // Gale - Airplane - optimize random calls in chunk ticking - reset ice & snow tick random - if (this.level.tickRateManager().runsNormally()) { - this.level.timings.countNaturalMobs.startTiming(); // Paper - timings - int k = this.distanceManager.getNaturalSpawnChunkCount(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index f027997cb227bbadf6000ddb236fa6622304216d..c7c83e99d0683ef6d057e56d1adc6d68424329a2 100644 +index 7aa13de4b3778e6708ed46ddcedde100f585a40f..2df8f9f7c631f7c4a67cfcaf218de1d29448d489 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -858,13 +858,15 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - } - // Paper end - optimise random ticking - -+ private int currentIceAndSnowTick = 0; protected void resetIceAndSnowTick() { this.currentIceAndSnowTick = this.random.nextInt(16); } // Gale - Airplane - optimize random calls in chunk ticking -+ - public void tickChunk(LevelChunk chunk, int randomTickSpeed) { - ChunkPos chunkcoordintpair = chunk.getPos(); - boolean flag = this.isRaining(); +@@ -840,7 +840,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. int j = chunkcoordintpair.getMinBlockX(); int k = chunkcoordintpair.getMinBlockZ(); @@ -86,17 +64,8 @@ index f027997cb227bbadf6000ddb236fa6622304216d..c7c83e99d0683ef6d057e56d1adc6d68 BlockPos blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15)); if (this.isRainingAt(blockposition)) { -@@ -892,7 +894,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. - } - } - -- if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow -+ if (!this.paperConfig().environment.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Option to disable ice and snow // Gale - Airplane - optimize random calls in chunk ticking - optimize further random ticking - for (int l = 0; l < randomTickSpeed; ++l) { - if (this.random.nextInt(48) == 0) { - this.tickPrecipitation(this.getBlockRandomPos(j, 0, k, 15)); diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index b07763aa7b3b92e24891b4ba346334ba8984ed67..4d04efcc4c902c1c108d142b9486d080aff7cd44 100644 +index 36540053590c30a902b9986dcf2e74375157822d..f23ed06a943646f45e1291f35ab3025e1dfa6b49 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -85,6 +85,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p @@ -118,11 +87,12 @@ index b07763aa7b3b92e24891b4ba346334ba8984ed67..4d04efcc4c902c1c108d142b9486d080 public LevelChunk(Level world, ChunkPos pos) { this(world, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, (LevelChunkSection[]) null, (LevelChunk.PostLoadProcessor) null, (BlendingData) null); } -@@ -108,6 +120,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p - this.postLoad = entityLoader; - this.blockTicks = blockTickScheduler; - this.fluidTicks = fluidTickScheduler; -+ this.lightningTick = this.level.random.nextInt(100000) << 1; // Gale - Airplane - optimize random calls in chunk ticking - initialize lightning tick - // Paper start - get block chunk optimisation - this.minSection = ca.spottedleaf.moonrise.common.util.WorldUtil.getMinSection(level); - this.maxSection = ca.spottedleaf.moonrise.common.util.WorldUtil.getMaxSection(level); +@@ -116,6 +128,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p + this.debug = !empty && this.level.isDebug(); + this.defaultBlockState = empty ? VOID_AIR_BLOCKSTATE : AIR_BLOCKSTATE; + // Paper end - get block chunk optimisation ++ ++ this.lightningTick = new java.util.Random().nextInt(100000) << 1; // Gale - Airplane - optimize random calls in chunk ticking - initialize lightning tick + } + + // CraftBukkit start diff --git a/patches/server/0017-Reduce-enderman-teleport-chunk-lookups.patch b/patches/server/0018-Reduce-enderman-teleport-chunk-lookups.patch similarity index 100% rename from patches/server/0017-Reduce-enderman-teleport-chunk-lookups.patch rename to patches/server/0018-Reduce-enderman-teleport-chunk-lookups.patch diff --git a/patches/server/0018-Reduce-acquire-POI-for-stuck-entities.patch b/patches/server/0019-Reduce-acquire-POI-for-stuck-entities.patch similarity index 100% rename from patches/server/0018-Reduce-acquire-POI-for-stuck-entities.patch rename to patches/server/0019-Reduce-acquire-POI-for-stuck-entities.patch diff --git a/patches/server/0019-Remove-iterators-from-Inventory-contains.patch b/patches/server/0020-Remove-iterators-from-Inventory-contains.patch similarity index 100% rename from patches/server/0019-Remove-iterators-from-Inventory-contains.patch rename to patches/server/0020-Remove-iterators-from-Inventory-contains.patch diff --git a/patches/server/0020-Check-targeting-range-before-getting-visibility.patch b/patches/server/0021-Check-targeting-range-before-getting-visibility.patch similarity index 100% rename from patches/server/0020-Check-targeting-range-before-getting-visibility.patch rename to patches/server/0021-Check-targeting-range-before-getting-visibility.patch diff --git a/patches/server/0021-Print-stack-trace-for-plugins-not-shutting-down-task.patch b/patches/server/0022-Print-stack-trace-for-plugins-not-shutting-down-task.patch similarity index 100% rename from patches/server/0021-Print-stack-trace-for-plugins-not-shutting-down-task.patch rename to patches/server/0022-Print-stack-trace-for-plugins-not-shutting-down-task.patch diff --git a/patches/server/0022-Improve-fluid-direction-caching.patch b/patches/server/0023-Improve-fluid-direction-caching.patch similarity index 100% rename from patches/server/0022-Improve-fluid-direction-caching.patch rename to patches/server/0023-Improve-fluid-direction-caching.patch diff --git a/patches/server/0023-Cache-on-climbable-check.patch b/patches/server/0024-Cache-on-climbable-check.patch similarity index 100% rename from patches/server/0023-Cache-on-climbable-check.patch rename to patches/server/0024-Cache-on-climbable-check.patch diff --git a/patches/server/0024-Make-EntityCollisionContext-a-live-representation.patch b/patches/server/0025-Make-EntityCollisionContext-a-live-representation.patch similarity index 100% rename from patches/server/0024-Make-EntityCollisionContext-a-live-representation.patch rename to patches/server/0025-Make-EntityCollisionContext-a-live-representation.patch diff --git a/patches/server/0025-Improve-container-checking-with-a-bitset.patch b/patches/server/0026-Improve-container-checking-with-a-bitset.patch similarity index 100% rename from patches/server/0025-Improve-container-checking-with-a-bitset.patch rename to patches/server/0026-Improve-container-checking-with-a-bitset.patch diff --git a/patches/server/0026-Better-checking-for-useless-move-packets.patch b/patches/server/0027-Better-checking-for-useless-move-packets.patch similarity index 100% rename from patches/server/0026-Better-checking-for-useless-move-packets.patch rename to patches/server/0027-Better-checking-for-useless-move-packets.patch diff --git a/patches/server/0027-Inline-level-height.patch b/patches/server/0028-Inline-level-height.patch similarity index 100% rename from patches/server/0027-Inline-level-height.patch rename to patches/server/0028-Inline-level-height.patch diff --git a/patches/server/0028-Remove-streams-and-iterators-from-range-check.patch b/patches/server/0029-Remove-streams-and-iterators-from-range-check.patch similarity index 100% rename from patches/server/0028-Remove-streams-and-iterators-from-range-check.patch rename to patches/server/0029-Remove-streams-and-iterators-from-range-check.patch diff --git a/patches/server/0029-Block-goal-does-not-load-chunks.patch b/patches/server/0030-Block-goal-does-not-load-chunks.patch similarity index 100% rename from patches/server/0029-Block-goal-does-not-load-chunks.patch rename to patches/server/0030-Block-goal-does-not-load-chunks.patch diff --git a/patches/server/0030-Reduce-entity-allocations.patch b/patches/server/0031-Reduce-entity-allocations.patch similarity index 100% rename from patches/server/0030-Reduce-entity-allocations.patch rename to patches/server/0031-Reduce-entity-allocations.patch diff --git a/patches/server/0031-Remove-lambda-from-ticking-guard.patch b/patches/server/0032-Remove-lambda-from-ticking-guard.patch similarity index 98% rename from patches/server/0031-Remove-lambda-from-ticking-guard.patch rename to patches/server/0032-Remove-lambda-from-ticking-guard.patch index 1ebd265..a1b8b04 100644 --- a/patches/server/0031-Remove-lambda-from-ticking-guard.patch +++ b/patches/server/0032-Remove-lambda-from-ticking-guard.patch @@ -31,7 +31,7 @@ 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/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 7aa13de4b3778e6708ed46ddcedde100f585a40f..1f2af396b7cddbbbb9a200bc6272309941f10e5b 100644 +index 2df8f9f7c631f7c4a67cfcaf218de1d29448d489..bfefe93b1ab4facd4874210609ecbe244a4cff0d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -717,7 +717,20 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. diff --git a/patches/server/0032-Reduce-entity-fluid-lookups-if-no-fluids.patch b/patches/server/0033-Reduce-entity-fluid-lookups-if-no-fluids.patch similarity index 99% rename from patches/server/0032-Reduce-entity-fluid-lookups-if-no-fluids.patch rename to patches/server/0033-Reduce-entity-fluid-lookups-if-no-fluids.patch index 34bebbd..b176c0e 100644 --- a/patches/server/0032-Reduce-entity-fluid-lookups-if-no-fluids.patch +++ b/patches/server/0033-Reduce-entity-fluid-lookups-if-no-fluids.patch @@ -31,7 +31,7 @@ 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/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a0ed1ffbf07edeb4d7f08316855376488b99940b..dfc1f3b3097430f1553b0a0b03d7be3863d14c11 100644 +index 2d3552ed0772d7bd7777b85879c10ca83c4baf37..7349dee46483632cffa88d11694e2cd3a6fad911 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -4434,16 +4434,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0033-SIMD-support.patch b/patches/server/0034-SIMD-support.patch similarity index 100% rename from patches/server/0033-SIMD-support.patch rename to patches/server/0034-SIMD-support.patch diff --git a/patches/server/0034-Make-book-writing-configurable.patch b/patches/server/0035-Make-book-writing-configurable.patch similarity index 98% rename from patches/server/0034-Make-book-writing-configurable.patch rename to patches/server/0035-Make-book-writing-configurable.patch index 4263fe4..1c2b3ca 100644 --- a/patches/server/0034-Make-book-writing-configurable.patch +++ b/patches/server/0035-Make-book-writing-configurable.patch @@ -22,7 +22,7 @@ you to easily disable books, should you want to preemptively remove this functionality before additional exploits are found. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7796e191747be545e744564a2b0b65790f69114d..13adcb90134f03cf951c3e7eaa3123e033224df6 100644 +index 624b80c796e9c95040d71d1595d11f98e2899cf3..0563a4273f8cbb4ca9af52f6f708d43967575252 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -193,6 +193,8 @@ import net.minecraft.world.phys.Vec3; diff --git a/patches/server/0067-Optimize-sun-burn-tick.patch b/patches/server/0067-Optimize-sun-burn-tick.patch index 4a5a776..e2a435c 100644 --- a/patches/server/0067-Optimize-sun-burn-tick.patch +++ b/patches/server/0067-Optimize-sun-burn-tick.patch @@ -13,7 +13,7 @@ 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 8e79c569eb6b49382d1335ab8a247506db6afe95..8fe992f191819f828ebc5c1986572569a09d52a9 100644 +index 7349dee46483632cffa88d11694e2cd3a6fad911..93c48dd6b87d5bb7ba5a83b7c0f6c64544416bfc 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -314,7 +314,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -22,7 +22,7 @@ index 8e79c569eb6b49382d1335ab8a247506db6afe95..8fe992f191819f828ebc5c1986572569 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 BlockPos blockPosition; private ChunkPos chunkPosition; private Vec3 deltaMovement; @@ -2061,9 +2061,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess