From f6d820f077cb565d0a5e891eaf3e586d53f1204a Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm Date: Tue, 16 Mar 2021 16:50:45 +0100 Subject: [PATCH] It compiles --- Spigot-Server-Patches/0003-MC-Dev-fixes.patch | 41 ++++- Spigot-Server-Patches/0004-MC-Utils.patch | 26 ++-- ...to-current-Chunk-for-Entity-and-Bloc.patch | 4 +- ...ve-invalid-mob-spawner-tile-entities.patch | 16 +- .../0023-Optimize-TileEntity-Ticking.patch | 41 +++-- .../0055-Add-exception-reporting-event.patch | 8 +- ...Location-getType-and-getBlockData-fo.patch | 6 +- ...ckPhysicsEvent-if-a-plugin-has-a-lis.patch | 26 +++- ...74-Configurable-Chunk-Inhabited-Time.patch | 4 +- .../0075-EntityPathfindEvent.patch | 16 +- ...7-Do-not-load-chunks-for-Pathfinding.patch | 4 +- ...-Configurable-Grass-Spread-Tick-Rate.patch | 12 +- .../0087-Configurable-Player-Collision.patch | 16 +- ...-possibility-for-getServer-singleton.patch | 8 +- .../0099-Optimize-UserCache-Thread-Safe.patch | 28 ++-- ...1-Optional-TNT-doesn-t-move-in-water.patch | 23 ++- .../0106-Fix-Old-Sign-Conversion.patch | 4 +- ...e-profiles-that-have-no-UUID-and-no-.patch | 4 +- ...tion-to-remove-corrupt-tile-entities.patch | 4 +- .../0123-Add-ProjectileCollideEvent.patch | 24 ++- ...vent-Pathfinding-out-of-World-Border.patch | 4 +- .../0132-Firework-API-s.patch | 14 +- .../0133-PlayerTeleportEndGatewayEvent.patch | 12 +- ...rovide-E-TE-Chunk-count-stat-methods.patch | 8 +- ...le-async-calls-to-restart-the-server.patch | 12 +- ...oleAppender-for-console-improvements.patch | 16 +- .../0152-Basic-PlayerProfile-API.patch | 10 +- .../0182-PlayerPickupExperienceEvent.patch | 12 +- ...4-Ability-to-apply-mending-to-XP-API.patch | 30 +++- .../0186-PreCreatureSpawnEvent.patch | 38 ++++- ...-Extend-Player-Interact-cancellation.patch | 22 ++- ...nt-extended-PaperServerListPingEvent.patch | 4 +- .../0200-Player.setPlayerProfile-API.patch | 18 ++- ...06-Flag-to-disable-the-channel-limit.patch | 6 +- ...d-method-to-open-already-placed-sign.patch | 14 +- ...Item-entities-with-World.spawnEntity.patch | 4 +- ...lement-EntityTeleportEndGatewayEvent.patch | 4 +- ...3-Implement-World.getEntity-UUID-API.patch | 4 +- .../0234-InventoryCloseEvent-Reason-API.patch | 12 +- ...8-Vanished-players-don-t-have-rights.patch | 14 +- ...-anytime-entities-change-to-guarante.patch | 6 +- ...dd-some-Debug-to-Chunk-Entity-slices.patch | 21 ++- ...revent-Saving-Bad-entities-to-chunks.patch | 18 ++- ...ead-Entities-in-entityList-iteration.patch | 12 +- ...55-Implement-Expanded-ArmorStand-API.patch | 14 +- ...6-Experience-should-save-as-Integers.patch | 6 +- ...ient-rendering-skulls-from-same-user.patch | 22 ++- ...dd-Early-Warning-Feature-to-WatchDog.patch | 4 +- ...Allow-disabling-armour-stand-ticking.patch | 4 +- ...le-speed-for-water-flowing-over-lava.patch | 14 +- .../0274-Add-PhantomPreSpawnEvent.patch | 19 ++- ...e-attack-cooldown-methods-for-Player.patch | 4 +- .../0280-Improve-death-events.patch | 6 +- ...ow-chests-to-be-placed-with-NBT-data.patch | 6 +- .../0282-Mob-Pathfinding-API.patch | 12 +- ...-for-CanPlaceOn-and-CanDestroy-NBT-v.patch | 51 ++++--- ...ent-Mob-AI-Rules-from-Loading-Chunks.patch | 14 +- ...wning-from-loading-generating-chunks.patch | 6 +- .../0289-PreSpawnerSpawnEvent.patch | 4 +- ...arseException-in-Entity-and-TE-names.patch | 36 ++++- Spigot-Server-Patches/0296-Turtle-API.patch | 18 ++- ...ther-worlds-for-shooter-of-projectil.patch | 4 +- ...9-Add-Velocity-IP-Forwarding-Support.patch | 8 +- ...er-Thread-Pool-and-Thread-Priorities.patch | 4 +- .../0307-Optimize-World-Time-Updates.patch | 4 +- ...t-allow-digging-into-unloaded-chunks.patch | 8 +- ...-replace-OfflinePlayer-getLastPlayed.patch | 12 +- ...-remove-from-being-called-on-Players.patch | 4 +- ...-Manager-and-add-advanced-packet-sup.patch | 10 +- .../0337-Entity-getEntitySpawnReason.patch | 10 +- .../0341-Server-Tick-Events.patch | 6 +- .../0344-Add-Heightmap-API.patch | 10 +- .../0345-Mob-Spawner-API-Enhancements.patch | 12 +- ...layer-View-Distance-API-placeholders.patch | 4 +- ...isPrimaryThread-and-MinecraftServer-.patch | 4 +- .../0351-Duplicate-UUID-Resolve-Option.patch | 6 +- ...le-Keep-Spawn-Loaded-range-per-world.patch | 6 +- ...eptions-from-dispenser-entity-spawns.patch | 12 +- ...359-Fix-World-isChunkGenerated-calls.patch | 19 ++- .../0362-incremental-chunk-saving.patch | 12 +- Spigot-Server-Patches/0363-Anti-Xray.patch | 26 ++-- ...al-Spawned-mobs-towards-natural-spaw.patch | 4 +- ...gurable-projectile-relative-velocity.patch | 4 +- ...opper-searches-if-there-are-no-items.patch | 26 +++- ...69-Asynchronous-chunk-IO-and-loading.patch | 58 +++++--- ...if-we-have-a-custom-Bukkit-generator.patch | 6 +- ...ement-optional-per-player-mob-spawns.patch | 32 ++-- .../0386-PlayerLaunchProjectileEvent.patch | 68 +++++++-- ...5656-Fix-Follow-Range-Initial-Target.patch | 15 +- .../0390-Optimize-Hoppers.patch | 20 ++- ...rializing-mismatching-chunk-coordina.patch | 18 ++- ...k-in-stack-not-having-effects-when-d.patch | 4 +- .../0402-Entity-Activation-Range-2.0.patch | 12 +- .../0408-Optimise-random-block-ticking.patch | 12 +- ...n-to-nerf-pigmen-from-nether-portals.patch | 14 +- .../0411-Make-the-GUI-graph-fancier.patch | 4 +- .../0417-Optimise-Chunk-getFluid.patch | 6 +- ...imise-TickListServer-by-rewriting-it.patch | 16 +- ...spawn-settings-and-per-player-option.patch | 16 +- ...ptimize-Collision-to-not-load-chunks.patch | 20 ++- ...hunkMap-memory-use-for-visibleChunks.patch | 6 +- .../0429-Increase-Light-Queue-Size.patch | 4 +- ...asks-Speed-up-processing-of-chunk-lo.patch | 18 +-- ...-Add-tick-times-API-and-mspt-command.patch | 8 +- .../0437-Async-command-map-building.patch | 14 +- .../0438-Improved-Watchdog-Support.patch | 28 ++-- .../0439-Optimize-Pathfinding.patch | 14 +- ...vent-opening-inventories-when-frozen.patch | 6 +- ...-Implement-Player-Client-Options-API.patch | 4 +- ...Load-Chunks-for-Login-Asynchronously.patch | 21 ++- ...ntom-creative-and-insomniac-controls.patch | 22 ++- .../0460-Implement-Brigadier-Mojang-API.patch | 8 +- .../0461-Villager-Restocks-API.patch | 4 +- .../0466-Implement-Mob-Goal-API.patch | 9 +- ...tance-map-to-optimise-entity-tracker.patch | 8 +- ...No-Tick-view-distance-implementation.patch | 140 ++++++++++++++---- .../0471-Add-villager-reputation-API.patch | 12 +- .../0472-Fix-Light-Command.patch | 17 +-- .../0475-Potential-bed-API.patch | 14 +- ...Wait-for-Async-Tasks-during-shutdown.patch | 4 +- ...ze-NibbleArray-to-use-pooled-buffers.patch | 25 +++- ...llocation-of-Vec3D-by-entity-tracker.patch | 4 +- .../0482-Ensure-safe-gateway-teleport.patch | 4 +- ...on-Full-Status-Chunk-NBT-Memory-Leak.patch | 14 +- ...ound-for-Client-Lag-Spikes-MC-162253.patch | 54 +------ ...k-Priority-Urgency-System-for-Chunks.patch | 66 ++++++--- ...mprove-Chunk-Status-Transition-Speed.patch | 6 +- .../0493-Optimize-Light-Engine.patch | 72 +++++---- ...-Plugin-Tickets-to-API-Chunk-Methods.patch | 24 ++- ...Holder-method-without-block-snapshot.patch | 16 +- ...07-Add-permission-for-command-blocks.patch | 10 +- ...WorldBorder-collision-checks-and-air.patch | 6 +- ...ld-Difficulty-Remembering-Difficulty.patch | 18 ++- ...512-Don-t-allow-null-UUID-s-for-chat.patch | 12 +- ...nvert-legacy-attributes-in-Item-Meta.patch | 6 +- ...-Remove-some-streams-from-structures.patch | 14 +- .../0519-Support-components-in-ItemMeta.patch | 10 +- .../0521-Add-entity-liquid-API.patch | 6 +- ...ze-NetworkManager-Exception-Handling.patch | 18 ++- ...ataPlayer-leak-due-from-quitting-ear.patch | 4 +- ...keLighting-call-to-World-spigot-stri.patch | 4 +- .../0540-Incremental-player-saving.patch | 6 +- ...ull-chunk-sections-for-block-updates.patch | 4 +- ...erver-load-chunks-from-newer-version.patch | 4 +- .../0547-Brand-support.patch | 4 +- ...geEvent-not-firing-for-all-use-cases.patch | 4 +- .../0555-Add-moon-phase-API.patch | 4 +- .../0557-Add-BellRingEvent.patch | 14 +- .../0564-Add-more-Evoker-API.patch | 13 +- .../0567-Cache-block-data-strings.patch | 18 ++- ...ortation-and-cancel-velocity-if-tele.patch | 6 +- ...al-open-container-api-to-HumanEntity.patch | 6 +- ...p-capture-to-capture-all-items-added.patch | 12 +- ...rty-in-invalid-locations-SPIGOT-6086.patch | 4 +- .../0575-Entity-isTicking.patch | 6 +- ...-non-whitelisted-player-when-white-l.patch | 4 +- ...Fix-Not-a-string-Map-Conversion-spam.patch | 17 ++- .../0582-Optimise-getType-calls.patch | 4 +- ...tem-locations-dropped-from-campfires.patch | 12 +- .../0588-Player-elytra-boost-API.patch | 25 +++- .../0592-Add-ignore-discounts-API.patch | 6 +- ...prove-performance-of-the-end-generat.patch | 13 +- .../0601-Expose-world-spawn-angle.patch | 6 +- ...r-spawnParticle-x-y-z-precision-loss.patch | 4 +- ...-should-not-bypass-cramming-gamerule.patch | 6 +- .../0609-Add-PlayerShearBlockEvent.patch | 26 +++- ...g-for-servers-not-running-on-Java-11.patch | 6 +- ...ing-zombie-villager-discount-exploit.patch | 4 +- .../0625-Fix-harming-potion-dupe.patch | 16 +- .../0636-Added-WorldGameRuleChangeEvent.patch | 6 +- ...7-Added-ServerResourcesReloadedEvent.patch | 8 +- .../0641-Fire-event-on-GS4-query.patch | 20 ++- ...pty-commands-shall-not-be-dispatched.patch | 4 +- ...PI-to-expose-exact-interaction-point.patch | 4 +- ...648-Entity-load-save-limit-per-chunk.patch | 6 +- .../0649-Add-sendOpLevel-API.patch | 6 +- ...n-for-requiring-a-player-participant.patch | 26 +++- ...-Make-ProjectileHitEvent-Cancellable.patch | 8 +- .../0667-EntityMoveEvent.patch | 4 +- .../0675-misc-debugging-dumps.patch | 8 +- .../0678-Expose-Tracked-Players.patch | 6 +- ...unnecessary-copies-of-passenger-list.patch | 20 +-- ...0685-fix-converting-txt-to-json-file.patch | 6 +- .../0687-added-PlayerNameEntityEvent.patch | 12 +- .../0689-Add-recipe-to-cook-events.patch | 6 +- .../0692-Implement-Keyed-on-World.patch | 4 +- scripts/importmcdev.sh | 6 +- 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 e80a53073..884320a1f 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>, EnumProtocol> f = Maps.newHashMap(); -@@ -248,7 +249,7 @@ public enum EnumProtocol { +@@ -248,7 +256,7 @@ public enum EnumProtocol { private final List>> 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 IAsyncTaskHandlerReentrantmap(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) 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 1948636b4..22194308d 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 currentChunk = null; ++ public java.lang.ref.WeakReference 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 5abc01638..2aeae2d5b 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 f56bf8b79..a556c9c8d 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 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 34e17ce28..74ea309c9 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 f5214b7a9..9f9e1ddd6 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 c1accf63c..0122441e7 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 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 1ec962b18..6066e9346 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 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 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 81720d125..e06e53104 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 60a844c33..3df71abbf 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 b11c89044..c9e047b2c 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 0febf2e4f..59933e763 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 ed8efad69..d30b0eae3 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 30ce8c344..5f7e8518a 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 ffcd613f0..6e0a520b6 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 848b9c004..6618bb4dd 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 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 25c51a6e8..5b49cb681 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, 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 processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; -@@ -323,7 +323,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 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 230e7015b..994fed3ea 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 94cff50e2..f8fd95c01 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 4f00d259e..6c66c1146 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 6133c1f72..8126ba4dc 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 14740e889..0f2e5b278 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= 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 7dba2f3c1..a800c632b 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 a4de34622..a03a30287 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 11e18a9ac..203a050a8 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 b646fd3ef..8ce474e8f 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 946ec2d23..188e40842 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 7b4017c78..e033cb6e9 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 497aacaf6..de6e63635 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 d709061d8..9892a1b93 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 37b456246..a5f5fb4d8 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 d3aa3ba8a..71c72d329 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 entitySlice = null; ++ public List 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 7df29dd5d..547315f0b 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 81f9584f9..ef440ea74 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 18ea30042..55ff4fad2 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 462f19eec..7c85de629 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 a207ac3b2..97e95497b 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 b4e112664..2791f66b5 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 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 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 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 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 internalTags = new HashMap(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 2c55a3415..29f93fd83 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 a15c89449..7a2091505 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 1855ebe48..df8c61a85 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 b57615d5d..21a0e7b36 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 1c6586b48..5d55bbc3f 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 1460c05dd..b624461f3 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 3fb312b09..4c21b54f1 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 8348f9c7a..6e9214487 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 entitySlice = null; + public List 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 64b1af288..bc5e604cb 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= -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 bfe2528d2..37f6cfaac 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 b09ce7ebb..4cd1837ea 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 1fc9de6cb..ad1c416c1 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 { ++ public final class a extends IAsyncTaskHandler { // 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 cf96f49f5..875707df0 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 processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); 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 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 o; private TickList p; private boolean q; diff --git a/Spigot-Server-Patches/0363-Anti-Xray.patch b/Spigot-Server-Patches/0363-Anti-Xray.patch index fe928bad5..5340e42f8 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 b7f512ff2..528f3c902 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 343b1ed42..55dc364cd 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 4773ab73f..77f09da2e 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 ticklist, TickList ticklist1, long i, @Nullable ChunkSection[] achunksection, @Nullable Consumer 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 1e53b4f82..dba9ede25 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 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 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 b6182e96b..dbd8cbc5a 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 iterable, SpawnerCreature.b spawnercreature_b) { @@ -686,7 +694,7 @@ index 166609e03474946882791dbebafe7121a3727854..66350a00f728901a7eef1c376c79a4cd SpawnerCreatureProbabilities spawnercreatureprobabilities = new SpawnerCreatureProbabilities(); Object2IntOpenHashMap 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 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 f3b911018..ceeb9bcd0 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 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 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 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 2fec6fc79..342a7deea 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 92ec64914..09f351c04 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 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 51438f77a..1c55da068 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 67a2dd383..f28895688 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 cf9973597..118ae7433 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 c62852f7a..798698c44 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 0d3de5119..1a54ef16f 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 72e312fc7..c8a21d02d 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 implements TickList { +@@ -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 implements TickList { + +@@ -61,6 +62,8 @@ public class TickListChunk implements TickList { return nbttaglist; } @@ -1084,7 +1092,7 @@ index c3cb513d0d107ecb43e98960b25054626aa6a03f..d7f532388b65161f8dcced02aebba6b0 public static TickListChunk a(NBTTagList nbttaglist, Function function, Function function1) { List> list = Lists.newArrayList(); -@@ -71,7 +73,14 @@ public class TickListChunk implements TickList { +@@ -71,7 +74,14 @@ public class TickListChunk implements TickList { 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 99eea71ef..32a59081e 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 fb11b1063..96dd9daa1 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 c(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate 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 { @Nullable @@ -88,7 +98,7 @@ index fa3421c9cd8531618827627e9c524a8df77c4c58..1fe6aba0884755be3382d38cebfdd191 private boolean h; private final BiPredicate i; -@@ -64,23 +64,37 @@ public class VoxelShapeSpliterator extends AbstractSpliterator { +@@ -64,23 +67,37 @@ public class VoxelShapeSpliterator extends AbstractSpliterator { boolean a(Consumer 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 8c621b9dc..e7e8ed2c4 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 allChunks = new ArrayList<>(visibleChunks.values()); List 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 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 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 24363b1b2..021753fb9 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 { @@ -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, CommandNode> 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 dba502193..3ddd0d36c 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 S a(Function function) { AtomicReference atomicreference = new AtomicReference(); Thread thread = new Thread(() -> { -@@ -840,6 +842,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 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 851493eac..812fed5f7 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 d71e7b136..d4d450f2e 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 488dd3e5f..dc34ab15b 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 bk = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); protected static final DataWatcherObject 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 edc3a56b8..991108f14 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> mailboxWorldGen; + private final Mailbox> 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 8c1972d3f..68c8e2168 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 g = (entity) -> { return !entity.isSpectator(); }; @@ -33,10 +43,10 @@ index 1a6f8aec32af85717f5d56e0b00a02cda88ce028..88ed99d0d08fb5f3fee605f8ed00004b // Paper start public static final Predicate 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 08911b53c..8f34e2718 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 bukkit, RootCommandNode 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 4ae5b26c3..07a9844dc 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 3e78756a2..dd71899d3 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 4e5c3ad53..e68fbaeca 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 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 47baa4de4..deb8894e5 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> 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> mailboxWorldGen; - private final Mailbox> mailboxMain; -+ final Mailbox> mailboxMain; // Paper - private -> package private ++ public final Mailbox> mailboxMain; // Paper - private -> public ++ // Paper start ++ final Mailbox> 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 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 8c2f3e092..007bd7a84 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 ff6d9af4d..3a0aaf19d 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> mailboxWorldGen; - final Mailbox> mailboxMain; // Paper - private -> package private -+ // Paper start -+ final Mailbox> 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 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 3911e4310..f002048a7 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 434e30979..b9b82cef4 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 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> { +@@ -34,7 +35,9 @@ public abstract class LightEngineStorageArray 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 32ab0cae4..5f3ad1df7 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 be689a86b..99601c7eb 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 db47c1167..bc5af6afc 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 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> 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 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 fbea350ad..4df93b2bf 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 5994394fd..b47f9027f 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 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 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 k2) { l = k2; -@@ -215,7 +234,7 @@ public final class LightEngineSky extends LightEngineLayer> { @@ -1194,7 +1210,7 @@ index 0ab4917053c090c874e8bb59e750fd909636f89d..a994e7e93814796d1a5d86f8863d1d21 // Paper start - avoid copying light data protected LightEngineStorageArray(com.destroystokyo.paper.util.map.QueuedChangesMapLong2Object data, boolean isVisible) { if (isVisible) { -@@ -20,12 +25,14 @@ public abstract class LightEngineStorageArray { 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 9537acdc4..eeb9b6235 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 d1f957641..7786a8cda 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 b239f9dd9..b153f9d17 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 { +@@ -143,10 +143,10 @@ public class VoxelShapeSpliterator extends AbstractSpliterator { 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 97b0c48a6..c5161b36b 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 { +@@ -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 { 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 1417fefe9..025b86e71 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 b7d5cb532..3daaa3172 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 f77118823..6f1e33b76 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(Lists.transform(this.lore, CraftChatMessage::fromJSONComponent)); } @@ -47,7 +47,7 @@ index 541c9f8ae334cc348ada8a65998f5a4b53eab4b3..6771c962c1f7dd43595585b7dd173c9c @Override public void setLore(List 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 e4451979e..abbec1c1e 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 3d34422c4..267d81608 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 { 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 d53d5ae95..e8ab744e2 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> criterionData = Maps.newIdentityHashMap(); ++ public final Map> 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 73d1a2f6f..dd9940c24 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 18f64b3e2..4f08d55d9 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 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 9a6e70132..c694cf589 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 8c2860616..1848cd99d 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 69ad6579b..0b85e68ef 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 ad5f568ff..060c516f4 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 671f1533a..dfb33917e 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 45e1a91e9..6352b4412 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 2b3c0ab1e..ccde2ad0c 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 2a0fbedba..7399db471 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%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 2e3cf160a..9e7d861f9 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 578a8fabd..775318f26 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 acdfc830e..482af3fc0 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 55e775a7c..974a34ff2 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 7973cb519..2842cb3c9 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 fc18e015b..dcdd06328 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 Co-authored-by: pop4959 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 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 53cbcb226..89f9d522f 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 a70abbf02..ffecbacf4 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 863919af3..20c9ba05e 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 a(Entity entity) { diff --git a/Spigot-Server-Patches/0609-Add-PlayerShearBlockEvent.patch b/Spigot-Server-Patches/0609-Add-PlayerShearBlockEvent.patch index d21d2e8cc..b63c91055 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 5f2765160..076d1b516 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 implements IMojangStatistics, ICommandListener, AutoCloseable { -@@ -1063,6 +1064,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 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 1df831198..de280533d 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 fe6a6a35c..95e355260 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 implements IMojangStatistics, ICommandListener, AutoCloseable { -@@ -1922,7 +1920,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant completablefuture = CompletableFuture.supplyAsync(() -> { Stream stream = collection.stream(); // CraftBukkit - decompile error ResourcePackRepository resourcepackrepository = this.resourcePackRepository; -@@ -1938,6 +1942,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant> 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 a532bed43..e68f9baa6 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 2c70325fc..2ffec6957 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 072cb11cb..9ff6d74f2 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 723d13b32..c68a52a6b 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 0; // Paper diff --git a/Spigot-Server-Patches/0675-misc-debugging-dumps.patch b/Spigot-Server-Patches/0675-misc-debugging-dumps.patch index 274c4c056..48feaf088 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= 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 58a61a09d..c8b1b43e2 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 597f797c1..fb795a84b 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 ######################################################## ########################################################