From 3fe0e32495a0a95a92a203321a3f414e9bb5a55f Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 8 Jun 2023 14:13:43 -0700 Subject: [PATCH] more compile fixes --- patches/server/0019-Rewrite-chunk-system.patch | 12 ++++++------ ...0034-Prevent-tile-entity-and-entity-crashes.patch | 2 +- .../server/0060-Add-exception-reporting-event.patch | 2 +- ...isInWorldBounds-and-getBlockState-for-inlin.patch | 2 +- .../0079-Configurable-Chunk-Inhabited-Time.patch | 2 +- .../0170-PlayerNaturallySpawnCreaturesEvent.patch | 2 +- ...40-implement-optional-per-player-mob-spawns.patch | 2 +- ...Optimise-getChunkAt-calls-for-loaded-chunks.patch | 2 +- .../server/0344-Add-debug-for-sync-chunk-loads.patch | 2 +- patches/server/0354-Optimise-Chunk-getFluid.patch | 2 +- patches/server/0368-Improved-Watchdog-Support.patch | 2 +- ...te-stacktraces-in-log-messages-crash-report.patch | 2 +- .../0422-incremental-chunk-and-player-saving.patch | 2 +- ...d-config-for-mobs-immune-to-default-effects.patch | 4 ++-- ...anyPlayerCloseEnoughForSpawning-to-use-dist.patch | 2 +- .../server/0686-Optimise-chunk-tick-iteration.patch | 2 +- .../server/0687-Execute-chunk-tasks-mid-tick.patch | 2 +- ...date-flush-calls-for-entity-tracker-packets.patch | 2 +- .../server/0706-Optimise-nearby-player-lookups.patch | 2 +- patches/server/0778-Implement-regenerateChunk.patch | 9 ++++----- .../0790-Force-close-world-loading-screen.patch | 4 ++-- .../0791-Fix-falling-block-spawn-methods.patch | 6 +++--- ...x-new-block-data-for-EntityChangeBlockEvent.patch | 2 +- ...ame-instead-of-display-name-in-PlayerList-g.patch | 2 +- ...814-Pass-ServerLevel-for-gamerule-callbacks.patch | 6 +++--- ...52-Warn-on-plugins-accessing-faraway-chunks.patch | 12 ++++++------ patches/server/0910-Properly-resend-entities.patch | 2 +- ...se-single-player-info-update-packet-on-join.patch | 2 +- 28 files changed, 47 insertions(+), 48 deletions(-) diff --git a/patches/server/0019-Rewrite-chunk-system.patch b/patches/server/0019-Rewrite-chunk-system.patch index 94fb3c4528..447c231cb7 100644 --- a/patches/server/0019-Rewrite-chunk-system.patch +++ b/patches/server/0019-Rewrite-chunk-system.patch @@ -9941,7 +9941,7 @@ index 0000000000000000000000000000000000000000..39411cc2e4af6edf767cc06bbca8335b +} diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkUpgradeGenericStatusTask.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkUpgradeGenericStatusTask.java new file mode 100644 -index 0000000000000000000000000000000000000000..ecc366a4176b2efadc46aa91aa21621f0fc6abe9 +index 0000000000000000000000000000000000000000..e929d55fdb6fad6587af058dff6cadb6bc2a156b --- /dev/null +++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkUpgradeGenericStatusTask.java @@ -0,0 +1,212 @@ @@ -10031,7 +10031,7 @@ index 0000000000000000000000000000000000000000..ecc366a4176b2efadc46aa91aa21621f + return; + } + completeFuture = this.toStatus.generate(Runnable::run, this.world, chunkMap.generator, chunkMap.structureTemplateManager, -+ serverChunkCache.getLightEngine(), null, this.neighbours, false) ++ serverChunkCache.getLightEngine(), null, this.neighbours) + .whenComplete((final Either either, final Throwable throwable) -> { + final ChunkAccess newChunk = (either == null) ? null : either.left().orElse(null); + if (newChunk instanceof ProtoChunk) { @@ -17566,7 +17566,7 @@ index f3c9a3dbb6f0e6f825b7477c89ed72ed52845419..20d600d29c2f2e47c798721d1f151e62 + */ // Paper - rewrite chunk system } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 6d5a160a9fdaa04bb930afae8a0765910f631d23..a558e9a364a13fc2e81b73fa00cc0eff59eacb9a 100644 +index 6d5a160a9fdaa04bb930afae8a0765910f631d23..5c97b0069d20815c2a1d61bf34596a8a928d8940 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -367,7 +367,7 @@ public class ServerChunkCache extends ChunkSource { @@ -17700,7 +17700,7 @@ index 6d5a160a9fdaa04bb930afae8a0765910f631d23..a558e9a364a13fc2e81b73fa00cc0eff - throw (IllegalStateException) Util.pauseInIde(new IllegalStateException("No chunk holder after ticket has been added")); - } - } -+ boolean needsFullScheduling = leastStatus == ChunkStatus.FULL && (chunkHolder == null || !chunkHolder.getChunkStatus().isOrAfter(ChunkHolder.FullChunkStatus.BORDER)); ++ boolean needsFullScheduling = leastStatus == ChunkStatus.FULL && (chunkHolder == null || !chunkHolder.getChunkStatus().isOrAfter(FullChunkStatus.FULL)); + + if ((chunkHolder == null || chunkHolder.getTicketLevel() > minLevel || needsFullScheduling) && !create) { + return ChunkHolder.UNLOADED_CHUNK_FUTURE; @@ -19380,7 +19380,7 @@ index fb5a06a908d2b42bf0530b62ed648548499d9f87..ec55711e912fe6cb8f797c0b21bcef27 public int getIndex() { 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 09999a3f523ce6d652799215d3418284a69042c1..3da04db71d6f33b2f466c11e031e0a11c298379b 100644 +index 09999a3f523ce6d652799215d3418284a69042c1..a0c88a15be577d552e61bfa923a6e566b1cfcc49 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -661,9 +661,26 @@ public class LevelChunk extends ChunkAccess { @@ -19554,7 +19554,7 @@ index 09999a3f523ce6d652799215d3418284a69042c1..3da04db71d6f33b2f466c11e031e0a11 public FullChunkStatus getFullStatus() { - return this.fullStatus == null ? FullChunkStatus.FULL : (FullChunkStatus) this.fullStatus.get(); -+ return this.chunkHolder == null ? FullChunkStaatus.INACCESSIBLE : this.chunkHolder.getChunkStatus(); // Paper - rewrite chunk system ++ return this.chunkHolder == null ? FullChunkStatus.INACCESSIBLE : this.chunkHolder.getChunkStatus(); // Paper - rewrite chunk system } public void setFullStatus(Supplier levelTypeProvider) { diff --git a/patches/server/0034-Prevent-tile-entity-and-entity-crashes.patch b/patches/server/0034-Prevent-tile-entity-and-entity-crashes.patch index c990a9dbb2..bde2f1f3e4 100644 --- a/patches/server/0034-Prevent-tile-entity-and-entity-crashes.patch +++ b/patches/server/0034-Prevent-tile-entity-and-entity-crashes.patch @@ -44,7 +44,7 @@ index b300d12e9e00519028b53aca9c3fb01f589eaa91..63acd109a79ed752a05df3d4f1b99309 } } 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 3da04db71d6f33b2f466c11e031e0a11c298379b..5d7290216d3a6ddb8e345a5b05da21ef28ed2307 100644 +index a0c88a15be577d552e61bfa923a6e566b1cfcc49..1f635d06dcff8672e9bdaf29fba6fdf39618f893 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -1146,11 +1146,11 @@ public class LevelChunk extends ChunkAccess { diff --git a/patches/server/0060-Add-exception-reporting-event.patch b/patches/server/0060-Add-exception-reporting-event.patch index 8a7883a6f0..3e5da0abe4 100644 --- a/patches/server/0060-Add-exception-reporting-event.patch +++ b/patches/server/0060-Add-exception-reporting-event.patch @@ -131,7 +131,7 @@ index f1675e35be0ab7670c875c6b0d1e982a3ae09d1e..b2bb9bbd3af414c50ec3f8e3e171a679 } 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 5d7290216d3a6ddb8e345a5b05da21ef28ed2307..fe6b2ade9f167c36cbac594a25ad36ee14208fa0 100644 +index 1f635d06dcff8672e9bdaf29fba6fdf39618f893..36701f196756dc7c6820cac516ff880d00a43b17 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -1,6 +1,7 @@ diff --git a/patches/server/0076-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch b/patches/server/0076-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch index be028d4d62..a403500673 100644 --- a/patches/server/0076-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch +++ b/patches/server/0076-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch @@ -88,7 +88,7 @@ index 60e760b42dd6471a229dfd45490dcf8c51979d35..4a3ac7dedf5cb1e76f16ec4f18e82afc @Override public FluidState getFluidState(BlockPos pos) { 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 fe6b2ade9f167c36cbac594a25ad36ee14208fa0..4e93e9ce7a7f939f802e51072efd389a86b42fc4 100644 +index 36701f196756dc7c6820cac516ff880d00a43b17..72637bb342f1260debf925f5b3fde8ec7dd3cfff 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -295,12 +295,29 @@ public class LevelChunk extends ChunkAccess { diff --git a/patches/server/0079-Configurable-Chunk-Inhabited-Time.patch b/patches/server/0079-Configurable-Chunk-Inhabited-Time.patch index ab8002ae7f..3f75537038 100644 --- a/patches/server/0079-Configurable-Chunk-Inhabited-Time.patch +++ b/patches/server/0079-Configurable-Chunk-Inhabited-Time.patch @@ -11,7 +11,7 @@ For people who want all chunks to be treated equally, you can chose a fixed valu This allows to fine-tune vanilla gameplay. 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 4e93e9ce7a7f939f802e51072efd389a86b42fc4..becec8ded3f7ed53998b55523793e6e9cd05d492 100644 +index 72637bb342f1260debf925f5b3fde8ec7dd3cfff..704f0500649acdbff2caf94f702a6685ecf4c986 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -280,6 +280,13 @@ public class LevelChunk extends ChunkAccess { diff --git a/patches/server/0170-PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/0170-PlayerNaturallySpawnCreaturesEvent.patch index 9dfe89b9ab..0d17f70c5f 100644 --- a/patches/server/0170-PlayerNaturallySpawnCreaturesEvent.patch +++ b/patches/server/0170-PlayerNaturallySpawnCreaturesEvent.patch @@ -40,7 +40,7 @@ index a502d293cedb2f507e6cf1792429b36685ed1910..e50af28f806593a0171ad7cee5805f74 return true; diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index a558e9a364a13fc2e81b73fa00cc0eff59eacb9a..0cf7c33f80e67eccc1bf5e1d2101325ab94d8f45 100644 +index 5c97b0069d20815c2a1d61bf34596a8a928d8940..bf802a791e857b0018cc760a24c32981eb732f68 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -716,6 +716,15 @@ public class ServerChunkCache extends ChunkSource { diff --git a/patches/server/0340-implement-optional-per-player-mob-spawns.patch b/patches/server/0340-implement-optional-per-player-mob-spawns.patch index 73fb1b1e40..0e857b9024 100644 --- a/patches/server/0340-implement-optional-per-player-mob-spawns.patch +++ b/patches/server/0340-implement-optional-per-player-mob-spawns.patch @@ -338,7 +338,7 @@ index 8c4d2b2f206d7662c0aceb30f49fa58f9426ec5c..1711170ef98831dacfbf30ac22e19f47 double d0 = (double) SectionPos.sectionToBlockCoord(pos.x, 8); double d1 = (double) SectionPos.sectionToBlockCoord(pos.z, 8); diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 0cf7c33f80e67eccc1bf5e1d2101325ab94d8f45..ed1510776a0c71dea33e7a8fedd289927031d34b 100644 +index bf802a791e857b0018cc760a24c32981eb732f68..8e183df0603d3abbf09301d71758c9cbb4cf413f 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -694,7 +694,18 @@ public class ServerChunkCache extends ChunkSource { diff --git a/patches/server/0343-Optimise-getChunkAt-calls-for-loaded-chunks.patch b/patches/server/0343-Optimise-getChunkAt-calls-for-loaded-chunks.patch index 3721985b42..f4554f1c28 100644 --- a/patches/server/0343-Optimise-getChunkAt-calls-for-loaded-chunks.patch +++ b/patches/server/0343-Optimise-getChunkAt-calls-for-loaded-chunks.patch @@ -7,7 +7,7 @@ bypass the need to get a player chunk, then get the either, then unwrap it... diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index ed1510776a0c71dea33e7a8fedd289927031d34b..9f019946c6098314b1aeba48ee5b1aba9f2935f2 100644 +index 8e183df0603d3abbf09301d71758c9cbb4cf413f..feb494177f8bfc6eb343aa29f5a7ffd8c47f9cb7 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -421,6 +421,12 @@ public class ServerChunkCache extends ChunkSource { diff --git a/patches/server/0344-Add-debug-for-sync-chunk-loads.patch b/patches/server/0344-Add-debug-for-sync-chunk-loads.patch index c4da57f0cf..08f080361a 100644 --- a/patches/server/0344-Add-debug-for-sync-chunk-loads.patch +++ b/patches/server/0344-Add-debug-for-sync-chunk-loads.patch @@ -300,7 +300,7 @@ index 0000000000000000000000000000000000000000..95d6022c9cfb2e36ec5a71be6e343540 + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 9f019946c6098314b1aeba48ee5b1aba9f2935f2..1806b0903185561a16581e10a75fff8c8e5f0464 100644 +index feb494177f8bfc6eb343aa29f5a7ffd8c47f9cb7..f6fd35300324f931c92f546b76dc16883b0f791d 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -445,6 +445,7 @@ public class ServerChunkCache extends ChunkSource { diff --git a/patches/server/0354-Optimise-Chunk-getFluid.patch b/patches/server/0354-Optimise-Chunk-getFluid.patch index 321e9ed9a5..ebc45ec318 100644 --- a/patches/server/0354-Optimise-Chunk-getFluid.patch +++ b/patches/server/0354-Optimise-Chunk-getFluid.patch @@ -8,7 +8,7 @@ faster on its own, however removing the try catch makes it easier to inline due to code size 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 becec8ded3f7ed53998b55523793e6e9cd05d492..1c4fc70d3bfd7af90a07894d3244af826596c507 100644 +index 704f0500649acdbff2caf94f702a6685ecf4c986..8d6e3c60035ba2e7e05d081aec66274bdeedf3ea 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -380,18 +380,20 @@ public class LevelChunk extends ChunkAccess { diff --git a/patches/server/0368-Improved-Watchdog-Support.patch b/patches/server/0368-Improved-Watchdog-Support.patch index f0ae407733..e8102269df 100644 --- a/patches/server/0368-Improved-Watchdog-Support.patch +++ b/patches/server/0368-Improved-Watchdog-Support.patch @@ -307,7 +307,7 @@ index 9d1c3859e54af9b42665e7ca2fc50e83e7784148..904ffb532ecfa45ef8dfc318d7672d19 final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); MinecraftServer.LOGGER.error(msg, throwable); 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 1c4fc70d3bfd7af90a07894d3244af826596c507..262b3fda0fda29d1827e3e000fb028d138307cf2 100644 +index 8d6e3c60035ba2e7e05d081aec66274bdeedf3ea..f1c9dd86f62243ece7e81e820d1dbcae72d2598c 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -1180,6 +1180,7 @@ public class LevelChunk extends ChunkAccess { diff --git a/patches/server/0389-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0389-Deobfuscate-stacktraces-in-log-messages-crash-report.patch index 11b5dc9765..a8c4e3369d 100644 --- a/patches/server/0389-Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/0389-Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -592,7 +592,7 @@ index 6599f874d9f97e9ef4862039ecad7277bbc5fd91..7edd4b88eb0476f0630630bc4681e859 } } 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 262b3fda0fda29d1827e3e000fb028d138307cf2..72da008040147bc080a3e61b926a9afaaca390dd 100644 +index f1c9dd86f62243ece7e81e820d1dbcae72d2598c..b90697fbf292f73fc661c46edcc71c1bbce99d94 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -603,7 +603,7 @@ public class LevelChunk extends ChunkAccess { diff --git a/patches/server/0422-incremental-chunk-and-player-saving.patch b/patches/server/0422-incremental-chunk-and-player-saving.patch index a3ffaf2580..816ec1f46f 100644 --- a/patches/server/0422-incremental-chunk-and-player-saving.patch +++ b/patches/server/0422-incremental-chunk-and-player-saving.patch @@ -53,7 +53,7 @@ index 2a55f9e0ab6fa07ba913203bb62acd54add450a0..7bd02abf039f7e047b6b6b1de0bc4788 // Paper start - move executeAll() into full server tick timing try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 1806b0903185561a16581e10a75fff8c8e5f0464..dfcb9a57d4b6c9bab7305a5ec8a4136a8c66c9d4 100644 +index f6fd35300324f931c92f546b76dc16883b0f791d..a8efb80b1408e2c4598e3baee3fe3f51618c9e63 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -603,6 +603,15 @@ public class ServerChunkCache extends ChunkSource { diff --git a/patches/server/0638-Add-config-for-mobs-immune-to-default-effects.patch b/patches/server/0638-Add-config-for-mobs-immune-to-default-effects.patch index ce42532bd2..13bffd8faa 100644 --- a/patches/server/0638-Add-config-for-mobs-immune-to-default-effects.patch +++ b/patches/server/0638-Add-config-for-mobs-immune-to-default-effects.patch @@ -18,7 +18,7 @@ index 3a669f8e0cd072fcbd5e5ed4b55abb0f73c009e7..212cdc23a443d019829aca5830e39ee9 } } diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -index 9adff51029781795c2cdf479a89111b3a1f102c0..3d3567e09ddf0982dfa6b2279019168a6f4abaaa 100644 +index 9adff51029781795c2cdf479a89111b3a1f102c0..de97ded68bca375d81c77e30afa6622e74a299b7 100644 --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java @@ -605,7 +605,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @@ -26,7 +26,7 @@ index 9adff51029781795c2cdf479a89111b3a1f102c0..3d3567e09ddf0982dfa6b2279019168a @Override public boolean canBeAffected(MobEffectInstance effect) { - return effect.getEffect() == MobEffects.WITHER ? false : super.canBeAffected(effect); -+ return effect.getEffect() == MobEffects.WITHER && this.level.paperConfig().entities.mobEffects.immuneToWitherEffect.wither ? false : super.canBeAffected(effect); // Paper ++ return effect.getEffect() == MobEffects.WITHER && this.level().paperConfig().entities.mobEffects.immuneToWitherEffect.wither ? false : super.canBeAffected(effect); // Paper } private class WitherDoNothingGoal extends Goal { diff --git a/patches/server/0685-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch b/patches/server/0685-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch index e3070e3ff3..2989b3ca98 100644 --- a/patches/server/0685-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch +++ b/patches/server/0685-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch @@ -263,7 +263,7 @@ index fcbdf311e981e010adc78342f0865d3f803354f9..40e17a8f182fea7c99b64cd074ce1757 public String getDebugStatus() { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index dfcb9a57d4b6c9bab7305a5ec8a4136a8c66c9d4..6ee93972a362a81d4a12108b14c564d07fc272c8 100644 +index a8efb80b1408e2c4598e3baee3fe3f51618c9e63..cd260728e95197f4b0cde35f3d6111366bd979db 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -668,6 +668,37 @@ public class ServerChunkCache extends ChunkSource { diff --git a/patches/server/0686-Optimise-chunk-tick-iteration.patch b/patches/server/0686-Optimise-chunk-tick-iteration.patch index 55ea38b4ec..cd53b49f3f 100644 --- a/patches/server/0686-Optimise-chunk-tick-iteration.patch +++ b/patches/server/0686-Optimise-chunk-tick-iteration.patch @@ -93,7 +93,7 @@ index 7d80cfd701d910badf1feaecaa4ce5129584e21d..03b802f9f6e31b1ab23af0ff7b235f64 // Paper - rewrite chunk system diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 6ee93972a362a81d4a12108b14c564d07fc272c8..55c813ed1df716747164dd02e482851fa51f9459 100644 +index cd260728e95197f4b0cde35f3d6111366bd979db..d9d3def899ee3dfea6df0c97e2be3fad9764776a 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -48,6 +48,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp diff --git a/patches/server/0687-Execute-chunk-tasks-mid-tick.patch b/patches/server/0687-Execute-chunk-tasks-mid-tick.patch index b822a4c250..a424976f7e 100644 --- a/patches/server/0687-Execute-chunk-tasks-mid-tick.patch +++ b/patches/server/0687-Execute-chunk-tasks-mid-tick.patch @@ -106,7 +106,7 @@ index b800249823e413933a5d469e431a003f977f59e7..d8fa1cb0b340f97debceb7e5b90051d2 + // Paper end - execute chunk tasks mid tick } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 55c813ed1df716747164dd02e482851fa51f9459..54318b327f464d299c0712f24c1eeba02b2b9263 100644 +index d9d3def899ee3dfea6df0c97e2be3fad9764776a..85d5c712f48c12079c6bf6a23d295746fe5f2550 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -750,6 +750,8 @@ public class ServerChunkCache extends ChunkSource { diff --git a/patches/server/0697-Consolidate-flush-calls-for-entity-tracker-packets.patch b/patches/server/0697-Consolidate-flush-calls-for-entity-tracker-packets.patch index 5d6cec1c0a..6ed5f87b97 100644 --- a/patches/server/0697-Consolidate-flush-calls-for-entity-tracker-packets.patch +++ b/patches/server/0697-Consolidate-flush-calls-for-entity-tracker-packets.patch @@ -22,7 +22,7 @@ With this change I could get all 200 on at 0ms ping. So in general this patch should reduce Netty I/O thread load. diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 54318b327f464d299c0712f24c1eeba02b2b9263..000d500d8bb4a1852b87a57a7beb7f9bb498d252 100644 +index 85d5c712f48c12079c6bf6a23d295746fe5f2550..1409db8d73a2ed43efbba7f0932bd6d497d9009e 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -807,7 +807,24 @@ public class ServerChunkCache extends ChunkSource { diff --git a/patches/server/0706-Optimise-nearby-player-lookups.patch b/patches/server/0706-Optimise-nearby-player-lookups.patch index 7cbacdd7c8..12a1c7f902 100644 --- a/patches/server/0706-Optimise-nearby-player-lookups.patch +++ b/patches/server/0706-Optimise-nearby-player-lookups.patch @@ -322,7 +322,7 @@ index d4f99f4592a86e2d8344bc2c44711fef1543acdf..089dd93d4cd4c1f72e63c4944b3b82c1 private static Boolean isValidSpawnPostitionForType(ServerLevel world, MobCategory group, StructureManager structureAccessor, ChunkGenerator chunkGenerator, MobSpawnSettings.SpawnerData spawnEntry, BlockPos.MutableBlockPos pos, double squaredDistance) { // Paper 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 72da008040147bc080a3e61b926a9afaaca390dd..7568baab4bec3ded6456332ed0f6a20e2721b03f 100644 +index b90697fbf292f73fc661c46edcc71c1bbce99d94..17398a48ff84ba1b21bd64f7857e3a326fcc54cf 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -221,6 +221,98 @@ public class LevelChunk extends ChunkAccess { diff --git a/patches/server/0778-Implement-regenerateChunk.patch b/patches/server/0778-Implement-regenerateChunk.patch index 1ae4d721dc..f3a90bb636 100644 --- a/patches/server/0778-Implement-regenerateChunk.patch +++ b/patches/server/0778-Implement-regenerateChunk.patch @@ -6,18 +6,18 @@ Subject: [PATCH] Implement regenerateChunk Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index d0f52da906d976fd7a6ddb5894bb4a33106d2b2c..5c59bc81676b9d53961058fd324990633086326d 100644 +index d0f52da906d976fd7a6ddb5894bb4a33106d2b2c..24dd33aede00f016ecf810d23d87e47025c5c1b5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -142,6 +142,7 @@ import org.jetbrains.annotations.NotNull; public class CraftWorld extends CraftRegionAccessor implements World { public static final int CUSTOM_DIMENSION_OFFSET = 10; private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); -+ private static final ChunkStatus[] REGEN_CHUNK_STATUSES = {ChunkStatus.BIOMES, ChunkStatus.NOISE, ChunkStatus.SURFACE, ChunkStatus.CARVERS, ChunkStatus.LIQUID_CARVERS, ChunkStatus.FEATURES}; // Paper - implement regenerate chunk method ++ private static final ChunkStatus[] REGEN_CHUNK_STATUSES = {ChunkStatus.BIOMES, ChunkStatus.NOISE, ChunkStatus.SURFACE, ChunkStatus.CARVERS, ChunkStatus.FEATURES, ChunkStatus.INITIALIZE_LIGHT}; // Paper - implement regenerate chunk method private final ServerLevel world; private WorldBorder worldBorder; -@@ -427,27 +428,62 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -427,27 +428,61 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean regenerateChunk(int x, int z) { org.spigotmc.AsyncCatcher.catchOp("chunk regenerate"); // Spigot @@ -67,8 +67,7 @@ index d0f52da906d976fd7a6ddb5894bb4a33106d2b2c..5c59bc81676b9d53961058fd32499063 + chunk -> { + throw new UnsupportedOperationException("Not creating full chunks here"); + }, -+ list, -+ true ++ list + ); + serverChunkCache.mainThreadProcessor.managedBlock(future::isDone); + if (chunkStatus == ChunkStatus.NOISE) { diff --git a/patches/server/0790-Force-close-world-loading-screen.patch b/patches/server/0790-Force-close-world-loading-screen.patch index 6facaadf10..2c16d09dc7 100644 --- a/patches/server/0790-Force-close-world-loading-screen.patch +++ b/patches/server/0790-Force-close-world-loading-screen.patch @@ -10,7 +10,7 @@ so we do not need that. The client only needs the chunk it is currently in to be loaded to close the loading screen, so we just send an empty one. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 3ba9d736ac8f3029b57fbf5deccc28cc68b34a3e..833cd284175ed3a874f82b03698dcfd5c0a62ac1 100644 +index 3ba9d736ac8f3029b57fbf5deccc28cc68b34a3e..752e4114227ac0eabc877732584cd2429c58f70b 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -396,6 +396,16 @@ public abstract class PlayerList { @@ -23,7 +23,7 @@ index 3ba9d736ac8f3029b57fbf5deccc28cc68b34a3e..833cd284175ed3a874f82b03698dcfd5 + .getHolderOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS); + player.connection.send(new net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket( + new net.minecraft.world.level.chunk.EmptyLevelChunk(worldserver1, player.chunkPosition(), plains), -+ worldserver1.getLightEngine(), null, null, true, false) ++ worldserver1.getLightEngine(), null, null) + ); + } + // Paper end diff --git a/patches/server/0791-Fix-falling-block-spawn-methods.patch b/patches/server/0791-Fix-falling-block-spawn-methods.patch index d8c8d6ad70..512587a809 100644 --- a/patches/server/0791-Fix-falling-block-spawn-methods.patch +++ b/patches/server/0791-Fix-falling-block-spawn-methods.patch @@ -24,10 +24,10 @@ index c738fb984ffd120e5adccdb5828833f180e72e80..5c8e905bbf56dd2af5b30d34371793c3 if (Snowball.class.isAssignableFrom(clazz)) { entity = new net.minecraft.world.entity.projectile.Snowball(world, x, y, z); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 5c59bc81676b9d53961058fd324990633086326d..adaa7eaf1a0a39f1d75061c7c1504b61f49ad845 100644 +index 24dd33aede00f016ecf810d23d87e47025c5c1b5..9d7aaee0a1176330f9d082b22741f8ee3bc69170 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1387,7 +1387,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1386,7 +1386,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { Validate.notNull(material, "Material cannot be null"); Validate.isTrue(material.isBlock(), "Material must be a block"); @@ -41,7 +41,7 @@ index 5c59bc81676b9d53961058fd324990633086326d..adaa7eaf1a0a39f1d75061c7c1504b61 return (FallingBlock) entity.getBukkitEntity(); } -@@ -1396,7 +1401,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1395,7 +1400,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { Validate.notNull(location, "Location cannot be null"); Validate.notNull(data, "BlockData cannot be null"); diff --git a/patches/server/0803-Fix-new-block-data-for-EntityChangeBlockEvent.patch b/patches/server/0803-Fix-new-block-data-for-EntityChangeBlockEvent.patch index 48e4b2d0b0..0ee11ae770 100644 --- a/patches/server/0803-Fix-new-block-data-for-EntityChangeBlockEvent.patch +++ b/patches/server/0803-Fix-new-block-data-for-EntityChangeBlockEvent.patch @@ -19,7 +19,7 @@ index 06b7ff21a6e3817e92bc135a573b2419e8900c5f..abf796c3369da6b73c8587dfc05f56d0 this.level.setBlock(blockposition1, Blocks.DIRT.defaultBlockState(), 2); } diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -index 3d3567e09ddf0982dfa6b2279019168a6f4abaaa..3525a3cee14651a5f6516b0a56062309f46d3e19 100644 +index de97ded68bca375d81c77e30afa6622e74a299b7..f69e0b11be74ac83694f59999b3f07a318410c19 100644 --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java @@ -373,7 +373,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob diff --git a/patches/server/0812-Use-username-instead-of-display-name-in-PlayerList-g.patch b/patches/server/0812-Use-username-instead-of-display-name-in-PlayerList-g.patch index 4f1fbc4dbd..164d371194 100644 --- a/patches/server/0812-Use-username-instead-of-display-name-in-PlayerList-g.patch +++ b/patches/server/0812-Use-username-instead-of-display-name-in-PlayerList-g.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Use username instead of display name in diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 833cd284175ed3a874f82b03698dcfd5c0a62ac1..f937dbd6a19b595e3660e598e52bf37f8cc72d13 100644 +index 752e4114227ac0eabc877732584cd2429c58f70b..f73436c8c48640514764735e28fa15f0b080d419 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1430,7 +1430,7 @@ public abstract class PlayerList { diff --git a/patches/server/0814-Pass-ServerLevel-for-gamerule-callbacks.patch b/patches/server/0814-Pass-ServerLevel-for-gamerule-callbacks.patch index 02ba46df0c..5d2738f33b 100644 --- a/patches/server/0814-Pass-ServerLevel-for-gamerule-callbacks.patch +++ b/patches/server/0814-Pass-ServerLevel-for-gamerule-callbacks.patch @@ -158,10 +158,10 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a this.onChanged(server); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index adaa7eaf1a0a39f1d75061c7c1504b61f49ad845..c6e50305031c9f9c958ae1eaf650bd61b00d0f4b 100644 +index 9d7aaee0a1176330f9d082b22741f8ee3bc69170..255afed65617d7f91f559b647efd26b2216124d1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1940,7 +1940,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1939,7 +1939,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper end GameRules.Value handle = this.getHandle().getGameRules().getRule(CraftWorld.getGameRulesNMS().get(rule)); handle.deserialize(event.getValue()); // Paper @@ -170,7 +170,7 @@ index adaa7eaf1a0a39f1d75061c7c1504b61f49ad845..c6e50305031c9f9c958ae1eaf650bd61 return true; } -@@ -1980,7 +1980,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1979,7 +1979,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper end GameRules.Value handle = this.getHandle().getGameRules().getRule(CraftWorld.getGameRulesNMS().get(rule.getName())); handle.deserialize(event.getValue()); // Paper diff --git a/patches/server/0852-Warn-on-plugins-accessing-faraway-chunks.patch b/patches/server/0852-Warn-on-plugins-accessing-faraway-chunks.patch index 388caad802..571205fc03 100644 --- a/patches/server/0852-Warn-on-plugins-accessing-faraway-chunks.patch +++ b/patches/server/0852-Warn-on-plugins-accessing-faraway-chunks.patch @@ -18,7 +18,7 @@ index 01e420715d47b5531ede82139133a9bb59c25955..090771dce76f4e8037b6b2df9fc0dad7 private static boolean isOutsideSpawnableHeight(int y) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index c6e50305031c9f9c958ae1eaf650bd61b00d0f4b..ab8cf1641dc0dc256c357481c23dca87f50d2c84 100644 +index 255afed65617d7f91f559b647efd26b2216124d1..439857a814212b36e475461a01b320731a10b86d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -311,9 +311,24 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -54,7 +54,7 @@ index c6e50305031c9f9c958ae1eaf650bd61b00d0f4b..ab8cf1641dc0dc256c357481c23dca87 // Paper start - implement regenerateChunk method final ServerLevel serverLevel = this.world; final net.minecraft.server.level.ServerChunkCache serverChunkCache = serverLevel.getChunkSource(); -@@ -519,6 +535,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -518,6 +534,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean loadChunk(int x, int z, boolean generate) { org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot @@ -62,7 +62,7 @@ index c6e50305031c9f9c958ae1eaf650bd61b00d0f4b..ab8cf1641dc0dc256c357481c23dca87 // Paper start - Optimize this method ChunkPos chunkPos = new ChunkPos(x, z); ChunkAccess immediate = world.getChunkSource().getChunkAtIfLoadedImmediately(x, z); // Paper -@@ -582,6 +599,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -581,6 +598,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean addPluginChunkTicket(int x, int z, Plugin plugin) { @@ -70,7 +70,7 @@ index c6e50305031c9f9c958ae1eaf650bd61b00d0f4b..ab8cf1641dc0dc256c357481c23dca87 Preconditions.checkArgument(plugin != null, "null plugin"); Preconditions.checkArgument(plugin.isEnabled(), "plugin is not enabled"); -@@ -650,6 +668,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -649,6 +667,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setChunkForceLoaded(int x, int z, boolean forced) { @@ -78,7 +78,7 @@ index c6e50305031c9f9c958ae1eaf650bd61b00d0f4b..ab8cf1641dc0dc256c357481c23dca87 this.getHandle().setChunkForced(x, z, forced); } -@@ -956,6 +975,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -955,6 +974,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) { @@ -86,7 +86,7 @@ index c6e50305031c9f9c958ae1eaf650bd61b00d0f4b..ab8cf1641dc0dc256c357481c23dca87 // Transient load for this tick return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z); } -@@ -2365,6 +2385,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2364,6 +2384,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Spigot end // Paper start public java.util.concurrent.CompletableFuture getChunkAtAsync(int x, int z, boolean gen, boolean urgent) { diff --git a/patches/server/0910-Properly-resend-entities.patch b/patches/server/0910-Properly-resend-entities.patch index 06f6683a35..3855189110 100644 --- a/patches/server/0910-Properly-resend-entities.patch +++ b/patches/server/0910-Properly-resend-entities.patch @@ -79,7 +79,7 @@ index ee2043891c04b95fccccbd19c79b91d7b8fcb436..d4c683b99bdc8fa76749b8edd1136303 } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f937dbd6a19b595e3660e598e52bf37f8cc72d13..d3e259eb22202133d54c4be58c5121735fe412ed 100644 +index f73436c8c48640514764735e28fa15f0b080d419..a07238b697d11dd1845d5c8f643e8cf359b6214f 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -371,7 +371,7 @@ public abstract class PlayerList { diff --git a/patches/server/0926-Use-single-player-info-update-packet-on-join.patch b/patches/server/0926-Use-single-player-info-update-packet-on-join.patch index 8668aa1437..e18b9aec88 100644 --- a/patches/server/0926-Use-single-player-info-update-packet-on-join.patch +++ b/patches/server/0926-Use-single-player-info-update-packet-on-join.patch @@ -18,7 +18,7 @@ index 60d1a2ec1f7b800d66f923ae3149db2c6a62691b..9ca6a2e610b6a82286bb617177bec657 }); } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d3e259eb22202133d54c4be58c5121735fe412ed..731459d80748cdcc7cb9c6c9ede3c56f3f5a0060 100644 +index a07238b697d11dd1845d5c8f643e8cf359b6214f..64da478118537c497363c394fb2ebc92fba6a505 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -317,7 +317,7 @@ public abstract class PlayerList {