From b03f255532bba5a1398f03207756f42e5597ccb8 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 25 Jan 2024 10:54:46 +0100 Subject: [PATCH] Finish moving patches back and improving compilable state --- patches/server/0009-MC-Utils.patch | 1 + ...Thread.patch => 0015-Add-TickThread.patch} | 0 ...16-Further-improve-server-tick-loop.patch} | 63 +++++++------ ...option-to-load-extra-plugin-jars-no.patch} | 2 +- ...evious-behavior-for-setResourcePack.patch} | 4 +- ...ient-crashes-server-lists-and-Mojang.patch | 6 +- .../0030-Player-affects-spawning-API.patch | 4 +- ...031-Only-refresh-abilities-if-needed.patch | 4 +- ...vent-block-entity-and-entity-crashes.patch | 4 +- patches/server/0040-Optimize-explosions.patch | 4 +- ...45-Implement-PlayerLocaleChangeEvent.patch | 4 +- .../0060-Add-exception-reporting-event.patch | 6 +- .../0064-Complete-resource-pack-API.patch | 4 +- ...llow-Reloading-of-Custom-Permissions.patch | 4 +- ...th-absorb-values-and-repair-bad-data.patch | 4 +- ...ckPhysicsEvent-if-a-plugin-has-a-lis.patch | 6 +- ...77-Configurable-Chunk-Inhabited-Time.patch | 4 +- .../0086-Configurable-Player-Collision.patch | 4 +- ...-possibility-for-getServer-singleton.patch | 6 +- .../0095-Async-GameProfileCache-saving.patch | 4 +- ...9-Allow-Reloading-of-Command-Aliases.patch | 4 +- ...le-async-calls-to-restart-the-server.patch | 6 +- ...n-option-to-prevent-player-names-fro.patch | 4 +- ...oleAppender-for-console-improvements.patch | 14 +-- .../server/0135-Basic-PlayerProfile-API.patch | 4 +- ...nt-extended-PaperServerListPingEvent.patch | 4 +- ...82-Flag-to-disable-the-channel-limit.patch | 4 +- ...dd-Early-Warning-Feature-to-WatchDog.patch | 10 +- ...238-Optimize-CraftBlockData-Creation.patch | 6 +- ...e-attack-cooldown-methods-for-Player.patch | 4 +- .../server/0246-Improve-death-events.patch | 4 +- ...er-Thread-Pool-and-Thread-Priorities.patch | 4 +- .../0269-Optimize-World-Time-Updates.patch | 4 +- ...ault-permission-message-configurable.patch | 8 +- .../0283-Async-command-map-building.patch | 4 +- patches/server/0292-Server-Tick-Events.patch | 6 +- ...le-Keep-Spawn-Loaded-range-per-world.patch | 10 +- ...301-Expose-the-internal-current-tick.patch | 4 +- ...rializing-mismatching-chunk-coordina.patch | 6 +- .../0326-Add-debug-for-sync-chunk-loads.patch | 6 +- .../server/0336-Optimise-Chunk-getFluid.patch | 6 +- ...-Add-tick-times-API-and-mspt-command.patch | 8 +- ...339-Expose-MinecraftServer-isRunning.patch | 4 +- ...Add-Raw-Byte-ItemStack-Serialization.patch | 9 +- .../server/0365-misc-debugging-dumps.patch | 10 +- ...ktraces-in-log-messages-crash-report.patch | 6 +- .../server/0368-Implement-Mob-Goal-API.patch | 4 +- ...Wait-for-Async-Tasks-during-shutdown.patch | 6 +- ...ld-Difficulty-Remembering-Difficulty.patch | 10 +- .../server/0393-Paper-dumpitem-command.patch | 6 +- patches/server/0414-Brand-support.patch | 4 +- ...erver-load-chunks-from-newer-version.patch | 14 +-- .../0429-Cache-block-data-strings.patch | 4 +- ...y-Counter-to-allow-plugins-to-use-va.patch | 4 +- ...-non-whitelisted-player-when-white-l.patch | 4 +- ...r-spawnParticle-x-y-z-precision-loss.patch | 4 +- ...487-Add-ServerResourcesReloadedEvent.patch | 6 +- patches/server/0511-Add-EntityMoveEvent.patch | 4 +- .../server/0528-Expand-world-key-API.patch | 6 +- patches/server/0530-Item-Rarity-API.patch | 4 +- ...telist-use-configurable-kick-message.patch | 4 +- .../server/0534-Expose-protocol-version.patch | 4 +- .../server/0558-Add-basic-Datapack-API.patch | 4 +- .../0561-ItemStack-repair-check-API.patch | 4 +- ...568-Attributes-API-for-item-defaults.patch | 4 +- .../0572-Add-PlayerKickEvent-causes.patch | 6 +- .../0620-Get-entity-default-attributes.patch | 4 +- ...Collidable-methods-to-various-places.patch | 4 +- ...29-Add-Raw-Byte-Entity-Serialization.patch | 13 ++- ...aper-mobcaps-and-paper-playermobcaps.patch | 6 +- ...vanilla-BiomeProvider-from-WorldInfo.patch | 6 +- .../0704-Implement-regenerateChunk.patch | 41 +++++---- ...sks-fairly-for-worlds-while-waiting-.patch | 6 +- ...efault-CustomSpawners-in-custom-worl.patch | 4 +- ...o-worldlist-before-initing-the-world.patch | 6 +- patches/server/0715-Custom-Potion-Mixes.patch | 8 +- ...0717-Fix-falling-block-spawn-methods.patch | 6 +- .../0727-Buffer-OOB-setBlock-calls.patch | 6 +- ...s-ServerLevel-for-gamerule-callbacks.patch | 6 +- ...n-on-world-create-while-being-ticked.patch | 12 +-- ...-on-plugins-accessing-faraway-chunks.patch | 12 +-- ...0781-Add-NamespacedKey-biome-methods.patch | 4 +- ...ix-plugin-loggers-on-server-shutdown.patch | 4 +- .../0801-Elder-Guardian-appearance-API.patch | 4 +- .../0816-Add-Player-Warden-Warning-API.patch | 4 +- ...0818-Add-paper-dumplisteners-command.patch | 4 +- ...async-entity-add-due-to-fungus-trees.patch | 4 +- ...-for-some-hot-BlockBehavior-and-Flui.patch | 8 +- patches/server/0839-Flying-Fall-Damage.patch | 4 +- ...Folia-scheduler-and-owned-region-API.patch | 6 +- ...x-custom-statistic-criteria-creation.patch | 4 +- .../server/0915-Bandaid-fix-for-Effect.patch | 6 +- ...-entities-in-chunks-that-are-positio.patch | 6 +- .../0958-Add-player-idle-duration-API.patch | 4 +- ...predicate-for-blocks-when-raytracing.patch | 8 +- ...ingEffect-powers-lightning-rods-and-.patch | 4 +- ...tch => 0975-Add-Structure-check-API.patch} | 2 +- ...-getAttributeModifier-duplication-c.patch} | 0 ...estore-vanilla-entity-drops-behavior.patch | 2 +- ...tch => 0979-add-more-scoreboard-API.patch} | 0 ...stry.patch => 0980-Improve-Registry.patch} | 0 ...on-null-loc-for-EntityTeleportEvent.patch} | 0 ...h => 0982-Add-experience-points-API.patch} | 2 +- ...h => 0983-Add-drops-to-shear-events.patch} | 0 ...> 0984-Add-PlayerShieldDisableEvent.patch} | 0 ...ate-ResourceLocation-in-NBT-reading.patch} | 0 ...-experience-dropping-on-block-break.patch} | 4 +- ...> 0987-Fixup-NamespacedKey-handling.patch} | 0 ...88-Expose-LootTable-of-DecoratedPot.patch} | 0 ...llocation-of-Vec3D-by-entity-tracker.patch | 2 +- ...> 0990-Rewrite-dataconverter-system.patch} | 33 ++++++- ...6-Starlight.patch => 0991-Starlight.patch} | 91 +++++++++++-------- ....patch => 0992-Rewrite-chunk-system.patch} | 54 +++++------ ...incremental-chunk-and-player-saving.patch} | 6 +- ...dBounds-and-getBlockState-for-inlin.patch} | 0 ...tem-frames-performance-and-bug-fixe.patch} | 0 ...ing-for-EntityLiving-hasLineOfSight.patch} | 0 ...Manager-and-add-advanced-packet-sup.patch} | 0 ...98-Allow-Saving-of-Oversized-Chunks.patch} | 0 ...99-Fix-World-isChunkGenerated-calls.patch} | 4 +- ...000-Flat-bedrock-generator-settings.patch} | 0 ...=> 1001-Entity-Activation-Range-2.0.patch} | 0 ...1002-Optional-per-player-mob-spawns.patch} | 0 ...2-Anti-Xray.patch => 1003-Anti-Xray.patch} | 8 +- ...g-PreCreatureSpawnEvent-with-per-pl.patch} | 0 ...timize-Collision-to-not-load-chunks.patch} | 0 ...alSelector-Goal.Flag-Set-operations.patch} | 0 ...07-Entity-load-save-limit-per-chunk.patch} | 0 ...-and-optimise-world-force-upgrading.patch} | 8 +- ...h => 1009-Improved-Watchdog-Support.patch} | 24 ++--- ...> 1010-Optimize-Voxel-Shape-Merging.patch} | 0 ...ch => 1011-Write-SavedData-IO-async.patch} | 0 ...nd-End-Portal-Frames-from-being-des.patch} | 0 ...ance-map-to-optimise-entity-tracker.patch} | 0 ...Optimize-Bit-Operations-by-inlining.patch} | 0 ...> 1015-Remove-streams-from-hot-code.patch} | 0 ...-Eigencraft-redstone-implementation.patch} | 0 ...er-Remove-Streams-Optimized-collect.patch} | 0 ...rTradeEvent-and-PlayerPurchaseEvent.patch} | 0 ...-Improve-boat-collision-performance.patch} | 0 ...=> 1020-Optimise-general-POI-access.patch} | 0 ...ementation-for-blockstate-state-loo.patch} | 0 ...> 1022-Execute-chunk-tasks-mid-tick.patch} | 4 +- ... 1023-Optimise-random-block-ticking.patch} | 0 ...ulate-regionfile-header-if-it-is-co.patch} | 2 +- ...city-compression-and-cipher-natives.patch} | 0 ...-more-information-in-watchdog-dumps.patch} | 0 ...tch => 1027-Collision-optimisations.patch} | 0 ...n-checking-in-player-move-packet-ha.patch} | 0 ...29-Fix-tripwire-state-inconsistency.patch} | 0 ...-type-tags-suggestions-in-selectors.patch} | 0 ...ate-Current-redstone-implementation.patch} | 0 ...32-optimize-dirt-and-snow-spreading.patch} | 0 ...ch => 1033-Properly-resend-entities.patch} | 0 ...pers.patch => 1034-Optimize-Hoppers.patch} | 4 +- ...-Improve-performance-of-mass-crafts.patch} | 0 ...> 1036-Actually-optimise-explosions.patch} | 0 ... 1037-Optimise-chunk-tick-iteration.patch} | 0 ...atch => 1038-Lag-compensation-ticks.patch} | 6 +- ...39-Optimise-nearby-player-retrieval.patch} | 0 ... 1040-Distance-manager-tick-timings.patch} | 0 ...-Oversized-block-entities-in-chunks.patch} | 0 scripts/moveback.py | 4 +- 163 files changed, 466 insertions(+), 411 deletions(-) rename patches/server/{0017-Add-TickThread.patch => 0015-Add-TickThread.patch} (100%) rename patches/server/{1041-Further-improve-server-tick-loop.patch => 0016-Further-improve-server-tick-loop.patch} (85%) rename patches/server/{0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch => 0017-Add-command-line-option-to-load-extra-plugin-jars-no.patch} (97%) rename patches/server/{0979-Keep-previous-behavior-for-setResourcePack.patch => 0018-Keep-previous-behavior-for-setResourcePack.patch} (91%) rename patches/server/{0976-Add-Structure-check-API.patch => 0975-Add-Structure-check-API.patch} (91%) rename patches/server/{0975-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch => 0976-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch} (100%) rename patches/server/{0980-add-more-scoreboard-API.patch => 0979-add-more-scoreboard-API.patch} (100%) rename patches/server/{0981-Improve-Registry.patch => 0980-Improve-Registry.patch} (100%) rename patches/server/{0982-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch => 0981-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch} (100%) rename patches/server/{0983-Add-experience-points-API.patch => 0982-Add-experience-points-API.patch} (97%) rename patches/server/{0984-Add-drops-to-shear-events.patch => 0983-Add-drops-to-shear-events.patch} (100%) rename patches/server/{0985-Add-PlayerShieldDisableEvent.patch => 0984-Add-PlayerShieldDisableEvent.patch} (100%) rename patches/server/{0986-Validate-ResourceLocation-in-NBT-reading.patch => 0985-Validate-ResourceLocation-in-NBT-reading.patch} (100%) rename patches/server/{0987-Properly-handle-experience-dropping-on-block-break.patch => 0986-Properly-handle-experience-dropping-on-block-break.patch} (97%) rename patches/server/{0988-Fixup-NamespacedKey-handling.patch => 0987-Fixup-NamespacedKey-handling.patch} (100%) rename patches/server/{0990-Expose-LootTable-of-DecoratedPot.patch => 0988-Expose-LootTable-of-DecoratedPot.patch} (100%) rename patches/server/{0015-Rewrite-dataconverter-system.patch => 0990-Rewrite-dataconverter-system.patch} (99%) rename patches/server/{0016-Starlight.patch => 0991-Starlight.patch} (98%) rename patches/server/{0991-Rewrite-chunk-system.patch => 0992-Rewrite-chunk-system.patch} (99%) rename patches/server/{0992-incremental-chunk-and-player-saving.patch => 0993-incremental-chunk-and-player-saving.patch} (97%) rename patches/server/{0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch => 0994-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch} (100%) rename patches/server/{0994-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch => 0995-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch} (100%) rename patches/server/{0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch => 0996-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch} (100%) rename patches/server/{0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch => 0997-Optimize-Network-Manager-and-add-advanced-packet-sup.patch} (100%) rename patches/server/{0997-Allow-Saving-of-Oversized-Chunks.patch => 0998-Allow-Saving-of-Oversized-Chunks.patch} (100%) rename patches/server/{0998-Fix-World-isChunkGenerated-calls.patch => 0999-Fix-World-isChunkGenerated-calls.patch} (98%) rename patches/server/{0999-Flat-bedrock-generator-settings.patch => 1000-Flat-bedrock-generator-settings.patch} (100%) rename patches/server/{1000-Entity-Activation-Range-2.0.patch => 1001-Entity-Activation-Range-2.0.patch} (100%) rename patches/server/{1001-Optional-per-player-mob-spawns.patch => 1002-Optional-per-player-mob-spawns.patch} (100%) rename patches/server/{1002-Anti-Xray.patch => 1003-Anti-Xray.patch} (99%) rename patches/server/{1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch => 1004-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch} (100%) rename patches/server/{1004-Optimize-Collision-to-not-load-chunks.patch => 1005-Optimize-Collision-to-not-load-chunks.patch} (100%) rename patches/server/{1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch => 1006-Optimize-GoalSelector-Goal.Flag-Set-operations.patch} (100%) rename patches/server/{1006-Entity-load-save-limit-per-chunk.patch => 1007-Entity-load-save-limit-per-chunk.patch} (100%) rename patches/server/{1007-Fix-and-optimise-world-force-upgrading.patch => 1008-Fix-and-optimise-world-force-upgrading.patch} (98%) rename patches/server/{1008-Improved-Watchdog-Support.patch => 1009-Improved-Watchdog-Support.patch} (97%) rename patches/server/{1009-Optimize-Voxel-Shape-Merging.patch => 1010-Optimize-Voxel-Shape-Merging.patch} (100%) rename patches/server/{1010-Write-SavedData-IO-async.patch => 1011-Write-SavedData-IO-async.patch} (100%) rename patches/server/{1011-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch => 1012-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch} (100%) rename patches/server/{1012-Use-distance-map-to-optimise-entity-tracker.patch => 1013-Use-distance-map-to-optimise-entity-tracker.patch} (100%) rename patches/server/{1013-Optimize-Bit-Operations-by-inlining.patch => 1014-Optimize-Bit-Operations-by-inlining.patch} (100%) rename patches/server/{1014-Remove-streams-from-hot-code.patch => 1015-Remove-streams-from-hot-code.patch} (100%) rename patches/server/{1015-Eigencraft-redstone-implementation.patch => 1016-Eigencraft-redstone-implementation.patch} (100%) rename patches/server/{1016-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch => 1017-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch} (100%) rename patches/server/{1017-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch => 1018-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch} (100%) rename patches/server/{1018-Improve-boat-collision-performance.patch => 1019-Improve-boat-collision-performance.patch} (100%) rename patches/server/{1019-Optimise-general-POI-access.patch => 1020-Optimise-general-POI-access.patch} (100%) rename patches/server/{1020-Custom-table-implementation-for-blockstate-state-loo.patch => 1021-Custom-table-implementation-for-blockstate-state-loo.patch} (100%) rename patches/server/{1021-Execute-chunk-tasks-mid-tick.patch => 1022-Execute-chunk-tasks-mid-tick.patch} (98%) rename patches/server/{1022-Optimise-random-block-ticking.patch => 1023-Optimise-random-block-ticking.patch} (100%) rename patches/server/{1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch => 1024-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch} (99%) rename patches/server/{1024-Use-Velocity-compression-and-cipher-natives.patch => 1025-Use-Velocity-compression-and-cipher-natives.patch} (100%) rename patches/server/{1025-Detail-more-information-in-watchdog-dumps.patch => 1026-Detail-more-information-in-watchdog-dumps.patch} (100%) rename patches/server/{1026-Collision-optimisations.patch => 1027-Collision-optimisations.patch} (100%) rename patches/server/{1027-Optimise-collision-checking-in-player-move-packet-ha.patch => 1028-Optimise-collision-checking-in-player-move-packet-ha.patch} (100%) rename patches/server/{1028-Fix-tripwire-state-inconsistency.patch => 1029-Fix-tripwire-state-inconsistency.patch} (100%) rename patches/server/{1029-Fix-entity-type-tags-suggestions-in-selectors.patch => 1030-Fix-entity-type-tags-suggestions-in-selectors.patch} (100%) rename patches/server/{1030-Add-Alternate-Current-redstone-implementation.patch => 1031-Add-Alternate-Current-redstone-implementation.patch} (100%) rename patches/server/{1031-optimize-dirt-and-snow-spreading.patch => 1032-optimize-dirt-and-snow-spreading.patch} (100%) rename patches/server/{1032-Properly-resend-entities.patch => 1033-Properly-resend-entities.patch} (100%) rename patches/server/{1033-Optimize-Hoppers.patch => 1034-Optimize-Hoppers.patch} (99%) rename patches/server/{1034-Improve-performance-of-mass-crafts.patch => 1035-Improve-performance-of-mass-crafts.patch} (100%) rename patches/server/{1035-Actually-optimise-explosions.patch => 1036-Actually-optimise-explosions.patch} (100%) rename patches/server/{1036-Optimise-chunk-tick-iteration.patch => 1037-Optimise-chunk-tick-iteration.patch} (100%) rename patches/server/{1037-Lag-compensation-ticks.patch => 1038-Lag-compensation-ticks.patch} (97%) rename patches/server/{1038-Optimise-nearby-player-retrieval.patch => 1039-Optimise-nearby-player-retrieval.patch} (100%) rename patches/server/{1039-Distance-manager-tick-timings.patch => 1040-Distance-manager-tick-timings.patch} (100%) rename patches/server/{1040-Handle-Oversized-block-entities-in-chunks.patch => 1041-Handle-Oversized-block-entities-in-chunks.patch} (100%) diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch index 26b152ecfd..1bdd52c2e4 100644 --- a/patches/server/0009-MC-Utils.patch +++ b/patches/server/0009-MC-Utils.patch @@ -10,6 +10,7 @@ public org.bukkit.craftbukkit.inventory.CraftItemStack handle public net.minecraft.server.level.ChunkMap getVisibleChunkIfPresent(J)Lnet/minecraft/server/level/ChunkHolder; public net.minecraft.server.level.ServerChunkCache mainThreadProcessor public net.minecraft.server.level.ServerChunkCache$MainThreadExecutor +public net.minecraft.world.level.chunk.LevelChunkSection states diff --git a/src/main/java/com/destroystokyo/paper/util/concurrent/WeakSeqLock.java b/src/main/java/com/destroystokyo/paper/util/concurrent/WeakSeqLock.java new file mode 100644 diff --git a/patches/server/0017-Add-TickThread.patch b/patches/server/0015-Add-TickThread.patch similarity index 100% rename from patches/server/0017-Add-TickThread.patch rename to patches/server/0015-Add-TickThread.patch diff --git a/patches/server/1041-Further-improve-server-tick-loop.patch b/patches/server/0016-Further-improve-server-tick-loop.patch similarity index 85% rename from patches/server/1041-Further-improve-server-tick-loop.patch rename to patches/server/0016-Further-improve-server-tick-loop.patch index 902156f89f..1e0b03efb3 100644 --- a/patches/server/1041-Further-improve-server-tick-loop.patch +++ b/patches/server/0016-Further-improve-server-tick-loop.patch @@ -12,28 +12,29 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 709698179e8da694c447221f0449e33ebd9b3c9f..23d2264dfc4f763a7198eb543e7f86a5a5aa85c3 100644 +index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..f32aa4e03ae02d1449101c4aa89c8e0c0fa26ba5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -292,7 +292,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -301,7 +301,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return worldserver + " " + worldserver.dimension().location(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 22f6260ffa7b9fb2f5f226e505e81b3e29760437..b4fdcfa28347beafe75339782d6e0cd7fc0b6256 100644 +index a127acc6c44bfd078e06c74b408d62df6e85d1fe..5975cc2fa72609ea5f3e6f99155d6e5bc321a321 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -221,6 +221,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0077-Configurable-Chunk-Inhabited-Time.patch b/patches/server/0077-Configurable-Chunk-Inhabited-Time.patch index 4e2e1411a2..e803f0aa2e 100644 --- a/patches/server/0077-Configurable-Chunk-Inhabited-Time.patch +++ b/patches/server/0077-Configurable-Chunk-Inhabited-Time.patch @@ -11,10 +11,10 @@ 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 30c0f59d521de5e7c9d5bbc0a7f1f272e165f389..8288be49fc0fbedefef799cb1038d5f79b7cf0a3 100644 +index 53c10ed58451c317e6d45f34d6eca3072155b814..82b59b7c791216aaaaaaf2972f47bd21dac7a202 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -276,6 +276,13 @@ public class LevelChunk extends ChunkAccess { +@@ -270,6 +270,13 @@ public class LevelChunk extends ChunkAccess { return new ChunkAccess.TicksToSave(this.blockTicks, this.fluidTicks); } diff --git a/patches/server/0086-Configurable-Player-Collision.patch b/patches/server/0086-Configurable-Player-Collision.patch index 2ba0e44020..481f34f9ff 100644 --- a/patches/server/0086-Configurable-Player-Collision.patch +++ b/patches/server/0086-Configurable-Player-Collision.patch @@ -18,10 +18,10 @@ index 3d2a689d11bfa230bab61a2a65c6051328f6b78d..cf31771648549ab6d7e4e38b30409ca4 buf.writeComponent(this.playerPrefix); buf.writeComponent(this.playerSuffix); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 07bd44752a8af3e44577484416b89c9acaa3769b..8d81dcd07a5a9d32d19ff5b4d246dae503651ebd 100644 +index 36de11970c3cb605357ec5c49d0654a43263bc00..2ce3a54a63b207940690508a277fae39baa032c3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -621,6 +621,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { -@@ -2367,9 +2369,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; -@@ -370,7 +369,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { MinecraftServer.LOGGER.error("Uncaught exception in server thread", throwable); }); diff --git a/patches/server/0269-Optimize-World-Time-Updates.patch b/patches/server/0269-Optimize-World-Time-Updates.patch index 663d4d1495..46bbe6ded4 100644 --- a/patches/server/0269-Optimize-World-Time-Updates.patch +++ b/patches/server/0269-Optimize-World-Time-Updates.patch @@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet object for every player unless they have per-player time enabled. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6cac85b9a05a522d71e2fd91b3d8486c06ee976b..2c2bdbdf7e4a27784d7b019accfe83987b4cf120 100644 +index be757de5b307bd8233c20f907f5d5d112761c362..fe0fde11e6d6bbe77a739c582a936c378b81a79c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1415,12 +1415,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0, "cannot deserialize nothing"); + + CompoundTag compound = deserializeNbtFromBytes(data); -+ int dataVersion = compound.getInt("DataVersion"); -+ return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ITEM_STACK, compound, dataVersion, getDataVersion()))); ++ final int dataVersion = compound.getInt("DataVersion"); ++ compound = (CompoundTag) MinecraftServer.getServer().fixerUpper.update(References.ITEM_STACK, new Dynamic<>(NbtOps.INSTANCE, compound), dataVersion, this.getDataVersion()).getValue(); ++ return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(compound)); + } + + private byte[] serializeNbtToBytes(CompoundTag compound) { diff --git a/patches/server/0365-misc-debugging-dumps.patch b/patches/server/0365-misc-debugging-dumps.patch index cbf65ca99a..ae8fbfc251 100644 --- a/patches/server/0365-misc-debugging-dumps.patch +++ b/patches/server/0365-misc-debugging-dumps.patch @@ -42,10 +42,10 @@ index 40ff3090fb17fb0f01a9b52639fb783ea57ce6b6..d39743d9626eb01c942194387dafb110 StackTraceElement[] astacktraceelement = exception.getStackTrace(); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index fcb8708276a73ab61e004f0113650b0a7415041c..4339a2cd0b2020b673ebdb6902ad0d0a53373a27 100644 +index 698601fc2c6e5d19a990bd3dcf0bc52e4c6efaea..4170f834c63807440c9bcda76cdcf93807de0eb1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -903,6 +903,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop completablefuture = CompletableFuture.supplyAsync(() -> { Stream stream = dataPacks.stream(); // CraftBukkit - decompile error -@@ -2006,6 +2012,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - BlockPhysicsEvent diff --git a/patches/server/0528-Expand-world-key-API.patch b/patches/server/0528-Expand-world-key-API.patch index 87afb65e1c..de0d6bde9f 100644 --- a/patches/server/0528-Expand-world-key-API.patch +++ b/patches/server/0528-Expand-world-key-API.patch @@ -20,7 +20,7 @@ index 0fb214ddd919b568da64541fd9b531c65caa5fad..9cd267f53505658d1c75187b662c4d9f // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 811c0f36bc314ca79e062fa149c6d19fc2734087..150013a0c62a057671cfad7f852c4439bd9051c6 100644 +index f027e405e4c80a66110d351961612faa8828bdb0..cf508b4ddd21d006b88eac6588a0f56eb20c5ec7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1137,9 +1137,15 @@ public final class CraftServer implements Server { @@ -67,10 +67,10 @@ index 811c0f36bc314ca79e062fa149c6d19fc2734087..150013a0c62a057671cfad7f852c4439 // Check if a World already exists with the UID. if (this.getWorld(world.getUID()) != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index f48702923beb6d99b23dfa2466396bf4d4e8fbc8..7629d3b375027ffe0656a21e4cb9315aabb62460 100644 +index 67c8e62c22f11ea4524e4229d2b89695313bf5d2..e0118a0c780cb60eb8545cb9c61f37c0986752b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -515,6 +515,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -516,6 +516,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public int nextEntityId() { return net.minecraft.world.entity.Entity.nextEntityId(); } diff --git a/patches/server/0530-Item-Rarity-API.patch b/patches/server/0530-Item-Rarity-API.patch index 1f69f50472..47ad27274a 100644 --- a/patches/server/0530-Item-Rarity-API.patch +++ b/patches/server/0530-Item-Rarity-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Item Rarity API public net.minecraft.world.item.Item rarity diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 7629d3b375027ffe0656a21e4cb9315aabb62460..d714d420376d032d82ce6fc066fee3f775f0744d 100644 +index e0118a0c780cb60eb8545cb9c61f37c0986752b0..841e5887c455fafd826965e4f84180750f303eaa 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -520,6 +520,20 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -521,6 +521,20 @@ public final class CraftMagicNumbers implements UnsafeValues { public String getMainLevelName() { return ((net.minecraft.server.dedicated.DedicatedServer) net.minecraft.server.MinecraftServer.getServer()).getProperties().levelName; } diff --git a/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch b/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch index 843d16f8c9..da6064c246 100644 --- a/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch +++ b/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch @@ -5,10 +5,10 @@ Subject: [PATCH] forced whitelist: use configurable kick message diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7ab3e35d4a6376f4c18c36ef1d6a29556d19f15f..82ed16af2384c73560b66cb5a60d53fb940371c0 100644 +index 37c4245a30ee6a5f786364aa46dee832396ba4fd..b3b78ad64c5cd9bde4756c5e619d0188ec8f2608 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2104,7 +2104,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop) net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(bukkitEntityKey))); return new io.papermc.paper.attribute.UnmodifiableAttributeMap(supplier); } diff --git a/patches/server/0629-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0629-Add-Raw-Byte-Entity-Serialization.patch index 04b2562669..77fee154d0 100644 --- a/patches/server/0629-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/server/0629-Add-Raw-Byte-Entity-Serialization.patch @@ -47,11 +47,11 @@ index a6492b6a9f66d8bcda8928fadf0a5920ff7f0dab..71845027ba1b755ead76cf75d011547d // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index df57a3be211017e2ba7bd28571adaea59d0be969..fd1ec07ada04de98d0a4f1ca4c93ec53771f88d7 100644 +index 35bc0c3bfda51e3eec2ee1fc68d207ddba4239ef..34c19a422de27cd6aa08159186a0180215c0837d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -483,6 +483,29 @@ public final class CraftMagicNumbers implements UnsafeValues { - return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ITEM_STACK, compound, dataVersion, getDataVersion()))); +@@ -484,6 +484,32 @@ public final class CraftMagicNumbers implements UnsafeValues { + return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(compound)); } + @Override @@ -71,8 +71,11 @@ index df57a3be211017e2ba7bd28571adaea59d0be969..fd1ec07ada04de98d0a4f1ca4c93ec53 + + CompoundTag compound = deserializeNbtFromBytes(data); + int dataVersion = compound.getInt("DataVersion"); -+ compound = ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ENTITY, compound, dataVersion, getDataVersion()); -+ if (!preserveUUID) compound.remove("UUID"); // Generate a new UUID so we don't have to worry about deserializing the same entity twice ++ compound = (CompoundTag) MinecraftServer.getServer().fixerUpper.update(References.ENTITY, new Dynamic<>(NbtOps.INSTANCE, compound), dataVersion, this.getDataVersion()).getValue(); ++ if (!preserveUUID) { ++ // Generate a new UUID so we don't have to worry about deserializing the same entity twice ++ compound.remove("UUID"); ++ } + return net.minecraft.world.entity.EntityType.create(compound, ((org.bukkit.craftbukkit.CraftWorld) world).getHandle()) + .orElseThrow(() -> new IllegalArgumentException("An ID was not found for the data. Did you downgrade?")).getBukkitEntity(); + } diff --git a/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch b/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch index 9ca6f8dd8e..d90f1f9ab8 100644 --- a/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch +++ b/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch @@ -10,11 +10,11 @@ Also has a hover text on each mob category listing what entity types are in said category diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index a27c90ea7af63b0d42f202ed1a7dab6e42daed9f..1fd0854fb4f8ab3b5da3cda5ddd2535a0faa6adf 100644 +index 27775df10a490ff75ca377e8373931738f1b817c..c9bb2df0d884227576ed8d2e72219bbbd7ba827e 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java -@@ -41,6 +41,7 @@ public final class PaperCommand extends Command { - commands.put(Set.of("fixlight"), new FixLightCommand()); +@@ -40,6 +40,7 @@ public final class PaperCommand extends Command { + commands.put(Set.of("dumpplugins"), new DumpPluginsCommand()); commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand()); commands.put(Set.of("dumpitem"), new DumpItemCommand()); + commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand()); diff --git a/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch b/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch index 3d3d4f1d89..c7af2ee421 100644 --- a/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch +++ b/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose vanilla BiomeProvider from WorldInfo diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 19158fae4c8ebd9f5cd136795723771e23dba23c..249c3e0724a0f85cd3bae9ae67cc787d3eedfbfc 100644 +index 2535f33e1ee5f1bac3247231138966fe070615cd..1df847164796c0992e677e0db45a9be223c8dc4a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -596,7 +596,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver)); LevelStem worlddimension = (LevelStem) dimensions.get(dimensionKey); @@ -18,7 +18,7 @@ index 19158fae4c8ebd9f5cd136795723771e23dba23c..249c3e0724a0f85cd3bae9ae67cc787d biomeProvider = gen.getDefaultBiomeProvider(worldInfo); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7a5fd6fb4ddcf1ba555725f1bb956333a0450d7c..5161f6d2fdd7cbf30b52089ecfda56b3d480ecda 100644 +index d8f4a433d5072e849eb883eb8e54831325c4c5ef..dd62f8ccca6a6c08876af1595bc274c9151055b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1260,7 +1260,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0704-Implement-regenerateChunk.patch b/patches/server/0704-Implement-regenerateChunk.patch index 5cf21d70a4..20bcc8001b 100644 --- a/patches/server/0704-Implement-regenerateChunk.patch +++ b/patches/server/0704-Implement-regenerateChunk.patch @@ -6,7 +6,7 @@ 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 146dce90630325437ea57b0c496f6ac5e9fefc7a..1ae13f0a320160210bd830f990f44de1eef3d5da 100644 +index 391f546e44080293fd94ff240d7809e3f471bb14..ef942e75ed1aefbc9175f99113cdfeada58e8a50 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -144,6 +144,7 @@ import org.jetbrains.annotations.NotNull; @@ -17,7 +17,7 @@ index 146dce90630325437ea57b0c496f6ac5e9fefc7a..1ae13f0a320160210bd830f990f44de1 private final ServerLevel world; private WorldBorder worldBorder; -@@ -414,27 +415,61 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -414,27 +415,68 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean regenerateChunk(int x, int z) { org.spigotmc.AsyncCatcher.catchOp("chunk regenerate"); // Spigot @@ -25,10 +25,6 @@ index 146dce90630325437ea57b0c496f6ac5e9fefc7a..1ae13f0a320160210bd830f990f44de1 - /* - if (!unloadChunk0(x, z, false)) { - return false; -- } -- -- final long chunkKey = ChunkCoordIntPair.pair(x, z); -- world.getChunkProvider().unloadQueue.remove(chunkKey); + // Paper start - implement regenerateChunk method + final ServerLevel serverLevel = this.world; + final net.minecraft.server.level.ServerChunkCache serverChunkCache = serverLevel.getChunkSource(); @@ -53,11 +49,7 @@ index 146dce90630325437ea57b0c496f6ac5e9fefc7a..1ae13f0a320160210bd830f990f44de1 + list.add(chunkAccess); + } + } - -- net.minecraft.server.Chunk chunk = world.getChunkProvider().generateChunk(x, z); -- PlayerChunk playerChunk = world.getPlayerChunkMap().getChunk(x, z); -- if (playerChunk != null) { -- playerChunk.chunk = chunk; ++ + final java.util.concurrent.CompletableFuture> future = chunkStatus.generate( + Runnable::run, + serverLevel, @@ -75,21 +67,34 @@ index 146dce90630325437ea57b0c496f6ac5e9fefc7a..1ae13f0a320160210bd830f990f44de1 + } } -- if (chunk != null) { -- refreshChunk(x, z); +- final long chunkKey = ChunkCoordIntPair.pair(x, z); +- world.getChunkProvider().unloadQueue.remove(chunkKey); + for (final BlockPos blockPos : BlockPos.betweenClosed(chunkPos.getMinBlockX(), serverLevel.getMinBuildHeight(), chunkPos.getMinBlockZ(), chunkPos.getMaxBlockX(), serverLevel.getMaxBuildHeight() - 1, chunkPos.getMaxBlockZ())) { + serverChunkCache.blockChanged(blockPos); - } ++ } -- return chunk != null; -- */ +- net.minecraft.server.Chunk chunk = world.getChunkProvider().generateChunk(x, z); +- PlayerChunk playerChunk = world.getPlayerChunkMap().getChunk(x, z); +- if (playerChunk != null) { +- playerChunk.chunk = chunk; + final Set chunksToRelight = new HashSet<>(9); + for (int chunkX = chunkPos.x - 1; chunkX <= chunkPos.x + 1 ; chunkX++) { + for (int chunkZ = chunkPos.z - 1; chunkZ <= chunkPos.z + 1 ; chunkZ++) { + chunksToRelight.add(new ChunkPos(chunkX, chunkZ)); + } -+ } -+ serverChunkCache.getLightEngine().relight(chunksToRelight, pos -> {}, relit -> {}); + } + +- if (chunk != null) { +- refreshChunk(x, z); ++ for (final ChunkPos pos : chunksToRelight) { ++ final ChunkAccess chunk = serverChunkCache.getChunk(pos.x, pos.z, false); ++ if (chunk != null) { ++ serverChunkCache.getLightEngine().lightChunk(chunk, false); ++ } + } + +- return chunk != null; +- */ + return true; + // Paper end - implement regenerate chunk method } diff --git a/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch index 18ec46d112..f4cd07d2d7 100644 --- a/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch +++ b/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch @@ -9,10 +9,10 @@ This might result in chunks loading far slower in the nether, for example. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d5436fd2037e510ccbcb195036c5056bbc1b374f..0207c7f3cc3a3bc130011325a592483531e8c949 100644 +index 1df847164796c0992e677e0db45a9be223c8dc4a..6a321f5d8dd8278d01e154f64a1685403255978c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1233,6 +1233,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 1ae13f0a320160210bd830f990f44de1eef3d5da..923782e94dfbac8a3270c15538e6b85bcaf8e8f2 100644 +index ef942e75ed1aefbc9175f99113cdfeada58e8a50..5e2a1a4bd047b6eb1581ce6e6d9b0f78be64c448 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1374,7 +1374,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1381,7 +1381,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { Preconditions.checkArgument(material != null, "Material cannot be null"); Preconditions.checkArgument(material.isBlock(), "Material.%s must be a block", material); @@ -28,7 +28,7 @@ index 1ae13f0a320160210bd830f990f44de1eef3d5da..923782e94dfbac8a3270c15538e6b85b return (FallingBlock) entity.getBukkitEntity(); } -@@ -1383,7 +1388,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1390,7 +1395,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { Preconditions.checkArgument(location != null, "Location cannot be null"); Preconditions.checkArgument(data != null, "BlockData cannot be null"); diff --git a/patches/server/0727-Buffer-OOB-setBlock-calls.patch b/patches/server/0727-Buffer-OOB-setBlock-calls.patch index cc1368326b..ae47164389 100644 --- a/patches/server/0727-Buffer-OOB-setBlock-calls.patch +++ b/patches/server/0727-Buffer-OOB-setBlock-calls.patch @@ -13,10 +13,10 @@ we'll also only gen a trace for the first one, I see no real pressing need to generate more, given that that would *massively* negate this patch otherwise diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index 23dfc741b31cdc25265fb5daffcae63417102a41..d6a9a6bd95307837ea76c0cb07666641c5e942a6 100644 +index d11741d2618976bdb51f75d823f260f32d5bafc9..ff94af5be8de374f5cde2607eebbb23e65705581 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -@@ -296,6 +296,7 @@ public class WorldGenRegion implements WorldGenLevel { +@@ -275,6 +275,7 @@ public class WorldGenRegion implements WorldGenLevel { } } @@ -24,7 +24,7 @@ index 23dfc741b31cdc25265fb5daffcae63417102a41..d6a9a6bd95307837ea76c0cb07666641 @Override public boolean ensureCanWrite(BlockPos pos) { int i = SectionPos.blockToSectionCoord(pos.getX()); -@@ -315,7 +316,15 @@ public class WorldGenRegion implements WorldGenLevel { +@@ -294,7 +295,15 @@ public class WorldGenRegion implements WorldGenLevel { return true; } else { diff --git a/patches/server/0738-Pass-ServerLevel-for-gamerule-callbacks.patch b/patches/server/0738-Pass-ServerLevel-for-gamerule-callbacks.patch index 3541c15f4c..103ec25d48 100644 --- a/patches/server/0738-Pass-ServerLevel-for-gamerule-callbacks.patch +++ b/patches/server/0738-Pass-ServerLevel-for-gamerule-callbacks.patch @@ -167,10 +167,10 @@ index f3cdf1fa7731eb7bb1cb89aa6a37204d81257cb0..0112ef51815c4fab38b95d5e917d335e this.onChanged(server); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 923782e94dfbac8a3270c15538e6b85bcaf8e8f2..c35f5a1a42b76b154bfbb161d23348e76f676090 100644 +index 5e2a1a4bd047b6eb1581ce6e6d9b0f78be64c448..12013237e7b00f47d2a8660fd09ee3d52fdf084c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1959,7 +1959,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1966,7 +1966,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper end - Add WorldGameRuleChangeEvent GameRules.Value handle = this.getHandle().getGameRules().getRule(CraftWorld.getGameRulesNMS().get(rule)); handle.deserialize(event.getValue()); // Paper - Add WorldGameRuleChangeEvent @@ -179,7 +179,7 @@ index 923782e94dfbac8a3270c15538e6b85bcaf8e8f2..c35f5a1a42b76b154bfbb161d23348e7 return true; } -@@ -2000,7 +2000,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2007,7 +2007,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper end - Add WorldGameRuleChangeEvent GameRules.Value handle = this.getHandle().getGameRules().getRule(CraftWorld.getGameRulesNMS().get(rule.getName())); handle.deserialize(event.getValue()); // Paper - Add WorldGameRuleChangeEvent diff --git a/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch index 954f93c541..bac0af6ad6 100644 --- a/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch +++ b/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch @@ -7,10 +7,10 @@ There are no plans to support creating worlds while worlds are being ticked themselvess. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7bb06b95c116eae425ab53f340f75c2e68da1081..13c08973d692a23188d045e82d4f1c4c93008426 100644 +index c0353463f59ae4d3fe94ee15feb95a4ec1a064f4..6e7e8aa26a60d774d51148bc8dca5e5c901f81e7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -306,6 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1438,7 +1439,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - BlockPhysicsEvent -@@ -1508,6 +1511,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z); } -@@ -2336,6 +2356,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2343,6 +2363,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/0781-Add-NamespacedKey-biome-methods.patch b/patches/server/0781-Add-NamespacedKey-biome-methods.patch index 7823841639..1656e9d9f2 100644 --- a/patches/server/0781-Add-NamespacedKey-biome-methods.patch +++ b/patches/server/0781-Add-NamespacedKey-biome-methods.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add NamespacedKey biome methods Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com> diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index fd1ec07ada04de98d0a4f1ca4c93ec53771f88d7..0185faee3051c04b4924753ba56536e4e070476b 100644 +index 34c19a422de27cd6aa08159186a0180215c0837d..3bf1c2a5273879a64e81bcd8c107e7bc82cf679c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -601,6 +601,19 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -605,6 +605,19 @@ public final class CraftMagicNumbers implements UnsafeValues { Preconditions.checkArgument(material.isBlock(), material + " is not a block"); return getBlock(material).hasCollision; } diff --git a/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch index eb539d450b..68314fc167 100644 --- a/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch +++ b/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch @@ -37,10 +37,10 @@ index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dc + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7819b889654cc6bac588532ffe7b32f36e9f8912..35eca4018d33d772f9a53f4d2a7830b8c38a8518 100644 +index 6e7e8aa26a60d774d51148bc8dca5e5c901f81e7..aaf49ff8339e360461dedfe940449b4bf9be1b66 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1160,6 +1160,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index 1fd0854fb4f8ab3b5da3cda5ddd2535a0faa6adf..a6793f227fa90a37260cf0b9d5e9b6f1f47ff920 100644 +index c9bb2df0d884227576ed8d2e72219bbbd7ba827e..534d9c380f26d6cce3c99fa88ad2e15410535094 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java -@@ -42,6 +42,7 @@ public final class PaperCommand extends Command { +@@ -41,6 +41,7 @@ public final class PaperCommand extends Command { commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand()); commands.put(Set.of("dumpitem"), new DumpItemCommand()); commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand()); diff --git a/patches/server/0820-Fix-async-entity-add-due-to-fungus-trees.patch b/patches/server/0820-Fix-async-entity-add-due-to-fungus-trees.patch index 6c8db92383..2486d05f04 100644 --- a/patches/server/0820-Fix-async-entity-add-due-to-fungus-trees.patch +++ b/patches/server/0820-Fix-async-entity-add-due-to-fungus-trees.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix async entity add due to fungus trees diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index 1c2ec978f923521322aaec59b4e88d26d656b6cd..5ece375eaf6bcc61864997a389bb5e24625e4505 100644 +index ff94af5be8de374f5cde2607eebbb23e65705581..209596e89307b9e1d0ff4c465876d29fef4fc290 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -@@ -249,6 +249,7 @@ public class WorldGenRegion implements WorldGenLevel { +@@ -228,6 +228,7 @@ public class WorldGenRegion implements WorldGenLevel { if (iblockdata.isAir()) { return false; } else { diff --git a/patches/server/0830-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch b/patches/server/0830-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch index e57df15047..a27e98f7ca 100644 --- a/patches/server/0830-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch +++ b/patches/server/0830-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Improve inlining for some hot BlockBehavior and FluidState diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index aa15d65f69f89da97cecd47c3458cd3b4937055f..a274d0c3b4cceb2688a41ac1c3fbaa1a03704224 100644 +index c8ccf424dccef47aaa9c9b6e03f49fe783035c0a..ab174986ad558916427a70f59c6907f17b0d01df 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -989,15 +989,15 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -975,15 +975,15 @@ public abstract class BlockBehaviour implements FeatureElement { return this.shapeExceedsCube; // Paper - moved into shape cache init } @@ -28,7 +28,7 @@ index aa15d65f69f89da97cecd47c3458cd3b4937055f..a274d0c3b4cceb2688a41ac1c3fbaa1a return this.isAir; } -@@ -1081,7 +1081,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -1067,7 +1067,7 @@ public abstract class BlockBehaviour implements FeatureElement { } } @@ -37,7 +37,7 @@ index aa15d65f69f89da97cecd47c3458cd3b4937055f..a274d0c3b4cceb2688a41ac1c3fbaa1a return this.canOcclude; } -@@ -1289,11 +1289,11 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -1275,11 +1275,11 @@ public abstract class BlockBehaviour implements FeatureElement { return this.getBlock().builtInRegistryHolder().is(key); } diff --git a/patches/server/0839-Flying-Fall-Damage.patch b/patches/server/0839-Flying-Fall-Damage.patch index 7d9c4d6035..fe06e47cf0 100644 --- a/patches/server/0839-Flying-Fall-Damage.patch +++ b/patches/server/0839-Flying-Fall-Damage.patch @@ -26,10 +26,10 @@ index e0fd3c3a129216ad1272a6e038eb16cb44e45475..182180275be3bf90b9f8e66dcf19ad6c } else { if (fallDistance >= 2.0F) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3f8f928b61ff48e403d7a391343e62fbedf5826d..c9616b31b074c82eb06d9254ae65a0a85260d480 100644 +index 2f299e3485fca4701719a31ba6c981b91155cf05..f807dfc75a8e8f1e642aeedfb46def1e5aacde85 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2430,6 +2430,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2432,6 +2432,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().onUpdateAbilities(); } diff --git a/patches/server/0904-Folia-scheduler-and-owned-region-API.patch b/patches/server/0904-Folia-scheduler-and-owned-region-API.patch index 5644b80eb8..33bafa151a 100644 --- a/patches/server/0904-Folia-scheduler-and-owned-region-API.patch +++ b/patches/server/0904-Folia-scheduler-and-owned-region-API.patch @@ -1148,10 +1148,10 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 016cebed19ca382a40e4fabee1b96aec816944bf..469e108c844880b1a95e5aa9f0f8f12375cc314a 100644 +index aaf49ff8339e360461dedfe940449b4bf9be1b66..f7e5d95bd94b87fb17fa98a170d171fbdd6d8357 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1434,6 +1434,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop biomeBase = cra.getHandle().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.BIOME).getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.BIOME, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(biomeKey))); cra.setBiome(x, y, z, biomeBase); } diff --git a/patches/server/0915-Bandaid-fix-for-Effect.patch b/patches/server/0915-Bandaid-fix-for-Effect.patch index 7cc42138ae..323cc5986c 100644 --- a/patches/server/0915-Bandaid-fix-for-Effect.patch +++ b/patches/server/0915-Bandaid-fix-for-Effect.patch @@ -60,10 +60,10 @@ index a4519762175c68256b1f303daca8b9408ac182bb..457e9093adb99d31ffc7f061d8c858f9 case COMPOSTER_FILL_ATTEMPT: datavalue = ((Boolean) data) ? 1 : 0; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 551e13635a82df8f2a420a758d08d3ccb2128e8c..3cca22e7ef6a2558a539d67705fc64c0f8867fe8 100644 +index caca37e0febbfaa2012820c8a6f0e6adbaf2451b..467aacb5ce61ac79d8294067fd681b081c195fbe 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1351,7 +1351,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1358,7 +1358,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { public void playEffect(Location loc, Effect effect, T data, int radius) { if (data != null) { Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect); @@ -73,7 +73,7 @@ index 551e13635a82df8f2a420a758d08d3ccb2128e8c..3cca22e7ef6a2558a539d67705fc64c0 // Special case: the axis is optional for ELECTRIC_SPARK Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a003b72f5c0384712ffd39f6505a408e09cbbc25..6d6bbd1d40bbb6d8c0b9a03b6c69f98c0370e866 100644 +index 63b7118d23959ad75565271cc2b8a1143cd550e1..d06bce05edf6026be2af9583cddea70739a72032 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -831,7 +831,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch b/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch index 1b37f747b4..0dabb11567 100644 --- a/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch +++ b/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch @@ -10,10 +10,10 @@ which would cause a crash on Folia but would appear to function fine on Paper. diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index 7ca4790d564846c1ab9560e349005eea8aef35b8..94e9919da2ba5a36afa5b7f97af888cb113bb14b 100644 +index 29aaedbe70901fdd98f15f2ca5ba382106091d1a..f594b5c60c723ef70e51ab30b45b90f89d6972d6 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -@@ -346,6 +346,13 @@ public class ChunkSerializer { +@@ -307,6 +307,13 @@ public class ChunkSerializer { for (int k1 = 0; k1 < nbttaglist3.size(); ++k1) { CompoundTag nbttagcompound4 = nbttaglist3.getCompound(k1); @@ -27,7 +27,7 @@ index 7ca4790d564846c1ab9560e349005eea8aef35b8..94e9919da2ba5a36afa5b7f97af888cb ((ChunkAccess) object1).setBlockEntityNbt(nbttagcompound4); } -@@ -591,10 +598,19 @@ public class ChunkSerializer { +@@ -517,10 +524,19 @@ public class ChunkSerializer { CompoundTag nbttagcompound1 = nbttaglist1.getCompound(i); boolean flag = nbttagcompound1.getBoolean("keepPacked"); diff --git a/patches/server/0958-Add-player-idle-duration-API.patch b/patches/server/0958-Add-player-idle-duration-API.patch index 6a84393957..d112b47a20 100644 --- a/patches/server/0958-Add-player-idle-duration-API.patch +++ b/patches/server/0958-Add-player-idle-duration-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API Implements API for getting and resetting a player's idle duration. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ea8eca5a7359d68095d073ea725f12a45e44dcaa..350d4e75401d2adda3f60e5637eac3d6c278c928 100644 +index 3155a7978f9cb77c7cfe299f751f2231ba71c478..7523db3196409c5d04069ff4bd22ba06bcfbbe84 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3269,6 +3269,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3271,6 +3271,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch b/patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch index 68e3bc845e..8488f5abd8 100644 --- a/patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch +++ b/patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch @@ -47,10 +47,10 @@ index c978f3b2d42f512e982f289e76c2422e41b7eec6..bb8e962e63c7a2d931f9bd7f7c002aa3 Vec3 vec3d = raytrace1.getFrom().subtract(raytrace1.getTo()); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 3cca22e7ef6a2558a539d67705fc64c0f8867fe8..11ad72b87651b380ceb7083322d1a8993837da2d 100644 +index 467aacb5ce61ac79d8294067fd681b081c195fbe..3a941be852a2dd5114ca9673597e84e3813d6ee2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1085,9 +1085,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1092,9 +1092,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize, Predicate filter) { @@ -68,7 +68,7 @@ index 3cca22e7ef6a2558a539d67705fc64c0f8867fe8..11ad72b87651b380ceb7083322d1a899 Preconditions.checkArgument(direction != null, "Vector direction cannot be null"); direction.checkFinite(); -@@ -1137,9 +1143,16 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1144,9 +1150,16 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) { @@ -87,7 +87,7 @@ index 3cca22e7ef6a2558a539d67705fc64c0f8867fe8..11ad72b87651b380ceb7083322d1a899 Preconditions.checkArgument(direction != null, "Vector direction cannot be null"); direction.checkFinite(); -@@ -1152,16 +1165,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1159,16 +1172,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { } Vector dir = direction.clone().normalize().multiply(maxDistance); diff --git a/patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch b/patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch index ddd7a5783d..beed351bbb 100644 --- a/patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch +++ b/patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch @@ -45,10 +45,10 @@ index 0db0d67f9ac15372becc1166c37f7f0aede4a4da..a9e70484b01fc082ea25d43d1d428334 BlockState iblockdata = BaseFireBlock.getState(this.level(), blockposition); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 11ad72b87651b380ceb7083322d1a8993837da2d..0617419975f843f3899b2cb013fd37ea631dd320 100644 +index 3a941be852a2dd5114ca9673597e84e3813d6ee2..da5f8dc6b4fce78f5f6278396d58474a5cc13f12 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -733,7 +733,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -740,7 +740,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { LightningBolt lightning = EntityType.LIGHTNING_BOLT.create(this.world); lightning.moveTo(loc.getX(), loc.getY(), loc.getZ()); diff --git a/patches/server/0976-Add-Structure-check-API.patch b/patches/server/0975-Add-Structure-check-API.patch similarity index 91% rename from patches/server/0976-Add-Structure-check-API.patch rename to patches/server/0975-Add-Structure-check-API.patch index 01a73c5287..12af3e4045 100644 --- a/patches/server/0976-Add-Structure-check-API.patch +++ b/patches/server/0975-Add-Structure-check-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add Structure check API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 0617419975f843f3899b2cb013fd37ea631dd320..d7fb40682d446b962d9e19ca88b297c4e9a28231 100644 +index d3ea1097a3df1af221d190aaa8c7c246f75e2b90..a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -230,6 +230,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0975-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch b/patches/server/0976-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch similarity index 100% rename from patches/server/0975-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch rename to patches/server/0976-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch diff --git a/patches/server/0977-Restore-vanilla-entity-drops-behavior.patch b/patches/server/0977-Restore-vanilla-entity-drops-behavior.patch index 74f1b6a5c6..5f294896fb 100644 --- a/patches/server/0977-Restore-vanilla-entity-drops-behavior.patch +++ b/patches/server/0977-Restore-vanilla-entity-drops-behavior.patch @@ -50,7 +50,7 @@ index 6147ffdcb83a9d013a05facd75453d6500064fe7..ecf463139bb6567103d81ae26cfff53d if (entityitem == null) { return null; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7fa7cb2a567c90a4bb7cf20c7182c45395b6ea32..2a1cbb548bfe65382483597c6350450033dffdb1 100644 +index 5fec06e12ede63496f75ccf43f52b16301d11eb0..4575e3e8a21e47d39fd3639163e804ec9dc452a6 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2476,6 +2476,25 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0980-add-more-scoreboard-API.patch b/patches/server/0979-add-more-scoreboard-API.patch similarity index 100% rename from patches/server/0980-add-more-scoreboard-API.patch rename to patches/server/0979-add-more-scoreboard-API.patch diff --git a/patches/server/0981-Improve-Registry.patch b/patches/server/0980-Improve-Registry.patch similarity index 100% rename from patches/server/0981-Improve-Registry.patch rename to patches/server/0980-Improve-Registry.patch diff --git a/patches/server/0982-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch b/patches/server/0981-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch similarity index 100% rename from patches/server/0982-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch rename to patches/server/0981-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch diff --git a/patches/server/0983-Add-experience-points-API.patch b/patches/server/0982-Add-experience-points-API.patch similarity index 97% rename from patches/server/0983-Add-experience-points-API.patch rename to patches/server/0982-Add-experience-points-API.patch index c7b16fc198..23a45d1ba3 100644 --- a/patches/server/0983-Add-experience-points-API.patch +++ b/patches/server/0982-Add-experience-points-API.patch @@ -18,7 +18,7 @@ index 182180275be3bf90b9f8e66dcf19ad6ce02136bf..2759fa8768cfa7a38af7266a8e58af5f // Paper start - send while respecting visibility private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 51a63de2e0bb43c35cd9b8e6c431ec81fc9aecd1..89a248b392a4001e951415a3560c39259a83e8d0 100644 +index 81d89d2d3c3144e6b4667597d39eddcceb9f1913..5743013c527c80f2dda444b5bf2d8872ff000386 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1779,6 +1779,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0984-Add-drops-to-shear-events.patch b/patches/server/0983-Add-drops-to-shear-events.patch similarity index 100% rename from patches/server/0984-Add-drops-to-shear-events.patch rename to patches/server/0983-Add-drops-to-shear-events.patch diff --git a/patches/server/0985-Add-PlayerShieldDisableEvent.patch b/patches/server/0984-Add-PlayerShieldDisableEvent.patch similarity index 100% rename from patches/server/0985-Add-PlayerShieldDisableEvent.patch rename to patches/server/0984-Add-PlayerShieldDisableEvent.patch diff --git a/patches/server/0986-Validate-ResourceLocation-in-NBT-reading.patch b/patches/server/0985-Validate-ResourceLocation-in-NBT-reading.patch similarity index 100% rename from patches/server/0986-Validate-ResourceLocation-in-NBT-reading.patch rename to patches/server/0985-Validate-ResourceLocation-in-NBT-reading.patch diff --git a/patches/server/0987-Properly-handle-experience-dropping-on-block-break.patch b/patches/server/0986-Properly-handle-experience-dropping-on-block-break.patch similarity index 97% rename from patches/server/0987-Properly-handle-experience-dropping-on-block-break.patch rename to patches/server/0986-Properly-handle-experience-dropping-on-block-break.patch index 3cebe8aa1c..0fb2129a50 100644 --- a/patches/server/0987-Properly-handle-experience-dropping-on-block-break.patch +++ b/patches/server/0986-Properly-handle-experience-dropping-on-block-break.patch @@ -68,10 +68,10 @@ index 660ede322b4f4ccad241820d8ffd4540ebb18fbc..63217d3db86b467f3358730eb8b9b3c9 } diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index a274d0c3b4cceb2688a41ac1c3fbaa1a03704224..4c6ab71c3222ce03edd70abef35c71398d885c13 100644 +index ab174986ad558916427a70f59c6907f17b0d01df..20de3aeb4991dcfd0bbf813075a4c76e277b7598 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -1197,6 +1197,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -1183,6 +1183,7 @@ public abstract class BlockBehaviour implements FeatureElement { public void spawnAfterBreak(ServerLevel world, BlockPos pos, ItemStack tool, boolean dropExperience) { this.getBlock().spawnAfterBreak(this.asState(), world, pos, tool, dropExperience); diff --git a/patches/server/0988-Fixup-NamespacedKey-handling.patch b/patches/server/0987-Fixup-NamespacedKey-handling.patch similarity index 100% rename from patches/server/0988-Fixup-NamespacedKey-handling.patch rename to patches/server/0987-Fixup-NamespacedKey-handling.patch diff --git a/patches/server/0990-Expose-LootTable-of-DecoratedPot.patch b/patches/server/0988-Expose-LootTable-of-DecoratedPot.patch similarity index 100% rename from patches/server/0990-Expose-LootTable-of-DecoratedPot.patch rename to patches/server/0988-Expose-LootTable-of-DecoratedPot.patch diff --git a/patches/server/0989-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/patches/server/0989-Reduce-allocation-of-Vec3D-by-entity-tracker.patch index 364e247001..d64cc30c77 100644 --- a/patches/server/0989-Reduce-allocation-of-Vec3D-by-entity-tracker.patch +++ b/patches/server/0989-Reduce-allocation-of-Vec3D-by-entity-tracker.patch @@ -18,7 +18,7 @@ index 3c4ac79c094dc2fff7de94150a34b7bf814ac0de..38b56923a642afc1cb411480ba03cc78 @VisibleForTesting static long encode(double value) { diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 0801bbba0ea2a5d6e19d503ee31ad6717f1d5234..a1fd9d902bb6ebca7ca7edc584cbf72a138368eb 100644 +index 886ddaf896c8385a744e9abe4dcd399bc693f60b..9dab2dd7fd77fa1006c903dc5d1f4f8339e10b91 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -1735,10 +1735,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider diff --git a/patches/server/0015-Rewrite-dataconverter-system.patch b/patches/server/0990-Rewrite-dataconverter-system.patch similarity index 99% rename from patches/server/0015-Rewrite-dataconverter-system.patch rename to patches/server/0990-Rewrite-dataconverter-system.patch index b25429c6d6..ef1dfaa9bd 100644 --- a/patches/server/0015-Rewrite-dataconverter-system.patch +++ b/patches/server/0990-Rewrite-dataconverter-system.patch @@ -24806,10 +24806,10 @@ index 2939fad9c86f358b317f815d6efff0f41f6a3ea8..3e4cd09fc37d72d22a0f966039d1e65b return structureTemplate.save(new CompoundTag()); } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java -index 25623dcd44edc475c5dce2756bf99fc18e142b63..6c0f87535ffa95cf82ab4b03bb7bf8f2132d275f 100644 +index 6743dca44e6552ad39aca757a24f3c4df400d83d..eebaf98bc0fa4696af59b2a79563beb73501a554 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java -@@ -78,7 +78,7 @@ public class ChunkStorage implements AutoCloseable { +@@ -79,7 +79,7 @@ public class ChunkStorage implements AutoCloseable { int i = ChunkStorage.getVersion(nbttagcompound); // CraftBukkit start @@ -24818,7 +24818,7 @@ index 25623dcd44edc475c5dce2756bf99fc18e142b63..6c0f87535ffa95cf82ab4b03bb7bf8f2 CompoundTag level = nbttagcompound.getCompound("Level"); if (level.getBoolean("TerrainPopulated") && !level.getBoolean("LightPopulated")) { ServerChunkCache cps = (generatoraccess == null) ? null : ((ServerLevel) generatoraccess).getChunkSource(); -@@ -90,7 +90,7 @@ public class ChunkStorage implements AutoCloseable { +@@ -91,7 +91,7 @@ public class ChunkStorage implements AutoCloseable { // CraftBukkit end if (i < 1493) { @@ -24827,7 +24827,7 @@ index 25623dcd44edc475c5dce2756bf99fc18e142b63..6c0f87535ffa95cf82ab4b03bb7bf8f2 if (nbttagcompound.getCompound("Level").getBoolean("hasLegacyStructureData")) { LegacyStructureDataHandler persistentstructurelegacy = this.getLegacyStructureHandler(resourcekey, supplier); -@@ -108,7 +108,7 @@ public class ChunkStorage implements AutoCloseable { +@@ -109,7 +109,7 @@ public class ChunkStorage implements AutoCloseable { // Spigot end ChunkStorage.injectDatafixingContext(nbttagcompound, resourcekey, optional); @@ -24926,7 +24926,7 @@ index 836bcea1c6a9de29b4a248220331f3a8c697204d..399da9d43aefbb95897df4697860d5bc Path path = save.dataFile(); diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java -index 8292978e1386c55d99241c3ee2ead3440b9e2570..3d74ffc6e38b0dbe7ca6d8d84a63f78d6b1908a7 100644 +index 49d39980054bce470ddaceeb6ab7fab83bf8dc54..63e187c65cb855031f286aad0d25ac4694f7a331 100644 --- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java +++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java @@ -97,7 +97,7 @@ public class PlayerDataStorage { @@ -24938,3 +24938,26 @@ index 8292978e1386c55d99241c3ee2ead3440b9e2570..3d74ffc6e38b0dbe7ca6d8d84a63f78d player.load(nbttagcompound); } +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +index b9183a9a657c2cd320fca0f15db0dae6827546f1..4e1390b9244aeb745ffd3fd1257bc74248722515 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +@@ -500,8 +500,7 @@ public final class CraftMagicNumbers implements UnsafeValues { + + CompoundTag compound = deserializeNbtFromBytes(data); + final int dataVersion = compound.getInt("DataVersion"); +- compound = (CompoundTag) MinecraftServer.getServer().fixerUpper.update(References.ITEM_STACK, new Dynamic<>(NbtOps.INSTANCE, compound), dataVersion, this.getDataVersion()).getValue(); +- return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(compound)); ++ return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ITEM_STACK, compound, dataVersion, this.getDataVersion()))); // Paper - rewrite dataconverter + } + + @Override +@@ -521,7 +520,7 @@ public final class CraftMagicNumbers implements UnsafeValues { + + CompoundTag compound = deserializeNbtFromBytes(data); + int dataVersion = compound.getInt("DataVersion"); +- compound = (CompoundTag) MinecraftServer.getServer().fixerUpper.update(References.ENTITY, new Dynamic<>(NbtOps.INSTANCE, compound), dataVersion, this.getDataVersion()).getValue(); ++ compound = ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ENTITY, compound, dataVersion, getDataVersion()); // Paper - rewrite dataconverter + if (!preserveUUID) { + // Generate a new UUID so we don't have to worry about deserializing the same entity twice + compound.remove("UUID"); diff --git a/patches/server/0016-Starlight.patch b/patches/server/0991-Starlight.patch similarity index 98% rename from patches/server/0016-Starlight.patch rename to patches/server/0991-Starlight.patch index 39d3cff759..a563feb5eb 100644 --- a/patches/server/0016-Starlight.patch +++ b/patches/server/0991-Starlight.patch @@ -7,7 +7,6 @@ See https://github.com/PaperMC/Starlight == AT == public net.minecraft.server.level.ChunkHolder broadcast(Lnet/minecraft/network/protocol/Packet;Z)V -public net.minecraft.world.level.chunk.LevelChunkSection states diff --git a/src/main/java/ca/spottedleaf/starlight/common/light/BlockStarLightEngine.java b/src/main/java/ca/spottedleaf/starlight/common/light/BlockStarLightEngine.java new file mode 100644 @@ -4347,13 +4346,13 @@ index 0000000000000000000000000000000000000000..dd995e25ae620ae36cd5eecb2fe10ad0 + +} diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index 6d06b772ffb9d47d6a717462a4b2b494544e80ae..de0e1ad2c78e5132651494f198703533847c84bd 100644 +index 534d9c380f26d6cce3c99fa88ad2e15410535094..e47fb2aa5e885162cae5cbfc9f33ff7864bf538e 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java -@@ -38,6 +38,7 @@ public final class PaperCommand extends Command { - commands.put(Set.of("reload"), new ReloadCommand()); - commands.put(Set.of("version"), new VersionCommand()); - commands.put(Set.of("dumpplugins"), new DumpPluginsCommand()); +@@ -42,6 +42,7 @@ public final class PaperCommand extends Command { + commands.put(Set.of("dumpitem"), new DumpItemCommand()); + commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand()); + commands.put(Set.of("dumplisteners"), new DumpListenersCommand()); + commands.put(Set.of("fixlight"), new FixLightCommand()); return commands.entrySet().stream() @@ -4480,7 +4479,7 @@ index 0000000000000000000000000000000000000000..463c6d8d5b114816ed90655582859458 + } +} diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index 5250bf5029825524c239854db7999883459f1a8a..c5cd2c2c28795593712b0de2bbaa7e3860f1131a 100644 +index facfdbb87e89f4db33ce13233c2ba4366d35c15b..807a6bb1026dac2c4cd0a50afe06fd62ce23558b 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -53,7 +53,7 @@ public class ChunkHolder { @@ -4493,7 +4492,7 @@ index 5250bf5029825524c239854db7999883459f1a8a..c5cd2c2c28795593712b0de2bbaa7e38 private final DebugBuffer chunkToSaveHistory; public int oldTicketLevel; diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 7ee1b9fe8099091feaf09c4e7ffda99159b33c9b..c581ddf24f66a98798e8965adc848638edd889de 100644 +index 9dab2dd7fd77fa1006c903dc5d1f4f8339e10b91..3ae47b86b80f9156e71d1da83e492153f360d1b5 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -125,7 +125,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -4506,7 +4505,7 @@ index 7ee1b9fe8099091feaf09c4e7ffda99159b33c9b..c581ddf24f66a98798e8965adc848638 private final RandomState randomState; private final ChunkGeneratorStructureState chunkGeneratorState; diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java -index 76005b3c48bfa323a77781c20c63708eeaa66b2b..222e72baa2fdb27c592e4c9ebef8303263b8d8ce 100644 +index 4e1618462840a1378dbe6492696c97544815edf2..8e8e3896040241bba8fd15f4d6d046567847f741 100644 --- a/src/main/java/net/minecraft/server/level/DistanceManager.java +++ b/src/main/java/net/minecraft/server/level/DistanceManager.java @@ -380,7 +380,7 @@ public abstract class DistanceManager { @@ -4851,7 +4850,7 @@ index 0d536d72ac918fbd403397ff369d10143ee9c204..6051e5f272838ef23276a90e21c2fc82 public static TicketType create(String name, Comparator argumentComparator) { return new TicketType<>(name, argumentComparator, 0L); diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index d11741d2618976bdb51f75d823f260f32d5bafc9..23dfc741b31cdc25265fb5daffcae63417102a41 100644 +index 209596e89307b9e1d0ff4c465876d29fef4fc290..c3e7bd8865cc8990fc59f1ff0dfc1697cbb5ca49 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java @@ -107,6 +107,27 @@ public class WorldGenRegion implements WorldGenLevel { @@ -4883,18 +4882,18 @@ index d11741d2618976bdb51f75d823f260f32d5bafc9..23dfc741b31cdc25265fb5daffcae634 return this.level.getChunkSource().chunkMap.isOldChunkAround(chunkPos, checkRadius); } diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index b6d3f9f9520e410526cfeabcdeb9720dbe30e4bf..a009fca54665cbc3f11cad776256fbf1fbbb18c7 100644 +index 20de3aeb4991dcfd0bbf813075a4c76e277b7598..4c6ab71c3222ce03edd70abef35c71398d885c13 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -874,6 +874,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -881,6 +881,7 @@ public abstract class BlockBehaviour implements FeatureElement { this.spawnTerrainParticles = blockbase_info.spawnTerrainParticles; this.instrument = blockbase_info.instrument; this.replaceable = blockbase_info.replaceable; + this.conditionallyFullOpaque = this.canOcclude & this.useShapeForLightOcclusion; // Paper } - - private boolean calculateSolid() { -@@ -902,6 +903,18 @@ public abstract class BlockBehaviour implements FeatureElement { + // Paper start - Perf: impl cached craft block data, lazy load to fix issue with loading at the wrong time + private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData; +@@ -917,6 +918,18 @@ public abstract class BlockBehaviour implements FeatureElement { return this.shapeExceedsCube; } // Paper end @@ -4913,7 +4912,7 @@ index b6d3f9f9520e410526cfeabcdeb9720dbe30e4bf..a009fca54665cbc3f11cad776256fbf1 public void initCache() { this.fluidState = ((Block) this.owner).getFluidState(this.asState()); -@@ -910,6 +923,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -925,6 +938,7 @@ public abstract class BlockBehaviour implements FeatureElement { this.cache = new BlockBehaviour.BlockStateBase.Cache(this.asState()); } this.shapeExceedsCube = this.cache == null || this.cache.largeCollisionShape; // Paper - moved from actual method to here @@ -5135,10 +5134,10 @@ index 6bb508105641b5729572736c5c3f9bd6711e309a..60e760b42dd6471a229dfd45490dcf8c @Override public BlockEntity getBlockEntity(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 c2179ea2a16ae0fac0b59d81a57abf13f563843f..3e51fb9fe05d5b974ae41ccc0acbb516a07c114b 100644 +index af757309cb46af6df07872f7596b66df6d6f18d7..73e682bb3ef3b2e450ec8c594b5365c7a340615e 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -219,6 +219,12 @@ public class LevelChunk extends ChunkAccess { +@@ -220,6 +220,12 @@ public class LevelChunk extends ChunkAccess { public LevelChunk(ServerLevel world, ProtoChunk protoChunk, @Nullable LevelChunk.PostLoadProcessor entityLoader) { this(world, protoChunk.getPos(), protoChunk.getUpgradeData(), protoChunk.unpackBlockTicks(), protoChunk.unpackFluidTicks(), protoChunk.getInhabitedTime(), protoChunk.getSections(), entityLoader, protoChunk.getBlendingData()); @@ -5151,7 +5150,7 @@ index c2179ea2a16ae0fac0b59d81a57abf13f563843f..3e51fb9fe05d5b974ae41ccc0acbb516 Iterator iterator = protoChunk.getBlockEntities().values().iterator(); while (iterator.hasNext()) { -@@ -245,7 +251,7 @@ public class LevelChunk extends ChunkAccess { +@@ -246,7 +252,7 @@ public class LevelChunk extends ChunkAccess { } } @@ -5160,7 +5159,7 @@ index c2179ea2a16ae0fac0b59d81a57abf13f563843f..3e51fb9fe05d5b974ae41ccc0acbb516 this.setLightCorrect(protoChunk.isLightCorrect()); this.unsaved = true; this.needsDecoration = true; // CraftBukkit -@@ -426,7 +432,7 @@ public class LevelChunk extends ChunkAccess { +@@ -437,7 +443,7 @@ public class LevelChunk extends ChunkAccess { ProfilerFiller gameprofilerfiller = this.level.getProfiler(); gameprofilerfiller.push("updateSkyLightSources"); @@ -5170,7 +5169,7 @@ index c2179ea2a16ae0fac0b59d81a57abf13f563843f..3e51fb9fe05d5b974ae41ccc0acbb516 this.level.getChunkSource().getLightEngine().checkBlock(blockposition); gameprofilerfiller.pop(); diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index b8fb6d1d85e07f5165bfaf7d80807e069b595851..1219200cd915d6239a32a2bd09d325cd8fa9b346 100644 +index dd62e257e16974a6d556a7f5e2d113a2cbc08981..dfae0918079425df92d958b04275be8ae60d4b60 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java @@ -143,7 +143,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer @@ -5196,13 +5195,13 @@ index 38ec21faaa16df5485a81a581506700a5ab0a440..7da1ed9640211b0e064162dcdb000053 } } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb694632ede5 100644 +index f594b5c60c723ef70e51ab30b45b90f89d6972d6..7e416ad09959a08931c207f62d97af4ee868c039 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -@@ -84,6 +84,14 @@ public class ChunkSerializer { - public static final String BLOCK_LIGHT_TAG = "BlockLight"; - public static final String SKY_LIGHT_TAG = "SkyLight"; - +@@ -88,6 +88,14 @@ public class ChunkSerializer { + private static final int CURRENT_DATA_VERSION = net.minecraft.SharedConstants.getCurrentVersion().getDataVersion().getVersion(); + private static final boolean JUST_CORRUPT_IT = Boolean.getBoolean("Paper.ignoreWorldDataVersion"); + // Paper end - Do not let the server load chunks from newer versions + // Paper start - replace light engine impl + private static final int STARLIGHT_LIGHT_VERSION = 9; + @@ -5213,8 +5212,8 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 + public ChunkSerializer() {} - public static ProtoChunk read(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt) { -@@ -94,13 +102,20 @@ public class ChunkSerializer { + // Paper start - guard against serializing mismatching coordinates +@@ -119,13 +127,20 @@ public class ChunkSerializer { } UpgradeData chunkconverter = nbt.contains("UpgradeData", 10) ? new UpgradeData(nbt.getCompound("UpgradeData"), world) : UpgradeData.EMPTY; @@ -5236,7 +5235,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 Registry iregistry = world.registryAccess().registryOrThrow(Registries.BIOME); Codec>> codec = ChunkSerializer.makeBiomeCodecRW(iregistry); // CraftBukkit - read/write boolean flag2 = false; -@@ -108,7 +123,7 @@ public class ChunkSerializer { +@@ -133,7 +148,7 @@ public class ChunkSerializer { DataResult dataresult; for (int j = 0; j < nbttaglist.size(); ++j) { @@ -5245,7 +5244,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 byte b0 = nbttagcompound1.getByte("Y"); int k = world.getSectionIndexFromSectionY(b0); -@@ -151,19 +166,39 @@ public class ChunkSerializer { +@@ -176,19 +191,39 @@ public class ChunkSerializer { boolean flag3 = nbttagcompound1.contains("BlockLight", 7); boolean flag4 = flag1 && nbttagcompound1.contains("SkyLight", 7); @@ -5293,7 +5292,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 } } -@@ -192,6 +227,8 @@ public class ChunkSerializer { +@@ -217,6 +252,8 @@ public class ChunkSerializer { }, chunkPos); object1 = new LevelChunk(world.getLevel(), chunkPos, chunkconverter, levelchunkticks, levelchunkticks1, l, achunksection, ChunkSerializer.postLoadChunk(world, nbt), blendingdata); @@ -5302,7 +5301,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 } else { ProtoChunkTicks protochunkticklist = ProtoChunkTicks.load(nbt.getList("block_ticks", 10), (s) -> { return BuiltInRegistries.BLOCK.getOptional(ResourceLocation.tryParse(s)); -@@ -200,6 +237,8 @@ public class ChunkSerializer { +@@ -225,6 +262,8 @@ public class ChunkSerializer { return BuiltInRegistries.FLUID.getOptional(ResourceLocation.tryParse(s)); }, chunkPos); ProtoChunk protochunk = new ProtoChunk(chunkPos, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, world, iregistry, blendingdata); @@ -5311,7 +5310,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 object1 = protochunk; protochunk.setInhabitedTime(l); -@@ -314,6 +353,12 @@ public class ChunkSerializer { +@@ -346,6 +385,12 @@ public class ChunkSerializer { // CraftBukkit end public static CompoundTag write(ServerLevel world, ChunkAccess chunk) { @@ -5324,7 +5323,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 ChunkPos chunkcoordintpair = chunk.getPos(); CompoundTag nbttagcompound = NbtUtils.addCurrentDataVersion(new CompoundTag()); -@@ -363,11 +408,14 @@ public class ChunkSerializer { +@@ -395,11 +440,14 @@ public class ChunkSerializer { for (int i = lightenginethreaded.getMinLightSection(); i < lightenginethreaded.getMaxLightSection(); ++i) { int j = chunk.getSectionIndexFromSectionY(i); boolean flag1 = j >= 0 && j < achunksection.length; @@ -5343,7 +5342,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 if (flag1) { LevelChunkSection chunksection = achunksection[j]; -@@ -382,13 +430,27 @@ public class ChunkSerializer { +@@ -414,13 +462,27 @@ public class ChunkSerializer { nbttagcompound1.put("biomes", (Tag) dataresult1.getOrThrow(false, logger1::error)); } @@ -5375,7 +5374,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 if (!nbttagcompound1.isEmpty()) { nbttagcompound1.putByte("Y", (byte) i); -@@ -399,7 +461,8 @@ public class ChunkSerializer { +@@ -431,7 +493,8 @@ public class ChunkSerializer { nbttagcompound.put("sections", nbttaglist); if (flag) { @@ -5385,7 +5384,7 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 } ListTag nbttaglist1 = new ListTag(); -@@ -473,6 +536,17 @@ public class ChunkSerializer { +@@ -505,6 +568,17 @@ public class ChunkSerializer { })); } @@ -5403,3 +5402,21 @@ index cc1d7626a82881c4410d65c6a33dadae7ab07172..24892ae367e19038625e243bcdf1bb69 public static ChunkStatus.ChunkType getChunkTypeFromTag(@Nullable CompoundTag nbt) { return nbt != null ? ChunkStatus.byName(nbt.getString("Status")).getChunkType() : ChunkStatus.ChunkType.PROTOCHUNK; } +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index 4ae206af89a413edb09319fd4bce2a94c575c617..5cc2deb8f170452c7049743068bf281f67687db9 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -490,12 +490,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { + } + } + +- for (final ChunkPos pos : chunksToRelight) { +- final ChunkAccess chunk = serverChunkCache.getChunk(pos.x, pos.z, false); +- if (chunk != null) { +- serverChunkCache.getLightEngine().lightChunk(chunk, false); +- } +- } ++ serverChunkCache.getLightEngine().relight(chunksToRelight, pos -> {}, relit -> {}); // Paper - Starlight + + return true; + // Paper end - implement regenerate chunk method diff --git a/patches/server/0991-Rewrite-chunk-system.patch b/patches/server/0992-Rewrite-chunk-system.patch similarity index 99% rename from patches/server/0991-Rewrite-chunk-system.patch rename to patches/server/0992-Rewrite-chunk-system.patch index e4f89841a2..acd575015b 100644 --- a/patches/server/0991-Rewrite-chunk-system.patch +++ b/patches/server/0992-Rewrite-chunk-system.patch @@ -15266,13 +15266,13 @@ index 0000000000000000000000000000000000000000..f7b0e2564ac4bd2db1d2b2bdc230c9f5 + } +} diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index a6793f227fa90a37260cf0b9d5e9b6f1f47ff920..596ef21a05a5c9311adcd8799239b1532d9bb747 100644 +index e47fb2aa5e885162cae5cbfc9f33ff7864bf538e..b68b37274f22c2a89d723aec4d1c6be813eef73c 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java @@ -43,6 +43,7 @@ public final class PaperCommand extends Command { - commands.put(Set.of("dumpitem"), new DumpItemCommand()); commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand()); commands.put(Set.of("dumplisteners"), new DumpListenersCommand()); + commands.put(Set.of("fixlight"), new FixLightCommand()); + commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); return commands.entrySet().stream() @@ -16642,10 +16642,10 @@ index deb2d8c22a1c5724d0ac8571f4ea54711988dc4b..72d013d06705b08ed696e3d3b6d631d6 DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce800a94811d 100644 +index 7d637094afecc2a838f9cc5cc837f8bf63cfd5aa..b27cdfd527d9234b51eba7bb642968fa886d460e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -310,7 +310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); @@ -16654,7 +16654,7 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 ((MinecraftServer) atomicreference.get()).runServer(); }, "Server thread"); -@@ -642,7 +642,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { @@ -16790,7 +16790,7 @@ index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce80 if (entity.isRemoved()) { continue; } -@@ -2457,7 +2451,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop levelTypeProvider) { diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index 94e9919da2ba5a36afa5b7f97af888cb113bb14b..5aff6454b5b1c7834adca8f1234ec4848aa3709c 100644 +index 7e416ad09959a08931c207f62d97af4ee868c039..5d50f1bcba507975b8942529104c0ccd5e08c252 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java @@ -110,6 +110,17 @@ public class ChunkSerializer { @@ -22531,7 +22531,7 @@ index 1eff5e4800ad3b628a42113fb3ba67458e56a40d..d4e0ef75dd12709a0dcf9193821c30b8 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b23cc5371cb8fc2cfaba70c73cd9d4b0accb3283..b63a0770e80f16848861a4747586ad22b9f9520b 100644 +index 28529732f23fefc8f642a44b95779f9e1cc2bb64..cbe6e8dae17b30905a28167449f1799b66d403c1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1384,7 +1384,6 @@ public final class CraftServer implements Server { @@ -22561,10 +22561,10 @@ index b23cc5371cb8fc2cfaba70c73cd9d4b0accb3283..b63a0770e80f16848861a4747586ad22 // Paper start - Adventure diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd3594abfa68 100644 +index 5cc2deb8f170452c7049743068bf281f67687db9..84ec87b889d0d450293310e18c34aef505a8147b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -499,10 +499,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -501,10 +501,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z)); if (playerChunk == null) return false; @@ -22582,7 +22582,7 @@ index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd35 ClientboundLevelChunkWithLightPacket refreshPacket = new ClientboundLevelChunkWithLightPacket(chunk, this.world.getLightEngine(), null, null); for (ServerPlayer player : playersInRange) { -@@ -510,8 +514,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -512,8 +516,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { player.connection.send(refreshPacket); } @@ -22592,7 +22592,7 @@ index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd35 return true; } -@@ -590,20 +593,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -592,20 +595,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public Collection getPluginChunkTickets(int x, int z) { DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; @@ -22614,7 +22614,7 @@ index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd35 } @Override -@@ -611,7 +601,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -613,7 +603,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { Map> ret = new HashMap<>(); DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; @@ -22623,7 +22623,7 @@ index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd35 long chunkKey = chunkTickets.getLongKey(); SortedArraySet> tickets = chunkTickets.getValue(); -@@ -1273,12 +1263,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1275,12 +1265,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public int getViewDistance() { @@ -22638,7 +22638,7 @@ index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd35 } public BlockMetadataStore getBlockMetadata() { -@@ -2420,17 +2410,20 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2422,17 +2412,20 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setSimulationDistance(final int simulationDistance) { diff --git a/patches/server/0992-incremental-chunk-and-player-saving.patch b/patches/server/0993-incremental-chunk-and-player-saving.patch similarity index 97% rename from patches/server/0992-incremental-chunk-and-player-saving.patch rename to patches/server/0993-incremental-chunk-and-player-saving.patch index 4f3f105b0b..7f13d86479 100644 --- a/patches/server/0992-incremental-chunk-and-player-saving.patch +++ b/patches/server/0993-incremental-chunk-and-player-saving.patch @@ -5,10 +5,10 @@ Subject: [PATCH] incremental chunk and player saving diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c546341dc36f5c0526008ff041efff5d491445ff..cae27c2182618bace836ac8356b260d51cad303d 100644 +index 103d2b4169215a8931d33b499fbfeb2354163712..ca352fc1a3d206f9a1fc52eba787e66040d5882c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -907,7 +907,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop playersInRange = playerChunk.playerProvider.getPlayers(playerChunk.getPos(), false); if (playersInRange.isEmpty()) return true; // Paper - rewrite player chunk loader diff --git a/patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch b/patches/server/1004-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch similarity index 100% rename from patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch rename to patches/server/1004-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch diff --git a/patches/server/1004-Optimize-Collision-to-not-load-chunks.patch b/patches/server/1005-Optimize-Collision-to-not-load-chunks.patch similarity index 100% rename from patches/server/1004-Optimize-Collision-to-not-load-chunks.patch rename to patches/server/1005-Optimize-Collision-to-not-load-chunks.patch diff --git a/patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch b/patches/server/1006-Optimize-GoalSelector-Goal.Flag-Set-operations.patch similarity index 100% rename from patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch rename to patches/server/1006-Optimize-GoalSelector-Goal.Flag-Set-operations.patch diff --git a/patches/server/1006-Entity-load-save-limit-per-chunk.patch b/patches/server/1007-Entity-load-save-limit-per-chunk.patch similarity index 100% rename from patches/server/1006-Entity-load-save-limit-per-chunk.patch rename to patches/server/1007-Entity-load-save-limit-per-chunk.patch diff --git a/patches/server/1007-Fix-and-optimise-world-force-upgrading.patch b/patches/server/1008-Fix-and-optimise-world-force-upgrading.patch similarity index 98% rename from patches/server/1007-Fix-and-optimise-world-force-upgrading.patch rename to patches/server/1008-Fix-and-optimise-world-force-upgrading.patch index 69b768b90a..3b5a35bcf5 100644 --- a/patches/server/1007-Fix-and-optimise-world-force-upgrading.patch +++ b/patches/server/1008-Fix-and-optimise-world-force-upgrading.patch @@ -267,10 +267,10 @@ index 72d013d06705b08ed696e3d3b6d631d65800c2c9..61840cfd64caba6595dfc99c91c76a19 Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, dimensionOptionsRegistry, eraseCache); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e04153106d91d235e70cc478fd343a04faf821f4..d6879c1b5f63098c276fa109ac66586e3e4ae2a0 100644 +index ca352fc1a3d206f9a1fc52eba787e66040d5882c..49fbd8b84401070d314a32a3b1cdf65055452e5b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -583,11 +583,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system -@@ -927,6 +930,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - BlockPhysicsEvent diff --git a/patches/server/1034-Improve-performance-of-mass-crafts.patch b/patches/server/1035-Improve-performance-of-mass-crafts.patch similarity index 100% rename from patches/server/1034-Improve-performance-of-mass-crafts.patch rename to patches/server/1035-Improve-performance-of-mass-crafts.patch diff --git a/patches/server/1035-Actually-optimise-explosions.patch b/patches/server/1036-Actually-optimise-explosions.patch similarity index 100% rename from patches/server/1035-Actually-optimise-explosions.patch rename to patches/server/1036-Actually-optimise-explosions.patch diff --git a/patches/server/1036-Optimise-chunk-tick-iteration.patch b/patches/server/1037-Optimise-chunk-tick-iteration.patch similarity index 100% rename from patches/server/1036-Optimise-chunk-tick-iteration.patch rename to patches/server/1037-Optimise-chunk-tick-iteration.patch diff --git a/patches/server/1037-Lag-compensation-ticks.patch b/patches/server/1038-Lag-compensation-ticks.patch similarity index 97% rename from patches/server/1037-Lag-compensation-ticks.patch rename to patches/server/1038-Lag-compensation-ticks.patch index 86c4c02378..c779081bd4 100644 --- a/patches/server/1037-Lag-compensation-ticks.patch +++ b/patches/server/1038-Lag-compensation-ticks.patch @@ -8,10 +8,10 @@ Areas affected by lag comepnsation: - Eating food items diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 9183e47d51d95e71ab503564a7a59e03c0a54c2f..baa33011136c1436733a413fdca16763b09d604b 100644 +index 7da73248b56992f765a7c27a42502efb04622956..cfe78fe6db2bb1f039619bf2497a8b8981917756 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -310,6 +310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1626,6 +1627,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop