aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMariell Hoversholm <[email protected]>2021-03-16 16:50:45 +0100
committerMariell Hoversholm <[email protected]>2021-03-18 18:03:22 +0100
commitf6d820f077cb565d0a5e891eaf3e586d53f1204a (patch)
tree5d111678250aa7a27a809a53635e015f21690652
parent0f78e95250b1123760c24473329e248ba817827d (diff)
downloadPaper-f6d820f077cb565d0a5e891eaf3e586d53f1204a.tar.gz
Paper-f6d820f077cb565d0a5e891eaf3e586d53f1204a.zip
It compiles
-rw-r--r--Spigot-Server-Patches/0003-MC-Dev-fixes.patch41
-rw-r--r--Spigot-Server-Patches/0004-MC-Utils.patch26
-rw-r--r--Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch4
-rw-r--r--Spigot-Server-Patches/0022-Remove-invalid-mob-spawner-tile-entities.patch16
-rw-r--r--Spigot-Server-Patches/0023-Optimize-TileEntity-Ticking.patch41
-rw-r--r--Spigot-Server-Patches/0055-Add-exception-reporting-event.patch8
-rw-r--r--Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch6
-rw-r--r--Spigot-Server-Patches/0072-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch26
-rw-r--r--Spigot-Server-Patches/0074-Configurable-Chunk-Inhabited-Time.patch4
-rw-r--r--Spigot-Server-Patches/0075-EntityPathfindEvent.patch16
-rw-r--r--Spigot-Server-Patches/0077-Do-not-load-chunks-for-Pathfinding.patch4
-rw-r--r--Spigot-Server-Patches/0080-Configurable-Grass-Spread-Tick-Rate.patch12
-rw-r--r--Spigot-Server-Patches/0087-Configurable-Player-Collision.patch16
-rw-r--r--Spigot-Server-Patches/0094-remove-null-possibility-for-getServer-singleton.patch8
-rw-r--r--Spigot-Server-Patches/0099-Optimize-UserCache-Thread-Safe.patch28
-rw-r--r--Spigot-Server-Patches/0101-Optional-TNT-doesn-t-move-in-water.patch23
-rw-r--r--Spigot-Server-Patches/0106-Fix-Old-Sign-Conversion.patch4
-rw-r--r--Spigot-Server-Patches/0107-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch4
-rw-r--r--Spigot-Server-Patches/0115-Option-to-remove-corrupt-tile-entities.patch4
-rw-r--r--Spigot-Server-Patches/0123-Add-ProjectileCollideEvent.patch24
-rw-r--r--Spigot-Server-Patches/0124-Prevent-Pathfinding-out-of-World-Border.patch4
-rw-r--r--Spigot-Server-Patches/0132-Firework-API-s.patch14
-rw-r--r--Spigot-Server-Patches/0133-PlayerTeleportEndGatewayEvent.patch12
-rw-r--r--Spigot-Server-Patches/0134-Provide-E-TE-Chunk-count-stat-methods.patch8
-rw-r--r--Spigot-Server-Patches/0142-Properly-handle-async-calls-to-restart-the-server.patch12
-rw-r--r--Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch16
-rw-r--r--Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch10
-rw-r--r--Spigot-Server-Patches/0182-PlayerPickupExperienceEvent.patch12
-rw-r--r--Spigot-Server-Patches/0184-Ability-to-apply-mending-to-XP-API.patch30
-rw-r--r--Spigot-Server-Patches/0186-PreCreatureSpawnEvent.patch38
-rw-r--r--Spigot-Server-Patches/0192-Extend-Player-Interact-cancellation.patch22
-rw-r--r--Spigot-Server-Patches/0197-Implement-extended-PaperServerListPingEvent.patch4
-rw-r--r--Spigot-Server-Patches/0200-Player.setPlayerProfile-API.patch18
-rw-r--r--Spigot-Server-Patches/0206-Flag-to-disable-the-channel-limit.patch6
-rw-r--r--Spigot-Server-Patches/0207-Add-method-to-open-already-placed-sign.patch14
-rw-r--r--Spigot-Server-Patches/0217-Allow-spawning-Item-entities-with-World.spawnEntity.patch4
-rw-r--r--Spigot-Server-Patches/0220-Implement-EntityTeleportEndGatewayEvent.patch4
-rw-r--r--Spigot-Server-Patches/0233-Implement-World.getEntity-UUID-API.patch4
-rw-r--r--Spigot-Server-Patches/0234-InventoryCloseEvent-Reason-API.patch12
-rw-r--r--Spigot-Server-Patches/0248-Vanished-players-don-t-have-rights.patch14
-rw-r--r--Spigot-Server-Patches/0249-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch6
-rw-r--r--Spigot-Server-Patches/0250-Add-some-Debug-to-Chunk-Entity-slices.patch21
-rw-r--r--Spigot-Server-Patches/0252-Prevent-Saving-Bad-entities-to-chunks.patch18
-rw-r--r--Spigot-Server-Patches/0254-Ignore-Dead-Entities-in-entityList-iteration.patch12
-rw-r--r--Spigot-Server-Patches/0255-Implement-Expanded-ArmorStand-API.patch14
-rw-r--r--Spigot-Server-Patches/0260-MC-135506-Experience-should-save-as-Integers.patch6
-rw-r--r--Spigot-Server-Patches/0261-Fix-client-rendering-skulls-from-same-user.patch22
-rw-r--r--Spigot-Server-Patches/0262-Add-Early-Warning-Feature-to-WatchDog.patch4
-rw-r--r--Spigot-Server-Patches/0267-Allow-disabling-armour-stand-ticking.patch4
-rw-r--r--Spigot-Server-Patches/0271-Configurable-speed-for-water-flowing-over-lava.patch14
-rw-r--r--Spigot-Server-Patches/0274-Add-PhantomPreSpawnEvent.patch19
-rw-r--r--Spigot-Server-Patches/0279-Expose-attack-cooldown-methods-for-Player.patch4
-rw-r--r--Spigot-Server-Patches/0280-Improve-death-events.patch6
-rw-r--r--Spigot-Server-Patches/0281-Allow-chests-to-be-placed-with-NBT-data.patch6
-rw-r--r--Spigot-Server-Patches/0282-Mob-Pathfinding-API.patch12
-rw-r--r--Spigot-Server-Patches/0284-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch51
-rw-r--r--Spigot-Server-Patches/0285-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch14
-rw-r--r--Spigot-Server-Patches/0286-Prevent-mob-spawning-from-loading-generating-chunks.patch6
-rw-r--r--Spigot-Server-Patches/0289-PreSpawnerSpawnEvent.patch4
-rw-r--r--Spigot-Server-Patches/0290-Catch-JsonParseException-in-Entity-and-TE-names.patch36
-rw-r--r--Spigot-Server-Patches/0296-Turtle-API.patch18
-rw-r--r--Spigot-Server-Patches/0297-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch4
-rw-r--r--Spigot-Server-Patches/0299-Add-Velocity-IP-Forwarding-Support.patch8
-rw-r--r--Spigot-Server-Patches/0306-Improve-Server-Thread-Pool-and-Thread-Priorities.patch4
-rw-r--r--Spigot-Server-Patches/0307-Optimize-World-Time-Updates.patch4
-rw-r--r--Spigot-Server-Patches/0311-Don-t-allow-digging-into-unloaded-chunks.patch8
-rw-r--r--Spigot-Server-Patches/0320-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch12
-rw-r--r--Spigot-Server-Patches/0323-Block-Entity-remove-from-being-called-on-Players.patch4
-rw-r--r--Spigot-Server-Patches/0329-Optimize-Network-Manager-and-add-advanced-packet-sup.patch10
-rw-r--r--Spigot-Server-Patches/0337-Entity-getEntitySpawnReason.patch10
-rw-r--r--Spigot-Server-Patches/0341-Server-Tick-Events.patch6
-rw-r--r--Spigot-Server-Patches/0344-Add-Heightmap-API.patch10
-rw-r--r--Spigot-Server-Patches/0345-Mob-Spawner-API-Enhancements.patch12
-rw-r--r--Spigot-Server-Patches/0346-Per-Player-View-Distance-API-placeholders.patch4
-rw-r--r--Spigot-Server-Patches/0349-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch4
-rw-r--r--Spigot-Server-Patches/0351-Duplicate-UUID-Resolve-Option.patch6
-rw-r--r--Spigot-Server-Patches/0353-Configurable-Keep-Spawn-Loaded-range-per-world.patch6
-rw-r--r--Spigot-Server-Patches/0358-Catch-exceptions-from-dispenser-entity-spawns.patch12
-rw-r--r--Spigot-Server-Patches/0359-Fix-World-isChunkGenerated-calls.patch19
-rw-r--r--Spigot-Server-Patches/0362-incremental-chunk-saving.patch12
-rw-r--r--Spigot-Server-Patches/0363-Anti-Xray.patch26
-rw-r--r--Spigot-Server-Patches/0364-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch4
-rw-r--r--Spigot-Server-Patches/0365-Configurable-projectile-relative-velocity.patch4
-rw-r--r--Spigot-Server-Patches/0368-Avoid-hopper-searches-if-there-are-no-items.patch26
-rw-r--r--Spigot-Server-Patches/0369-Asynchronous-chunk-IO-and-loading.patch58
-rw-r--r--Spigot-Server-Patches/0373-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch6
-rw-r--r--Spigot-Server-Patches/0375-implement-optional-per-player-mob-spawns.patch32
-rw-r--r--Spigot-Server-Patches/0386-PlayerLaunchProjectileEvent.patch68
-rw-r--r--Spigot-Server-Patches/0389-MC-145656-Fix-Follow-Range-Initial-Target.patch15
-rw-r--r--Spigot-Server-Patches/0390-Optimize-Hoppers.patch20
-rw-r--r--Spigot-Server-Patches/0394-Guard-against-serializing-mismatching-chunk-coordina.patch18
-rw-r--r--Spigot-Server-Patches/0399-Fix-last-firework-in-stack-not-having-effects-when-d.patch4
-rw-r--r--Spigot-Server-Patches/0402-Entity-Activation-Range-2.0.patch12
-rw-r--r--Spigot-Server-Patches/0408-Optimise-random-block-ticking.patch12
-rw-r--r--Spigot-Server-Patches/0410-Add-option-to-nerf-pigmen-from-nether-portals.patch14
-rw-r--r--Spigot-Server-Patches/0411-Make-the-GUI-graph-fancier.patch4
-rw-r--r--Spigot-Server-Patches/0417-Optimise-Chunk-getFluid.patch6
-rw-r--r--Spigot-Server-Patches/0418-Optimise-TickListServer-by-rewriting-it.patch16
-rw-r--r--Spigot-Server-Patches/0419-Pillager-patrol-spawn-settings-and-per-player-option.patch16
-rw-r--r--Spigot-Server-Patches/0425-Optimize-Collision-to-not-load-chunks.patch20
-rw-r--r--Spigot-Server-Patches/0428-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch6
-rw-r--r--Spigot-Server-Patches/0429-Increase-Light-Queue-Size.patch4
-rw-r--r--Spigot-Server-Patches/0430-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch18
-rw-r--r--Spigot-Server-Patches/0432-Add-tick-times-API-and-mspt-command.patch8
-rw-r--r--Spigot-Server-Patches/0437-Async-command-map-building.patch14
-rw-r--r--Spigot-Server-Patches/0438-Improved-Watchdog-Support.patch28
-rw-r--r--Spigot-Server-Patches/0439-Optimize-Pathfinding.patch14
-rw-r--r--Spigot-Server-Patches/0443-Prevent-opening-inventories-when-frozen.patch6
-rw-r--r--Spigot-Server-Patches/0448-Implement-Player-Client-Options-API.patch4
-rw-r--r--Spigot-Server-Patches/0453-Load-Chunks-for-Login-Asynchronously.patch21
-rw-r--r--Spigot-Server-Patches/0458-Add-phantom-creative-and-insomniac-controls.patch22
-rw-r--r--Spigot-Server-Patches/0460-Implement-Brigadier-Mojang-API.patch8
-rw-r--r--Spigot-Server-Patches/0461-Villager-Restocks-API.patch4
-rw-r--r--Spigot-Server-Patches/0466-Implement-Mob-Goal-API.patch9
-rw-r--r--Spigot-Server-Patches/0467-Use-distance-map-to-optimise-entity-tracker.patch8
-rw-r--r--Spigot-Server-Patches/0470-No-Tick-view-distance-implementation.patch140
-rw-r--r--Spigot-Server-Patches/0471-Add-villager-reputation-API.patch12
-rw-r--r--Spigot-Server-Patches/0472-Fix-Light-Command.patch17
-rw-r--r--Spigot-Server-Patches/0475-Potential-bed-API.patch14
-rw-r--r--Spigot-Server-Patches/0476-Wait-for-Async-Tasks-during-shutdown.patch4
-rw-r--r--Spigot-Server-Patches/0479-Optimize-NibbleArray-to-use-pooled-buffers.patch25
-rw-r--r--Spigot-Server-Patches/0481-Reduce-allocation-of-Vec3D-by-entity-tracker.patch4
-rw-r--r--Spigot-Server-Patches/0482-Ensure-safe-gateway-teleport.patch4
-rw-r--r--Spigot-Server-Patches/0484-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch14
-rw-r--r--Spigot-Server-Patches/0485-Workaround-for-Client-Lag-Spikes-MC-162253.patch54
-rw-r--r--Spigot-Server-Patches/0486-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch66
-rw-r--r--Spigot-Server-Patches/0488-Improve-Chunk-Status-Transition-Speed.patch6
-rw-r--r--Spigot-Server-Patches/0493-Optimize-Light-Engine.patch72
-rw-r--r--Spigot-Server-Patches/0495-Add-Plugin-Tickets-to-API-Chunk-Methods.patch24
-rw-r--r--Spigot-Server-Patches/0502-Inventory-getHolder-method-without-block-snapshot.patch16
-rw-r--r--Spigot-Server-Patches/0507-Add-permission-for-command-blocks.patch10
-rw-r--r--Spigot-Server-Patches/0509-Optimize-WorldBorder-collision-checks-and-air.patch6
-rw-r--r--Spigot-Server-Patches/0510-Fix-Per-World-Difficulty-Remembering-Difficulty.patch18
-rw-r--r--Spigot-Server-Patches/0512-Don-t-allow-null-UUID-s-for-chat.patch12
-rw-r--r--Spigot-Server-Patches/0516-Convert-legacy-attributes-in-Item-Meta.patch6
-rw-r--r--Spigot-Server-Patches/0517-Remove-some-streams-from-structures.patch14
-rw-r--r--Spigot-Server-Patches/0519-Support-components-in-ItemMeta.patch10
-rw-r--r--Spigot-Server-Patches/0521-Add-entity-liquid-API.patch6
-rw-r--r--Spigot-Server-Patches/0527-Optimize-NetworkManager-Exception-Handling.patch18
-rw-r--r--Spigot-Server-Patches/0536-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch4
-rw-r--r--Spigot-Server-Patches/0537-Add-missing-strikeLighting-call-to-World-spigot-stri.patch4
-rw-r--r--Spigot-Server-Patches/0540-Incremental-player-saving.patch6
-rw-r--r--Spigot-Server-Patches/0542-Don-t-mark-null-chunk-sections-for-block-updates.patch4
-rw-r--r--Spigot-Server-Patches/0546-Do-not-let-the-server-load-chunks-from-newer-version.patch4
-rw-r--r--Spigot-Server-Patches/0547-Brand-support.patch4
-rw-r--r--Spigot-Server-Patches/0554-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch4
-rw-r--r--Spigot-Server-Patches/0555-Add-moon-phase-API.patch4
-rw-r--r--Spigot-Server-Patches/0557-Add-BellRingEvent.patch14
-rw-r--r--Spigot-Server-Patches/0564-Add-more-Evoker-API.patch13
-rw-r--r--Spigot-Server-Patches/0567-Cache-block-data-strings.patch18
-rw-r--r--Spigot-Server-Patches/0568-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch6
-rw-r--r--Spigot-Server-Patches/0569-Add-additional-open-container-api-to-HumanEntity.patch6
-rw-r--r--Spigot-Server-Patches/0571-Extend-block-drop-capture-to-capture-all-items-added.patch12
-rw-r--r--Spigot-Server-Patches/0572-Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch4
-rw-r--r--Spigot-Server-Patches/0575-Entity-isTicking.patch6
-rw-r--r--Spigot-Server-Patches/0576-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch4
-rw-r--r--Spigot-Server-Patches/0577-Fix-Not-a-string-Map-Conversion-spam.patch17
-rw-r--r--Spigot-Server-Patches/0582-Optimise-getType-calls.patch4
-rw-r--r--Spigot-Server-Patches/0587-Fix-item-locations-dropped-from-campfires.patch12
-rw-r--r--Spigot-Server-Patches/0588-Player-elytra-boost-API.patch25
-rw-r--r--Spigot-Server-Patches/0592-Add-ignore-discounts-API.patch6
-rw-r--r--Spigot-Server-Patches/0600-Significantly-improve-performance-of-the-end-generat.patch13
-rw-r--r--Spigot-Server-Patches/0601-Expose-world-spawn-angle.patch6
-rw-r--r--Spigot-Server-Patches/0603-Fix-Player-spawnParticle-x-y-z-precision-loss.patch4
-rw-r--r--Spigot-Server-Patches/0607-Climbing-should-not-bypass-cramming-gamerule.patch6
-rw-r--r--Spigot-Server-Patches/0609-Add-PlayerShearBlockEvent.patch26
-rw-r--r--Spigot-Server-Patches/0610-Add-warning-for-servers-not-running-on-Java-11.patch6
-rw-r--r--Spigot-Server-Patches/0612-Fix-curing-zombie-villager-discount-exploit.patch4
-rw-r--r--Spigot-Server-Patches/0625-Fix-harming-potion-dupe.patch16
-rw-r--r--Spigot-Server-Patches/0636-Added-WorldGameRuleChangeEvent.patch6
-rw-r--r--Spigot-Server-Patches/0637-Added-ServerResourcesReloadedEvent.patch8
-rw-r--r--Spigot-Server-Patches/0641-Fire-event-on-GS4-query.patch20
-rw-r--r--Spigot-Server-Patches/0644-Empty-commands-shall-not-be-dispatched.patch4
-rw-r--r--Spigot-Server-Patches/0645-Implement-API-to-expose-exact-interaction-point.patch4
-rw-r--r--Spigot-Server-Patches/0648-Entity-load-save-limit-per-chunk.patch6
-rw-r--r--Spigot-Server-Patches/0649-Add-sendOpLevel-API.patch6
-rw-r--r--Spigot-Server-Patches/0651-Collision-option-for-requiring-a-player-participant.patch26
-rw-r--r--Spigot-Server-Patches/0652-Make-ProjectileHitEvent-Cancellable.patch8
-rw-r--r--Spigot-Server-Patches/0667-EntityMoveEvent.patch4
-rw-r--r--Spigot-Server-Patches/0675-misc-debugging-dumps.patch8
-rw-r--r--Spigot-Server-Patches/0678-Expose-Tracked-Players.patch6
-rw-r--r--Spigot-Server-Patches/0680-do-not-create-unnecessary-copies-of-passenger-list.patch20
-rw-r--r--Spigot-Server-Patches/0685-fix-converting-txt-to-json-file.patch6
-rw-r--r--Spigot-Server-Patches/0687-added-PlayerNameEntityEvent.patch12
-rw-r--r--Spigot-Server-Patches/0689-Add-recipe-to-cook-events.patch6
-rw-r--r--Spigot-Server-Patches/0692-Implement-Keyed-on-World.patch4
-rwxr-xr-xscripts/importmcdev.sh6
187 files changed, 1699 insertions, 875 deletions
diff --git a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch
index e80a530731..884320a1fe 100644
--- a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch
+++ b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch
@@ -182,10 +182,41 @@ index 35cca76fb7c7aa736e64185b44016e65cfaef6cd..4f6f6f51f9807bafa88482c0fe776c8b
private byte type;
diff --git a/src/main/java/net/minecraft/network/EnumProtocol.java b/src/main/java/net/minecraft/network/EnumProtocol.java
-index ab08336043d4f558434ed1f38d25cc555ace1ac0..539084d087bc6bd38d333066d3f8238cf2b08900 100644
+index ab08336043d4f558434ed1f38d25cc555ace1ac0..a892521db1197369bf6363bd2f5da24bf53643ab 100644
--- a/src/main/java/net/minecraft/network/EnumProtocol.java
+++ b/src/main/java/net/minecraft/network/EnumProtocol.java
-@@ -163,7 +163,8 @@ import org.apache.logging.log4j.LogManager;
+@@ -12,6 +12,8 @@ import javax.annotation.Nullable;
+ import net.minecraft.SystemUtils;
+ import net.minecraft.network.protocol.EnumProtocolDirection;
+ import net.minecraft.network.protocol.Packet;
++import net.minecraft.network.protocol.game.PacketListenerPlayIn;
++import net.minecraft.network.protocol.game.PacketListenerPlayOut;
+ import net.minecraft.network.protocol.game.PacketPlayInAbilities;
+ import net.minecraft.network.protocol.game.PacketPlayInAdvancements;
+ import net.minecraft.network.protocol.game.PacketPlayInArmAnimation;
+@@ -146,24 +148,30 @@ import net.minecraft.network.protocol.game.PacketPlayOutWindowItems;
+ import net.minecraft.network.protocol.game.PacketPlayOutWorldBorder;
+ import net.minecraft.network.protocol.game.PacketPlayOutWorldEvent;
+ import net.minecraft.network.protocol.game.PacketPlayOutWorldParticles;
++import net.minecraft.network.protocol.handshake.PacketHandshakingInListener;
+ import net.minecraft.network.protocol.handshake.PacketHandshakingInSetProtocol;
+ import net.minecraft.network.protocol.login.PacketLoginInCustomPayload;
+ import net.minecraft.network.protocol.login.PacketLoginInEncryptionBegin;
++import net.minecraft.network.protocol.login.PacketLoginInListener;
+ import net.minecraft.network.protocol.login.PacketLoginInStart;
+ import net.minecraft.network.protocol.login.PacketLoginOutCustomPayload;
+ import net.minecraft.network.protocol.login.PacketLoginOutDisconnect;
+ import net.minecraft.network.protocol.login.PacketLoginOutEncryptionBegin;
++import net.minecraft.network.protocol.login.PacketLoginOutListener;
+ import net.minecraft.network.protocol.login.PacketLoginOutSetCompression;
+ import net.minecraft.network.protocol.login.PacketLoginOutSuccess;
++import net.minecraft.network.protocol.status.PacketStatusInListener;
+ import net.minecraft.network.protocol.status.PacketStatusInPing;
+ import net.minecraft.network.protocol.status.PacketStatusInStart;
++import net.minecraft.network.protocol.status.PacketStatusOutListener;
+ import net.minecraft.network.protocol.status.PacketStatusOutPong;
+ import net.minecraft.network.protocol.status.PacketStatusOutServerInfo;
+ import org.apache.logging.log4j.LogManager;
public enum EnumProtocol {
@@ -195,7 +226,7 @@ index ab08336043d4f558434ed1f38d25cc555ace1ac0..539084d087bc6bd38d333066d3f8238c
private static final EnumProtocol[] e = new EnumProtocol[4];
private static final Map<Class<? extends Packet<?>>, EnumProtocol> f = Maps.newHashMap();
-@@ -248,7 +249,7 @@ public enum EnumProtocol {
+@@ -248,7 +256,7 @@ public enum EnumProtocol {
private final List<Supplier<? extends Packet<T>>> b;
private a() {
@@ -205,7 +236,7 @@ index ab08336043d4f558434ed1f38d25cc555ace1ac0..539084d087bc6bd38d333066d3f8238c
});
this.b = Lists.newArrayList();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index e4fae57da4ee232a818e608912f021694bcea0f2..76d880e05bbc1534343a105dd7121bddd729b8a2 100644
+index e4fae57da4ee232a818e608912f021694bcea0f2..078631631616874741b0e0662e51b3faadcddcec 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1665,9 +1665,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -216,7 +247,7 @@ index e4fae57da4ee232a818e608912f021694bcea0f2..76d880e05bbc1534343a105dd7121bdd
+ return stream.<ResourcePackLoader>map(resourcepackrepository::a).filter(Objects::nonNull).map(ResourcePackLoader::d).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error // Paper - decompile error
}, this).thenCompose((immutablelist) -> {
- return DataPackResources.a(immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this);
-+ return DataPackResources.a((List<IResourcePack>) immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this); // Paper - decompile error
++ return DataPackResources.a(immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this); // Paper - decompile error
}).thenAcceptAsync((datapackresources) -> {
this.dataPackResources.close();
this.dataPackResources = datapackresources;
diff --git a/Spigot-Server-Patches/0004-MC-Utils.patch b/Spigot-Server-Patches/0004-MC-Utils.patch
index 1948636b49..22194308d0 100644
--- a/Spigot-Server-Patches/0004-MC-Utils.patch
+++ b/Spigot-Server-Patches/0004-MC-Utils.patch
@@ -3009,7 +3009,7 @@ index 0000000000000000000000000000000000000000..18b56b59fd6efd618e6ff6f9cf3a02f5
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 76d880e05bbc1534343a105dd7121bddd729b8a2..08443ca31ead7c484f0faeef57305c28d74c0e3f 100644
+index 078631631616874741b0e0662e51b3faadcddcec..8203192a94da26e8bfd6cf9999a2b2e8d26b1acf 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -874,6 +874,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -3023,7 +3023,7 @@ index 76d880e05bbc1534343a105dd7121bddd729b8a2..08443ca31ead7c484f0faeef57305c28
LOGGER.info("Saving usercache.json");
this.getUserCache().b();
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
-index 7fd6893c30fbb34367181620aa159ed79b803455..3055ef62a054d91a74552f83f7afdfe08c7880db 100644
+index 7fd6893c30fbb34367181620aa159ed79b803455..0b5bcb60472c778574702a5ac26a6d02d54bfeac 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -42,6 +42,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.DefinedStruct
@@ -3057,7 +3057,7 @@ index 7fd6893c30fbb34367181620aa159ed79b803455..3055ef62a054d91a74552f83f7afdfe0
+ return x & 3 | ((z & 3) << 2);
+ }
+
-+ void addLoadedChunk(Chunk chunk) {
++ public void addLoadedChunk(Chunk chunk) {
+ this.loadedChunkMapSeqLock.acquireWrite();
+ try {
+ this.loadedChunkMap.put(chunk.coordinateKey, chunk);
@@ -3072,7 +3072,7 @@ index 7fd6893c30fbb34367181620aa159ed79b803455..3055ef62a054d91a74552f83f7afdfe0
+ this.lastLoadedChunks[cacheKey] = chunk;
+ }
+
-+ void removeLoadedChunk(Chunk chunk) {
++ public void removeLoadedChunk(Chunk chunk) {
+ this.loadedChunkMapSeqLock.acquireWrite();
+ try {
+ this.loadedChunkMap.remove(chunk.coordinateKey);
@@ -3890,10 +3890,18 @@ index 5f8022745f709b6d542182d2ac94147aefdd3f0f..543b13c1e43135c044f834c2a6231e17
public IBlockData getType(BlockPosition blockposition) {
return Blocks.AIR.getBlockData();
diff --git a/src/main/java/net/minecraft/world/level/ChunkCache.java b/src/main/java/net/minecraft/world/level/ChunkCache.java
-index 8541e87a34612e8bc86cf5c291164e091641d1af..5694c6225fd2b79c61ed004c4a696e75bbd53716 100644
+index 8541e87a34612e8bc86cf5c291164e091641d1af..7a760ef0264c9041c38bdfb8fd31333052c26139 100644
--- a/src/main/java/net/minecraft/world/level/ChunkCache.java
+++ b/src/main/java/net/minecraft/world/level/ChunkCache.java
-@@ -23,7 +23,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
+@@ -4,6 +4,7 @@ import java.util.function.Predicate;
+ import java.util.stream.Stream;
+ import javax.annotation.Nullable;
+ import net.minecraft.core.BlockPosition;
++import net.minecraft.server.level.WorldServer;
+ import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.block.entity.TileEntity;
+@@ -23,7 +24,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
protected final int b;
protected final IChunkAccess[][] c;
protected boolean d;
@@ -3902,7 +3910,7 @@ index 8541e87a34612e8bc86cf5c291164e091641d1af..5694c6225fd2b79c61ed004c4a696e75
public ChunkCache(World world, BlockPosition blockposition, BlockPosition blockposition1) {
this.e = world;
-@@ -42,7 +42,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
+@@ -42,7 +43,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
for (k = this.a; k <= i; ++k) {
for (l = this.b; l <= j; ++l) {
@@ -3911,7 +3919,7 @@ index 8541e87a34612e8bc86cf5c291164e091641d1af..5694c6225fd2b79c61ed004c4a696e75
}
}
-@@ -67,7 +67,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
+@@ -67,7 +68,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
int k = i - this.a;
int l = j - this.b;
@@ -3920,7 +3928,7 @@ index 8541e87a34612e8bc86cf5c291164e091641d1af..5694c6225fd2b79c61ed004c4a696e75
IChunkAccess ichunkaccess = this.c[k][l];
return (IChunkAccess) (ichunkaccess != null ? ichunkaccess : new ChunkEmpty(this.e, new ChunkCoordIntPair(i, j)));
-@@ -86,6 +86,29 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
+@@ -86,6 +87,29 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
return this.a(i, j);
}
diff --git a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch
index c43854e2c1..873dc9de7e 100644
--- a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch
+++ b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch
@@ -8,7 +8,7 @@ This enables us a fast reference to the entities current chunk instead
of having to look it up by hashmap lookups.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index ec553e7d7595ef3652bfa3325a07483bb3c32245..9af9d9463e9b50f8a627ffd79dcd3716c506f7e7 100644
+index ec553e7d7595ef3652bfa3325a07483bb3c32245..2bea2f4748cadf479dd4f89792ef5ffdd88e9cab 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -261,7 +261,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -24,7 +24,7 @@ index ec553e7d7595ef3652bfa3325a07483bb3c32245..9af9d9463e9b50f8a627ffd79dcd3716
}
// Paper start
-+ java.lang.ref.WeakReference<net.minecraft.world.level.chunk.Chunk> currentChunk = null;
++ public java.lang.ref.WeakReference<net.minecraft.world.level.chunk.Chunk> currentChunk = null;
+
+ public void setCurrentChunk(net.minecraft.world.level.chunk.Chunk chunk) {
+ this.currentChunk = chunk != null ? new java.lang.ref.WeakReference<>(chunk) : null;
diff --git a/Spigot-Server-Patches/0022-Remove-invalid-mob-spawner-tile-entities.patch b/Spigot-Server-Patches/0022-Remove-invalid-mob-spawner-tile-entities.patch
index 5abc016389..2aeae2d5b4 100644
--- a/Spigot-Server-Patches/0022-Remove-invalid-mob-spawner-tile-entities.patch
+++ b/Spigot-Server-Patches/0022-Remove-invalid-mob-spawner-tile-entities.patch
@@ -5,10 +5,22 @@ Subject: [PATCH] Remove invalid mob spawner tile entities
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index ac576d268b23148089d404cb22d8c2f9d1a79d6e..0312d68f0f64fa9e5816fe12a09430208ae2b8ce 100644
+index ac576d268b23148089d404cb22d8c2f9d1a79d6e..a2d80c2c8e4f080f60746548f75631c5946ba8e2 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -648,6 +648,10 @@ public class Chunk implements IChunkAccess {
+@@ -40,9 +40,11 @@ import net.minecraft.world.level.TickListChunk;
+ import net.minecraft.world.level.TickListEmpty;
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.level.block.Block;
++import net.minecraft.world.level.block.BlockMobSpawner;
+ import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.block.ITileEntity;
+ import net.minecraft.world.level.block.entity.TileEntity;
++import net.minecraft.world.level.block.entity.TileEntityMobSpawner;
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.level.levelgen.ChunkProviderDebug;
+ import net.minecraft.world.level.levelgen.HeightMap;
+@@ -648,6 +650,10 @@ public class Chunk implements IChunkAccess {
}
// CraftBukkit start
diff --git a/Spigot-Server-Patches/0023-Optimize-TileEntity-Ticking.patch b/Spigot-Server-Patches/0023-Optimize-TileEntity-Ticking.patch
index f56bf8b797..a556c9c8da 100644
--- a/Spigot-Server-Patches/0023-Optimize-TileEntity-Ticking.patch
+++ b/Spigot-Server-Patches/0023-Optimize-TileEntity-Ticking.patch
@@ -44,10 +44,18 @@ index 60e7dc1910ae9214d84d65b011cfec278b6b32ae..b229faad99120c67b089f7680d800fbe
protected static final VoxelShape f = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 14.0D, 16.0D);
protected static final VoxelShape g = Block.a(0.0D, 0.0D, 1.0D, 15.0D, 14.0D, 15.0D);
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java
-index eed95b370d1d624ffc6b7a35357b7028ec58c584..aafd1f7c6c811f9eb2796d865e327f374be9b461 100644
+index eed95b370d1d624ffc6b7a35357b7028ec58c584..51167d776c710decb0107bebcb35bdf43103772b 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java
-@@ -33,7 +33,7 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+@@ -8,6 +8,7 @@ import net.minecraft.core.NonNullList;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.network.chat.ChatMessage;
+ import net.minecraft.network.chat.IChatBaseComponent;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.sounds.SoundCategory;
+ import net.minecraft.sounds.SoundEffect;
+ import net.minecraft.sounds.SoundEffects;
+@@ -33,7 +34,7 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.entity.HumanEntity;
// CraftBukkit end
@@ -56,7 +64,7 @@ index eed95b370d1d624ffc6b7a35357b7028ec58c584..aafd1f7c6c811f9eb2796d865e327f37
private NonNullList<ItemStack> items;
protected float a;
-@@ -111,14 +111,20 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
+@@ -111,14 +112,20 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
return nbttagcompound;
}
@@ -79,7 +87,7 @@ index eed95b370d1d624ffc6b7a35357b7028ec58c584..aafd1f7c6c811f9eb2796d865e327f37
this.b = this.a;
float f = 0.1F;
-@@ -132,8 +138,11 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
+@@ -132,8 +139,11 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
if (this.viewingCount > 0 && this.a == 0.0F) {
this.playOpenSound(SoundEffects.BLOCK_CHEST_OPEN);
}
@@ -92,7 +100,7 @@ index eed95b370d1d624ffc6b7a35357b7028ec58c584..aafd1f7c6c811f9eb2796d865e327f37
float f1 = this.a;
if (this.viewingCount > 0) {
-@@ -149,8 +158,11 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
+@@ -149,8 +159,11 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
float f2 = 0.5F;
if (this.a < 0.5F && f1 >= 0.5F) {
@@ -105,7 +113,7 @@ index eed95b370d1d624ffc6b7a35357b7028ec58c584..aafd1f7c6c811f9eb2796d865e327f37
if (this.a < 0.0F) {
this.a = 0.0F;
-@@ -189,6 +201,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
+@@ -189,6 +202,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
}
public void playOpenSound(SoundEffect soundeffect) {
@@ -113,7 +121,7 @@ index eed95b370d1d624ffc6b7a35357b7028ec58c584..aafd1f7c6c811f9eb2796d865e327f37
BlockPropertyChestType blockpropertychesttype = (BlockPropertyChestType) this.getBlock().get(BlockChest.c);
if (blockpropertychesttype != BlockPropertyChestType.LEFT) {
-@@ -227,6 +240,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
+@@ -227,6 +241,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
++this.viewingCount;
if (this.world == null) return; // CraftBukkit
@@ -121,7 +129,7 @@ index eed95b370d1d624ffc6b7a35357b7028ec58c584..aafd1f7c6c811f9eb2796d865e327f37
// CraftBukkit start - Call redstone event
if (this.getBlock().getBlock() == Blocks.TRAPPED_CHEST) {
-@@ -249,6 +263,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
+@@ -249,6 +264,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
--this.viewingCount;
// CraftBukkit start - Call redstone event
@@ -130,10 +138,15 @@ index eed95b370d1d624ffc6b7a35357b7028ec58c584..aafd1f7c6c811f9eb2796d865e327f37
int newPower = Math.max(0, Math.min(15, this.viewingCount));
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnderChest.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnderChest.java
-index 930f1bd091d9754f7ca5d9e36cdf49b2be03eb23..385aed0f8bd9992e0c30d8fca5be4f49bc321183 100644
+index 930f1bd091d9754f7ca5d9e36cdf49b2be03eb23..2bc4213c70be47ca8bbc24898cc92e43f4228821 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnderChest.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnderChest.java
-@@ -5,7 +5,7 @@ import net.minecraft.sounds.SoundEffects;
+@@ -1,11 +1,12 @@
+ package net.minecraft.world.level.block.entity;
+
++import net.minecraft.server.MCUtil;
+ import net.minecraft.sounds.SoundCategory;
+ import net.minecraft.sounds.SoundEffects;
import net.minecraft.world.entity.player.EntityHuman;
import net.minecraft.world.level.block.Blocks;
@@ -142,7 +155,7 @@ index 930f1bd091d9754f7ca5d9e36cdf49b2be03eb23..385aed0f8bd9992e0c30d8fca5be4f49
public float a;
public float b;
-@@ -16,18 +16,28 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
+@@ -16,18 +17,28 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
super(TileEntityTypes.ENDER_CHEST);
}
@@ -172,7 +185,7 @@ index 930f1bd091d9754f7ca5d9e36cdf49b2be03eb23..385aed0f8bd9992e0c30d8fca5be4f49
if (this.c > 0 && this.a == 0.0F) {
double d1 = (double) i + 0.5D;
-@@ -35,8 +45,17 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
+@@ -35,8 +46,17 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
d0 = (double) k + 0.5D;
this.world.playSound((EntityHuman) null, d1, (double) j + 0.5D, d0, SoundEffects.BLOCK_ENDER_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
}
@@ -191,7 +204,7 @@ index 930f1bd091d9754f7ca5d9e36cdf49b2be03eb23..385aed0f8bd9992e0c30d8fca5be4f49
float f1 = this.a;
if (this.c > 0) {
-@@ -52,11 +71,14 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
+@@ -52,11 +72,14 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
float f2 = 0.5F;
if (this.a < 0.5F && f1 >= 0.5F) {
@@ -207,7 +220,7 @@ index 930f1bd091d9754f7ca5d9e36cdf49b2be03eb23..385aed0f8bd9992e0c30d8fca5be4f49
if (this.a < 0.0F) {
this.a = 0.0F;
-@@ -84,11 +106,13 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
+@@ -84,11 +107,13 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
public void d() {
++this.c;
this.world.playBlockAction(this.position, Blocks.ENDER_CHEST, 1, this.c);
diff --git a/Spigot-Server-Patches/0055-Add-exception-reporting-event.patch b/Spigot-Server-Patches/0055-Add-exception-reporting-event.patch
index 34e17ce28f..74ea309c98 100644
--- a/Spigot-Server-Patches/0055-Add-exception-reporting-event.patch
+++ b/Spigot-Server-Patches/0055-Add-exception-reporting-event.patch
@@ -168,7 +168,7 @@ index 33469b719d679c65d4bcb8366008e6e107eb3a0b..01cb0c8dd9875986e0c08371e876f0db
return;
// Paper end
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index 0312d68f0f64fa9e5816fe12a09430208ae2b8ce..4f86aa618ab0b497b1ad46cc9a4443c6874d388b 100644
+index a2d80c2c8e4f080f60746548f75631c5946ba8e2..4b3de29b1a6e9d75b28962073c62bbe8d666165f 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
@@ -1,5 +1,6 @@
@@ -178,7 +178,7 @@ index 0312d68f0f64fa9e5816fe12a09430208ae2b8ce..4f86aa618ab0b497b1ad46cc9a4443c6
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
-@@ -653,10 +654,15 @@ public class Chunk implements IChunkAccess {
+@@ -655,10 +656,15 @@ public class Chunk implements IChunkAccess {
this.tileEntities.remove(blockposition);
// Paper end
} else {
@@ -188,8 +188,8 @@ index 0312d68f0f64fa9e5816fe12a09430208ae2b8ce..4f86aa618ab0b497b1ad46cc9a4443c6
- new Exception().printStackTrace();
+ // Paper start
+ ServerInternalException e = new ServerInternalException(
-+ "Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + ","
-+ + tileentity.position.getY() + "," + tileentity.position.getZ()
++ "Attempted to place a tile entity (" + tileentity + ") at " + tileentity.getPosition().getX() + ","
++ + tileentity.getPosition().getY() + "," + tileentity.getPosition().getZ()
+ + " (" + getType(blockposition) + ") where there was no entity tile!\n" +
+ "Chunk coordinates: " + (this.loc.x * 16) + "," + (this.loc.z * 16));
+ e.printStackTrace();
diff --git a/Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch
index f5214b7a93..9f9e1ddd60 100644
--- a/Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch
+++ b/Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch
@@ -33,7 +33,7 @@ index 25fdd55a7548cfaa45a541ad77f22f33c33e7471..4b56683336fdab06804efdc8ca1f7c13
this.a = i;
this.b = j;
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
-index 067f5e46ad2f28ab119db77b19c4897bed9b3d80..07b5ff3ae319776bc1d85d113007a9afbad1c29a 100644
+index a570998e4ef6c3ff83403881bf1d24c8cbcfcf67..a22be13b097052b2a88707c9436b88c84298e46b 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -239,7 +239,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -46,10 +46,10 @@ index 067f5e46ad2f28ab119db77b19c4897bed9b3d80..07b5ff3ae319776bc1d85d113007a9af
public static boolean l(BlockPosition blockposition) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index 4f86aa618ab0b497b1ad46cc9a4443c6874d388b..ace0566626338f02cbfcc8b40d29dc6a66ede58d 100644
+index 4b3de29b1a6e9d75b28962073c62bbe8d666165f..fdc491f978560c394eec22116572585f9bbdec9f 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -346,12 +346,27 @@ public class Chunk implements IChunkAccess {
+@@ -348,12 +348,27 @@ public class Chunk implements IChunkAccess {
return this.sections;
}
diff --git a/Spigot-Server-Patches/0072-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/Spigot-Server-Patches/0072-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
index c1accf63cf..0122441e7d 100644
--- a/Spigot-Server-Patches/0072-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
+++ b/Spigot-Server-Patches/0072-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 2c295e070a0418c7d3bc4a4a531df699acadb0ff..555b99c45e0785750c48b0db2bc0b8da98c52295 100644
+index fec2e723d2cdc4d0144f9f2292804a2d364769f9..8c389b06dbd47c44f01d6bdd8a6b283c75353043 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1282,6 +1282,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -52,10 +52,18 @@ index a22be13b097052b2a88707c9436b88c84298e46b..9236e480d21340d4295caa16dae34363
this.getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/world/level/block/BlockPlant.java b/src/main/java/net/minecraft/world/level/block/BlockPlant.java
-index 33a5c5a4dc1478ab211dbb2e09df87570b06644f..81fbdda5e87b07259db206316cb4b423d9acdc3c 100644
+index 33a5c5a4dc1478ab211dbb2e09df87570b06644f..97dfe5c5e3ea1d9691de87ffbf4b1a29a83a65b4 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockPlant.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockPlant.java
-@@ -23,7 +23,7 @@ public class BlockPlant extends Block {
+@@ -2,6 +2,7 @@ package net.minecraft.world.level.block;
+
+ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.EnumDirection;
++import net.minecraft.server.level.WorldServer;
+ import net.minecraft.world.level.GeneratorAccess;
+ import net.minecraft.world.level.IBlockAccess;
+ import net.minecraft.world.level.IWorldReader;
+@@ -23,7 +24,7 @@ public class BlockPlant extends Block {
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
// CraftBukkit start
if (!iblockdata.canPlace(generatoraccess, blockposition)) {
@@ -65,10 +73,18 @@ index 33a5c5a4dc1478ab211dbb2e09df87570b06644f..81fbdda5e87b07259db206316cb4b423
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/BlockTallPlant.java b/src/main/java/net/minecraft/world/level/block/BlockTallPlant.java
-index ca22187625f7ac6c43b663fd4d66cbf0c943c655..7c34cc7c0b74a336d0f0e705deab6d0f86e2e5f8 100644
+index ca22187625f7ac6c43b663fd4d66cbf0c943c655..1a5d29ecc9edc52bac14ed5d05ef5376fd5b8a9c 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockTallPlant.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockTallPlant.java
-@@ -83,7 +83,7 @@ public class BlockTallPlant extends BlockPlant {
+@@ -3,6 +3,7 @@ package net.minecraft.world.level.block;
+ import javax.annotation.Nullable;
+ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.EnumDirection;
++import net.minecraft.server.level.WorldServer;
+ import net.minecraft.world.entity.EntityLiving;
+ import net.minecraft.world.entity.player.EntityHuman;
+ import net.minecraft.world.item.ItemStack;
+@@ -83,7 +84,7 @@ public class BlockTallPlant extends BlockPlant {
protected static void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
// CraftBukkit start
diff --git a/Spigot-Server-Patches/0074-Configurable-Chunk-Inhabited-Time.patch b/Spigot-Server-Patches/0074-Configurable-Chunk-Inhabited-Time.patch
index d0aaee3807..aec9c86c64 100644
--- a/Spigot-Server-Patches/0074-Configurable-Chunk-Inhabited-Time.patch
+++ b/Spigot-Server-Patches/0074-Configurable-Chunk-Inhabited-Time.patch
@@ -30,10 +30,10 @@ index cd64fb9d0c6d123e1c86cb33f12cd9cefc9f80d0..74ba5dbb83c13ce1721619b755036a78
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index ace0566626338f02cbfcc8b40d29dc6a66ede58d..c24315a329b3076a022fdf2aa7459e7117323e20 100644
+index fdc491f978560c394eec22116572585f9bbdec9f..b6898cd6e6117fef65198db32b98a64c806811d4 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -1020,7 +1020,7 @@ public class Chunk implements IChunkAccess {
+@@ -1022,7 +1022,7 @@ public class Chunk implements IChunkAccess {
@Override
public long getInhabitedTime() {
diff --git a/Spigot-Server-Patches/0075-EntityPathfindEvent.patch b/Spigot-Server-Patches/0075-EntityPathfindEvent.patch
index 3984fbe891..84caa9a7de 100644
--- a/Spigot-Server-Patches/0075-EntityPathfindEvent.patch
+++ b/Spigot-Server-Patches/0075-EntityPathfindEvent.patch
@@ -19,10 +19,18 @@ index 942e03578836524ba746bc37699677eb06cc7803..703d06b2b29f1500301d82df78dc3771
private int u() {
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
-index 8848a7552a0ef3944560a71f71620c6bd0f08c10..8c699279a3553da2888669c64269a1dfd8152e22 100644
+index 8848a7552a0ef3944560a71f71620c6bd0f08c10..58225877ce4f2533c19d34e143ae374dc289bce5 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
-@@ -28,7 +28,7 @@ import net.minecraft.world.phys.Vec3D;
+@@ -10,6 +10,7 @@ import net.minecraft.core.BaseBlockPosition;
+ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.IPosition;
+ import net.minecraft.network.protocol.game.PacketDebug;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.util.MathHelper;
+ import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.entity.EntityInsentient;
+@@ -28,7 +29,7 @@ import net.minecraft.world.phys.Vec3D;
public abstract class NavigationAbstract {
@@ -31,7 +39,7 @@ index 8848a7552a0ef3944560a71f71620c6bd0f08c10..8c699279a3553da2888669c64269a1df
protected final World b;
@Nullable
protected PathEntity c;
-@@ -115,16 +115,26 @@ public abstract class NavigationAbstract {
+@@ -115,16 +116,26 @@ public abstract class NavigationAbstract {
@Nullable
public PathEntity a(BlockPosition blockposition, int i) {
@@ -60,7 +68,7 @@ index 8848a7552a0ef3944560a71f71620c6bd0f08c10..8c699279a3553da2888669c64269a1df
if (set.isEmpty()) {
return null;
} else if (this.a.locY() < 0.0D) {
-@@ -134,6 +144,23 @@ public abstract class NavigationAbstract {
+@@ -134,6 +145,23 @@ public abstract class NavigationAbstract {
} else if (this.c != null && !this.c.c() && set.contains(this.p)) {
return this.c;
} else {
diff --git a/Spigot-Server-Patches/0077-Do-not-load-chunks-for-Pathfinding.patch b/Spigot-Server-Patches/0077-Do-not-load-chunks-for-Pathfinding.patch
index 4fb82e5e9a..6086fc3ad7 100644
--- a/Spigot-Server-Patches/0077-Do-not-load-chunks-for-Pathfinding.patch
+++ b/Spigot-Server-Patches/0077-Do-not-load-chunks-for-Pathfinding.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Do not load chunks for Pathfinding
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
-index 8c699279a3553da2888669c64269a1dfd8152e22..c50d792c3ef3277ecab229e866f052854edac19d 100644
+index 58225877ce4f2533c19d34e143ae374dc289bce5..d71a6e5991629ce59c8529d7cc8064960e385236 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
-@@ -47,7 +47,7 @@ public abstract class NavigationAbstract {
+@@ -48,7 +48,7 @@ public abstract class NavigationAbstract {
private BlockPosition p;
private int q;
private float r;
diff --git a/Spigot-Server-Patches/0080-Configurable-Grass-Spread-Tick-Rate.patch b/Spigot-Server-Patches/0080-Configurable-Grass-Spread-Tick-Rate.patch
index b41777f7eb..78ce2d0001 100644
--- a/Spigot-Server-Patches/0080-Configurable-Grass-Spread-Tick-Rate.patch
+++ b/Spigot-Server-Patches/0080-Configurable-Grass-Spread-Tick-Rate.patch
@@ -20,10 +20,18 @@ index 74ba5dbb83c13ce1721619b755036a7864a1fb90..db2dddd12f54e6d15916c4cee6236765
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
-index a98392f06e66959ec1b75df8d2ecf3b5267980af..b8b0ac69a4114936cfe86ab90f95bba5bf125069 100644
+index a98392f06e66959ec1b75df8d2ecf3b5267980af..712596420af83e6e1b9d147ae2fd8d8a1f36e1b9 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
-@@ -41,6 +41,7 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow {
+@@ -3,6 +3,7 @@ package net.minecraft.world.level.block;
+ import java.util.Random;
+ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.EnumDirection;
++import net.minecraft.server.MinecraftServer;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.tags.Tag;
+ import net.minecraft.tags.TagsFluid;
+@@ -41,6 +42,7 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow {
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
diff --git a/Spigot-Server-Patches/0087-Configurable-Player-Collision.patch b/Spigot-Server-Patches/0087-Configurable-Player-Collision.patch
index c52f4fd417..e456d81b42 100644
--- a/Spigot-Server-Patches/0087-Configurable-Player-Collision.patch
+++ b/Spigot-Server-Patches/0087-Configurable-Player-Collision.patch
@@ -32,10 +32,18 @@ index bc40f2cbe1645fd60c4cee106b90f17cd043d32d..c1bb5c325286119891e8d68ce8f7328c
packetdataserializer.a(this.c);
packetdataserializer.a(this.d);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 555b99c45e0785750c48b0db2bc0b8da98c52295..bea6cd6cf4dceece74de9cbb12a094334d129c4a 100644
+index 8c389b06dbd47c44f01d6bdd8a6b283c75353043..19ca2ea39ca3a3c820141467388eca65a0b744d0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -541,6 +541,20 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -151,6 +151,7 @@ import net.minecraft.world.phys.Vec2F;
+ import net.minecraft.world.phys.Vec3D;
+ import net.minecraft.world.scores.PersistentScoreboard;
+ import net.minecraft.world.scores.Scoreboard;
++import net.minecraft.world.scores.ScoreboardTeam;
+ import org.apache.commons.lang3.Validate;
+ import org.apache.logging.log4j.LogManager;
+ import org.apache.logging.log4j.Logger;
+@@ -541,6 +542,20 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
}
@@ -57,7 +65,7 @@ index 555b99c45e0785750c48b0db2bc0b8da98c52295..bea6cd6cf4dceece74de9cbb12a09433
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
this.serverConnection.acceptConnections();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 152aa38788a21638aab7cfe2dc187671f1143bde..95ff827b1d5704d279d258bdfb43fd33ec7a9187 100644
+index 152aa38788a21638aab7cfe2dc187671f1143bde..f9e9e51b0b0dcbf2a8424c7c14bd2cbb0d899e82 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -86,6 +86,7 @@ import net.minecraft.world.level.storage.SavedFile;
@@ -72,7 +80,7 @@ index 152aa38788a21638aab7cfe2dc187671f1143bde..95ff827b1d5704d279d258bdfb43fd33
// CraftBukkit start
private CraftServer cserver;
private final Map<String,EntityPlayer> playersByName = new java.util.HashMap<>();
-+ @Nullable String collideRuleTeamName; // Paper - Team name used for collideRule
++ public @Nullable String collideRuleTeamName; // Paper - Team name used for collideRule
public PlayerList(MinecraftServer minecraftserver, IRegistryCustom.Dimension iregistrycustom_dimension, WorldNBTStorage worldnbtstorage, int i) {
this.cserver = minecraftserver.server = new CraftServer((DedicatedServer) minecraftserver, this);
diff --git a/Spigot-Server-Patches/0094-remove-null-possibility-for-getServer-singleton.patch b/Spigot-Server-Patches/0094-remove-null-possibility-for-getServer-singleton.patch
index 1ec962b183..6066e9346e 100644
--- a/Spigot-Server-Patches/0094-remove-null-possibility-for-getServer-singleton.patch
+++ b/Spigot-Server-Patches/0094-remove-null-possibility-for-getServer-singleton.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] remove null possibility for getServer singleton
to stop IDE complaining about potential NPE
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index bea6cd6cf4dceece74de9cbb12a094334d129c4a..3b2fcb4338d56a8e1dd2de799571db4e2a79ec9f 100644
+index 19ca2ea39ca3a3c820141467388eca65a0b744d0..3d20206c3817cc7bf1d0168c0b556b7505eebf93 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -179,6 +179,7 @@ import org.spigotmc.SlackActivityAccountant; // Spigot
+@@ -180,6 +180,7 @@ import org.spigotmc.SlackActivityAccountant; // Spigot
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
@@ -17,7 +17,7 @@ index bea6cd6cf4dceece74de9cbb12a094334d129c4a..3b2fcb4338d56a8e1dd2de799571db4e
public static final Logger LOGGER = LogManager.getLogger();
public static final File b = new File("usercache.json");
public static final WorldSettings c = new WorldSettings("Demo World", EnumGamemode.SURVIVAL, false, EnumDifficulty.NORMAL, false, new GameRules(), DataPackConfiguration.a);
-@@ -285,6 +286,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -286,6 +287,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public MinecraftServer(OptionSet options, DataPackConfiguration datapackconfiguration, Thread thread, IRegistryCustom.Dimension iregistrycustom_dimension, Convertable.ConversionSession convertable_conversionsession, SaveData savedata, ResourcePackRepository resourcepackrepository, Proxy proxy, DataFixer datafixer, DataPackResources datapackresources, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) {
super("Server");
@@ -25,7 +25,7 @@ index bea6cd6cf4dceece74de9cbb12a094334d129c4a..3b2fcb4338d56a8e1dd2de799571db4e
this.m = new GameProfilerSwitcher(SystemUtils.a, this::ai);
this.methodProfiler = GameProfilerDisabled.a;
this.serverPing = new ServerPing();
-@@ -2152,7 +2154,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -2153,7 +2155,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@Deprecated
public static MinecraftServer getServer() {
diff --git a/Spigot-Server-Patches/0099-Optimize-UserCache-Thread-Safe.patch b/Spigot-Server-Patches/0099-Optimize-UserCache-Thread-Safe.patch
index 652f8fbb89..143884b0ab 100644
--- a/Spigot-Server-Patches/0099-Optimize-UserCache-Thread-Safe.patch
+++ b/Spigot-Server-Patches/0099-Optimize-UserCache-Thread-Safe.patch
@@ -10,10 +10,10 @@ Additionally, move Saving of the User cache to be done async, incase
the user never changed the default setting for Spigot's save on stop only.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 3b2fcb4338d56a8e1dd2de799571db4e2a79ec9f..c6ab645397911d984a28e40583bdb8f782a4f934 100644
+index 3d20206c3817cc7bf1d0168c0b556b7505eebf93..9ae25f9496355d3114c0032731c8dcb621d243dc 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -896,7 +896,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -897,7 +897,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
} catch (java.lang.InterruptedException ignored) {} // Paper
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
LOGGER.info("Saving usercache.json");
@@ -36,10 +36,18 @@ index faf4d00bf288359db806913c4d2964324e8706b7..8ae72e8c8325d9b03803f29fcdd83a0c
if (!NameReferencingFileConverter.e(this)) {
diff --git a/src/main/java/net/minecraft/server/players/UserCache.java b/src/main/java/net/minecraft/server/players/UserCache.java
-index 581e036f598b51a4e9f2dafd7e92c700c3e04407..9bb949ff4cbfc87ce179653939454a1e44dcdd77 100644
+index 581e036f598b51a4e9f2dafd7e92c700c3e04407..2de2d84a56183435d641ba857472276821a70ae0 100644
--- a/src/main/java/net/minecraft/server/players/UserCache.java
+++ b/src/main/java/net/minecraft/server/players/UserCache.java
-@@ -107,7 +107,7 @@ public class UserCache {
+@@ -35,6 +35,7 @@ import java.util.concurrent.atomic.AtomicLong;
+ import java.util.concurrent.atomic.AtomicReference;
+ import java.util.stream.Stream;
+ import javax.annotation.Nullable;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.world.entity.player.EntityHuman;
+ import org.apache.logging.log4j.LogManager;
+ import org.apache.logging.log4j.Logger;
+@@ -107,7 +108,7 @@ public class UserCache {
return UserCache.b;
}
@@ -48,7 +56,7 @@ index 581e036f598b51a4e9f2dafd7e92c700c3e04407..9bb949ff4cbfc87ce179653939454a1e
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
-@@ -116,7 +116,7 @@ public class UserCache {
+@@ -116,7 +117,7 @@ public class UserCache {
UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date);
this.a(usercache_usercacheentry);
@@ -57,7 +65,7 @@ index 581e036f598b51a4e9f2dafd7e92c700c3e04407..9bb949ff4cbfc87ce179653939454a1e
}
private long d() {
-@@ -124,7 +124,7 @@ public class UserCache {
+@@ -124,7 +125,7 @@ public class UserCache {
}
@Nullable
@@ -66,7 +74,7 @@ index 581e036f598b51a4e9f2dafd7e92c700c3e04407..9bb949ff4cbfc87ce179653939454a1e
String s1 = s.toLowerCase(Locale.ROOT);
UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.c.get(s1);
boolean flag = false;
-@@ -150,7 +150,7 @@ public class UserCache {
+@@ -150,7 +151,7 @@ public class UserCache {
}
if (flag && !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { // Spigot - skip saving if disabled
@@ -75,7 +83,7 @@ index 581e036f598b51a4e9f2dafd7e92c700c3e04407..9bb949ff4cbfc87ce179653939454a1e
}
return gameprofile;
-@@ -232,7 +232,7 @@ public class UserCache {
+@@ -232,7 +233,7 @@ public class UserCache {
return arraylist;
}
@@ -84,7 +92,7 @@ index 581e036f598b51a4e9f2dafd7e92c700c3e04407..9bb949ff4cbfc87ce179653939454a1e
JsonArray jsonarray = new JsonArray();
DateFormat dateformat = e();
-@@ -240,6 +240,7 @@ public class UserCache {
+@@ -240,6 +241,7 @@ public class UserCache {
jsonarray.add(a(usercache_usercacheentry, dateformat));
});
String s = this.f.toJson(jsonarray);
@@ -92,7 +100,7 @@ index 581e036f598b51a4e9f2dafd7e92c700c3e04407..9bb949ff4cbfc87ce179653939454a1e
try {
BufferedWriter bufferedwriter = Files.newWriter(this.g, StandardCharsets.UTF_8);
-@@ -267,6 +268,14 @@ public class UserCache {
+@@ -267,6 +269,14 @@ public class UserCache {
} catch (IOException ioexception) {
;
}
diff --git a/Spigot-Server-Patches/0101-Optional-TNT-doesn-t-move-in-water.patch b/Spigot-Server-Patches/0101-Optional-TNT-doesn-t-move-in-water.patch
index 56f0c27595..6138102655 100644
--- a/Spigot-Server-Patches/0101-Optional-TNT-doesn-t-move-in-water.patch
+++ b/Spigot-Server-Patches/0101-Optional-TNT-doesn-t-move-in-water.patch
@@ -45,7 +45,7 @@ index f5227aa761d326376d057eaadcdbef024ed30241..44b79c97d5cc7570683e1b7f025b4f3a
private java.util.Map<EntityPlayer, Boolean> trackedPlayerMap = null;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 2b1b46bda48c0b137fe914c47a387e6e72a1be40..ee160558d84b24e1309262874a9d433bbe6593f3 100644
+index f942d75982409f7640f073f9c77f8939225c6939..88ffc594a2ee7f8718337883609ad4c082f85f50 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2766,6 +2766,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -61,10 +61,25 @@ index 2b1b46bda48c0b137fe914c47a387e6e72a1be40..ee160558d84b24e1309262874a9d433b
}
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java b/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java
-index 535e7d7297d81026b8586d5049b72fa65519b464..ca954912c798a7f4f7c9903a53156075ab688e46 100644
+index 535e7d7297d81026b8586d5049b72fa65519b464..63b35feac07f01b200dd68c4836ceb419e951660 100644
--- a/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java
-@@ -96,7 +96,27 @@ public class EntityTNTPrimed extends Entity {
+@@ -4,10 +4,14 @@ import javax.annotation.Nullable;
+ import net.minecraft.core.particles.Particles;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.network.protocol.Packet;
++import net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport;
++import net.minecraft.network.protocol.game.PacketPlayOutEntityVelocity;
+ import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
+ import net.minecraft.network.syncher.DataWatcher;
+ import net.minecraft.network.syncher.DataWatcherObject;
+ import net.minecraft.network.syncher.DataWatcherRegistry;
++import net.minecraft.server.level.PlayerChunkMap;
++import net.minecraft.server.level.WorldServer;
+ import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.entity.EntityLiving;
+ import net.minecraft.world.entity.EntityPose;
+@@ -96,7 +100,27 @@ public class EntityTNTPrimed extends Entity {
this.world.addParticle(Particles.SMOKE, this.locX(), this.locY() + 0.5D, this.locZ(), 0.0D, 0.0D, 0.0D);
}
}
@@ -93,7 +108,7 @@ index 535e7d7297d81026b8586d5049b72fa65519b464..ca954912c798a7f4f7c9903a53156075
}
private void explode() {
-@@ -165,4 +185,11 @@ public class EntityTNTPrimed extends Entity {
+@@ -165,4 +189,11 @@ public class EntityTNTPrimed extends Entity {
public Packet<?> P() {
return new PacketPlayOutSpawnEntity(this);
}
diff --git a/Spigot-Server-Patches/0106-Fix-Old-Sign-Conversion.patch b/Spigot-Server-Patches/0106-Fix-Old-Sign-Conversion.patch
index 81720d1251..e06e531049 100644
--- a/Spigot-Server-Patches/0106-Fix-Old-Sign-Conversion.patch
+++ b/Spigot-Server-Patches/0106-Fix-Old-Sign-Conversion.patch
@@ -9,14 +9,14 @@ Subject: [PATCH] Fix Old Sign Conversion
This causes Igloos and such to render broken signs. We fix this by ignoring sign conversion for Defined Structures
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
-index 58789a6e285c31947508deae37caefe7e182278c..fd6364dfc68c2eb9f560e7bc403dea874193828e 100644
+index 58789a6e285c31947508deae37caefe7e182278c..9b44ca96669ce423e5649f11743226dfdd9ce746 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
@@ -34,6 +34,7 @@ public abstract class TileEntity implements net.minecraft.server.KeyedObject { /
public CraftPersistentDataContainer persistentDataContainer;
// CraftBukkit end
private static final Logger LOGGER = LogManager.getLogger();
-+ boolean isLoadingStructure = false; // Paper
++ public boolean isLoadingStructure = false; // Paper
private final TileEntityTypes<?> tileType; public TileEntityTypes getTileEntityType() { return tileType; } // Paper - OBFHELPER
@Nullable
protected World world;
diff --git a/Spigot-Server-Patches/0107-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/Spigot-Server-Patches/0107-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
index 60a844c334..3df71abbfd 100644
--- a/Spigot-Server-Patches/0107-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
+++ b/Spigot-Server-Patches/0107-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't lookup game profiles that have no UUID and no name
diff --git a/src/main/java/net/minecraft/server/players/UserCache.java b/src/main/java/net/minecraft/server/players/UserCache.java
-index 9bb949ff4cbfc87ce179653939454a1e44dcdd77..85ca2a3b19d27a0dbe1c8dee6bd5b31ae11bbce2 100644
+index 2de2d84a56183435d641ba857472276821a70ae0..6c349128bdedc53003f043c9cb1210b4666aee33 100644
--- a/src/main/java/net/minecraft/server/players/UserCache.java
+++ b/src/main/java/net/minecraft/server/players/UserCache.java
-@@ -90,7 +90,7 @@ public class UserCache {
+@@ -91,7 +91,7 @@ public class UserCache {
gameprofilerepository.findProfilesByNames(new String[]{s}, Agent.MINECRAFT, profilelookupcallback);
GameProfile gameprofile = (GameProfile) atomicreference.get();
diff --git a/Spigot-Server-Patches/0115-Option-to-remove-corrupt-tile-entities.patch b/Spigot-Server-Patches/0115-Option-to-remove-corrupt-tile-entities.patch
index b11c89044d..c9e047b2c4 100644
--- a/Spigot-Server-Patches/0115-Option-to-remove-corrupt-tile-entities.patch
+++ b/Spigot-Server-Patches/0115-Option-to-remove-corrupt-tile-entities.patch
@@ -19,10 +19,10 @@ index 6eca3f300020006f02dd36253b522db442e3cc33..622affa0dc3cc1eadaed400511f2ca2c
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index c24315a329b3076a022fdf2aa7459e7117323e20..86872f4e65d7e0ca68237a42fe87f33ba7a92802 100644
+index b6898cd6e6117fef65198db32b98a64c806811d4..7918dd4ad3e8cbb905b3929062a70fb7961b7d68 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -677,6 +677,12 @@ public class Chunk implements IChunkAccess {
+@@ -679,6 +679,12 @@ public class Chunk implements IChunkAccess {
"Chunk coordinates: " + (this.loc.x * 16) + "," + (this.loc.z * 16));
e.printStackTrace();
ServerInternalException.reportInternalException(e);
diff --git a/Spigot-Server-Patches/0123-Add-ProjectileCollideEvent.patch b/Spigot-Server-Patches/0123-Add-ProjectileCollideEvent.patch
index 0febf2e4f0..59933e763d 100644
--- a/Spigot-Server-Patches/0123-Add-ProjectileCollideEvent.patch
+++ b/Spigot-Server-Patches/0123-Add-ProjectileCollideEvent.patch
@@ -27,10 +27,18 @@ index 9bd4a283a99f86c9a26f73e0bad0c3414d66ad55..5ecbe9135a71dd84e0722fa9c039c272
this.a((MovingObjectPosition) object);
this.impulse = true;
diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java
-index ed76aec99f46a7923d139e347779c24f512ac131..08b3499681eaf23a2f79f6dd9134ccfd86d888a4 100644
+index ed76aec99f46a7923d139e347779c24f512ac131..ede7b4dbf2dce7bac83c5e17eecfdaf0e8a84fe7 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java
-@@ -72,7 +72,16 @@ public abstract class EntityFireball extends IProjectile {
+@@ -13,6 +13,7 @@ import net.minecraft.world.entity.EntityLiving;
+ import net.minecraft.world.entity.EntityTypes;
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.phys.MovingObjectPosition;
++import net.minecraft.world.phys.MovingObjectPositionEntity;
+ import net.minecraft.world.phys.Vec3D;
+
+ import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+@@ -72,7 +73,16 @@ public abstract class EntityFireball extends IProjectile {
MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a);
@@ -49,10 +57,18 @@ index ed76aec99f46a7923d139e347779c24f512ac131..08b3499681eaf23a2f79f6dd9134ccfd
// CraftBukkit start - Fire ProjectileHitEvent
diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java
-index 829b4f28896bcb0eb6e48242bd00585eeaae62c2..7bf41d2c924531f7a28e906c64b8a4ccd3dffedb 100644
+index 829b4f28896bcb0eb6e48242bd00585eeaae62c2..3b379e83b79bd9b46dbdd4a48ac3842abc4dfbb8 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java
-@@ -57,7 +57,17 @@ public abstract class EntityProjectile extends IProjectile {
+@@ -14,6 +14,7 @@ import net.minecraft.world.level.block.entity.TileEntityEndGateway;
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.phys.MovingObjectPosition;
+ import net.minecraft.world.phys.MovingObjectPositionBlock;
++import net.minecraft.world.phys.MovingObjectPositionEntity;
+ import net.minecraft.world.phys.Vec3D;
+
+ public abstract class EntityProjectile extends IProjectile {
+@@ -57,7 +58,17 @@ public abstract class EntityProjectile extends IProjectile {
}
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS && !flag) {
diff --git a/Spigot-Server-Patches/0124-Prevent-Pathfinding-out-of-World-Border.patch b/Spigot-Server-Patches/0124-Prevent-Pathfinding-out-of-World-Border.patch
index ed8efad698..d30b0eae33 100644
--- a/Spigot-Server-Patches/0124-Prevent-Pathfinding-out-of-World-Border.patch
+++ b/Spigot-Server-Patches/0124-Prevent-Pathfinding-out-of-World-Border.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Prevent Pathfinding out of World Border
This prevents Entities from trying to run outside of the World Border
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
-index c50d792c3ef3277ecab229e866f052854edac19d..1664d47a61f1c502ece7f32aecdce759172c9f85 100644
+index d71a6e5991629ce59c8529d7cc8064960e385236..d134333c736dc1ee1c722d680d7a9c22c1b265bd 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
-@@ -147,7 +147,7 @@ public abstract class NavigationAbstract {
+@@ -148,7 +148,7 @@ public abstract class NavigationAbstract {
// Paper start - Pathfind event
boolean copiedSet = false;
for (BlockPosition possibleTarget : set) {
diff --git a/Spigot-Server-Patches/0132-Firework-API-s.patch b/Spigot-Server-Patches/0132-Firework-API-s.patch
index 30ce8c3445..5f7e8518a2 100644
--- a/Spigot-Server-Patches/0132-Firework-API-s.patch
+++ b/Spigot-Server-Patches/0132-Firework-API-s.patch
@@ -93,10 +93,18 @@ index 9153945c2e245b9a2a098bdf58b0dcab052084ff..a2950faa48021782f10db0673d12d178
itemstack.subtract(1);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
-index 33162fd419ab9a7b650ca9d4270a0c03f06f19f6..ec8c32c7be51219d95a38ffb9291509f7d09bd7c 100644
+index 33162fd419ab9a7b650ca9d4270a0c03f06f19f6..73c2da316e41329114fcb3d30cb009d9cc7de7b9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
-@@ -78,4 +78,17 @@ public class CraftFirework extends CraftProjectile implements Firework {
+@@ -1,6 +1,7 @@
+ package org.bukkit.craftbukkit.entity;
+
+ import java.util.Random;
++import net.minecraft.world.entity.EntityLiving;
+ import net.minecraft.world.entity.projectile.EntityFireworks;
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.item.Items;
+@@ -78,4 +79,17 @@ public class CraftFirework extends CraftProjectile implements Firework {
public void setShotAtAngle(boolean shotAtAngle) {
getHandle().getDataWatcher().set(EntityFireworks.SHOT_AT_ANGLE, shotAtAngle);
}
@@ -109,7 +117,7 @@ index 33162fd419ab9a7b650ca9d4270a0c03f06f19f6..ec8c32c7be51219d95a38ffb9291509f
+
+ @Override
+ public org.bukkit.entity.LivingEntity getBoostedEntity() {
-+ net.minecraft.server.EntityLiving boostedEntity = getHandle().ridingEntity;
++ EntityLiving boostedEntity = getHandle().ridingEntity;
+ return boostedEntity != null ? (org.bukkit.entity.LivingEntity) boostedEntity.getBukkitEntity() : null;
+ }
+ // Paper end
diff --git a/Spigot-Server-Patches/0133-PlayerTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/0133-PlayerTeleportEndGatewayEvent.patch
index ffcd613f07..6e0a520b62 100644
--- a/Spigot-Server-Patches/0133-PlayerTeleportEndGatewayEvent.patch
+++ b/Spigot-Server-Patches/0133-PlayerTeleportEndGatewayEvent.patch
@@ -6,10 +6,18 @@ Subject: [PATCH] PlayerTeleportEndGatewayEvent
Allows you to access the Gateway being used in a teleport event
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
-index 0c5d9600eadc0a550cc2d5e7b4ee665c030faa89..8f2db48201925f4a5dac5dfc19bb2b96438959e1 100644
+index 0c5d9600eadc0a550cc2d5e7b4ee665c030faa89..2808cd0b100bd65a730aba315ab47a59a4621b30 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
-@@ -180,7 +180,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
+@@ -10,6 +10,7 @@ import net.minecraft.data.worldgen.BiomeDecoratorGroups;
+ import net.minecraft.nbt.GameProfileSerializer;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.network.protocol.game.PacketPlayOutTileEntityData;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.util.MathHelper;
+@@ -180,7 +181,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
location.setPitch(player.getLocation().getPitch());
location.setYaw(player.getLocation().getYaw());
diff --git a/Spigot-Server-Patches/0134-Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-Server-Patches/0134-Provide-E-TE-Chunk-count-stat-methods.patch
index 848b9c0049..6618bb4dd0 100644
--- a/Spigot-Server-Patches/0134-Provide-E-TE-Chunk-count-stat-methods.patch
+++ b/Spigot-Server-Patches/0134-Provide-E-TE-Chunk-count-stat-methods.patch
@@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 8b68c1b680e0b7ecb21b9de782dbc2864e7b5dfe..af8593d117359c75ff8c635a93499d84e25eb854 100644
+index 5c488c8a40c648c5c432d38d95d3e00fde2cdb75..642efd930dc6cfad1d9436df97f151ea69b24b0c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -282,6 +282,48 @@ public class CraftWorld implements World {
@@ -17,7 +17,7 @@ index 8b68c1b680e0b7ecb21b9de782dbc2864e7b5dfe..af8593d117359c75ff8c635a93499d84
+ // Paper start - Provide fast information methods
+ public int getEntityCount() {
+ int ret = 0;
-+ for (net.minecraft.server.Entity entity : world.entitiesById.values()) {
++ for (net.minecraft.world.entity.Entity entity : world.entitiesById.values()) {
+ if (entity.isChunkLoaded()) {
+ ++ret;
+ }
@@ -28,8 +28,8 @@ index 8b68c1b680e0b7ecb21b9de782dbc2864e7b5dfe..af8593d117359c75ff8c635a93499d84
+ // We don't use the full world tile entity list, so we must iterate chunks
+ Long2ObjectLinkedOpenHashMap<PlayerChunk> chunks = world.getChunkProvider().playerChunkMap.visibleChunks;
+ int size = 0;
-+ for (net.minecraft.server.PlayerChunk playerchunk : chunks.values()) {
-+ net.minecraft.server.Chunk chunk = playerchunk.getChunk();
++ for (PlayerChunk playerchunk : chunks.values()) {
++ net.minecraft.world.level.chunk.Chunk chunk = playerchunk.getChunk();
+ if (chunk == null) {
+ continue;
+ }
diff --git a/Spigot-Server-Patches/0142-Properly-handle-async-calls-to-restart-the-server.patch b/Spigot-Server-Patches/0142-Properly-handle-async-calls-to-restart-the-server.patch
index 25c51a6e8b..5b49cb681a 100644
--- a/Spigot-Server-Patches/0142-Properly-handle-async-calls-to-restart-the-server.patch
+++ b/Spigot-Server-Patches/0142-Properly-handle-async-calls-to-restart-the-server.patch
@@ -30,10 +30,10 @@ will have plugins and worlds saving to the disk has a high potential to result
in corruption/dataloss.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index c6ab645397911d984a28e40583bdb8f782a4f934..42ff9c57a6107c0cf22a204cf7cabf374bbdc868 100644
+index 9ae25f9496355d3114c0032731c8dcb621d243dc..7637e17e8a811214931c2df3dab50651a4cbcde6 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -200,6 +200,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -201,6 +201,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public final Map<ResourceKey<World>, WorldServer> worldServer;
private PlayerList playerList;
private volatile boolean isRunning;
@@ -41,7 +41,7 @@ index c6ab645397911d984a28e40583bdb8f782a4f934..42ff9c57a6107c0cf22a204cf7cabf37
private boolean isStopped;
private int ticks;
protected final Proxy proxy;
-@@ -849,7 +850,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -850,7 +851,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
if (this.playerList != null) {
MinecraftServer.LOGGER.info("Saving players");
this.playerList.savePlayers();
@@ -50,7 +50,7 @@ index c6ab645397911d984a28e40583bdb8f782a4f934..42ff9c57a6107c0cf22a204cf7cabf37
try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets
}
-@@ -914,8 +915,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -915,8 +916,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
return this.isRunning;
}
@@ -64,7 +64,7 @@ index c6ab645397911d984a28e40583bdb8f782a4f934..42ff9c57a6107c0cf22a204cf7cabf37
if (flag) {
try {
this.serverThread.join();
-@@ -925,6 +931,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -926,6 +932,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
}
@@ -73,7 +73,7 @@ index c6ab645397911d984a28e40583bdb8f782a4f934..42ff9c57a6107c0cf22a204cf7cabf37
// Spigot Start
private static double calcTps(double avg, double exp, double tps)
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index d7cf89f4603779ce9a2e9a6f837a81684f209826..488e33cfc4887e602c897c9a94c0d824af7672ff 100644
+index eb5c22d8af3a3cfadd581d641010942caa6bed54..6c80f328016b6cd30c77b5a5b1e2f6be0b3cd2f0 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1158,9 +1158,15 @@ public abstract class PlayerList {
diff --git a/Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch
index fd51a32a5b..13d5847e4e 100644
--- a/Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch
+++ b/Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch
@@ -144,10 +144,10 @@ index 0000000000000000000000000000000000000000..685deaa0e5d1ddc13e3a7c0471b1cfcf
+
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 42ff9c57a6107c0cf22a204cf7cabf374bbdc868..5b796a6e5f34c38e15d9ce288dfd9bf498cc328e 100644
+index 7637e17e8a811214931c2df3dab50651a4cbcde6..d181a41c1724ee6e84f5239649ab74df158d5f24 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -159,7 +159,7 @@ import org.apache.logging.log4j.Logger;
+@@ -160,7 +160,7 @@ import org.apache.logging.log4j.Logger;
import com.mojang.serialization.DynamicOps;
import com.mojang.serialization.Lifecycle;
import com.google.common.collect.ImmutableSet;
@@ -156,7 +156,7 @@ index 42ff9c57a6107c0cf22a204cf7cabf374bbdc868..5b796a6e5f34c38e15d9ce288dfd9bf4
import joptsimple.OptionSet;
import net.minecraft.nbt.DynamicOpsNBT;
import net.minecraft.nbt.NBTBase;
-@@ -254,7 +254,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -255,7 +255,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public OptionSet options;
public org.bukkit.command.ConsoleCommandSender console;
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
@@ -165,7 +165,7 @@ index 42ff9c57a6107c0cf22a204cf7cabf374bbdc868..5b796a6e5f34c38e15d9ce288dfd9bf4
public static int currentTick = 0; // Paper - Further improve tick loop
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod;
-@@ -323,7 +323,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -324,7 +324,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.options = options;
this.datapackconfiguration = datapackconfiguration;
this.vanillaCommandDispatcher = datapackresources.commandDispatcher; // CraftBukkit
@@ -175,7 +175,7 @@ index 42ff9c57a6107c0cf22a204cf7cabf374bbdc868..5b796a6e5f34c38e15d9ce288dfd9bf4
if (System.console() == null && System.getProperty("jline.terminal") == null) {
System.setProperty("jline.terminal", "jline.UnsupportedTerminal");
Main.useJline = false;
-@@ -344,6 +346,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -345,6 +347,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
LOGGER.warn((String) null, ex);
}
}
@@ -184,7 +184,7 @@ index 42ff9c57a6107c0cf22a204cf7cabf374bbdc868..5b796a6e5f34c38e15d9ce288dfd9bf4
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
}
// CraftBukkit end
-@@ -1087,7 +1091,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1088,7 +1092,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
org.spigotmc.WatchdogThread.doStop(); // Spigot
// CraftBukkit start - Restore terminal to original settings
try {
@@ -193,7 +193,7 @@ index 42ff9c57a6107c0cf22a204cf7cabf374bbdc868..5b796a6e5f34c38e15d9ce288dfd9bf4
} catch (Exception ignored) {
}
// CraftBukkit end
-@@ -1458,7 +1462,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1459,7 +1463,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@Override
public void sendMessage(IChatBaseComponent ichatbasecomponent, UUID uuid) {
@@ -245,7 +245,7 @@ index 8ae72e8c8325d9b03803f29fcdd83a0ce8d34450..a0804c4df6f047cf913ae70970219617
System.setOut(IoBuilder.forLogger(logger).setLevel(Level.INFO).buildPrintStream());
System.setErr(IoBuilder.forLogger(logger).setLevel(Level.WARN).buildPrintStream());
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 488e33cfc4887e602c897c9a94c0d824af7672ff..9db65b9d8f66ff83dcf32274fec98a425e7353d8 100644
+index 6c80f328016b6cd30c77b5a5b1e2f6be0b3cd2f0..a892bcf08dddac90f01caec81229259e1070c3ea 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -150,8 +150,7 @@ public abstract class PlayerList {
diff --git a/Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch
index efc9e3b069..a04012c287 100644
--- a/Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch
+++ b/Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch
@@ -473,10 +473,10 @@ index 89db31061fcc3420bc8e668533a4051cdbd12253..191a74bd9b894f9d64d0a55747cb17e0
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
UserCache usercache = new UserCache(gameprofilerepository, new File(file, MinecraftServer.b.getName()));
diff --git a/src/main/java/net/minecraft/server/players/UserCache.java b/src/main/java/net/minecraft/server/players/UserCache.java
-index 85ca2a3b19d27a0dbe1c8dee6bd5b31ae11bbce2..bc3deb1d9710c744388ce6e89a6f5f4f3f05238d 100644
+index 6c349128bdedc53003f043c9cb1210b4666aee33..e3801a4a13d0bac7816a1350d3799a9815481c4b 100644
--- a/src/main/java/net/minecraft/server/players/UserCache.java
+++ b/src/main/java/net/minecraft/server/players/UserCache.java
-@@ -43,7 +43,7 @@ public class UserCache {
+@@ -44,7 +44,7 @@ public class UserCache {
private static final Logger LOGGER = LogManager.getLogger();
private static boolean b;
@@ -485,7 +485,7 @@ index 85ca2a3b19d27a0dbe1c8dee6bd5b31ae11bbce2..bc3deb1d9710c744388ce6e89a6f5f4f
private final Map<UUID, UserCache.UserCacheEntry> d = Maps.newConcurrentMap();
private final GameProfileRepository e;
private final Gson f = (new GsonBuilder()).create();
-@@ -107,6 +107,7 @@ public class UserCache {
+@@ -108,6 +108,7 @@ public class UserCache {
return UserCache.b;
}
@@ -493,7 +493,7 @@ index 85ca2a3b19d27a0dbe1c8dee6bd5b31ae11bbce2..bc3deb1d9710c744388ce6e89a6f5f4f
public synchronized void a(GameProfile gameprofile) { // Paper - synchronize
Calendar calendar = Calendar.getInstance();
-@@ -156,6 +157,13 @@ public class UserCache {
+@@ -157,6 +158,13 @@ public class UserCache {
return gameprofile;
}
@@ -507,7 +507,7 @@ index 85ca2a3b19d27a0dbe1c8dee6bd5b31ae11bbce2..bc3deb1d9710c744388ce6e89a6f5f4f
@Nullable
public GameProfile getProfile(UUID uuid) {
UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.d.get(uuid);
-@@ -338,7 +346,7 @@ public class UserCache {
+@@ -339,7 +347,7 @@ public class UserCache {
static class UserCacheEntry {
diff --git a/Spigot-Server-Patches/0182-PlayerPickupExperienceEvent.patch b/Spigot-Server-Patches/0182-PlayerPickupExperienceEvent.patch
index 230e7015b9..994fed3ea2 100644
--- a/Spigot-Server-Patches/0182-PlayerPickupExperienceEvent.patch
+++ b/Spigot-Server-Patches/0182-PlayerPickupExperienceEvent.patch
@@ -6,10 +6,18 @@ Subject: [PATCH] PlayerPickupExperienceEvent
Allows plugins to cancel a player picking up an experience orb
diff --git a/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java b/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java
-index f4da22b33c704e675510b4b1a3aa7c180088be29..1fd4bd03463a76e838d1aaa8e6f16f7a42f96fa7 100644
+index f4da22b33c704e675510b4b1a3aa7c180088be29..e3dfb018b06c0139594ddbb88fab2ca8d43ab12f 100644
--- a/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java
-@@ -232,7 +232,7 @@ public class EntityExperienceOrb extends Entity {
+@@ -5,6 +5,7 @@ import net.minecraft.core.BlockPosition;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.network.protocol.Packet;
+ import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntityExperienceOrb;
++import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.sounds.SoundEffects;
+ import net.minecraft.tags.Tag;
+ import net.minecraft.tags.TagsFluid;
+@@ -232,7 +233,7 @@ public class EntityExperienceOrb extends Entity {
@Override
public void pickup(EntityHuman entityhuman) {
if (!this.world.isClientSide) {
diff --git a/Spigot-Server-Patches/0184-Ability-to-apply-mending-to-XP-API.patch b/Spigot-Server-Patches/0184-Ability-to-apply-mending-to-XP-API.patch
index 94cff50e24..f8fd95c016 100644
--- a/Spigot-Server-Patches/0184-Ability-to-apply-mending-to-XP-API.patch
+++ b/Spigot-Server-Patches/0184-Ability-to-apply-mending-to-XP-API.patch
@@ -10,10 +10,10 @@ of giving the player experience points.
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
diff --git a/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java b/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java
-index 1fd4bd03463a76e838d1aaa8e6f16f7a42f96fa7..dc257a7cafc4b728aa5c99ca332143bb05896d7e 100644
+index e3dfb018b06c0139594ddbb88fab2ca8d43ab12f..3387a19044b3ee2a1ef549c328c8bc354a5b6d23 100644
--- a/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java
-@@ -264,10 +264,12 @@ public class EntityExperienceOrb extends Entity {
+@@ -265,10 +265,12 @@ public class EntityExperienceOrb extends Entity {
}
}
@@ -42,10 +42,28 @@ index d313b02f41e4f4a90676cbb37afce4e92dd4d664..72afbf8f537770540e90a2880ea81de1
return true;
});
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index cf9ae60db30ef09bb4c89935a42632e562b6d61e..f8780db8f376ee71a35ebe1c2ab84a6117d0d74e 100644
+index cf9ae60db30ef09bb4c89935a42632e562b6d61e..4766a78a0562e5ae6e7d4850bd7b5d71425c3a0c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1180,8 +1180,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -58,13 +58,17 @@ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.server.network.PlayerConnection;
+ import net.minecraft.server.players.WhiteListEntry;
+ import net.minecraft.world.entity.Entity;
++import net.minecraft.world.entity.EntityExperienceOrb;
+ import net.minecraft.world.entity.EntityLiving;
++import net.minecraft.world.entity.EntityTypes;
+ import net.minecraft.world.entity.ai.attributes.AttributeMapBase;
+ import net.minecraft.world.entity.ai.attributes.AttributeModifiable;
+ import net.minecraft.world.entity.ai.attributes.GenericAttributes;
+ import net.minecraft.world.entity.player.EntityHuman;
+ import net.minecraft.world.inventory.Container;
+ import net.minecraft.world.item.EnumColor;
++import net.minecraft.world.item.enchantment.EnchantmentManager;
++import net.minecraft.world.item.enchantment.Enchantments;
+ import net.minecraft.world.level.EnumGamemode;
+ import net.minecraft.world.level.block.entity.TileEntitySign;
+ import net.minecraft.world.level.saveddata.maps.MapIcon;
+@@ -1180,8 +1184,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return GameMode.getByValue(getHandle().playerInteractManager.getGameMode().getId());
}
@@ -55,10 +73,10 @@ index cf9ae60db30ef09bb4c89935a42632e562b6d61e..f8780db8f376ee71a35ebe1c2ab84a61
+ public int applyMending(int amount) {
+ EntityPlayer handle = getHandle();
+ // Logic copied from EntityExperienceOrb and remapped to unobfuscated methods/properties
-+ net.minecraft.server.ItemStack itemstack = net.minecraft.server.EnchantmentManager.getRandomEquippedItemWithEnchant(net.minecraft.server.Enchantments.MENDING, handle);
++ net.minecraft.world.item.ItemStack itemstack = EnchantmentManager.getRandomEquippedItemWithEnchant(Enchantments.MENDING, handle);
+ if (!itemstack.isEmpty() && itemstack.getItem().usesDurability()) {
+
-+ net.minecraft.server.EntityExperienceOrb orb = net.minecraft.server.EntityTypes.EXPERIENCE_ORB.create(handle.world);
++ EntityExperienceOrb orb = EntityTypes.EXPERIENCE_ORB.create(handle.world);
+ orb.value = amount;
+ orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM;
+ orb.setPositionRaw(handle.locX(), handle.locY(), handle.locZ());
diff --git a/Spigot-Server-Patches/0186-PreCreatureSpawnEvent.patch b/Spigot-Server-Patches/0186-PreCreatureSpawnEvent.patch
index 4f00d259ec..6c66c1146f 100644
--- a/Spigot-Server-Patches/0186-PreCreatureSpawnEvent.patch
+++ b/Spigot-Server-Patches/0186-PreCreatureSpawnEvent.patch
@@ -69,10 +69,18 @@ index 41f1aecbf6b506231a1b3b525fe0ce23b35c7840..6c01e460d3a1ff7f865ebc34dfd28d55
entityliving.getBehaviorController().a(MemoryModuleType.GOLEM_DETECTED_RECENTLY, true, 600L);
}
diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
-index adce6f17a5dd33004f8a67cd55d195de029e0263..d1afbfc4458c76a35b9be124f1e09c3b82501798 100644
+index adce6f17a5dd33004f8a67cd55d195de029e0263..534efe39beee393d11705b8f0b13ce4ca727c3eb 100644
--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
-@@ -936,6 +936,21 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
+@@ -30,6 +30,7 @@ import net.minecraft.network.protocol.game.PacketDebug;
+ import net.minecraft.network.syncher.DataWatcher;
+ import net.minecraft.network.syncher.DataWatcherObject;
+ import net.minecraft.network.syncher.DataWatcherRegistry;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.server.MinecraftServer;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.sounds.SoundEffect;
+@@ -936,6 +937,21 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
BlockPosition blockposition1 = this.a(blockposition, d0, d1);
if (blockposition1 != null) {
@@ -95,10 +103,18 @@ index adce6f17a5dd33004f8a67cd55d195de029e0263..d1afbfc4458c76a35b9be124f1e09c3b
if (entityirongolem != null) {
diff --git a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
-index 883c724fbb86a84ee903b5e7127f14726fe4cf24..79339bcbe15e5b3a409148245c68bbff3a59f59f 100644
+index 883c724fbb86a84ee903b5e7127f14726fe4cf24..d4b8126f12fdf7d9b4f882d3ed7d8da544ed9e8a 100644
--- a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
-@@ -125,6 +125,27 @@ public abstract class MobSpawnerAbstract {
+@@ -12,6 +12,7 @@ import net.minecraft.core.particles.Particles;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.nbt.NBTTagList;
+ import net.minecraft.resources.MinecraftKey;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.util.UtilColor;
+ import net.minecraft.util.WeightedRandom;
+@@ -125,6 +126,27 @@ public abstract class MobSpawnerAbstract {
WorldServer worldserver = (WorldServer) world;
if (EntityPositionTypes.a((EntityTypes) optional.get(), worldserver, EnumMobSpawn.SPAWNER, new BlockPosition(d3, d4, d5), world.getRandom())) {
@@ -127,10 +143,18 @@ index 883c724fbb86a84ee903b5e7127f14726fe4cf24..79339bcbe15e5b3a409148245c68bbff
entity1.setPositionRotation(d3, d4, d5, entity1.yaw, entity1.pitch);
return entity1;
diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/main/java/net/minecraft/world/level/SpawnerCreature.java
-index fd0595fd584046326eccacdf0a6afe40c5e84eed..9a039ce12879baf8088c2ccaf0af61109efb7d74 100644
+index fd0595fd584046326eccacdf0a6afe40c5e84eed..1969d1002b3182338614a2be0519fcdc385b7a44 100644
--- a/src/main/java/net/minecraft/world/level/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/world/level/SpawnerCreature.java
-@@ -216,9 +216,16 @@ public final class SpawnerCreature {
+@@ -15,6 +15,7 @@ import net.minecraft.core.EnumDirection;
+ import net.minecraft.core.IPosition;
+ import net.minecraft.core.IRegistry;
+ import net.minecraft.nbt.NBTTagCompound;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.tags.Tag;
+ import net.minecraft.tags.TagsBlock;
+@@ -216,9 +217,16 @@ public final class SpawnerCreature {
j1 = biomesettingsmobs_c.d + worldserver.random.nextInt(1 + biomesettingsmobs_c.e - biomesettingsmobs_c.d);
}
@@ -148,7 +172,7 @@ index fd0595fd584046326eccacdf0a6afe40c5e84eed..9a039ce12879baf8088c2ccaf0af6110
if (entityinsentient == null) {
return;
}
-@@ -271,8 +278,24 @@ public final class SpawnerCreature {
+@@ -271,8 +279,24 @@ public final class SpawnerCreature {
}
}
diff --git a/Spigot-Server-Patches/0192-Extend-Player-Interact-cancellation.patch b/Spigot-Server-Patches/0192-Extend-Player-Interact-cancellation.patch
index 6133c1f722..8126ba4dc2 100644
--- a/Spigot-Server-Patches/0192-Extend-Player-Interact-cancellation.patch
+++ b/Spigot-Server-Patches/0192-Extend-Player-Interact-cancellation.patch
@@ -13,10 +13,26 @@ Update adjacent blocks of doors, double plants, pistons and beds
when cancelling interaction.
diff --git a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
-index 51157a9223f3da22d1110cfa211a502de59fb8a1..13e02b8d73164bc36e8d29edf8b0b2cb51fe3080 100644
+index 51157a9223f3da22d1110cfa211a502de59fb8a1..cea19f4aafb3d81bf0dfcdac9103c03786fd5fc2 100644
--- a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
-@@ -179,6 +179,11 @@ public class PlayerInteractManager {
+@@ -6,6 +6,7 @@ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.EnumDirection;
+ import net.minecraft.network.protocol.game.PacketPlayInBlockDig;
+ import net.minecraft.network.protocol.game.PacketPlayOutBlockBreak;
++import net.minecraft.network.protocol.game.PacketPlayOutCloseWindow;
+ import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo;
+ import net.minecraft.world.EnumHand;
+ import net.minecraft.world.EnumInteractionResult;
+@@ -18,6 +19,7 @@ import net.minecraft.world.level.EnumGamemode;
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.level.block.Block;
+ import net.minecraft.world.level.block.BlockCommand;
++import net.minecraft.world.level.block.BlockFlowerPot;
+ import net.minecraft.world.level.block.BlockJigsaw;
+ import net.minecraft.world.level.block.BlockStructure;
+ import net.minecraft.world.level.block.entity.TileEntity;
+@@ -179,6 +181,11 @@ public class PlayerInteractManager {
PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, blockposition, enumdirection, this.player.inventory.getItemInHand(), EnumHand.MAIN_HAND);
if (event.isCancelled()) {
// Let the client know the block still exists
@@ -28,7 +44,7 @@ index 51157a9223f3da22d1110cfa211a502de59fb8a1..13e02b8d73164bc36e8d29edf8b0b2cb
this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition));
// Update any tile entity data for this block
TileEntity tileentity = this.world.getTileEntity(blockposition);
-@@ -483,13 +488,32 @@ public class PlayerInteractManager {
+@@ -483,13 +490,32 @@ public class PlayerInteractManager {
interactItemStack = itemstack.cloneItemStack();
if (event.useInteractedBlock() == Event.Result.DENY) {
diff --git a/Spigot-Server-Patches/0197-Implement-extended-PaperServerListPingEvent.patch b/Spigot-Server-Patches/0197-Implement-extended-PaperServerListPingEvent.patch
index 14740e889e..0f2e5b2787 100644
--- a/Spigot-Server-Patches/0197-Implement-extended-PaperServerListPingEvent.patch
+++ b/Spigot-Server-Patches/0197-Implement-extended-PaperServerListPingEvent.patch
@@ -223,7 +223,7 @@ index 005ae7a75dfb19152abb606da29acad07c85e499..b9e36a83837913cd3e5abe598f695ba7
this.c = agameprofile;
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 5b796a6e5f34c38e15d9ce288dfd9bf498cc328e..d69b6783572b44c9b8d49d0853a8282e14e64476 100644
+index d181a41c1724ee6e84f5239649ab74df158d5f24..9672619d3f206a5290d459b300ecdf53b7b70d91 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2,6 +2,9 @@ package net.minecraft.server;
@@ -236,7 +236,7 @@ index 5b796a6e5f34c38e15d9ce288dfd9bf498cc328e..d69b6783572b44c9b8d49d0853a8282e
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
-@@ -1228,7 +1231,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1229,7 +1232,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
if (i - this.T >= 5000000000L) {
this.T = i;
this.serverPing.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.getMaxPlayers(), this.getPlayerCount()));
diff --git a/Spigot-Server-Patches/0200-Player.setPlayerProfile-API.patch b/Spigot-Server-Patches/0200-Player.setPlayerProfile-API.patch
index 7dba2f3c12..a800c632bf 100644
--- a/Spigot-Server-Patches/0200-Player.setPlayerProfile-API.patch
+++ b/Spigot-Server-Patches/0200-Player.setPlayerProfile-API.patch
@@ -48,10 +48,18 @@ index 18b0020d184e46c8957e82100681c8c66b1c3b62..41dd46c6ef95f7dc41d9ca36a5f0b85f
private final ItemCooldown bM;
@Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index f8780db8f376ee71a35ebe1c2ab84a6117d0d74e..87d00559fb54ed93a374ce827d2d99b4a11c73d7 100644
+index 4766a78a0562e5ae6e7d4850bd7b5d71425c3a0c..e6adf5ab609076bf1c25061429ed9aba1df1d9cb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1308,8 +1308,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -70,6 +70,7 @@ import net.minecraft.world.item.EnumColor;
+ import net.minecraft.world.item.enchantment.EnchantmentManager;
+ import net.minecraft.world.item.enchantment.Enchantments;
+ import net.minecraft.world.level.EnumGamemode;
++import net.minecraft.world.level.biome.BiomeManager;
+ import net.minecraft.world.level.block.entity.TileEntitySign;
+ import net.minecraft.world.level.saveddata.maps.MapIcon;
+ import net.minecraft.world.phys.Vec3D;
+@@ -1312,8 +1313,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
hiddenPlayers.put(player.getUniqueId(), hidingPlugins);
// Remove this player from the hidden player's EntityTrackerEntry
@@ -66,7 +74,7 @@ index f8780db8f376ee71a35ebe1c2ab84a6117d0d74e..87d00559fb54ed93a374ce827d2d99b4
PlayerChunkMap.EntityTracker entry = tracker.trackedEntities.get(other.getId());
if (entry != null) {
entry.clear(getHandle());
-@@ -1350,8 +1355,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1354,8 +1360,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
hiddenPlayers.remove(player.getUniqueId());
@@ -81,7 +89,7 @@ index f8780db8f376ee71a35ebe1c2ab84a6117d0d74e..87d00559fb54ed93a374ce827d2d99b4
getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, other));
-@@ -1360,6 +1370,50 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1364,6 +1375,50 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
entry.updatePlayer(getHandle());
}
}
@@ -118,7 +126,7 @@ index f8780db8f376ee71a35ebe1c2ab84a6117d0d74e..87d00559fb54ed93a374ce827d2d99b4
+
+ //Respawn the player then update their position and selected slot
+ WorldServer worldserver = handle.getWorldServer();
-+ connection.sendPacket(new net.minecraft.network.protocol.game.PacketPlayOutRespawn(worldserver.getDimensionManager(), worldserver.getDimensionKey(), net.minecraft.server.BiomeManager.a(worldserver.getSeed()), handle.playerInteractManager.getGameMode(), handle.playerInteractManager.c(), worldserver.isDebugWorld(), worldserver.isFlatWorld(), true));
++ connection.sendPacket(new net.minecraft.network.protocol.game.PacketPlayOutRespawn(worldserver.getDimensionManager(), worldserver.getDimensionKey(), BiomeManager.a(worldserver.getSeed()), handle.playerInteractManager.getGameMode(), handle.playerInteractManager.c(), worldserver.isDebugWorld(), worldserver.isFlatWorld(), true));
+ handle.updateAbilities();
+ connection.sendPacket(new net.minecraft.network.protocol.game.PacketPlayOutPosition(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), new HashSet<>(), 0));
+ net.minecraft.server.MinecraftServer.getServer().getPlayerList().updateClient(handle);
diff --git a/Spigot-Server-Patches/0206-Flag-to-disable-the-channel-limit.patch b/Spigot-Server-Patches/0206-Flag-to-disable-the-channel-limit.patch
index a4de34622c..a03a302879 100644
--- a/Spigot-Server-Patches/0206-Flag-to-disable-the-channel-limit.patch
+++ b/Spigot-Server-Patches/0206-Flag-to-disable-the-channel-limit.patch
@@ -9,10 +9,10 @@ e.g. servers which allow and support the usage of mod packs.
provide an optional flag to disable this check, at your own risk.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index cddba4763f11ad51807693a07484511c473ffadf..785682d7b932693ff0c437563c9f53f32136e75e 100644
+index e6adf5ab609076bf1c25061429ed9aba1df1d9cb..871c0e0b0c6df68c0f8c87828a01fe006d0646fb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -141,6 +141,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -146,6 +146,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper start
private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus;
private String resourcePackHash;
@@ -20,7 +20,7 @@ index cddba4763f11ad51807693a07484511c473ffadf..785682d7b932693ff0c437563c9f53f3
// Paper end
public CraftPlayer(CraftServer server, EntityPlayer entity) {
-@@ -1576,7 +1577,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1581,7 +1582,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void addChannel(String channel) {
diff --git a/Spigot-Server-Patches/0207-Add-method-to-open-already-placed-sign.patch b/Spigot-Server-Patches/0207-Add-method-to-open-already-placed-sign.patch
index 11e18a9ac6..203a050a82 100644
--- a/Spigot-Server-Patches/0207-Add-method-to-open-already-placed-sign.patch
+++ b/Spigot-Server-Patches/0207-Add-method-to-open-already-placed-sign.patch
@@ -5,10 +5,18 @@ Subject: [PATCH] Add method to open already placed sign
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-index f209e6d8fa20ceb7db71a6bb1685fd79b13f0738..d53cbcb6bba9d2526dbecb118735443c839c67d2 100644
+index 8661f97ac885daca068057c1fcc4eed54c6d7f14..db7ad5a94d449f58a5749115776e61f448ff2f52 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-@@ -603,6 +603,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
+@@ -30,6 +30,7 @@ import net.minecraft.world.level.block.BlockWorkbench;
+ import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.block.entity.TileEntity;
+ import net.minecraft.world.level.block.entity.TileEntityContainer;
++import net.minecraft.world.level.block.entity.TileEntitySign;
+ import net.minecraft.world.level.block.state.IBlockData;
+ import org.bukkit.GameMode;
+ import org.bukkit.Location;
+@@ -603,6 +604,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
}
}
@@ -17,7 +25,7 @@ index f209e6d8fa20ceb7db71a6bb1685fd79b13f0738..d53cbcb6bba9d2526dbecb118735443c
+ public void openSign(org.bukkit.block.Sign sign) {
+ org.apache.commons.lang.Validate.isTrue(sign.getWorld().equals(this.getWorld()), "Sign must be in the same world as player is in");
+ org.bukkit.craftbukkit.block.CraftSign craftSign = (org.bukkit.craftbukkit.block.CraftSign) sign;
-+ net.minecraft.server.TileEntitySign teSign = craftSign.getTileEntity();
++ TileEntitySign teSign = craftSign.getTileEntity();
+ // Make sign editable temporarily, will be set back to false in PlayerConnection later
+ teSign.isEditable = true;
+ getHandle().openSign(teSign);
diff --git a/Spigot-Server-Patches/0217-Allow-spawning-Item-entities-with-World.spawnEntity.patch b/Spigot-Server-Patches/0217-Allow-spawning-Item-entities-with-World.spawnEntity.patch
index b646fd3ef8..8ce474e8f6 100644
--- a/Spigot-Server-Patches/0217-Allow-spawning-Item-entities-with-World.spawnEntity.patch
+++ b/Spigot-Server-Patches/0217-Allow-spawning-Item-entities-with-World.spawnEntity.patch
@@ -8,7 +8,7 @@ This API has more capabilities than .dropItem with the Consumer function
Item can be set inside of the Consumer pre spawn function.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 6e2f73cac222044256e97bc2c07f5581d63de1a2..e2dd76d0bc5db5dd07d8574135b8d64b40e2c34a 100644
+index 9b64aad8834d9e9047331415bd4fc18800eac734..d41bf389bf64d8548ea6eda67429404dc9f19ede 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1521,6 +1521,10 @@ public class CraftWorld implements World {
@@ -17,7 +17,7 @@ index 6e2f73cac222044256e97bc2c07f5581d63de1a2..e2dd76d0bc5db5dd07d8574135b8d64b
entity.setPositionRotation(x, y, z, yaw, pitch);
+ // Paper start
+ } else if (org.bukkit.entity.Item.class.isAssignableFrom(clazz)) {
-+ entity = new EntityItem(world, x, y, z, new net.minecraft.server.ItemStack(net.minecraft.server.Item.getItemOf(net.minecraft.server.Blocks.DIRT)));
++ entity = new EntityItem(world, x, y, z, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Item.getItemOf(net.minecraft.world.level.block.Blocks.DIRT)));
+ // Paper end
} else if (FallingBlock.class.isAssignableFrom(clazz)) {
entity = new EntityFallingBlock(world, x, y, z, world.getType(new BlockPosition(x, y, z)));
diff --git a/Spigot-Server-Patches/0220-Implement-EntityTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/0220-Implement-EntityTeleportEndGatewayEvent.patch
index 946ec2d235..188e408423 100644
--- a/Spigot-Server-Patches/0220-Implement-EntityTeleportEndGatewayEvent.patch
+++ b/Spigot-Server-Patches/0220-Implement-EntityTeleportEndGatewayEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Implement EntityTeleportEndGatewayEvent
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
-index 8f2db48201925f4a5dac5dfc19bb2b96438959e1..1d90cb32560a9102ebe43dfa9806b407d0ee1bd1 100644
+index 2808cd0b100bd65a730aba315ab47a59a4621b30..b7548d0b3938d95328fc86db4000190532eaa8f5 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
-@@ -193,9 +193,20 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
+@@ -194,9 +194,20 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
}
// CraftBukkit end
diff --git a/Spigot-Server-Patches/0233-Implement-World.getEntity-UUID-API.patch b/Spigot-Server-Patches/0233-Implement-World.getEntity-UUID-API.patch
index 7b4017c78a..e033cb6e9f 100644
--- a/Spigot-Server-Patches/0233-Implement-World.getEntity-UUID-API.patch
+++ b/Spigot-Server-Patches/0233-Implement-World.getEntity-UUID-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Implement World.getEntity(UUID) API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index ad80ebd9d69b4d86078a7c3daa274f115f172794..d8d8a8e10911424ba6ce8a80c58f172fbe0b44af 100644
+index 6167c284b08636452519cbff43d2807ea0575bd5..1bb6ed364cdde01fe54553cfad8ec4256789620b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1310,6 +1310,15 @@ public class CraftWorld implements World {
@@ -16,7 +16,7 @@ index ad80ebd9d69b4d86078a7c3daa274f115f172794..d8d8a8e10911424ba6ce8a80c58f172f
+ @Override
+ public Entity getEntity(UUID uuid) {
+ Validate.notNull(uuid, "UUID cannot be null");
-+ net.minecraft.server.Entity entity = world.getEntity(uuid);
++ net.minecraft.world.entity.Entity entity = world.getEntity(uuid);
+ return entity == null ? null : entity.getBukkitEntity();
+ }
+ // Paper end
diff --git a/Spigot-Server-Patches/0234-InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/0234-InventoryCloseEvent-Reason-API.patch
index 497aacaf6c..de6e636359 100644
--- a/Spigot-Server-Patches/0234-InventoryCloseEvent-Reason-API.patch
+++ b/Spigot-Server-Patches/0234-InventoryCloseEvent-Reason-API.patch
@@ -112,7 +112,7 @@ index 415f34109019e68638f76fefa52bd8d40c449e12..c4f14fabc83a9cb13f8f82b651119e0a
this.player.o();
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 738a69a1a5765897fb3ca3b4ceb07cddade0d27f..349bd74e7e4d1dea9587e55cb6afc1968628ca01 100644
+index ae877ea38a63ef8d0bd9855e9b9279475bb6c465..95cadb09b5a154d7dfe8144fab6c403547672287 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -494,7 +494,7 @@ public abstract class PlayerList {
@@ -152,10 +152,10 @@ index 3c49d7acd4ad0717886adf6c469e8a49a58e859b..b6effe1037f3ae59e6faa5f5d039b6ad
this.activeContainer = this.defaultContainer;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-index a3396a19ba60daeb7240f23831e4bc28631098cc..2ca9d061ec951fb0563959620f0e99590e3038af 100644
+index db7ad5a94d449f58a5749115776e61f448ff2f52..e8f8a07f256e01c5792199bf47f3cc1f0f3d1610 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-@@ -372,7 +372,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
+@@ -373,7 +373,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
if (((EntityPlayer) getHandle()).playerConnection == null) return;
if (getHandle().activeContainer != getHandle().defaultContainer) {
// fire INVENTORY_CLOSE if one already open
@@ -164,7 +164,7 @@ index a3396a19ba60daeb7240f23831e4bc28631098cc..2ca9d061ec951fb0563959620f0e9959
}
EntityPlayer player = (EntityPlayer) getHandle();
Container container;
-@@ -442,8 +442,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
+@@ -443,8 +443,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@Override
public void closeInventory() {
@@ -180,10 +180,10 @@ index a3396a19ba60daeb7240f23831e4bc28631098cc..2ca9d061ec951fb0563959620f0e9959
@Override
public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 89476782c71a0c54ff140a501a97fdfc4c8f4b81..b4c763d2935aad0038128a61ed09c4904975f0ef 100644
+index 871c0e0b0c6df68c0f8c87828a01fe006d0646fb..32228b4eddaadabbae46ebbc5eb3404acf73fb29 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -895,7 +895,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -900,7 +900,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Close any foreign inventory
if (getHandle().activeContainer != getHandle().defaultContainer) {
diff --git a/Spigot-Server-Patches/0248-Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/0248-Vanished-players-don-t-have-rights.patch
index d709061d84..9892a1b936 100644
--- a/Spigot-Server-Patches/0248-Vanished-players-don-t-have-rights.patch
+++ b/Spigot-Server-Patches/0248-Vanished-players-don-t-have-rights.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Vanished players don't have rights
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 36ac9ba19b3bbcab40b5d4339ba9c297d4b5a65b..e243aa01d59c3e1b6c813922bcf6e04db0693d20 100644
+index c88eea18e2e219f242c53ffb4e28cfc6d7bf318a..3a46a5001cda7402a97ac8552650cf64e7881fad 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -184,7 +184,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -18,10 +18,18 @@ index 36ac9ba19b3bbcab40b5d4339ba9c297d4b5a65b..e243aa01d59c3e1b6c813922bcf6e04d
protected int j;
@Nullable
diff --git a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
-index 65cea9282467cb362ac6e9e0bb03c5d36085ee43..8967cf1e0238941370412109eff2ccf19f86b727 100644
+index 65cea9282467cb362ac6e9e0bb03c5d36085ee43..65cee640040bdd1229149409ff046b765ee08c34 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
-@@ -140,8 +140,14 @@ public abstract class IProjectile extends Entity {
+@@ -4,6 +4,7 @@ import java.util.Iterator;
+ import java.util.UUID;
+ import javax.annotation.Nullable;
+ import net.minecraft.nbt.NBTTagCompound;
++import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.util.MathHelper;
+ import net.minecraft.world.entity.Entity;
+@@ -140,8 +141,14 @@ public abstract class IProjectile extends Entity {
protected boolean a(Entity entity) {
if (!entity.isSpectator() && entity.isAlive() && entity.isInteractable()) {
Entity entity1 = this.getShooter();
diff --git a/Spigot-Server-Patches/0249-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch b/Spigot-Server-Patches/0249-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch
index 37b456246d..a5f5fb4d8d 100644
--- a/Spigot-Server-Patches/0249-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch
+++ b/Spigot-Server-Patches/0249-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index 86872f4e65d7e0ca68237a42fe87f33ba7a92802..bae9ba25136d66f59b03f0ad3d6ac1f915097ae2 100644
+index 7918dd4ad3e8cbb905b3929062a70fb7961b7d68..f56ff8e727c74870229d4d146b13534863f620d6 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -558,6 +558,7 @@ public class Chunk implements IChunkAccess {
+@@ -560,6 +560,7 @@ public class Chunk implements IChunkAccess {
entity.chunkZ = this.loc.z;
this.entities.add(entity); // Paper - per chunk entity list
this.entitySlices[k].add(entity);
@@ -17,7 +17,7 @@ index 86872f4e65d7e0ca68237a42fe87f33ba7a92802..bae9ba25136d66f59b03f0ad3d6ac1f9
}
@Override
-@@ -586,6 +587,7 @@ public class Chunk implements IChunkAccess {
+@@ -588,6 +589,7 @@ public class Chunk implements IChunkAccess {
return;
}
entityCounts.decrement(entity.getMinecraftKeyString());
diff --git a/Spigot-Server-Patches/0250-Add-some-Debug-to-Chunk-Entity-slices.patch b/Spigot-Server-Patches/0250-Add-some-Debug-to-Chunk-Entity-slices.patch
index d3aa3ba8a9..71c72d329e 100644
--- a/Spigot-Server-Patches/0250-Add-some-Debug-to-Chunk-Entity-slices.patch
+++ b/Spigot-Server-Patches/0250-Add-some-Debug-to-Chunk-Entity-slices.patch
@@ -9,22 +9,31 @@ This should hopefully avoid duplicate entities ever being created
if the entity was to end up in 2 different chunk slices
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index e243aa01d59c3e1b6c813922bcf6e04db0693d20..6c6171175b1f9cd4471162d070f668263f900dc0 100644
+index 3a46a5001cda7402a97ac8552650cf64e7881fad..102c2bb98a99cdbfcdf1297341dbba91434ee0e3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -157,6 +157,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
}
}
};
-+ List<Entity> entitySlice = null;
++ public List<Entity> entitySlice = null;
// Paper end
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index bae9ba25136d66f59b03f0ad3d6ac1f915097ae2..1fa3e4418d14bd761ffbca6ea5dd80f6251caf16 100644
+index f56ff8e727c74870229d4d146b13534863f620d6..e4accac8f2e8daa58f9b0c279ffcad9347448bb0 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -549,6 +549,25 @@ public class Chunk implements IChunkAccess {
+@@ -26,6 +26,8 @@ import net.minecraft.ReportedException;
+ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.IRegistry;
+ import net.minecraft.nbt.NBTTagCompound;
++import net.minecraft.server.MinecraftServer;
++import net.minecraft.server.level.ChunkProviderServer;
+ import net.minecraft.server.level.PlayerChunk;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.util.EntitySlice;
+@@ -551,6 +553,25 @@ public class Chunk implements IChunkAccess {
if (k >= this.entitySlices.length) {
k = this.entitySlices.length - 1;
}
@@ -50,7 +59,7 @@ index bae9ba25136d66f59b03f0ad3d6ac1f915097ae2..1fa3e4418d14bd761ffbca6ea5dd80f6
if (!entity.inChunk || entity.getCurrentChunk() != this) entityCounts.increment(entity.getMinecraftKeyString()); // Paper
entity.inChunk = true;
-@@ -558,6 +577,7 @@ public class Chunk implements IChunkAccess {
+@@ -560,6 +581,7 @@ public class Chunk implements IChunkAccess {
entity.chunkZ = this.loc.z;
this.entities.add(entity); // Paper - per chunk entity list
this.entitySlices[k].add(entity);
@@ -58,7 +67,7 @@ index bae9ba25136d66f59b03f0ad3d6ac1f915097ae2..1fa3e4418d14bd761ffbca6ea5dd80f6
this.markDirty(); // Paper
}
-@@ -583,6 +603,10 @@ public class Chunk implements IChunkAccess {
+@@ -585,6 +607,10 @@ public class Chunk implements IChunkAccess {
// Paper start
if (entity.currentChunk != null && entity.currentChunk.get() == this) entity.setCurrentChunk(null);
diff --git a/Spigot-Server-Patches/0252-Prevent-Saving-Bad-entities-to-chunks.patch b/Spigot-Server-Patches/0252-Prevent-Saving-Bad-entities-to-chunks.patch
index 7df29dd5de..547315f0bb 100644
--- a/Spigot-Server-Patches/0252-Prevent-Saving-Bad-entities-to-chunks.patch
+++ b/Spigot-Server-Patches/0252-Prevent-Saving-Bad-entities-to-chunks.patch
@@ -18,7 +18,7 @@ an invalid entity.
This should reduce log occurrences of dupe uuid messages.
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
-index 70b837ef82dfe46eb24625b96f9bdbe2e7f2cc2d..b121d404f3afb69fa1d0eae727c1dba92eadb0e5 100644
+index 04b708e776f277985340f329dc8cb3c16a6100a7..c59bcb6e19b712e007c7bf66bf70a4ffa3c6c2cd 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -1155,6 +1155,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -56,10 +56,18 @@ index 70b837ef82dfe46eb24625b96f9bdbe2e7f2cc2d..b121d404f3afb69fa1d0eae727c1dba9
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-index f301c7ba4b17b92c6cf2fcee6da1e67081dad4fa..1711c40e163a1148e2f7be58d4c020c61bef8bb2 100644
+index f301c7ba4b17b92c6cf2fcee6da1e67081dad4fa..69bc9dc18bab157851d8080a672504598e8572a8 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-@@ -349,6 +349,7 @@ public class ChunkRegionLoader {
+@@ -26,6 +26,7 @@ import net.minecraft.nbt.NBTTagList;
+ import net.minecraft.nbt.NBTTagLongArray;
+ import net.minecraft.nbt.NBTTagShort;
+ import net.minecraft.server.level.ChunkProviderServer;
++import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.server.level.LightEngineThreaded;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.world.entity.Entity;
+@@ -349,6 +350,7 @@ public class ChunkRegionLoader {
nbttagcompound1.set("TileEntities", nbttaglist1);
NBTTagList nbttaglist2 = new NBTTagList();
@@ -67,7 +75,7 @@ index f301c7ba4b17b92c6cf2fcee6da1e67081dad4fa..1711c40e163a1148e2f7be58d4c020c6
if (ichunkaccess.getChunkStatus().getType() == ChunkStatus.Type.LEVELCHUNK) {
Chunk chunk = (Chunk) ichunkaccess;
-@@ -366,13 +367,28 @@ public class ChunkRegionLoader {
+@@ -366,13 +368,28 @@ public class ChunkRegionLoader {
while (iterator1.hasNext()) {
Entity entity = (Entity) iterator1.next();
NBTTagCompound nbttagcompound4 = new NBTTagCompound();
@@ -97,7 +105,7 @@ index f301c7ba4b17b92c6cf2fcee6da1e67081dad4fa..1711c40e163a1148e2f7be58d4c020c6
} else {
ProtoChunk protochunk = (ProtoChunk) ichunkaccess;
-@@ -431,6 +447,19 @@ public class ChunkRegionLoader {
+@@ -431,6 +448,19 @@ public class ChunkRegionLoader {
nbttagcompound1.set("Structures", a(chunkcoordintpair, ichunkaccess.h(), ichunkaccess.v()));
return nbttagcompound;
}
diff --git a/Spigot-Server-Patches/0254-Ignore-Dead-Entities-in-entityList-iteration.patch b/Spigot-Server-Patches/0254-Ignore-Dead-Entities-in-entityList-iteration.patch
index 81f9584f93..ef440ea746 100644
--- a/Spigot-Server-Patches/0254-Ignore-Dead-Entities-in-entityList-iteration.patch
+++ b/Spigot-Server-Patches/0254-Ignore-Dead-Entities-in-entityList-iteration.patch
@@ -43,7 +43,7 @@ index c59bcb6e19b712e007c7bf66bf70a4ffa3c6c2cd..8452b4f62689b231d38f4608c2d72b41
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 6c6171175b1f9cd4471162d070f668263f900dc0..a7115fb1fc6fadb38c7cc9f23629473a7173982e 100644
+index 102c2bb98a99cdbfcdf1297341dbba91434ee0e3..046b191e771ed9be337e095214a67febd768e5f6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -276,6 +276,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -55,10 +55,10 @@ index 6c6171175b1f9cd4471162d070f668263f900dc0..a7115fb1fc6fadb38c7cc9f23629473a
public float getBukkitYaw() {
return this.yaw;
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index 1fa3e4418d14bd761ffbca6ea5dd80f6251caf16..246a4b69e1b4ee6affa9564d50f261fac2f269d0 100644
+index e4accac8f2e8daa58f9b0c279ffcad9347448bb0..79ff96f18c53f3d1ce4a00be2e2d8fe68f77bf54 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -859,6 +859,7 @@ public class Chunk implements IChunkAccess {
+@@ -863,6 +863,7 @@ public class Chunk implements IChunkAccess {
for (int i1 = 0; i1 < l; ++i1) {
Entity entity1 = (Entity) list1.get(i1);
@@ -66,7 +66,7 @@ index 1fa3e4418d14bd761ffbca6ea5dd80f6251caf16..246a4b69e1b4ee6affa9564d50f261fa
if (entity1.getBoundingBox().c(axisalignedbb) && entity1 != entity) {
if (predicate == null || predicate.test(entity1)) {
-@@ -896,6 +897,7 @@ public class Chunk implements IChunkAccess {
+@@ -900,6 +901,7 @@ public class Chunk implements IChunkAccess {
while (iterator.hasNext()) {
T entity = (T) iterator.next(); // CraftBukkit - decompile error
@@ -74,7 +74,7 @@ index 1fa3e4418d14bd761ffbca6ea5dd80f6251caf16..246a4b69e1b4ee6affa9564d50f261fa
if ((entitytypes == null || entity.getEntityType() == entitytypes) && entity.getBoundingBox().c(axisalignedbb) && predicate.test(entity)) {
list.add(entity);
-@@ -918,6 +920,7 @@ public class Chunk implements IChunkAccess {
+@@ -922,6 +924,7 @@ public class Chunk implements IChunkAccess {
while (iterator.hasNext()) {
T t0 = (T) iterator.next(); // CraftBukkit - decompile error
@@ -83,7 +83,7 @@ index 1fa3e4418d14bd761ffbca6ea5dd80f6251caf16..246a4b69e1b4ee6affa9564d50f261fa
if (oclass.isInstance(t0) && t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) { // Spigot - instance check
list.add(t0);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 71916f826ecd6203207cd5e2f9e51120fe539661..2869a121ff5477bf12b1e078e413be8e0dce1ff3 100644
+index 1bb6ed364cdde01fe54553cfad8ec4256789620b..24c80cf3820622297046abaa13205814b8178195 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1046,6 +1046,7 @@ public class CraftWorld implements World {
diff --git a/Spigot-Server-Patches/0255-Implement-Expanded-ArmorStand-API.patch b/Spigot-Server-Patches/0255-Implement-Expanded-ArmorStand-API.patch
index 18ea30042a..55ff4fad22 100644
--- a/Spigot-Server-Patches/0255-Implement-Expanded-ArmorStand-API.patch
+++ b/Spigot-Server-Patches/0255-Implement-Expanded-ArmorStand-API.patch
@@ -20,10 +20,18 @@ index 829013f57128cc6c92a45098c6883f2305cf4ea5..e97d25339b37a70f91022dcb021bbe82
return (this.disabledSlots & 1 << enumitemslot.getSlotFlag()) != 0 || enumitemslot.a() == EnumItemSlot.Function.HAND && !this.hasArms();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
-index 6f922e4cbb095439fcd76ee0d0c08bc4160b8107..226d3a242c602a3e4d16b6eab11d938a1e3e84ba 100644
+index 6f922e4cbb095439fcd76ee0d0c08bc4160b8107..103f935d9b7a2cbe9639528c587d8ac2e5f14d07 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
-@@ -239,5 +239,78 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
+@@ -1,6 +1,7 @@
+ package org.bukkit.craftbukkit.entity;
+
+ import net.minecraft.core.Vector3f;
++import net.minecraft.world.entity.EnumItemSlot;
+ import net.minecraft.world.entity.decoration.EntityArmorStand;
+ import org.bukkit.craftbukkit.CraftEquipmentSlot;
+ import org.bukkit.craftbukkit.CraftServer;
+@@ -239,5 +240,78 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
public void setCanMove(boolean move) {
getHandle().canMove = move;
}
@@ -76,7 +84,7 @@ index 6f922e4cbb095439fcd76ee0d0c08bc4160b8107..226d3a242c602a3e4d16b6eab11d938a
+ int disabled = 0;
+ for (org.bukkit.inventory.EquipmentSlot slot : slots) {
+ if (slot == org.bukkit.inventory.EquipmentSlot.OFF_HAND) continue;
-+ net.minecraft.server.EnumItemSlot nmsSlot = org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot);
++ EnumItemSlot nmsSlot = org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot);
+ disabled += (1 << nmsSlot.getSlotFlag()) + (1 << (nmsSlot.getSlotFlag() + 8)) + (1 << (nmsSlot.getSlotFlag() + 16));
+ }
+ getHandle().disabledSlots = disabled;
diff --git a/Spigot-Server-Patches/0260-MC-135506-Experience-should-save-as-Integers.patch b/Spigot-Server-Patches/0260-MC-135506-Experience-should-save-as-Integers.patch
index 462f19eec4..7c85de6290 100644
--- a/Spigot-Server-Patches/0260-MC-135506-Experience-should-save-as-Integers.patch
+++ b/Spigot-Server-Patches/0260-MC-135506-Experience-should-save-as-Integers.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] MC-135506: Experience should save as Integers
diff --git a/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java b/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java
-index dc257a7cafc4b728aa5c99ca332143bb05896d7e..c1fa9437015a554ee875d4d2948dfcc2c8353f12 100644
+index 3387a19044b3ee2a1ef549c328c8bc354a5b6d23..a7551e95185895a290be70d501496279eaf884ae 100644
--- a/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java
-@@ -217,7 +217,7 @@ public class EntityExperienceOrb extends Entity {
+@@ -218,7 +218,7 @@ public class EntityExperienceOrb extends Entity {
public void saveData(NBTTagCompound nbttagcompound) {
nbttagcompound.setShort("Health", (short) this.e);
nbttagcompound.setShort("Age", (short) this.c);
@@ -17,7 +17,7 @@ index dc257a7cafc4b728aa5c99ca332143bb05896d7e..c1fa9437015a554ee875d4d2948dfcc2
this.savePaperNBT(nbttagcompound); // Paper
}
-@@ -225,7 +225,7 @@ public class EntityExperienceOrb extends Entity {
+@@ -226,7 +226,7 @@ public class EntityExperienceOrb extends Entity {
public void loadData(NBTTagCompound nbttagcompound) {
this.e = nbttagcompound.getShort("Health");
this.c = nbttagcompound.getShort("Age");
diff --git a/Spigot-Server-Patches/0261-Fix-client-rendering-skulls-from-same-user.patch b/Spigot-Server-Patches/0261-Fix-client-rendering-skulls-from-same-user.patch
index a207ac3b21..97e95497b3 100644
--- a/Spigot-Server-Patches/0261-Fix-client-rendering-skulls-from-same-user.patch
+++ b/Spigot-Server-Patches/0261-Fix-client-rendering-skulls-from-same-user.patch
@@ -12,10 +12,18 @@ This allows the client to render multiple skull textures from the same user,
for when different skins were used when skull was made.
diff --git a/src/main/java/net/minecraft/network/PacketDataSerializer.java b/src/main/java/net/minecraft/network/PacketDataSerializer.java
-index df459918c14589155a574730205cb35d463b8079..4fc06bc5ef630b07fc8462cf835e6f92b151e6c6 100644
+index df459918c14589155a574730205cb35d463b8079..5a1187b001004afe22d208bc5d7c288e796e16a6 100644
--- a/src/main/java/net/minecraft/network/PacketDataSerializer.java
+++ b/src/main/java/net/minecraft/network/PacketDataSerializer.java
-@@ -311,9 +311,18 @@ public class PacketDataSerializer extends ByteBuf {
+@@ -37,6 +37,7 @@ import net.minecraft.network.chat.IChatBaseComponent;
+ import net.minecraft.resources.MinecraftKey;
+ import net.minecraft.world.item.Item;
+ import net.minecraft.world.item.ItemStack;
++import net.minecraft.world.level.block.entity.TileEntitySkull;
+ import net.minecraft.world.phys.MovingObjectPositionBlock;
+ import net.minecraft.world.phys.Vec3D;
+
+@@ -311,9 +312,18 @@ public class PacketDataSerializer extends ByteBuf {
if (item.usesDurability() || item.n()) {
// Spigot start - filter
itemstack = itemstack.cloneItemStack();
@@ -35,7 +43,7 @@ index df459918c14589155a574730205cb35d463b8079..4fc06bc5ef630b07fc8462cf835e6f92
}
this.a(nbttagcompound);
-@@ -333,7 +342,16 @@ public class PacketDataSerializer extends ByteBuf {
+@@ -333,7 +343,16 @@ public class PacketDataSerializer extends ByteBuf {
itemstack.setTag(this.l());
// CraftBukkit start
if (itemstack.getTag() != null) {
@@ -74,7 +82,7 @@ index b6b55d5baa5e8a6b69a3e4865c06bc8a4d61a4f3..152118729b1a95dcae05d32aa4289034
this.g.add(nbttagcompound);
}
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index c525afbc7d73488db2cae1501cdbe80ec05aeb7c..de171e18fbc6cc5ee06e75f4a3c60fd4c710d8bb 100644
+index c525afbc7d73488db2cae1501cdbe80ec05aeb7c..ce5d8463763dd39e1225d9dec0514b1754df5411 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -114,7 +114,7 @@ public final class ItemStack {
@@ -82,12 +90,12 @@ index c525afbc7d73488db2cae1501cdbe80ec05aeb7c..de171e18fbc6cc5ee06e75f4a3c60fd4
@Deprecated
private Item item;
- private NBTTagCompound tag;
-+ NBTTagCompound tag; // Paper -> package private
++ public NBTTagCompound tag; // Paper private -> public
private boolean j;
private Entity k;
private ShapeDetectorBlock l;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java
-index 06ab45e0927403beb6b5e11d2b5ea93d4786f1d3..0c95465cdc29418063a960033fe80de6932c8aa8 100644
+index 06ab45e0927403beb6b5e11d2b5ea93d4786f1d3..1d1d708d1cbebb5a3ee50d5f46d9d953f22447dc 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java
@@ -8,6 +8,7 @@ import java.util.UUID;
@@ -115,7 +123,7 @@ index 06ab45e0927403beb6b5e11d2b5ea93d4786f1d3..0c95465cdc29418063a960033fe80de6
+ return cmp;
+ }
+
-+ static void sanitizeUUID(NBTTagCompound owner) {
++ public static void sanitizeUUID(NBTTagCompound owner) {
+ NBTTagCompound properties = owner.getCompound("Properties");
+ NBTTagList list = null;
+ if (!properties.isEmpty()) {
diff --git a/Spigot-Server-Patches/0262-Add-Early-Warning-Feature-to-WatchDog.patch b/Spigot-Server-Patches/0262-Add-Early-Warning-Feature-to-WatchDog.patch
index b4e112664c..2791f66b55 100644
--- a/Spigot-Server-Patches/0262-Add-Early-Warning-Feature-to-WatchDog.patch
+++ b/Spigot-Server-Patches/0262-Add-Early-Warning-Feature-to-WatchDog.patch
@@ -36,10 +36,10 @@ index bd508025b771424c942fd856c31d520b6f548082..62621562137cba4804f0465c58d25ca2
public static int tabSpamLimit = 500;
private static void tabSpamLimiters() {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index d69b6783572b44c9b8d49d0853a8282e14e64476..aa5abee5dd7dc601f3f738f11faf434d90e493a4 100644
+index 9672619d3f206a5290d459b300ecdf53b7b70d91..8166ad11642bb1b4b11722a5a09e773a2e749c47 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1007,6 +1007,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1008,6 +1008,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.a(this.serverPing);
// Spigot start
diff --git a/Spigot-Server-Patches/0267-Allow-disabling-armour-stand-ticking.patch b/Spigot-Server-Patches/0267-Allow-disabling-armour-stand-ticking.patch
index c06565f19e..788112651f 100644
--- a/Spigot-Server-Patches/0267-Allow-disabling-armour-stand-ticking.patch
+++ b/Spigot-Server-Patches/0267-Allow-disabling-armour-stand-ticking.patch
@@ -137,10 +137,10 @@ index e97d25339b37a70f91022dcb021bbe82fb8f5eda..8d35240405d7f7245f3c7b0b611973d5
this.datawatcher.set(EntityArmorStand.bh, vector3f);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
-index 226d3a242c602a3e4d16b6eab11d938a1e3e84ba..e87f293cf26d7ce2a8c385936d09be9b41968cea 100644
+index 103f935d9b7a2cbe9639528c587d8ac2e5f14d07..348993f3839f984be65daaf87f3510865e8e4670 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
-@@ -312,5 +312,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
+@@ -313,5 +313,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
public boolean isSlotDisabled(org.bukkit.inventory.EquipmentSlot slot) {
return getHandle().isSlotDisabled(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot));
}
diff --git a/Spigot-Server-Patches/0271-Configurable-speed-for-water-flowing-over-lava.patch b/Spigot-Server-Patches/0271-Configurable-speed-for-water-flowing-over-lava.patch
index 56b931091b..55ef5bbfa1 100644
--- a/Spigot-Server-Patches/0271-Configurable-speed-for-water-flowing-over-lava.patch
+++ b/Spigot-Server-Patches/0271-Configurable-speed-for-water-flowing-over-lava.patch
@@ -20,10 +20,18 @@ index 5ab0e7183e48134b7a0f736462516b1a8a333b04..f280dbff4a09bc611a9ca565c6d697d0
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/block/BlockFluids.java b/src/main/java/net/minecraft/world/level/block/BlockFluids.java
-index 0654c77ab059dea2ad06cb16d07950e153d3f15d..9fcdb06c7907554fc7cdf887a2c313c9f1d1659b 100644
+index 0654c77ab059dea2ad06cb16d07950e153d3f15d..0ed8d938b8fafdb03e01a00a201ba3f8597ac6e9 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockFluids.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockFluids.java
-@@ -100,11 +100,28 @@ public class BlockFluids extends Block implements IFluidSource {
+@@ -23,6 +23,7 @@ import net.minecraft.world.level.material.Fluid;
+ import net.minecraft.world.level.material.FluidType;
+ import net.minecraft.world.level.material.FluidTypeFlowing;
+ import net.minecraft.world.level.material.FluidTypes;
++import net.minecraft.world.level.material.Material;
+ import net.minecraft.world.level.pathfinder.PathMode;
+ import net.minecraft.world.level.storage.loot.LootTableInfo;
+ import net.minecraft.world.phys.shapes.VoxelShape;
+@@ -100,11 +101,28 @@ public class BlockFluids extends Block implements IFluidSource {
@Override
public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) {
if (this.a(world, blockposition, iblockdata)) {
@@ -53,7 +61,7 @@ index 0654c77ab059dea2ad06cb16d07950e153d3f15d..9fcdb06c7907554fc7cdf887a2c313c9
@Override
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
if (iblockdata.getFluid().isSource() || iblockdata1.getFluid().isSource()) {
-@@ -117,7 +134,7 @@ public class BlockFluids extends Block implements IFluidSource {
+@@ -117,7 +135,7 @@ public class BlockFluids extends Block implements IFluidSource {
@Override
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
if (this.a(world, blockposition, iblockdata)) {
diff --git a/Spigot-Server-Patches/0274-Add-PhantomPreSpawnEvent.patch b/Spigot-Server-Patches/0274-Add-PhantomPreSpawnEvent.patch
index 7ca23533af..dca07a67d6 100644
--- a/Spigot-Server-Patches/0274-Add-PhantomPreSpawnEvent.patch
+++ b/Spigot-Server-Patches/0274-Add-PhantomPreSpawnEvent.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add PhantomPreSpawnEvent
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java
-index 6053894c5250e9a1a0c4aa2d681127dfd652b34f..bdb0a9541b4f167b95578034ec15e7051a7721be 100644
+index 6053894c5250e9a1a0c4aa2d681127dfd652b34f..6c498d4345df35a411d155799ac56e47c9c48114 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java
@@ -161,6 +161,11 @@ public class EntityPhantom extends EntityFlying implements IMonster {
@@ -32,7 +32,7 @@ index 6053894c5250e9a1a0c4aa2d681127dfd652b34f..bdb0a9541b4f167b95578034ec15e705
}
@Override
-@@ -216,6 +226,14 @@ public class EntityPhantom extends EntityFlying implements IMonster {
+@@ -216,6 +226,15 @@ public class EntityPhantom extends EntityFlying implements IMonster {
return entitysize.a(f);
}
@@ -42,16 +42,25 @@ index 6053894c5250e9a1a0c4aa2d681127dfd652b34f..bdb0a9541b4f167b95578034ec15e705
+ public java.util.UUID getSpawningEntity() {
+ return spawningEntity;
+ }
++ public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; }
+ // Paper end
+
class b extends PathfinderGoal {
private final PathfinderTargetCondition b;
diff --git a/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java b/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java
-index cfc32acee1e456a0fda12a5faa4035e29d0c3d5e..afbcabca5180e26e85af820ad4ca2de1163b55a1 100644
+index cfc32acee1e456a0fda12a5faa4035e29d0c3d5e..96a5a6569387a25b15a06aaab3bd9d033547e875 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java
-@@ -73,8 +73,17 @@ public class MobSpawnerPhantom implements MobSpawner {
+@@ -4,6 +4,7 @@ import java.util.Iterator;
+ import java.util.Random;
+ import net.minecraft.core.BlockPosition;
+ import net.minecraft.nbt.NBTTagCompound;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.stats.ServerStatisticManager;
+@@ -73,8 +74,17 @@ public class MobSpawnerPhantom implements MobSpawner {
int k = 1 + random.nextInt(difficultydamagescaler.a().a() + 1);
for (int l = 0; l < k; ++l) {
@@ -66,7 +75,7 @@ index cfc32acee1e456a0fda12a5faa4035e29d0c3d5e..afbcabca5180e26e85af820ad4ca2de1
+ // Paper end
EntityPhantom entityphantom = (EntityPhantom) EntityTypes.PHANTOM.a((World) worldserver);
-
-+ entityphantom.spawningEntity = entityhuman.uniqueID; // Paper
++ entityphantom.setSpawningEntity(entityhuman.getUniqueID()); // Paper
entityphantom.setPositionRotation(blockposition1, 0.0F, 0.0F);
groupdataentity = entityphantom.prepare(worldserver, difficultydamagescaler, EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null);
worldserver.addAllEntities(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
diff --git a/Spigot-Server-Patches/0279-Expose-attack-cooldown-methods-for-Player.patch b/Spigot-Server-Patches/0279-Expose-attack-cooldown-methods-for-Player.patch
index 116504981b..11610da177 100644
--- a/Spigot-Server-Patches/0279-Expose-attack-cooldown-methods-for-Player.patch
+++ b/Spigot-Server-Patches/0279-Expose-attack-cooldown-methods-for-Player.patch
@@ -17,10 +17,10 @@ index b6effe1037f3ae59e6faa5f5d039b6ad54bca5d4..87374174dcbf9e7ee448a1cdd9a35285
return (float) (1.0D / this.b(GenericAttributes.ATTACK_SPEED) * 20.0D);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index b4c763d2935aad0038128a61ed09c4904975f0ef..330ea2ea346867fc9005352e87cca892a1d33e03 100644
+index 32228b4eddaadabbae46ebbc5eb3404acf73fb29..9d3e01f7ad743dbe60685e9b111308ed06a0b4b7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2181,6 +2181,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2186,6 +2186,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
connection.sendPacket(new net.minecraft.network.protocol.game.PacketPlayOutOpenBook(net.minecraft.world.EnumHand.MAIN_HAND));
connection.sendPacket(new net.minecraft.network.protocol.game.PacketPlayOutSetSlot(0, slot, inventory.getItemInHand()));
}
diff --git a/Spigot-Server-Patches/0280-Improve-death-events.patch b/Spigot-Server-Patches/0280-Improve-death-events.patch
index 68aaa0fa7a..fb9de320d2 100644
--- a/Spigot-Server-Patches/0280-Improve-death-events.patch
+++ b/Spigot-Server-Patches/0280-Improve-death-events.patch
@@ -78,7 +78,7 @@ index f6f79ed9c38206cc6a4feb5504e854a476868aec..7d2b947b3c2b255c01241f2c4a6d7377
int i = this.f ? 300 : 100;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index a7115fb1fc6fadb38c7cc9f23629473a7173982e..2fc25a13a554174d2b5f415c910c4a26e37b30e1 100644
+index 046b191e771ed9be337e095214a67febd768e5f6..b6b4eb9ac883cfdfab5f114767fb5cfb29445730 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1538,6 +1538,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -325,10 +325,10 @@ index 8d35240405d7f7245f3c7b0b611973d58fa4384f..69361caebf0d3caa5195b519a1669170
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 330ea2ea346867fc9005352e87cca892a1d33e03..91da1f4d933b991c73e04e077722382d02487e07 100644
+index 9d3e01f7ad743dbe60685e9b111308ed06a0b4b7..2334a9a95ab0e2395744343a5a1e3d26c88b7dc3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1836,7 +1836,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1841,7 +1841,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void sendHealthUpdate() {
diff --git a/Spigot-Server-Patches/0281-Allow-chests-to-be-placed-with-NBT-data.patch b/Spigot-Server-Patches/0281-Allow-chests-to-be-placed-with-NBT-data.patch
index e2dd12b2fd..b2c6dc0b13 100644
--- a/Spigot-Server-Patches/0281-Allow-chests-to-be-placed-with-NBT-data.patch
+++ b/Spigot-Server-Patches/0281-Allow-chests-to-be-placed-with-NBT-data.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Allow chests to be placed with NBT data
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index de171e18fbc6cc5ee06e75f4a3c60fd4c710d8bb..5da20483ed352ac6d9695287f840ed643a2bf302 100644
+index ce5d8463763dd39e1225d9dec0514b1754df5411..30db766c54db08a472caef82fdcc7cf1b7855fbf 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -298,6 +298,7 @@ public final class ItemStack {
@@ -17,10 +17,10 @@ index de171e18fbc6cc5ee06e75f4a3c60fd4c710d8bb..5da20483ed352ac6d9695287f840ed64
for (BlockState blockstate : blocks) {
blockstate.update(true, false);
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java
-index aafd1f7c6c811f9eb2796d865e327f374be9b461..d4f019e98fbadfadee981ae8e7a5f121ba8fe1e8 100644
+index 51167d776c710decb0107bebcb35bdf43103772b..111f62d0e5b40e945793b8f504f2c035c0884a6a 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java
-@@ -326,7 +326,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
+@@ -327,7 +327,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
// CraftBukkit start
@Override
public boolean isFilteredNBT() {
diff --git a/Spigot-Server-Patches/0282-Mob-Pathfinding-API.patch b/Spigot-Server-Patches/0282-Mob-Pathfinding-API.patch
index bdaa12000f..34e0d63bf2 100644
--- a/Spigot-Server-Patches/0282-Mob-Pathfinding-API.patch
+++ b/Spigot-Server-Patches/0282-Mob-Pathfinding-API.patch
@@ -153,10 +153,10 @@ index 0000000000000000000000000000000000000000..9a3edd114c4736b1843844c6ca49da7a
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
-index 1664d47a61f1c502ece7f32aecdce759172c9f85..ab469f1698b4f0e36c0d077472f1adea36f95ce9 100644
+index d134333c736dc1ee1c722d680d7a9c22c1b265bd..06d05b511d623d0247d44989bee85b383a8fb52f 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
-@@ -99,7 +99,7 @@ public abstract class NavigationAbstract {
+@@ -100,7 +100,7 @@ public abstract class NavigationAbstract {
}
@Nullable
@@ -165,7 +165,7 @@ index 1664d47a61f1c502ece7f32aecdce759172c9f85..ab469f1698b4f0e36c0d077472f1adea
return this.a(new BlockPosition(d0, d1, d2), i);
}
-@@ -124,7 +124,7 @@ public abstract class NavigationAbstract {
+@@ -125,7 +125,7 @@ public abstract class NavigationAbstract {
}
@Nullable
@@ -174,7 +174,7 @@ index 1664d47a61f1c502ece7f32aecdce759172c9f85..ab469f1698b4f0e36c0d077472f1adea
return this.a(ImmutableSet.of(entity.getChunkCoordinates()), entity, 16, true, i); // Paper
}
-@@ -189,6 +189,7 @@ public abstract class NavigationAbstract {
+@@ -190,6 +190,7 @@ public abstract class NavigationAbstract {
return pathentity != null && this.a(pathentity, d0);
}
@@ -182,7 +182,7 @@ index 1664d47a61f1c502ece7f32aecdce759172c9f85..ab469f1698b4f0e36c0d077472f1adea
public boolean a(@Nullable PathEntity pathentity, double d0) {
if (pathentity == null) {
this.c = null;
-@@ -216,7 +217,7 @@ public abstract class NavigationAbstract {
+@@ -217,7 +218,7 @@ public abstract class NavigationAbstract {
}
}
@@ -191,7 +191,7 @@ index 1664d47a61f1c502ece7f32aecdce759172c9f85..ab469f1698b4f0e36c0d077472f1adea
public PathEntity k() {
return this.c;
}
-@@ -340,6 +341,7 @@ public abstract class NavigationAbstract {
+@@ -341,6 +342,7 @@ public abstract class NavigationAbstract {
return !this.m();
}
diff --git a/Spigot-Server-Patches/0284-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/Spigot-Server-Patches/0284-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch
index 176f6da8eb..22d4952f48 100644
--- a/Spigot-Server-Patches/0284-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch
+++ b/Spigot-Server-Patches/0284-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch
@@ -32,10 +32,25 @@ index 7e53d8b787c42f8592140f7de8974bc63e5149b2..d72b800e5f03422d0b2518980b1955ec
this.s = this::l;
if (this.i.canRead() && this.i.peek() == '#') {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068f5e3aca1 100644
+index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..8f8dccd6fb2e49d65383d6e8f3fc5ffbabd2b7a5 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-@@ -84,6 +84,12 @@ import org.bukkit.persistence.PersistentDataContainer;
+@@ -39,12 +39,14 @@ import java.util.logging.Level;
+ import java.util.logging.Logger;
+ import javax.annotation.Nonnull;
+ import javax.annotation.Nullable;
++import net.minecraft.commands.arguments.blocks.ArgumentBlock;
+ import net.minecraft.nbt.NBTBase;
+ import net.minecraft.nbt.NBTCompressedStreamTools;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.nbt.NBTTagList;
+ import net.minecraft.nbt.NBTTagString;
+ import net.minecraft.network.chat.ChatComponentText;
++import net.minecraft.resources.MinecraftKey;
+ import net.minecraft.world.entity.EnumItemSlot;
+ import net.minecraft.world.item.ItemBlock;
+ import org.apache.commons.codec.binary.Base64;
+@@ -84,6 +86,12 @@ import org.bukkit.persistence.PersistentDataContainer;
import static org.spigotmc.ValidateUtils.*;
// Spigot end
@@ -48,7 +63,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
/**
* Children must include the following:
*
-@@ -267,6 +273,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -267,6 +275,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Specific(Specific.To.NBT)
static final ItemMetaKey BLOCK_DATA = new ItemMetaKey("BlockStateTag");
static final ItemMetaKey BUKKIT_CUSTOM_TAG = new ItemMetaKey("PublicBukkitValues");
@@ -59,7 +74,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
// We store the raw original JSON representation of all text data. See SPIGOT-5063, SPIGOT-5656, SPIGOT-5304
private String displayName;
-@@ -280,6 +290,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -280,6 +292,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
private int hideFlag;
private boolean unbreakable;
private int damage;
@@ -70,7 +85,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
private static final Set<String> HANDLED_TAGS = Sets.newHashSet();
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
-@@ -317,6 +331,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -317,6 +333,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.hideFlag = meta.hideFlag;
this.unbreakable = meta.unbreakable;
this.damage = meta.damage;
@@ -86,7 +101,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
this.unhandledTags.putAll(meta.unhandledTags);
this.persistentDataContainer.putAll(meta.persistentDataContainer.getRaw());
-@@ -380,6 +403,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -380,6 +405,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
persistentDataContainer.put(key, compound.get(key));
}
}
@@ -118,7 +133,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
Set<String> keys = tag.getKeys();
for (String key : keys) {
-@@ -518,6 +566,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -518,6 +568,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
setDamage(damage);
}
@@ -153,7 +168,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
String internal = SerializableMeta.getString(map, "internal", true);
if (internal != null) {
ByteArrayInputStream buf = new ByteArrayInputStream(Base64.decodeBase64(internal));
-@@ -646,6 +722,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -646,6 +724,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
if (hasDamage()) {
itemTag.setInt(DAMAGE.NBT, damage);
}
@@ -177,7 +192,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
for (Map.Entry<String, NBTBase> e : unhandledTags.entrySet()) {
itemTag.set(e.getKey(), e.getValue());
-@@ -662,6 +755,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -662,6 +757,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
}
@@ -199,7 +214,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
NBTTagList createStringList(List<String> list) {
if (list == null) {
return null;
-@@ -745,7 +853,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -745,7 +855,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Overridden
boolean isEmpty() {
@@ -208,7 +223,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
}
// Paper start
-@@ -1169,7 +1277,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1169,7 +1279,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
&& (this.hideFlag == that.hideFlag)
&& (this.isUnbreakable() == that.isUnbreakable())
&& (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage())
@@ -221,7 +236,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
}
/**
-@@ -1204,6 +1316,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1204,6 +1318,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
hash = 61 * hash + (hasDamage() ? this.damage : 0);
hash = 61 * hash + (hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0);
hash = 61 * hash + version;
@@ -232,7 +247,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
return hash;
}
-@@ -1228,6 +1344,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1228,6 +1346,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
clone.unbreakable = this.unbreakable;
clone.damage = this.damage;
clone.version = this.version;
@@ -247,7 +262,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
return clone;
} catch (CloneNotSupportedException e) {
throw new Error(e);
-@@ -1285,6 +1409,24 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1285,6 +1411,24 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
builder.put(DAMAGE.BUKKIT, damage);
}
@@ -272,7 +287,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
final Map<String, NBTBase> internalTags = new HashMap<String, NBTBase>(unhandledTags);
serializeInternal(internalTags);
if (!internalTags.isEmpty()) {
-@@ -1449,6 +1591,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1449,6 +1593,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
CraftMetaArmorStand.SHOW_ARMS.NBT,
CraftMetaArmorStand.SMALL.NBT,
CraftMetaArmorStand.MARKER.NBT,
@@ -281,7 +296,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
// Paper end
CraftMetaCompass.LODESTONE_DIMENSION.NBT,
CraftMetaCompass.LODESTONE_POS.NBT,
-@@ -1476,4 +1620,147 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1476,4 +1622,147 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
// Paper end
@@ -377,7 +392,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
+
+ private @Nullable Namespaced deserializeNamespaced(String raw) {
+ boolean isTag = raw.length() > 0 && raw.codePointAt(0) == '#';
-+ net.minecraft.server.ArgumentBlock blockParser = new net.minecraft.server.ArgumentBlock(new com.mojang.brigadier.StringReader(raw), true);
++ ArgumentBlock blockParser = new ArgumentBlock(new com.mojang.brigadier.StringReader(raw), true);
+ try {
+ blockParser = blockParser.parse(false);
+ } catch (com.mojang.brigadier.exceptions.CommandSyntaxException e) {
@@ -385,7 +400,7 @@ index 7f790c484fec77e1d1f1dc6abe0daa19d009ae46..2b0c4c278c2d189e4040440763138068
+ return null;
+ }
+
-+ net.minecraft.server.MinecraftKey key;
++ MinecraftKey key;
+ if (isTag) {
+ key = blockParser.getTagKey();
+ } else {
diff --git a/Spigot-Server-Patches/0285-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch b/Spigot-Server-Patches/0285-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch
index 2c55a34158..29f93fd83f 100644
--- a/Spigot-Server-Patches/0285-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch
+++ b/Spigot-Server-Patches/0285-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch
@@ -52,10 +52,18 @@ index b5c7b39a49afae1089a293b9b06bdd94deed1f64..61a62c093b24c43064f116630d850961
return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).a(this.g) && ichunkaccess.getType(blockposition.up()).isAir() && ichunkaccess.getType(blockposition.up(2)).isAir();
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/util/RandomPositionGenerator.java b/src/main/java/net/minecraft/world/entity/ai/util/RandomPositionGenerator.java
-index 129ea3857969ddb99e15ae817ee3eec67b4c3ccf..c389414e2bbef96ec2e5e887fd105028b72e586d 100644
+index 129ea3857969ddb99e15ae817ee3eec67b4c3ccf..f9c40c8223109a9a40e7e7523c8f1f2e5aeddba1 100644
--- a/src/main/java/net/minecraft/world/entity/ai/util/RandomPositionGenerator.java
+++ b/src/main/java/net/minecraft/world/entity/ai/util/RandomPositionGenerator.java
-@@ -128,6 +128,7 @@ public class RandomPositionGenerator {
+@@ -13,6 +13,7 @@ import net.minecraft.util.MathHelper;
+ import net.minecraft.world.entity.EntityCreature;
+ import net.minecraft.world.entity.ai.navigation.NavigationAbstract;
+ import net.minecraft.world.level.IBlockAccess;
++import net.minecraft.world.level.material.Fluid;
+ import net.minecraft.world.level.pathfinder.PathType;
+ import net.minecraft.world.level.pathfinder.PathfinderNormal;
+ import net.minecraft.world.phys.Vec3D;
+@@ -128,6 +129,7 @@ public class RandomPositionGenerator {
}
blockposition2 = new BlockPosition((double) k1 + entitycreature.locX(), (double) l1 + entitycreature.locY(), (double) i2 + entitycreature.locZ());
@@ -63,7 +71,7 @@ index 129ea3857969ddb99e15ae817ee3eec67b4c3ccf..c389414e2bbef96ec2e5e887fd105028
if (blockposition2.getY() >= 0 && blockposition2.getY() <= entitycreature.world.getBuildHeight() && (!flag3 || entitycreature.a(blockposition2)) && (!flag2 || navigationabstract.a(blockposition2))) {
if (flag1) {
blockposition2 = a(blockposition2, random.nextInt(l + 1) + i1, entitycreature.world.getBuildHeight(), (blockposition3) -> {
-@@ -135,7 +136,8 @@ public class RandomPositionGenerator {
+@@ -135,7 +137,8 @@ public class RandomPositionGenerator {
});
}
diff --git a/Spigot-Server-Patches/0286-Prevent-mob-spawning-from-loading-generating-chunks.patch b/Spigot-Server-Patches/0286-Prevent-mob-spawning-from-loading-generating-chunks.patch
index a15c894497..7a20915052 100644
--- a/Spigot-Server-Patches/0286-Prevent-mob-spawning-from-loading-generating-chunks.patch
+++ b/Spigot-Server-Patches/0286-Prevent-mob-spawning-from-loading-generating-chunks.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Prevent mob spawning from loading/generating chunks
also prevents if out of world border bounds
diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/main/java/net/minecraft/world/level/SpawnerCreature.java
-index 9a039ce12879baf8088c2ccaf0af61109efb7d74..28b3a74d139820f91775d3377d79675d308aff65 100644
+index 1969d1002b3182338614a2be0519fcdc385b7a44..5307488fa48ffa91446dd4457de1ce6a8f61da61 100644
--- a/src/main/java/net/minecraft/world/level/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/world/level/SpawnerCreature.java
-@@ -175,9 +175,9 @@ public final class SpawnerCreature {
+@@ -176,9 +176,9 @@ public final class SpawnerCreature {
StructureManager structuremanager = worldserver.getStructureManager();
ChunkGenerator chunkgenerator = worldserver.getChunkProvider().getChunkGenerator();
int i = blockposition.getY();
@@ -21,7 +21,7 @@ index 9a039ce12879baf8088c2ccaf0af61109efb7d74..28b3a74d139820f91775d3377d79675d
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
int j = 0;
int k = 0;
-@@ -206,7 +206,7 @@ public final class SpawnerCreature {
+@@ -207,7 +207,7 @@ public final class SpawnerCreature {
if (entityhuman != null) {
double d2 = entityhuman.h(d0, (double) i, d1);
diff --git a/Spigot-Server-Patches/0289-PreSpawnerSpawnEvent.patch b/Spigot-Server-Patches/0289-PreSpawnerSpawnEvent.patch
index 1855ebe484..df8c61a859 100644
--- a/Spigot-Server-Patches/0289-PreSpawnerSpawnEvent.patch
+++ b/Spigot-Server-Patches/0289-PreSpawnerSpawnEvent.patch
@@ -9,10 +9,10 @@ SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for
spawners.
diff --git a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
-index 79339bcbe15e5b3a409148245c68bbff3a59f59f..0a23fc173cca32b9e910e6c8c638b0b51a94cac2 100644
+index d4b8126f12fdf7d9b4f882d3ed7d8da544ed9e8a..867478484c0ba4ff467b96e458689937299b981d 100644
--- a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
-@@ -131,11 +131,11 @@ public abstract class MobSpawnerAbstract {
+@@ -132,11 +132,11 @@ public abstract class MobSpawnerAbstract {
org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key);
if (type != null) {
diff --git a/Spigot-Server-Patches/0290-Catch-JsonParseException-in-Entity-and-TE-names.patch b/Spigot-Server-Patches/0290-Catch-JsonParseException-in-Entity-and-TE-names.patch
index b57615d5de..21a0e7b36d 100644
--- a/Spigot-Server-Patches/0290-Catch-JsonParseException-in-Entity-and-TE-names.patch
+++ b/Spigot-Server-Patches/0290-Catch-JsonParseException-in-Entity-and-TE-names.patch
@@ -46,10 +46,18 @@ index cd7dc7d90efddb8a1bb50cd964b43d18cf9c83d1..35d1444c5b75d9a3a6cface5dd70aea0
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/CommandBlockListenerAbstract.java b/src/main/java/net/minecraft/world/level/CommandBlockListenerAbstract.java
-index 94adf4d3b3a367e2a7fa383f1da6fb3b02b35c85..0f966c5defdda58fd7d31072b625f16928cddeb7 100644
+index 94adf4d3b3a367e2a7fa383f1da6fb3b02b35c85..3fcdff3649c725580456dfc965d6c83bd5afe3da 100644
--- a/src/main/java/net/minecraft/world/level/CommandBlockListenerAbstract.java
+++ b/src/main/java/net/minecraft/world/level/CommandBlockListenerAbstract.java
-@@ -72,7 +72,7 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener {
+@@ -12,6 +12,7 @@ import net.minecraft.commands.ICommandListener;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.network.chat.ChatComponentText;
+ import net.minecraft.network.chat.IChatBaseComponent;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.server.MinecraftServer;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.util.UtilColor;
+@@ -72,7 +73,7 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener {
this.command = nbttagcompound.getString("Command");
this.successCount = nbttagcompound.getInt("SuccessCount");
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
@@ -59,10 +67,18 @@ index 94adf4d3b3a367e2a7fa383f1da6fb3b02b35c85..0f966c5defdda58fd7d31072b625f169
if (nbttagcompound.hasKeyOfType("TrackOutput", 1)) {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBanner.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBanner.java
-index fd8d39d04f39ea8aa389deb66ca0ddaa3e282c40..e2d3ade6565b10ebed3c001f4a1c5bbb3a7f0b12 100644
+index fd8d39d04f39ea8aa389deb66ca0ddaa3e282c40..45958ffedca64e08e347ae65033700c0d798beb5 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBanner.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBanner.java
-@@ -70,7 +70,7 @@ public class TileEntityBanner extends TileEntity implements INamableTileEntity {
+@@ -9,6 +9,7 @@ import net.minecraft.nbt.NBTTagList;
+ import net.minecraft.network.chat.ChatMessage;
+ import net.minecraft.network.chat.IChatBaseComponent;
+ import net.minecraft.network.protocol.game.PacketPlayOutTileEntityData;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.world.INamableTileEntity;
+ import net.minecraft.world.item.EnumColor;
+ import net.minecraft.world.item.ItemStack;
+@@ -70,7 +71,7 @@ public class TileEntityBanner extends TileEntity implements INamableTileEntity {
public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) {
super.load(iblockdata, nbttagcompound);
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
@@ -72,10 +88,18 @@ index fd8d39d04f39ea8aa389deb66ca0ddaa3e282c40..e2d3ade6565b10ebed3c001f4a1c5bbb
if (this.hasWorld()) {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityContainer.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityContainer.java
-index 19739ad1fb01c767288da2667a48909e4c1c36cc..5841422beb972f28fb9e9d10bcf711b2c20a4bb0 100644
+index 19739ad1fb01c767288da2667a48909e4c1c36cc..fb7a1a854efcf42f0351ef521aff67d5fcc4ab27 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityContainer.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityContainer.java
-@@ -30,7 +30,7 @@ public abstract class TileEntityContainer extends TileEntity implements IInvento
+@@ -4,6 +4,7 @@ import javax.annotation.Nullable;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.network.chat.ChatMessage;
+ import net.minecraft.network.chat.IChatBaseComponent;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.sounds.SoundCategory;
+ import net.minecraft.sounds.SoundEffects;
+ import net.minecraft.world.ChestLock;
+@@ -30,7 +31,7 @@ public abstract class TileEntityContainer extends TileEntity implements IInvento
super.load(iblockdata, nbttagcompound);
this.chestLock = ChestLock.b(nbttagcompound);
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
diff --git a/Spigot-Server-Patches/0296-Turtle-API.patch b/Spigot-Server-Patches/0296-Turtle-API.patch
index 1c6586b485..5d55bbc3f4 100644
--- a/Spigot-Server-Patches/0296-Turtle-API.patch
+++ b/Spigot-Server-Patches/0296-Turtle-API.patch
@@ -18,10 +18,18 @@ index 62276550627bfe453794a2b3101426fe05a585ff..6a156a488bc073b3b60f4d1081e3f2ab
private final int i;
private final int j;
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java b/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java
-index bf224c97854daa379c61affff6a0ac9524c2c35d..38588e59f26dd1f3a43fc229195e4fb8484e3705 100644
+index bf224c97854daa379c61affff6a0ac9524c2c35d..09a6310af6712d36c20167256b60dc3235e76021 100644
--- a/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java
-@@ -93,7 +93,7 @@ public class EntityTurtle extends EntityAnimal {
+@@ -14,6 +14,7 @@ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.network.syncher.DataWatcher;
+ import net.minecraft.network.syncher.DataWatcherObject;
+ import net.minecraft.network.syncher.DataWatcherRegistry;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.sounds.SoundCategory;
+@@ -93,7 +94,7 @@ public class EntityTurtle extends EntityAnimal {
this.datawatcher.set(EntityTurtle.bp, blockposition);
}
@@ -30,7 +38,7 @@ index bf224c97854daa379c61affff6a0ac9524c2c35d..38588e59f26dd1f3a43fc229195e4fb8
return (BlockPosition) this.datawatcher.get(EntityTurtle.bp);
}
-@@ -109,31 +109,37 @@ public class EntityTurtle extends EntityAnimal {
+@@ -109,31 +110,37 @@ public class EntityTurtle extends EntityAnimal {
return (Boolean) this.datawatcher.get(EntityTurtle.bq);
}
@@ -69,7 +77,7 @@ index bf224c97854daa379c61affff6a0ac9524c2c35d..38588e59f26dd1f3a43fc229195e4fb8
private void w(boolean flag) {
this.datawatcher.set(EntityTurtle.bu, flag);
}
-@@ -500,14 +506,17 @@ public class EntityTurtle extends EntityAnimal {
+@@ -500,14 +507,17 @@ public class EntityTurtle extends EntityAnimal {
if (!this.g.isInWater() && this.l()) {
if (this.g.bv < 1) {
@@ -90,7 +98,7 @@ index bf224c97854daa379c61affff6a0ac9524c2c35d..38588e59f26dd1f3a43fc229195e4fb8
}
// CraftBukkit end
this.g.setHasEgg(false);
-@@ -636,7 +645,7 @@ public class EntityTurtle extends EntityAnimal {
+@@ -636,7 +646,7 @@ public class EntityTurtle extends EntityAnimal {
@Override
public boolean a() {
diff --git a/Spigot-Server-Patches/0297-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch b/Spigot-Server-Patches/0297-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch
index 1460c05dd9..b624461f37 100644
--- a/Spigot-Server-Patches/0297-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch
+++ b/Spigot-Server-Patches/0297-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch
@@ -11,10 +11,10 @@ If the projectile fails to find the shooter in the current world, check
other worlds.
diff --git a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
-index 8967cf1e0238941370412109eff2ccf19f86b727..1ff55a1b6c1faae95a83cd8fc12a2045ad479145 100644
+index 65cee640040bdd1229149409ff046b765ee08c34..a33f3924a95b86c2337c455f30de9bb257cb8db4 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
-@@ -40,7 +40,18 @@ public abstract class IProjectile extends Entity {
+@@ -41,7 +41,18 @@ public abstract class IProjectile extends Entity {
@Nullable
public Entity getShooter() {
diff --git a/Spigot-Server-Patches/0299-Add-Velocity-IP-Forwarding-Support.patch b/Spigot-Server-Patches/0299-Add-Velocity-IP-Forwarding-Support.patch
index 3fb312b095..4c21b54f18 100644
--- a/Spigot-Server-Patches/0299-Add-Velocity-IP-Forwarding-Support.patch
+++ b/Spigot-Server-Patches/0299-Add-Velocity-IP-Forwarding-Support.patch
@@ -127,10 +127,10 @@ index 0000000000000000000000000000000000000000..e6afaa41df086b1eb3950ce870c91dd5
+ }
+}
diff --git a/src/main/java/net/minecraft/network/PacketDataSerializer.java b/src/main/java/net/minecraft/network/PacketDataSerializer.java
-index 4fc06bc5ef630b07fc8462cf835e6f92b151e6c6..eb00eb2b7bee2b9f85efef0ee5ed1605f4cabef8 100644
+index 5a1187b001004afe22d208bc5d7c288e796e16a6..579eb1260c7266cd41025cff177de4fb00ac0cec 100644
--- a/src/main/java/net/minecraft/network/PacketDataSerializer.java
+++ b/src/main/java/net/minecraft/network/PacketDataSerializer.java
-@@ -191,6 +191,7 @@ public class PacketDataSerializer extends ByteBuf {
+@@ -192,6 +192,7 @@ public class PacketDataSerializer extends ByteBuf {
return this.d(oenum.ordinal());
}
@@ -138,7 +138,7 @@ index 4fc06bc5ef630b07fc8462cf835e6f92b151e6c6..eb00eb2b7bee2b9f85efef0ee5ed1605
public int i() {
int i = 0;
int j = 0;
-@@ -231,6 +232,7 @@ public class PacketDataSerializer extends ByteBuf {
+@@ -232,6 +233,7 @@ public class PacketDataSerializer extends ByteBuf {
return this;
}
@@ -146,7 +146,7 @@ index 4fc06bc5ef630b07fc8462cf835e6f92b151e6c6..eb00eb2b7bee2b9f85efef0ee5ed1605
public UUID k() {
return new UUID(this.readLong(), this.readLong());
}
-@@ -358,6 +360,7 @@ public class PacketDataSerializer extends ByteBuf {
+@@ -359,6 +361,7 @@ public class PacketDataSerializer extends ByteBuf {
}
}
diff --git a/Spigot-Server-Patches/0306-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/Spigot-Server-Patches/0306-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
index 8348f9c7ac..6e9214487f 100644
--- a/Spigot-Server-Patches/0306-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
+++ b/Spigot-Server-Patches/0306-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
@@ -75,10 +75,10 @@ index 68ce7605bd63ea280b96db8230463d2afb0a6cb1..46d82c1548088b8305f758699388edf0
c(throwable);
if (throwable instanceof CompletionException) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index aa5abee5dd7dc601f3f738f11faf434d90e493a4..38ddb77c4b979cd22e4ec83ca109955d11739f1f 100644
+index 8166ad11642bb1b4b11722a5a09e773a2e749c47..021adb8a6b8c9e05c03391d0f8edfa71b3c0c246 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -284,6 +284,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -285,6 +285,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
S s0 = function.apply(thread); // CraftBukkit - decompile error
atomicreference.set(s0);
diff --git a/Spigot-Server-Patches/0307-Optimize-World-Time-Updates.patch b/Spigot-Server-Patches/0307-Optimize-World-Time-Updates.patch
index 12e04f0ed1..a02a09f292 100644
--- a/Spigot-Server-Patches/0307-Optimize-World-Time-Updates.patch
+++ b/Spigot-Server-Patches/0307-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 38ddb77c4b979cd22e4ec83ca109955d11739f1f..3ce1204184656d7500509f8600cec0a4b6089a3f 100644
+index 021adb8a6b8c9e05c03391d0f8edfa71b3c0c246..dd207a5138c4933c281255f4135f42b8fb0351d2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1304,12 +1304,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1305,12 +1305,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
// Send time updates to everyone, it will get the right time from the world the player is in.
diff --git a/Spigot-Server-Patches/0311-Don-t-allow-digging-into-unloaded-chunks.patch b/Spigot-Server-Patches/0311-Don-t-allow-digging-into-unloaded-chunks.patch
index 2f622b81df..557761c138 100644
--- a/Spigot-Server-Patches/0311-Don-t-allow-digging-into-unloaded-chunks.patch
+++ b/Spigot-Server-Patches/0311-Don-t-allow-digging-into-unloaded-chunks.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't allow digging into unloaded chunks
diff --git a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
-index 13e02b8d73164bc36e8d29edf8b0b2cb51fe3080..0d32d7e9fc6bf6a05f3975fe225022a9e176e47b 100644
+index cea19f4aafb3d81bf0dfcdac9103c03786fd5fc2..e7f762dc131ae40e36ff5e70b0394e0d5abdcee8 100644
--- a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
-@@ -111,8 +111,8 @@ public class PlayerInteractManager {
+@@ -113,8 +113,8 @@ public class PlayerInteractManager {
IBlockData iblockdata;
if (this.j) {
@@ -19,7 +19,7 @@ index 13e02b8d73164bc36e8d29edf8b0b2cb51fe3080..0d32d7e9fc6bf6a05f3975fe225022a9
this.j = false;
} else {
float f = this.a(iblockdata, this.k, this.l);
-@@ -123,7 +123,13 @@ public class PlayerInteractManager {
+@@ -125,7 +125,13 @@ public class PlayerInteractManager {
}
}
} else if (this.f) {
@@ -34,7 +34,7 @@ index 13e02b8d73164bc36e8d29edf8b0b2cb51fe3080..0d32d7e9fc6bf6a05f3975fe225022a9
if (iblockdata.isAir()) {
this.world.a(this.player.getId(), this.h, -1);
this.m = -1;
-@@ -287,10 +293,12 @@ public class PlayerInteractManager {
+@@ -289,10 +295,12 @@ public class PlayerInteractManager {
this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, true, "stopped destroying"));
} else if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.ABORT_DESTROY_BLOCK) {
this.f = false;
diff --git a/Spigot-Server-Patches/0320-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/Spigot-Server-Patches/0320-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch
index a6f3de44a8..03e6d41ca1 100644
--- a/Spigot-Server-Patches/0320-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch
+++ b/Spigot-Server-Patches/0320-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch
@@ -28,7 +28,7 @@ index bea8dd578cfd5532dd1b679a4ee4e6c74a416bba..e3cc64e837fa9b9c1f1d95037b1a59f1
public boolean queueHealthUpdatePacket = false;
public net.minecraft.network.protocol.game.PacketPlayOutUpdateHealth queuedHealthUpdatePacket;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 3aaa6313a33865b9823aa38e5d0cce7edce04592..3ef632928bf93a8af5eccada3b1cc76354ed5617 100644
+index 1faae8a451c25cc8e37ef1907206a4f721477b13..e58784539bb1cc66581317c7167ae3326d5622ec 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -168,6 +168,7 @@ public abstract class PlayerList {
@@ -106,10 +106,10 @@ index 9b8d7b176e288fa715177196e7aff92900d8567a..1e741158bbcc0991259436bec549b32d
public Location getBedSpawnLocation() {
NBTTagCompound data = getData();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 91da1f4d933b991c73e04e077722382d02487e07..cd3987ec7569f4a2de1f66fc73b1ca6c19fa82aa 100644
+index 2334a9a95ab0e2395744343a5a1e3d26c88b7dc3..c2ebf264d9d150541aeb2d89f24853c2f887cde5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -142,6 +142,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -147,6 +147,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus;
private String resourcePackHash;
private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit
@@ -117,7 +117,7 @@ index 91da1f4d933b991c73e04e077722382d02487e07..cd3987ec7569f4a2de1f66fc73b1ca6c
// Paper end
public CraftPlayer(CraftServer server, EntityPlayer entity) {
-@@ -1480,6 +1481,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1485,6 +1486,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.firstPlayed = firstPlayed;
}
@@ -136,7 +136,7 @@ index 91da1f4d933b991c73e04e077722382d02487e07..cd3987ec7569f4a2de1f66fc73b1ca6c
public void readExtraData(NBTTagCompound nbttagcompound) {
hasPlayedBefore = true;
if (nbttagcompound.hasKey("bukkit")) {
-@@ -1502,6 +1515,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1507,6 +1520,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setExtraData(NBTTagCompound nbttagcompound) {
@@ -145,7 +145,7 @@ index 91da1f4d933b991c73e04e077722382d02487e07..cd3987ec7569f4a2de1f66fc73b1ca6c
if (!nbttagcompound.hasKey("bukkit")) {
nbttagcompound.set("bukkit", new NBTTagCompound());
}
-@@ -1516,6 +1531,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1521,6 +1536,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
data.setLong("firstPlayed", getFirstPlayed());
data.setLong("lastPlayed", System.currentTimeMillis());
data.setString("lastKnownName", handle.getName());
diff --git a/Spigot-Server-Patches/0323-Block-Entity-remove-from-being-called-on-Players.patch b/Spigot-Server-Patches/0323-Block-Entity-remove-from-being-called-on-Players.patch
index 71909228f6..59f9e671b8 100644
--- a/Spigot-Server-Patches/0323-Block-Entity-remove-from-being-called-on-Players.patch
+++ b/Spigot-Server-Patches/0323-Block-Entity-remove-from-being-called-on-Players.patch
@@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to
be unintentional in the few cases we've seen so far.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 9666192e7e5a25e482af9c575300239fcc5b8a19..fffe522058144da31149e59a06263914865983ec 100644
+index c2ebf264d9d150541aeb2d89f24853c2f887cde5..e645a3386df6334e99d80ec6961399461c9545a9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2226,6 +2226,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2231,6 +2231,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void resetCooldown() {
getHandle().resetAttackCooldown();
}
diff --git a/Spigot-Server-Patches/0329-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/Spigot-Server-Patches/0329-Optimize-Network-Manager-and-add-advanced-packet-sup.patch
index 12e93d8f0e..053340619f 100644
--- a/Spigot-Server-Patches/0329-Optimize-Network-Manager-and-add-advanced-packet-sup.patch
+++ b/Spigot-Server-Patches/0329-Optimize-Network-Manager-and-add-advanced-packet-sup.patch
@@ -28,7 +28,7 @@ and then catch exceptions and close if they fire.
Part of this commit was authored by: Spottedleaf
diff --git a/src/main/java/net/minecraft/network/NetworkManager.java b/src/main/java/net/minecraft/network/NetworkManager.java
-index 6d40ade5a52383ed86d28d272c3dc83dbdcbd218..8e591f75b2c80fdb7e012574e9d7c348f1ffc90d 100644
+index 6d40ade5a52383ed86d28d272c3dc83dbdcbd218..ab70eeaeca222de7de7cab1b3db14b2c4761c3c3 100644
--- a/src/main/java/net/minecraft/network/NetworkManager.java
+++ b/src/main/java/net/minecraft/network/NetworkManager.java
@@ -25,8 +25,15 @@ import net.minecraft.network.chat.ChatMessage;
@@ -52,9 +52,9 @@ index 6d40ade5a52383ed86d28d272c3dc83dbdcbd218..8e591f75b2c80fdb7e012574e9d7c348
public java.net.InetSocketAddress virtualHost;
private static boolean enableExplicitFlush = Boolean.getBoolean("paper.explicit-flush");
+ // Optimize network
-+ boolean isPending = true;
-+ boolean queueImmunity = false;
-+ EnumProtocol protocol;
++ public boolean isPending = true;
++ public boolean queueImmunity = false;
++ public EnumProtocol protocol;
// Paper end
public NetworkManager(EnumProtocolDirection enumprotocoldirection) {
@@ -71,7 +71,7 @@ index 6d40ade5a52383ed86d28d272c3dc83dbdcbd218..8e591f75b2c80fdb7e012574e9d7c348
this.packetListener = packetlistener;
}
+ // Paper start
-+ EntityPlayer getPlayer() {
++ public EntityPlayer getPlayer() {
+ if (packetListener instanceof PlayerConnection) {
+ return ((PlayerConnection) packetListener).player;
+ } else {
diff --git a/Spigot-Server-Patches/0337-Entity-getEntitySpawnReason.patch b/Spigot-Server-Patches/0337-Entity-getEntitySpawnReason.patch
index f72125e570..4cebbb7d19 100644
--- a/Spigot-Server-Patches/0337-Entity-getEntitySpawnReason.patch
+++ b/Spigot-Server-Patches/0337-Entity-getEntitySpawnReason.patch
@@ -22,7 +22,7 @@ index ab18969083e89eb2016c6a6bffc06f4e83c9f753..53359f5ca7a1098f78e683ebad142d5b
if (entity.valid) {
MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable());
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index aebde5e6ec24aff073dfd4eae1ce5a008134658a..ea6c5c9305994e64831c5444666c22a96f9d36da 100644
+index fa288b099b17adafc085fb0fc5da6e810d078952..33b5825d753029e98ea7a11a4758280eddd2584c 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -335,7 +335,7 @@ public abstract class PlayerList {
@@ -35,7 +35,7 @@ index aebde5e6ec24aff073dfd4eae1ce5a008134658a..ea6c5c9305994e64831c5444666c22a9
});
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 36e9a33d22fc2572e23e457adf62bd2bcebd10d3..37b9915e6c25458e9ec2d0beb40be51991276b8d 100644
+index e9b535622d6c33083c575ee4691598014dba0e2c..cbdd75feb7250e771111184b1fac7c4a6bf6e575 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -63,6 +63,8 @@ import net.minecraft.world.EnumHand;
@@ -50,7 +50,7 @@ index 36e9a33d22fc2572e23e457adf62bd2bcebd10d3..37b9915e6c25458e9ec2d0beb40be519
@@ -158,6 +160,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
}
};
- List<Entity> entitySlice = null;
+ public List<Entity> entitySlice = null;
+ public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason;
// Paper end
@@ -93,10 +93,10 @@ index 36e9a33d22fc2572e23e457adf62bd2bcebd10d3..37b9915e6c25458e9ec2d0beb40be519
} catch (Throwable throwable) {
diff --git a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
-index 0a23fc173cca32b9e910e6c8c638b0b51a94cac2..ca753267a06643b6f7224140950aa7f47cea64ad 100644
+index 867478484c0ba4ff467b96e458689937299b981d..34bcee4ff55ba118ba393e94b3c25ee2b84feaa2 100644
--- a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
-@@ -182,6 +182,7 @@ public abstract class MobSpawnerAbstract {
+@@ -183,6 +183,7 @@ public abstract class MobSpawnerAbstract {
// Spigot End
}
entity.spawnedViaMobSpawner = true; // Paper
diff --git a/Spigot-Server-Patches/0341-Server-Tick-Events.patch b/Spigot-Server-Patches/0341-Server-Tick-Events.patch
index 64b1af2884..bc5e604cb1 100644
--- a/Spigot-Server-Patches/0341-Server-Tick-Events.patch
+++ b/Spigot-Server-Patches/0341-Server-Tick-Events.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Server Tick Events
Fires event at start and end of a server tick
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 3ce1204184656d7500509f8600cec0a4b6089a3f..c864749646d26199e4c938f1fa6bbee4a3b942dd 100644
+index dd207a5138c4933c281255f4135f42b8fb0351d2..f07579d5b2450e7f972e0a942287ea1205740722 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1227,6 +1227,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1228,6 +1228,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
});
isOversleep = false;MinecraftTimings.serverOversleep.stopTiming();
// Paper end
@@ -17,7 +17,7 @@ index 3ce1204184656d7500509f8600cec0a4b6089a3f..c864749646d26199e4c938f1fa6bbee4
++this.ticks;
this.b(booleansupplier);
-@@ -1270,6 +1271,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1271,6 +1272,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
// Paper end
diff --git a/Spigot-Server-Patches/0344-Add-Heightmap-API.patch b/Spigot-Server-Patches/0344-Add-Heightmap-API.patch
index 4e7df82f3f..82b558d009 100644
--- a/Spigot-Server-Patches/0344-Add-Heightmap-API.patch
+++ b/Spigot-Server-Patches/0344-Add-Heightmap-API.patch
@@ -20,7 +20,7 @@ index b6b9a471426ddf911a1f6bf38543c0304bfc31f6..12ac3608736b45447afe6b0d35ead144
if (i >= -30000000 && j >= -30000000 && i < 30000000 && j < 30000000) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 317d08c49b980f8785d0d098c993e2ac03200e14..ed5f6ec979a2f1124c2fbb37c3be1d42994dc4da 100644
+index 8bfb7a5bf6aa2ee568ceee3d2e4efe9dd57d9c1b..294a06c998a84523f8a2a0702aa6a9048d204722 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -343,6 +343,29 @@ public class CraftWorld implements World {
@@ -37,13 +37,13 @@ index 317d08c49b980f8785d0d098c993e2ac03200e14..ed5f6ec979a2f1124c2fbb37c3be1d42
+ throw new UnsupportedOperationException(); // TODO
+ //return this.world.getHighestBlockY(HeightMap.Type.LIGHT_BLOCKING, x, z);
+ case ANY:
-+ return this.world.getHighestBlockY(net.minecraft.server.HeightMap.Type.WORLD_SURFACE, x, z);
++ return this.world.getHighestBlockY(net.minecraft.world.level.levelgen.HeightMap.Type.WORLD_SURFACE, x, z);
+ case SOLID:
-+ return this.world.getHighestBlockY(net.minecraft.server.HeightMap.Type.OCEAN_FLOOR, x, z);
++ return this.world.getHighestBlockY(net.minecraft.world.level.levelgen.HeightMap.Type.OCEAN_FLOOR, x, z);
+ case SOLID_OR_LIQUID:
-+ return this.world.getHighestBlockY(net.minecraft.server.HeightMap.Type.MOTION_BLOCKING, x, z);
++ return this.world.getHighestBlockY(net.minecraft.world.level.levelgen.HeightMap.Type.MOTION_BLOCKING, x, z);
+ case SOLID_OR_LIQUID_NO_LEAVES:
-+ return this.world.getHighestBlockY(net.minecraft.server.HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, x, z);
++ return this.world.getHighestBlockY(net.minecraft.world.level.levelgen.HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, x, z);
+ default:
+ throw new UnsupportedOperationException();
+ }
diff --git a/Spigot-Server-Patches/0345-Mob-Spawner-API-Enhancements.patch b/Spigot-Server-Patches/0345-Mob-Spawner-API-Enhancements.patch
index bfe2528d28..37f6cfaac5 100644
--- a/Spigot-Server-Patches/0345-Mob-Spawner-API-Enhancements.patch
+++ b/Spigot-Server-Patches/0345-Mob-Spawner-API-Enhancements.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Mob Spawner API Enhancements
diff --git a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
-index ca753267a06643b6f7224140950aa7f47cea64ad..bd4c7dbfad80b65c1350e93bb8303bf145dc99c1 100644
+index 34bcee4ff55ba118ba393e94b3c25ee2b84feaa2..5538404456dfee42257fad9040fcc0fefdfc5fab 100644
--- a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
-@@ -64,6 +64,7 @@ public abstract class MobSpawnerAbstract {
+@@ -65,6 +65,7 @@ public abstract class MobSpawnerAbstract {
this.mobs.clear(); // CraftBukkit - SPIGOT-3496, MC-92282
}
@@ -16,7 +16,7 @@ index ca753267a06643b6f7224140950aa7f47cea64ad..bd4c7dbfad80b65c1350e93bb8303bf1
private boolean h() {
BlockPosition blockposition = this.b();
-@@ -220,6 +221,7 @@ public abstract class MobSpawnerAbstract {
+@@ -221,6 +222,7 @@ public abstract class MobSpawnerAbstract {
}
}
@@ -24,7 +24,7 @@ index ca753267a06643b6f7224140950aa7f47cea64ad..bd4c7dbfad80b65c1350e93bb8303bf1
private void i() {
if (this.maxSpawnDelay <= this.minSpawnDelay) {
this.spawnDelay = this.minSpawnDelay;
-@@ -237,7 +239,13 @@ public abstract class MobSpawnerAbstract {
+@@ -238,7 +240,13 @@ public abstract class MobSpawnerAbstract {
}
public void a(NBTTagCompound nbttagcompound) {
@@ -38,7 +38,7 @@ index ca753267a06643b6f7224140950aa7f47cea64ad..bd4c7dbfad80b65c1350e93bb8303bf1
this.mobs.clear();
if (nbttagcompound.hasKeyOfType("SpawnPotentials", 9)) {
NBTTagList nbttaglist = nbttagcompound.getList("SpawnPotentials", 10);
-@@ -252,10 +260,15 @@ public abstract class MobSpawnerAbstract {
+@@ -253,10 +261,15 @@ public abstract class MobSpawnerAbstract {
} else if (!this.mobs.isEmpty()) {
this.setSpawnData((MobSpawnerData) WeightedRandom.a(this.a().random, this.mobs));
}
@@ -57,7 +57,7 @@ index ca753267a06643b6f7224140950aa7f47cea64ad..bd4c7dbfad80b65c1350e93bb8303bf1
this.spawnCount = nbttagcompound.getShort("SpawnCount");
}
-@@ -280,9 +293,20 @@ public abstract class MobSpawnerAbstract {
+@@ -281,9 +294,20 @@ public abstract class MobSpawnerAbstract {
if (minecraftkey == null) {
return nbttagcompound;
} else {
diff --git a/Spigot-Server-Patches/0346-Per-Player-View-Distance-API-placeholders.patch b/Spigot-Server-Patches/0346-Per-Player-View-Distance-API-placeholders.patch
index b09ce7ebb4..4cd1837eac 100644
--- a/Spigot-Server-Patches/0346-Per-Player-View-Distance-API-placeholders.patch
+++ b/Spigot-Server-Patches/0346-Per-Player-View-Distance-API-placeholders.patch
@@ -40,10 +40,10 @@ index 145767e8b0fc4105a0afa47af17dcdbb75e952bc..174eb12722872182b2d9b54841e5bb57
double deltaZ = this.locZ() - player.locZ();
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 0b01a688617a198f510738e783546f1c72240151..3b7be01513f9851b50585fca2e7e2f21e03ca253 100644
+index e645a3386df6334e99d80ec6961399461c9545a9..43e4ade73619d430be7ee93687e98ef5a27cb329 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2235,6 +2235,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2240,6 +2240,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
super.remove();
}
}
diff --git a/Spigot-Server-Patches/0349-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch b/Spigot-Server-Patches/0349-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch
index 1fc9de6cb1..ad1c416c1d 100644
--- a/Spigot-Server-Patches/0349-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch
+++ b/Spigot-Server-Patches/0349-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch
@@ -16,10 +16,10 @@ handling that should have been handled synchronously will be handled
synchronously when the server gets shut down.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index c864749646d26199e4c938f1fa6bbee4a3b942dd..00dbb5382aa6efec0038a45049716cd44c1f4c79 100644
+index f07579d5b2450e7f972e0a942287ea1205740722..b704401da2832601dd45d3c29e950cb52033a3fd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2180,7 +2180,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -2181,7 +2181,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// CraftBukkit start
@Override
public boolean isMainThread() {
diff --git a/Spigot-Server-Patches/0351-Duplicate-UUID-Resolve-Option.patch b/Spigot-Server-Patches/0351-Duplicate-UUID-Resolve-Option.patch
index 385ae1b329..b5241bf306 100644
--- a/Spigot-Server-Patches/0351-Duplicate-UUID-Resolve-Option.patch
+++ b/Spigot-Server-Patches/0351-Duplicate-UUID-Resolve-Option.patch
@@ -217,7 +217,7 @@ index edae7ff7d181a5d28e083e714112dc3188b2461f..44611304d5bf222900866319a02a333e
}
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 37b9915e6c25458e9ec2d0beb40be51991276b8d..63268bc3e04ef334a750f83a8e39acc0919f7906 100644
+index cbdd75feb7250e771111184b1fac7c4a6bf6e575..5acf61ece9ca38a262387fd0395bd464312501fd 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2799,6 +2799,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -229,10 +229,10 @@ index 37b9915e6c25458e9ec2d0beb40be51991276b8d..63268bc3e04ef334a750f83a8e39acc0
this.uniqueID = uuid;
this.ae = this.uniqueID.toString();
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index 246a4b69e1b4ee6affa9564d50f261fac2f269d0..5539ee8552c4bcfa718a63dbd4c25bd232048bff 100644
+index 79ff96f18c53f3d1ce4a00be2e2d8fe68f77bf54..3f926ed8e2b2c9dbf1e2493870af7eff3b6db019 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -538,6 +538,7 @@ public class Chunk implements IChunkAccess {
+@@ -542,6 +542,7 @@ public class Chunk implements IChunkAccess {
if (i != this.loc.x || j != this.loc.z) {
Chunk.LOGGER.warn("Wrong location! ({}, {}) should be ({}, {}), {}", i, j, this.loc.x, this.loc.z, entity);
entity.dead = true;
diff --git a/Spigot-Server-Patches/0353-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/0353-Configurable-Keep-Spawn-Loaded-range-per-world.patch
index 9bb44b2ba9..30e70243f3 100644
--- a/Spigot-Server-Patches/0353-Configurable-Keep-Spawn-Loaded-range-per-world.patch
+++ b/Spigot-Server-Patches/0353-Configurable-Keep-Spawn-Loaded-range-per-world.patch
@@ -21,10 +21,10 @@ index 38d25a12c6a52d8a83214e2a0f43a218cf15ceac..ffe9b1a63d78925e1d77b9e730aef42f
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 00dbb5382aa6efec0038a45049716cd44c1f4c79..e4b7bd30117e0a3af50ec28aada604df837ebb02 100644
+index b704401da2832601dd45d3c29e950cb52033a3fd..90eb5d8ed7698b5e19d38cec647c1bcbc15532f4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -706,35 +706,36 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -707,35 +707,36 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// CraftBukkit start
public void loadSpawn(WorldLoadListener worldloadlistener, WorldServer worldserver) {
@@ -221,7 +221,7 @@ index 872d00de41533ab7f4b43874de6c1747022e2ac5..ca81664d884e80e5cb1eb376a2c2ef1e
@Override
public void a(ChunkCoordIntPair chunkcoordintpair) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 6dd09a5fc5f9706c4eb2e6f7ef25162d98efc156..7080dc890e959e1cce9aec63c1de8ac413b4b2e9 100644
+index 02b7be844f723fd0e0d5f547ba8ff31a14f448a7..9e47e9cfa5bf1819e6d6779c52828e4472e4eed0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1973,15 +1973,21 @@ public class CraftWorld implements World {
diff --git a/Spigot-Server-Patches/0358-Catch-exceptions-from-dispenser-entity-spawns.patch b/Spigot-Server-Patches/0358-Catch-exceptions-from-dispenser-entity-spawns.patch
index eb386f8345..f724360c49 100644
--- a/Spigot-Server-Patches/0358-Catch-exceptions-from-dispenser-entity-spawns.patch
+++ b/Spigot-Server-Patches/0358-Catch-exceptions-from-dispenser-entity-spawns.patch
@@ -5,10 +5,18 @@ Subject: [PATCH] Catch exceptions from dispenser entity spawns
diff --git a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
-index ffce5baaca6fd5b5e73ed898d12a4fee02c24515..d8a8a57c2228376347d46de8821ae0e8321861e3 100644
+index ffce5baaca6fd5b5e73ed898d12a4fee02c24515..158075319bd49ac78ea994639cdad21aeacdf86f 100644
--- a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
-@@ -236,7 +236,14 @@ public interface IDispenseBehavior {
+@@ -8,6 +8,7 @@ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.EnumDirection;
+ import net.minecraft.core.IPosition;
+ import net.minecraft.core.ISourceBlock;
++import net.minecraft.server.MinecraftServer;
+ import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.sounds.SoundCategory;
+@@ -236,7 +237,14 @@ public interface IDispenseBehavior {
}
}
diff --git a/Spigot-Server-Patches/0359-Fix-World-isChunkGenerated-calls.patch b/Spigot-Server-Patches/0359-Fix-World-isChunkGenerated-calls.patch
index 0e8c6f91d3..bb4d406988 100644
--- a/Spigot-Server-Patches/0359-Fix-World-isChunkGenerated-calls.patch
+++ b/Spigot-Server-Patches/0359-Fix-World-isChunkGenerated-calls.patch
@@ -8,7 +8,7 @@ This patch also adds a chunk status cache on region files (note that
its only purpose is to cache the status on DISK)
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
-index b80c3bd702141ca4a88078386845d731b3ecc539..c6acc429fd0a599c1c1ab676054d9e3f720fbd39 100644
+index 94af98e250fe7ef37c16d432c05c6f2b68625fe1..f2d48659fdb9f030dbeec12ed820062d4d066e48 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -52,7 +52,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -42,6 +42,15 @@ index b80c3bd702141ca4a88078386845d731b3ecc539..c6acc429fd0a599c1c1ab676054d9e3f
// Paper end
@Nullable
+@@ -768,7 +783,7 @@ public class ChunkProviderServer extends IChunkProvider {
+ return this.p;
+ }
+
+- final class a extends IAsyncTaskHandler<Runnable> {
++ public final class a extends IAsyncTaskHandler<Runnable> { // Paper - package -> public
+
+ private a(World world) {
+ super("Chunk source main thread executor for " + world.getDimensionKey().a());
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java
index 9891cf98f8c740f84f9135ee8176e67abb648b3a..6bced8533df49d7bfdb32dfa0caad9d788ffc2c8 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java
@@ -165,10 +174,10 @@ index 5e4c162654349f884becc10e8fbae4ded6889deb..711308cf84a816f09d116a7414f9cbee
return (ChunkStatus) IRegistry.CHUNK_STATUS.get(MinecraftKey.a(s));
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-index 1711c40e163a1148e2f7be58d4c020c61bef8bb2..839d3d08a2d1ff6714645517906598a87075687b 100644
+index 69bc9dc18bab157851d8080a672504598e8572a8..98bc26c7ae01884eb53766e72fc7cbabbf065e6e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-@@ -461,6 +461,17 @@ public class ChunkRegionLoader {
+@@ -462,6 +462,17 @@ public class ChunkRegionLoader {
}
// Paper end
@@ -285,7 +294,7 @@ index ab9f4d40fd1126a3d7ba5b16fdc6ab09de4a7fdb..55e7e983d2c760a8052d7b3ddbdc8447
} catch (Throwable throwable1) {
throwable = throwable1;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 7080dc890e959e1cce9aec63c1de8ac413b4b2e9..a0654c41ce981a12dc20e1ecaf13f1f2d150029f 100644
+index 9e47e9cfa5bf1819e6d6779c52828e4472e4eed0..bf1ebb108149f519ae29a2277020398c898d2bc3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -19,6 +19,7 @@ import java.util.Objects;
@@ -311,7 +320,7 @@ index 7080dc890e959e1cce9aec63c1de8ac413b4b2e9..a0654c41ce981a12dc20e1ecaf13f1f2
+ chunk = world.getChunkProvider().playerChunkMap.getUnloadingChunk(x, z);
+ }
+ if (chunk != null) {
-+ return chunk instanceof ProtoChunkExtension || chunk instanceof net.minecraft.server.Chunk;
++ return chunk instanceof ProtoChunkExtension || chunk instanceof net.minecraft.world.level.chunk.Chunk;
+ }
try {
- return world.getChunkProvider().getChunkAtIfCachedImmediately(x, z) != null || world.getChunkProvider().playerChunkMap.read(new ChunkCoordIntPair(x, z)) != null; // Paper (TODO check if the first part can be removed)
diff --git a/Spigot-Server-Patches/0362-incremental-chunk-saving.patch b/Spigot-Server-Patches/0362-incremental-chunk-saving.patch
index cf96f49f51..875707df07 100644
--- a/Spigot-Server-Patches/0362-incremental-chunk-saving.patch
+++ b/Spigot-Server-Patches/0362-incremental-chunk-saving.patch
@@ -29,10 +29,10 @@ index ffe9b1a63d78925e1d77b9e730aef42fed6d58fa..1278d09f70c1e97607ef20d87a178dc2
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index e4b7bd30117e0a3af50ec28aada604df837ebb02..1d8695ac6692194c9a1cfd46c9d735120ca75245 100644
+index 90eb5d8ed7698b5e19d38cec647c1bcbc15532f4..78fc9046c64f612dfc56431ce6ea0e1cc7d66f15 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -261,6 +261,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -262,6 +262,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public static int currentTick = 0; // Paper - Further improve tick loop
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod;
@@ -40,7 +40,7 @@ index e4b7bd30117e0a3af50ec28aada604df837ebb02..1d8695ac6692194c9a1cfd46c9d73512
public CommandDispatcher vanillaCommandDispatcher;
private boolean forceTicks;
// CraftBukkit end
-@@ -1246,14 +1247,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1247,14 +1248,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.serverPing.b().a(agameprofile);
}
@@ -71,7 +71,7 @@ index e4b7bd30117e0a3af50ec28aada604df837ebb02..1d8695ac6692194c9a1cfd46c9d73512
this.methodProfiler.enter("snooper");
if (((DedicatedServer) this).getDedicatedServerProperties().snooperEnabled && !this.snooper.d() && this.ticks > 100) { // Spigot
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
-index c6acc429fd0a599c1c1ab676054d9e3f720fbd39..2a3c2f4f6d581cff82e0cb69fd6e6fb75435e953 100644
+index f2d48659fdb9f030dbeec12ed820062d4d066e48..5122afbd51c87c27efa82d7d9393f252efa848d4 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -557,6 +557,15 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -309,10 +309,10 @@ index 16441006736abdea0120570557348be4919c82ad..5da94d3c2498c84da81f41c37249159d
if (this.dragonBattle != null) {
this.worldDataServer.a(this.dragonBattle.a()); // CraftBukkit
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index 5539ee8552c4bcfa718a63dbd4c25bd232048bff..f036cc45e7b1f3aedd8c63293b9b5436968a42c3 100644
+index 3f926ed8e2b2c9dbf1e2493870af7eff3b6db019..2690c44eaae193a259fe195c95e59d07d5e1cc5a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -77,7 +77,7 @@ public class Chunk implements IChunkAccess {
+@@ -81,7 +81,7 @@ public class Chunk implements IChunkAccess {
private TickList<Block> o;
private TickList<FluidType> p;
private boolean q;
diff --git a/Spigot-Server-Patches/0363-Anti-Xray.patch b/Spigot-Server-Patches/0363-Anti-Xray.patch
index fe928bad58..5340e42f81 100644
--- a/Spigot-Server-Patches/0363-Anti-Xray.patch
+++ b/Spigot-Server-Patches/0363-Anti-Xray.patch
@@ -1160,10 +1160,10 @@ index 1f32ab230d650bb5f652efbacdd5e4b90dc4de89..71c2792d7eede35485cc36ac929cf295
}
diff --git a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
-index 0d32d7e9fc6bf6a05f3975fe225022a9e176e47b..3dcfb2326af92eb7a9cd16fd4725b3ae9acee17b 100644
+index e7f762dc131ae40e36ff5e70b0394e0d5abdcee8..37e436c28c3c71c73fb0e7bf06a417739a318e47 100644
--- a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
-@@ -306,6 +306,8 @@ public class PlayerInteractManager {
+@@ -308,6 +308,8 @@ public class PlayerInteractManager {
}
}
@@ -1227,10 +1227,10 @@ index 12ac3608736b45447afe6b0d35ead1441390be5e..15da3511a9e57c320f4cf409852bee07
if (iblockdata1 == null) {
// CraftBukkit start - remove blockstate if failed (or the same)
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index f036cc45e7b1f3aedd8c63293b9b5436968a42c3..9b75e5ea8987421523e0324a83db317f150d3f48 100644
+index 2690c44eaae193a259fe195c95e59d07d5e1cc5a..3fdce0e6fa34eb4b1eafc618068a3fb06abd5ec1 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -461,7 +461,7 @@ public class Chunk implements IChunkAccess {
+@@ -465,7 +465,7 @@ public class Chunk implements IChunkAccess {
return null;
}
@@ -1240,10 +1240,18 @@ index f036cc45e7b1f3aedd8c63293b9b5436968a42c3..9b75e5ea8987421523e0324a83db317f
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkEmpty.java b/src/main/java/net/minecraft/world/level/chunk/ChunkEmpty.java
-index 89efd0b68b04457e1cd617dcc8bb1a6ea1c4717c..a8f4c1468759fe44c28957e0e733dee741aa502f 100644
+index 89efd0b68b04457e1cd617dcc8bb1a6ea1c4717c..9fb8d20e9e1a8cc716c32a100b1d70e90f385eca 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkEmpty.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkEmpty.java
-@@ -28,7 +28,7 @@ public class ChunkEmpty extends Chunk {
+@@ -8,6 +8,7 @@ import net.minecraft.SystemUtils;
+ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.IRegistry;
+ import net.minecraft.data.worldgen.biome.BiomeRegistry;
++import net.minecraft.server.MinecraftServer;
+ import net.minecraft.server.level.PlayerChunk;
+ import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.level.ChunkCoordIntPair;
+@@ -28,7 +29,7 @@ public class ChunkEmpty extends Chunk {
});
public ChunkEmpty(World world, ChunkCoordIntPair chunkcoordintpair) {
@@ -1489,10 +1497,10 @@ index 9351e6ba541d440c485b6e4a3209170c5756e31e..7a82d43d51d80a3054e0871bf4b9aa76
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-index 839d3d08a2d1ff6714645517906598a87075687b..2853f9e06064a5c0fe2b0e5df75223d1275eae20 100644
+index 98bc26c7ae01884eb53766e72fc7cbabbf065e6e..c652897aae99c48c6cc020b5d64f6a8b02beecb5 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-@@ -100,7 +100,7 @@ public class ChunkRegionLoader {
+@@ -101,7 +101,7 @@ public class ChunkRegionLoader {
byte b0 = nbttagcompound2.getByte("Y");
if (nbttagcompound2.hasKeyOfType("Palette", 9) && nbttagcompound2.hasKeyOfType("BlockStates", 12)) {
@@ -1501,7 +1509,7 @@ index 839d3d08a2d1ff6714645517906598a87075687b..2853f9e06064a5c0fe2b0e5df75223d1
chunksection.getBlocks().a(nbttagcompound2.getList("Palette", 10), nbttagcompound2.getLongArray("BlockStates"));
chunksection.recalcBlockCounts();
-@@ -164,7 +164,7 @@ public class ChunkRegionLoader {
+@@ -165,7 +165,7 @@ public class ChunkRegionLoader {
// CraftBukkit end
});
} else {
diff --git a/Spigot-Server-Patches/0364-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch b/Spigot-Server-Patches/0364-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch
index b7f512ff2e..528f3c9022 100644
--- a/Spigot-Server-Patches/0364-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch
+++ b/Spigot-Server-Patches/0364-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch
@@ -38,10 +38,10 @@ index c45493e88bf7e8811be2759ff9ac19e3fe9d938a..384cb363eed794551bee6b0ec11ba1be
public EngineMode engineMode;
public int maxChunkSectionIndex;
diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/main/java/net/minecraft/world/level/SpawnerCreature.java
-index 28b3a74d139820f91775d3377d79675d308aff65..166609e03474946882791dbebafe7121a3727854 100644
+index 5307488fa48ffa91446dd4457de1ce6a8f61da61..d30a3de84dc75a57680052904337af02b6b80636 100644
--- a/src/main/java/net/minecraft/world/level/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/world/level/SpawnerCreature.java
-@@ -80,6 +80,13 @@ public final class SpawnerCreature {
+@@ -81,6 +81,13 @@ public final class SpawnerCreature {
EnumCreatureType enumcreaturetype = entity.getEntityType().e();
if (enumcreaturetype != EnumCreatureType.MISC) {
diff --git a/Spigot-Server-Patches/0365-Configurable-projectile-relative-velocity.patch b/Spigot-Server-Patches/0365-Configurable-projectile-relative-velocity.patch
index 343b1ed420..55dc364cd3 100644
--- a/Spigot-Server-Patches/0365-Configurable-projectile-relative-velocity.patch
+++ b/Spigot-Server-Patches/0365-Configurable-projectile-relative-velocity.patch
@@ -39,10 +39,10 @@ index 384cb363eed794551bee6b0ec11ba1be92a3d7ac..1ee2cced100626e48eb36ee14f84b925
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
-index 1ff55a1b6c1faae95a83cd8fc12a2045ad479145..0e3c646dca1fa1fa895c3aece037367a9b2cf378 100644
+index a33f3924a95b86c2337c455f30de9bb257cb8db4..37b1febb45b900dfe4b225152e66bc4be83df220 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
-@@ -125,7 +125,7 @@ public abstract class IProjectile extends Entity {
+@@ -126,7 +126,7 @@ public abstract class IProjectile extends Entity {
this.shoot((double) f5, (double) f6, (double) f7, f3, f4);
Vec3D vec3d = entity.getMot();
diff --git a/Spigot-Server-Patches/0368-Avoid-hopper-searches-if-there-are-no-items.patch b/Spigot-Server-Patches/0368-Avoid-hopper-searches-if-there-are-no-items.patch
index 4773ab73f6..77f09da2e9 100644
--- a/Spigot-Server-Patches/0368-Avoid-hopper-searches-if-there-are-no-items.patch
+++ b/Spigot-Server-Patches/0368-Avoid-hopper-searches-if-there-are-no-items.patch
@@ -26,10 +26,24 @@ index cb5cda5e6497edeb801ef712f9bd8823cb055750..1a6f8aec32af85717f5d56e0b00a02cd
return entity instanceof IInventory && entity.isAlive();
};
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index 9b75e5ea8987421523e0324a83db317f150d3f48..46467230aac994e2b3864b7a1eddc701c4ade91c 100644
+index 3fdce0e6fa34eb4b1eafc618068a3fb06abd5ec1..e7bb33125a25b9e5a68013b15d7b5b6b6769ab9b 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -119,6 +119,10 @@ public class Chunk implements IChunkAccess {
+@@ -32,10 +32,13 @@ import net.minecraft.server.level.PlayerChunk;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.util.EntitySlice;
+ import net.minecraft.util.MathHelper;
++import net.minecraft.world.IInventory;
+ import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.entity.EntityTypes;
++import net.minecraft.world.entity.IEntitySelector;
+ import net.minecraft.world.entity.boss.EntityComplexPart;
+ import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon;
++import net.minecraft.world.entity.item.EntityItem;
+ import net.minecraft.world.level.ChunkCoordIntPair;
+ import net.minecraft.world.level.GeneratorAccess;
+ import net.minecraft.world.level.TickList;
+@@ -123,6 +126,10 @@ public class Chunk implements IChunkAccess {
return removed;
}
}
@@ -40,7 +54,7 @@ index 9b75e5ea8987421523e0324a83db317f150d3f48..46467230aac994e2b3864b7a1eddc701
// Paper end
public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage, ChunkConverter chunkconverter, TickList<Block> ticklist, TickList<FluidType> ticklist1, long i, @Nullable ChunkSection[] achunksection, @Nullable Consumer<Chunk> consumer) {
-@@ -578,6 +582,13 @@ public class Chunk implements IChunkAccess {
+@@ -582,6 +589,13 @@ public class Chunk implements IChunkAccess {
entity.chunkZ = this.loc.z;
this.entities.add(entity); // Paper - per chunk entity list
this.entitySlices[k].add(entity);
@@ -54,7 +68,7 @@ index 9b75e5ea8987421523e0324a83db317f150d3f48..46467230aac994e2b3864b7a1eddc701
entity.entitySlice = this.entitySlices[k]; // Paper
this.markDirty(); // Paper
}
-@@ -611,6 +622,11 @@ public class Chunk implements IChunkAccess {
+@@ -615,6 +629,11 @@ public class Chunk implements IChunkAccess {
if (!this.entitySlices[i].remove(entity)) {
return;
}
@@ -66,7 +80,7 @@ index 9b75e5ea8987421523e0324a83db317f150d3f48..46467230aac994e2b3864b7a1eddc701
entityCounts.decrement(entity.getMinecraftKeyString());
this.markDirty(); // Paper
// Paper end
-@@ -896,6 +912,14 @@ public class Chunk implements IChunkAccess {
+@@ -900,6 +919,14 @@ public class Chunk implements IChunkAccess {
for (int k = i; k <= j; ++k) {
Iterator iterator = this.entitySlices[k].iterator(); // Spigot
@@ -81,7 +95,7 @@ index 9b75e5ea8987421523e0324a83db317f150d3f48..46467230aac994e2b3864b7a1eddc701
while (iterator.hasNext()) {
T entity = (T) iterator.next(); // CraftBukkit - decompile error
if (entity.shouldBeRemoved) continue; // Paper
-@@ -916,9 +940,29 @@ public class Chunk implements IChunkAccess {
+@@ -920,9 +947,29 @@ public class Chunk implements IChunkAccess {
i = MathHelper.clamp(i, 0, this.entitySlices.length - 1);
j = MathHelper.clamp(j, 0, this.entitySlices.length - 1);
diff --git a/Spigot-Server-Patches/0369-Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/0369-Asynchronous-chunk-IO-and-loading.patch
index 1e53b4f823..dba9ede259 100644
--- a/Spigot-Server-Patches/0369-Asynchronous-chunk-IO-and-loading.patch
+++ b/Spigot-Server-Patches/0369-Asynchronous-chunk-IO-and-loading.patch
@@ -2340,10 +2340,10 @@ index 191a74bd9b894f9d64d0a55747cb17e07ceef597..949e374d1e3bdbe31b160ad5ab6c0153
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, datapackconfiguration1, thread, iregistrycustom_dimension, convertable_conversionsession, resourcepackrepository, datapackresources, null, dedicatedserversettings, DataConverterRegistry.a(), minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 1d8695ac6692194c9a1cfd46c9d735120ca75245..eafee14262ac8abb482bdd0fa52a8a33bf4a0f87 100644
+index 78fc9046c64f612dfc56431ce6ea0e1cc7d66f15..d2b81e14f8f58f5746a5577e23357d26f22e74fe 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -910,7 +910,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -911,7 +911,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.getUserCache().b(false); // Paper
}
// Spigot end
@@ -2353,7 +2353,7 @@ index 1d8695ac6692194c9a1cfd46c9d735120ca75245..eafee14262ac8abb482bdd0fa52a8a33
public String getServerIp() {
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
-index 2a3c2f4f6d581cff82e0cb69fd6e6fb75435e953..df71f8c42ac488153257614b58202bb5d7083251 100644
+index 5122afbd51c87c27efa82d7d9393f252efa848d4..1e74299bb3a368dcbc813408804d25cf58a75b0b 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -38,6 +38,7 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
@@ -3386,7 +3386,7 @@ index 37d31b49dbbbf834daf29e50daffd9852bfaaf03..2e86be5be969ebf672ef3844e1367583
return this.a == null ? new NibbleArray() : new NibbleArray((byte[]) this.a.clone());
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-index 2853f9e06064a5c0fe2b0e5df75223d1275eae20..42dc430d948dbab38ad1a1788aaff840f28bc8e8 100644
+index c652897aae99c48c6cc020b5d64f6a8b02beecb5..c95fcdf47db8bfe59a83c0d28f4744b4d8540ef8 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
@@ -6,6 +6,7 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
@@ -3397,7 +3397,7 @@ index 2853f9e06064a5c0fe2b0e5df75223d1275eae20..42dc430d948dbab38ad1a1788aaff840
import java.util.Arrays;
import java.util.BitSet;
import java.util.EnumSet;
-@@ -65,7 +66,29 @@ public class ChunkRegionLoader {
+@@ -66,7 +67,29 @@ public class ChunkRegionLoader {
private static final Logger LOGGER = LogManager.getLogger();
@@ -3427,7 +3427,7 @@ index 2853f9e06064a5c0fe2b0e5df75223d1275eae20..42dc430d948dbab38ad1a1788aaff840
ChunkGenerator chunkgenerator = worldserver.getChunkProvider().getChunkGenerator();
WorldChunkManager worldchunkmanager = chunkgenerator.getWorldChunkManager();
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Level");
-@@ -92,7 +115,9 @@ public class ChunkRegionLoader {
+@@ -93,7 +116,9 @@ public class ChunkRegionLoader {
LightEngine lightengine = chunkproviderserver.getLightEngine();
if (flag) {
@@ -3438,7 +3438,7 @@ index 2853f9e06064a5c0fe2b0e5df75223d1275eae20..42dc430d948dbab38ad1a1788aaff840
}
for (int i = 0; i < nbttaglist.size(); ++i) {
-@@ -108,16 +133,28 @@ public class ChunkRegionLoader {
+@@ -109,16 +134,28 @@ public class ChunkRegionLoader {
achunksection[b0] = chunksection;
}
@@ -3470,7 +3470,7 @@ index 2853f9e06064a5c0fe2b0e5df75223d1275eae20..42dc430d948dbab38ad1a1788aaff840
}
}
}
-@@ -226,7 +263,7 @@ public class ChunkRegionLoader {
+@@ -227,7 +264,7 @@ public class ChunkRegionLoader {
}
if (chunkstatus_type == ChunkStatus.Type.LEVELCHUNK) {
@@ -3479,7 +3479,7 @@ index 2853f9e06064a5c0fe2b0e5df75223d1275eae20..42dc430d948dbab38ad1a1788aaff840
} else {
ProtoChunk protochunk1 = (ProtoChunk) object;
-@@ -265,11 +302,83 @@ public class ChunkRegionLoader {
+@@ -266,11 +303,83 @@ public class ChunkRegionLoader {
protochunk1.a(worldgenstage_features, BitSet.valueOf(nbttagcompound5.getByteArray(s1)));
}
@@ -3564,7 +3564,7 @@ index 2853f9e06064a5c0fe2b0e5df75223d1275eae20..42dc430d948dbab38ad1a1788aaff840
ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos();
NBTTagCompound nbttagcompound = new NBTTagCompound();
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
-@@ -278,7 +387,7 @@ public class ChunkRegionLoader {
+@@ -279,7 +388,7 @@ public class ChunkRegionLoader {
nbttagcompound.set("Level", nbttagcompound1);
nbttagcompound1.setInt("xPos", chunkcoordintpair.x);
nbttagcompound1.setInt("zPos", chunkcoordintpair.z);
@@ -3573,7 +3573,7 @@ index 2853f9e06064a5c0fe2b0e5df75223d1275eae20..42dc430d948dbab38ad1a1788aaff840
nbttagcompound1.setLong("InhabitedTime", ichunkaccess.getInhabitedTime());
nbttagcompound1.setString("Status", ichunkaccess.getChunkStatus().d());
ChunkConverter chunkconverter = ichunkaccess.p();
-@@ -294,14 +403,22 @@ public class ChunkRegionLoader {
+@@ -295,14 +404,22 @@ public class ChunkRegionLoader {
NBTTagCompound nbttagcompound2;
@@ -3600,7 +3600,7 @@ index 2853f9e06064a5c0fe2b0e5df75223d1275eae20..42dc430d948dbab38ad1a1788aaff840
if (chunksection != Chunk.a || nibblearray != null || nibblearray1 != null) {
nbttagcompound2 = new NBTTagCompound();
nbttagcompound2.setByte("Y", (byte) (i & 255));
-@@ -368,7 +485,7 @@ public class ChunkRegionLoader {
+@@ -369,7 +486,7 @@ public class ChunkRegionLoader {
Entity entity = (Entity) iterator1.next();
NBTTagCompound nbttagcompound4 = new NBTTagCompound();
// Paper start
@@ -3609,7 +3609,7 @@ index 2853f9e06064a5c0fe2b0e5df75223d1275eae20..42dc430d948dbab38ad1a1788aaff840
toUpdate.add(entity);
continue;
}
-@@ -411,24 +528,32 @@ public class ChunkRegionLoader {
+@@ -412,24 +529,32 @@ public class ChunkRegionLoader {
}
nbttagcompound1.set("Entities", nbttaglist2);
@@ -4052,7 +4052,7 @@ index 8ad97a8a2189553da88810380b1c240079eacc93..d3b9a9e4695655860c72db5f21884726
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index a0654c41ce981a12dc20e1ecaf13f1f2d150029f..ff6aff979ffaa740a5141ef6dc929fb3368bc194 100644
+index bf1ebb108149f519ae29a2277020398c898d2bc3..7169cb3eb857a0725822bb7561693453f1600cdc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -563,22 +563,23 @@ public class CraftWorld implements World {
@@ -4123,22 +4123,40 @@ index a0654c41ce981a12dc20e1ecaf13f1f2d150029f..ff6aff979ffaa740a5141ef6dc929fb3
// Spigot start
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index 93bbf63e9d38f32d5528c7693633d4b65655bb9d..27b90388cc21ffdccaabc8072ead1bd29f3e88c6 100644
+index 93bbf63e9d38f32d5528c7693633d4b65655bb9d..266b2cbd6bfaf10743929a1eeb9732a5d1fb4c62 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-@@ -508,6 +508,28 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+@@ -12,6 +12,9 @@ import net.minecraft.nbt.NBTBase;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.network.chat.IChatBaseComponent;
+ import net.minecraft.server.level.EntityPlayer;
++import net.minecraft.server.level.PlayerChunk;
++import net.minecraft.server.level.PlayerChunkMap;
++import net.minecraft.server.level.TicketType;
+ import net.minecraft.world.damagesource.DamageSource;
+ import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.entity.EntityAreaEffectCloud;
+@@ -144,6 +147,7 @@ import net.minecraft.world.entity.vehicle.EntityMinecartHopper;
+ import net.minecraft.world.entity.vehicle.EntityMinecartMobSpawner;
+ import net.minecraft.world.entity.vehicle.EntityMinecartRideable;
+ import net.minecraft.world.entity.vehicle.EntityMinecartTNT;
++import net.minecraft.world.level.ChunkCoordIntPair;
+ import net.minecraft.world.phys.AxisAlignedBB;
+ import org.bukkit.Chunk; // Paper
+ import org.bukkit.EntityEffect;
+@@ -508,6 +512,28 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
entity.setHeadRotation(yaw);
}
+ @Override// Paper start
+ public java.util.concurrent.CompletableFuture<Boolean> teleportAsync(Location loc, @javax.annotation.Nonnull org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) {
-+ net.minecraft.server.PlayerChunkMap playerChunkMap = ((CraftWorld) loc.getWorld()).getHandle().getChunkProvider().playerChunkMap;
++ PlayerChunkMap playerChunkMap = ((CraftWorld) loc.getWorld()).getHandle().getChunkProvider().playerChunkMap;
+ java.util.concurrent.CompletableFuture<Boolean> future = new java.util.concurrent.CompletableFuture<>();
+
+ loc.getWorld().getChunkAtAsyncUrgently(loc).thenCompose(chunk -> {
-+ net.minecraft.server.ChunkCoordIntPair pair = new net.minecraft.server.ChunkCoordIntPair(chunk.getX(), chunk.getZ());
-+ ((CraftWorld) loc.getWorld()).getHandle().getChunkProvider().addTicketAtLevel(net.minecraft.server.TicketType.POST_TELEPORT, pair, 31, 0);
-+ net.minecraft.server.PlayerChunk updatingChunk = playerChunkMap.getUpdatingChunk(pair.pair());
++ ChunkCoordIntPair pair = new ChunkCoordIntPair(chunk.getX(), chunk.getZ());
++ ((CraftWorld) loc.getWorld()).getHandle().getChunkProvider().addTicketAtLevel(TicketType.POST_TELEPORT, pair, 31, 0);
++ PlayerChunk updatingChunk = playerChunkMap.getUpdatingChunk(pair.pair());
+ if (updatingChunk != null) {
+ return updatingChunk.getEntityTickingFuture();
+ } else {
diff --git a/Spigot-Server-Patches/0373-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch b/Spigot-Server-Patches/0373-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch
index b6182e96bc..dbd8cbc5ab 100644
--- a/Spigot-Server-Patches/0373-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch
+++ b/Spigot-Server-Patches/0373-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch
@@ -7,10 +7,10 @@ If the Bukkit generator already has a spawn, use it immediately instead
of spending time generating one that we won't use
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index eafee14262ac8abb482bdd0fa52a8a33bf4a0f87..ede36b4c4d806bee62fd46d2e1ba595c9cd515ce 100644
+index d2b81e14f8f58f5746a5577e23357d26f22e74fe..705dad5092cb5f7355eeac9af395093d0a7a2212 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -618,12 +618,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -619,12 +619,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
} else if (flag1) {
iworlddataserver.setSpawn(BlockPosition.ZERO.up(), 0.0F);
} else {
@@ -24,7 +24,7 @@ index eafee14262ac8abb482bdd0fa52a8a33bf4a0f87..ede36b4c4d806bee62fd46d2e1ba595c
// CraftBukkit start
if (worldserver.generator != null) {
Random rand = new Random(worldserver.getSeed());
-@@ -639,6 +634,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -640,6 +635,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
}
// CraftBukkit end
diff --git a/Spigot-Server-Patches/0375-implement-optional-per-player-mob-spawns.patch b/Spigot-Server-Patches/0375-implement-optional-per-player-mob-spawns.patch
index 4068ba842a..8bc041496e 100644
--- a/Spigot-Server-Patches/0375-implement-optional-per-player-mob-spawns.patch
+++ b/Spigot-Server-Patches/0375-implement-optional-per-player-mob-spawns.patch
@@ -544,7 +544,7 @@ index 0000000000000000000000000000000000000000..4f13d3ff8391793a99f067189f854078
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
-index 2530c5ddfc8469329b411ad5c98ed718a3771890..4998fad49755c08e20ebfb1dc97b558e1cf10b50 100644
+index 662d7f418e8acc9503ebf43e09410e7bd50f6bb3..372e5268783a84effa8f9f06c3f85b182e209cb8 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -767,7 +767,22 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -671,10 +671,18 @@ index 1355c074353611669c947cb0f06c67be0ab418aa..9d2955f05aadd4bbc6dcfec068a55d7f
return this.bg;
}
diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/main/java/net/minecraft/world/level/SpawnerCreature.java
-index 166609e03474946882791dbebafe7121a3727854..66350a00f728901a7eef1c376c79a4cde2e9ed4b 100644
+index d30a3de84dc75a57680052904337af02b6b80636..24771c3522ea74ac12058591137eafc21adf3762 100644
--- a/src/main/java/net/minecraft/world/level/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/world/level/SpawnerCreature.java
-@@ -61,6 +61,11 @@ public final class SpawnerCreature {
+@@ -16,6 +16,7 @@ import net.minecraft.core.IPosition;
+ import net.minecraft.core.IRegistry;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.server.MCUtil;
++import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.tags.Tag;
+ import net.minecraft.tags.TagsBlock;
+@@ -62,6 +63,11 @@ public final class SpawnerCreature {
});
public static SpawnerCreature.d a(int i, Iterable<Entity> iterable, SpawnerCreature.b spawnercreature_b) {
@@ -686,7 +694,7 @@ index 166609e03474946882791dbebafe7121a3727854..66350a00f728901a7eef1c376c79a4cd
SpawnerCreatureProbabilities spawnercreatureprobabilities = new SpawnerCreatureProbabilities();
Object2IntOpenHashMap<EnumCreatureType> object2intopenhashmap = new Object2IntOpenHashMap();
Iterator iterator = iterable.iterator();
-@@ -98,6 +103,11 @@ public final class SpawnerCreature {
+@@ -99,6 +105,11 @@ public final class SpawnerCreature {
}
object2intopenhashmap.addTo(enumcreaturetype, 1);
@@ -698,7 +706,7 @@ index 166609e03474946882791dbebafe7121a3727854..66350a00f728901a7eef1c376c79a4cd
});
}
}
-@@ -156,13 +166,31 @@ public final class SpawnerCreature {
+@@ -157,13 +168,31 @@ public final class SpawnerCreature {
continue;
}
@@ -733,7 +741,7 @@ index 166609e03474946882791dbebafe7121a3727854..66350a00f728901a7eef1c376c79a4cd
}
}
-@@ -171,22 +199,34 @@ public final class SpawnerCreature {
+@@ -172,22 +201,34 @@ public final class SpawnerCreature {
}
public static void a(EnumCreatureType enumcreaturetype, WorldServer worldserver, Chunk chunk, SpawnerCreature.c spawnercreature_c, SpawnerCreature.a spawnercreature_a) {
@@ -770,7 +778,7 @@ index 166609e03474946882791dbebafe7121a3727854..66350a00f728901a7eef1c376c79a4cd
int k = 0;
while (k < 3) {
-@@ -226,7 +266,7 @@ public final class SpawnerCreature {
+@@ -227,7 +268,7 @@ public final class SpawnerCreature {
// Paper start
Boolean doSpawning = a(worldserver, enumcreaturetype, structuremanager, chunkgenerator, biomesettingsmobs_c, blockposition_mutableblockposition, d2);
if (doSpawning == null) {
@@ -779,7 +787,7 @@ index 166609e03474946882791dbebafe7121a3727854..66350a00f728901a7eef1c376c79a4cd
}
if (doSpawning && spawnercreature_c.test(biomesettingsmobs_c.c, blockposition_mutableblockposition, ichunkaccess)) {
// Paper end
-@@ -234,7 +274,7 @@ public final class SpawnerCreature {
+@@ -235,7 +276,7 @@ public final class SpawnerCreature {
if (entityinsentient == null) {
@@ -788,7 +796,7 @@ index 166609e03474946882791dbebafe7121a3727854..66350a00f728901a7eef1c376c79a4cd
}
entityinsentient.setPositionRotation(d0, (double) i, d1, worldserver.random.nextFloat() * 360.0F, 0.0F);
-@@ -243,13 +283,18 @@ public final class SpawnerCreature {
+@@ -244,13 +285,18 @@ public final class SpawnerCreature {
// CraftBukkit start
worldserver.addAllEntities(entityinsentient, SpawnReason.NATURAL);
if (!entityinsentient.dead) {
@@ -810,7 +818,7 @@ index 166609e03474946882791dbebafe7121a3727854..66350a00f728901a7eef1c376c79a4cd
}
if (entityinsentient.c(k1)) {
-@@ -271,6 +316,7 @@ public final class SpawnerCreature {
+@@ -272,6 +318,7 @@ public final class SpawnerCreature {
}
}
@@ -818,7 +826,7 @@ index 166609e03474946882791dbebafe7121a3727854..66350a00f728901a7eef1c376c79a4cd
}
private static boolean a(WorldServer worldserver, IChunkAccess ichunkaccess, BlockPosition.MutableBlockPosition blockposition_mutableblockposition, double d0) {
-@@ -511,8 +557,8 @@ public final class SpawnerCreature {
+@@ -512,8 +559,8 @@ public final class SpawnerCreature {
public static class d {
@@ -829,7 +837,7 @@ index 166609e03474946882791dbebafe7121a3727854..66350a00f728901a7eef1c376c79a4cd
private final SpawnerCreatureProbabilities c;
private final Object2IntMap<EnumCreatureType> d;
@Nullable
-@@ -573,7 +619,7 @@ public final class SpawnerCreature {
+@@ -574,7 +621,7 @@ public final class SpawnerCreature {
// CraftBukkit start
private boolean a(EnumCreatureType enumcreaturetype, int limit) {
diff --git a/Spigot-Server-Patches/0386-PlayerLaunchProjectileEvent.patch b/Spigot-Server-Patches/0386-PlayerLaunchProjectileEvent.patch
index f3b9110187..ceeb9bcd0e 100644
--- a/Spigot-Server-Patches/0386-PlayerLaunchProjectileEvent.patch
+++ b/Spigot-Server-Patches/0386-PlayerLaunchProjectileEvent.patch
@@ -113,10 +113,24 @@ index 5349282b9a5b43c4c3539e1677971463e2ca5a17..9896d77381e7fadf1ef2619210713e19
return InteractionResultWrapper.a(itemstack, world.s_());
}
diff --git a/src/main/java/net/minecraft/world/item/ItemExpBottle.java b/src/main/java/net/minecraft/world/item/ItemExpBottle.java
-index 3f41fe5bf1a0cc283d6a72824779026fdad75708..6a12b87847f9d5a37299c81f8082cf9eceb4e5c4 100644
+index 3f41fe5bf1a0cc283d6a72824779026fdad75708..cf36ec4769dc316e3ed16262043cb78cbba340ab 100644
--- a/src/main/java/net/minecraft/world/item/ItemExpBottle.java
+++ b/src/main/java/net/minecraft/world/item/ItemExpBottle.java
-@@ -24,19 +24,38 @@ public class ItemExpBottle extends Item {
+@@ -1,10 +1,13 @@
+ package net.minecraft.world.item;
+
++import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.sounds.SoundCategory;
+ import net.minecraft.sounds.SoundEffects;
+ import net.minecraft.stats.StatisticList;
+ import net.minecraft.world.EnumHand;
++import net.minecraft.world.EnumInteractionResult;
+ import net.minecraft.world.InteractionResultWrapper;
++import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.entity.player.EntityHuman;
+ import net.minecraft.world.entity.projectile.EntityThrownExpBottle;
+ import net.minecraft.world.level.World;
+@@ -24,19 +27,38 @@ public class ItemExpBottle extends Item {
public InteractionResultWrapper<ItemStack> a(World world, EntityHuman entityhuman, EnumHand enumhand) {
ItemStack itemstack = entityhuman.b(enumhand);
@@ -158,10 +172,18 @@ index 3f41fe5bf1a0cc283d6a72824779026fdad75708..6a12b87847f9d5a37299c81f8082cf9e
return InteractionResultWrapper.a(itemstack, world.s_());
}
diff --git a/src/main/java/net/minecraft/world/item/ItemFireworks.java b/src/main/java/net/minecraft/world/item/ItemFireworks.java
-index 79e9be800385b94c4493bd8970620d76bfbd65ae..3cb52eb8c76c5d9aeed90798156cb2710773185a 100644
+index 79e9be800385b94c4493bd8970620d76bfbd65ae..e7f958d137257da912ce9b83db017b4423959943 100644
--- a/src/main/java/net/minecraft/world/item/ItemFireworks.java
+++ b/src/main/java/net/minecraft/world/item/ItemFireworks.java
-@@ -29,8 +29,12 @@ public class ItemFireworks extends Item {
+@@ -3,6 +3,7 @@ package net.minecraft.world.item;
+ import java.util.Arrays;
+ import java.util.Comparator;
+ import net.minecraft.core.EnumDirection;
++import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.world.EnumHand;
+ import net.minecraft.world.EnumInteractionResult;
+ import net.minecraft.world.InteractionResultWrapper;
+@@ -29,8 +30,12 @@ public class ItemFireworks extends Item {
EntityFireworks entityfireworks = new EntityFireworks(world, itemactioncontext.getEntity(), vec3d.x + (double) enumdirection.getAdjacentX() * 0.15D, vec3d.y + (double) enumdirection.getAdjacentY() * 0.15D, vec3d.z + (double) enumdirection.getAdjacentZ() * 0.15D, itemstack);
entityfireworks.spawningEntity = itemactioncontext.getEntity().getUniqueID(); // Paper
@@ -177,10 +199,18 @@ index 79e9be800385b94c4493bd8970620d76bfbd65ae..3cb52eb8c76c5d9aeed90798156cb271
return EnumInteractionResult.a(world.isClientSide);
diff --git a/src/main/java/net/minecraft/world/item/ItemLingeringPotion.java b/src/main/java/net/minecraft/world/item/ItemLingeringPotion.java
-index a75f374f0639e8143772aa863666afe25d2020cf..5ac094d7cb7bd5f376b6aabbc09b2f024f8bfb18 100644
+index a75f374f0639e8143772aa863666afe25d2020cf..0e073a8c23d24afb8b0198a9cfd8dc7d0b9d0a6b 100644
--- a/src/main/java/net/minecraft/world/item/ItemLingeringPotion.java
+++ b/src/main/java/net/minecraft/world/item/ItemLingeringPotion.java
-@@ -15,7 +15,12 @@ public class ItemLingeringPotion extends ItemPotionThrowable {
+@@ -3,6 +3,7 @@ package net.minecraft.world.item;
+ import net.minecraft.sounds.SoundCategory;
+ import net.minecraft.sounds.SoundEffects;
+ import net.minecraft.world.EnumHand;
++import net.minecraft.world.EnumInteractionResult;
+ import net.minecraft.world.InteractionResultWrapper;
+ import net.minecraft.world.entity.player.EntityHuman;
+ import net.minecraft.world.level.World;
+@@ -15,7 +16,12 @@ public class ItemLingeringPotion extends ItemPotionThrowable {
@Override
public InteractionResultWrapper<ItemStack> a(World world, EntityHuman entityhuman, EnumHand enumhand) {
@@ -196,10 +226,20 @@ index a75f374f0639e8143772aa863666afe25d2020cf..5ac094d7cb7bd5f376b6aabbc09b2f02
}
}
diff --git a/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java b/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java
-index d050243946ad7023d5dd3958d7056cddcaf185a4..2b795ee9cfb98addc7fabe3363284bf6a493237e 100644
+index d050243946ad7023d5dd3958d7056cddcaf185a4..27c61fc4e61b0d76565ca6893514b3c73247c954 100644
--- a/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java
+++ b/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java
-@@ -22,13 +22,31 @@ public class ItemPotionThrowable extends ItemPotion {
+@@ -1,7 +1,9 @@
+ package net.minecraft.world.item;
+
++import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.stats.StatisticList;
+ import net.minecraft.world.EnumHand;
++import net.minecraft.world.EnumInteractionResult;
+ import net.minecraft.world.InteractionResultWrapper;
+ import net.minecraft.world.entity.player.EntityHuman;
+ import net.minecraft.world.entity.projectile.EntityPotion;
+@@ -22,13 +24,31 @@ public class ItemPotionThrowable extends ItemPotion {
entitypotion.setItem(itemstack);
entitypotion.a(entityhuman, entityhuman.pitch, entityhuman.yaw, -20.0F, 0.5F, 1.0F);
@@ -262,10 +302,18 @@ index e5200b2a7d6d5c2d549e585ed157ec5217edae8e..8a1d59cb1ea5a8959c52272aa762ec35
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/item/ItemSplashPotion.java b/src/main/java/net/minecraft/world/item/ItemSplashPotion.java
-index 98f29fac4bf087ad15f1cc7e85b408e22ec07efd..052e7056271bc21fceaf4fa78e9e833ac5c0cad9 100644
+index 98f29fac4bf087ad15f1cc7e85b408e22ec07efd..971491a461ccb7a707c6ca1a5b7c16d8823a7a80 100644
--- a/src/main/java/net/minecraft/world/item/ItemSplashPotion.java
+++ b/src/main/java/net/minecraft/world/item/ItemSplashPotion.java
-@@ -15,7 +15,12 @@ public class ItemSplashPotion extends ItemPotionThrowable {
+@@ -3,6 +3,7 @@ package net.minecraft.world.item;
+ import net.minecraft.sounds.SoundCategory;
+ import net.minecraft.sounds.SoundEffects;
+ import net.minecraft.world.EnumHand;
++import net.minecraft.world.EnumInteractionResult;
+ import net.minecraft.world.InteractionResultWrapper;
+ import net.minecraft.world.entity.player.EntityHuman;
+ import net.minecraft.world.level.World;
+@@ -15,7 +16,12 @@ public class ItemSplashPotion extends ItemPotionThrowable {
@Override
public InteractionResultWrapper<ItemStack> a(World world, EntityHuman entityhuman, EnumHand enumhand) {
diff --git a/Spigot-Server-Patches/0389-MC-145656-Fix-Follow-Range-Initial-Target.patch b/Spigot-Server-Patches/0389-MC-145656-Fix-Follow-Range-Initial-Target.patch
index 2fec6fc79d..342a7deea1 100644
--- a/Spigot-Server-Patches/0389-MC-145656-Fix-Follow-Range-Initial-Target.patch
+++ b/Spigot-Server-Patches/0389-MC-145656-Fix-Follow-Range-Initial-Target.patch
@@ -31,10 +31,19 @@ index 4f0a2cbdd6d42e3e4721345e21bf0ef33ec48e1e..44f21c3f7af17e9d39777a48c6715a22
@Override
diff --git a/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java b/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java
-index 0de32bcf24a94efe5af922b877d4cdc3578e0cbd..3853eaee9c2447f0e5e414a6f01ef6d207acd479 100644
+index 0de32bcf24a94efe5af922b877d4cdc3578e0cbd..e6988f7ea428f1503e3db63876b13e57f898ee30 100644
--- a/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java
+++ b/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java
-@@ -82,7 +82,7 @@ public class PathfinderTargetCondition {
+@@ -4,6 +4,8 @@ import java.util.function.Predicate;
+ import javax.annotation.Nullable;
+ import net.minecraft.world.entity.EntityInsentient;
+ import net.minecraft.world.entity.EntityLiving;
++import net.minecraft.world.entity.ai.attributes.AttributeModifiable;
++import net.minecraft.world.entity.ai.attributes.GenericAttributes;
+
+ public class PathfinderTargetCondition {
+
+@@ -82,7 +84,7 @@ public class PathfinderTargetCondition {
if (this.b > 0.0D) {
double d0 = this.g ? entityliving1.A(entityliving) : 1.0D;
@@ -43,7 +52,7 @@ index 0de32bcf24a94efe5af922b877d4cdc3578e0cbd..3853eaee9c2447f0e5e414a6f01ef6d2
double d2 = entityliving.h(entityliving1.locX(), entityliving1.locY(), entityliving1.locZ());
if (d2 > d1 * d1) {
-@@ -98,4 +98,18 @@ public class PathfinderTargetCondition {
+@@ -98,4 +100,18 @@ public class PathfinderTargetCondition {
return true;
}
}
diff --git a/Spigot-Server-Patches/0390-Optimize-Hoppers.patch b/Spigot-Server-Patches/0390-Optimize-Hoppers.patch
index 92ec649147..09f351c046 100644
--- a/Spigot-Server-Patches/0390-Optimize-Hoppers.patch
+++ b/Spigot-Server-Patches/0390-Optimize-Hoppers.patch
@@ -31,10 +31,18 @@ index edda2121f8c1046478beaa77030ebb36d403b334..7fbd501d70dccf869a4454e2789a5d68
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index ede36b4c4d806bee62fd46d2e1ba595c9cd515ce..ef6559190c336822149560d2f2748b2c90dfad86 100644
+index 705dad5092cb5f7355eeac9af395093d0a7a2212..bf6fbb8e80eb64bdfdf29347b794f01ace31cec0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1350,6 +1350,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -128,6 +128,7 @@ import net.minecraft.world.level.WorldSettings;
+ import net.minecraft.world.level.biome.BiomeManager;
+ import net.minecraft.world.level.biome.WorldChunkManager;
+ import net.minecraft.world.level.block.Block;
++import net.minecraft.world.level.block.entity.TileEntityHopper;
+ import net.minecraft.world.level.border.IWorldBorderListener;
+ import net.minecraft.world.level.border.WorldBorder;
+ import net.minecraft.world.level.chunk.ChunkGenerator;
+@@ -1351,6 +1352,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next();
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
@@ -43,7 +51,7 @@ index ede36b4c4d806bee62fd46d2e1ba595c9cd515ce..ef6559190c336822149560d2f2748b2c
this.methodProfiler.a(() -> {
return worldserver + " " + worldserver.getDimensionKey().a();
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index 5da20483ed352ac6d9695287f840ed643a2bf302..8a2ff2ef17aba806a63be3aaebfa779dac96831d 100644
+index 30db766c54db08a472caef82fdcc7cf1b7855fbf..661f400ae4f5cebef5d1743819529ecf647b6681 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -540,11 +540,12 @@ public final class ItemStack {
@@ -108,7 +116,7 @@ index d0943ae1f372784716195666212ff83e6ee4873e..1db7b7bfe98658d0b20800a4178556f8
+ double A(); default double getZ() { return this.A(); } // Paper - OBFHELPER
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
-index 3ff9e389fcf15044c2740fb884c9438428d7a681..9088fd324207f2abc9ba04cf510b519f4fbb8cc9 100644
+index 48daa039ffa8ccb7b6f3ca47bdc56394addf9254..f1e586754396439dfb70a4d63e3b8b34fb36ebf4 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
@@ -77,6 +77,7 @@ public abstract class TileEntity implements net.minecraft.server.KeyedObject { /
@@ -128,7 +136,7 @@ index 3ff9e389fcf15044c2740fb884c9438428d7a681..9088fd324207f2abc9ba04cf510b519f
this.world.b(this.position, this);
if (!this.c.isAir()) {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityHopper.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityHopper.java
-index 5fe715e8dbe9d925170acce6e0f18312d9f998f2..66cbb46088c6938ebe1d3771b3312112dd1a7160 100644
+index 5fe715e8dbe9d925170acce6e0f18312d9f998f2..537dc52e5ff3325555ee6049bc7f277952983b76 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityHopper.java
@@ -196,6 +196,160 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
@@ -138,7 +146,7 @@ index 5fe715e8dbe9d925170acce6e0f18312d9f998f2..66cbb46088c6938ebe1d3771b3312112
+ // Paper start - Optimize Hoppers
+ private static boolean skipPullModeEventFire = false;
+ private static boolean skipPushModeEventFire = false;
-+ static boolean skipHopperEvents = false;
++ public static boolean skipHopperEvents = false;
+
+ private boolean hopperPush(IInventory iinventory, EnumDirection enumdirection) {
+ skipPushModeEventFire = skipHopperEvents;
diff --git a/Spigot-Server-Patches/0394-Guard-against-serializing-mismatching-chunk-coordina.patch b/Spigot-Server-Patches/0394-Guard-against-serializing-mismatching-chunk-coordina.patch
index 51438f77a4..1c55da068c 100644
--- a/Spigot-Server-Patches/0394-Guard-against-serializing-mismatching-chunk-coordina.patch
+++ b/Spigot-Server-Patches/0394-Guard-against-serializing-mismatching-chunk-coordina.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Guard against serializing mismatching chunk coordinate
Should help if something dumb happens
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-index 42dc430d948dbab38ad1a1788aaff840f28bc8e8..358b3c396e8201fa5f82778179e8a300b4aed908 100644
+index c95fcdf47db8bfe59a83c0d28f4744b4d8540ef8..e16e046d165330326ed220c9c440a637007f3137 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-@@ -66,6 +66,13 @@ public class ChunkRegionLoader {
+@@ -67,6 +67,13 @@ public class ChunkRegionLoader {
private static final Logger LOGGER = LogManager.getLogger();
@@ -23,7 +23,7 @@ index 42dc430d948dbab38ad1a1788aaff840f28bc8e8..358b3c396e8201fa5f82778179e8a300
// Paper start
public static final class InProgressChunkHolder {
-@@ -91,8 +98,8 @@ public class ChunkRegionLoader {
+@@ -92,8 +99,8 @@ public class ChunkRegionLoader {
// Paper end
ChunkGenerator chunkgenerator = worldserver.getChunkProvider().getChunkGenerator();
WorldChunkManager worldchunkmanager = chunkgenerator.getWorldChunkManager();
@@ -35,10 +35,18 @@ index 42dc430d948dbab38ad1a1788aaff840f28bc8e8..358b3c396e8201fa5f82778179e8a300
if (!Objects.equals(chunkcoordintpair, chunkcoordintpair1)) {
ChunkRegionLoader.LOGGER.error("Chunk file at {} is in the wrong location; relocating. (Expected {}, got {})", chunkcoordintpair, chunkcoordintpair, chunkcoordintpair1);
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/IChunkLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/IChunkLoader.java
-index 65c2bbeb4d77b9accbfa0e26504fdec3f581fa6a..2de8ac694296f78a0e1dea716f52f50b0de6487e 100644
+index 01ae13385dd0208c9f34da8b3897b571f86305d0..890362d28ab9cb760c73fe5014e144fb08ada6b8 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/IChunkLoader.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/IChunkLoader.java
-@@ -123,6 +123,13 @@ public class IChunkLoader implements AutoCloseable {
+@@ -13,6 +13,7 @@ import net.minecraft.SharedConstants;
+ import net.minecraft.nbt.GameProfileSerializer;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.resources.ResourceKey;
++import net.minecraft.server.level.PlayerChunkMap;
+ import net.minecraft.util.datafix.DataFixTypes;
+ import net.minecraft.world.level.ChunkCoordIntPair;
+ import net.minecraft.world.level.World;
+@@ -123,6 +124,13 @@ public class IChunkLoader implements AutoCloseable {
public void a(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) throws IOException { write(chunkcoordintpair, nbttagcompound); } // Paper OBFHELPER
public void write(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) throws IOException { // Paper - OBFHELPER - (Switched around for safety)
diff --git a/Spigot-Server-Patches/0399-Fix-last-firework-in-stack-not-having-effects-when-d.patch b/Spigot-Server-Patches/0399-Fix-last-firework-in-stack-not-having-effects-when-d.patch
index 67a2dd383f..f288956882 100644
--- a/Spigot-Server-Patches/0399-Fix-last-firework-in-stack-not-having-effects-when-d.patch
+++ b/Spigot-Server-Patches/0399-Fix-last-firework-in-stack-not-having-effects-when-d.patch
@@ -9,10 +9,10 @@ dispensed. The resulting item would have size == 0 and therefore
be convertered to air, hence why the effects disappeared.
diff --git a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
-index d8a8a57c2228376347d46de8821ae0e8321861e3..879a7e9310855084fe011f30135e6bfa4de98a1e 100644
+index 158075319bd49ac78ea994639cdad21aeacdf86f..93093c05da53e5ddc59fac179081af2e0893706d 100644
--- a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
-@@ -425,7 +425,7 @@ public interface IDispenseBehavior {
+@@ -426,7 +426,7 @@ public interface IDispenseBehavior {
}
itemstack1 = CraftItemStack.asNMSCopy(event.getItem());
diff --git a/Spigot-Server-Patches/0402-Entity-Activation-Range-2.0.patch b/Spigot-Server-Patches/0402-Entity-Activation-Range-2.0.patch
index cf9973597e..118ae7433c 100644
--- a/Spigot-Server-Patches/0402-Entity-Activation-Range-2.0.patch
+++ b/Spigot-Server-Patches/0402-Entity-Activation-Range-2.0.patch
@@ -105,7 +105,7 @@ index f11617dc37771f65d574cd14ae9cea09103d11e1..c4adf5d3c2389d3344e179562eee6817
}
} else {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 63268bc3e04ef334a750f83a8e39acc0919f7906..664ccd8fc43cbf1c9417670d14c937314379ccf9 100644
+index 5acf61ece9ca38a262387fd0395bd464312501fd..bc136276cad4e87d8658072b2f62f608670f39ca 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -68,6 +68,7 @@ import net.minecraft.world.entity.animal.EntityFish;
@@ -351,10 +351,10 @@ index 8b09aaa30dd753fd34bea155890bdd9e5cb180f5..2005cb484ba6b5929ad81d3d120521f2
return this.bB != null;
}
diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
-index d1afbfc4458c76a35b9be124f1e09c3b82501798..02dbb98a1b211d6b3184405ec81f6f58fcef79f3 100644
+index 534efe39beee393d11705b8f0b13ce4ca727c3eb..07f87ee8f5df9d7a40001dd28f50457344308a03 100644
--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
-@@ -212,17 +212,29 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
+@@ -213,17 +213,29 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
@Override
public void inactiveTick() {
// SPIGOT-3874, SPIGOT-3894, SPIGOT-3846, SPIGOT-5286 :(
@@ -388,7 +388,7 @@ index d1afbfc4458c76a35b9be124f1e09c3b82501798..02dbb98a1b211d6b3184405ec81f6f58
this.world.getMethodProfiler().exit();
if (this.bF) {
this.bF = false;
-@@ -246,7 +258,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
+@@ -247,7 +259,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
this.bv = null;
}
@@ -397,7 +397,7 @@ index d1afbfc4458c76a35b9be124f1e09c3b82501798..02dbb98a1b211d6b3184405ec81f6f58
Raid raid = ((WorldServer) this.world).b_(this.getChunkCoordinates());
if (raid != null && raid.v() && !raid.a()) {
-@@ -257,6 +269,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
+@@ -258,6 +270,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
if (this.getVillagerData().getProfession() == VillagerProfession.NONE && this.eN()) {
this.eT();
}
@@ -405,7 +405,7 @@ index d1afbfc4458c76a35b9be124f1e09c3b82501798..02dbb98a1b211d6b3184405ec81f6f58
super.mobTick();
}
-@@ -893,6 +906,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
+@@ -894,6 +907,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
}
}
diff --git a/Spigot-Server-Patches/0408-Optimise-random-block-ticking.patch b/Spigot-Server-Patches/0408-Optimise-random-block-ticking.patch
index c62852f7ad..798698c445 100644
--- a/Spigot-Server-Patches/0408-Optimise-random-block-ticking.patch
+++ b/Spigot-Server-Patches/0408-Optimise-random-block-ticking.patch
@@ -222,7 +222,7 @@ index c4adf5d3c2389d3344e179562eee6817cd4fb298..f666b281926876636672e76a7a5e6386
protected BlockPosition a(BlockPosition blockposition) {
diff --git a/src/main/java/net/minecraft/util/DataBits.java b/src/main/java/net/minecraft/util/DataBits.java
-index c4f3b680512fb15cea01ad12d0a00c6e60bf34b7..679abdd669206e1984ef8e1b43312d2fe3121931 100644
+index c4f3b680512fb15cea01ad12d0a00c6e60bf34b7..cfa444cf384920d446c6dc14b23e5158fc28df3b 100644
--- a/src/main/java/net/minecraft/util/DataBits.java
+++ b/src/main/java/net/minecraft/util/DataBits.java
@@ -112,4 +112,32 @@ public class DataBits {
@@ -251,7 +251,7 @@ index c4f3b680512fb15cea01ad12d0a00c6e60bf34b7..679abdd669206e1984ef8e1b43312d2f
+ }
+
+ @FunctionalInterface
-+ static interface DataBitConsumer {
++ public static interface DataBitConsumer {
+
+ void accept(int location, int data);
+
@@ -259,10 +259,10 @@ index c4f3b680512fb15cea01ad12d0a00c6e60bf34b7..679abdd669206e1984ef8e1b43312d2f
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java b/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java
-index 38588e59f26dd1f3a43fc229195e4fb8484e3705..6fa8176530af23903f8e6ad33ab63f1bc9e2e302 100644
+index 09a6310af6712d36c20167256b60dc3235e76021..ecec8a3c4d4b5d491f79ad60d7ce5a118f30b3db 100644
--- a/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java
-@@ -90,7 +90,7 @@ public class EntityTurtle extends EntityAnimal {
+@@ -91,7 +91,7 @@ public class EntityTurtle extends EntityAnimal {
}
public void setHomePos(BlockPosition blockposition) {
@@ -296,10 +296,10 @@ index c4680142bf23d30169555abe7db78d85811e042b..cc41dcd85760b57bb8076b37e9a907d1
public boolean isSavingDisabled() {
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index 46467230aac994e2b3864b7a1eddc701c4ade91c..09d157bd2795b7e4374778cbd1e554de70f397bd 100644
+index e7bb33125a25b9e5a68013b15d7b5b6b6769ab9b..fc55e89260fdec2c5045e8f00e091191980ff1f2 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -633,8 +633,8 @@ public class Chunk implements IChunkAccess {
+@@ -640,8 +640,8 @@ public class Chunk implements IChunkAccess {
this.entities.remove(entity); // Paper
}
diff --git a/Spigot-Server-Patches/0410-Add-option-to-nerf-pigmen-from-nether-portals.patch b/Spigot-Server-Patches/0410-Add-option-to-nerf-pigmen-from-nether-portals.patch
index 0d3de5119b..1a54ef16f6 100644
--- a/Spigot-Server-Patches/0410-Add-option-to-nerf-pigmen-from-nether-portals.patch
+++ b/Spigot-Server-Patches/0410-Add-option-to-nerf-pigmen-from-nether-portals.patch
@@ -19,7 +19,7 @@ index 7fbd501d70dccf869a4454e2789a5d68f2e15754..9e4591ddc4b755f4ff5a6f1078b51cb1
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index cc50c0025a98ed1192fdc2e507c63c747e796dc6..19322c00422ac53de9903b3492994ce6e3c3bef4 100644
+index d676eaad8179cdeae410038e58ddafe0fe541ccc..68fdb01c3f11c3b060d3d621099d67f6b29431d6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -278,6 +278,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -49,10 +49,18 @@ index cc50c0025a98ed1192fdc2e507c63c747e796dc6..19322c00422ac53de9903b3492994ce6
String spawnReasonName = nbttagcompound.getString("Paper.SpawnReason");
try {
diff --git a/src/main/java/net/minecraft/world/level/block/BlockPortal.java b/src/main/java/net/minecraft/world/level/block/BlockPortal.java
-index e115ff86987c69f5e3571af5d7f034f24a3f6bba..4cfa3108996eb879d39337a7b23307a6dbcb97a7 100644
+index e115ff86987c69f5e3571af5d7f034f24a3f6bba..5f797260eff317409a5039b88b01ad79ee2fdd91 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockPortal.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockPortal.java
-@@ -62,6 +62,8 @@ public class BlockPortal extends Block {
+@@ -7,6 +7,7 @@ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.network.chat.IChatBaseComponent;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.world.entity.Entity;
++import net.minecraft.world.entity.EntityInsentient;
+ import net.minecraft.world.entity.EntityTypes;
+ import net.minecraft.world.entity.EnumMobSpawn;
+ import net.minecraft.world.entity.player.EntityHuman;
+@@ -62,6 +63,8 @@ public class BlockPortal extends Block {
if (entity != null) {
entity.resetPortalCooldown();
diff --git a/Spigot-Server-Patches/0411-Make-the-GUI-graph-fancier.patch b/Spigot-Server-Patches/0411-Make-the-GUI-graph-fancier.patch
index 72e312fc76..c8a21d02dd 100644
--- a/Spigot-Server-Patches/0411-Make-the-GUI-graph-fancier.patch
+++ b/Spigot-Server-Patches/0411-Make-the-GUI-graph-fancier.patch
@@ -396,10 +396,10 @@ index 46d82c1548088b8305f758699388edf0d5d4d050..397194b3e90c9df39cfae17b401c7ac8
consumer.accept(t0);
return t0;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index ef6559190c336822149560d2f2748b2c90dfad86..928a801493003e3ab034f65ac501f5b7e1cb6c75 100644
+index bf6fbb8e80eb64bdfdf29347b794f01ace31cec0..039c76a07bae4eec407e06adf077d1887919e9d8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -215,7 +215,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -217,7 +217,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
private String motd;
private int F;
private int G;
diff --git a/Spigot-Server-Patches/0417-Optimise-Chunk-getFluid.patch b/Spigot-Server-Patches/0417-Optimise-Chunk-getFluid.patch
index 8a93c47014..593c9aaac6 100644
--- a/Spigot-Server-Patches/0417-Optimise-Chunk-getFluid.patch
+++ b/Spigot-Server-Patches/0417-Optimise-Chunk-getFluid.patch
@@ -8,10 +8,10 @@ faster on its own, however removing the try catch makes it
easier to inline due to code size
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index 09d157bd2795b7e4374778cbd1e554de70f397bd..bd56cac7ce01942704d566c2cd8c1775fe643e25 100644
+index fc55e89260fdec2c5045e8f00e091191980ff1f2..bb2ff043f0d159fa18769c31b08683ee12037c58 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -424,17 +424,20 @@ public class Chunk implements IChunkAccess {
+@@ -431,17 +431,20 @@ public class Chunk implements IChunkAccess {
}
public Fluid a(int i, int j, int k) {
@@ -39,7 +39,7 @@ index 09d157bd2795b7e4374778cbd1e554de70f397bd..bd56cac7ce01942704d566c2cd8c1775
CrashReport crashreport = CrashReport.a(throwable, "Getting fluid state");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Block being got");
-@@ -443,6 +446,7 @@ public class Chunk implements IChunkAccess {
+@@ -450,6 +453,7 @@ public class Chunk implements IChunkAccess {
});
throw new ReportedException(crashreport);
}
diff --git a/Spigot-Server-Patches/0418-Optimise-TickListServer-by-rewriting-it.patch b/Spigot-Server-Patches/0418-Optimise-TickListServer-by-rewriting-it.patch
index ec933de0d8..88e22f5116 100644
--- a/Spigot-Server-Patches/0418-Optimise-TickListServer-by-rewriting-it.patch
+++ b/Spigot-Server-Patches/0418-Optimise-TickListServer-by-rewriting-it.patch
@@ -901,7 +901,7 @@ index 8c0aeb51f5e230fd6109e750732eb54559bc9637..1fb931d4c0720a5e496030e25c865771
return this.b(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ());
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
-index 2f172f38f817f48fe2e62235c3859b91e60bc0df..911b733d32400a6f963a20f10de3802e70dd8823 100644
+index 0c8864eeae6e3b449514f52d95c17f2e4a304f0e..a444f6214b90f7707be2265f4b2ab12632986c53 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -21,6 +21,7 @@ import net.minecraft.SystemUtils;
@@ -1072,10 +1072,18 @@ index 37b7dd82a227a88b720c13a813dd7e8caf803e03..8eb3084def3aa8776d32f8a3c942c95d
public String toString() {
return this.e + ": " + this.a + ", " + this.b + ", " + this.c + ", " + this.f;
diff --git a/src/main/java/net/minecraft/world/level/TickListChunk.java b/src/main/java/net/minecraft/world/level/TickListChunk.java
-index c3cb513d0d107ecb43e98960b25054626aa6a03f..d7f532388b65161f8dcced02aebba6b0615d57d1 100644
+index c3cb513d0d107ecb43e98960b25054626aa6a03f..fd293e11ec62a41a53c1e5238cb1219349d446d4 100644
--- a/src/main/java/net/minecraft/world/level/TickListChunk.java
+++ b/src/main/java/net/minecraft/world/level/TickListChunk.java
-@@ -61,6 +61,8 @@ public class TickListChunk<T> implements TickList<T> {
+@@ -9,6 +9,7 @@ import net.minecraft.core.BlockPosition;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.nbt.NBTTagList;
+ import net.minecraft.resources.MinecraftKey;
++import net.minecraft.server.MinecraftServer;
+
+ public class TickListChunk<T> implements TickList<T> {
+
+@@ -61,6 +62,8 @@ public class TickListChunk<T> implements TickList<T> {
return nbttaglist;
}
@@ -1084,7 +1092,7 @@ index c3cb513d0d107ecb43e98960b25054626aa6a03f..d7f532388b65161f8dcced02aebba6b0
public static <T> TickListChunk<T> a(NBTTagList nbttaglist, Function<T, MinecraftKey> function, Function<MinecraftKey, T> function1) {
List<TickListChunk.a<T>> list = Lists.newArrayList();
-@@ -71,7 +73,14 @@ public class TickListChunk<T> implements TickList<T> {
+@@ -71,7 +74,14 @@ public class TickListChunk<T> implements TickList<T> {
if (t0 != null) {
BlockPosition blockposition = new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z"));
diff --git a/Spigot-Server-Patches/0419-Pillager-patrol-spawn-settings-and-per-player-option.patch b/Spigot-Server-Patches/0419-Pillager-patrol-spawn-settings-and-per-player-option.patch
index 99eea71ef7..32a59081e4 100644
--- a/Spigot-Server-Patches/0419-Pillager-patrol-spawn-settings-and-per-player-option.patch
+++ b/Spigot-Server-Patches/0419-Pillager-patrol-spawn-settings-and-per-player-option.patch
@@ -60,10 +60,20 @@ index c1a694c4a773a41cdefca6b154711f7fc0a7fcaa..00d79ccf9c65acadc030ab1796cff459
return this.a(t0, Counter.DEFAULT);
}
diff --git a/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPatrol.java b/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPatrol.java
-index cba98adb7f2711fb97c7e4120d962f46a59682e7..d50377425088b98730684c82ae2c6e2fe5b2fd57 100644
+index cba98adb7f2711fb97c7e4120d962f46a59682e7..111c4c1fad2f1839a8c6b7c277cf801236ae1685 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPatrol.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPatrol.java
-@@ -20,13 +20,13 @@ import net.minecraft.world.level.block.state.IBlockData;
+@@ -3,7 +3,9 @@ package net.minecraft.world.level.levelgen;
+ import java.util.Random;
+ import net.minecraft.core.BlockPosition;
+ import net.minecraft.nbt.NBTTagCompound;
++import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.server.level.WorldServer;
++import net.minecraft.stats.StatisticList;
+ import net.minecraft.world.entity.EntityTypes;
+ import net.minecraft.world.entity.EnumMobSpawn;
+ import net.minecraft.world.entity.GroupDataEntity;
+@@ -20,13 +22,13 @@ import net.minecraft.world.level.block.state.IBlockData;
public class MobSpawnerPatrol implements MobSpawner {
@@ -79,7 +89,7 @@ index cba98adb7f2711fb97c7e4120d962f46a59682e7..d50377425088b98730684c82ae2c6e2f
if (!flag) {
return 0;
} else if (!worldserver.getGameRules().getBoolean(GameRules.DO_PATROL_SPAWNING)) {
-@@ -34,23 +34,51 @@ public class MobSpawnerPatrol implements MobSpawner {
+@@ -34,23 +36,51 @@ public class MobSpawnerPatrol implements MobSpawner {
} else {
Random random = worldserver.random;
diff --git a/Spigot-Server-Patches/0425-Optimize-Collision-to-not-load-chunks.patch b/Spigot-Server-Patches/0425-Optimize-Collision-to-not-load-chunks.patch
index fb11b1063a..96dd9daa1f 100644
--- a/Spigot-Server-Patches/0425-Optimize-Collision-to-not-load-chunks.patch
+++ b/Spigot-Server-Patches/0425-Optimize-Collision-to-not-load-chunks.patch
@@ -14,7 +14,7 @@ movement will load only the chunk the player enters anyways and avoids loading
massive amounts of surrounding chunks due to large AABB lookups.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 1f74fddfc6d9d9ae38fd35f83fa668e38591b222..f7a44104c09e4b2ebd5e1a3d7a08267c865c405d 100644
+index c5116a9c596074a33c98d29bb1e9cf22a8ad53bf..84c2bc0bac4f388094693859ab7b6ced5e315c27 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -61,6 +61,7 @@ import net.minecraft.server.ScoreboardServer;
@@ -42,7 +42,7 @@ index 1f74fddfc6d9d9ae38fd35f83fa668e38591b222..f7a44104c09e4b2ebd5e1a3d7a08267c
entityplayer1.setPosition(entityplayer1.locX(), entityplayer1.locY() + 1.0D, entityplayer1.locZ());
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 44886357da22f0e7f74b1739028ae0c7a81dd525..1824dac8f3015e4b86685374ad98b1650c319479 100644
+index f95aa9b4cc53c1e3258b7b32249ec1c3ef4ae2f1..7bce3722fb00194f5a913c0b9866b73cfc74611d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -169,6 +169,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -68,10 +68,20 @@ index fcf6cc86e3b5d9afe3ab3b3fba2ec13846ed0b4c..fcb3e2f9dea97138e0fd4cd2eb11b547
Stream<VoxelShape> c(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate<Entity> predicate);
diff --git a/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java b/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java
-index fa3421c9cd8531618827627e9c524a8df77c4c58..1fe6aba0884755be3382d38cebfdd1916bd9180e 100644
+index fa3421c9cd8531618827627e9c524a8df77c4c58..d0cc8677f2be422722160fee9b71894b5ddd3186 100644
--- a/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java
+++ b/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java
-@@ -21,13 +21,13 @@ import net.minecraft.world.phys.shapes.VoxelShapes;
+@@ -7,6 +7,9 @@ import java.util.function.Consumer;
+ import javax.annotation.Nullable;
+ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.CursorPosition;
++import net.minecraft.server.MCUtil;
++import net.minecraft.server.level.EntityPlayer;
++import net.minecraft.server.level.RegionLimitedWorldAccess;
+ import net.minecraft.util.MathHelper;
+ import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.level.block.Blocks;
+@@ -21,13 +24,13 @@ import net.minecraft.world.phys.shapes.VoxelShapes;
public class VoxelShapeSpliterator extends AbstractSpliterator<VoxelShape> {
@Nullable
@@ -88,7 +98,7 @@ index fa3421c9cd8531618827627e9c524a8df77c4c58..1fe6aba0884755be3382d38cebfdd191
private boolean h;
private final BiPredicate<IBlockData, BlockPosition> i;
-@@ -64,23 +64,37 @@ public class VoxelShapeSpliterator extends AbstractSpliterator<VoxelShape> {
+@@ -64,23 +67,37 @@ public class VoxelShapeSpliterator extends AbstractSpliterator<VoxelShape> {
boolean a(Consumer<? super VoxelShape> consumer) {
while (true) {
if (this.d.a()) {
diff --git a/Spigot-Server-Patches/0428-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch b/Spigot-Server-Patches/0428-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch
index 8c621b9dca..e7e8ed2c43 100644
--- a/Spigot-Server-Patches/0428-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch
+++ b/Spigot-Server-Patches/0428-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch
@@ -70,7 +70,7 @@ index 5a410550cfb48505c9de9979465ed1528c8fbf05..9edbde8299bcd127e1727d34ed441f63
List<PlayerChunk> allChunks = new ArrayList<>(visibleChunks.values());
List<EntityPlayer> players = world.players;
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
-index 911b733d32400a6f963a20f10de3802e70dd8823..af6309899dcb4fe09b765bf1073e482d16b0fb24 100644
+index a444f6214b90f7707be2265f4b2ab12632986c53..138676e5b03bc80a777a1f4c12f3f4b5316e8dea 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -780,7 +780,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -243,7 +243,7 @@ index 12cfe9f3c89316557e94c8b944b4f82277fb8877..8050be2ed04fb0b8141f92595680407b
while (objectbidirectionaliterator.hasNext()) {
Entry<PlayerChunk> entry = (Entry) objectbidirectionaliterator.next();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index cc15f27759771c0d839dcc7118ed898cf3617619..da3c7aaf6c2732450ac365c11a1fd7b70db0513d 100644
+index 2d142699ebe2062947ba3eb228aaad4468c11371..adcb2bd279f1f87d174556cb1b8aac497c11d7d3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -294,6 +294,7 @@ public class CraftWorld implements World {
@@ -285,7 +285,7 @@ index cc15f27759771c0d839dcc7118ed898cf3617619..da3c7aaf6c2732450ac365c11a1fd7b7
+ if (Thread.currentThread() != world.getMinecraftWorld().serverThread) {
+ synchronized (world.getChunkProvider().playerChunkMap.visibleChunks) {
+ Long2ObjectLinkedOpenHashMap<PlayerChunk> chunks = world.getChunkProvider().playerChunkMap.visibleChunks;
-+ return chunks.values().stream().map(PlayerChunk::getFullChunk).filter(Objects::nonNull).map(net.minecraft.server.Chunk::getBukkitChunk).toArray(Chunk[]::new);
++ return chunks.values().stream().map(PlayerChunk::getFullChunk).filter(Objects::nonNull).map(net.minecraft.world.level.chunk.Chunk::getBukkitChunk).toArray(Chunk[]::new);
+ }
+ }
+ // Paper end
diff --git a/Spigot-Server-Patches/0429-Increase-Light-Queue-Size.patch b/Spigot-Server-Patches/0429-Increase-Light-Queue-Size.patch
index 24363b1b20..021753fb90 100644
--- a/Spigot-Server-Patches/0429-Increase-Light-Queue-Size.patch
+++ b/Spigot-Server-Patches/0429-Increase-Light-Queue-Size.patch
@@ -28,10 +28,10 @@ index 6c8e9d498c9a30a1aa88494ba09c3cae012a8fa1..cd248eb6be663e8be33f2c3c6b06b77b
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 928a801493003e3ab034f65ac501f5b7e1cb6c75..dcd5a3ec07e2269cb86e7feb706b738bcf1abe56 100644
+index 039c76a07bae4eec407e06adf077d1887919e9d8..2d3da64041849fed4a28204c6aaf3a1c8a8aa905 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -764,7 +764,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -766,7 +766,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.executeModerately();
// CraftBukkit end
worldloadlistener.b();
diff --git a/Spigot-Server-Patches/0430-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch b/Spigot-Server-Patches/0430-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch
index ef557b85ca..ca67ac4ff7 100644
--- a/Spigot-Server-Patches/0430-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch
+++ b/Spigot-Server-Patches/0430-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch
@@ -56,10 +56,10 @@ index da93d38fe63035e4ff198ada84a4431f52d97c01..ddbc8cb712c50038922eded75dd6ca85
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index dcd5a3ec07e2269cb86e7feb706b738bcf1abe56..cbec7410fcbd81bc0958bb3e94d0beacd392e46b 100644
+index 2d3da64041849fed4a28204c6aaf3a1c8a8aa905..fd07b682bec1bb534f42350ef95c7da7191b027e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1044,6 +1044,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1046,6 +1046,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// Paper end
tickSection = curTime;
}
@@ -67,7 +67,7 @@ index dcd5a3ec07e2269cb86e7feb706b738bcf1abe56..cbec7410fcbd81bc0958bb3e94d0beac
// Spigot end
//MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
-@@ -1113,7 +1114,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1115,7 +1116,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
@@ -76,7 +76,7 @@ index dcd5a3ec07e2269cb86e7feb706b738bcf1abe56..cbec7410fcbd81bc0958bb3e94d0beac
// CraftBukkit start
if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken
return this.forceTicks || this.isEntered() || SystemUtils.getMonotonicMillis() < (this.X ? this.W : this.nextTick);
-@@ -1143,6 +1144,23 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1145,6 +1146,23 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
});
}
@@ -100,7 +100,7 @@ index dcd5a3ec07e2269cb86e7feb706b738bcf1abe56..cbec7410fcbd81bc0958bb3e94d0beac
@Override
public TickTask postToMainThread(Runnable runnable) {
return new TickTask(this.ticks, runnable);
-@@ -1229,6 +1247,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1231,6 +1249,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// Paper start - move oversleep into full server tick
isOversleep = true;MinecraftTimings.serverOversleep.startTiming();
this.awaitTasks(() -> {
@@ -108,7 +108,7 @@ index dcd5a3ec07e2269cb86e7feb706b738bcf1abe56..cbec7410fcbd81bc0958bb3e94d0beac
return !this.canOversleep();
});
isOversleep = false;MinecraftTimings.serverOversleep.stopTiming();
-@@ -1307,13 +1326,16 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1309,13 +1328,16 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
protected void b(BooleanSupplier booleansupplier) {
@@ -125,7 +125,7 @@ index dcd5a3ec07e2269cb86e7feb706b738bcf1abe56..cbec7410fcbd81bc0958bb3e94d0beac
this.methodProfiler.exitEnter("levels");
Iterator iterator = this.getWorlds().iterator();
-@@ -1324,7 +1346,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1326,7 +1348,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
processQueue.remove().run();
}
MinecraftTimings.processQueueTimer.stopTiming(); // Spigot
@@ -134,7 +134,7 @@ index dcd5a3ec07e2269cb86e7feb706b738bcf1abe56..cbec7410fcbd81bc0958bb3e94d0beac
MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
// Send time updates to everyone, it will get the right time from the world the player is in.
// Paper start - optimize time updates
-@@ -1366,9 +1388,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1368,9 +1390,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.methodProfiler.enter("tick");
try {
@@ -147,7 +147,7 @@ index dcd5a3ec07e2269cb86e7feb706b738bcf1abe56..cbec7410fcbd81bc0958bb3e94d0beac
// Spigot Start
CrashReport crashreport;
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
-index af6309899dcb4fe09b765bf1073e482d16b0fb24..08e7b20d3ad3a02cab74864cce6fd2a31d80fe59 100644
+index 138676e5b03bc80a777a1f4c12f3f4b5316e8dea..99108d2c8145c16943fb29872c55d8e74f75eb77 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -22,6 +22,7 @@ import net.minecraft.core.BlockPosition;
diff --git a/Spigot-Server-Patches/0432-Add-tick-times-API-and-mspt-command.patch b/Spigot-Server-Patches/0432-Add-tick-times-API-and-mspt-command.patch
index 612e6729c9..4624d22dab 100644
--- a/Spigot-Server-Patches/0432-Add-tick-times-API-and-mspt-command.patch
+++ b/Spigot-Server-Patches/0432-Add-tick-times-API-and-mspt-command.patch
@@ -87,10 +87,10 @@ index ddbc8cb712c50038922eded75dd6ca85fe851078..78271b400c79578d043b20a5389a37b1
version = getInt("config-version", 20);
set("config-version", 20);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index cbec7410fcbd81bc0958bb3e94d0beacd392e46b..88679e7fa760e242c81466f90950d1f6f088e294 100644
+index fd07b682bec1bb534f42350ef95c7da7191b027e..ed5712cc7c070f44500e5c1a1d41cd26bdd13fec 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -216,6 +216,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -218,6 +218,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
private int F;
private int G;
public final long[] h; public long[] getTickTimes() { return h; } // Paper - OBFHELPER
@@ -102,7 +102,7 @@ index cbec7410fcbd81bc0958bb3e94d0beacd392e46b..88679e7fa760e242c81466f90950d1f6
@Nullable
private KeyPair H;
@Nullable
-@@ -1318,6 +1323,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1320,6 +1325,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.ag = this.ag * 0.8F + (float) l / 1000000.0F * 0.19999999F;
long i1 = SystemUtils.getMonotonicNanos();
@@ -115,7 +115,7 @@ index cbec7410fcbd81bc0958bb3e94d0beacd392e46b..88679e7fa760e242c81466f90950d1f6
this.circularTimer.a(i1 - i);
this.methodProfiler.exit();
org.spigotmc.WatchdogThread.tick(); // Spigot
-@@ -2290,4 +2301,30 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -2292,4 +2303,30 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public ITextFilter a(EntityPlayer entityplayer) {
return null;
}
diff --git a/Spigot-Server-Patches/0437-Async-command-map-building.patch b/Spigot-Server-Patches/0437-Async-command-map-building.patch
index 98feab5870..463fac0fc7 100644
--- a/Spigot-Server-Patches/0437-Async-command-map-building.patch
+++ b/Spigot-Server-Patches/0437-Async-command-map-building.patch
@@ -5,10 +5,18 @@ Subject: [PATCH] Async command map building
diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java
-index ddbd4c43bbe6d6a5b90f4958c4be80520a40beab..ca33ec8da544272ecf708b0cc1b0123eabc48a8b 100644
+index ddbd4c43bbe6d6a5b90f4958c4be80520a40beab..c97424b401147be53ffa7e2a2a3271d696752efe 100644
--- a/src/main/java/net/minecraft/commands/CommandDispatcher.java
+++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java
-@@ -327,6 +327,14 @@ public class CommandDispatcher {
+@@ -29,6 +29,7 @@ import net.minecraft.network.chat.ChatHoverable;
+ import net.minecraft.network.chat.ChatMessage;
+ import net.minecraft.network.chat.IChatMutableComponent;
+ import net.minecraft.network.protocol.game.PacketPlayOutCommands;
++import net.minecraft.server.MinecraftServer;
+ import net.minecraft.server.commands.CommandAdvancement;
+ import net.minecraft.server.commands.CommandAttribute;
+ import net.minecraft.server.commands.CommandBan;
+@@ -327,6 +328,14 @@ public class CommandDispatcher {
if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot
// CraftBukkit start
// Register Vanilla commands into builtRoot as before
@@ -23,7 +31,7 @@ index ddbd4c43bbe6d6a5b90f4958c4be80520a40beab..ca33ec8da544272ecf708b0cc1b0123e
Map<CommandNode<CommandListenerWrapper>, CommandNode<ICompletionProvider>> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues
RootCommandNode vanillaRoot = new RootCommandNode();
-@@ -344,7 +352,14 @@ public class CommandDispatcher {
+@@ -344,7 +353,14 @@ public class CommandDispatcher {
for (CommandNode node : rootcommandnode.getChildren()) {
bukkit.add(node.getName());
}
diff --git a/Spigot-Server-Patches/0438-Improved-Watchdog-Support.patch b/Spigot-Server-Patches/0438-Improved-Watchdog-Support.patch
index dba5021931..3ddd0d36c4 100644
--- a/Spigot-Server-Patches/0438-Improved-Watchdog-Support.patch
+++ b/Spigot-Server-Patches/0438-Improved-Watchdog-Support.patch
@@ -83,10 +83,10 @@ index 397194b3e90c9df39cfae17b401c7ac891b0dbb7..61b4c42e95994343772a91640b243b8e
a(SystemUtils.e);
a(SystemUtils.f);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 88679e7fa760e242c81466f90950d1f6f088e294..2ab3b3d42e08f7594361ab3a7354486aff0878ab 100644
+index ed5712cc7c070f44500e5c1a1d41cd26bdd13fec..fe3fe04981a0cc1ddeac2e030ee754baae4e8409 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -268,7 +268,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -270,7 +270,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public int autosavePeriod;
public boolean serverAutoSave = false; // Paper
public CommandDispatcher vanillaCommandDispatcher;
@@ -95,7 +95,7 @@ index 88679e7fa760e242c81466f90950d1f6f088e294..2ab3b3d42e08f7594361ab3a7354486a
// CraftBukkit end
// Spigot start
public static final int TPS = 20;
-@@ -278,6 +278,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -280,6 +280,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant();
// Spigot end
@@ -104,7 +104,7 @@ index 88679e7fa760e242c81466f90950d1f6f088e294..2ab3b3d42e08f7594361ab3a7354486a
public static <S extends MinecraftServer> S a(Function<Thread, S> function) {
AtomicReference<S> atomicreference = new AtomicReference();
Thread thread = new Thread(() -> {
-@@ -840,6 +842,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -842,6 +844,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// CraftBukkit start
private boolean hasStopped = false;
@@ -112,7 +112,7 @@ index 88679e7fa760e242c81466f90950d1f6f088e294..2ab3b3d42e08f7594361ab3a7354486a
private final Object stopLock = new Object();
public final boolean hasStopped() {
synchronized (stopLock) {
-@@ -854,6 +857,23 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -856,6 +859,23 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
if (hasStopped) return;
hasStopped = true;
}
@@ -136,7 +136,7 @@ index 88679e7fa760e242c81466f90950d1f6f088e294..2ab3b3d42e08f7594361ab3a7354486a
// CraftBukkit end
MinecraftServer.LOGGER.info("Stopping server");
MinecraftTimings.stopServer(); // Paper
-@@ -919,7 +939,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -921,7 +941,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.getUserCache().b(false); // Paper
}
// Spigot end
@@ -155,7 +155,7 @@ index 88679e7fa760e242c81466f90950d1f6f088e294..2ab3b3d42e08f7594361ab3a7354486a
}
public String getServerIp() {
-@@ -1012,6 +1043,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1014,6 +1045,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
protected void w() {
try {
@@ -163,7 +163,7 @@ index 88679e7fa760e242c81466f90950d1f6f088e294..2ab3b3d42e08f7594361ab3a7354486a
if (this.init()) {
this.nextTick = SystemUtils.getMonotonicMillis();
this.serverPing.setMOTD(new ChatComponentText(this.motd));
-@@ -1019,6 +1051,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1021,6 +1053,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.a(this.serverPing);
// Spigot start
@@ -182,7 +182,7 @@ index 88679e7fa760e242c81466f90950d1f6f088e294..2ab3b3d42e08f7594361ab3a7354486a
org.spigotmc.WatchdogThread.hasStarted = true; // Paper
Arrays.fill( recentTps, 20 );
long start = System.nanoTime(), curTime, tickSection = start; // Paper - Further improve server tick loop
-@@ -1074,6 +1118,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1076,6 +1120,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.a((CrashReport) null);
}
} catch (Throwable throwable) {
@@ -195,7 +195,7 @@ index 88679e7fa760e242c81466f90950d1f6f088e294..2ab3b3d42e08f7594361ab3a7354486a
MinecraftServer.LOGGER.error("Encountered an unexpected exception", throwable);
// Spigot Start
if ( throwable.getCause() != null )
-@@ -1105,14 +1155,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1107,14 +1157,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
} catch (Throwable throwable1) {
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
} finally {
@@ -213,7 +213,7 @@ index 88679e7fa760e242c81466f90950d1f6f088e294..2ab3b3d42e08f7594361ab3a7354486a
}
}
-@@ -1168,6 +1218,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1170,6 +1220,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@Override
public TickTask postToMainThread(Runnable runnable) {
@@ -226,7 +226,7 @@ index 88679e7fa760e242c81466f90950d1f6f088e294..2ab3b3d42e08f7594361ab3a7354486a
return new TickTask(this.ticks, runnable);
}
-@@ -1410,6 +1466,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1412,6 +1468,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
try {
crashreport = CrashReport.a(throwable, "Exception ticking world");
} catch (Throwable t) {
@@ -234,7 +234,7 @@ index 88679e7fa760e242c81466f90950d1f6f088e294..2ab3b3d42e08f7594361ab3a7354486a
throw new RuntimeException("Error generating crash report", t);
}
// Spigot End
-@@ -1867,7 +1924,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1869,7 +1926,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.resourcePackRepository.a(collection);
this.saveData.a(a(this.resourcePackRepository));
datapackresources.i();
@@ -300,7 +300,7 @@ index c69eef0d523fc75dce2c2606f3e447591c7cf6dc..da3614a4a59884e7cbc8758cfdad9698
List<java.lang.Runnable> afterEntityTickingTasks = Lists.newArrayList();
public void doIfNotEntityTicking(java.lang.Runnable run) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index d6a6321e936ce803a3e52e7420ba2bcd096f4649..f58dd78e5984ace42ccd6121a5836fed29b82af0 100644
+index f35825d4a8574ea75b46be36b9929f8e12405217..48d4f8310d79d0eb78f4ace42c8778ee4addf7d0 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -507,7 +507,7 @@ public abstract class PlayerList {
diff --git a/Spigot-Server-Patches/0439-Optimize-Pathfinding.patch b/Spigot-Server-Patches/0439-Optimize-Pathfinding.patch
index 851493eac5..812fed5f72 100644
--- a/Spigot-Server-Patches/0439-Optimize-Pathfinding.patch
+++ b/Spigot-Server-Patches/0439-Optimize-Pathfinding.patch
@@ -7,10 +7,18 @@ Prevents pathfinding from spamming failures for things such as
arrow attacks.
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
-index ab469f1698b4f0e36c0d077472f1adea36f95ce9..795224a31142bebbe1b62ae00c3c098617e21f6c 100644
+index 06d05b511d623d0247d44989bee85b383a8fb52f..e6ba9b7fbf08ae0dd083a1ebee8eb7ed8a937751 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
-@@ -31,7 +31,7 @@ public abstract class NavigationAbstract {
+@@ -11,6 +11,7 @@ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.IPosition;
+ import net.minecraft.network.protocol.game.PacketDebug;
+ import net.minecraft.server.MCUtil;
++import net.minecraft.server.MinecraftServer;
+ import net.minecraft.util.MathHelper;
+ import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.entity.EntityInsentient;
+@@ -32,7 +33,7 @@ public abstract class NavigationAbstract {
protected final EntityInsentient a; public Entity getEntity() { return a; } // Paper - OBFHELPER
protected final World b;
@Nullable
@@ -19,7 +27,7 @@ index ab469f1698b4f0e36c0d077472f1adea36f95ce9..795224a31142bebbe1b62ae00c3c0986
protected double d;
protected int e;
protected int f;
-@@ -183,10 +183,30 @@ public abstract class NavigationAbstract {
+@@ -184,10 +185,30 @@ public abstract class NavigationAbstract {
return this.a(this.a(d0, d1, d2, 1), d3);
}
diff --git a/Spigot-Server-Patches/0443-Prevent-opening-inventories-when-frozen.patch b/Spigot-Server-Patches/0443-Prevent-opening-inventories-when-frozen.patch
index d71e7b136c..d4d450f2ed 100644
--- a/Spigot-Server-Patches/0443-Prevent-opening-inventories-when-frozen.patch
+++ b/Spigot-Server-Patches/0443-Prevent-opening-inventories-when-frozen.patch
@@ -36,10 +36,10 @@ index 8371d5ac694f469804ad55669fdedb8b3fc627bd..320be04d9e3284d728adb2df9da7edb6
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-index 2ca9d061ec951fb0563959620f0e99590e3038af..35ede7760ee5f0b28f9b52443f663498f8a21c0c 100644
+index e8f8a07f256e01c5792199bf47f3cc1f0f3d1610..5b142e96248278c6bb6068879bb5ad1578b0f79f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-@@ -321,7 +321,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
+@@ -322,7 +322,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
if (adventure$title == null) adventure$title = io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(container.getBukkitView().getTitle()); // Paper
//player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, windowType, CraftChatMessage.fromString(title)[0])); // Paper // Paper - comment
@@ -48,7 +48,7 @@ index 2ca9d061ec951fb0563959620f0e99590e3038af..35ede7760ee5f0b28f9b52443f663498
getHandle().activeContainer = container;
getHandle().activeContainer.addSlotListener(player);
}
-@@ -395,7 +395,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
+@@ -396,7 +396,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
net.kyori.adventure.text.Component adventure$title = inventory.title(); // Paper
if (adventure$title == null) adventure$title = io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(inventory.getTitle()); // Paper
//player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, windowType, CraftChatMessage.fromString(title)[0])); // Paper - comment
diff --git a/Spigot-Server-Patches/0448-Implement-Player-Client-Options-API.patch b/Spigot-Server-Patches/0448-Implement-Player-Client-Options-API.patch
index 488dd3e5f0..dc34ab15b2 100644
--- a/Spigot-Server-Patches/0448-Implement-Player-Client-Options-API.patch
+++ b/Spigot-Server-Patches/0448-Implement-Player-Client-Options-API.patch
@@ -149,7 +149,7 @@ index 8981dfacd10cae9de052e1b36ce5181cd0e6752d..202fa94d5dc55b549475ae0309bbcfca
protected static final DataWatcherObject<NBTTagCompound> bk = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
protected static final DataWatcherObject<NBTTagCompound> bl = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 78310e4a1fe4fd240350963c80463687b209d37b..f512a78c1fee21e90dfbb3af2ebbeeb89ae6b8f1 100644
+index 43e4ade73619d430be7ee93687e98ef5a27cb329..7a240739ac6e043e590b380659d8e6d794954f84 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1,5 +1,8 @@
@@ -161,7 +161,7 @@ index 78310e4a1fe4fd240350963c80463687b209d37b..f512a78c1fee21e90dfbb3af2ebbeeb8
import com.destroystokyo.paper.Title;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet;
-@@ -2245,6 +2248,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2250,6 +2253,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setViewDistance(int viewDistance) {
throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
}
diff --git a/Spigot-Server-Patches/0453-Load-Chunks-for-Login-Asynchronously.patch b/Spigot-Server-Patches/0453-Load-Chunks-for-Login-Asynchronously.patch
index edc3a56b8d..991108f14b 100644
--- a/Spigot-Server-Patches/0453-Load-Chunks-for-Login-Asynchronously.patch
+++ b/Spigot-Server-Patches/0453-Load-Chunks-for-Login-Asynchronously.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Load Chunks for Login Asynchronously
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
-index 612a05f493981f9fb22522da4f3a5379bce4b786..bc642671292a753484e47f87bef4eee724353f07 100644
+index 6e5d21af43261dc2f12ceec7b7e3269be635cf7a..ecf4cd6dfea777ab9daea0b40724d247df7ddb53 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -629,7 +629,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -37,6 +37,19 @@ index eaeac60b2d54d8e7d298ea412d888471a7ea9e79..2ca9335129465ffb67617b42534db530
public Integer clientViewDistance;
// CraftBukkit end
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
+diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+index 94860c06717e8dcf969277562e88687e9a99aaa4..e5d94dedc88e8bbcf8d9517dfb5c6ec6f62de5aa 100644
+--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+@@ -147,7 +147,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+ private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxWorldGen;
+ private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxMain;
+ public final WorldLoadListener worldLoadListener;
+- public final PlayerChunkMap.a chunkDistanceManager;
++ public final PlayerChunkMap.a chunkDistanceManager; public final ChunkMapDistance getChunkDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER
+ private final AtomicInteger u;
+ public final DefinedStructureManager definedStructureManager; // Paper - private -> public
+ private final File w;
diff --git a/src/main/java/net/minecraft/server/level/TicketType.java b/src/main/java/net/minecraft/server/level/TicketType.java
index 218dc900e125a11548485887b1918742072c7a77..2c932d36f982e7f8713aabff9a6c631055810366 100644
--- a/src/main/java/net/minecraft/server/level/TicketType.java
@@ -109,7 +122,7 @@ index 3285a4248a7c5352454a64c6a84658f585932548..6a0e3bd8641c895decd83b80e3a715ea
this.minecraftServer.getMethodProfiler().enter("keepAlive");
// Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index c9a8e5c04a10c28ce79368a783dfe3c8e3709583..b5a1f2ca1ad1e48ee61df394ef01e1bee768aea7 100644
+index 7305bba223229d9aa5315a8dff5fdc5af8faba6a..70b3a7c8c4bd817be9c4dfaee71ec22a42620e11 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -41,6 +41,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutEntityStatus;
@@ -174,7 +187,7 @@ index c9a8e5c04a10c28ce79368a783dfe3c8e3709583..b5a1f2ca1ad1e48ee61df394ef01e1be
+ int chunkZ = loc.getBlockZ() >> 4;
+ final ChunkCoordIntPair pos = new ChunkCoordIntPair(chunkX, chunkZ);
+ PlayerChunkMap playerChunkMap = worldserver1.getChunkProvider().playerChunkMap;
-+ playerChunkMap.chunkDistanceManager.addTicketAtLevel(TicketType.LOGIN, pos, 31, pos.pair());
++ playerChunkMap.getChunkDistanceManager().addTicketAtLevel(TicketType.LOGIN, pos, 31, pos.pair());
+ worldserver1.getChunkProvider().tickDistanceManager();
+ worldserver1.getChunkProvider().getChunkAtAsynchronously(chunkX, chunkZ, true, true).thenApply(chunk -> {
+ PlayerChunk updatingChunk = playerChunkMap.getUpdatingChunk(pos.pair());
@@ -271,7 +284,7 @@ index c9a8e5c04a10c28ce79368a783dfe3c8e3709583..b5a1f2ca1ad1e48ee61df394ef01e1be
Iterator iterator = list.iterator();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 1824dac8f3015e4b86685374ad98b1650c319479..c7786e8d100cb872b10664b9c16de332ada3e3fe 100644
+index 7bce3722fb00194f5a913c0b9866b73cfc74611d..8ca7012264528f17ac2e4f15ced96c774fa566d7 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1372,7 +1372,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
diff --git a/Spigot-Server-Patches/0458-Add-phantom-creative-and-insomniac-controls.patch b/Spigot-Server-Patches/0458-Add-phantom-creative-and-insomniac-controls.patch
index 8c1972d3fb..68c8e2168d 100644
--- a/Spigot-Server-Patches/0458-Add-phantom-creative-and-insomniac-controls.patch
+++ b/Spigot-Server-Patches/0458-Add-phantom-creative-and-insomniac-controls.patch
@@ -21,10 +21,20 @@ index cd248eb6be663e8be33f2c3c6b06b77b6d5753a4..46ac6d91422423f1e03b86d3efa3241f
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/IEntitySelector.java b/src/main/java/net/minecraft/world/entity/IEntitySelector.java
-index 1a6f8aec32af85717f5d56e0b00a02cda88ce028..88ed99d0d08fb5f3fee605f8ed00004b466633bf 100644
+index 1a6f8aec32af85717f5d56e0b00a02cda88ce028..c8d7ea8cfa4945af4a6675172b931a4cc3ca2801 100644
--- a/src/main/java/net/minecraft/world/entity/IEntitySelector.java
+++ b/src/main/java/net/minecraft/world/entity/IEntitySelector.java
-@@ -31,6 +31,7 @@ public final class IEntitySelector {
+@@ -3,6 +3,9 @@ package net.minecraft.world.entity;
+ import com.google.common.base.Predicates;
+ import java.util.function.Predicate;
+ import javax.annotation.Nullable;
++import net.minecraft.server.level.EntityPlayer;
++import net.minecraft.stats.StatisticList;
++import net.minecraft.util.MathHelper;
+ import net.minecraft.world.EnumDifficulty;
+ import net.minecraft.world.IInventory;
+ import net.minecraft.world.entity.player.EntityHuman;
+@@ -31,6 +34,7 @@ public final class IEntitySelector {
public static final Predicate<Entity> g = (entity) -> {
return !entity.isSpectator();
};
@@ -33,10 +43,10 @@ index 1a6f8aec32af85717f5d56e0b00a02cda88ce028..88ed99d0d08fb5f3fee605f8ed00004b
// Paper start
public static final Predicate<Entity> affectsSpawning = (entity) -> {
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java
-index bdb0a9541b4f167b95578034ec15e7051a7721be..93ea08af4fa221521ae89eaccefac0e3d50f6f5e 100644
+index 6c498d4345df35a411d155799ac56e47c9c48114..42cf3fa42b73739182d26fbb524ee5b304c799b2 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java
-@@ -261,6 +261,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
+@@ -262,6 +262,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
EntityHuman entityhuman = (EntityHuman) iterator.next();
if (EntityPhantom.this.a((EntityLiving) entityhuman, PathfinderTargetCondition.a)) {
@@ -45,10 +55,10 @@ index bdb0a9541b4f167b95578034ec15e7051a7721be..93ea08af4fa221521ae89eaccefac0e3
return true;
}
diff --git a/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java b/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java
-index afbcabca5180e26e85af820ad4ca2de1163b55a1..24299fab240ae5dfae4ba13c9e98760f9eda634e 100644
+index 96a5a6569387a25b15a06aaab3bd9d033547e875..e4f5e570636862481aac92ec9b74d6cf5723eb6e 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java
-@@ -52,7 +52,7 @@ public class MobSpawnerPhantom implements MobSpawner {
+@@ -53,7 +53,7 @@ public class MobSpawnerPhantom implements MobSpawner {
while (iterator.hasNext()) {
EntityHuman entityhuman = (EntityHuman) iterator.next();
diff --git a/Spigot-Server-Patches/0460-Implement-Brigadier-Mojang-API.patch b/Spigot-Server-Patches/0460-Implement-Brigadier-Mojang-API.patch
index 08911b53c7..8f34e27183 100644
--- a/Spigot-Server-Patches/0460-Implement-Brigadier-Mojang-API.patch
+++ b/Spigot-Server-Patches/0460-Implement-Brigadier-Mojang-API.patch
@@ -10,10 +10,10 @@ Adds CommandRegisteredEvent
- Allows manipulating the CommandNode to add more children/metadata for the client
diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java
-index ca33ec8da544272ecf708b0cc1b0123eabc48a8b..77d3712390125601d964519c3df9928ea3a7caf0 100644
+index c97424b401147be53ffa7e2a2a3271d696752efe..07d3dec9f613013aac72f3f5db17089ebe5ee770 100644
--- a/src/main/java/net/minecraft/commands/CommandDispatcher.java
+++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java
-@@ -353,6 +353,7 @@ public class CommandDispatcher {
+@@ -354,6 +354,7 @@ public class CommandDispatcher {
bukkit.add(node.getName());
}
// Paper start - Async command map building
@@ -21,7 +21,7 @@ index ca33ec8da544272ecf708b0cc1b0123eabc48a8b..77d3712390125601d964519c3df9928e
MinecraftServer.getServer().execute(() -> {
runSync(entityplayer, bukkit, rootcommandnode);
});
-@@ -360,6 +361,7 @@ public class CommandDispatcher {
+@@ -361,6 +362,7 @@ public class CommandDispatcher {
private void runSync(EntityPlayer entityplayer, Collection<String> bukkit, RootCommandNode<ICompletionProvider> rootcommandnode) {
// Paper end - Async command map building
@@ -69,7 +69,7 @@ index eb2c9d2248a8647beee9960c5016a83f35aa1247..b5ee789c8dfb7f413ab60902ff3d2ef0
public boolean hasPermission(int i) {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
-index 8bfc26eb12cc5523c64a210383c9156aef6883b3..de0d37044911b50a91f82d4064520e2ba97ff4fd 100644
+index 6a0e3bd8641c895decd83b80e3a715ea31a5cce7..839eb6a294a696c5abd0d5e005b70d9bdbf25f9b 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -768,8 +768,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
diff --git a/Spigot-Server-Patches/0461-Villager-Restocks-API.patch b/Spigot-Server-Patches/0461-Villager-Restocks-API.patch
index 4ae5b26c3b..07a9844dc0 100644
--- a/Spigot-Server-Patches/0461-Villager-Restocks-API.patch
+++ b/Spigot-Server-Patches/0461-Villager-Restocks-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Villager Restocks API
diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
-index 02dbb98a1b211d6b3184405ec81f6f58fcef79f3..035b5320d1246d60000ce4d0dbcde11cb9faa634 100644
+index 07f87ee8f5df9d7a40001dd28f50457344308a03..c37dd836c284ed8beac6699ec4f5f91886cf3f63 100644
--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
-@@ -112,7 +112,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
+@@ -113,7 +113,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
private long bA;
private int bB;
private long bC;
diff --git a/Spigot-Server-Patches/0466-Implement-Mob-Goal-API.patch b/Spigot-Server-Patches/0466-Implement-Mob-Goal-API.patch
index 3e78756a26..dd71899d3e 100644
--- a/Spigot-Server-Patches/0466-Implement-Mob-Goal-API.patch
+++ b/Spigot-Server-Patches/0466-Implement-Mob-Goal-API.patch
@@ -1060,15 +1060,14 @@ index 96652862531301c08aefa0baa79b1258b5b307ec..3014a5d71de98009bdc121ba690c3653
}
diff --git a/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java b/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java
new file mode 100644
-index 0000000000000000000000000000000000000000..232c382b586b0812c9f7161565c0d382177adf7d
+index 0000000000000000000000000000000000000000..a75276b93f3f84672224b5c314a60aad8baf0cac
--- /dev/null
+++ b/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java
-@@ -0,0 +1,103 @@
+@@ -0,0 +1,102 @@
+package com.destroystokyo.paper.entity.ai;
+
-+import net.minecraft.server.EntityInsentient;
-+import net.minecraft.server.PathfinderGoal;
-+
++import net.minecraft.world.entity.EntityInsentient;
++import net.minecraft.world.entity.ai.goal.PathfinderGoal;
+import org.junit.Assert;
+import org.junit.Test;
+
diff --git a/Spigot-Server-Patches/0467-Use-distance-map-to-optimise-entity-tracker.patch b/Spigot-Server-Patches/0467-Use-distance-map-to-optimise-entity-tracker.patch
index 4e5c3ad53e..e68fbaeca5 100644
--- a/Spigot-Server-Patches/0467-Use-distance-map-to-optimise-entity-tracker.patch
+++ b/Spigot-Server-Patches/0467-Use-distance-map-to-optimise-entity-tracker.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Use distance map to optimise entity tracker
Use the distance map to find candidate players for tracking.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 2ab3b3d42e08f7594361ab3a7354486aff0878ab..40b52ed64428f59173ee8af4046c1e8d926fcdd5 100644
+index fe3fe04981a0cc1ddeac2e030ee754baae4e8409..580e08347d06e6b4b9558b3f25f1f095c41fcf91 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1640,6 +1640,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1642,6 +1642,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
}
@@ -30,7 +30,7 @@ index bcc1103e21cc10d5b405a2b89f3dfe78eda271bd..4c82266656d0a60a166faa082a9aaaae
List<Entity> list = this.tracker.getPassengers();
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
-index 1b309682b58a2ef52b973181aefb0136f1aa3e80..3e5c3d33a2d031915305abd37d1ba6e1ebfd089e 100644
+index 042a6beb8cada116d54bed18181de291bf5ed1bb..c30ec3ad68fc10d01d0b3dd1feea32f08c19ab1c 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
@@ -61,6 +61,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutMapChunk;
@@ -316,7 +316,7 @@ index 1b309682b58a2ef52b973181aefb0136f1aa3e80..3e5c3d33a2d031915305abd37d1ba6e1
}
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index b57888b2b53a8cf6d1e8af0f6e779bbcf748cd61..8a1a7a465f007109f8e3b5359cac8ea9d9673049 100644
+index cb5c93dca3b947462b89f79c60c7562085684b87..da2b5bfd3966ded2d5dde0d65646583576a088c5 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -46,6 +46,7 @@ import net.minecraft.network.syncher.DataWatcherObject;
diff --git a/Spigot-Server-Patches/0470-No-Tick-view-distance-implementation.patch b/Spigot-Server-Patches/0470-No-Tick-view-distance-implementation.patch
index 47baa4de4e..deb8894e5a 100644
--- a/Spigot-Server-Patches/0470-No-Tick-view-distance-implementation.patch
+++ b/Spigot-Server-Patches/0470-No-Tick-view-distance-implementation.patch
@@ -179,7 +179,7 @@ index 25484cac9c62e49de39fbbf506fcb3edc4ba6e65..1f6333c2c26ad04e23d2881235ed1dcf
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> a(ChunkStatus chunkstatus, PlayerChunkMap playerchunkmap) {
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
-index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79557d6780 100644
+index 3c49ca30959204840a656c1a44de50a60ea1c7df..762598b1dc8c6fb4beaad01e5777d0a950845eaf 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
@@ -60,9 +60,11 @@ import net.minecraft.network.protocol.game.PacketPlayOutLightUpdate;
@@ -194,16 +194,22 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
import net.minecraft.util.CSVWriter;
import net.minecraft.util.EntitySlice;
import net.minecraft.util.MathHelper;
-@@ -146,7 +148,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -146,7 +148,13 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
private boolean updatingChunksModified;
private final ChunkTaskQueueSorter p;
private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxWorldGen;
- private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxMain;
-+ final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxMain; // Paper - private -> package private
++ public final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxMain; // Paper - private -> public
++ // Paper start
++ final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxLight;
++ public void addLightTask(PlayerChunk playerchunk, Runnable run) {
++ this.mailboxLight.a(ChunkTaskQueueSorter.a(playerchunk, run));
++ }
++ // Paper end
public final WorldLoadListener worldLoadListener;
- public final PlayerChunkMap.a chunkDistanceManager;
+ public final PlayerChunkMap.a chunkDistanceManager; public final ChunkMapDistance getChunkDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER
private final AtomicInteger u;
-@@ -221,6 +223,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -221,6 +229,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobSpawnMap; // this map is absent from updateMaps since it's controlled at the start of the chunkproviderserver tick
public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerChunkTickRangeMap;
// Paper end - optimise PlayerChunkMap#isOutsideRange
@@ -226,7 +232,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
void addPlayerToDistanceMaps(EntityPlayer player) {
int chunkX = MCUtil.getChunkCoordinate(player.locX());
-@@ -237,6 +255,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -237,6 +261,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper start - optimise PlayerChunkMap#isOutsideRange
this.playerChunkTickRangeMap.add(player, chunkX, chunkZ, ChunkMapDistance.MOB_SPAWN_RANGE);
// Paper end - optimise PlayerChunkMap#isOutsideRange
@@ -246,7 +252,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
}
void removePlayerFromDistanceMaps(EntityPlayer player) {
-@@ -249,6 +280,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -249,6 +286,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.playerMobSpawnMap.remove(player);
this.playerChunkTickRangeMap.remove(player);
// Paper end - optimise PlayerChunkMap#isOutsideRange
@@ -258,7 +264,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
}
void updateMaps(EntityPlayer player) {
-@@ -266,6 +302,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -266,6 +308,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper start - optimise PlayerChunkMap#isOutsideRange
this.playerChunkTickRangeMap.update(player, chunkX, chunkZ, ChunkMapDistance.MOB_SPAWN_RANGE);
// Paper end - optimise PlayerChunkMap#isOutsideRange
@@ -278,7 +284,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
}
// Paper end
-@@ -373,6 +422,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -373,6 +428,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
});
// Paper end - optimise PlayerChunkMap#isOutsideRange
@@ -324,7 +330,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
}
public void updatePlayerMobTypeMap(Entity entity) {
-@@ -1193,15 +1281,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1193,15 +1287,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
completablefuture1.thenAcceptAsync((either) -> {
either.mapLeft((chunk) -> {
this.u.getAndIncrement();
@@ -342,7 +348,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
});
return completablefuture1;
}
-@@ -1296,32 +1380,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1296,32 +1386,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
@@ -396,7 +402,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
protected void sendChunk(EntityPlayer entityplayer, ChunkCoordIntPair chunkcoordintpair, Packet<?>[] apacket, boolean flag, boolean flag1) {
if (entityplayer.world == this.world) {
-@@ -1329,7 +1419,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1329,7 +1425,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
PlayerChunk playerchunk = this.getVisibleChunk(chunkcoordintpair.pair());
if (playerchunk != null) {
@@ -405,7 +411,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
if (chunk != null) {
this.a(entityplayer, apacket, chunk);
-@@ -1590,6 +1680,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1590,6 +1686,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
// Paper end - optimise isOutsideOfRange
@@ -413,7 +419,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
private boolean b(EntityPlayer entityplayer) {
return entityplayer.isSpectator() && !this.world.getGameRules().getBoolean(GameRules.SPECTATORS_GENERATE_CHUNKS);
}
-@@ -1617,13 +1708,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1617,13 +1714,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.removePlayerFromDistanceMaps(entityplayer); // Paper - distance maps
}
@@ -428,7 +434,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
}
-@@ -1631,7 +1716,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1631,7 +1722,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
SectionPosition sectionposition = SectionPosition.a((Entity) entityplayer);
entityplayer.a(sectionposition);
@@ -437,7 +443,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
return sectionposition;
}
-@@ -1676,6 +1761,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1676,6 +1767,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
int k1;
int l1;
@@ -445,7 +451,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
if (Math.abs(i1 - i) <= this.viewDistance * 2 && Math.abs(j1 - j) <= this.viewDistance * 2) {
k1 = Math.min(i, i1) - this.viewDistance;
l1 = Math.min(j, j1) - this.viewDistance;
-@@ -1713,7 +1799,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1713,7 +1805,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.sendChunk(entityplayer, chunkcoordintpair1, new Packet[2], false, true);
}
}
@@ -454,7 +460,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
this.updateMaps(entityplayer); // Paper - distance maps
-@@ -1721,11 +1807,46 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1721,11 +1813,46 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@Override
public Stream<EntityPlayer> a(ChunkCoordIntPair chunkcoordintpair, boolean flag) {
@@ -505,16 +511,57 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
}
public void addEntity(Entity entity) { // Paper - protected -> public
-@@ -1883,7 +2004,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1883,7 +2010,48 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
- private final void sendChunk(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) { this.a(entityplayer, apacket, chunk); } // Paper - OBFHELPER
-+ final void sendChunk(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) { this.a(entityplayer, apacket, chunk); } // Paper - OBFHELPER
++ // Paper start
++ private static int getLightMask(final Chunk chunk) {
++ final ChunkSection[] chunkSections = chunk.getSections();
++ int mask = 0;
++
++ for (int i = 0; i < chunkSections.length; ++i) {
++ /*
++
++
++Lightmasks have 18 bits, from the -1 (void) section until the 17th (air) section.
++Sections go from 0..16. Now whenever a section is not empty, it can potentially change lighting for the section itself, the section below and the section above, hence the bitmask 111b, which is 7d.
++
++ */
++ mask |= (ChunkSection.isEmpty(chunkSections[i]) ? 0 : 7) << i;
++ }
++
++ return mask;
++ }
++
++ private static int getCeilingLightMask(final Chunk chunk) {
++ int mask = getLightMask(chunk);
++
++ /*
++ It is similar to get highest bit, it would turn an 001010 into an 001111 so basically the highest bit and all below.
++ We then invert this, so we'd have 110000 and compare that to the "main" chunk.
++ This is because the bug only appears when the current chunks lightmaps are higher than those of the neighbors, thus we can omit sending neighbors which are lower than the current chunks lights.
++
++ so TLDR is that getCeilingLightMask returns a light mask with all bits set below the highest affected section. We could also count the number of leading zeros and invert them, somehow.
++ @TODO: Implement Leafs suggestion
++ either use Integer#numberOfLeadingZeros or document what this bithack is supposed to be doing then
++ */
++ mask |= mask >> 1;
++ mask |= mask >> 2;
++ mask |= mask >> 4;
++ mask |= mask >> 8;
++ mask |= mask >> 16;
++
++ return mask;
++ }
++ // Paper end
++
++ public final void sendChunk(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) { this.a(entityplayer, apacket, chunk); } // Paper - OBFHELPER
private void a(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) {
if (apacket[0] == null) {
apacket[0] = new PacketPlayOutMapChunk(chunk, 65535, chunk.world.chunkPacketBlockController.shouldModify(entityplayer, chunk, 65535)); // Paper - Anti-Xray - Bypass
-@@ -2069,7 +2190,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -2069,7 +2237,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ);
PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair());
@@ -524,7 +571,7 @@ index ad6cfce582e319314134eff4571519aa7325d783..8c4325e2f6e8a63b42580f2ac55dfb79
}
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index b5a1f2ca1ad1e48ee61df394ef01e1bee768aea7..79c37b86370b8247480eed272d2cc77af4445084 100644
+index 70b3a7c8c4bd817be9c4dfaee71ec22a42620e11..ee6de0186f6a112d02e1dd4cc73fdaa92ab4d0d9 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -254,7 +254,7 @@ public abstract class PlayerList {
@@ -574,10 +621,23 @@ index efcfc8f0f45901d14ac8fdf8ed7b0bd67f8f94da..7ead848342bfbb5b20e95d716805f4b4
if ((i & 1) != 0) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index bd56cac7ce01942704d566c2cd8c1775fe643e25..92f40f759f625a46288388a3853cf996a0685b18 100644
+index bb2ff043f0d159fa18769c31b08683ee12037c58..90e895e9eac6158a28de4a30589bf7538e5ec9cc 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -236,7 +236,51 @@ public class Chunk implements IChunkAccess {
+@@ -28,7 +28,12 @@ import net.minecraft.core.IRegistry;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.server.MinecraftServer;
+ import net.minecraft.server.level.ChunkProviderServer;
++import net.minecraft.network.protocol.Packet;
++import net.minecraft.server.level.ChunkTaskQueueSorter;
++import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.server.level.PlayerChunk;
++import net.minecraft.server.level.PlayerChunkMap;
++import net.minecraft.server.level.TicketType;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.util.EntitySlice;
+ import net.minecraft.util.MathHelper;
+@@ -243,7 +248,51 @@ public class Chunk implements IChunkAccess {
}
protected void onNeighbourChange(final long bitsetBefore, final long bitsetAfter) {
@@ -629,7 +689,7 @@ index bd56cac7ce01942704d566c2cd8c1775fe643e25..92f40f759f625a46288388a3853cf996
}
public final boolean isAnyNeighborsLoaded() {
-@@ -1125,7 +1169,7 @@ public class Chunk implements IChunkAccess {
+@@ -1132,7 +1181,7 @@ public class Chunk implements IChunkAccess {
IBlockData iblockdata = this.getType(blockposition);
IBlockData iblockdata1 = Block.b(iblockdata, (GeneratorAccess) this.world, blockposition);
@@ -639,10 +699,18 @@ index bd56cac7ce01942704d566c2cd8c1775fe643e25..92f40f759f625a46288388a3853cf996
this.n[i].clear();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index da3c7aaf6c2732450ac365c11a1fd7b70db0513d..70002819b0c18cce4e907678ca3d3e4e8f7cc70a 100644
+index adcb2bd279f1f87d174556cb1b8aac497c11d7d3..72619407f22584f9677dbea759684cfa67f7648c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -2551,10 +2551,39 @@ public class CraftWorld implements World {
+@@ -32,6 +32,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutWorldEvent;
+ import net.minecraft.resources.MinecraftKey;
+ import net.minecraft.server.level.ChunkMapDistance;
+ import net.minecraft.server.level.PlayerChunk;
++import net.minecraft.server.level.PlayerChunkMap;
+ import net.minecraft.server.level.Ticket;
+ import net.minecraft.server.level.TicketType;
+ import net.minecraft.server.level.WorldServer;
+@@ -2551,10 +2552,39 @@ public class CraftWorld implements World {
// Spigot start
@Override
public int getViewDistance() {
@@ -657,7 +725,7 @@ index da3c7aaf6c2732450ac365c11a1fd7b70db0513d..70002819b0c18cce4e907678ca3d3e4e
+ if (viewDistance < 2 || viewDistance > 32) {
+ throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]");
+ }
-+ net.minecraft.server.PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap;
++ PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap;
+ if (viewDistance != chunkMap.getEffectiveViewDistance()) {
+ chunkMap.setViewDistance(viewDistance);
+ }
@@ -673,7 +741,7 @@ index da3c7aaf6c2732450ac365c11a1fd7b70db0513d..70002819b0c18cce4e907678ca3d3e4e
+ if ((viewDistance < 2 || viewDistance > 32) && viewDistance != -1) {
+ throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]");
+ }
-+ net.minecraft.server.PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap;
++ PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap;
+ if (viewDistance != chunkMap.getRawNoTickViewDistance()) {
+ chunkMap.setNoTickViewDistance(viewDistance);
+ }
@@ -684,15 +752,23 @@ index da3c7aaf6c2732450ac365c11a1fd7b70db0513d..70002819b0c18cce4e907678ca3d3e4e
private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot()
{
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
-index 663127e6e6ec507959142b18a11a5a4790d4b98b..5ffdeff04d1a8ed90cd3f1ccab23c20ec760823c 100644
+index 663127e6e6ec507959142b18a11a5a4790d4b98b..5c2eaca0bc63c7880ee928aba6a24761737aa649 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
-@@ -197,7 +197,7 @@ public class ActivationRange
+@@ -2,6 +2,7 @@ package org.spigotmc;
+
+ import java.util.Collection;
+ import net.minecraft.server.MinecraftServer;
++import net.minecraft.server.level.WorldServer;
+ import net.minecraft.util.MathHelper;
+ import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.entity.EntityCreature;
+@@ -197,7 +198,7 @@ public class ActivationRange
maxRange = Math.max( maxRange, waterActivationRange );
maxRange = Math.max( maxRange, villagerActivationRange );
// Paper end
- maxRange = Math.min( ( world.spigotConfig.viewDistance << 4 ) - 8, maxRange );
-+ maxRange = Math.min( ( ((net.minecraft.server.WorldServer)world).getChunkProvider().playerChunkMap.getEffectiveViewDistance() << 4 ) - 8, maxRange ); // Paper - no-tick view distance
++ maxRange = Math.min( ( ((WorldServer)world).getChunkProvider().playerChunkMap.getEffectiveViewDistance() << 4 ) - 8, maxRange ); // Paper - no-tick view distance
for ( EntityHuman player : world.getPlayers() )
{
diff --git a/Spigot-Server-Patches/0471-Add-villager-reputation-API.patch b/Spigot-Server-Patches/0471-Add-villager-reputation-API.patch
index 8c2f3e0927..007bd7a843 100644
--- a/Spigot-Server-Patches/0471-Add-villager-reputation-API.patch
+++ b/Spigot-Server-Patches/0471-Add-villager-reputation-API.patch
@@ -76,10 +76,10 @@ index a7f5e4a499c1f6fb1450e536dbf117a8af3b3b84..9cc3a18636a356977577076e96cb7be7
static class b {
diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
-index 035b5320d1246d60000ce4d0dbcde11cb9faa634..89ae2b4b836658dc335f28760672b952c2fb58d4 100644
+index c37dd836c284ed8beac6699ec4f5f91886cf3f63..80a9eecfd2eb17db6a7d0b3973f4acdb80f873e8 100644
--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
-@@ -1030,6 +1030,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
+@@ -1031,6 +1031,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
this.bD = 0;
}
@@ -88,7 +88,7 @@ index 035b5320d1246d60000ce4d0dbcde11cb9faa634..89ae2b4b836658dc335f28760672b952
return this.by;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
-index 4b2451179cdda918808ea7001f5033c7e5a8b9ac..a524a7b8e977424e28bf2d096d9c577bdd1c99f5 100644
+index 4b2451179cdda918808ea7001f5033c7e5a8b9ac..073c4c518be5a32fccd82e5739ede461214007b2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
@@ -17,6 +17,13 @@ import org.bukkit.entity.Villager;
@@ -113,7 +113,7 @@ index 4b2451179cdda918808ea7001f5033c7e5a8b9ac..a524a7b8e977424e28bf2d096d9c577b
+ // Paper start - Add villager reputation API
+ @Override
+ public Reputation getReputation(UUID uniqueId) {
-+ net.minecraft.server.Reputation.a rep = getHandle().getReputation().getReputations().get(uniqueId);
++ net.minecraft.world.entity.ai.gossip.Reputation.a rep = getHandle().getReputation().getReputations().get(uniqueId);
+ if (rep == null) {
+ return new Reputation(Maps.newHashMap());
+ }
@@ -130,10 +130,10 @@ index 4b2451179cdda918808ea7001f5033c7e5a8b9ac..a524a7b8e977424e28bf2d096d9c577b
+
+ @Override
+ public void setReputation(UUID uniqueId, Reputation reputation) {
-+ net.minecraft.server.Reputation.a nmsReputation =
++ net.minecraft.world.entity.ai.gossip.Reputation.a nmsReputation =
+ getHandle().getReputation().getReputations().computeIfAbsent(
+ uniqueId,
-+ key -> new net.minecraft.server.Reputation.a()
++ key -> new net.minecraft.world.entity.ai.gossip.Reputation.a()
+ );
+ nmsReputation.assignFromPaperReputation(reputation);
+ }
diff --git a/Spigot-Server-Patches/0472-Fix-Light-Command.patch b/Spigot-Server-Patches/0472-Fix-Light-Command.patch
index ff6d9af4dd..3a0aaf19d2 100644
--- a/Spigot-Server-Patches/0472-Fix-Light-Command.patch
+++ b/Spigot-Server-Patches/0472-Fix-Light-Command.patch
@@ -166,23 +166,10 @@ index 1f6333c2c26ad04e23d2881235ed1dcf707be038..e53054fc46e528f9c713eb4c03add613
// Paper start - per player view distance
// there can be potential desync with player's last mapped section and the view distance map, so use the
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
-index 8c4325e2f6e8a63b42580f2ac55dfb79557d6780..c299bbc814bc0571f17b0c3b843df0fcbb181bfb 100644
+index 762598b1dc8c6fb4beaad01e5777d0a950845eaf..5538d97e237e448a7d3eb76a57609980c3a6bddb 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
-@@ -149,6 +149,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
- private final ChunkTaskQueueSorter p;
- private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxWorldGen;
- final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxMain; // Paper - private -> package private
-+ // Paper start
-+ final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxLight;
-+ public void addLightTask(PlayerChunk playerchunk, Runnable run) {
-+ this.mailboxLight.a(ChunkTaskQueueSorter.a(playerchunk, run));
-+ }
-+ // Paper end
- public final WorldLoadListener worldLoadListener;
- public final PlayerChunkMap.a chunkDistanceManager;
- private final AtomicInteger u;
-@@ -340,11 +346,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -346,11 +346,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
Mailbox<Runnable> mailbox = Mailbox.a("main", iasynctaskhandler::a);
this.worldLoadListener = worldloadlistener;
diff --git a/Spigot-Server-Patches/0475-Potential-bed-API.patch b/Spigot-Server-Patches/0475-Potential-bed-API.patch
index 3911e4310a..f002048a71 100644
--- a/Spigot-Server-Patches/0475-Potential-bed-API.patch
+++ b/Spigot-Server-Patches/0475-Potential-bed-API.patch
@@ -8,10 +8,18 @@ Adds a new method to fetch the location of a player's bed without generating any
getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-index 9e9e5118cbdc02b9171bbccb1b29990c11d7cb5f..bc1f8a0470e4720ff60f5b9c6f1c4172d903d15a 100644
+index 5b142e96248278c6bb6068879bb5ad1578b0f79f..92501a415813b3b0f2be492a4711962320264a76 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-@@ -126,6 +126,22 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
+@@ -13,6 +13,7 @@ import net.minecraft.network.chat.IChatBaseComponent;
+ import net.minecraft.network.protocol.game.PacketPlayInCloseWindow;
+ import net.minecraft.network.protocol.game.PacketPlayOutOpenWindow;
+ import net.minecraft.server.level.EntityPlayer;
++import net.minecraft.server.level.WorldServer;
+ import net.minecraft.world.ITileInventory;
+ import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.entity.EntityTypes;
+@@ -127,6 +128,22 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
return getHandle().sleepTicks;
}
@@ -24,7 +32,7 @@ index 9e9e5118cbdc02b9171bbccb1b29990c11d7cb5f..bc1f8a0470e4720ff60f5b9c6f1c4172
+ return null;
+ }
+
-+ net.minecraft.server.WorldServer worldServer = handle.server.getWorldServer(handle.getSpawnDimension());
++ WorldServer worldServer = handle.server.getWorldServer(handle.getSpawnDimension());
+ if (worldServer == null) {
+ return null;
+ }
diff --git a/Spigot-Server-Patches/0476-Wait-for-Async-Tasks-during-shutdown.patch b/Spigot-Server-Patches/0476-Wait-for-Async-Tasks-during-shutdown.patch
index 434e30979c..b9b82cef45 100644
--- a/Spigot-Server-Patches/0476-Wait-for-Async-Tasks-during-shutdown.patch
+++ b/Spigot-Server-Patches/0476-Wait-for-Async-Tasks-during-shutdown.patch
@@ -10,10 +10,10 @@ Adds a 5 second grace period for any async tasks to finish and warns
if any are still running after that delay just as reload does.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 40b52ed64428f59173ee8af4046c1e8d926fcdd5..b1a05896c50787657421e4cf721b9100bb38706d 100644
+index 580e08347d06e6b4b9558b3f25f1f095c41fcf91..2deeaf23b8dd0ee5dc126797b271681a5f7880df 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -880,6 +880,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -882,6 +882,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// CraftBukkit start
if (this.server != null) {
this.server.disablePlugins();
diff --git a/Spigot-Server-Patches/0479-Optimize-NibbleArray-to-use-pooled-buffers.patch b/Spigot-Server-Patches/0479-Optimize-NibbleArray-to-use-pooled-buffers.patch
index 5097f10e47..ebb1afc548 100644
--- a/Spigot-Server-Patches/0479-Optimize-NibbleArray-to-use-pooled-buffers.patch
+++ b/Spigot-Server-Patches/0479-Optimize-NibbleArray-to-use-pooled-buffers.patch
@@ -123,10 +123,10 @@ index 247d969e7d1aa59d9650fce1032aaa09db3903e5..9050ff7180f63c1f5756570446c4d0a8
this.d &= ~(1 << k);
if (nibblearray != null) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/NibbleArray.java b/src/main/java/net/minecraft/world/level/chunk/NibbleArray.java
-index 2e86be5be969ebf672ef3844e1367583c823f252..50fc6316bfd42a532f792ba7557783eea3988a55 100644
+index 2e86be5be969ebf672ef3844e1367583c823f252..064d49a36dc1603c92a6bb8e9540ba9cc41a3335 100644
--- a/src/main/java/net/minecraft/world/level/chunk/NibbleArray.java
+++ b/src/main/java/net/minecraft/world/level/chunk/NibbleArray.java
-@@ -1,17 +1,76 @@
+@@ -1,17 +1,77 @@
package net.minecraft.world.level.chunk;
+import com.destroystokyo.paper.util.pooled.PooledObjects; // Paper
@@ -134,6 +134,7 @@ index 2e86be5be969ebf672ef3844e1367583c823f252..50fc6316bfd42a532f792ba7557783ee
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.SystemUtils;
++import net.minecraft.server.MCUtil;
public class NibbleArray {
@@ -205,7 +206,7 @@ index 2e86be5be969ebf672ef3844e1367583c823f252..50fc6316bfd42a532f792ba7557783ee
if (abyte.length != 2048) {
throw (IllegalArgumentException) SystemUtils.c((Throwable) (new IllegalArgumentException("ChunkNibbleArrays should be 2048 bytes not: " + abyte.length)));
}
-@@ -45,7 +104,8 @@ public class NibbleArray {
+@@ -45,7 +105,8 @@ public class NibbleArray {
public void a(int i, int j) { // PAIL: private -> public
if (this.a == null) {
@@ -215,7 +216,7 @@ index 2e86be5be969ebf672ef3844e1367583c823f252..50fc6316bfd42a532f792ba7557783ee
}
int k = this.d(i);
-@@ -67,14 +127,36 @@ public class NibbleArray {
+@@ -67,14 +128,36 @@ public class NibbleArray {
public byte[] asBytes() {
if (this.a == null) {
this.a = new byte[2048];
@@ -254,10 +255,10 @@ index 2e86be5be969ebf672ef3844e1367583c823f252..50fc6316bfd42a532f792ba7557783ee
public String toString() {
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-index 358b3c396e8201fa5f82778179e8a300b4aed908..120115b44c2ec592fe0f90eee89bb213d4e8325e 100644
+index e16e046d165330326ed220c9c440a637007f3137..91bcbf7156dd90b00e2d53bb6bff4abc44ecb721 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-@@ -434,11 +434,11 @@ public class ChunkRegionLoader {
+@@ -435,11 +435,11 @@ public class ChunkRegionLoader {
}
if (nibblearray != null && !nibblearray.c()) {
@@ -300,10 +301,18 @@ index 5b1ff4ff87591dd4ff0b79e4ac6ff0494fc3d0f8..9ba9efb181b9607f25b7c921e69e4c59
}
diff --git a/src/main/java/net/minecraft/world/level/lighting/LightEngineStorageArray.java b/src/main/java/net/minecraft/world/level/lighting/LightEngineStorageArray.java
-index ed7864c552054fc47c6010a094230ce4aebf1c54..0ab4917053c090c874e8bb59e750fd909636f89d 100644
+index ed7864c552054fc47c6010a094230ce4aebf1c54..da78d4c4b5f8af4648ac82d63c21f6a2a5b73ecb 100644
--- a/src/main/java/net/minecraft/world/level/lighting/LightEngineStorageArray.java
+++ b/src/main/java/net/minecraft/world/level/lighting/LightEngineStorageArray.java
-@@ -34,7 +34,9 @@ public abstract class LightEngineStorageArray<M extends LightEngineStorageArray<
+@@ -2,6 +2,7 @@ package net.minecraft.world.level.lighting;
+
+ import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
+ import javax.annotation.Nullable;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.world.level.chunk.NibbleArray;
+
+ public abstract class LightEngineStorageArray<M extends LightEngineStorageArray<M>> {
+@@ -34,7 +35,9 @@ public abstract class LightEngineStorageArray<M extends LightEngineStorageArray<
public void a(long i) {
if (this.isVisible) { throw new IllegalStateException("writing to visible data"); } // Paper - avoid copying light data
diff --git a/Spigot-Server-Patches/0481-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/Spigot-Server-Patches/0481-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
index 4b3fc10f62..271994117a 100644
--- a/Spigot-Server-Patches/0481-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
+++ b/Spigot-Server-Patches/0481-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
@@ -39,10 +39,10 @@ index 4c82266656d0a60a166faa082a9aaaaed7f062d3..aa5ba862f18ff706f11b0b26cea55a90
if (!flag4 && this.o <= 400 && !this.q && this.r == this.tracker.isOnGround()) {
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
-index c299bbc814bc0571f17b0c3b843df0fcbb181bfb..a6e794a77110b670ace4003b7d1156801cf35b6e 100644
+index 5538d97e237e448a7d3eb76a57609980c3a6bddb..ede47aaaace80280756fe4463def1ea26792c9e4 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
-@@ -2186,9 +2186,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -2227,9 +2227,14 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
public void updatePlayer(EntityPlayer entityplayer) {
org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
if (entityplayer != this.tracker) {
diff --git a/Spigot-Server-Patches/0482-Ensure-safe-gateway-teleport.patch b/Spigot-Server-Patches/0482-Ensure-safe-gateway-teleport.patch
index 92e815000c..cf98a288ea 100644
--- a/Spigot-Server-Patches/0482-Ensure-safe-gateway-teleport.patch
+++ b/Spigot-Server-Patches/0482-Ensure-safe-gateway-teleport.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Ensure safe gateway teleport
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
-index 1d90cb32560a9102ebe43dfa9806b407d0ee1bd1..5a1d23dc718a883825e8e7550bd9d034b81f2bf8 100644
+index b7548d0b3938d95328fc86db4000190532eaa8f5..855c49164277ca96ca08fb204d851a5ad6789990 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
-@@ -88,9 +88,14 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
+@@ -89,9 +89,14 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
} else if (!this.world.isClientSide) {
List<Entity> list = this.world.a(Entity.class, new AxisAlignedBB(this.getPosition()), TileEntityEndGateway::a);
diff --git a/Spigot-Server-Patches/0484-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch b/Spigot-Server-Patches/0484-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch
index 32ab0cae48..5f3ad1df79 100644
--- a/Spigot-Server-Patches/0484-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch
+++ b/Spigot-Server-Patches/0484-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch
@@ -16,10 +16,18 @@ We further improve it by making a copy of the nbt tag with only the memory
it needs, so that we dont have to hold a copy to the entire compound.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-index 120115b44c2ec592fe0f90eee89bb213d4e8325e..427544bc0ad72f82a54e9d2f7dbb3373a25c5ca3 100644
+index 91bcbf7156dd90b00e2d53bb6bff4abc44ecb721..8e4924cd649c350520cba54a0e1497d5acf089ff 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-@@ -198,15 +198,9 @@ public class ChunkRegionLoader {
+@@ -22,6 +22,7 @@ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.IRegistry;
+ import net.minecraft.core.RegistryBlocks;
+ import net.minecraft.core.SectionPosition;
++import net.minecraft.nbt.NBTBase;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.nbt.NBTTagList;
+ import net.minecraft.nbt.NBTTagLongArray;
+@@ -199,15 +200,9 @@ public class ChunkRegionLoader {
object2 = protochunkticklist1;
}
@@ -38,7 +46,7 @@ index 120115b44c2ec592fe0f90eee89bb213d4e8325e..427544bc0ad72f82a54e9d2f7dbb3373
} else {
ProtoChunk protochunk = new ProtoChunk(chunkcoordintpair, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, worldserver); // Paper - Anti-Xray - Add parameter
-@@ -312,6 +306,50 @@ public class ChunkRegionLoader {
+@@ -313,6 +308,50 @@ public class ChunkRegionLoader {
return new InProgressChunkHolder(protochunk1, tasksToExecuteOnMain); // Paper - Async chunk loading
}
}
diff --git a/Spigot-Server-Patches/0485-Workaround-for-Client-Lag-Spikes-MC-162253.patch b/Spigot-Server-Patches/0485-Workaround-for-Client-Lag-Spikes-MC-162253.patch
index be689a86b3..99601c7eb7 100644
--- a/Spigot-Server-Patches/0485-Workaround-for-Client-Lag-Spikes-MC-162253.patch
+++ b/Spigot-Server-Patches/0485-Workaround-for-Client-Lag-Spikes-MC-162253.patch
@@ -12,7 +12,7 @@ to the client, so that it doesn't attempt to calculate them.
This mitigates the frametime impact to a minimum (but it's still there).
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
-index a6e794a77110b670ace4003b7d1156801cf35b6e..6db110aaa2c1e08808eb80c333ceb8ab0377ca39 100644
+index ede47aaaace80280756fe4463def1ea26792c9e4..d5c939281df21683efc63937a9146b0dfeb22e2c 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
@@ -85,6 +85,7 @@ import net.minecraft.world.level.World;
@@ -23,52 +23,8 @@ index a6e794a77110b670ace4003b7d1156801cf35b6e..6db110aaa2c1e08808eb80c333ceb8ab
import net.minecraft.world.level.chunk.ChunkStatus;
import net.minecraft.world.level.chunk.IChunkAccess;
import net.minecraft.world.level.chunk.ILightAccess;
-@@ -2011,12 +2012,112 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
-
- }
-
-+ // Paper start
-+ private static int getLightMask(final Chunk chunk) {
-+ final ChunkSection[] chunkSections = chunk.getSections();
-+ int mask = 0;
-+
-+ for (int i = 0; i < chunkSections.length; ++i) {
-+ /*
-+
-+
-+Lightmasks have 18 bits, from the -1 (void) section until the 17th (air) section.
-+Sections go from 0..16. Now whenever a section is not empty, it can potentially change lighting for the section itself, the section below and the section above, hence the bitmask 111b, which is 7d.
-+
-+ */
-+ mask |= (ChunkSection.isEmpty(chunkSections[i]) ? 0 : 7) << i;
-+ }
-+
-+ return mask;
-+ }
-+
-+ private static int getCeilingLightMask(final Chunk chunk) {
-+ int mask = getLightMask(chunk);
-+
-+ /*
-+ It is similar to get highest bit, it would turn an 001010 into an 001111 so basically the highest bit and all below.
-+ We then invert this, so we'd have 110000 and compare that to the "main" chunk.
-+ This is because the bug only appears when the current chunks lightmaps are higher than those of the neighbors, thus we can omit sending neighbors which are lower than the current chunks lights.
-+
-+ so TLDR is that getCeilingLightMask returns a light mask with all bits set below the highest affected section. We could also count the number of leading zeros and invert them, somehow.
-+ @TODO: Implement Leafs suggestion
-+ either use Integer#numberOfLeadingZeros or document what this bithack is supposed to be doing then
-+ */
-+ mask |= mask >> 1;
-+ mask |= mask >> 2;
-+ mask |= mask >> 4;
-+ mask |= mask >> 8;
-+ mask |= mask >> 16;
-+
-+ return mask;
-+ }
-+ // Paper end
-+
- final void sendChunk(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) { this.a(entityplayer, apacket, chunk); } // Paper - OBFHELPER
+@@ -2055,9 +2056,68 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
+ public final void sendChunk(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) { this.a(entityplayer, apacket, chunk); } // Paper - OBFHELPER
private void a(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) {
if (apacket[0] == null) {
+ // Paper start - add 8 for light fix workaround
@@ -137,10 +93,10 @@ index a6e794a77110b670ace4003b7d1156801cf35b6e..6db110aaa2c1e08808eb80c333ceb8ab
entityplayer.a(chunk.getPos(), apacket[0], apacket[1]);
PacketDebug.a(this.world, chunk.getPos());
diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-index 92f40f759f625a46288388a3853cf996a0685b18..e056d198a530a830aeebf7ebb51ac9273675f2f0 100644
+index 90e895e9eac6158a28de4a30589bf7538e5ec9cc..34a9f7b2f998f77b1279516cd09397ab6c2ac1cc 100644
--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
-@@ -268,7 +268,7 @@ public class Chunk implements IChunkAccess {
+@@ -280,7 +280,7 @@ public class Chunk implements IChunkAccess {
// broadcast
Object[] backingSet = inRange.getBackingSet();
diff --git a/Spigot-Server-Patches/0486-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/Spigot-Server-Patches/0486-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
index db47c1167a..bc5af6afc7 100644
--- a/Spigot-Server-Patches/0486-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
+++ b/Spigot-Server-Patches/0486-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
@@ -483,7 +483,7 @@ index 2bbdcedf4856080ea9232effdf3bdae9c26c425b..fb4e587e86c76ea720bddcdbb969f21d
protected int c(long i) {
return this.a.get(i);
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
-index b24a96dddf50029e4b40a47d49e3278cacaf42ce..9a3f552789b6972982ab28e7edb16ca302e9ff7b 100644
+index 42bb00364375e5cf324b43557385345868b37ffe..19e02d12bb0c5a73066f7c57da40277918276210 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -468,6 +468,26 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -624,7 +624,7 @@ index 2def7680367e4a20d7402b27bff7242afdc250e2..5d6865fd7b67c2031440a8bd86209924
for (int i = 0; i < this.inventory.getSize(); ++i) {
ItemStack itemstack = this.inventory.getItem(i);
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java
-index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc763313ca1f 100644
+index e53054fc46e528f9c713eb4c03add61316e19396..fc79a73c884ceb7e0ce56443c36b135c4e525193 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java
@@ -1,6 +1,7 @@
@@ -635,7 +635,15 @@ index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc76
import it.unimi.dsi.fastutil.shorts.ShortArraySet;
import it.unimi.dsi.fastutil.shorts.ShortSet;
import java.util.List;
-@@ -53,8 +54,8 @@ public class PlayerChunk {
+@@ -19,6 +20,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutBlockChange;
+ import net.minecraft.network.protocol.game.PacketPlayOutLightUpdate;
+ import net.minecraft.network.protocol.game.PacketPlayOutMultiBlockChange;
+ import net.minecraft.network.protocol.game.PacketPlayOutTileEntityData;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.util.MathHelper;
+ import net.minecraft.world.level.ChunkCoordIntPair;
+ import net.minecraft.world.level.EnumSkyBlock;
+@@ -53,8 +55,8 @@ public class PlayerChunk {
private CompletableFuture<IChunkAccess> chunkSave;
public int oldTicketLevel;
private int ticketLevel;
@@ -646,7 +654,7 @@ index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc76
private boolean p;
private final ShortSet[] dirtyBlocks;
private int r;
-@@ -66,6 +67,7 @@ public class PlayerChunk {
+@@ -66,6 +68,7 @@ public class PlayerChunk {
private boolean x;
private final PlayerChunkMap chunkMap; // Paper
@@ -654,7 +662,7 @@ index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc76
long lastAutoSaveTime; // Paper - incremental autosave
long inactiveTimeStart; // Paper - incremental autosave
-@@ -93,6 +95,120 @@ public class PlayerChunk {
+@@ -93,6 +96,120 @@ public class PlayerChunk {
return null;
}
// Paper end - no-tick view distance
@@ -775,7 +783,7 @@ index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc76
public PlayerChunk(ChunkCoordIntPair chunkcoordintpair, int i, LightEngine lightengine, PlayerChunk.c playerchunk_c, PlayerChunk.d playerchunk_d) {
this.statusFutures = new AtomicReferenceArray(PlayerChunk.CHUNK_STATUSES.size());
-@@ -195,6 +311,18 @@ public class PlayerChunk {
+@@ -195,6 +312,18 @@ public class PlayerChunk {
}
return null;
}
@@ -794,7 +802,7 @@ index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc76
// Paper end
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) {
-@@ -441,6 +569,7 @@ public class PlayerChunk {
+@@ -441,6 +570,7 @@ public class PlayerChunk {
return this.n;
}
@@ -802,7 +810,7 @@ index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc76
private void d(int i) {
this.n = i;
}
-@@ -459,7 +588,7 @@ public class PlayerChunk {
+@@ -459,7 +589,7 @@ public class PlayerChunk {
// CraftBukkit start
// ChunkUnloadEvent: Called before the chunk is unloaded: isChunkLoaded is still true and chunk can still be modified by plugins.
if (playerchunk_state.isAtLeast(PlayerChunk.State.BORDER) && !playerchunk_state1.isAtLeast(PlayerChunk.State.BORDER)) {
@@ -811,7 +819,7 @@ index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc76
Chunk chunk = (Chunk)either.left().orElse(null);
if (chunk != null) {
playerchunkmap.callbackExecutor.execute(() -> {
-@@ -524,12 +653,13 @@ public class PlayerChunk {
+@@ -524,12 +654,13 @@ public class PlayerChunk {
if (!flag2 && flag3) {
// Paper start - cache ticking ready status
int expectCreateCount = ++this.fullChunkCreateCount;
@@ -826,7 +834,7 @@ index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc76
}
-@@ -554,7 +684,7 @@ public class PlayerChunk {
+@@ -554,7 +685,7 @@ public class PlayerChunk {
if (!flag4 && flag5) {
// Paper start - cache ticking ready status
@@ -835,7 +843,7 @@ index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc76
if (either.left().isPresent()) {
// note: Here is a very good place to add callbacks to logic waiting on this.
Chunk tickingChunk = either.left().get();
-@@ -585,7 +715,7 @@ public class PlayerChunk {
+@@ -585,7 +716,7 @@ public class PlayerChunk {
}
// Paper start - cache ticking ready status
@@ -844,7 +852,7 @@ index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc76
if (either.left().isPresent()) {
// note: Here is a very good place to add callbacks to logic waiting on this.
Chunk entityTickingChunk = either.left().get();
-@@ -605,12 +735,29 @@ public class PlayerChunk {
+@@ -605,12 +736,29 @@ public class PlayerChunk {
this.entityTickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
}
@@ -876,7 +884,7 @@ index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc76
Chunk chunk = (Chunk)either.left().orElse(null);
if (chunk != null) {
playerchunkmap.callbackExecutor.execute(() -> {
-@@ -692,6 +839,7 @@ public class PlayerChunk {
+@@ -692,6 +840,7 @@ public class PlayerChunk {
public interface c {
@@ -885,7 +893,7 @@ index e53054fc46e528f9c713eb4c03add61316e19396..cd2c2a680a93d92b1814ce88892bfc76
}
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
-index 6db110aaa2c1e08808eb80c333ceb8ab0377ca39..ff47dbe63a60adae11660578f4e0bf1b7fab48d4 100644
+index d5c939281df21683efc63937a9146b0dfeb22e2c..01cce21eeed25b2bb36a0f32b9708afb83690f90 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
@@ -14,6 +14,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
@@ -1195,13 +1203,13 @@ index 41d4c3533119cc80cb4c93771db344531c8dd106..d8be5ff9620da8d96a0d157fb99145d3
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 79c37b86370b8247480eed272d2cc77af4445084..86e50a90e524bd8e77efd9e5641fa4e59560df11 100644
+index ee6de0186f6a112d02e1dd4cc73fdaa92ab4d0d9..65e01b98c74d2fa9ff6d6db18f9f8c684b7bdac4 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -275,8 +275,8 @@ public abstract class PlayerList {
final ChunkCoordIntPair pos = new ChunkCoordIntPair(chunkX, chunkZ);
PlayerChunkMap playerChunkMap = worldserver1.getChunkProvider().playerChunkMap;
- playerChunkMap.chunkDistanceManager.addTicketAtLevel(TicketType.LOGIN, pos, 31, pos.pair());
+ playerChunkMap.getChunkDistanceManager().addTicketAtLevel(TicketType.LOGIN, pos, 31, pos.pair());
- worldserver1.getChunkProvider().tickDistanceManager();
- worldserver1.getChunkProvider().getChunkAtAsynchronously(chunkX, chunkZ, true, true).thenApply(chunk -> {
+ worldserver1.getChunkProvider().markAreaHighPriority(pos, 28, 3);
@@ -1238,10 +1246,10 @@ index 9a88791be443a5b18934e7d752aee6dcdb8aa38f..e41d63596c32eee5f0c04a6f043d576d
return new BlockPosition(this.d(), 0, this.e());
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 70002819b0c18cce4e907678ca3d3e4e8f7cc70a..fa2f6f737b41157b90f455b65d41b1e51fcb4eb5 100644
+index 72619407f22584f9677dbea759684cfa67f7648c..e463dd48593becd701d8e087b8a058b8a4a50ee5 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -2541,6 +2541,10 @@ public class CraftWorld implements World {
+@@ -2542,6 +2542,10 @@ public class CraftWorld implements World {
return future;
}
@@ -1253,17 +1261,33 @@ index 70002819b0c18cce4e907678ca3d3e4e8f7cc70a..fa2f6f737b41157b90f455b65d41b1e5
net.minecraft.world.level.chunk.Chunk chunk = (net.minecraft.world.level.chunk.Chunk) either.left().orElse(null);
return CompletableFuture.completedFuture(chunk == null ? null : chunk.getBukkitChunk());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index f512a78c1fee21e90dfbb3af2ebbeeb89ae6b8f1..bfca937a85ea8249f81b746a15835520a3b22dd1 100644
+index 7a240739ac6e043e590b380659d8e6d794954f84..ba8c36c9fa7a1fdc3047b14042da8703802f9275 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -848,6 +848,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -60,6 +60,7 @@ import net.minecraft.server.level.PlayerChunkMap;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.server.network.PlayerConnection;
+ import net.minecraft.server.players.WhiteListEntry;
++import net.minecraft.util.MathHelper;
+ import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.entity.EntityExperienceOrb;
+ import net.minecraft.world.entity.EntityLiving;
+@@ -72,6 +73,7 @@ import net.minecraft.world.inventory.Container;
+ import net.minecraft.world.item.EnumColor;
+ import net.minecraft.world.item.enchantment.EnchantmentManager;
+ import net.minecraft.world.item.enchantment.Enchantments;
++import net.minecraft.world.level.ChunkCoordIntPair;
+ import net.minecraft.world.level.EnumGamemode;
+ import net.minecraft.world.level.biome.BiomeManager;
+ import net.minecraft.world.level.block.entity.TileEntitySign;
+@@ -853,6 +855,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
throw new UnsupportedOperationException("Cannot set rotation of players. Consider teleporting instead.");
}
+ // Paper start
+ @Override
+ public java.util.concurrent.CompletableFuture<Boolean> teleportAsync(Location loc, @javax.annotation.Nonnull PlayerTeleportEvent.TeleportCause cause) {
-+ ((CraftWorld)loc.getWorld()).getHandle().getChunkProvider().markAreaHighPriority(new net.minecraft.server.ChunkCoordIntPair(net.minecraft.server.MathHelper.floor(loc.getX()) >> 4, net.minecraft.server.MathHelper.floor(loc.getZ()) >> 4), 28, 3); // Paper - load area high priority
++ ((CraftWorld)loc.getWorld()).getHandle().getChunkProvider().markAreaHighPriority(new ChunkCoordIntPair(MathHelper.floor(loc.getX()) >> 4, MathHelper.floor(loc.getZ()) >> 4), 28, 3); // Paper - load area high priority
+ return super.teleportAsync(loc, cause);
+ }
+ // Paper end
diff --git a/Spigot-Server-Patches/0488-Improve-Chunk-Status-Transition-Speed.patch b/Spigot-Server-Patches/0488-Improve-Chunk-Status-Transition-Speed.patch
index fbea350ad2..4df93b2bf2 100644
--- a/Spigot-Server-Patches/0488-Improve-Chunk-Status-Transition-Speed.patch
+++ b/Spigot-Server-Patches/0488-Improve-Chunk-Status-Transition-Speed.patch
@@ -36,10 +36,10 @@ scenario / path:
Previously would have hopped to SERVER around 12+ times there extra.
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java
-index cd2c2a680a93d92b1814ce88892bfc763313ca1f..48b87ed945a71b97d8a88cbaf4099dc966a8ab88 100644
+index fc79a73c884ceb7e0ce56443c36b135c4e525193..88022e3ccd04f9c041ced68be66a95247c1017e9 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java
-@@ -83,6 +83,13 @@ public class PlayerChunk {
+@@ -84,6 +84,13 @@ public class PlayerChunk {
this.playersInChunkTickRange = this.chunkMap.playerChunkTickRangeMap.getObjectsInRange(key);
}
// Paper end - optimise isOutsideOfRange
@@ -54,7 +54,7 @@ index cd2c2a680a93d92b1814ce88892bfc763313ca1f..48b87ed945a71b97d8a88cbaf4099dc9
// Paper start - no-tick view distance
public final Chunk getSendingChunk() {
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
-index ff47dbe63a60adae11660578f4e0bf1b7fab48d4..488a7f6849036310d5831ab9cb29ec79bc226e2b 100644
+index 01cce21eeed25b2bb36a0f32b9708afb83690f90..7318103feafd12ed631f907a450c9dc3d665a9a3 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
@@ -795,7 +795,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
diff --git a/Spigot-Server-Patches/0493-Optimize-Light-Engine.patch b/Spigot-Server-Patches/0493-Optimize-Light-Engine.patch
index 5994394fd8..b47f9027fb 100644
--- a/Spigot-Server-Patches/0493-Optimize-Light-Engine.patch
+++ b/Spigot-Server-Patches/0493-Optimize-Light-Engine.patch
@@ -25,7 +25,7 @@ Massive update to light to improve performance and chunk loading/generation.
8) Fix NPE risk that crashes server in getting nibble data
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
-index 9a3f552789b6972982ab28e7edb16ca302e9ff7b..f7e684e550ac531a978113c6f5861fd912d3cfd1 100644
+index 19e02d12bb0c5a73066f7c57da40277918276210..f46f3ca87badefd668e70d792de5b3d3c0172a68 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -1070,7 +1070,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -83,7 +83,7 @@ index c8bb040e7ed848877ec9c2f9b30dcda137cadf35..4ee7070364a8989eece4fa4237b52992
if (l1 == i) {
l1 = Long.MAX_VALUE;
diff --git a/src/main/java/net/minecraft/server/level/LightEngineThreaded.java b/src/main/java/net/minecraft/server/level/LightEngineThreaded.java
-index e066848127cb9a42e8c39422691cc65132cac6bb..8a70286c017450dcc1926f471673933c493c555c 100644
+index e066848127cb9a42e8c39422691cc65132cac6bb..0b80569648c1df01aab52d0b8d47028cda925d86 100644
--- a/src/main/java/net/minecraft/server/level/LightEngineThreaded.java
+++ b/src/main/java/net/minecraft/server/level/LightEngineThreaded.java
@@ -1,6 +1,7 @@
@@ -94,7 +94,15 @@ index e066848127cb9a42e8c39422691cc65132cac6bb..8a70286c017450dcc1926f471673933c
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import it.unimi.dsi.fastutil.objects.ObjectList;
import it.unimi.dsi.fastutil.objects.ObjectListIterator;
-@@ -27,15 +28,149 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
+@@ -16,6 +17,7 @@ import net.minecraft.util.thread.ThreadedMailbox;
+ import net.minecraft.world.level.ChunkCoordIntPair;
+ import net.minecraft.world.level.EnumSkyBlock;
+ import net.minecraft.world.level.chunk.ChunkSection;
++import net.minecraft.world.level.chunk.ChunkStatus;
+ import net.minecraft.world.level.chunk.IChunkAccess;
+ import net.minecraft.world.level.chunk.ILightAccess;
+ import net.minecraft.world.level.chunk.NibbleArray;
+@@ -27,15 +29,149 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
private static final Logger LOGGER = LogManager.getLogger();
private final ThreadedMailbox<Runnable> b;
@@ -247,7 +255,7 @@ index e066848127cb9a42e8c39422691cc65132cac6bb..8a70286c017450dcc1926f471673933c
this.e = mailbox;
this.b = threadedmailbox;
}
-@@ -122,13 +257,9 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
+@@ -122,13 +258,9 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
}
private void a(int i, int j, IntSupplier intsupplier, LightEngineThreaded.Update lightenginethreaded_update, Runnable runnable) {
@@ -264,7 +272,7 @@ index e066848127cb9a42e8c39422691cc65132cac6bb..8a70286c017450dcc1926f471673933c
}
@Override
-@@ -145,8 +276,19 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
+@@ -145,8 +277,19 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
public CompletableFuture<IChunkAccess> a(IChunkAccess ichunkaccess, boolean flag) {
ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos();
@@ -286,7 +294,7 @@ index e066848127cb9a42e8c39422691cc65132cac6bb..8a70286c017450dcc1926f471673933c
ChunkSection[] achunksection = ichunkaccess.getSections();
for (int i = 0; i < 16; ++i) {
-@@ -164,55 +306,48 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
+@@ -164,55 +307,48 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
});
}
@@ -367,10 +375,10 @@ index e066848127cb9a42e8c39422691cc65132cac6bb..8a70286c017450dcc1926f471673933c
public void a(int i) {
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java
-index 48b87ed945a71b97d8a88cbaf4099dc966a8ab88..b19c3bdbf64dc44f01487a3d17236a03a95708b5 100644
+index 88022e3ccd04f9c041ced68be66a95247c1017e9..d6a5a0b17308913a5efd97cd27fabd0825ef68c6 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java
-@@ -753,6 +753,7 @@ public class PlayerChunk {
+@@ -754,6 +754,7 @@ public class PlayerChunk {
ioPriority = com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGH_PRIORITY;
}
chunkMap.world.asyncChunkTaskManager.raisePriority(location.x, location.z, ioPriority);
@@ -379,7 +387,7 @@ index 48b87ed945a71b97d8a88cbaf4099dc966a8ab88..b19c3bdbf64dc44f01487a3d17236a03
if (getCurrentPriority() != priority) {
this.u.a(this.location, this::getCurrentPriority, priority, this::setPriority); // use preferred priority
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
-index 488a7f6849036310d5831ab9cb29ec79bc226e2b..033dee28da5b788b90b6c6651b2ab92efd1d2f21 100644
+index 7318103feafd12ed631f907a450c9dc3d665a9a3..b47cd2a8fb4920531d80acfcfe40f8211fedc9ae 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
@@ -99,6 +99,7 @@ import net.minecraft.world.level.chunk.storage.RegionFile;
@@ -458,20 +466,20 @@ index 2efca1fe92b2e93dcbf5337eea8855b1b2b9a564..72bfda620f073fd3c3e4c43d78583386
this.a.a(t0);
this.f();
diff --git a/src/main/java/net/minecraft/world/level/chunk/NibbleArray.java b/src/main/java/net/minecraft/world/level/chunk/NibbleArray.java
-index 50fc6316bfd42a532f792ba7557783eea3988a55..c01284e6221b69f8fac3c74a7f9726a188f1f843 100644
+index 064d49a36dc1603c92a6bb8e9540ba9cc41a3335..3a85a89be2a736e5b6b7f08032f4becd6bb39ed1 100644
--- a/src/main/java/net/minecraft/world/level/chunk/NibbleArray.java
+++ b/src/main/java/net/minecraft/world/level/chunk/NibbleArray.java
-@@ -9,6 +9,13 @@ import net.minecraft.SystemUtils;
+@@ -10,6 +10,13 @@ import net.minecraft.server.MCUtil;
public class NibbleArray {
// Paper start
-+ static final NibbleArray EMPTY_NIBBLE_ARRAY = new NibbleArray() {
++ public static final NibbleArray EMPTY_NIBBLE_ARRAY = new NibbleArray() {
+ @Override
+ public byte[] asBytes() {
+ throw new IllegalStateException();
+ }
+ };
-+ long lightCacheKey = Long.MIN_VALUE;
++ public long lightCacheKey = Long.MIN_VALUE;
public static byte[] EMPTY_NIBBLE = new byte[2048];
private static final int nibbleBucketSizeMultiplier = Integer.getInteger("Paper.nibbleBucketSize", 3072);
private static final int maxPoolSize = Integer.getInteger("Paper.maxNibblePoolSize", (int) Math.min(6, Math.max(1, Runtime.getRuntime().maxMemory() / 1024 / 1024 / 1024)) * (nibbleBucketSizeMultiplier * 8));
@@ -756,10 +764,18 @@ index 944a8c295ff9df0d96800ddc4f6763598cf61d0d..64dad8ed7c16011d9cb3e9d22ac6f892
@Override
diff --git a/src/main/java/net/minecraft/world/level/lighting/LightEngineSky.java b/src/main/java/net/minecraft/world/level/lighting/LightEngineSky.java
-index 37fa5faea6e2972e3eb8a3cbd1913ef38dc9456f..fa8d84ce6819b2f41ff7448dec5662ba2df76e77 100644
+index 37fa5faea6e2972e3eb8a3cbd1913ef38dc9456f..9cd2dfbfa216fdc58297fd25066d31bb92e13ec2 100644
--- a/src/main/java/net/minecraft/world/level/lighting/LightEngineSky.java
+++ b/src/main/java/net/minecraft/world/level/lighting/LightEngineSky.java
-@@ -38,21 +38,25 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
+@@ -4,6 +4,7 @@ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.EnumDirection;
+ import net.minecraft.core.SectionPosition;
+ import net.minecraft.world.level.EnumSkyBlock;
++import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.level.chunk.ILightAccess;
+ import net.minecraft.world.level.chunk.NibbleArray;
+@@ -38,21 +39,25 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
return k;
} else {
//MutableInt mutableint = new MutableInt(); // Paper - share mutableint, single threaded
@@ -798,7 +814,7 @@ index 37fa5faea6e2972e3eb8a3cbd1913ef38dc9456f..fa8d84ce6819b2f41ff7448dec5662ba
EnumDirection enumdirection;
if (i == Long.MAX_VALUE) {
-@@ -61,7 +65,7 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
+@@ -61,7 +66,7 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
enumdirection = EnumDirection.a(j2, k2, l2);
}
@@ -807,7 +823,7 @@ index 37fa5faea6e2972e3eb8a3cbd1913ef38dc9456f..fa8d84ce6819b2f41ff7448dec5662ba
VoxelShape voxelshape;
if (enumdirection != null) {
-@@ -91,9 +95,9 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
+@@ -91,9 +96,9 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
}
}
@@ -819,7 +835,7 @@ index 37fa5faea6e2972e3eb8a3cbd1913ef38dc9456f..fa8d84ce6819b2f41ff7448dec5662ba
}
}
}
-@@ -101,10 +105,14 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
+@@ -101,10 +106,14 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
@Override
protected void a(long i, int j, boolean flag) {
@@ -838,7 +854,7 @@ index 37fa5faea6e2972e3eb8a3cbd1913ef38dc9456f..fa8d84ce6819b2f41ff7448dec5662ba
int k1;
if (i1 != 0) {
-@@ -119,15 +127,16 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
+@@ -119,15 +128,16 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
k1 = l1;
}
@@ -859,7 +875,7 @@ index 37fa5faea6e2972e3eb8a3cbd1913ef38dc9456f..fa8d84ce6819b2f41ff7448dec5662ba
if (k == l2 || ((LightEngineStorageSky) this.c).g(l2)) {
this.b(i, k2, j, flag);
-@@ -142,8 +151,8 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
+@@ -142,8 +152,8 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
int k3 = 0;
while (true) {
@@ -870,7 +886,7 @@ index 37fa5faea6e2972e3eb8a3cbd1913ef38dc9456f..fa8d84ce6819b2f41ff7448dec5662ba
if (k == i4) {
this.b(i, l3, j, flag);
-@@ -181,26 +190,36 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
+@@ -181,26 +191,36 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
}
}
@@ -913,7 +929,7 @@ index 37fa5faea6e2972e3eb8a3cbd1913ef38dc9456f..fa8d84ce6819b2f41ff7448dec5662ba
if (l > k2) {
l = k2;
-@@ -215,7 +234,7 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
+@@ -215,7 +235,7 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
j2 = SectionPosition.a(j2, EnumDirection.UP);
}
@@ -1169,10 +1185,10 @@ index 9ba9efb181b9607f25b7c921e69e4c59b182d429..fc0162e7f543d230277457638f208a66
if (!this.i.containsKey(k1) && this.g(k1)) {
for (int l1 = 0; l1 < 16; ++l1) {
diff --git a/src/main/java/net/minecraft/world/level/lighting/LightEngineStorageArray.java b/src/main/java/net/minecraft/world/level/lighting/LightEngineStorageArray.java
-index 0ab4917053c090c874e8bb59e750fd909636f89d..a994e7e93814796d1a5d86f8863d1d21bae51022 100644
+index da78d4c4b5f8af4648ac82d63c21f6a2a5b73ecb..2ce5cf2e5b6e1dae463439fbfde519fa54677714 100644
--- a/src/main/java/net/minecraft/world/level/lighting/LightEngineStorageArray.java
+++ b/src/main/java/net/minecraft/world/level/lighting/LightEngineStorageArray.java
-@@ -6,13 +6,18 @@ import net.minecraft.world.level.chunk.NibbleArray;
+@@ -7,13 +7,18 @@ import net.minecraft.world.level.chunk.NibbleArray;
public abstract class LightEngineStorageArray<M extends LightEngineStorageArray<M>> {
@@ -1194,7 +1210,7 @@ index 0ab4917053c090c874e8bb59e750fd909636f89d..a994e7e93814796d1a5d86f8863d1d21
// Paper start - avoid copying light data
protected LightEngineStorageArray(com.destroystokyo.paper.util.map.QueuedChangesMapLong2Object<NibbleArray> data, boolean isVisible) {
if (isVisible) {
-@@ -20,12 +25,14 @@ public abstract class LightEngineStorageArray<M extends LightEngineStorageArray<
+@@ -21,12 +26,14 @@ public abstract class LightEngineStorageArray<M extends LightEngineStorageArray<
}
this.data = data;
this.isVisible = isVisible;
@@ -1211,7 +1227,7 @@ index 0ab4917053c090c874e8bb59e750fd909636f89d..a994e7e93814796d1a5d86f8863d1d21
this.c();
this.d = true;
}
-@@ -35,7 +42,9 @@ public abstract class LightEngineStorageArray<M extends LightEngineStorageArray<
+@@ -36,7 +43,9 @@ public abstract class LightEngineStorageArray<M extends LightEngineStorageArray<
public void a(long i) {
if (this.isVisible) { throw new IllegalStateException("writing to visible data"); } // Paper - avoid copying light data
NibbleArray updating = this.data.getUpdating(i); // Paper - pool nibbles
@@ -1222,7 +1238,7 @@ index 0ab4917053c090c874e8bb59e750fd909636f89d..a994e7e93814796d1a5d86f8863d1d21
if (updating.cleaner != null) MCUtil.scheduleTask(2, updating.cleaner, "Light Engine Release"); // Paper - delay clean incase anything holding ref was still using it
this.c();
}
-@@ -44,34 +53,34 @@ public abstract class LightEngineStorageArray<M extends LightEngineStorageArray<
+@@ -45,34 +54,34 @@ public abstract class LightEngineStorageArray<M extends LightEngineStorageArray<
return lookup.apply(i) != null; // Paper - avoid copying light data
}
@@ -1278,7 +1294,7 @@ index 0ab4917053c090c874e8bb59e750fd909636f89d..a994e7e93814796d1a5d86f8863d1d21
@Nullable
public NibbleArray d(long i) {
-@@ -81,13 +90,14 @@ public abstract class LightEngineStorageArray<M extends LightEngineStorageArray<
+@@ -82,13 +91,14 @@ public abstract class LightEngineStorageArray<M extends LightEngineStorageArray<
public void a(long i, NibbleArray nibblearray) {
if (this.isVisible) { throw new IllegalStateException("writing to visible data"); } // Paper - avoid copying light data
diff --git a/Spigot-Server-Patches/0495-Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/Spigot-Server-Patches/0495-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
index 6d72c1fd8a..7ac0c4afa3 100644
--- a/Spigot-Server-Patches/0495-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
+++ b/Spigot-Server-Patches/0495-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
@@ -44,16 +44,24 @@ index 32e68e403950be62bd0330b268738225c2e70edd..d0c951878600a4227e558bc68d68098c
printSaveWarning = false;
console.autosavePeriod = configuration.getInt("ticks-per.autosave");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index fa2f6f737b41157b90f455b65d41b1e51fcb4eb5..0a9bdf5e2665aa379cd6c887c534189d8a197191 100644
+index e463dd48593becd701d8e087b8a058b8a4a50ee5..c538e075904382de72a74f518223c6b9daaf0625 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -406,8 +406,21 @@ public class CraftWorld implements World {
+@@ -30,6 +30,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutCustomSoundEffect;
+ import net.minecraft.network.protocol.game.PacketPlayOutUpdateTime;
+ import net.minecraft.network.protocol.game.PacketPlayOutWorldEvent;
+ import net.minecraft.resources.MinecraftKey;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.server.level.ChunkMapDistance;
+ import net.minecraft.server.level.PlayerChunk;
+ import net.minecraft.server.level.PlayerChunkMap;
+@@ -407,8 +408,21 @@ public class CraftWorld implements World {
@Override
public Chunk getChunkAt(int x, int z) {
- return this.world.getChunkProvider().getChunkAt(x, z, true).bukkitChunk;
+ // Paper start - add ticket to hold chunk for a little while longer if plugin accesses it
-+ net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAtIfLoadedImmediately(x, z);
++ net.minecraft.world.level.chunk.Chunk chunk = world.getChunkProvider().getChunkAtIfLoadedImmediately(x, z);
+ if (chunk == null) {
+ addTicket(x, z);
+ chunk = this.world.getChunkProvider().getChunkAt(x, z, true);
@@ -70,7 +78,7 @@ index fa2f6f737b41157b90f455b65d41b1e51fcb4eb5..0a9bdf5e2665aa379cd6c887c534189d
@Override
public Chunk getChunkAt(Block block) {
-@@ -482,7 +495,7 @@ public class CraftWorld implements World {
+@@ -483,7 +497,7 @@ public class CraftWorld implements World {
public boolean unloadChunkRequest(int x, int z) {
org.spigotmc.AsyncCatcher.catchOp("chunk unload"); // Spigot
if (isChunkLoaded(x, z)) {
@@ -79,7 +87,7 @@ index fa2f6f737b41157b90f455b65d41b1e51fcb4eb5..0a9bdf5e2665aa379cd6c887c534189d
}
return true;
-@@ -559,9 +572,12 @@ public class CraftWorld implements World {
+@@ -560,9 +574,12 @@ public class CraftWorld implements World {
org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot
// Paper start - Optimize this method
ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(x, z);
@@ -93,7 +101,7 @@ index fa2f6f737b41157b90f455b65d41b1e51fcb4eb5..0a9bdf5e2665aa379cd6c887c534189d
if (immediate == null) {
immediate = world.getChunkProvider().playerChunkMap.getUnloadingChunk(x, z);
}
-@@ -569,7 +585,7 @@ public class CraftWorld implements World {
+@@ -570,7 +587,7 @@ public class CraftWorld implements World {
if (!(immediate instanceof ProtoChunkExtension) && !(immediate instanceof net.minecraft.world.level.chunk.Chunk)) {
return false; // not full status
}
@@ -102,7 +110,7 @@ index fa2f6f737b41157b90f455b65d41b1e51fcb4eb5..0a9bdf5e2665aa379cd6c887c534189d
world.getChunkAt(x, z); // make sure we're at ticket level 32 or lower
return true;
}
-@@ -596,7 +612,7 @@ public class CraftWorld implements World {
+@@ -597,7 +614,7 @@ public class CraftWorld implements World {
// we do this so we do not re-read the chunk data on disk
}
@@ -111,7 +119,7 @@ index fa2f6f737b41157b90f455b65d41b1e51fcb4eb5..0a9bdf5e2665aa379cd6c887c534189d
world.getChunkProvider().getChunkAt(x, z, ChunkStatus.FULL, true);
return true;
// Paper end
-@@ -2547,6 +2563,7 @@ public class CraftWorld implements World {
+@@ -2548,6 +2565,7 @@ public class CraftWorld implements World {
}
return this.world.getChunkProvider().getChunkAtAsynchronously(x, z, gen, urgent).thenComposeAsync((either) -> {
net.minecraft.world.level.chunk.Chunk chunk = (net.minecraft.world.level.chunk.Chunk) either.left().orElse(null);
diff --git a/Spigot-Server-Patches/0502-Inventory-getHolder-method-without-block-snapshot.patch b/Spigot-Server-Patches/0502-Inventory-getHolder-method-without-block-snapshot.patch
index 9537acdc43..eeb9b62352 100644
--- a/Spigot-Server-Patches/0502-Inventory-getHolder-method-without-block-snapshot.patch
+++ b/Spigot-Server-Patches/0502-Inventory-getHolder-method-without-block-snapshot.patch
@@ -5,17 +5,25 @@ Subject: [PATCH] Inventory getHolder method without block snapshot
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
-index 5e0180ac658db9d7c9d90fd3d3c4eddf6f34c90d..bba9bddc1c0aacade9b7ad56afb1e630caa078fc 100644
+index 45634fded9916dca35a246921efb87964c860339..c3fa97ac34e1fc61ae02f224f8afe5a0b486fb4d 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
-@@ -526,6 +526,13 @@ public class CraftInventory implements Inventory {
+@@ -9,6 +9,7 @@ import net.minecraft.world.inventory.InventoryCrafting;
+ import net.minecraft.world.inventory.InventoryEnderChest;
+ import net.minecraft.world.inventory.InventoryMerchant;
+ import net.minecraft.world.level.block.entity.IHopper;
++import net.minecraft.world.level.block.entity.TileEntity;
+ import net.minecraft.world.level.block.entity.TileEntityBarrel;
+ import net.minecraft.world.level.block.entity.TileEntityBlastFurnace;
+ import net.minecraft.world.level.block.entity.TileEntityBrewingStand;
+@@ -526,6 +527,13 @@ public class CraftInventory implements Inventory {
return inventory.getOwner();
}
+ // Paper start - getHolder without snapshot
+ @Override
+ public InventoryHolder getHolder(boolean useSnapshot) {
-+ return inventory instanceof net.minecraft.server.TileEntity ? ((net.minecraft.server.TileEntity) inventory).getOwner(useSnapshot) : getHolder();
++ return inventory instanceof TileEntity ? ((TileEntity) inventory).getOwner(useSnapshot) : getHolder();
+ }
+ // Paper end
+
@@ -23,7 +31,7 @@ index 5e0180ac658db9d7c9d90fd3d3c4eddf6f34c90d..bba9bddc1c0aacade9b7ad56afb1e630
public int getMaxStackSize() {
return inventory.getMaxStackSize();
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java
-index e917db0b01c2fef46a1ea873bee9aa25044de036..ad425d89bcae3045d0e35ecfb70a233895f88cc8 100644
+index 47029af761e26453090980b9a231fd53d4238cc4..d22abb4259dfcfd3ec0e0516f87fc838a81353ce 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java
@@ -64,6 +64,13 @@ public class CraftInventoryDoubleChest extends CraftInventory implements DoubleC
diff --git a/Spigot-Server-Patches/0507-Add-permission-for-command-blocks.patch b/Spigot-Server-Patches/0507-Add-permission-for-command-blocks.patch
index d1f957641e..7786a8cda6 100644
--- a/Spigot-Server-Patches/0507-Add-permission-for-command-blocks.patch
+++ b/Spigot-Server-Patches/0507-Add-permission-for-command-blocks.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add permission for command blocks
diff --git a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
-index 3dcfb2326af92eb7a9cd16fd4725b3ae9acee17b..8b6367d3bb4cbb007bf68d957a6c1f701f5643b6 100644
+index 37e436c28c3c71c73fb0e7bf06a417739a318e47..831bc83cdbf15f08961cc8703be348b458d47fd3 100644
--- a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
-@@ -384,7 +384,7 @@ public class PlayerInteractManager {
+@@ -386,7 +386,7 @@ public class PlayerInteractManager {
TileEntity tileentity = this.world.getTileEntity(blockposition);
Block block = iblockdata.getBlock();
@@ -18,7 +18,7 @@ index 3dcfb2326af92eb7a9cd16fd4725b3ae9acee17b..8b6367d3bb4cbb007bf68d957a6c1f70
return false;
} else if (this.player.a((World) this.world, blockposition, this.gamemode)) {
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
-index 3839a82328bd8d6f8e395b833c9bac6cc8564016..a28441952e57e92a24a2933feb9188b13f15af2f 100644
+index 2f61d5fcaff10d2e5514f60a8a6430aa3949a077..134f1f811d7d822e1871d306129ae0cbb1d1c8b2 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -796,7 +796,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -40,10 +40,10 @@ index 3839a82328bd8d6f8e395b833c9bac6cc8564016..a28441952e57e92a24a2933feb9188b1
} else {
CommandBlockListenerAbstract commandblocklistenerabstract = packetplayinsetcommandminecart.a(this.player.world);
diff --git a/src/main/java/net/minecraft/world/level/CommandBlockListenerAbstract.java b/src/main/java/net/minecraft/world/level/CommandBlockListenerAbstract.java
-index 0f966c5defdda58fd7d31072b625f16928cddeb7..d92ec078e4df3a9d3f43f5d930890d1573bc4eac 100644
+index 3fcdff3649c725580456dfc965d6c83bd5afe3da..85e7957103d2b2e16e4d3a3ea0bd7de4935f61cd 100644
--- a/src/main/java/net/minecraft/world/level/CommandBlockListenerAbstract.java
+++ b/src/main/java/net/minecraft/world/level/CommandBlockListenerAbstract.java
-@@ -191,7 +191,7 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener {
+@@ -192,7 +192,7 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener {
}
public EnumInteractionResult a(EntityHuman entityhuman) {
diff --git a/Spigot-Server-Patches/0509-Optimize-WorldBorder-collision-checks-and-air.patch b/Spigot-Server-Patches/0509-Optimize-WorldBorder-collision-checks-and-air.patch
index b239f9dd96..b153f9d172 100644
--- a/Spigot-Server-Patches/0509-Optimize-WorldBorder-collision-checks-and-air.patch
+++ b/Spigot-Server-Patches/0509-Optimize-WorldBorder-collision-checks-and-air.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Optimize WorldBorder collision checks and air
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 6b9c73265a987be4da9b1657ff594cde1f3e6304..2dc65047fcba5d498caf76ce2ceeebf7a914b8cd 100644
+index c50b89ee8f16821923933025bf19243771dd1604..27e5ba64ed6406c1ece318bf79fca0f261a77818 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -909,7 +909,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -18,10 +18,10 @@ index 6b9c73265a987be4da9b1657ff594cde1f3e6304..2dc65047fcba5d498caf76ce2ceeebf7
return true;
});
diff --git a/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java b/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java
-index 1fe6aba0884755be3382d38cebfdd1916bd9180e..03b624e3f62a1b938efe2d5f7d8c2b58d362bbde 100644
+index d0cc8677f2be422722160fee9b71894b5ddd3186..03584572fa5bf0d96fc4cecece573547f9c94cea 100644
--- a/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java
+++ b/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java
-@@ -140,10 +140,10 @@ public class VoxelShapeSpliterator extends AbstractSpliterator<VoxelShape> {
+@@ -143,10 +143,10 @@ public class VoxelShapeSpliterator extends AbstractSpliterator<VoxelShape> {
AxisAlignedBB axisalignedbb = this.a.getBoundingBox();
if (!a(worldborder, axisalignedbb)) {
diff --git a/Spigot-Server-Patches/0510-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/Spigot-Server-Patches/0510-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
index 97b0c48a60..c5161b36b8 100644
--- a/Spigot-Server-Patches/0510-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
+++ b/Spigot-Server-Patches/0510-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
@@ -8,10 +8,10 @@ makes it so that the server keeps the last difficulty used instead
of restoring the server.properties every single load.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index b1a05896c50787657421e4cf721b9100bb38706d..31a083730536177c5ff5ae463ca0b9780968a5d8 100644
+index 2deeaf23b8dd0ee5dc126797b271681a5f7880df..3867e1d9a3d3648aaea46816643c0d8f070baf5d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1633,11 +1633,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1635,11 +1635,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
}
@@ -33,10 +33,18 @@ index b1a05896c50787657421e4cf721b9100bb38706d..31a083730536177c5ff5ae463ca0b978
}
diff --git a/src/main/java/net/minecraft/server/commands/CommandDifficulty.java b/src/main/java/net/minecraft/server/commands/CommandDifficulty.java
-index 1773fa44f55c6f6dcda0afceff4db39881861879..21125087e9a81dee994cbec7ee7ad41447772a32 100644
+index 1773fa44f55c6f6dcda0afceff4db39881861879..4a43b4632a5cb1e3b5659c9c6c44b42d33bbfcd4 100644
--- a/src/main/java/net/minecraft/server/commands/CommandDifficulty.java
+++ b/src/main/java/net/minecraft/server/commands/CommandDifficulty.java
-@@ -41,10 +41,11 @@ public class CommandDifficulty {
+@@ -7,6 +7,7 @@ import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
+ import net.minecraft.commands.CommandListenerWrapper;
+ import net.minecraft.network.chat.ChatMessage;
+ import net.minecraft.server.MinecraftServer;
++import net.minecraft.server.level.WorldServer;
+ import net.minecraft.world.EnumDifficulty;
+
+ public class CommandDifficulty {
+@@ -41,10 +42,11 @@ public class CommandDifficulty {
public static int a(CommandListenerWrapper commandlistenerwrapper, EnumDifficulty enumdifficulty) throws CommandSyntaxException {
MinecraftServer minecraftserver = commandlistenerwrapper.getServer();
@@ -64,7 +72,7 @@ index ec1f36736d79d4054ad7ff4da4e3659f35c811d6..c4df472050622eb2469b2ddb4d2ed917
@Override
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
-index a28441952e57e92a24a2933feb9188b13f15af2f..95f4d39f3c21933f440f8ee3e29fd8a533dfb4c1 100644
+index 134f1f811d7d822e1871d306129ae0cbb1d1c8b2..316cb57870a6a3f568bb3d353540283b9d785976 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -3027,7 +3027,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
diff --git a/Spigot-Server-Patches/0512-Don-t-allow-null-UUID-s-for-chat.patch b/Spigot-Server-Patches/0512-Don-t-allow-null-UUID-s-for-chat.patch
index 635d0cb1dc..5479393854 100644
--- a/Spigot-Server-Patches/0512-Don-t-allow-null-UUID-s-for-chat.patch
+++ b/Spigot-Server-Patches/0512-Don-t-allow-null-UUID-s-for-chat.patch
@@ -5,10 +5,18 @@ Subject: [PATCH] Don't allow null UUID's for chat
diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java
-index d4cf5536883192c49636177cb782a9a2f514cd87..f3cd2b585c6cf1cf948de49a5608e04ee6eb9aab 100644
+index d4cf5536883192c49636177cb782a9a2f514cd87..2203a3d89a3d9f9b3b6b068f6600e79a584f8a67 100644
--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java
+++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java
-@@ -20,7 +20,7 @@ public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
+@@ -2,6 +2,7 @@ package net.minecraft.network.protocol.game;
+
+ import java.io.IOException;
+ import java.util.UUID;
++import net.minecraft.SystemUtils;
+ import net.minecraft.network.PacketDataSerializer;
+ import net.minecraft.network.chat.ChatMessageType;
+ import net.minecraft.network.chat.IChatBaseComponent;
+@@ -20,7 +21,7 @@ public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent, ChatMessageType chatmessagetype, UUID uuid) {
this.a = ichatbasecomponent;
this.b = chatmessagetype;
diff --git a/Spigot-Server-Patches/0516-Convert-legacy-attributes-in-Item-Meta.patch b/Spigot-Server-Patches/0516-Convert-legacy-attributes-in-Item-Meta.patch
index 1417fefe97..025b86e719 100644
--- a/Spigot-Server-Patches/0516-Convert-legacy-attributes-in-Item-Meta.patch
+++ b/Spigot-Server-Patches/0516-Convert-legacy-attributes-in-Item-Meta.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Convert legacy attributes in Item Meta
diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java
-index bf3b236b2090fe4dd67e2f87b0b27c8d7186cb48..c5dd25add39298342a6f4b2a05e137de93d1e62b 100644
+index 43fa8d3c573540682fc87ee2bf8d61ba80d3732d..673948947bd918c1dbb6c4c99486b4200e3c09fe 100644
--- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java
+++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java
@@ -13,6 +13,20 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey;
@@ -30,10 +30,10 @@ index bf3b236b2090fe4dd67e2f87b0b27c8d7186cb48..c5dd25add39298342a6f4b2a05e137de
public CraftAttributeMap(AttributeMapBase handle) {
this.handle = handle;
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-index d14e640167e1d00b91ea63038cb434b9c83ce887..541c9f8ae334cc348ada8a65998f5a4b53eab4b3 100644
+index 8f8dccd6fb2e49d65383d6e8f3fc5ffbabd2b7a5..8398ac45e988c621b3e059d75101185513ddd9ab 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-@@ -479,7 +479,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -481,7 +481,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);
diff --git a/Spigot-Server-Patches/0517-Remove-some-streams-from-structures.patch b/Spigot-Server-Patches/0517-Remove-some-streams-from-structures.patch
index b7d5cb5320..3daaa31723 100644
--- a/Spigot-Server-Patches/0517-Remove-some-streams-from-structures.patch
+++ b/Spigot-Server-Patches/0517-Remove-some-streams-from-structures.patch
@@ -109,10 +109,18 @@ index 7147cdda756ccb3d4f6880802128f68601783883..15096a9c2719b8b4c099f62d0a1c808e
CrashReport crashreport = CrashReport.a(exception, "Feature placement");
diff --git a/src/main/java/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java
-index 700b32322e8d0fbb8ec2824e50a340be16b48f81..d842cb5a8fdcdd8f77c7b44cc83c8341f947d7b3 100644
+index 700b32322e8d0fbb8ec2824e50a340be16b48f81..369fb0bda22f02e76b901b6eb8990651c53c7577 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java
-@@ -455,7 +455,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator {
+@@ -40,6 +40,7 @@ import net.minecraft.world.level.levelgen.feature.structures.WorldGenFeatureDefi
+ import net.minecraft.world.level.levelgen.feature.structures.WorldGenFeatureDefinedStructurePoolTemplate;
+ import net.minecraft.world.level.levelgen.structure.StructureBoundingBox;
+ import net.minecraft.world.level.levelgen.structure.StructurePiece;
++import net.minecraft.world.level.levelgen.structure.StructureStart;
+ import net.minecraft.world.level.levelgen.structure.WorldGenFeaturePillagerOutpostPoolPiece;
+ import net.minecraft.world.level.levelgen.synth.NoiseGenerator;
+ import net.minecraft.world.level.levelgen.synth.NoiseGenerator3;
+@@ -455,7 +456,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator {
while (iterator.hasNext()) {
StructureGenerator<?> structuregenerator = (StructureGenerator) iterator.next();
@@ -121,7 +129,7 @@ index 700b32322e8d0fbb8ec2824e50a340be16b48f81..d842cb5a8fdcdd8f77c7b44cc83c8341
Iterator iterator1 = structurestart.d().iterator();
while (iterator1.hasNext()) {
-@@ -487,7 +487,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator {
+@@ -487,7 +488,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator {
}
}
diff --git a/Spigot-Server-Patches/0519-Support-components-in-ItemMeta.patch b/Spigot-Server-Patches/0519-Support-components-in-ItemMeta.patch
index f771188233..6f1e33b76d 100644
--- a/Spigot-Server-Patches/0519-Support-components-in-ItemMeta.patch
+++ b/Spigot-Server-Patches/0519-Support-components-in-ItemMeta.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Support components in ItemMeta
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-index 541c9f8ae334cc348ada8a65998f5a4b53eab4b3..6771c962c1f7dd43595585b7dd173c9c5dd182d7 100644
+index 8398ac45e988c621b3e059d75101185513ddd9ab..5c1319a86f6314c1d0a979af34424ee025a8030f 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-@@ -873,11 +873,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -875,11 +875,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return CraftChatMessage.fromJSONComponent(displayName);
}
@@ -32,7 +32,7 @@ index 541c9f8ae334cc348ada8a65998f5a4b53eab4b3..6771c962c1f7dd43595585b7dd173c9c
@Override
public boolean hasDisplayName() {
return displayName != null;
-@@ -1020,6 +1032,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1022,6 +1034,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return this.lore == null ? null : new ArrayList<String>(Lists.transform(this.lore, CraftChatMessage::fromJSONComponent));
}
@@ -47,7 +47,7 @@ index 541c9f8ae334cc348ada8a65998f5a4b53eab4b3..6771c962c1f7dd43595585b7dd173c9c
@Override
public void setLore(List<String> lore) {
if (lore == null || lore.isEmpty()) {
-@@ -1034,6 +1054,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1036,6 +1056,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
}
@@ -69,7 +69,7 @@ index 541c9f8ae334cc348ada8a65998f5a4b53eab4b3..6771c962c1f7dd43595585b7dd173c9c
@Override
public boolean hasCustomModelData() {
return customModelData != null;
-@@ -1495,6 +1530,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1497,6 +1532,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
for (Object object : addFrom) {
diff --git a/Spigot-Server-Patches/0521-Add-entity-liquid-API.patch b/Spigot-Server-Patches/0521-Add-entity-liquid-API.patch
index e4451979e4..abbec1c1e7 100644
--- a/Spigot-Server-Patches/0521-Add-entity-liquid-API.patch
+++ b/Spigot-Server-Patches/0521-Add-entity-liquid-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add entity liquid API
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 2dc65047fcba5d498caf76ce2ceeebf7a914b8cd..f0e120e0d0da6949b7a5a12e5217b3d70ccec7fa 100644
+index 27e5ba64ed6406c1ece318bf79fca0f261a77818..743d4725c0a26a8abd0a98eed2ec45ffba6211ad 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1166,12 +1166,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -40,10 +40,10 @@ index 2dc65047fcba5d498caf76ce2ceeebf7a914b8cd..f0e120e0d0da6949b7a5a12e5217b3d7
return !this.justCreated && this.M.getDouble(TagsFluid.LAVA) > 0.0D;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index 27b90388cc21ffdccaabc8072ead1bd29f3e88c6..d76800778ccf05913ff887a566b3a2f11ec2d40b 100644
+index 266b2cbd6bfaf10743929a1eeb9732a5d1fb4c62..387f6f6fa9bbb1cce544cfb907f68c7993752dd7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-@@ -1133,5 +1133,29 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+@@ -1137,5 +1137,29 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason() {
return getHandle().spawnReason;
}
diff --git a/Spigot-Server-Patches/0527-Optimize-NetworkManager-Exception-Handling.patch b/Spigot-Server-Patches/0527-Optimize-NetworkManager-Exception-Handling.patch
index 3d34422c4b..267d81608f 100644
--- a/Spigot-Server-Patches/0527-Optimize-NetworkManager-Exception-Handling.patch
+++ b/Spigot-Server-Patches/0527-Optimize-NetworkManager-Exception-Handling.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimize NetworkManager Exception Handling
diff --git a/src/main/java/net/minecraft/network/EnumProtocol.java b/src/main/java/net/minecraft/network/EnumProtocol.java
-index 539084d087bc6bd38d333066d3f8238cf2b08900..2c26c28b07e86735de2b8e594cd83e9cba4f193b 100644
+index a892521db1197369bf6363bd2f5da24bf53643ab..46d8471ba98a5f2c659d35dd86c4c20c67f1ceac 100644
--- a/src/main/java/net/minecraft/network/EnumProtocol.java
+++ b/src/main/java/net/minecraft/network/EnumProtocol.java
-@@ -279,6 +279,7 @@ public enum EnumProtocol {
+@@ -286,6 +286,7 @@ public enum EnumProtocol {
@Nullable
public Packet<?> a(int i) {
@@ -59,10 +59,20 @@ index b644c91cecd8a347319dfe8c8923fd05919a9795..4c583593de4dc8ab27b3e1187f4dfe17
public interface Packet<T extends PacketListener> {
diff --git a/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java b/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java
-index e47da20ab8ce4da34755e105bf55d8542fb50138..839fa47bea425edcd31bcbbef2535c1a5f118c71 100644
+index e47da20ab8ce4da34755e105bf55d8542fb50138..67d8fe8ad036a9252c774bb6a914c8ec79981876 100644
--- a/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java
+++ b/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java
-@@ -31,6 +31,21 @@ public class PlayerConnectionUtils {
+@@ -1,6 +1,9 @@
+ package net.minecraft.network.protocol;
+
++import net.minecraft.network.NetworkManager;
+ import net.minecraft.network.PacketListener;
++import net.minecraft.network.chat.ChatComponentText;
++import net.minecraft.network.protocol.game.PacketPlayOutKickDisconnect;
+ import net.minecraft.server.CancelledPacketHandleException;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.util.thread.IAsyncTaskHandler;
+@@ -31,6 +34,21 @@ public class PlayerConnectionUtils {
try (Timing ignored = timing.startTiming()) { // Paper - timings
packet.a(t0);
} // Paper - timings
diff --git a/Spigot-Server-Patches/0536-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch b/Spigot-Server-Patches/0536-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch
index d53d5ae953..e8ab744e26 100644
--- a/Spigot-Server-Patches/0536-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch
+++ b/Spigot-Server-Patches/0536-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch
@@ -70,7 +70,7 @@ index c2ee816af000f0c94782d704e6372cd93fd34bb3..c6388223daa26b200dc16cd562bcef19
if (t0.b().a(loottableinfo) && predicate.test(t0)) {
if (list == null) {
diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
-index e1d3f7e63c731f9376900a86abe17282e9b55ded..cc89bc1880a8c095942ba4e34c1bf4202e8dbedc 100644
+index e1d3f7e63c731f9376900a86abe17282e9b55ded..8e760445885f6ab92f60db0ee2a02d098b5e5f03 100644
--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
+++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
@@ -39,6 +39,7 @@ import net.minecraft.advancements.CriterionInstance;
@@ -86,7 +86,7 @@ index e1d3f7e63c731f9376900a86abe17282e9b55ded..cc89bc1880a8c095942ba4e34c1bf420
private boolean m = true;
+ // Paper start - fix advancement data player leakage
-+ final Map<CriterionTriggerAbstract, Set<CriterionTrigger.a>> criterionData = Maps.newIdentityHashMap();
++ public final Map<CriterionTriggerAbstract, Set<CriterionTrigger.a>> criterionData = Maps.newIdentityHashMap();
+ // Paper end - fix advancement data player leakage
+
public AdvancementDataPlayer(DataFixer datafixer, PlayerList playerlist, AdvancementDataWorld advancementdataworld, File file, EntityPlayer entityplayer) {
diff --git a/Spigot-Server-Patches/0537-Add-missing-strikeLighting-call-to-World-spigot-stri.patch b/Spigot-Server-Patches/0537-Add-missing-strikeLighting-call-to-World-spigot-stri.patch
index 73d1a2f6fb..dd9940c249 100644
--- a/Spigot-Server-Patches/0537-Add-missing-strikeLighting-call-to-World-spigot-stri.patch
+++ b/Spigot-Server-Patches/0537-Add-missing-strikeLighting-call-to-World-spigot-stri.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Add missing strikeLighting call to
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 0a9bdf5e2665aa379cd6c887c534189d8a197191..5f23438b0031d57c49a8c7a7ccbd0f87a2d76875 100644
+index c538e075904382de72a74f518223c6b9daaf0625..54625156dd21607f27eb97f95dead60b806f19e1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -2626,6 +2626,7 @@ public class CraftWorld implements World {
+@@ -2628,6 +2628,7 @@ public class CraftWorld implements World {
lightning.teleportAndSync( loc.getX(), loc.getY(), loc.getZ() );
lightning.isEffect = true;
lightning.isSilent = isSilent;
diff --git a/Spigot-Server-Patches/0540-Incremental-player-saving.patch b/Spigot-Server-Patches/0540-Incremental-player-saving.patch
index 18f64b3e21..4f08d55d98 100644
--- a/Spigot-Server-Patches/0540-Incremental-player-saving.patch
+++ b/Spigot-Server-Patches/0540-Incremental-player-saving.patch
@@ -25,10 +25,10 @@ index b67ba8f75e4a3358d7c2462918b85b0bf9b5a922..fdbd8b89bb8bf3b61f60b812b90483c9
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 31a083730536177c5ff5ae463ca0b9780968a5d8..1f7435c78b1b522ba76a43440cf3a4e62ae0e0ee 100644
+index 3867e1d9a3d3648aaea46816643c0d8f070baf5d..ca284cd0419f5d99efa7e73c19fa1591261d8d5b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1335,9 +1335,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1337,9 +1337,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
//if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit // Paper - move down
//MinecraftServer.LOGGER.debug("Autosave started"); // Paper
serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper
@@ -59,7 +59,7 @@ index 5d6865fd7b67c2031440a8bd862099244d2ea407..81fd2efd25d9f5ffdabd40fb29f356db
public NetworkManager networkManager; // Paper
public final MinecraftServer server;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 503ad38073fd8334d6692df97ea3fb68ded694d5..7127e5f2cd8eb72220c959cb83711ad9b9c240c2 100644
+index 1b78f53d09cc26fe881933df8aa1a7e77337acf1..939e3721af52069f1abad79d28c0555be3ac2d59 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -563,6 +563,7 @@ public abstract class PlayerList {
diff --git a/Spigot-Server-Patches/0542-Don-t-mark-null-chunk-sections-for-block-updates.patch b/Spigot-Server-Patches/0542-Don-t-mark-null-chunk-sections-for-block-updates.patch
index 9a6e701328..c694cf5898 100644
--- a/Spigot-Server-Patches/0542-Don-t-mark-null-chunk-sections-for-block-updates.patch
+++ b/Spigot-Server-Patches/0542-Don-t-mark-null-chunk-sections-for-block-updates.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't mark null chunk sections for block updates
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java
-index b19c3bdbf64dc44f01487a3d17236a03a95708b5..dbd3d021f42ca45edbb061ce29746bc84331a0ad 100644
+index d6a5a0b17308913a5efd97cd27fabd0825ef68c6..00cebd33101916f29bbc192d531ac0fba31e037b 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java
-@@ -449,6 +449,7 @@ public class PlayerChunk {
+@@ -450,6 +450,7 @@ public class PlayerChunk {
this.a(world, blockposition, iblockdata);
} else {
ChunkSection chunksection = chunk.getSections()[sectionposition.getY()];
diff --git a/Spigot-Server-Patches/0546-Do-not-let-the-server-load-chunks-from-newer-version.patch b/Spigot-Server-Patches/0546-Do-not-let-the-server-load-chunks-from-newer-version.patch
index 8c28606163..1848cd99d4 100644
--- a/Spigot-Server-Patches/0546-Do-not-let-the-server-load-chunks-from-newer-version.patch
+++ b/Spigot-Server-Patches/0546-Do-not-let-the-server-load-chunks-from-newer-version.patch
@@ -9,10 +9,10 @@ the game, immediately stop the server to prevent data corruption.
You can override this functionality at your own peril.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-index 427544bc0ad72f82a54e9d2f7dbb3373a25c5ca3..4449a4e9609970622394bb4a3968d73a4d825382 100644
+index 8e4924cd649c350520cba54a0e1497d5acf089ff..2e5221bc1b9e260e33f2cef2653dc59d05e2680d 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-@@ -93,10 +93,24 @@ public class ChunkRegionLoader {
+@@ -95,10 +95,24 @@ public class ChunkRegionLoader {
return holder.protoChunk;
}
diff --git a/Spigot-Server-Patches/0547-Brand-support.patch b/Spigot-Server-Patches/0547-Brand-support.patch
index 69ad6579b7..0b85e68ef4 100644
--- a/Spigot-Server-Patches/0547-Brand-support.patch
+++ b/Spigot-Server-Patches/0547-Brand-support.patch
@@ -73,10 +73,10 @@ index bd6f3e9d321abcf039875dd5c9f7ccc59afd2dd2..0d65ffcad016a5f3fa9ddf616bc54908
return (!this.player.joining && !this.networkManager.isConnected()) || this.processedDisconnect; // Paper
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index bfca937a85ea8249f81b746a15835520a3b22dd1..d75bf9ecb70224f5e9772f98ac5633244828202e 100644
+index ba8c36c9fa7a1fdc3047b14042da8703802f9275..a4726747c066d623f37162e2637403efee7f5708 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2378,6 +2378,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2385,6 +2385,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end
};
diff --git a/Spigot-Server-Patches/0554-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/Spigot-Server-Patches/0554-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
index ad5f568ff9..060c516f40 100644
--- a/Spigot-Server-Patches/0554-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
+++ b/Spigot-Server-Patches/0554-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
@@ -24,10 +24,10 @@ index 0e738ace7d37011547378954aae91f79c7ebd544..7f5d3bcf8be30a6bcdd077bfbc416079
// if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add
this.removeTicketsForSpawn(this.paperConfig.keepLoadedRange, prevSpawn);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 5f23438b0031d57c49a8c7a7ccbd0f87a2d76875..aea493db53d6a3c98f081ba72b1b03b7e2cdd8e5 100644
+index 54625156dd21607f27eb97f95dead60b806f19e1..1d1b150215c1e226fa2583829f0260cba4133f23 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -387,11 +387,13 @@ public class CraftWorld implements World {
+@@ -389,11 +389,13 @@ public class CraftWorld implements World {
public boolean setSpawnLocation(int x, int y, int z, float angle) {
try {
Location previousLocation = getSpawnLocation();
diff --git a/Spigot-Server-Patches/0555-Add-moon-phase-API.patch b/Spigot-Server-Patches/0555-Add-moon-phase-API.patch
index 671f1533a0..dfb33917e6 100644
--- a/Spigot-Server-Patches/0555-Add-moon-phase-API.patch
+++ b/Spigot-Server-Patches/0555-Add-moon-phase-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add moon phase API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index aea493db53d6a3c98f081ba72b1b03b7e2cdd8e5..82d478cfa296be9c8d19e8dbd8d3485443108e40 100644
+index 1d1b150215c1e226fa2583829f0260cba4133f23..4fe821c5bac2f713529668b2001f95cc3cb2c388 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -326,6 +326,11 @@ public class CraftWorld implements World {
+@@ -328,6 +328,11 @@ public class CraftWorld implements World {
public int getPlayerCount() {
return world.players.size();
}
diff --git a/Spigot-Server-Patches/0557-Add-BellRingEvent.patch b/Spigot-Server-Patches/0557-Add-BellRingEvent.patch
index 45e1a91e9f..6352b44128 100644
--- a/Spigot-Server-Patches/0557-Add-BellRingEvent.patch
+++ b/Spigot-Server-Patches/0557-Add-BellRingEvent.patch
@@ -7,10 +7,10 @@ Add a new event, BellRingEvent, to trigger whenever a player rings a
village bell. Passes along the bell block and the player who rang it.
diff --git a/src/main/java/net/minecraft/world/level/block/BlockBell.java b/src/main/java/net/minecraft/world/level/block/BlockBell.java
-index 687f7acd8254294b568c9adf3e72d02d12551381..60beeeff73efc155029c5f214ead3f520f2c3bac 100644
+index 687f7acd8254294b568c9adf3e72d02d12551381..24754057bc83577f4854262bbb82db355591270e 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockBell.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockBell.java
-@@ -1,5 +1,7 @@
+@@ -1,8 +1,11 @@
package net.minecraft.world.level.block;
+import io.papermc.paper.event.block.BellRingEvent;
@@ -18,7 +18,11 @@ index 687f7acd8254294b568c9adf3e72d02d12551381..60beeeff73efc155029c5f214ead3f52
import javax.annotation.Nullable;
import net.minecraft.core.BlockPosition;
import net.minecraft.core.EnumDirection;
-@@ -89,7 +91,7 @@ public class BlockBell extends BlockTileEntity {
++import net.minecraft.server.MCUtil;
+ import net.minecraft.sounds.SoundCategory;
+ import net.minecraft.sounds.SoundEffects;
+ import net.minecraft.stats.StatisticList;
+@@ -89,7 +92,7 @@ public class BlockBell extends BlockTileEntity {
boolean flag1 = !flag || this.a(iblockdata, enumdirection, movingobjectpositionblock.getPos().y - (double) blockposition.getY());
if (flag1) {
@@ -27,7 +31,7 @@ index 687f7acd8254294b568c9adf3e72d02d12551381..60beeeff73efc155029c5f214ead3f52
if (flag2 && entityhuman != null) {
entityhuman.a(StatisticList.BELL_RING);
-@@ -123,6 +125,11 @@ public class BlockBell extends BlockTileEntity {
+@@ -123,6 +126,11 @@ public class BlockBell extends BlockTileEntity {
}
public boolean a(World world, BlockPosition blockposition, @Nullable EnumDirection enumdirection) {
@@ -39,7 +43,7 @@ index 687f7acd8254294b568c9adf3e72d02d12551381..60beeeff73efc155029c5f214ead3f52
TileEntity tileentity = world.getTileEntity(blockposition);
if (!world.isClientSide && tileentity instanceof TileEntityBell) {
-@@ -130,6 +137,7 @@ public class BlockBell extends BlockTileEntity {
+@@ -130,6 +138,7 @@ public class BlockBell extends BlockTileEntity {
enumdirection = (EnumDirection) world.getType(blockposition).get(BlockBell.a);
}
diff --git a/Spigot-Server-Patches/0564-Add-more-Evoker-API.patch b/Spigot-Server-Patches/0564-Add-more-Evoker-API.patch
index 2b3c0ab1e9..ccde2ad0c9 100644
--- a/Spigot-Server-Patches/0564-Add-more-Evoker-API.patch
+++ b/Spigot-Server-Patches/0564-Add-more-Evoker-API.patch
@@ -27,10 +27,17 @@ index 64bfd84e8a5a0c2b1fec7044b688c7cc1083f18a..2aa6b6ca93c25c59ad224348aad1bb34
this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300));
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, false));
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
-index 5e8e9d95068342661a962aae9878a7eafaa06207..081e038b8e6ec4c08f29f46ed00b14694a8c47a9 100644
+index 5e8e9d95068342661a962aae9878a7eafaa06207..75a7832e9841921497a9a2d1cfd1b05807fe6ede 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
-@@ -36,4 +36,17 @@ public class CraftEvoker extends CraftSpellcaster implements Evoker {
+@@ -1,5 +1,6 @@
+ package org.bukkit.craftbukkit.entity;
+
++import net.minecraft.world.entity.animal.EntitySheep;
+ import net.minecraft.world.entity.monster.EntityEvoker;
+ import net.minecraft.world.entity.monster.EntityIllagerWizard;
+ import org.bukkit.craftbukkit.CraftServer;
+@@ -36,4 +37,17 @@ public class CraftEvoker extends CraftSpellcaster implements Evoker {
public void setCurrentSpell(Evoker.Spell spell) {
getHandle().setSpell(spell == null ? EntityIllagerWizard.Spell.NONE : EntityIllagerWizard.Spell.a(spell.ordinal()));
}
@@ -38,7 +45,7 @@ index 5e8e9d95068342661a962aae9878a7eafaa06207..081e038b8e6ec4c08f29f46ed00b1469
+ // Paper start
+ @Override
+ public org.bukkit.entity.Sheep getWololoTarget() {
-+ net.minecraft.server.EntitySheep sheep = getHandle().getWololoTarget();
++ EntitySheep sheep = getHandle().getWololoTarget();
+ return sheep == null ? null : (org.bukkit.entity.Sheep) sheep.getBukkitEntity();
+ }
+
diff --git a/Spigot-Server-Patches/0567-Cache-block-data-strings.patch b/Spigot-Server-Patches/0567-Cache-block-data-strings.patch
index 2a0fbedbaf..7399db471f 100644
--- a/Spigot-Server-Patches/0567-Cache-block-data-strings.patch
+++ b/Spigot-Server-Patches/0567-Cache-block-data-strings.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 1f7435c78b1b522ba76a43440cf3a4e62ae0e0ee..27e7547a6414e84e170ca33bdb276a451f35cf46 100644
+index ca284cd0419f5d99efa7e73c19fa1591261d8d5b..97085ae04f77b79a367cd328905d4b68ebaca133 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1941,6 +1941,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1943,6 +1943,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.getPlayerList().reload();
this.customFunctionData.a(this.dataPackResources.a());
this.ak.a(this.dataPackResources.h());
@@ -17,10 +17,18 @@ index 1f7435c78b1b522ba76a43440cf3a4e62ae0e0ee..27e7547a6414e84e170ca33bdb276a45
if (this.isMainThread()) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
-index ed88da727feddc319a650fb35710d16727f6dbd7..61d08973be351017df2d1a9f0ab12101cfe15af5 100644
+index ed88da727feddc319a650fb35710d16727f6dbd7..58f892478de74b853cd35ef2fec8c462e3a9ecee 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
-@@ -476,9 +476,39 @@ public class CraftBlockData implements BlockData {
+@@ -13,6 +13,7 @@ import net.minecraft.commands.arguments.blocks.ArgumentBlock;
+ import net.minecraft.core.EnumDirection;
+ import net.minecraft.core.IRegistry;
+ import net.minecraft.nbt.NBTTagCompound;
++import net.minecraft.resources.MinecraftKey;
+ import net.minecraft.util.INamable;
+ import net.minecraft.world.level.block.Block;
+ import net.minecraft.world.level.block.state.IBlockData;
+@@ -476,9 +477,39 @@ public class CraftBlockData implements BlockData {
Preconditions.checkState(MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit);
}
@@ -46,7 +54,7 @@ index ed88da727feddc319a650fb35710d16727f6dbd7..61d08973be351017df2d1a9f0ab12101
+ if (material != null) {
+ Block block = CraftMagicNumbers.getBlock(material);
+ if (block != null) {
-+ net.minecraft.server.MinecraftKey key = IRegistry.BLOCK.getKey(block);
++ MinecraftKey key = IRegistry.BLOCK.getKey(block);
+ data = data == null ? key.toString() : key + data;
+ }
+ }
diff --git a/Spigot-Server-Patches/0568-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/Spigot-Server-Patches/0568-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch
index 2e3cf160a4..9e7d861f99 100644
--- a/Spigot-Server-Patches/0568-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch
+++ b/Spigot-Server-Patches/0568-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch
@@ -31,7 +31,7 @@ index 0d65ffcad016a5f3fa9ddf616bc549087bf1335b..acbb629345d09f6ea9b18d20ab3e334c
this.player.playerConnection.sendPacket(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.teleportAwait));
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index f0e120e0d0da6949b7a5a12e5217b3d70ccec7fa..0a853ffc658d8e82c21af7853bdaa9112a4e1e20 100644
+index 743d4725c0a26a8abd0a98eed2ec45ffba6211ad..344862c3f479ae7b6d4f929c9ef7882aba983ffb 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -145,6 +145,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -57,10 +57,10 @@ index f0e120e0d0da6949b7a5a12e5217b3d70ccec7fa..0a853ffc658d8e82c21af7853bdaa911
this.yaw = f;
this.pitch = f1;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index d76800778ccf05913ff887a566b3a2f11ec2d40b..e0ab4c96544483e43c7f5e5f5965f74a207437d5 100644
+index 387f6f6fa9bbb1cce544cfb907f68c7993752dd7..fb52a60437d48282f3e99e7eccb0e76b446155f9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-@@ -554,7 +554,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+@@ -558,7 +558,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
// entity.setLocation() throws no event, and so cannot be cancelled
diff --git a/Spigot-Server-Patches/0569-Add-additional-open-container-api-to-HumanEntity.patch b/Spigot-Server-Patches/0569-Add-additional-open-container-api-to-HumanEntity.patch
index 578a8fabd1..775318f266 100644
--- a/Spigot-Server-Patches/0569-Add-additional-open-container-api-to-HumanEntity.patch
+++ b/Spigot-Server-Patches/0569-Add-additional-open-container-api-to-HumanEntity.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add additional open container api to HumanEntity
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-index 2f93a5bc694bfe97022ec227132f76f57a8fffb0..7bbcb41ef43a54f03474581064ff7e051122769a 100644
+index 92501a415813b3b0f2be492a4711962320264a76..b99423b3b413fc6364c6530a99e3c74dd406e1b4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-@@ -456,6 +456,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
+@@ -458,6 +458,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
return this.getHandle().activeContainer.getBukkitView();
}
@@ -54,7 +54,7 @@ index 2f93a5bc694bfe97022ec227132f76f57a8fffb0..7bbcb41ef43a54f03474581064ff7e05
+ return null;
+ }
+ }
-+ net.minecraft.server.Block block;
++ net.minecraft.world.level.block.Block block;
+ if (material == Material.ANVIL) {
+ block = Blocks.ANVIL;
+ } else if (material == Material.CARTOGRAPHY_TABLE) {
diff --git a/Spigot-Server-Patches/0571-Extend-block-drop-capture-to-capture-all-items-added.patch b/Spigot-Server-Patches/0571-Extend-block-drop-capture-to-capture-all-items-added.patch
index acdfc830ed..482af3fc06 100644
--- a/Spigot-Server-Patches/0571-Extend-block-drop-capture-to-capture-all-items-added.patch
+++ b/Spigot-Server-Patches/0571-Extend-block-drop-capture-to-capture-all-items-added.patch
@@ -6,10 +6,18 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the
diff --git a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
-index 8b6367d3bb4cbb007bf68d957a6c1f701f5643b6..86d1a7625bb3016093ee8a46f91fd657d8bc2546 100644
+index 831bc83cdbf15f08961cc8703be348b458d47fd3..5974cc9f895478eebd4922faa26d5a944064d7b6 100644
--- a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
-@@ -416,10 +416,12 @@ public class PlayerInteractManager {
+@@ -12,6 +12,7 @@ import net.minecraft.world.EnumHand;
+ import net.minecraft.world.EnumInteractionResult;
+ import net.minecraft.world.ITileInventory;
+ import net.minecraft.world.InteractionResultWrapper;
++import net.minecraft.world.entity.item.EntityItem;
+ import net.minecraft.world.entity.player.EntityHuman;
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.item.context.ItemActionContext;
+@@ -418,10 +419,12 @@ public class PlayerInteractManager {
// return true; // CraftBukkit
}
// CraftBukkit start
diff --git a/Spigot-Server-Patches/0572-Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch b/Spigot-Server-Patches/0572-Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch
index 55e775a7cc..974a34ff2f 100644
--- a/Spigot-Server-Patches/0572-Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch
+++ b/Spigot-Server-Patches/0572-Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't mark dirty in invalid locations (SPIGOT-6086)
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java
-index dbd3d021f42ca45edbb061ce29746bc84331a0ad..45834045c3a40b20095d4990c91f6e112cff335c 100644
+index 00cebd33101916f29bbc192d531ac0fba31e037b..a323b76f68c273a73cb3f20167a668b2100f4944 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java
-@@ -388,6 +388,7 @@ public class PlayerChunk {
+@@ -389,6 +389,7 @@ public class PlayerChunk {
}
public void a(BlockPosition blockposition) {
diff --git a/Spigot-Server-Patches/0575-Entity-isTicking.patch b/Spigot-Server-Patches/0575-Entity-isTicking.patch
index 7973cb5192..2842cb3c9f 100644
--- a/Spigot-Server-Patches/0575-Entity-isTicking.patch
+++ b/Spigot-Server-Patches/0575-Entity-isTicking.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Entity#isTicking
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 1b3371b087efa8c184f3c07fe560a709f76db4f7..80f3e124ad6230789e27e8ddf20be08befb0a86f 100644
+index e2301dbeb3d76684b2a0ab4262bb76cab3557789..f1fa11217ab09133f4f19f5c73dfdab2f2b434e2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -48,6 +48,7 @@ import net.minecraft.resources.MinecraftKey;
@@ -27,10 +27,10 @@ index 1b3371b087efa8c184f3c07fe560a709f76db4f7..80f3e124ad6230789e27e8ddf20be08b
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index e0ab4c96544483e43c7f5e5f5965f74a207437d5..c064c510442d615beeacf9899d9b7f0e10ce7575 100644
+index fb52a60437d48282f3e99e7eccb0e76b446155f9..295ffab08672d77d88aca368cb5b56f80bc4f1b5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-@@ -1157,5 +1157,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+@@ -1161,5 +1161,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public boolean isInLava() {
return getHandle().isInLava();
}
diff --git a/Spigot-Server-Patches/0576-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/Spigot-Server-Patches/0576-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch
index fc18e015b9..dcdd06328d 100644
--- a/Spigot-Server-Patches/0576-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch
+++ b/Spigot-Server-Patches/0576-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 27e7547a6414e84e170ca33bdb276a451f35cf46..8e5dcab795b1158e2ee957ac4532f5bdf00b6376 100644
+index 97085ae04f77b79a367cd328905d4b68ebaca133..6d00525b24efa76931ff4dd2bdf1947b1466930a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2006,6 +2006,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -2008,6 +2008,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
if (this.aN()) {
PlayerList playerlist = commandlistenerwrapper.getServer().getPlayerList();
WhiteList whitelist = playerlist.getWhitelist();
diff --git a/Spigot-Server-Patches/0577-Fix-Not-a-string-Map-Conversion-spam.patch b/Spigot-Server-Patches/0577-Fix-Not-a-string-Map-Conversion-spam.patch
index 237ee07813..26697d6feb 100644
--- a/Spigot-Server-Patches/0577-Fix-Not-a-string-Map-Conversion-spam.patch
+++ b/Spigot-Server-Patches/0577-Fix-Not-a-string-Map-Conversion-spam.patch
@@ -10,10 +10,21 @@ This stops the spam by converting the old format to new before
requesting the world.
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java b/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java
-index d470af1814af332595c1c0beb1cdc552e186a6bb..3b6872af2a3e3ab45b0036e2d64009b2f3882d20 100644
+index d470af1814af332595c1c0beb1cdc552e186a6bb..1f9b710f2af3c5067b3c2b73bebb11f8e22c403e 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java
-@@ -94,7 +94,26 @@ public class WorldMap extends PersistentBase {
+@@ -11,8 +11,10 @@ import javax.annotation.Nullable;
+ import net.minecraft.core.BlockPosition;
+ import net.minecraft.nbt.DynamicOpsNBT;
+ import net.minecraft.nbt.NBTBase;
++import net.minecraft.nbt.NBTNumber;
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.nbt.NBTTagList;
++import net.minecraft.nbt.NBTTagString;
+ import net.minecraft.network.chat.IChatBaseComponent;
+ import net.minecraft.network.protocol.Packet;
+ import net.minecraft.network.protocol.game.PacketPlayOutMap;
+@@ -94,7 +96,26 @@ public class WorldMap extends PersistentBase {
@Override
public void a(NBTTagCompound nbttagcompound) {
@@ -28,7 +39,7 @@ index d470af1814af332595c1c0beb1cdc552e186a6bb..3b6872af2a3e3ab45b0036e2d64009b2
+ this.uniqueId = new UUID(most, least);
+ CraftWorld world = (CraftWorld) server.getWorld(this.uniqueId);
+ if (world != null) {
-+ dimension = NBTTagString.create("minecaft:" + world.getName().toLowerCase(java.util.Locale.ENGLISH));
++ dimension = NBTTagString.create("minecraft:" + world.getName().toLowerCase(java.util.Locale.ENGLISH));
+ } else {
+ dimension = NBTTagString.create("bukkit:_invalidworld_");
+ }
diff --git a/Spigot-Server-Patches/0582-Optimise-getType-calls.patch b/Spigot-Server-Patches/0582-Optimise-getType-calls.patch
index 1b76f47982..214867df37 100644
--- a/Spigot-Server-Patches/0582-Optimise-getType-calls.patch
+++ b/Spigot-Server-Patches/0582-Optimise-getType-calls.patch
@@ -69,10 +69,10 @@ index b7ce677572f1f5ed01f3a8caf9368222e03bb69c..1960f01b5e4d7bff96d466e9a48f1d53
public void setFlag(int flag) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
-index 61d08973be351017df2d1a9f0ab12101cfe15af5..4d936c544acfc85cda52b8d3a1cdf4df29749a93 100644
+index 58f892478de74b853cd35ef2fec8c462e3a9ecee..1fe9b32c2a3717652be70786090a61c5fa7430cf 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
-@@ -44,7 +44,7 @@ public class CraftBlockData implements BlockData {
+@@ -45,7 +45,7 @@ public class CraftBlockData implements BlockData {
@Override
public Material getMaterial() {
diff --git a/Spigot-Server-Patches/0587-Fix-item-locations-dropped-from-campfires.patch b/Spigot-Server-Patches/0587-Fix-item-locations-dropped-from-campfires.patch
index dd0ef6a7e9..764f6d7979 100644
--- a/Spigot-Server-Patches/0587-Fix-item-locations-dropped-from-campfires.patch
+++ b/Spigot-Server-Patches/0587-Fix-item-locations-dropped-from-campfires.patch
@@ -6,10 +6,18 @@ Subject: [PATCH] Fix item locations dropped from campfires
Fixes #4259 by not flooring the blockposition among other weirdness
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityCampfire.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityCampfire.java
-index df010dc740f2dd647a418ba4e425ce3a3b1d79e2..bd213deedf47e71f0983bb950c7e74d4bf30f54e 100644
+index df010dc740f2dd647a418ba4e425ce3a3b1d79e2..62a19f39405cff27f34a3b98fb9310b1c9c27563 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityCampfire.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityCampfire.java
-@@ -92,7 +92,11 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
+@@ -14,6 +14,7 @@ import net.minecraft.world.Clearable;
+ import net.minecraft.world.ContainerUtil;
+ import net.minecraft.world.InventorySubcontainer;
+ import net.minecraft.world.InventoryUtils;
++import net.minecraft.world.entity.item.EntityItem;
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.item.crafting.RecipeCampfire;
+ import net.minecraft.world.item.crafting.Recipes;
+@@ -92,7 +93,11 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
result = blockCookEvent.getResult();
itemstack1 = CraftItemStack.asNMSCopy(result);
// CraftBukkit end
diff --git a/Spigot-Server-Patches/0588-Player-elytra-boost-API.patch b/Spigot-Server-Patches/0588-Player-elytra-boost-API.patch
index b2a39fb564..4b422c7169 100644
--- a/Spigot-Server-Patches/0588-Player-elytra-boost-API.patch
+++ b/Spigot-Server-Patches/0588-Player-elytra-boost-API.patch
@@ -5,10 +5,25 @@ Subject: [PATCH] Player elytra boost API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index d75bf9ecb70224f5e9772f98ac5633244828202e..69f2f575eb8ea91a5f5ce0115286d6ea741e89ff 100644
+index a4726747c066d623f37162e2637403efee7f5708..204d3e879c736f44e01f9246af26f6cccf8d72a7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2274,6 +2274,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -69,12 +69,14 @@ import net.minecraft.world.entity.ai.attributes.AttributeMapBase;
+ import net.minecraft.world.entity.ai.attributes.AttributeModifiable;
+ import net.minecraft.world.entity.ai.attributes.GenericAttributes;
+ import net.minecraft.world.entity.player.EntityHuman;
++import net.minecraft.world.entity.projectile.EntityFireworks;
+ import net.minecraft.world.inventory.Container;
+ import net.minecraft.world.item.EnumColor;
+ import net.minecraft.world.item.enchantment.EnchantmentManager;
+ import net.minecraft.world.item.enchantment.Enchantments;
+ import net.minecraft.world.level.ChunkCoordIntPair;
+ import net.minecraft.world.level.EnumGamemode;
++import net.minecraft.world.level.World;
+ import net.minecraft.world.level.biome.BiomeManager;
+ import net.minecraft.world.level.block.entity.TileEntitySign;
+ import net.minecraft.world.level.saveddata.maps.MapIcon;
+@@ -2281,6 +2283,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
throw new RuntimeException("Unknown settings type");
}
@@ -19,9 +34,9 @@ index d75bf9ecb70224f5e9772f98ac5633244828202e..69f2f575eb8ea91a5f5ce0115286d6ea
+ Validate.isTrue(firework != null, "firework == null");
+ Validate.isTrue(firework.getType() == Material.FIREWORK_ROCKET, "Firework must be Material.FIREWORK_ROCKET");
+
-+ net.minecraft.server.ItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(firework);
-+ net.minecraft.server.World world = ((CraftWorld) getWorld()).getHandle();
-+ net.minecraft.server.EntityFireworks entity = new net.minecraft.server.EntityFireworks(world, item, getHandle());
++ net.minecraft.world.item.ItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(firework);
++ World world = ((CraftWorld) getWorld()).getHandle();
++ EntityFireworks entity = new EntityFireworks(world, item, getHandle());
+ return world.addEntity(entity)
+ ? (org.bukkit.entity.Firework) entity.getBukkitEntity()
+ : null;
diff --git a/Spigot-Server-Patches/0592-Add-ignore-discounts-API.patch b/Spigot-Server-Patches/0592-Add-ignore-discounts-API.patch
index bd3bc818d4..9904971520 100644
--- a/Spigot-Server-Patches/0592-Add-ignore-discounts-API.patch
+++ b/Spigot-Server-Patches/0592-Add-ignore-discounts-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add ignore discounts API
diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
-index 89ae2b4b836658dc335f28760672b952c2fb58d4..32155889583b0773b8cadabbd2f279f9b88d1a0b 100644
+index 80a9eecfd2eb17db6a7d0b3973f4acdb80f873e8..382059b2c2b6a7b8231b3c3a5c9a401091b1ad18 100644
--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
-@@ -459,6 +459,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
+@@ -460,6 +460,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
while (iterator.hasNext()) {
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
@@ -16,7 +16,7 @@ index 89ae2b4b836658dc335f28760672b952c2fb58d4..32155889583b0773b8cadabbd2f279f9
// CraftBukkit start
int bonus = -MathHelper.d((float) i * merchantrecipe.getPriceMultiplier());
-@@ -478,6 +479,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
+@@ -479,6 +480,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
while (iterator1.hasNext()) {
MerchantRecipe merchantrecipe1 = (MerchantRecipe) iterator1.next();
diff --git a/Spigot-Server-Patches/0600-Significantly-improve-performance-of-the-end-generat.patch b/Spigot-Server-Patches/0600-Significantly-improve-performance-of-the-end-generat.patch
index 93801258a2..b205a133b3 100644
--- a/Spigot-Server-Patches/0600-Significantly-improve-performance-of-the-end-generat.patch
+++ b/Spigot-Server-Patches/0600-Significantly-improve-performance-of-the-end-generat.patch
@@ -12,10 +12,10 @@ Co-authored-by: Dylan Xaldin <[email protected]>
Co-authored-by: pop4959 <[email protected]>
diff --git a/src/main/java/net/minecraft/world/level/biome/WorldChunkManagerTheEnd.java b/src/main/java/net/minecraft/world/level/biome/WorldChunkManagerTheEnd.java
-index 1077972d694d604c3ec97d333d34a9ab81819c33..25ea3c46c7748bd0c3aa96ee3d3a22cccb6da5c0 100644
+index 1077972d694d604c3ec97d333d34a9ab81819c33..62fe4cc00a24e330443d2f006a88dbab3798fb28 100644
--- a/src/main/java/net/minecraft/world/level/biome/WorldChunkManagerTheEnd.java
+++ b/src/main/java/net/minecraft/world/level/biome/WorldChunkManagerTheEnd.java
-@@ -3,6 +3,7 @@ package net.minecraft.world.level.biome;
+@@ -3,10 +3,12 @@ package net.minecraft.world.level.biome;
import com.google.common.collect.ImmutableList;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
@@ -23,7 +23,12 @@ index 1077972d694d604c3ec97d333d34a9ab81819c33..25ea3c46c7748bd0c3aa96ee3d3a22cc
import java.util.List;
import net.minecraft.core.IRegistry;
import net.minecraft.resources.RegistryLookupCodec;
-@@ -27,6 +28,16 @@ public class WorldChunkManagerTheEnd extends WorldChunkManager {
+ import net.minecraft.util.MathHelper;
++import net.minecraft.world.level.ChunkCoordIntPair;
+ import net.minecraft.world.level.levelgen.SeededRandom;
+ import net.minecraft.world.level.levelgen.synth.NoiseGenerator3Handler;
+
+@@ -27,6 +29,16 @@ public class WorldChunkManagerTheEnd extends WorldChunkManager {
private final BiomeBase k;
private final BiomeBase l;
private final BiomeBase m;
@@ -40,7 +45,7 @@ index 1077972d694d604c3ec97d333d34a9ab81819c33..25ea3c46c7748bd0c3aa96ee3d3a22cc
public WorldChunkManagerTheEnd(IRegistry<BiomeBase> iregistry, long i) {
this(iregistry, i, (BiomeBase) iregistry.d(Biomes.THE_END), (BiomeBase) iregistry.d(Biomes.END_HIGHLANDS), (BiomeBase) iregistry.d(Biomes.END_MIDLANDS), (BiomeBase) iregistry.d(Biomes.SMALL_END_ISLANDS), (BiomeBase) iregistry.d(Biomes.END_BARRENS));
-@@ -81,13 +92,27 @@ public class WorldChunkManagerTheEnd extends WorldChunkManager {
+@@ -81,13 +93,27 @@ public class WorldChunkManagerTheEnd extends WorldChunkManager {
f = MathHelper.a(f, -100.0F, 80.0F);
diff --git a/Spigot-Server-Patches/0601-Expose-world-spawn-angle.patch b/Spigot-Server-Patches/0601-Expose-world-spawn-angle.patch
index 53cbcb2261..89f9d522ff 100644
--- a/Spigot-Server-Patches/0601-Expose-world-spawn-angle.patch
+++ b/Spigot-Server-Patches/0601-Expose-world-spawn-angle.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Expose world spawn angle
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index c146e91c323504a96b800769d412c59d98e5ccf4..e4eeacd86824463944966199017e98c877858a75 100644
+index 61513e3c27cf95090e61f7085bb2f0435c774df9..a7ca1dbebf30262d7c526f96b7a45482b1f898f4 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -894,7 +894,7 @@ public abstract class PlayerList {
@@ -30,10 +30,10 @@ index 81ad90ba93481decdfaa38fc9fa81bca0e402781..7599488f7d4b168c92078c2d2987cb38
long getTime();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 82d478cfa296be9c8d19e8dbd8d3485443108e40..c64bd5725f287aebff60a86cafe86fac29016191 100644
+index 4fe821c5bac2f713529668b2001f95cc3cb2c388..50b6829394af843350d70604d9151453e4c8bbef 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -378,7 +378,7 @@ public class CraftWorld implements World {
+@@ -380,7 +380,7 @@ public class CraftWorld implements World {
@Override
public Location getSpawnLocation() {
BlockPosition spawn = world.getSpawn();
diff --git a/Spigot-Server-Patches/0603-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/Spigot-Server-Patches/0603-Fix-Player-spawnParticle-x-y-z-precision-loss.patch
index a70abbf02a..ffecbacf4d 100644
--- a/Spigot-Server-Patches/0603-Fix-Player-spawnParticle-x-y-z-precision-loss.patch
+++ b/Spigot-Server-Patches/0603-Fix-Player-spawnParticle-x-y-z-precision-loss.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 69f2f575eb8ea91a5f5ce0115286d6ea741e89ff..adebc5b1d110983feb6d43f371bf2569ddca4088 100644
+index 204d3e879c736f44e01f9246af26f6cccf8d72a7..5a245184d6290a58bb9aed139cc4c7b5511ce491 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2005,7 +2005,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2014,7 +2014,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (data != null && !particle.getDataType().isInstance(data)) {
throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass());
}
diff --git a/Spigot-Server-Patches/0607-Climbing-should-not-bypass-cramming-gamerule.patch b/Spigot-Server-Patches/0607-Climbing-should-not-bypass-cramming-gamerule.patch
index 863919af3f..20c9ba05e0 100644
--- a/Spigot-Server-Patches/0607-Climbing-should-not-bypass-cramming-gamerule.patch
+++ b/Spigot-Server-Patches/0607-Climbing-should-not-bypass-cramming-gamerule.patch
@@ -19,7 +19,7 @@ index b4d76494851601d61a69e2f060727a68f4461267..6262246c4018c660705fbad028f297fc
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 04c2b1ed98efc47b0f5a46668f4aef1c6531e73e..0618c0bb7587dd1dc7560d0f0800036ff596edab 100644
+index 2a3025793db52a18e58f832c9da78c6c3b39d33c..d801486565865cf3b56e9d80b7c1643e9b0f4597 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1575,6 +1575,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -75,10 +75,10 @@ index 593805ac08e783546be99b025b22e40c654e05d1..9a826ae0319dd52ca7d98ea5d7312fb7
// CraftBukkit start - collidable API
diff --git a/src/main/java/net/minecraft/world/entity/IEntitySelector.java b/src/main/java/net/minecraft/world/entity/IEntitySelector.java
-index 88ed99d0d08fb5f3fee605f8ed00004b466633bf..a7738f8bde558c9b161a4bde18a3a4311e35d5eb 100644
+index c8d7ea8cfa4945af4a6675172b931a4cc3ca2801..f5e32faeb6d937cf90b1f3ea251b5cfc91f2338d 100644
--- a/src/main/java/net/minecraft/world/entity/IEntitySelector.java
+++ b/src/main/java/net/minecraft/world/entity/IEntitySelector.java
-@@ -48,11 +48,17 @@ public final class IEntitySelector {
+@@ -51,11 +51,17 @@ public final class IEntitySelector {
}
public static Predicate<Entity> a(Entity entity) {
diff --git a/Spigot-Server-Patches/0609-Add-PlayerShearBlockEvent.patch b/Spigot-Server-Patches/0609-Add-PlayerShearBlockEvent.patch
index d21d2e8cc1..b63c910557 100644
--- a/Spigot-Server-Patches/0609-Add-PlayerShearBlockEvent.patch
+++ b/Spigot-Server-Patches/0609-Add-PlayerShearBlockEvent.patch
@@ -18,7 +18,7 @@ index 768934fa4158a9773d06f5b23bfb19db75f6d179..596b4597313b87296d39027b13555b5a
float f = 0.5F;
double d0 = (double) (world.random.nextFloat() * 0.5F) + 0.25D;
diff --git a/src/main/java/net/minecraft/world/level/block/BlockBeehive.java b/src/main/java/net/minecraft/world/level/block/BlockBeehive.java
-index ff521e64384281fc88b78bb908d19049743cf63b..7ac696c6d91807ffdac5dd2bd4d60a0468417cc1 100644
+index ff521e64384281fc88b78bb908d19049743cf63b..828d231a963f1962d88fe170ac86590d86e1df40 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockBeehive.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockBeehive.java
@@ -1,5 +1,7 @@
@@ -29,7 +29,15 @@ index ff521e64384281fc88b78bb908d19049743cf63b..7ac696c6d91807ffdac5dd2bd4d60a04
import java.util.Iterator;
import java.util.List;
import java.util.Random;
-@@ -116,8 +118,19 @@ public class BlockBeehive extends BlockTileEntity {
+@@ -10,6 +12,7 @@ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.EnumDirection;
+ import net.minecraft.nbt.NBTBase;
+ import net.minecraft.nbt.NBTTagCompound;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.sounds.SoundCategory;
+ import net.minecraft.sounds.SoundEffects;
+@@ -116,8 +119,19 @@ public class BlockBeehive extends BlockTileEntity {
if (i >= 5) {
if (itemstack.getItem() == Items.SHEARS) {
@@ -51,10 +59,18 @@ index ff521e64384281fc88b78bb908d19049743cf63b..7ac696c6d91807ffdac5dd2bd4d60a04
entityhuman1.broadcastItemBreak(enumhand);
});
diff --git a/src/main/java/net/minecraft/world/level/block/BlockPumpkin.java b/src/main/java/net/minecraft/world/level/block/BlockPumpkin.java
-index 130b768ac7155c2960694dfa12163e46315f7797..18fcf2c40cdc9be0084e2caaecb64350bbbb6126 100644
+index 130b768ac7155c2960694dfa12163e46315f7797..11a9c3e76baaa50317a3cd7d81541a3666028c16 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockPumpkin.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockPumpkin.java
-@@ -15,6 +15,8 @@ import net.minecraft.world.level.block.state.BlockBase;
+@@ -2,6 +2,7 @@ package net.minecraft.world.level.block;
+
+ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.EnumDirection;
++import net.minecraft.server.MCUtil;
+ import net.minecraft.sounds.SoundCategory;
+ import net.minecraft.sounds.SoundEffects;
+ import net.minecraft.world.EnumHand;
+@@ -15,6 +16,8 @@ import net.minecraft.world.level.block.state.BlockBase;
import net.minecraft.world.level.block.state.IBlockData;
import net.minecraft.world.phys.MovingObjectPositionBlock;
@@ -63,7 +79,7 @@ index 130b768ac7155c2960694dfa12163e46315f7797..18fcf2c40cdc9be0084e2caaecb64350
public class BlockPumpkin extends BlockStemmed {
protected BlockPumpkin(BlockBase.Info blockbase_info) {
-@@ -27,15 +29,26 @@ public class BlockPumpkin extends BlockStemmed {
+@@ -27,15 +30,26 @@ public class BlockPumpkin extends BlockStemmed {
if (itemstack.getItem() == Items.SHEARS) {
if (!world.isClientSide) {
diff --git a/Spigot-Server-Patches/0610-Add-warning-for-servers-not-running-on-Java-11.patch b/Spigot-Server-Patches/0610-Add-warning-for-servers-not-running-on-Java-11.patch
index 5f27651600..076d1b516d 100644
--- a/Spigot-Server-Patches/0610-Add-warning-for-servers-not-running-on-Java-11.patch
+++ b/Spigot-Server-Patches/0610-Add-warning-for-servers-not-running-on-Java-11.patch
@@ -59,10 +59,10 @@ index 0000000000000000000000000000000000000000..c6ea429819c07e7f4bc257cad73463a0
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 8e5dcab795b1158e2ee957ac4532f5bdf00b6376..f5d21fd1dc74faa0414b793d8f146d2e6e4d3fd2 100644
+index 6d00525b24efa76931ff4dd2bdf1947b1466930a..732237bf3a950238e7edc5593691c8bff43c1c91 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -179,6 +179,7 @@ import org.bukkit.event.server.ServerLoadEvent;
+@@ -181,6 +181,7 @@ import org.bukkit.event.server.ServerLoadEvent;
import co.aikar.timings.MinecraftTimings; // Paper
import org.spigotmc.SlackActivityAccountant; // Spigot
@@ -70,7 +70,7 @@ index 8e5dcab795b1158e2ee957ac4532f5bdf00b6376..f5d21fd1dc74faa0414b793d8f146d2e
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
-@@ -1063,6 +1064,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1065,6 +1066,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
LOGGER.info("Done ({})! For help, type \"help\"", doneTime);
// Paper end
diff --git a/Spigot-Server-Patches/0612-Fix-curing-zombie-villager-discount-exploit.patch b/Spigot-Server-Patches/0612-Fix-curing-zombie-villager-discount-exploit.patch
index facd095786..638e510669 100644
--- a/Spigot-Server-Patches/0612-Fix-curing-zombie-villager-discount-exploit.patch
+++ b/Spigot-Server-Patches/0612-Fix-curing-zombie-villager-discount-exploit.patch
@@ -34,10 +34,10 @@ index 7d34d1157786227ac210edc1595a024ccb61a3e9..ce8a4cc9f642a740947c4e63d6eb78ad
this.a.removeInt(reputationtype);
}
diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
-index 32155889583b0773b8cadabbd2f279f9b88d1a0b..a3111727354b811ba933372a3910f264a7f5a9bd 100644
+index 382059b2c2b6a7b8231b3c3a5c9a401091b1ad18..2d0b83923d58cc7b6918b4e2ff2bece13ca26899 100644
--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
-@@ -1006,6 +1006,15 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
+@@ -1007,6 +1007,15 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
@Override
public void a(ReputationEvent reputationevent, Entity entity) {
if (reputationevent == ReputationEvent.a) {
diff --git a/Spigot-Server-Patches/0625-Fix-harming-potion-dupe.patch b/Spigot-Server-Patches/0625-Fix-harming-potion-dupe.patch
index 9e87ac725f..0e9ad1d647 100644
--- a/Spigot-Server-Patches/0625-Fix-harming-potion-dupe.patch
+++ b/Spigot-Server-Patches/0625-Fix-harming-potion-dupe.patch
@@ -8,10 +8,18 @@ Before this patch, instant effects would be applied before the potion ItemStack
This patch makes it so that instant effects are applied after the potion ItemStack is removed, and the glass bottle is only put into the player's inventory if the player is not dead. Otherwise, the glass bottle is dropped on the ground.
diff --git a/src/main/java/net/minecraft/world/item/ItemPotion.java b/src/main/java/net/minecraft/world/item/ItemPotion.java
-index b197fe561ab735e80d8bf29ac16eacfaf3fc2d21..d2ec88d23c945504bb8a0bb57281c04409740636 100644
+index b197fe561ab735e80d8bf29ac16eacfaf3fc2d21..ca2f8d522d7f2305f161cb4aa611226355ea5789 100644
--- a/src/main/java/net/minecraft/world/item/ItemPotion.java
+++ b/src/main/java/net/minecraft/world/item/ItemPotion.java
-@@ -36,6 +36,7 @@ public class ItemPotion extends Item {
+@@ -15,6 +15,7 @@ import net.minecraft.world.entity.player.EntityHuman;
+ import net.minecraft.world.item.alchemy.PotionRegistry;
+ import net.minecraft.world.item.alchemy.PotionUtil;
+ import net.minecraft.world.item.alchemy.Potions;
++import net.minecraft.world.level.GameRules;
+ import net.minecraft.world.level.World;
+
+ public class ItemPotion extends Item {
+@@ -36,6 +37,7 @@ public class ItemPotion extends Item {
CriterionTriggers.z.a((EntityPlayer) entityhuman, itemstack);
}
@@ -19,7 +27,7 @@ index b197fe561ab735e80d8bf29ac16eacfaf3fc2d21..d2ec88d23c945504bb8a0bb57281c044
if (!world.isClientSide) {
List<MobEffect> list = PotionUtil.getEffects(itemstack);
Iterator iterator = list.iterator();
-@@ -44,7 +45,7 @@ public class ItemPotion extends Item {
+@@ -44,7 +46,7 @@ public class ItemPotion extends Item {
MobEffect mobeffect = (MobEffect) iterator.next();
if (mobeffect.getMobEffect().isInstant()) {
@@ -28,7 +36,7 @@ index b197fe561ab735e80d8bf29ac16eacfaf3fc2d21..d2ec88d23c945504bb8a0bb57281c044
} else {
entityliving.addEffect(new MobEffect(mobeffect), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.POTION_DRINK); // CraftBukkit
}
-@@ -58,7 +59,20 @@ public class ItemPotion extends Item {
+@@ -58,7 +60,20 @@ public class ItemPotion extends Item {
}
}
diff --git a/Spigot-Server-Patches/0636-Added-WorldGameRuleChangeEvent.patch b/Spigot-Server-Patches/0636-Added-WorldGameRuleChangeEvent.patch
index 1df8311984..de280533d9 100644
--- a/Spigot-Server-Patches/0636-Added-WorldGameRuleChangeEvent.patch
+++ b/Spigot-Server-Patches/0636-Added-WorldGameRuleChangeEvent.patch
@@ -74,10 +74,10 @@ index 276c28170b2a177dab6b2a0d5425044cd9f8df22..3783f3a83e3e70d77cf0fa1021f62a89
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index c64bd5725f287aebff60a86cafe86fac29016191..04ab5f395c565e998478564fd5b3081457317537 100644
+index 50b6829394af843350d70604d9151453e4c8bbef..2008e05c090e6a390d4210f2e8ed6ff75fb99e89 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -2362,8 +2362,13 @@ public class CraftWorld implements World {
+@@ -2364,8 +2364,13 @@ public class CraftWorld implements World {
if (!isGameRule(rule)) return false;
@@ -92,7 +92,7 @@ index c64bd5725f287aebff60a86cafe86fac29016191..04ab5f395c565e998478564fd5b30814
handle.onChange(getHandle().getMinecraftServer());
return true;
}
-@@ -2398,8 +2403,12 @@ public class CraftWorld implements World {
+@@ -2400,8 +2405,12 @@ public class CraftWorld implements World {
if (!isGameRule(rule.getName())) return false;
diff --git a/Spigot-Server-Patches/0637-Added-ServerResourcesReloadedEvent.patch b/Spigot-Server-Patches/0637-Added-ServerResourcesReloadedEvent.patch
index fe6a6a35c7..95e355260b 100644
--- a/Spigot-Server-Patches/0637-Added-ServerResourcesReloadedEvent.patch
+++ b/Spigot-Server-Patches/0637-Added-ServerResourcesReloadedEvent.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Added ServerResourcesReloadedEvent
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index f5d21fd1dc74faa0414b793d8f146d2e6e4d3fd2..d7f52ceaca74d5db239d0c6ac151b0ba184bb58c 100644
+index 732237bf3a950238e7edc5593691c8bff43c1c91..c4da751bed3014a5521ac0014b07c139b69b1187 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2,9 +2,6 @@ package net.minecraft.server;
@@ -18,7 +18,7 @@ index f5d21fd1dc74faa0414b793d8f146d2e6e4d3fd2..d7f52ceaca74d5db239d0c6ac151b0ba
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
-@@ -180,6 +177,7 @@ import org.bukkit.event.server.ServerLoadEvent;
+@@ -182,6 +179,7 @@ import org.bukkit.event.server.ServerLoadEvent;
import co.aikar.timings.MinecraftTimings; // Paper
import org.spigotmc.SlackActivityAccountant; // Spigot
import io.papermc.paper.util.PaperJvmChecker; // Paper
@@ -26,7 +26,7 @@ index f5d21fd1dc74faa0414b793d8f146d2e6e4d3fd2..d7f52ceaca74d5db239d0c6ac151b0ba
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
-@@ -1922,7 +1920,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1924,7 +1922,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
return this.customFunctionData;
}
@@ -40,7 +40,7 @@ index f5d21fd1dc74faa0414b793d8f146d2e6e4d3fd2..d7f52ceaca74d5db239d0c6ac151b0ba
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
Stream<String> stream = collection.stream(); // CraftBukkit - decompile error
ResourcePackRepository resourcepackrepository = this.resourcePackRepository;
-@@ -1938,6 +1942,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1940,6 +1944,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.resourcePackRepository.a(collection);
this.saveData.a(a(this.resourcePackRepository));
datapackresources.i();
diff --git a/Spigot-Server-Patches/0641-Fire-event-on-GS4-query.patch b/Spigot-Server-Patches/0641-Fire-event-on-GS4-query.patch
index 2a2a9ffee5..24dd766968 100644
--- a/Spigot-Server-Patches/0641-Fire-event-on-GS4-query.patch
+++ b/Spigot-Server-Patches/0641-Fire-event-on-GS4-query.patch
@@ -37,10 +37,18 @@ index 57ff3db0a0199ef03045b880e598407886b0306b..1b6761f75d97c49b1bf1ce3db631b725
this.b.writeShort(Short.reverseBytes(short0));
}
diff --git a/src/main/java/net/minecraft/server/rcon/thread/RemoteStatusListener.java b/src/main/java/net/minecraft/server/rcon/thread/RemoteStatusListener.java
-index 55b379af2e0c8c3513a76a346d381cd3dbcabe40..4dc3b388c0e2d89f1e0bc2199794a3fa2532b7a0 100644
+index 55b379af2e0c8c3513a76a346d381cd3dbcabe40..59769f7ea808b952cd02192c7121c248756998e9 100644
--- a/src/main/java/net/minecraft/server/rcon/thread/RemoteStatusListener.java
+++ b/src/main/java/net/minecraft/server/rcon/thread/RemoteStatusListener.java
-@@ -26,18 +26,18 @@ public class RemoteStatusListener extends RemoteConnectionThread {
+@@ -16,6 +16,7 @@ import java.util.Random;
+ import javax.annotation.Nullable;
+ import net.minecraft.SystemUtils;
+ import net.minecraft.server.IMinecraftServer;
++import net.minecraft.server.dedicated.DedicatedServer;
+ import net.minecraft.server.rcon.RemoteStatusReply;
+ import net.minecraft.server.rcon.StatusChallengeUtils;
+ import org.apache.logging.log4j.LogManager;
+@@ -26,18 +27,18 @@ public class RemoteStatusListener extends RemoteConnectionThread {
private static final Logger LOGGER = LogManager.getLogger();
private long e;
private final int f;
@@ -66,7 +74,7 @@ index 55b379af2e0c8c3513a76a346d381cd3dbcabe40..4dc3b388c0e2d89f1e0bc2199794a3fa
private RemoteStatusListener(IMinecraftServer iminecraftserver, int i) {
super("Query Listener");
-@@ -107,6 +107,7 @@ public class RemoteStatusListener extends RemoteConnectionThread {
+@@ -107,6 +108,7 @@ public class RemoteStatusListener extends RemoteConnectionThread {
remotestatusreply.a((int) 0);
remotestatusreply.a(this.a(datagrampacket.getSocketAddress()));
@@ -74,7 +82,7 @@ index 55b379af2e0c8c3513a76a346d381cd3dbcabe40..4dc3b388c0e2d89f1e0bc2199794a3fa
remotestatusreply.a(this.i);
remotestatusreply.a("SMP");
remotestatusreply.a(this.j);
-@@ -114,6 +115,31 @@ public class RemoteStatusListener extends RemoteConnectionThread {
+@@ -114,6 +116,31 @@ public class RemoteStatusListener extends RemoteConnectionThread {
remotestatusreply.a(Integer.toString(this.h));
remotestatusreply.a((short) this.g);
remotestatusreply.a(this.m);
@@ -106,7 +114,7 @@ index 55b379af2e0c8c3513a76a346d381cd3dbcabe40..4dc3b388c0e2d89f1e0bc2199794a3fa
this.a(remotestatusreply.a(), datagrampacket);
RemoteStatusListener.LOGGER.debug("Status [{}]", socketaddress);
}
-@@ -150,6 +176,7 @@ public class RemoteStatusListener extends RemoteConnectionThread {
+@@ -150,6 +177,7 @@ public class RemoteStatusListener extends RemoteConnectionThread {
this.p.a("splitnum");
this.p.a((int) 128);
this.p.a((int) 0);
@@ -114,7 +122,7 @@ index 55b379af2e0c8c3513a76a346d381cd3dbcabe40..4dc3b388c0e2d89f1e0bc2199794a3fa
this.p.a("hostname");
this.p.a(this.i);
this.p.a("gametype");
-@@ -185,6 +212,79 @@ public class RemoteStatusListener extends RemoteConnectionThread {
+@@ -185,6 +213,79 @@ public class RemoteStatusListener extends RemoteConnectionThread {
}
this.p.a((int) 0);
diff --git a/Spigot-Server-Patches/0644-Empty-commands-shall-not-be-dispatched.patch b/Spigot-Server-Patches/0644-Empty-commands-shall-not-be-dispatched.patch
index 1d69ef963b..5cf58807ca 100644
--- a/Spigot-Server-Patches/0644-Empty-commands-shall-not-be-dispatched.patch
+++ b/Spigot-Server-Patches/0644-Empty-commands-shall-not-be-dispatched.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Empty commands shall not be dispatched
diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java
-index 77d3712390125601d964519c3df9928ea3a7caf0..9d37d0c4af89469421dbdf47075612288cfa17c9 100644
+index 07d3dec9f613013aac72f3f5db17089ebe5ee770..a70e0761aeddee8fafff971b5cbd0422ab560fb5 100644
--- a/src/main/java/net/minecraft/commands/CommandDispatcher.java
+++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java
-@@ -222,6 +222,7 @@ public class CommandDispatcher {
+@@ -223,6 +223,7 @@ public class CommandDispatcher {
command = event.getCommand();
String[] args = command.split(" ");
diff --git a/Spigot-Server-Patches/0645-Implement-API-to-expose-exact-interaction-point.patch b/Spigot-Server-Patches/0645-Implement-API-to-expose-exact-interaction-point.patch
index 19f88178d4..1f195b4ea2 100644
--- a/Spigot-Server-Patches/0645-Implement-API-to-expose-exact-interaction-point.patch
+++ b/Spigot-Server-Patches/0645-Implement-API-to-expose-exact-interaction-point.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Implement API to expose exact interaction point
diff --git a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
-index 86d1a7625bb3016093ee8a46f91fd657d8bc2546..6ac3cf976205ea939e2a124bf9699e650eafe79f 100644
+index 5974cc9f895478eebd4922faa26d5a944064d7b6..1511cf54fea53577a2808b5d84417eee834db984 100644
--- a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
-@@ -492,7 +492,7 @@ public class PlayerInteractManager {
+@@ -495,7 +495,7 @@ public class PlayerInteractManager {
cancelledBlock = true;
}
diff --git a/Spigot-Server-Patches/0648-Entity-load-save-limit-per-chunk.patch b/Spigot-Server-Patches/0648-Entity-load-save-limit-per-chunk.patch
index 202226a888..a168fe3f5f 100644
--- a/Spigot-Server-Patches/0648-Entity-load-save-limit-per-chunk.patch
+++ b/Spigot-Server-Patches/0648-Entity-load-save-limit-per-chunk.patch
@@ -40,10 +40,10 @@ index 946c12abc0e25ccfe09ee64a7ac8b045ba5c46a9..bda4eeb032bea452ea368c679f96b2bd
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-index 4449a4e9609970622394bb4a3968d73a4d825382..eae810265051127d25c469797f4988ab4710bd4e 100644
+index 2e5221bc1b9e260e33f2cef2653dc59d05e2680d..4eaf497d048324a85ce49fc1c6e9559991c20df7 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
-@@ -537,11 +537,22 @@ public class ChunkRegionLoader {
+@@ -539,11 +539,22 @@ public class ChunkRegionLoader {
chunk.d(false);
@@ -66,7 +66,7 @@ index 4449a4e9609970622394bb4a3968d73a4d825382..eae810265051127d25c469797f4988ab
NBTTagCompound nbttagcompound4 = new NBTTagCompound();
// Paper start
if (asyncsavedata == null && !entity.dead && (int) Math.floor(entity.locX()) >> 4 != chunk.getPos().x || (int) Math.floor(entity.locZ()) >> 4 != chunk.getPos().z) {
-@@ -672,10 +683,21 @@ public class ChunkRegionLoader {
+@@ -674,10 +685,21 @@ public class ChunkRegionLoader {
NBTTagList nbttaglist = nbttagcompound.getList("Entities", 10);
World world = chunk.getWorld();
diff --git a/Spigot-Server-Patches/0649-Add-sendOpLevel-API.patch b/Spigot-Server-Patches/0649-Add-sendOpLevel-API.patch
index a532bed433..e68f9baa60 100644
--- a/Spigot-Server-Patches/0649-Add-sendOpLevel-API.patch
+++ b/Spigot-Server-Patches/0649-Add-sendOpLevel-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add sendOpLevel API
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 0cd0b268af5ef7903ce46387540e289f62077e7c..e00de9eba84de57b1b79d1860bd1eff8d1b71705 100644
+index 0757cfcb96778258ba2593756e4ca9cbb16e2f87..24b3a893a2b76a4ecfbc6b2cc1eac242e5c6e9d6 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1138,6 +1138,11 @@ public abstract class PlayerList {
@@ -32,10 +32,10 @@ index 0cd0b268af5ef7903ce46387540e289f62077e7c..e00de9eba84de57b1b79d1860bd1eff8
// Paper start
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index adebc5b1d110983feb6d43f371bf2569ddca4088..89737dfb0244a6dfe3a2cc2d77a7b16a64f469bb 100644
+index 5a245184d6290a58bb9aed139cc4c7b5511ce491..e97ad53eb8bdc4c71d8014d060710cb3a29ab7f8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2288,6 +2288,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2297,6 +2297,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
? (org.bukkit.entity.Firework) entity.getBukkitEntity()
: null;
}
diff --git a/Spigot-Server-Patches/0651-Collision-option-for-requiring-a-player-participant.patch b/Spigot-Server-Patches/0651-Collision-option-for-requiring-a-player-participant.patch
index 2c70325fcb..2ffec6957f 100644
--- a/Spigot-Server-Patches/0651-Collision-option-for-requiring-a-player-participant.patch
+++ b/Spigot-Server-Patches/0651-Collision-option-for-requiring-a-player-participant.patch
@@ -28,7 +28,7 @@ index bda4eeb032bea452ea368c679f96b2bd93118730..5801fe872aff240dc8209069b978d6a4
public int wanderingTraderSpawnDayTicks = 24000;
public int wanderingTraderSpawnChanceFailureIncrement = 25;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 0618c0bb7587dd1dc7560d0f0800036ff596edab..8b4df4affb798c19a8f2e968b3ca77aa22241201 100644
+index d801486565865cf3b56e9d80b7c1643e9b0f4597..f7223f214f911dd25abcf3a52745588ec630241d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1467,6 +1467,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -40,10 +40,18 @@ index 0618c0bb7587dd1dc7560d0f0800036ff596edab..8b4df4affb798c19a8f2e968b3ca77aa
double d1 = entity.locZ() - this.locZ();
double d2 = MathHelper.a(d0, d1);
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java
-index 2609b83573e0e8532e6c4c36d4f475bf0da6a354..5ae7620be7b0b5fba6aab8173aed45dc28bf36e3 100644
+index 2609b83573e0e8532e6c4c36d4f475bf0da6a354..069076d3c7165440217a7632b089ab2aa0fbdb1d 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java
-@@ -230,6 +230,7 @@ public class EntityBoat extends Entity {
+@@ -14,6 +14,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
+ import net.minecraft.network.syncher.DataWatcher;
+ import net.minecraft.network.syncher.DataWatcherObject;
+ import net.minecraft.network.syncher.DataWatcherRegistry;
++import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.sounds.SoundEffect;
+ import net.minecraft.sounds.SoundEffects;
+ import net.minecraft.tags.Tag;
+@@ -230,6 +231,7 @@ public class EntityBoat extends Entity {
@Override
public void collide(Entity entity) {
@@ -52,10 +60,18 @@ index 2609b83573e0e8532e6c4c36d4f475bf0da6a354..5ae7620be7b0b5fba6aab8173aed45dc
if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
-index 2e3ceab3e34f7756764b3471b13d48d1263ecba9..c79474ffb455bb87bfdd98bc68b3dc8dfcdca45e 100644
+index 2e3ceab3e34f7756764b3471b13d48d1263ecba9..57821301ef031995e6044a17b46c70a693322455 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
-@@ -767,6 +767,7 @@ public abstract class EntityMinecartAbstract extends Entity {
+@@ -21,6 +21,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
+ import net.minecraft.network.syncher.DataWatcher;
+ import net.minecraft.network.syncher.DataWatcherObject;
+ import net.minecraft.network.syncher.DataWatcherRegistry;
++import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.tags.Tag;
+ import net.minecraft.tags.TagsBlock;
+ import net.minecraft.util.MathHelper;
+@@ -767,6 +768,7 @@ public abstract class EntityMinecartAbstract extends Entity {
public void collide(Entity entity) {
if (!this.world.isClientSide) {
if (!entity.noclip && !this.noclip) {
diff --git a/Spigot-Server-Patches/0652-Make-ProjectileHitEvent-Cancellable.patch b/Spigot-Server-Patches/0652-Make-ProjectileHitEvent-Cancellable.patch
index 072cb11cbe..9ff6d74f21 100644
--- a/Spigot-Server-Patches/0652-Make-ProjectileHitEvent-Cancellable.patch
+++ b/Spigot-Server-Patches/0652-Make-ProjectileHitEvent-Cancellable.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Make ProjectileHitEvent Cancellable
Allows cancelling things like detonating TNT from Fire Arrows
diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java
-index 08b3499681eaf23a2f79f6dd9134ccfd86d888a4..7428de092006d5da3e8a543e46a11c6122eac323 100644
+index ede7b4dbf2dce7bac83c5e17eecfdaf0e8a84fe7..b9680f6f2e30ec9397d6a9c83e79563d9253aff6 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java
-@@ -86,7 +86,7 @@ public abstract class EntityFireball extends IProjectile {
+@@ -87,7 +87,7 @@ public abstract class EntityFireball extends IProjectile {
// CraftBukkit start - Fire ProjectileHitEvent
if (this.dead) {
@@ -19,10 +19,10 @@ index 08b3499681eaf23a2f79f6dd9134ccfd86d888a4..7428de092006d5da3e8a543e46a11c61
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
-index 0e3c646dca1fa1fa895c3aece037367a9b2cf378..054785a3db3c787f5c1444613d3e8fe235e397f1 100644
+index 37b1febb45b900dfe4b225152e66bc4be83df220..9f2e7d345d98f50e6d47cbf4bb35714852fa42da 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
-@@ -129,7 +129,7 @@ public abstract class IProjectile extends Entity {
+@@ -130,7 +130,7 @@ public abstract class IProjectile extends Entity {
}
protected void a(MovingObjectPosition movingobjectposition) {
diff --git a/Spigot-Server-Patches/0667-EntityMoveEvent.patch b/Spigot-Server-Patches/0667-EntityMoveEvent.patch
index 723d13b324..c68a52a6ba 100644
--- a/Spigot-Server-Patches/0667-EntityMoveEvent.patch
+++ b/Spigot-Server-Patches/0667-EntityMoveEvent.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] EntityMoveEvent
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index d7f52ceaca74d5db239d0c6ac151b0ba184bb58c..36823b17aea61af9b0bf4565e3b33ade95f50c97 100644
+index c4da751bed3014a5521ac0014b07c139b69b1187..5da58830459d2ff10e7fde28b41995699134459f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -12,6 +12,7 @@ import com.mojang.datafixers.DataFixer;
@@ -16,7 +16,7 @@ index d7f52ceaca74d5db239d0c6ac151b0ba184bb58c..36823b17aea61af9b0bf4565e3b33ade
import it.unimi.dsi.fastutil.longs.LongIterator;
import java.awt.image.BufferedImage;
import java.io.BufferedWriter;
-@@ -1446,6 +1447,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -1448,6 +1449,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next();
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
diff --git a/Spigot-Server-Patches/0675-misc-debugging-dumps.patch b/Spigot-Server-Patches/0675-misc-debugging-dumps.patch
index 274c4c056f..48feaf0889 100644
--- a/Spigot-Server-Patches/0675-misc-debugging-dumps.patch
+++ b/Spigot-Server-Patches/0675-misc-debugging-dumps.patch
@@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..2d5494d2813b773e60ddba6790b750a9
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 36823b17aea61af9b0bf4565e3b33ade95f50c97..e6e54b1a9d3fbe4da72bf096af7db8d8844a8e55 100644
+index 5da58830459d2ff10e7fde28b41995699134459f..c372e6897c73fad6f9c478cec9f58303fb0cce17 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -13,6 +13,7 @@ import io.netty.buffer.ByteBuf;
@@ -40,7 +40,7 @@ index 36823b17aea61af9b0bf4565e3b33ade95f50c97..e6e54b1a9d3fbe4da72bf096af7db8d8
import it.unimi.dsi.fastutil.longs.LongIterator;
import java.awt.image.BufferedImage;
import java.io.BufferedWriter;
-@@ -843,6 +844,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -845,6 +846,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// CraftBukkit start
private boolean hasStopped = false;
public volatile boolean hasFullyShutdown = false; // Paper
@@ -48,7 +48,7 @@ index 36823b17aea61af9b0bf4565e3b33ade95f50c97..e6e54b1a9d3fbe4da72bf096af7db8d8
private final Object stopLock = new Object();
public final boolean hasStopped() {
synchronized (stopLock) {
-@@ -857,6 +859,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -859,6 +861,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
if (hasStopped) return;
hasStopped = true;
}
@@ -56,7 +56,7 @@ index 36823b17aea61af9b0bf4565e3b33ade95f50c97..e6e54b1a9d3fbe4da72bf096af7db8d8
// Paper start - kill main thread, and kill it hard
shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper
-@@ -973,6 +976,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
+@@ -975,6 +978,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public void safeShutdown(boolean flag, boolean isRestarting) {
this.isRunning = false;
this.isRestarting = isRestarting;
diff --git a/Spigot-Server-Patches/0678-Expose-Tracked-Players.patch b/Spigot-Server-Patches/0678-Expose-Tracked-Players.patch
index 94ba59394e..cf2ad1c4ed 100644
--- a/Spigot-Server-Patches/0678-Expose-Tracked-Players.patch
+++ b/Spigot-Server-Patches/0678-Expose-Tracked-Players.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Expose Tracked Players
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 8b4df4affb798c19a8f2e968b3ca77aa22241201..038e44fc94b9920f2af9e2ede626950d1add06bc 100644
+index f7223f214f911dd25abcf3a52745588ec630241d..7abeeefeb579a43bc9ee85fd4150afacfb11c802 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -172,7 +172,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -18,7 +18,7 @@ index 8b4df4affb798c19a8f2e968b3ca77aa22241201..038e44fc94b9920f2af9e2ede626950d
public Throwable addedToWorldStack; // Paper - entity debug
public CraftEntity getBukkitEntity() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 89737dfb0244a6dfe3a2cc2d77a7b16a64f469bb..c86d7435346d9cb04cf798939ccfa54488f20480 100644
+index e97ad53eb8bdc4c71d8014d060710cb3a29ab7f8..e5549439b3d4d608cf37dd33b6c8c9e10dfe9328 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -16,6 +16,7 @@ import java.net.InetSocketAddress;
@@ -29,7 +29,7 @@ index 89737dfb0244a6dfe3a2cc2d77a7b16a64f469bb..c86d7435346d9cb04cf798939ccfa544
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
-@@ -2297,6 +2298,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2306,6 +2307,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end
diff --git a/Spigot-Server-Patches/0680-do-not-create-unnecessary-copies-of-passenger-list.patch b/Spigot-Server-Patches/0680-do-not-create-unnecessary-copies-of-passenger-list.patch
index d32eb2798c..c36ce71390 100644
--- a/Spigot-Server-Patches/0680-do-not-create-unnecessary-copies-of-passenger-list.patch
+++ b/Spigot-Server-Patches/0680-do-not-create-unnecessary-copies-of-passenger-list.patch
@@ -44,7 +44,7 @@ index aa5ba862f18ff706f11b0b26cea55a904a5a9473..f65eb0168ed365e5c1b490c56ec84e3b
}
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
-index 033dee28da5b788b90b6c6651b2ab92efd1d2f21..cb75fb64b28827097eb4f3e778ab3bbcd8ed0779 100644
+index b47cd2a8fb4920531d80acfcfe40f8211fedc9ae..300884804bf9ac3fba7c30a04d8adf52e3dd2e3e 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
@@ -2307,7 +2307,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
@@ -57,7 +57,7 @@ index 033dee28da5b788b90b6c6651b2ab92efd1d2f21..cb75fb64b28827097eb4f3e778ab3bbc
}
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 038e44fc94b9920f2af9e2ede626950d1add06bc..afd443a30e2839d4fbb7200d1f767cadc162fb9d 100644
+index 7abeeefeb579a43bc9ee85fd4150afacfb11c802..429f0591c6a55f6c5d08a0755f7d39da676468bc 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2230,7 +2230,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -167,10 +167,10 @@ index 7781386da593a1c4f3ad7e7e8761767dda7cb66c..16d5cae64887b82e67eeb61ccb714e61
@Override
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java
-index 5ae7620be7b0b5fba6aab8173aed45dc28bf36e3..0e3fcf5facdac7f5d2d509f20cb45d5de38f72d4 100644
+index 069076d3c7165440217a7632b089ab2aa0fbdb1d..5e2c13bd6e52ffe182ef034e05ba6fe1cb301005 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java
-@@ -316,7 +316,7 @@ public class EntityBoat extends Entity {
+@@ -317,7 +317,7 @@ public class EntityBoat extends Entity {
super.tick();
this.r();
if (this.cs()) {
@@ -179,7 +179,7 @@ index 5ae7620be7b0b5fba6aab8173aed45dc28bf36e3..0e3fcf5facdac7f5d2d509f20cb45d5d
this.a(false, false);
}
-@@ -379,7 +379,7 @@ public class EntityBoat extends Entity {
+@@ -380,7 +380,7 @@ public class EntityBoat extends Entity {
Entity entity = (Entity) list.get(j);
if (!entity.w(this)) {
@@ -188,7 +188,7 @@ index 5ae7620be7b0b5fba6aab8173aed45dc28bf36e3..0e3fcf5facdac7f5d2d509f20cb45d5d
entity.startRiding(this);
} else {
this.collide(entity);
-@@ -726,8 +726,8 @@ public class EntityBoat extends Entity {
+@@ -727,8 +727,8 @@ public class EntityBoat extends Entity {
float f = 0.0F;
float f1 = (float) ((this.dead ? 0.009999999776482582D : this.bc()) + entity.bb());
@@ -199,7 +199,7 @@ index 5ae7620be7b0b5fba6aab8173aed45dc28bf36e3..0e3fcf5facdac7f5d2d509f20cb45d5d
if (i == 0) {
f = 0.2F;
-@@ -746,7 +746,7 @@ public class EntityBoat extends Entity {
+@@ -747,7 +747,7 @@ public class EntityBoat extends Entity {
entity.yaw += this.ak;
entity.setHeadRotation(entity.getHeadRotation() + this.ak);
this.a(entity);
@@ -208,7 +208,7 @@ index 5ae7620be7b0b5fba6aab8173aed45dc28bf36e3..0e3fcf5facdac7f5d2d509f20cb45d5d
int j = entity.getId() % 2 == 0 ? 90 : 270;
entity.n(((EntityAnimal) entity).aA + (float) j);
-@@ -906,13 +906,13 @@ public class EntityBoat extends Entity {
+@@ -907,13 +907,13 @@ public class EntityBoat extends Entity {
@Override
protected boolean q(Entity entity) {
@@ -225,10 +225,10 @@ index 5ae7620be7b0b5fba6aab8173aed45dc28bf36e3..0e3fcf5facdac7f5d2d509f20cb45d5d
return list.isEmpty() ? null : (Entity) list.get(0);
}
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
-index c79474ffb455bb87bfdd98bc68b3dc8dfcdca45e..f2b905e5689ee419e9d83bb4ca671ef44ccb031f 100644
+index 57821301ef031995e6044a17b46c70a693322455..75a88ab5d5b0fdb98ea8d61bb6b82049b21101f3 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
-@@ -560,7 +560,7 @@ public abstract class EntityMinecartAbstract extends Entity {
+@@ -561,7 +561,7 @@ public abstract class EntityMinecartAbstract extends Entity {
vec3d1 = new Vec3D(d8 * d4 / d6, vec3d1.y, d8 * d5 / d6);
this.setMot(vec3d1);
diff --git a/Spigot-Server-Patches/0685-fix-converting-txt-to-json-file.patch b/Spigot-Server-Patches/0685-fix-converting-txt-to-json-file.patch
index 082b19bb5e..012889fee3 100644
--- a/Spigot-Server-Patches/0685-fix-converting-txt-to-json-file.patch
+++ b/Spigot-Server-Patches/0685-fix-converting-txt-to-json-file.patch
@@ -49,7 +49,7 @@ index c4df472050622eb2469b2ddb4d2ed917994f6e95..52bb528e75eb43156ee2bf19877bc051
return false;
} else {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index e00de9eba84de57b1b79d1860bd1eff8d1b71705..c7d81efa41fd9dd248ba85a29386cbad470f8f66 100644
+index 24b3a893a2b76a4ecfbc6b2cc1eac242e5c6e9d6..92ed4938d5fe6b76e3a9ac5491d6e9c004ade843 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -175,6 +175,7 @@ public abstract class PlayerList {
@@ -61,10 +61,10 @@ index e00de9eba84de57b1b79d1860bd1eff8d1b71705..c7d81efa41fd9dd248ba85a29386cbad
public void a(NetworkManager networkmanager, EntityPlayer entityplayer) {
EntityPlayer prev = pendingPlayers.put(entityplayer.getUniqueID(), entityplayer);// Paper
diff --git a/src/main/java/net/minecraft/server/players/UserCache.java b/src/main/java/net/minecraft/server/players/UserCache.java
-index bc3deb1d9710c744388ce6e89a6f5f4f3f05238d..08d279d7a1bc73f4043b944beb1c64132ededef5 100644
+index e3801a4a13d0bac7816a1350d3799a9815481c4b..74b024a51f6c3ee88db730cbf97a24af66fa332b 100644
--- a/src/main/java/net/minecraft/server/players/UserCache.java
+++ b/src/main/java/net/minecraft/server/players/UserCache.java
-@@ -240,6 +240,7 @@ public class UserCache {
+@@ -241,6 +241,7 @@ public class UserCache {
return arraylist;
}
diff --git a/Spigot-Server-Patches/0687-added-PlayerNameEntityEvent.patch b/Spigot-Server-Patches/0687-added-PlayerNameEntityEvent.patch
index bd505483ca..c4ab87d789 100644
--- a/Spigot-Server-Patches/0687-added-PlayerNameEntityEvent.patch
+++ b/Spigot-Server-Patches/0687-added-PlayerNameEntityEvent.patch
@@ -5,10 +5,16 @@ Subject: [PATCH] added PlayerNameEntityEvent
diff --git a/src/main/java/net/minecraft/world/item/ItemNameTag.java b/src/main/java/net/minecraft/world/item/ItemNameTag.java
-index 140a865f4f8fb3e4f787cf8d334d20fac6cb5eef..542ffc79cdd76d71da2c749548abca2dad2fef41 100644
+index 140a865f4f8fb3e4f787cf8d334d20fac6cb5eef..b9b2b27e534ba87a1aae3c521f393a066a18a199 100644
--- a/src/main/java/net/minecraft/world/item/ItemNameTag.java
+++ b/src/main/java/net/minecraft/world/item/ItemNameTag.java
-@@ -6,6 +6,11 @@ import net.minecraft.world.entity.EntityInsentient;
+@@ -1,11 +1,17 @@
+ package net.minecraft.world.item;
+
++import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.world.EnumHand;
+ import net.minecraft.world.EnumInteractionResult;
+ import net.minecraft.world.entity.EntityInsentient;
import net.minecraft.world.entity.EntityLiving;
import net.minecraft.world.entity.player.EntityHuman;
@@ -20,7 +26,7 @@ index 140a865f4f8fb3e4f787cf8d334d20fac6cb5eef..542ffc79cdd76d71da2c749548abca2d
public class ItemNameTag extends Item {
public ItemNameTag(Item.Info item_info) {
-@@ -16,11 +21,15 @@ public class ItemNameTag extends Item {
+@@ -16,11 +22,15 @@ public class ItemNameTag extends Item {
public EnumInteractionResult a(ItemStack itemstack, EntityHuman entityhuman, EntityLiving entityliving, EnumHand enumhand) {
if (itemstack.hasName() && !(entityliving instanceof EntityHuman)) {
if (!entityhuman.world.isClientSide && entityliving.isAlive()) {
diff --git a/Spigot-Server-Patches/0689-Add-recipe-to-cook-events.patch b/Spigot-Server-Patches/0689-Add-recipe-to-cook-events.patch
index a8630ee2eb..41d4ad4460 100644
--- a/Spigot-Server-Patches/0689-Add-recipe-to-cook-events.patch
+++ b/Spigot-Server-Patches/0689-Add-recipe-to-cook-events.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add recipe to cook events
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityCampfire.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityCampfire.java
-index bd213deedf47e71f0983bb950c7e74d4bf30f54e..d263b5a95cd482fa15a20fd742158f9ab837038f 100644
+index 62a19f39405cff27f34a3b98fb9310b1c9c27563..08759f461ec947c0d5655557f49d8717afee6f00 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityCampfire.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityCampfire.java
-@@ -73,7 +73,10 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
+@@ -74,7 +74,10 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
if (this.cookingTimes[i] >= this.cookingTotalTimes[i]) {
InventorySubcontainer inventorysubcontainer = new InventorySubcontainer(new ItemStack[]{itemstack});
@@ -20,7 +20,7 @@ index bd213deedf47e71f0983bb950c7e74d4bf30f54e..d263b5a95cd482fa15a20fd742158f9a
return recipecampfire.a(inventorysubcontainer);
}).orElse(itemstack);
BlockPosition blockposition = this.getPosition();
-@@ -82,7 +85,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
+@@ -83,7 +86,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);
diff --git a/Spigot-Server-Patches/0692-Implement-Keyed-on-World.patch b/Spigot-Server-Patches/0692-Implement-Keyed-on-World.patch
index 58a61a09dc..c8b1b43e20 100644
--- a/Spigot-Server-Patches/0692-Implement-Keyed-on-World.patch
+++ b/Spigot-Server-Patches/0692-Implement-Keyed-on-World.patch
@@ -93,10 +93,10 @@ index cbac3c96c5d3c1551912f5769bfc50d690519495..03b8d67a5f0088c0254b2099f27e8dca
// Check if a World already exists with the UID.
if (getWorld(world.getUID()) != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 04ab5f395c565e998478564fd5b3081457317537..9cd907baa38a5b04fb56873009ac7cf3b92e0b9e 100644
+index 2008e05c090e6a390d4210f2e8ed6ff75fb99e89..16567619d7ca84a997ef46417d72f92e6db6993d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -2583,6 +2583,11 @@ public class CraftWorld implements World {
+@@ -2585,6 +2585,11 @@ public class CraftWorld implements World {
return CompletableFuture.completedFuture(chunk == null ? null : chunk.getBukkitChunk());
}, net.minecraft.server.MinecraftServer.getServer());
}
diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh
index 597f797c1f..fb795a84b2 100755
--- a/scripts/importmcdev.sh
+++ b/scripts/importmcdev.sh
@@ -62,7 +62,7 @@ function importLibrary {
files=$(cat "$basedir/Spigot-Server-Patches/"* | grep "+++ b/src/main/java/net/minecraft/" | sort | uniq | sed 's/\+\+\+ b\/src\/main\/java\/net\/minecraft\///g')
-nonnms=$(grep -R "new file mode" -B 1 "$basedir/Spigot-Server-Patches/" | grep -v "new file mode" | grep -oE "net\/minecraft\/**\/.*.java" | grep -oE "[A-Za-z]+?.java$" --color=none | sed 's/.java//g')
+nonnms=$(grep -R "new file mode" -B 1 "$basedir/Spigot-Server-Patches/" | grep -v "new file mode" | grep -oE "net\/minecraft\/**\/.*.java" | sed -E 's/.*\/net\/minecraft\/(.*)/\1/g')
function containsElement {
local e
for e in "${@:2}"; do
@@ -78,12 +78,16 @@ for f in $files; do
f="$(echo "$f" | sed 's/.java//g')"
if [ ! -f "$decompiledir/$nms/$f.java" ]; then
echo "$(color 1 31) ERROR!!! Missing NMS$(color 1 34) $f $(colorend)";
+ error=true
else
import $f
fi
fi
fi
done
+if [ -n "$error" ]; then
+ exit 1
+fi
########################################################
########################################################