diff --git a/patches/server/0749-Do-not-accept-invalid-client-settings.patch b/patches/server/0399-Do-not-accept-invalid-client-settings.patch similarity index 90% rename from patches/server/0749-Do-not-accept-invalid-client-settings.patch rename to patches/server/0399-Do-not-accept-invalid-client-settings.patch index c00092c57a..714a9cca8b 100644 --- a/patches/server/0749-Do-not-accept-invalid-client-settings.patch +++ b/patches/server/0399-Do-not-accept-invalid-client-settings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Do not accept invalid client settings diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a08cf32d56b6f5491d2f2e8e9486a5d65ec9a825..9810c476ba7cdee6a2ed17c48f8f101426596aea 100644 +index 48fca15cdc6b0bafc3d8ff13cc96b3258104c1fb..cbc472cc725c925395f60b7bea0de6663b5346ab 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3242,6 +3242,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3161,6 +3161,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleClientInformation(ServerboundClientInformationPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); diff --git a/patches/server/0407-Fix-SPIGOT-5989.patch b/patches/server/0407-Fix-SPIGOT-5989.patch index e08e8c90b6..1bacf423a4 100644 --- a/patches/server/0407-Fix-SPIGOT-5989.patch +++ b/patches/server/0407-Fix-SPIGOT-5989.patch @@ -10,7 +10,7 @@ This fixes that by checking if the modified spawn location is still at a respawn anchor. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 172d7c3df8f9aab24d49b2ff12e3cdf5f40727f9..db40e72020ff651e8e77cf2f214e3d5cce61ea5a 100644 +index a35dda4010c6db1a8e1efb7951ac8732d9a1e16e..98e66497f1a81e3df8d555ffdd36b9aae9f39447 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -805,6 +805,7 @@ public abstract class PlayerList { diff --git a/patches/server/0408-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch b/patches/server/0408-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch index 727c238f0f..2e36f96bd3 100644 --- a/patches/server/0408-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch +++ b/patches/server/0408-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix SPIGOT-5824 Bukkit world-container is not used diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 0c9f6443663bc567a181393b13311a909602f4a4..a32449f5bfc88b251022064b6f9f5cc0d368fbca 100644 +index 5374a6b70a9780cfe9f62207b290b9a3ab82c7e9..976d5e9c965324537720e38acf6a6deda079a324 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -175,8 +175,17 @@ public class Main { diff --git a/patches/server/0409-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch b/patches/server/0409-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch index 9c908c8e37..5bf7411f05 100644 --- a/patches/server/0409-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch +++ b/patches/server/0409-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix SPIGOT-5885 Unable to disable advancements diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index a32449f5bfc88b251022064b6f9f5cc0d368fbca..7c8af0b369457098afb726fefb5087dbf159cb66 100644 +index 976d5e9c965324537720e38acf6a6deda079a324..a99fddc55bf125fe6de7be254e9f9384c2bf9ba3 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -175,6 +175,7 @@ public class Main { diff --git a/patches/server/0414-Brand-support.patch b/patches/server/0414-Brand-support.patch index 687d90e2ef..8526ffa1cf 100644 --- a/patches/server/0414-Brand-support.patch +++ b/patches/server/0414-Brand-support.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Brand support diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 897fa2857f070a976cc95695d7009f663a6bc89d..27f1d336b2493bf475a388f63cce8d99408acea3 100644 +index c4e0fa6c24f9df0d99508ea7d6a9ed974f14835e..468e4ccbe767a04a6903307f7285e882fab9e598 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -274,6 +274,7 @@ public class ServerPlayer extends Player { @@ -14,8 +14,8 @@ index 897fa2857f070a976cc95695d7009f663a6bc89d..27f1d336b2493bf475a388f63cce8d99 public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent + public @Nullable String clientBrandName = null; // Paper - Brand support - // Paper start - replace player chunk loader - private final java.util.concurrent.atomic.AtomicReference viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1)); + public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { + super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java index e69043316372d98b122ed3788fda79cdd36849e8..6597e6e9987ddb5906909c22704fdfb6557aee8e 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java @@ -57,10 +57,10 @@ index e69043316372d98b122ed3788fda79cdd36849e8..6597e6e9987ddb5906909c22704fdfb6 } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 4de49a81238ca3d550f85fdcdf921c17f992f65a..ac908edaad2e58e4813f236e938e9d305f93dbe6 100644 +index 549c14e2d861c0b4692ee56e1de5df13ef72f6f8..7a10bdaf6b837738afb73e27fa970f9eff9bb196 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3030,6 +3030,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2988,6 +2988,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end }; diff --git a/patches/server/0417-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/0417-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch index 076d1e6550..3b842579c8 100644 --- a/patches/server/0417-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch +++ b/patches/server/0417-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index dcc411b3c7d5e5a675c8e21adef25e821ffd7cdd..b455472d258ce59252cb4f93cbef73d3c2da342e 100644 +index baafe984f2e015e20e57841b5009861cb0a02525..d7bbe096b2bff241b95da17c2897c88565d521ae 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1996,9 +1996,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1757,9 +1757,11 @@ public class ServerLevel extends Level implements WorldGenLevel { public void setDefaultSpawnPos(BlockPos pos, float angle) { // Paper start - Configurable Keep Spawn Loaded range per world BlockPos prevSpawn = this.getSharedSpawnPos(); @@ -21,7 +21,7 @@ index dcc411b3c7d5e5a675c8e21adef25e821ffd7cdd..b455472d258ce59252cb4f93cbef73d3 // if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add this.removeTicketsForSpawn(this.paperConfig().spawn.keepSpawnLoadedRange * 16, prevSpawn); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index f248735d48aa5c430752426e9dc02c1ae6644aaf..f0f6f2b5f474881c865f1a2098611cd395249530 100644 +index fe0095601b41d85d8813af18e1c74b31f26f150d..46a168a3e0db80c1584931c13eedeab420aa76c6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -262,12 +262,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch b/patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch index 941e280dfb..1ed9987051 100644 --- a/patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch +++ b/patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch @@ -9,20 +9,24 @@ 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/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index c1ca83446bb4ccc7c1cb0f5e071850ce15657a69..00e60bba33fe3e100070bb3ded55e5253a8db138 100644 +index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..7ca4790d564846c1ab9560e349005eea8aef35b8 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -@@ -121,9 +121,22 @@ public class ChunkSerializer { - InProgressChunkHolder holder = readInProgressChunkHolder(world, poiStorage, chunkPos, nbt); - return holder.protoChunk; - } +@@ -91,6 +91,10 @@ public class ChunkSerializer { + private static final String SKYLIGHT_STATE_TAG = "starlight.skylight_state"; + private static final String STARLIGHT_VERSION_TAG = "starlight.light_version"; + // Paper end - replace light engine impl + // Paper start - Do not let the server load chunks from newer versions + private static final int CURRENT_DATA_VERSION = net.minecraft.SharedConstants.getCurrentVersion().getDataVersion().getVersion(); + private static final boolean JUST_CORRUPT_IT = Boolean.getBoolean("Paper.ignoreWorldDataVersion"); + // Paper end - Do not let the server load chunks from newer versions - public static InProgressChunkHolder readInProgressChunkHolder(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt) { - // Paper end - rewrite chunk system + public ChunkSerializer() {} + +@@ -107,6 +111,15 @@ public class ChunkSerializer { + } + // Paper end - guard against serializing mismatching coordinates + public static ProtoChunk read(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt) { + // Paper start - Do not let the server load chunks from newer versions + if (nbt.contains("DataVersion", net.minecraft.nbt.Tag.TAG_ANY_NUMERIC)) { + final int dataVersion = nbt.getInt("DataVersion"); diff --git a/patches/server/0420-Prevent-headless-pistons-from-being-created.patch b/patches/server/0420-Prevent-headless-pistons-from-being-created.patch index 2254a27e12..856b2719cc 100644 --- a/patches/server/0420-Prevent-headless-pistons-from-being-created.patch +++ b/patches/server/0420-Prevent-headless-pistons-from-being-created.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Prevent headless pistons from being created Prevent headless pistons from being created by explosions or tree/mushroom growth. diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index b1fdfae75aeea78ca77987e40242bf498447bc08..5097d9f1a3ab4e49e1899ede1742436357b0ad91 100644 +index 653036ca797ed4e87f0cc15898d55ede2ed96206..c7075aaf417b1dc9eab4a19b72fac50d2a44286b 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -205,6 +205,15 @@ public class Explosion { diff --git a/patches/server/0422-Add-zombie-targets-turtle-egg-config.patch b/patches/server/0422-Add-zombie-targets-turtle-egg-config.patch index f3294d3a33..240bf5e662 100644 --- a/patches/server/0422-Add-zombie-targets-turtle-egg-config.patch +++ b/patches/server/0422-Add-zombie-targets-turtle-egg-config.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add zombie targets turtle egg config diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index ac4916a898af8c3584d84088b18e8b38b5eb6b13..47f8e5ecadf79fa66db0248ef23eab1e6524f108 100644 +index 408cbb80df72cf67e5228a76b7f267281e1752ab..67aaa688b4db0c4304699fdd983730cdb4a68058 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java @@ -109,7 +109,7 @@ public class Zombie extends Monster { diff --git a/patches/server/0429-Cache-block-data-strings.patch b/patches/server/0429-Cache-block-data-strings.patch index a339d827e1..cdee87c883 100644 --- a/patches/server/0429-Cache-block-data-strings.patch +++ b/patches/server/0429-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 ca005f3c60e58a2ac3e391c9107023e982f33ffe..78df27da35b8c30d1de189aaac0710c94e7112f9 100644 +index f03a2995c2eb080ec4db0d6c3aa261a463c08579..3b50dc6f01a449ca3d5cfa02aadc8c63777a0094 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2011,6 +2011,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= level; } -@@ -1825,6 +1826,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1773,6 +1774,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void moveTo(double x, double y, double z, float yaw, float pitch) { @@ -57,7 +57,7 @@ index a6fc2a67027b749b9f87110aa15b339bdc58a72b..ac2380e43639f661358b63eef77cbc7b this.setYRot(yaw); this.setXRot(pitch); diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index 0c14b382e7660ce518096e9f26525ccea57a1bf9..a9c74ef33182505b6982fea273a760e937ddbf51 100644 +index 8e6d782f3a5a000217b7dcd27fc88aa340a58f47..7fdf026bdeb85d149e24aa013181a848ece4c55e 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -169,6 +169,7 @@ public abstract class BaseSpawner { diff --git a/patches/server/0433-Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/0433-Extend-block-drop-capture-to-capture-all-items-added.patch index 4f59e89ef2..de8db5031d 100644 --- a/patches/server/0433-Extend-block-drop-capture-to-capture-all-items-added.patch +++ b/patches/server/0433-Extend-block-drop-capture-to-capture-all-items-added.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index b455472d258ce59252cb4f93cbef73d3c2da342e..611f06d58708a06e1b8ac4f9d4c7a715f177e31f 100644 +index d7bbe096b2bff241b95da17c2897c88565d521ae..e360048893f7719e6735724a2e0c2606879d6c9d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1494,6 +1494,12 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1255,6 +1255,12 @@ public class ServerLevel extends Level implements WorldGenLevel { // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit return false; } else { diff --git a/patches/server/0434-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/0434-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index ccc6db5d5f..f130e5af51 100644 --- a/patches/server/0434-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/server/0434-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 838004fc124bd5f7b46dbfa9d69d3fde6e990623..4def6868bc0a51d408f67b4de13c85b2eed76e13 100644 +index 9946f04c7e5877f094293c4c0976aeecf5c83c56..5dce8180a7ddfdd5fd32509010bdbaa66788a7c2 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4459,4 +4459,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4384,4 +4384,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S void accept(Entity entity, double x, double y, double z); } diff --git a/patches/server/0436-Entity-isTicking.patch b/patches/server/0436-Entity-isTicking.patch index 83e0b766f8..0dd291d2b5 100644 --- a/patches/server/0436-Entity-isTicking.patch +++ b/patches/server/0436-Entity-isTicking.patch @@ -5,10 +5,10 @@ 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 4def6868bc0a51d408f67b4de13c85b2eed76e13..7f5efeef47e4f31106e4a0069feea7f82aa89f88 100644 +index 5dce8180a7ddfdd5fd32509010bdbaa66788a7c2..f4f5175c3c8c12d390470b7f44ad9d2ca39ff1fc 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4464,5 +4464,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4389,5 +4389,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public static int nextEntityId() { return ENTITY_COUNTER.incrementAndGet(); } diff --git a/patches/server/0437-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/0437-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch index f99aa4ab50..357b3ef705 100644 --- a/patches/server/0437-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch +++ b/patches/server/0437-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 78df27da35b8c30d1de189aaac0710c94e7112f9..e60e5f94cd05d71b29414f2a911ac4ce9d8f7412 100644 +index 3b50dc6f01a449ca3d5cfa02aadc8c63777a0094..e7936fbc641769dfea77ae4add7b1b19e59addbb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2094,13 +2094,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 1.0D) { -@@ -1326,9 +1344,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1319,9 +1337,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl AABB axisalignedbb = this.player.getBoundingBox(); diff --git a/patches/server/0443-Retain-block-place-order-when-capturing-blockstates.patch b/patches/server/0443-Retain-block-place-order-when-capturing-blockstates.patch index a991a30770..8089018fdd 100644 --- a/patches/server/0443-Retain-block-place-order-when-capturing-blockstates.patch +++ b/patches/server/0443-Retain-block-place-order-when-capturing-blockstates.patch @@ -10,7 +10,7 @@ In general, look at making this logic more robust (i.e properly handling cases where a captured entry is overriden) - but for now this will do. diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index ee237d0e57cbb9b8fe2ae3c84fa7d7a964ad73b9..859f515813240030b3598a2152dd41d4fb8828ad 100644 +index 3f1c0f3b879bf562db2b999dd39a3ce37759775d..3e98a86dd56855485c7d8c26eb30f2bbace2d66c 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -159,7 +159,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/0447-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch b/patches/server/0447-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch index 27b0ff407c..12172751cd 100644 --- a/patches/server/0447-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch +++ b/patches/server/0447-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch @@ -8,7 +8,7 @@ This can realistically only happen if there's custom loot active on fishing which can return 0 items. This would disconnect the player who's fishing. diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -index 5c77992e0c49eb217dd66657b35164225b400518..a9eaa079a43bc8a5e81deaf6df5ce2f9c53cb319 100644 +index 94bdd467108bc5fd0211f67a792787ef7c356619..f3694d432e280cace281eda95d8c2d4dd5d6930a 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java @@ -503,9 +503,15 @@ public class FishingHook extends Projectile { diff --git a/patches/server/0448-Add-getOfflinePlayerIfCached-String.patch b/patches/server/0448-Add-getOfflinePlayerIfCached-String.patch index 96f1ef8cc8..8761b2840d 100644 --- a/patches/server/0448-Add-getOfflinePlayerIfCached-String.patch +++ b/patches/server/0448-Add-getOfflinePlayerIfCached-String.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 8b5fb5e5719ea1453751ef8f7bd97bca1af64ae8..2685722282f0b90bdcf65ba6675998b31f491b31 100644 +index 3aa481599811af7cd9b0c523f66dac469105ee49..da0af328409aae94b3d537bf2db083fbc269d573 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1909,6 +1909,28 @@ public final class CraftServer implements Server { diff --git a/patches/server/0453-Beacon-API-custom-effect-ranges.patch b/patches/server/0453-Beacon-API-custom-effect-ranges.patch index 14faa92e4b..4a1999c4d4 100644 --- a/patches/server/0453-Beacon-API-custom-effect-ranges.patch +++ b/patches/server/0453-Beacon-API-custom-effect-ranges.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Beacon API - custom effect ranges diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index cd28ee0cbc69713a641a21c9a626c694a4bcbfc9..7205d0ea78af545108719c1373ba7946ede34ae6 100644 +index f3b9a692417dbfc67b939a753c29ad1c159e274b..80bd394920902cd67ef22bf9a14db64800a3ab97 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java @@ -82,6 +82,26 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name diff --git a/patches/server/0454-Add-API-for-quit-reason.patch b/patches/server/0454-Add-API-for-quit-reason.patch index e610f51c4e..d6bbd7a15f 100644 --- a/patches/server/0454-Add-API-for-quit-reason.patch +++ b/patches/server/0454-Add-API-for-quit-reason.patch @@ -25,7 +25,7 @@ index 777681a58417684a35a875c869ab22e50bb27da5..1e495daf53a53260e1a3b1c86365edb9 Connection.LOGGER.debug("Failed to sent packet", throwable); if (this.getSending() == PacketFlow.CLIENTBOUND) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 27f1d336b2493bf475a388f63cce8d99408acea3..d5b5ad2f91d440ae0a1e61accab60122335591d4 100644 +index 468e4ccbe767a04a6903307f7285e882fab9e598..58bbf3176f405c3c31007780368a3e16948382a7 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -275,6 +275,7 @@ public class ServerPlayer extends Player { @@ -34,8 +34,8 @@ index 27f1d336b2493bf475a388f63cce8d99408acea3..d5b5ad2f91d440ae0a1e61accab60122 public @Nullable String clientBrandName = null; // Paper - Brand support + public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event - // Paper start - replace player chunk loader - private final java.util.concurrent.atomic.AtomicReference viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1)); + public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { + super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java index 6597e6e9987ddb5906909c22704fdfb6557aee8e..6bb846d3ee2fb54ab3ffa116607f2a83e538460e 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java @@ -49,7 +49,7 @@ index 6597e6e9987ddb5906909c22704fdfb6557aee8e..6bb846d3ee2fb54ab3ffa116607f2a83 this.connection.disconnect(ichatbasecomponent); })); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index db40e72020ff651e8e77cf2f214e3d5cce61ea5a..d356981f7ed3c517aa6c9ff81a7a72b9872021ad 100644 +index 98e66497f1a81e3df8d555ffdd36b9aae9f39447..5e6aa40d7574b939746ac4724a24d85f9cf29d76 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -578,7 +578,7 @@ public abstract class PlayerList { diff --git a/patches/server/0456-Expose-world-spawn-angle.patch b/patches/server/0456-Expose-world-spawn-angle.patch index aeaf99d7d1..d529beeb32 100644 --- a/patches/server/0456-Expose-world-spawn-angle.patch +++ b/patches/server/0456-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 d356981f7ed3c517aa6c9ff81a7a72b9872021ad..3fa1033936fa3d0c00fc4d51ec10d1977765d2d5 100644 +index 5e6aa40d7574b939746ac4724a24d85f9cf29d76..4771d0da97421443089499cc376bdf469dec8522 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -848,7 +848,7 @@ public abstract class PlayerList { diff --git a/patches/server/0458-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0458-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index 16a21f556b..2f830ee3a0 100644 --- a/patches/server/0458-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0458-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 ac908edaad2e58e4813f236e938e9d305f93dbe6..7d5733f6c45c0521b1d1a37d6dfc3b0a7aad1662 100644 +index 7a10bdaf6b837738afb73e27fa970f9eff9bb196..1b9eeb31e2cea8a30640af4daa73f7a3b335a9c4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2593,7 +2593,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2551,7 +2551,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (data != null) { Preconditions.checkArgument(particle.getDataType().isInstance(data), "data (%s) should be %s", data.getClass(), particle.getDataType()); } diff --git a/patches/server/0463-Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/0463-Climbing-should-not-bypass-cramming-gamerule.patch index f0adf634a9..ad99ead472 100644 --- a/patches/server/0463-Climbing-should-not-bypass-cramming-gamerule.patch +++ b/patches/server/0463-Climbing-should-not-bypass-cramming-gamerule.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Climbing should not bypass cramming gamerule diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index fcb928696e676fe0749b1bc4b1aa433985767f5b..a1cf6f17313f4f861f3c5c6ebcaafc85d9102b55 100644 +index f4f5175c3c8c12d390470b7f44ad9d2ca39ff1fc..55395837df277eac393949aa7447d69e57c5d756 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2018,6 +2018,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1966,6 +1966,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public boolean isPushable() { @@ -22,7 +22,7 @@ index fcb928696e676fe0749b1bc4b1aa433985767f5b..a1cf6f17313f4f861f3c5c6ebcaafc85 } diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java -index c9c7833755af3c7bef1d40f2ca425cbec59efa68..75cdddbfbbc4c0c521194dde27ba5f5d17221842 100644 +index ee4495b67c46cf1282cdd6ad15b224b0b7b10bfb..e382a29b441b656f35bc24cb90f95cb4def433d2 100644 --- a/src/main/java/net/minecraft/world/entity/EntitySelector.java +++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java @@ -46,11 +46,16 @@ public final class EntitySelector { diff --git a/patches/server/0466-Limit-recipe-packets.patch b/patches/server/0466-Limit-recipe-packets.patch index 0d6c1aaa35..8117c0e211 100644 --- a/patches/server/0466-Limit-recipe-packets.patch +++ b/patches/server/0466-Limit-recipe-packets.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Limit recipe packets diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 8682ba8d677461842fbb0b40a3d5fdd4d22a8e9e..3756ea70ae32005eb5d6b8285b1b1c1273c553f0 100644 +index 93c708ad4f16cc6fc8334c36b1131235bc6e2925..52ad9ec75333ba6aac38ae3874b26435a1f896d4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -258,6 +258,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -24,7 +24,7 @@ index 8682ba8d677461842fbb0b40a3d5fdd4d22a8e9e..3756ea70ae32005eb5d6b8285b1b1c12 /* Use thread-safe field access instead if (this.chatSpamTickCount > 0) { --this.chatSpamTickCount; -@@ -2985,6 +2987,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2978,6 +2980,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { diff --git a/patches/server/0468-Player-Chunk-Load-Unload-Events.patch b/patches/server/0468-Player-Chunk-Load-Unload-Events.patch index ed886a05a1..241610bb61 100644 --- a/patches/server/0468-Player-Chunk-Load-Unload-Events.patch +++ b/patches/server/0468-Player-Chunk-Load-Unload-Events.patch @@ -5,24 +5,24 @@ Subject: [PATCH] Player Chunk Load/Unload Events diff --git a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java -index 5de5209e04d631bd6a50e28e8d3abebf148252c1..43e3c99eafaed42161664e31827dfd0abb127ad2 100644 +index c509a1318bcef38fd4927e38b6ee9846853e2d15..13209267c26f46492a92e820889a9be0bd2287a0 100644 --- a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java +++ b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java -@@ -46,6 +46,11 @@ public class PlayerChunkSender { - public static void dropChunkStatic(ServerPlayer player, ChunkPos pos) { - player.serverLevel().chunkSource.chunkMap.getVisibleChunkIfPresent(pos.toLong()).removePlayer(player); - player.connection.send(new ClientboundForgetLevelChunkPacket(pos)); -+ // Paper start - PlayerChunkUnloadEvent -+ if (io.papermc.paper.event.packet.PlayerChunkUnloadEvent.getHandlerList().getRegisteredListeners().length > 0) { -+ new io.papermc.paper.event.packet.PlayerChunkUnloadEvent(player.getBukkitEntity().getWorld().getChunkAt(pos.longKey), player.getBukkitEntity()).callEvent(); -+ } -+ // Paper end - PlayerChunkUnloadEvent - } - // Paper end - rewrite player chunk loader +@@ -45,6 +45,11 @@ public class PlayerChunkSender { + public void dropChunk(ServerPlayer player, ChunkPos pos) { + if (!this.pendingChunks.remove(pos.toLong()) && player.isAlive()) { + player.connection.send(new ClientboundForgetLevelChunkPacket(pos)); ++ // Paper start - PlayerChunkUnloadEvent ++ if (io.papermc.paper.event.packet.PlayerChunkUnloadEvent.getHandlerList().getRegisteredListeners().length > 0) { ++ new io.papermc.paper.event.packet.PlayerChunkUnloadEvent(player.getBukkitEntity().getWorld().getChunkAt(pos.longKey), player.getBukkitEntity()).callEvent(); ++ } ++ // Paper end - PlayerChunkUnloadEvent + } -@@ -86,6 +91,11 @@ public class PlayerChunkSender { - public static void sendChunk(ServerGamePacketListenerImpl handler, ServerLevel world, LevelChunk chunk) { // Paper - rewrite chunk loader - public - handler.player.serverLevel().chunkSource.chunkMap.getVisibleChunkIfPresent(chunk.getPos().toLong()).addPlayer(handler.player); + } +@@ -77,6 +82,11 @@ public class PlayerChunkSender { + + private static void sendChunk(ServerGamePacketListenerImpl handler, ServerLevel world, LevelChunk chunk) { handler.send(new ClientboundLevelChunkWithLightPacket(chunk, world.getLightEngine(), (BitSet)null, (BitSet)null)); + // Paper start - PlayerChunkLoadEvent + if (io.papermc.paper.event.packet.PlayerChunkLoadEvent.getHandlerList().getRegisteredListeners().length > 0) { diff --git a/patches/server/0474-MC-4-Fix-item-position-desync.patch b/patches/server/0474-MC-4-Fix-item-position-desync.patch index 56b0f80efc..244dd4bf2c 100644 --- a/patches/server/0474-MC-4-Fix-item-position-desync.patch +++ b/patches/server/0474-MC-4-Fix-item-position-desync.patch @@ -28,13 +28,13 @@ index 05ac41e136da43284fb24a6b698ebd36318278fb..3c4ac79c094dc2fff7de94150a34b7bf public Vec3 decode(long x, long y, long z) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index b9c919c466d6591492ede8a53df673114c50c1d9..18438f5c92840bd07e7ef0c2203d4ec943cb3161 100644 +index 55395837df277eac393949aa7447d69e57c5d756..da5dcea43fdbc0ad0acb1130d363cc8cbea16dfa 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4235,6 +4235,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4167,6 +4167,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return; } - // Paper end - rewrite chunk system + // Paper end - Block invalid positions and bounding box + // Paper start - Fix MC-4 + if (this instanceof ItemEntity) { + if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.fixEntityPositionDesync) { diff --git a/patches/server/0482-Fix-interact-event-not-being-called-sometimes.patch b/patches/server/0482-Fix-interact-event-not-being-called-sometimes.patch index ce207281d0..768527283c 100644 --- a/patches/server/0482-Fix-interact-event-not-being-called-sometimes.patch +++ b/patches/server/0482-Fix-interact-event-not-being-called-sometimes.patch @@ -11,10 +11,10 @@ Subject: [PATCH] Fix interact event not being called sometimes Co-authored-by: Moulberry diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 3756ea70ae32005eb5d6b8285b1b1c1273c553f0..c169c44321c8bd6ea562f99f6c8a5a5f5be79425 100644 +index 52ad9ec75333ba6aac38ae3874b26435a1f896d4..1f39a44b27cf427885a14115946f0f1a54508c5b 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1760,7 +1760,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1753,7 +1753,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl MutableComponent ichatmutablecomponent = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED); this.player.sendSystemMessage(ichatmutablecomponent, true); @@ -23,7 +23,7 @@ index 3756ea70ae32005eb5d6b8285b1b1c1273c553f0..c169c44321c8bd6ea562f99f6c8a5a5f this.player.swing(enumhand, true); } } -@@ -2306,13 +2306,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2299,13 +2299,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d3 = this.player.gameMode.getGameModeForPlayer() == GameType.CREATIVE ? 5.0D : 4.5D; // SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time // SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities diff --git a/patches/server/0486-Add-WorldGameRuleChangeEvent.patch b/patches/server/0486-Add-WorldGameRuleChangeEvent.patch index b4fe45d7a8..f24bdcc6de 100644 --- a/patches/server/0486-Add-WorldGameRuleChangeEvent.patch +++ b/patches/server/0486-Add-WorldGameRuleChangeEvent.patch @@ -64,10 +64,10 @@ index 334001cb749600c973c82391e1c11f0e40bd2dfb..f3cdf1fa7731eb7bb1cb89aa6a37204d public int get() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index f0f6f2b5f474881c865f1a2098611cd395249530..9ca85c53236528460441d2da7f2935438c6b0078 100644 +index 46a168a3e0db80c1584931c13eedeab420aa76c6..75387d9507add359e7b35527c6a69b6a96cdff5c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1880,8 +1880,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1851,8 +1851,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { if (!this.isGameRule(rule)) return false; @@ -82,7 +82,7 @@ index f0f6f2b5f474881c865f1a2098611cd395249530..9ca85c53236528460441d2da7f293543 handle.onChanged(this.getHandle().getServer()); return true; } -@@ -1917,8 +1922,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1888,8 +1893,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { if (!this.isGameRule(rule.getName())) return false; diff --git a/patches/server/0487-Add-ServerResourcesReloadedEvent.patch b/patches/server/0487-Add-ServerResourcesReloadedEvent.patch index 07d0008923..33cdb307c4 100644 --- a/patches/server/0487-Add-ServerResourcesReloadedEvent.patch +++ b/patches/server/0487-Add-ServerResourcesReloadedEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ServerResourcesReloadedEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e60e5f94cd05d71b29414f2a911ac4ce9d8f7412..5429906d0d793a45d7cedc2c14cae9d3e0ebb5e2 100644 +index e7936fbc641769dfea77ae4add7b1b19e59addbb..e679ee1cfae0787775c655690094d72732e1bbb4 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1979,7 +1979,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop completablefuture = CompletableFuture.supplyAsync(() -> { Stream stream = dataPacks.stream(); // CraftBukkit - decompile error -@@ -2012,6 +2018,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { this.getServer().execute(() -> { diff --git a/patches/server/0495-Fix-villager-boat-exploit.patch b/patches/server/0495-Fix-villager-boat-exploit.patch index ebc44a1fc5..59db870962 100644 --- a/patches/server/0495-Fix-villager-boat-exploit.patch +++ b/patches/server/0495-Fix-villager-boat-exploit.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix villager boat exploit diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 3fa1033936fa3d0c00fc4d51ec10d1977765d2d5..a24aa06d65dadaece78e37ba6f67aee724c410f0 100644 +index 4771d0da97421443089499cc376bdf469dec8522..5cb195fc8d1431088253d496585f19e81f8082ef 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -603,6 +603,14 @@ public abstract class PlayerList { diff --git a/patches/server/0496-Add-sendOpLevel-API.patch b/patches/server/0496-Add-sendOpLevel-API.patch index 529cef3fac..616e836a5c 100644 --- a/patches/server/0496-Add-sendOpLevel-API.patch +++ b/patches/server/0496-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 a24aa06d65dadaece78e37ba6f67aee724c410f0..5541508a1c50ec5375db48d87203c922c6a439de 100644 +index 5cb195fc8d1431088253d496585f19e81f8082ef..065a189566d1eea08b1013ce64d1f2282d0c2dc3 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1101,6 +1101,11 @@ public abstract class PlayerList { @@ -32,10 +32,10 @@ index a24aa06d65dadaece78e37ba6f67aee724c410f0..5541508a1c50ec5375db48d87203c922 public boolean isWhiteListed(GameProfile profile) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7d5733f6c45c0521b1d1a37d6dfc3b0a7aad1662..a0e33c3b6e8134ec7570a8c160da41c4a92d5040 100644 +index 1b9eeb31e2cea8a30640af4daa73f7a3b335a9c4..57839c42ca0f9925028eb4f8e3d39a252b9fcbf8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -633,6 +633,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -591,6 +591,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/0498-Add-StructuresLocateEvent.patch b/patches/server/0498-Add-StructuresLocateEvent.patch index a0a3344871..7f26276336 100644 --- a/patches/server/0498-Add-StructuresLocateEvent.patch +++ b/patches/server/0498-Add-StructuresLocateEvent.patch @@ -47,7 +47,7 @@ index 0000000000000000000000000000000000000000..2667067fd13f61e0464ba88ae4e4a707 + } +} diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -index 1eacb6998f99833441dd1dcb8301f25759675f53..180f8ae443d1ea44a748c7f3ebb82a0bab8d31f1 100644 +index 3e57142dd9cb23d43857d5a4cb30962e4b696b74..a6d5b3fa7e3437e0aec54eec4079e9f3267c64b8 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java @@ -121,6 +121,24 @@ public abstract class ChunkGenerator { diff --git a/patches/server/0499-Collision-option-for-requiring-a-player-participant.patch b/patches/server/0499-Collision-option-for-requiring-a-player-participant.patch index 725ea5ef49..b0c31542c1 100644 --- a/patches/server/0499-Collision-option-for-requiring-a-player-participant.patch +++ b/patches/server/0499-Collision-option-for-requiring-a-player-participant.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Collision option for requiring a player participant diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3877544229bc8a4e6e475060c4edca17c64ff739..d2c2dd79cc6f484306bd1ab523cb4d9283131d1b 100644 +index da5dcea43fdbc0ad0acb1130d363cc8cbea16dfa..4fd7cd7b2dba4047f36a52c510f12d61f281a95f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1888,6 +1888,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1836,6 +1836,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void push(Entity entity) { if (!this.isPassengerOfSameVehicle(entity)) { if (!entity.noPhysics && !this.noPhysics) { diff --git a/patches/server/0508-Expand-EntityUnleashEvent.patch b/patches/server/0508-Expand-EntityUnleashEvent.patch index 8589ce0a04..9685e2e137 100644 --- a/patches/server/0508-Expand-EntityUnleashEvent.patch +++ b/patches/server/0508-Expand-EntityUnleashEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expand EntityUnleashEvent diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 7d0ccdd4b144afed8a93256941b3d8618c847f4d..6482dc12324524b92e0161055ad13d27dfb7f97d 100644 +index c4b05c7e339a2ec01ee3f5e4dec0b3493788d8d2..8cc40521146d02bbfafbb113dda8183840814c96 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -1292,12 +1292,15 @@ public abstract class Mob extends LivingEntity implements Targeting { diff --git a/patches/server/0509-Reset-shield-blocking-on-dimension-change.patch b/patches/server/0509-Reset-shield-blocking-on-dimension-change.patch index 80bf8880eb..b7ac72f720 100644 --- a/patches/server/0509-Reset-shield-blocking-on-dimension-change.patch +++ b/patches/server/0509-Reset-shield-blocking-on-dimension-change.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Reset shield blocking on dimension change diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index d5b5ad2f91d440ae0a1e61accab60122335591d4..75bd3de7bc1596a4782b82e30162d89aa3e99211 100644 +index 58bbf3176f405c3c31007780368a3e16948382a7..4b4f5fcb51b54981d81924e3d1b9ff091e2c5ae5 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1243,6 +1243,11 @@ public class ServerPlayer extends Player { +@@ -1199,6 +1199,11 @@ public class ServerPlayer extends Player { this.level().getCraftServer().getPluginManager().callEvent(changeEvent); // CraftBukkit end } diff --git a/patches/server/0511-Add-EntityMoveEvent.patch b/patches/server/0511-Add-EntityMoveEvent.patch index 48917244b3..fbeda05f6f 100644 --- a/patches/server/0511-Add-EntityMoveEvent.patch +++ b/patches/server/0511-Add-EntityMoveEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityMoveEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5429906d0d793a45d7cedc2c14cae9d3e0ebb5e2..7857a385aef33fa3bc9bfe01223016c0eb879112 100644 +index e679ee1cfae0787775c655690094d72732e1bbb4..f8e74f8818002f7cc1be0bdb2317439b29a05ad5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1469,6 +1469,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - BlockPhysicsEvent @@ -17,7 +17,7 @@ index 5429906d0d793a45d7cedc2c14cae9d3e0ebb5e2..7857a385aef33fa3bc9bfe01223016c0 this.profiler.push(() -> { return worldserver + " " + worldserver.dimension().location(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e6216892f5bbc22dfde1eebfea33709e2eea841c..a24c782dfdf47868fdd8d494f0af1024fdc6ebe5 100644 +index 2f1d8a02f9fd85b4d577b67237de8400917c151f..909f9c0a53971a28844a59b1cb4b996afb902d80 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -222,6 +222,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0512-added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/0512-added-option-to-disable-pathfinding-updates-on-block.patch index f6619b9d44..5a7c2a4fd7 100644 --- a/patches/server/0512-added-option-to-disable-pathfinding-updates-on-block.patch +++ b/patches/server/0512-added-option-to-disable-pathfinding-updates-on-block.patch @@ -5,10 +5,10 @@ Subject: [PATCH] added option to disable pathfinding updates on block changes diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index f69fae303770b3ccace8e7d421b762504a7cb5dc..901d9f47a63f5c6ddd596c7d327abd06f5a17f16 100644 +index 909f9c0a53971a28844a59b1cb4b996afb902d80..379be7cd3ce1808cf0cf50e50ac7e8de8c8f652c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1639,6 +1639,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1400,6 +1400,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } this.getChunkSource().blockChanged(pos); @@ -16,7 +16,7 @@ index f69fae303770b3ccace8e7d421b762504a7cb5dc..901d9f47a63f5c6ddd596c7d327abd06 VoxelShape voxelshape = oldState.getCollisionShape(this, pos); VoxelShape voxelshape1 = newState.getCollisionShape(this, pos); -@@ -1680,6 +1681,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1441,6 +1442,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } diff --git a/patches/server/0521-fix-converting-txt-to-json-file.patch b/patches/server/0521-fix-converting-txt-to-json-file.patch index de9066f880..f4fc2d6541 100644 --- a/patches/server/0521-fix-converting-txt-to-json-file.patch +++ b/patches/server/0521-fix-converting-txt-to-json-file.patch @@ -21,7 +21,7 @@ index a20d47f54f12dfc0a5f76dd969238e34c958b618..1c9cf5e1c4ee05724ffcdbd77a19bca1 this.saveUserBanList(); this.loadIpBanList(); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 5ecf65315b42cd07dcd69a10c445b1f0576f03c5..a27e9ba8448930e45e283b8e19156bcf86b9baee 100644 +index 317f9048be060778104c8ac3494599c2141b7aac..413f2ab9b6df22f083df684a8a2e7e97a7a312a1 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -199,6 +199,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -48,7 +48,7 @@ index 5ecf65315b42cd07dcd69a10c445b1f0576f03c5..a27e9ba8448930e45e283b8e19156bcf if (!OldUsersConverter.serverReadyAfterUserconversion(this)) { return false; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 5541508a1c50ec5375db48d87203c922c6a439de..974ca4ebdbbbbe38ef0f0c1992f69bdcfd52cbf9 100644 +index 065a189566d1eea08b1013ce64d1f2282d0c2dc3..fde0b21f3e3349cf55ed6e9c200cf0b63dcb11a9 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -176,6 +176,7 @@ public abstract class PlayerList { diff --git a/patches/server/0527-Allow-using-signs-inside-spawn-protection.patch b/patches/server/0527-Allow-using-signs-inside-spawn-protection.patch index 264b2f0c15..df12991aeb 100644 --- a/patches/server/0527-Allow-using-signs-inside-spawn-protection.patch +++ b/patches/server/0527-Allow-using-signs-inside-spawn-protection.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow using signs inside spawn protection diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index c169c44321c8bd6ea562f99f6c8a5a5f5be79425..dba0aa5d1dc63e8d9f4a429e7b7c415bea0af3d8 100644 +index 1f39a44b27cf427885a14115946f0f1a54508c5b..8520433df409d30c746640602e36a54587020b08 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1752,7 +1752,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1745,7 +1745,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl int i = this.player.level().getMaxBuildHeight(); if (blockposition.getY() < i) { diff --git a/patches/server/0528-Expand-world-key-API.patch b/patches/server/0528-Expand-world-key-API.patch index d943671eb9..87a8a262a6 100644 --- a/patches/server/0528-Expand-world-key-API.patch +++ b/patches/server/0528-Expand-world-key-API.patch @@ -20,7 +20,7 @@ index 0fb214ddd919b568da64541fd9b531c65caa5fad..9cd267f53505658d1c75187b662c4d9f // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2685722282f0b90bdcf65ba6675998b31f491b31..59935e2557ece2890cf0fc62096a01ef2c52e384 100644 +index da0af328409aae94b3d537bf2db083fbc269d573..3ace5c08dfa2b156d79a00f06a2977c385fe5210 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1137,9 +1137,15 @@ public final class CraftServer implements Server { diff --git a/patches/server/0531-Drop-carried-item-when-player-has-disconnected.patch b/patches/server/0531-Drop-carried-item-when-player-has-disconnected.patch index 6a35c353de..4f9e0fd1d1 100644 --- a/patches/server/0531-Drop-carried-item-when-player-has-disconnected.patch +++ b/patches/server/0531-Drop-carried-item-when-player-has-disconnected.patch @@ -7,7 +7,7 @@ Fixes disappearance of held items, when a player gets disconnected and PlayerDro Closes #5036 diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 974ca4ebdbbbbe38ef0f0c1992f69bdcfd52cbf9..b6f173055be42e8627f162f02da00227a4e5f2b6 100644 +index fde0b21f3e3349cf55ed6e9c200cf0b63dcb11a9..ad8d02821131eac8cb04532a57265fa450cd8e87 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -596,6 +596,14 @@ public abstract class PlayerList { diff --git a/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch b/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch index 0b21df32eb..4e583539b1 100644 --- a/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch +++ b/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch @@ -5,10 +5,10 @@ Subject: [PATCH] forced whitelist: use configurable kick message diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7857a385aef33fa3bc9bfe01223016c0eb879112..d4c1b31eb016bb6f39d3a399fb07f3cee40d6391 100644 +index f8e74f8818002f7cc1be0bdb2317439b29a05ad5..2615fbf23202c3218826d98835e327a71a5214e2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2110,7 +2110,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 0 && packet.getSlot() < Inventory.getSelectionSize()) { diff --git a/patches/server/0545-More-World-API.patch b/patches/server/0545-More-World-API.patch index 1069d6e230..e1ff14e424 100644 --- a/patches/server/0545-More-World-API.patch +++ b/patches/server/0545-More-World-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] More World API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 9ca85c53236528460441d2da7f2935438c6b0078..dc36b7686a3d06c07a00e319a2af872bd77d49ef 100644 +index 75387d9507add359e7b35527c6a69b6a96cdff5c..6724d0b4e857a9671eac89445ceb70c070b29929 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2126,6 +2126,53 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2097,6 +2097,53 @@ public class CraftWorld extends CraftRegionAccessor implements World { return new CraftStructureSearchResult(CraftStructure.minecraftToBukkit(found.getSecond().value()), CraftLocation.toBukkit(found.getFirst(), this)); } diff --git a/patches/server/0547-Implement-methods-to-convert-between-Component-and-B.patch b/patches/server/0547-Implement-methods-to-convert-between-Component-and-B.patch index 77ecc68ca2..74bdc39e9b 100644 --- a/patches/server/0547-Implement-methods-to-convert-between-Component-and-B.patch +++ b/patches/server/0547-Implement-methods-to-convert-between-Component-and-B.patch @@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..dd6012b6a097575b2d1471be5069ecce + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 83bf6e7fd2f59ddc6b10a11d64ad198f8277e0fa..143720bfa65e08262b96afbe53d6cf42bc326052 100644 +index 46b581e1f930eda3671a283ad89ed1c2094e2cd6..959ce2efe156c8ff2e3d1b57cde27f4da548c3ef 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -210,6 +210,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface diff --git a/patches/server/0548-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch b/patches/server/0548-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch index d23fa92efd..a69097796c 100644 --- a/patches/server/0548-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch +++ b/patches/server/0548-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expand PlayerRespawnEvent, fix passed parameter issues Co-authored-by: Jake Potrebic diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 6252f71c6b5df2a35d58c8f7cd64049b2819ddc0..cc393b070f6df598bd4523605d20900c622eac1b 100644 +index 923026fbc223d845ed8ea4028522b4c6d21673f2..6acec839ee6d7a8893016e79af76892d63a7b601 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2639,7 +2639,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2632,7 +2632,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl case PERFORM_RESPAWN: if (this.player.wonGame) { this.player.wonGame = false; @@ -19,7 +19,7 @@ index 6252f71c6b5df2a35d58c8f7cd64049b2819ddc0..cc393b070f6df598bd4523605d20900c } else { if (this.player.getHealth() > 0.0F) { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index b6f173055be42e8627f162f02da00227a4e5f2b6..cb71aacd23696bf0bf83d2850a5f9cbd46eb1996 100644 +index ad8d02821131eac8cb04532a57265fa450cd8e87..37662f2b42d1cbaac62743ff9907434670bb93ed 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -780,6 +780,12 @@ public abstract class PlayerList { diff --git a/patches/server/0549-Introduce-beacon-activation-deactivation-events.patch b/patches/server/0549-Introduce-beacon-activation-deactivation-events.patch index 3a9a6e6ec5..e4a4750e9e 100644 --- a/patches/server/0549-Introduce-beacon-activation-deactivation-events.patch +++ b/patches/server/0549-Introduce-beacon-activation-deactivation-events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Introduce beacon activation/deactivation events diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index 7205d0ea78af545108719c1373ba7946ede34ae6..83a5417d14e89c3e582e400543fe41f129bbbf3b 100644 +index 80bd394920902cd67ef22bf9a14db64800a3ab97..2ceadc753eb99a08881f1292de789528f4a3de85 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java @@ -221,6 +221,15 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name diff --git a/patches/server/0555-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch b/patches/server/0554-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch similarity index 100% rename from patches/server/0555-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch rename to patches/server/0554-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch diff --git a/patches/server/0989-Add-HiddenPotionEffect-API.patch b/patches/server/0555-Add-HiddenPotionEffect-API.patch similarity index 100% rename from patches/server/0989-Add-HiddenPotionEffect-API.patch rename to patches/server/0555-Add-HiddenPotionEffect-API.patch diff --git a/patches/server/0558-Add-basic-Datapack-API.patch b/patches/server/0558-Add-basic-Datapack-API.patch index 20f6d35a65..734f9585fb 100644 --- a/patches/server/0558-Add-basic-Datapack-API.patch +++ b/patches/server/0558-Add-basic-Datapack-API.patch @@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..cf4374493c11057451a62a655514415c + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b5b2e729c57d0b73c433b0a9f9e673fc96c313d6..6e297adce9b20112b566acbdbad8c0197818b9bc 100644 +index 3ace5c08dfa2b156d79a00f06a2977c385fe5210..b3e11cf65548bd79413620a4a6303b530e15297e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -301,6 +301,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0559-Add-environment-variable-to-disable-server-gui.patch b/patches/server/0559-Add-environment-variable-to-disable-server-gui.patch index 691761d142..5cb0f04643 100644 --- a/patches/server/0559-Add-environment-variable-to-disable-server-gui.patch +++ b/patches/server/0559-Add-environment-variable-to-disable-server-gui.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add environment variable to disable server gui diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 7c8af0b369457098afb726fefb5087dbf159cb66..1cad3585ca122a465572b16d4ecbb7231e87c7de 100644 +index a99fddc55bf125fe6de7be254e9f9384c2bf9ba3..7a5e70c99716273d04f4cd28d80a38f6f6b3868e 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -326,6 +326,7 @@ public class Main { +@@ -325,6 +325,7 @@ public class Main { */ boolean flag1 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui"); diff --git a/patches/server/0560-Expand-PlayerGameModeChangeEvent.patch b/patches/server/0560-Expand-PlayerGameModeChangeEvent.patch index 43f9246e99..5428a748c8 100644 --- a/patches/server/0560-Expand-PlayerGameModeChangeEvent.patch +++ b/patches/server/0560-Expand-PlayerGameModeChangeEvent.patch @@ -45,10 +45,10 @@ index aee8618e27b893b72931e925724dd683d2e6d2aa..f7c9127346261d83413ca03a1cdaa849 } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 75bd3de7bc1596a4782b82e30162d89aa3e99211..d1d7f4c3963986031ea26562549ee15c8232a5a9 100644 +index 4b4f5fcb51b54981d81924e3d1b9ff091e2c5ae5..364ecb81521a9490d561faddd86aa2ac6b225d12 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1985,8 +1985,16 @@ public class ServerPlayer extends Player { +@@ -1941,8 +1941,16 @@ public class ServerPlayer extends Player { } public boolean setGameMode(GameType gameMode) { @@ -67,7 +67,7 @@ index 75bd3de7bc1596a4782b82e30162d89aa3e99211..d1d7f4c3963986031ea26562549ee15c } else { this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.CHANGE_GAME_MODE, (float) gameMode.getId())); if (gameMode == GameType.SPECTATOR) { -@@ -1998,7 +2006,7 @@ public class ServerPlayer extends Player { +@@ -1954,7 +1962,7 @@ public class ServerPlayer extends Player { this.onUpdateAbilities(); this.updateEffectVisibility(); @@ -76,7 +76,7 @@ index 75bd3de7bc1596a4782b82e30162d89aa3e99211..d1d7f4c3963986031ea26562549ee15c } } -@@ -2410,6 +2418,16 @@ public class ServerPlayer extends Player { +@@ -2366,6 +2374,16 @@ public class ServerPlayer extends Player { } public void loadGameTypes(@Nullable CompoundTag nbt) { @@ -131,10 +131,10 @@ index f66ce9ae705b0fbe17a1bb437bad6808ff47ed92..37513cf5714afda6c552219c2eca8134 } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index cc393b070f6df598bd4523605d20900c622eac1b..e0e09e9d127cd54ece239c0c1e931bb8802c17a1 100644 +index 6acec839ee6d7a8893016e79af76892d63a7b601..4ee35e2f717a5a55c9f90a6528f5c93529a92a84 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2648,7 +2648,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2641,7 +2641,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player = this.server.getPlayerList().respawn(this.player, false, RespawnReason.DEATH); if (this.server.isHardcore()) { @@ -144,10 +144,10 @@ index cc393b070f6df598bd4523605d20900c622eac1b..e0e09e9d127cd54ece239c0c1e931bb8 } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a0e33c3b6e8134ec7570a8c160da41c4a92d5040..7b5fd058817f27ffefcdc7e3667e8258a87cbb4c 100644 +index 57839c42ca0f9925028eb4f8e3d39a252b9fcbf8..41e4c05325bb5ef5ce37caabb1c8a76f80d7abe2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1559,7 +1559,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1517,7 +1517,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Preconditions.checkArgument(mode != null, "GameMode cannot be null"); if (this.getHandle().connection == null) return; diff --git a/patches/server/0563-Move-range-check-for-block-placing-up.patch b/patches/server/0563-Move-range-check-for-block-placing-up.patch index c55a150746..3b8699a29f 100644 --- a/patches/server/0563-Move-range-check-for-block-placing-up.patch +++ b/patches/server/0563-Move-range-check-for-block-placing-up.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Move range check for block placing up diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e0e09e9d127cd54ece239c0c1e931bb8802c17a1..2f69f4368bb0fb6d254c1f445953c8dd05d0b0aa 100644 +index 4ee35e2f717a5a55c9f90a6528f5c93529a92a84..b27e232689b8af2f3c9f643b9bee805f9a7a0434 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1738,6 +1738,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1731,6 +1731,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (itemstack.isItemEnabled(worldserver.enabledFeatures())) { BlockHitResult movingobjectpositionblock = packet.getHitResult(); Vec3 vec3d = movingobjectpositionblock.getLocation(); diff --git a/patches/server/0565-Add-Mob-lookAt-API.patch b/patches/server/0564-Add-Mob-lookAt-API.patch similarity index 100% rename from patches/server/0565-Add-Mob-lookAt-API.patch rename to patches/server/0564-Add-Mob-lookAt-API.patch diff --git a/patches/server/0990-Correctly-check-if-bucket-dispenses-will-succeed-for.patch b/patches/server/0565-Correctly-check-if-bucket-dispenses-will-succeed-for.patch similarity index 91% rename from patches/server/0990-Correctly-check-if-bucket-dispenses-will-succeed-for.patch rename to patches/server/0565-Correctly-check-if-bucket-dispenses-will-succeed-for.patch index c619812deb..5ca75e86a3 100644 --- a/patches/server/0990-Correctly-check-if-bucket-dispenses-will-succeed-for.patch +++ b/patches/server/0565-Correctly-check-if-bucket-dispenses-will-succeed-for.patch @@ -8,10 +8,10 @@ in order to fire the BlockDispenseEvent. This patch corrects that. diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index 738f6348c14b0f6942f90d15b082e16d16c89411..1fb809486ee56efd3d0ef3fa02503ba9be459f68 100644 +index 8c8d2e81f0866dc1441e181f2580852d87263bcc..c1c57f24ccfa7bd17541f53d02293db0bce8dc5c 100644 --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -@@ -628,7 +628,13 @@ public interface DispenseItemBehavior { +@@ -617,7 +617,13 @@ public interface DispenseItemBehavior { int y = blockposition.getY(); int z = blockposition.getZ(); BlockState iblockdata = worldserver.getBlockState(blockposition); @@ -24,5 +24,5 @@ index 738f6348c14b0f6942f90d15b082e16d16c89411..1fb809486ee56efd3d0ef3fa02503ba9 + if (willEmptyContentsSolidBucketItem || willEmptyBucketItem) { + // Paper end - correctly check if the bucket place will succeed org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); - CraftItemStack craftItem = CraftItemStack.asCraftMirror(stack.copyWithCount(1)); // Paper - single item in event + CraftItemStack craftItem = CraftItemStack.asCraftMirror(stack); diff --git a/patches/server/0566-Add-Unix-domain-socket-support.patch b/patches/server/0566-Add-Unix-domain-socket-support.patch index dc0ef24008..cc839de3fd 100644 --- a/patches/server/0566-Add-Unix-domain-socket-support.patch +++ b/patches/server/0566-Add-Unix-domain-socket-support.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add Unix domain socket support diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 143720bfa65e08262b96afbe53d6cf42bc326052..70fd0256a58f66122629572a72f90fb22e30bddc 100644 +index 959ce2efe156c8ff2e3d1b57cde27f4da548c3ef..212ce0957d623776a11779c4a476c76bc7c1c0bd 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -219,6 +219,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -87,10 +87,10 @@ index 25ddfe8e5da65e4ac70be2820ba139e7f3852c0c..87abd6274f9da9367094bad0c28acfa4 } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2f69f4368bb0fb6d254c1f445953c8dd05d0b0aa..e70ff6389436f33f4ec1d0b238601419bddb3fe0 100644 +index b27e232689b8af2f3c9f643b9bee805f9a7a0434..9c8188a5937206448479e9e29efcee7b938fb2cc 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2471,6 +2471,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2464,6 +2464,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Spigot Start public SocketAddress getRawAddress() { diff --git a/patches/server/0567-Add-EntityInsideBlockEvent.patch b/patches/server/0567-Add-EntityInsideBlockEvent.patch index 97313bf8a3..addc980ab1 100644 --- a/patches/server/0567-Add-EntityInsideBlockEvent.patch +++ b/patches/server/0567-Add-EntityInsideBlockEvent.patch @@ -65,7 +65,7 @@ index 3356f327c9adae6c2f3354b4417f3954012c945a..0118c4ef4f5ed0e724b379b5a563e2b6 this.checkPressed(state, world, pos); } diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java -index 3c7bbfcb3a88f23056cd0db3da2a281a81dc8c85..88ca50038b483fe5c207ef5c2bf3ea87540e147e 100644 +index 43ecbeaced4d50910a59b24934908ff40d894770..c5a0cefc6b7e19d8a277dbc59e54f465a994a858 100644 --- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java @@ -121,6 +121,7 @@ public class CactusBlock extends Block { diff --git a/patches/server/0569-Add-cause-to-Weather-ThunderChangeEvents.patch b/patches/server/0569-Add-cause-to-Weather-ThunderChangeEvents.patch index b05abf2ec8..eb81834be8 100644 --- a/patches/server/0569-Add-cause-to-Weather-ThunderChangeEvents.patch +++ b/patches/server/0569-Add-cause-to-Weather-ThunderChangeEvents.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add cause to Weather/ThunderChangeEvents diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 901d9f47a63f5c6ddd596c7d327abd06f5a17f16..497dd11d7965c9f9a2cf991712cd30d875537240 100644 +index 379be7cd3ce1808cf0cf50e50ac7e8de8c8f652c..da2a8f57b733b84106ed0818f4402d9c9d854481 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -668,8 +668,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -434,8 +434,8 @@ public class ServerLevel extends Level implements WorldGenLevel { this.serverLevelData.setClearWeatherTime(clearDuration); this.serverLevelData.setRainTime(rainDuration); this.serverLevelData.setThunderTime(rainDuration); @@ -19,7 +19,7 @@ index 901d9f47a63f5c6ddd596c7d327abd06f5a17f16..497dd11d7965c9f9a2cf991712cd30d8 } @Override -@@ -1105,8 +1105,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -868,8 +868,8 @@ public class ServerLevel extends Level implements WorldGenLevel { this.serverLevelData.setThunderTime(j); this.serverLevelData.setRainTime(k); this.serverLevelData.setClearWeatherTime(i); @@ -30,7 +30,7 @@ index 901d9f47a63f5c6ddd596c7d327abd06f5a17f16..497dd11d7965c9f9a2cf991712cd30d8 } this.oThunderLevel = this.thunderLevel; -@@ -1173,14 +1173,14 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -936,14 +936,14 @@ public class ServerLevel extends Level implements WorldGenLevel { @VisibleForTesting public void resetWeatherCycle() { // CraftBukkit start @@ -95,10 +95,10 @@ index f5ac36fa54f3d3b39de103c95abb9ca3adfe8dda..59ba982dc96ce47e47399514e8f74d2b if (weather.isCancelled()) { return; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index dc36b7686a3d06c07a00e319a2af872bd77d49ef..2d1d2f8db7ebb0d813eea2fdb2fc0044e601aade 100644 +index 6724d0b4e857a9671eac89445ceb70c070b29929..c70599006c16ea342ad1b50915cda13673431e79 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1193,7 +1193,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1164,7 +1164,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setStorm(boolean hasStorm) { @@ -107,7 +107,7 @@ index dc36b7686a3d06c07a00e319a2af872bd77d49ef..2d1d2f8db7ebb0d813eea2fdb2fc0044 this.setWeatherDuration(0); // Reset weather duration (legacy behaviour) this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands) } -@@ -1215,7 +1215,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1186,7 +1186,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setThundering(boolean thundering) { diff --git a/patches/server/0572-Add-PlayerKickEvent-causes.patch b/patches/server/0572-Add-PlayerKickEvent-causes.patch index b7343c8ce0..8abd6de517 100644 --- a/patches/server/0572-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0572-Add-PlayerKickEvent-causes.patch @@ -48,10 +48,10 @@ index 96814e626a95e4e3c2f4df1a0339d37bb02f2e61..ba12919c3f9aec34a9e64993b143ae92 public boolean shouldDisconnect() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 046ace2307e0196d4b1dbd90714d89e92e0b5ee4..0fd9e6f740ce4224144f80027b7aa611bafc0827 100644 +index 2615fbf23202c3218826d98835e327a71a5214e2..9568e922fb69ff516539aca27a599a4b2e8c647b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2113,7 +2113,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop this.disconnect(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - AsyncTabCompleteEvent & kick event cause return; } - // Paper start -@@ -881,7 +881,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + // CraftBukkit end +@@ -874,7 +874,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Paper start - validate pick item position if (!(packet.getSlot() >= 0 && packet.getSlot() < this.player.getInventory().items.size())) { ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString()); @@ -275,7 +275,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 return; } this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed -@@ -1066,7 +1066,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1059,7 +1059,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; if (byteLength > 256 * 4) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!"); @@ -284,7 +284,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 return; } byteTotal += byteLength; -@@ -1089,14 +1089,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1082,14 +1082,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (byteTotal > byteAllowed) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); @@ -301,7 +301,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 return; } this.lastBookTick = MinecraftServer.currentTick; -@@ -1240,7 +1240,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1233,7 +1233,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl public void handleMovePlayer(ServerboundMovePlayerPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) { @@ -310,7 +310,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 } else { ServerLevel worldserver = this.player.serverLevel(); -@@ -1660,7 +1660,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1653,7 +1653,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.dropCount++; if (this.dropCount >= 20) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!"); @@ -319,7 +319,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 return; } } -@@ -1943,7 +1943,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1936,7 +1936,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.resetLastActionTime(); } else { ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString()); @@ -328,7 +328,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 } } -@@ -1956,7 +1956,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1949,7 +1949,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // CraftBukkit end if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) { @@ -337,7 +337,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 } else { Optional optional = this.tryHandleChat(packet.lastSeenMessages()); -@@ -1988,7 +1988,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1981,7 +1981,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleChatCommand(ServerboundChatCommandPacket packet) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) { @@ -346,7 +346,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 } else { Optional optional = this.tryHandleChat(packet.lastSeenMessages()); -@@ -2044,7 +2044,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2037,7 +2037,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) { ServerGamePacketListenerImpl.LOGGER.warn("Failed to update secure chat state for {}: '{}'", this.player.getGameProfile().getName(), exception.getComponent().getString()); if (exception.shouldDisconnect()) { @@ -355,7 +355,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 } else { this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED)); } -@@ -2092,7 +2092,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2085,7 +2085,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (optional.isEmpty()) { ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); @@ -364,7 +364,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 } return optional; -@@ -2278,7 +2278,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2271,7 +2271,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // this.chatSpamTickCount += 20; if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // CraftBukkit end @@ -373,7 +373,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 } } -@@ -2290,7 +2290,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2283,7 +2283,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl synchronized (this.lastSeenMessages) { if (!this.lastSeenMessages.applyOffset(packet.offset())) { ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); @@ -382,7 +382,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 } } -@@ -2443,7 +2443,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2436,7 +2436,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } if (i > 4096) { @@ -391,7 +391,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 } } -@@ -2500,7 +2500,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2493,7 +2493,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Spigot Start if ( entity == this.player && !this.player.isSpectator() ) { @@ -400,7 +400,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 return; } // Spigot End -@@ -2599,7 +2599,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2592,7 +2592,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // CraftBukkit end } } else { @@ -409,7 +409,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString()); } } -@@ -3008,7 +3008,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3001,7 +3001,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Paper start - auto recipe limit if (!org.bukkit.Bukkit.isPrimaryThread()) { if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { @@ -437,7 +437,7 @@ index e70ff6389436f33f4ec1d0b238601419bddb3fe0..cde1ae539f8808ecaf28afda20dc5ea2 } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index cb71aacd23696bf0bf83d2850a5f9cbd46eb1996..0ec9d49b938ff701535fadaf701dc8f3ad4d0664 100644 +index 37662f2b42d1cbaac62743ff9907434670bb93ed..50318611b3fad9e7ad4a39c8746f77a7f9b19d69 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -683,7 +683,7 @@ public abstract class PlayerList { @@ -491,10 +491,10 @@ index 6724d0a1af13e97bc1d3bd94fd43fef742a0deab..20ba0a0c9eae28658888a77dd2170f62 } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7b5fd058817f27ffefcdc7e3667e8258a87cbb4c..667d0f7f50f7000d71efe429e2218e0358e22698 100644 +index 41e4c05325bb5ef5ce37caabb1c8a76f80d7abe2..aa145f29dfd60b19fedd4b39bc3103fb3c8fa242 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -591,7 +591,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -549,7 +549,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot if (this.getHandle().connection == null) return; @@ -503,7 +503,7 @@ index 7b5fd058817f27ffefcdc7e3667e8258a87cbb4c..667d0f7f50f7000d71efe429e2218e03 } // Paper start -@@ -603,10 +603,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -561,10 +561,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void kick(final net.kyori.adventure.text.Component message) { @@ -520,7 +520,7 @@ index 7b5fd058817f27ffefcdc7e3667e8258a87cbb4c..667d0f7f50f7000d71efe429e2218e03 } } -@@ -665,7 +670,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -623,7 +628,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper start - Improve chat handling if (ServerGamePacketListenerImpl.isChatMessageIllegal(msg)) { diff --git a/patches/server/0580-Fix-dangerous-end-portal-logic.patch b/patches/server/0580-Fix-dangerous-end-portal-logic.patch index d8c9a605cf..ed189860b8 100644 --- a/patches/server/0580-Fix-dangerous-end-portal-logic.patch +++ b/patches/server/0580-Fix-dangerous-end-portal-logic.patch @@ -11,13 +11,13 @@ Move the tick logic into the post tick, where portaling was designed to happen in the first place. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 99861651b918baafc1ca7d1fd17f37213272953b..5f8144b847e0fb62bd8db48c035b33c0fa9ed5d8 100644 +index 4fd7cd7b2dba4047f36a52c510f12d61f281a95f..50ebb94f4403bdf532af423d5204364d538667ee 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -485,6 +485,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S - - public boolean updatingSectionStatus = false; - // Paper end +@@ -420,6 +420,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S + return this.originWorld; + } + // Paper end - Entity origin API + // Paper start - make end portalling safe + public BlockPos portalBlock; + public ServerLevel portalWorld; @@ -48,10 +48,10 @@ index 99861651b918baafc1ca7d1fd17f37213272953b..5f8144b847e0fb62bd8db48c035b33c0 + this.teleportTo(worldserver, null); + } + // Paper end - make end portalling safe - - public Entity(EntityType type, Level world) { - this.id = Entity.ENTITY_COUNTER.incrementAndGet(); -@@ -2830,6 +2860,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S + public float getBukkitYaw() { + return this.yRot; + } +@@ -2778,6 +2808,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } this.processPortalCooldown(); diff --git a/patches/server/0582-Make-item-validations-configurable.patch b/patches/server/0582-Make-item-validations-configurable.patch index 0cd64973b3..111d700507 100644 --- a/patches/server/0582-Make-item-validations-configurable.patch +++ b/patches/server/0582-Make-item-validations-configurable.patch @@ -32,7 +32,7 @@ index 5e01357208fe52c1d270c68cb19029ea0f4057bb..6d85237b21650edf1d2dc71abaf0edbe } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index ad3a289af7922bfc8d503eb1da93db72b31a03f6..8af7ef1c12a7826e607b15f1376311e9d38e7f31 100644 +index f9f57f4ab75776dbaa4dc39d30e32b2c778b1955..d42f4640a53221ffa7a479bce681374527cb3a0c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -362,7 +362,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { diff --git a/patches/server/0584-add-per-world-spawn-limits.patch b/patches/server/0584-add-per-world-spawn-limits.patch index e1329a1ea6..b5e0294a7c 100644 --- a/patches/server/0584-add-per-world-spawn-limits.patch +++ b/patches/server/0584-add-per-world-spawn-limits.patch @@ -5,7 +5,7 @@ Subject: [PATCH] add per world spawn limits diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 2d1d2f8db7ebb0d813eea2fdb2fc0044e601aade..a1557d6904304d510040b8c5ecb06b89cd2fe346 100644 +index c70599006c16ea342ad1b50915cda13673431e79..eb915b7e07666ef1cad55dc32882ecc962ab2ae3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -215,6 +215,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch index e614329b11..6f96cf927d 100644 --- a/patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch +++ b/patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix PlayerDropItemEvent using wrong item diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 0a7589ef5e9ac21e0d3cb077f19cd8b99fb8e00f..3f0c5ccc53663ae006ad09b4eba7f372e9caf357 100644 +index 364ecb81521a9490d561faddd86aa2ac6b225d12..f795699d5bb7295adee8f28ed7837f7586f83552 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2387,7 +2387,7 @@ public class ServerPlayer extends Player { +@@ -2343,7 +2343,7 @@ public class ServerPlayer extends Player { if (retainOwnership) { if (!itemstack1.isEmpty()) { diff --git a/patches/server/0589-Ensure-disconnect-for-book-edit-is-called-on-main.patch b/patches/server/0589-Ensure-disconnect-for-book-edit-is-called-on-main.patch index aa232f3f8a..9ba3a2adc7 100644 --- a/patches/server/0589-Ensure-disconnect-for-book-edit-is-called-on-main.patch +++ b/patches/server/0589-Ensure-disconnect-for-book-edit-is-called-on-main.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ensure disconnect for book edit is called on main diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index cde1ae539f8808ecaf28afda20dc5ea24d006d5f..3adf67c4bd427cf666bb0b79f4ea7b94c8c5453c 100644 +index 692c9235d4a6026e3598074a936972556723c244..728a02bc2037f3afcdfb2755d11105b2d6687751 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1096,7 +1096,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1089,7 +1089,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Paper end - Book size limits // CraftBukkit start if (this.lastBookTick + 20 > MinecraftServer.currentTick) { diff --git a/patches/server/0591-Use-getChunkIfLoadedImmediately-in-places.patch b/patches/server/0591-Use-getChunkIfLoadedImmediately-in-places.patch index 19442f967b..31b7ca763f 100644 --- a/patches/server/0591-Use-getChunkIfLoadedImmediately-in-places.patch +++ b/patches/server/0591-Use-getChunkIfLoadedImmediately-in-places.patch @@ -8,7 +8,7 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk load in that case). diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 497dd11d7965c9f9a2cf991712cd30d875537240..49c23f4fbafbae516f3546c200448c400a6b0d5d 100644 +index da2a8f57b733b84106ed0818f4402d9c9d854481..0a7f98900cf45fdb11e64c2ed7139fcad940f0d5 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -225,7 +225,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -21,10 +21,10 @@ index 497dd11d7965c9f9a2cf991712cd30d875537240..49c23f4fbafbae516f3546c200448c40 @Override diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index c4086b17db7624489a8873ee321e7707078e5e0b..9c8a2cae9832f2503aed6c2d6e32cdc2f12029c9 100644 +index 3e98a86dd56855485c7d8c26eb30f2bbace2d66c..596bcc62e5754b5a2c29de263ba2f7fd9b6e0bed 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -196,6 +196,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -187,6 +187,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return (CraftServer) Bukkit.getServer(); } diff --git a/patches/server/0593-Add-PlayerArmSwingEvent.patch b/patches/server/0593-Add-PlayerArmSwingEvent.patch index 43f3865524..ea2ca9d38e 100644 --- a/patches/server/0593-Add-PlayerArmSwingEvent.patch +++ b/patches/server/0593-Add-PlayerArmSwingEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerArmSwingEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 3adf67c4bd427cf666bb0b79f4ea7b94c8c5453c..6d385f169b5daab69cd40e37ffaa38416dc91223 100644 +index 728a02bc2037f3afcdfb2755d11105b2d6687751..297f9731f005c93c5d8d2d1913bd3bf74afdda47 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2328,7 +2328,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2321,7 +2321,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Paper end - Call interact event // Arm swing animation diff --git a/patches/server/0594-Fix-kick-event-leave-message-not-being-sent.patch b/patches/server/0594-Fix-kick-event-leave-message-not-being-sent.patch index 70477f1da1..5a6a489245 100644 --- a/patches/server/0594-Fix-kick-event-leave-message-not-being-sent.patch +++ b/patches/server/0594-Fix-kick-event-leave-message-not-being-sent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix kick event leave message not being sent diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 64b31447847d3b40ba00c4e6708d68113f2ef2bd..5114543c1510d203bfa4e684357b94585919742f 100644 +index f795699d5bb7295adee8f28ed7837f7586f83552..f0f1c5b4dd4dffa29715e3cfe7225f0753713d98 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -269,7 +269,6 @@ public class ServerPlayer extends Player { @@ -50,10 +50,10 @@ index a65a1466dab52fca75cda16a4b22fef03b6207a0..0306771b8f90dcdd77f151c19c6c2d75 MinecraftServer minecraftserver = this.server; Connection networkmanager = this.connection; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 6d385f169b5daab69cd40e37ffaa38416dc91223..cfe980606a87ccad1cbf9354728a8d2e57686fa4 100644 +index 297f9731f005c93c5d8d2d1913bd3bf74afdda47..ffe90271365138d6046b52cad2cf661d25d6e6d4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1882,6 +1882,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1875,6 +1875,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void onDisconnect(Component reason) { @@ -66,7 +66,7 @@ index 6d385f169b5daab69cd40e37ffaa38416dc91223..cfe980606a87ccad1cbf9354728a8d2e // CraftBukkit start - Rarely it would send a disconnect line twice if (this.processedDisconnect) { return; -@@ -1890,11 +1896,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1883,11 +1889,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // CraftBukkit end ServerGamePacketListenerImpl.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), reason.getString()); @@ -86,7 +86,7 @@ index 6d385f169b5daab69cd40e37ffaa38416dc91223..cfe980606a87ccad1cbf9354728a8d2e this.chatMessageChain.close(); // CraftBukkit start - Replace vanilla quit message handling with our own. /* -@@ -1904,7 +1916,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1897,7 +1909,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.disconnect(); // Paper start - Adventure @@ -96,7 +96,7 @@ index 6d385f169b5daab69cd40e37ffaa38416dc91223..cfe980606a87ccad1cbf9354728a8d2e this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false); // Paper end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 0ec9d49b938ff701535fadaf701dc8f3ad4d0664..cedfc39539f7eb7d2cc0dfeda347cf59fadd95fc 100644 +index 50318611b3fad9e7ad4a39c8746f77a7f9b19d69..e4cfdba803eea5092c5064ff5dcbc668976176d0 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -569,6 +569,11 @@ public abstract class PlayerList { diff --git a/patches/server/0596-Don-t-apply-cramming-damage-to-players.patch b/patches/server/0596-Don-t-apply-cramming-damage-to-players.patch index de289eb5eb..928b033417 100644 --- a/patches/server/0596-Don-t-apply-cramming-damage-to-players.patch +++ b/patches/server/0596-Don-t-apply-cramming-damage-to-players.patch @@ -11,7 +11,7 @@ It does not make a lot of sense to damage players if they get crammed, For those who really want it a config option is provided. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 5114543c1510d203bfa4e684357b94585919742f..415a48203aa150056cb224e3eb65a1f62f0741e7 100644 +index f0f1c5b4dd4dffa29715e3cfe7225f0753713d98..481732b49b9492a7010d85932554b0d466e82765 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -95,6 +95,7 @@ import net.minecraft.util.Mth; @@ -22,7 +22,7 @@ index 5114543c1510d203bfa4e684357b94585919742f..415a48203aa150056cb224e3eb65a1f6 import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.Entity; -@@ -1475,7 +1476,7 @@ public class ServerPlayer extends Player { +@@ -1431,7 +1432,7 @@ public class ServerPlayer extends Player { @Override public boolean isInvulnerableTo(DamageSource damageSource) { diff --git a/patches/server/0601-Add-System.out-err-catcher.patch b/patches/server/0601-Add-System.out-err-catcher.patch index 2b01eabadb..470f68bfd8 100644 --- a/patches/server/0601-Add-System.out-err-catcher.patch +++ b/patches/server/0601-Add-System.out-err-catcher.patch @@ -105,7 +105,7 @@ index 0000000000000000000000000000000000000000..a8e813ca89b033f061e695288b3383bd + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 980bf1f65db95533b757a757dcfda3d6970fcc8b..e437dac193b6aa301b35b847647ca6004334a092 100644 +index b3e11cf65548bd79413620a4a6303b530e15297e..06f14b2adacdbcc4e9f24b8e1fb2224ae3925172 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -303,6 +303,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0603-Prevent-AFK-kick-while-watching-end-credits.patch b/patches/server/0603-Prevent-AFK-kick-while-watching-end-credits.patch index f391ce9592..1179d89813 100644 --- a/patches/server/0603-Prevent-AFK-kick-while-watching-end-credits.patch +++ b/patches/server/0603-Prevent-AFK-kick-while-watching-end-credits.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent AFK kick while watching end credits diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index cfe980606a87ccad1cbf9354728a8d2e57686fa4..fa6783305aae385723d6bdb83166e147b8ebcfe9 100644 +index ffe90271365138d6046b52cad2cf661d25d6e6d4..b04460f710ed24ab94011e9d6b79953338d5b7e0 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -390,7 +390,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0605-Add-PlayerSetSpawnEvent.patch b/patches/server/0605-Add-PlayerSetSpawnEvent.patch index cd6f103ac2..68ec8e90f4 100644 --- a/patches/server/0605-Add-PlayerSetSpawnEvent.patch +++ b/patches/server/0605-Add-PlayerSetSpawnEvent.patch @@ -49,10 +49,10 @@ index a2d0699e8427b2262a2396495111125eccafbb66..15db9368227dbc29d07d74e85bd126b3 } } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 415a48203aa150056cb224e3eb65a1f62f0741e7..770f99014f3cccbbc666f0aa8530dfb545ced7b6 100644 +index 481732b49b9492a7010d85932554b0d466e82765..ef957f0dcea13097e34bf8c9f223eb9790ee282c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1352,7 +1352,7 @@ public class ServerPlayer extends Player { +@@ -1308,7 +1308,7 @@ public class ServerPlayer extends Player { } else if (this.bedBlocked(blockposition, enumdirection)) { return Either.left(Player.BedSleepingProblem.OBSTRUCTED); } else { @@ -61,7 +61,7 @@ index 415a48203aa150056cb224e3eb65a1f62f0741e7..770f99014f3cccbbc666f0aa8530dfb5 if (this.level().isDay()) { return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW); } else { -@@ -2307,44 +2307,50 @@ public class ServerPlayer extends Player { +@@ -2263,44 +2263,50 @@ public class ServerPlayer extends Player { return this.respawnForced; } @@ -145,7 +145,7 @@ index 415a48203aa150056cb224e3eb65a1f62f0741e7..770f99014f3cccbbc666f0aa8530dfb5 } else { this.respawnPosition = null; this.respawnDimension = Level.OVERWORLD; -@@ -2352,6 +2358,7 @@ public class ServerPlayer extends Player { +@@ -2308,6 +2314,7 @@ public class ServerPlayer extends Player { this.respawnForced = false; } @@ -154,7 +154,7 @@ index 415a48203aa150056cb224e3eb65a1f62f0741e7..770f99014f3cccbbc666f0aa8530dfb5 public SectionPos getLastSectionPos() { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index cedfc39539f7eb7d2cc0dfeda347cf59fadd95fc..a4d2ddbb9cee1682fc5d91e90d2fd0b74a47aa3c 100644 +index e4cfdba803eea5092c5064ff5dcbc668976176d0..edeec3dd7887fbde9456e39c023d4a2dd9b6ffc5 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -871,7 +871,7 @@ public abstract class PlayerList { @@ -187,10 +187,10 @@ index ecaa7f0b2bf795f16187f11fa27f6d5d435ccbfe..acd5ec218b8d4c096f44ae2eec1379ee } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 667d0f7f50f7000d71efe429e2218e0358e22698..75d06c92de46a8cb374985435e89bb3b03962ee4 100644 +index aa145f29dfd60b19fedd4b39bc3103fb3c8fa242..85dd644ca86895e91ba639ba4974a05290e4e061 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1318,9 +1318,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1276,9 +1276,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setBedSpawnLocation(Location location, boolean override) { if (location == null) { diff --git a/patches/server/0610-Optimize-indirect-passenger-iteration.patch b/patches/server/0610-Optimize-indirect-passenger-iteration.patch index 58246604f3..787e9411e7 100644 --- a/patches/server/0610-Optimize-indirect-passenger-iteration.patch +++ b/patches/server/0610-Optimize-indirect-passenger-iteration.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Optimize indirect passenger iteration diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 5f8144b847e0fb62bd8db48c035b33c0fa9ed5d8..bf9499f076e4eabc69d45d95705964daa56a570c 100644 +index 50ebb94f4403bdf532af423d5204364d538667ee..fb085b7c72896bc6e5223eb2d87d1e6b435114dc 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3875,20 +3875,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3823,20 +3823,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } private Stream getIndirectPassengersStream() { @@ -43,8 +43,8 @@ index 5f8144b847e0fb62bd8db48c035b33c0fa9ed5d8..bf9499f076e4eabc69d45d95705964da return () -> { return this.getIndirectPassengersStream().iterator(); }; -@@ -3911,6 +3925,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S - // Paper end - rewrite chunk system +@@ -3849,6 +3863,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S + } public boolean hasExactlyOnePlayerPassenger() { + if (this.passengers.isEmpty()) { return false; } // Paper - Optimize indirect passenger iteration diff --git a/patches/server/0612-Clear-bucket-NBT-after-dispense.patch b/patches/server/0612-Clear-bucket-NBT-after-dispense.patch index a427f6d5e2..24eb614ec7 100644 --- a/patches/server/0612-Clear-bucket-NBT-after-dispense.patch +++ b/patches/server/0612-Clear-bucket-NBT-after-dispense.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Clear bucket NBT after dispense diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index 8c8d2e81f0866dc1441e181f2580852d87263bcc..d41e3e5382b17d3de41054b496c1707a926a897a 100644 +index c1c57f24ccfa7bd17541f53d02293db0bce8dc5c..829c72333664da0c06ce04af93ea39bb90ce0b67 100644 --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -@@ -650,8 +650,7 @@ public interface DispenseItemBehavior { +@@ -656,8 +656,7 @@ public interface DispenseItemBehavior { Item item = Items.BUCKET; stack.shrink(1); if (stack.isEmpty()) { diff --git a/patches/server/0618-Add-back-EntityPortalExitEvent.patch b/patches/server/0618-Add-back-EntityPortalExitEvent.patch index 6837ae902e..380fbcd778 100644 --- a/patches/server/0618-Add-back-EntityPortalExitEvent.patch +++ b/patches/server/0618-Add-back-EntityPortalExitEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add back EntityPortalExitEvent diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index bf9499f076e4eabc69d45d95705964daa56a570c..5755c836024de4c8c25b026baa47c193a2df2a0b 100644 +index fb085b7c72896bc6e5223eb2d87d1e6b435114dc..8825afb72b3d85840a15b02dbd3d914de06a62a8 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3324,6 +3324,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3272,6 +3272,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } else { // CraftBukkit start worldserver = shapedetectorshape.world; @@ -37,7 +37,7 @@ index bf9499f076e4eabc69d45d95705964daa56a570c..5755c836024de4c8c25b026baa47c193 if (worldserver == this.level) { // SPIGOT-6782: Just move the entity if a plugin changed the world to the one the entity is already in this.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, shapedetectorshape.xRot); -@@ -3343,8 +3365,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3291,8 +3313,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (entity != null) { entity.restoreFrom(this); diff --git a/patches/server/0619-Add-methods-to-find-targets-for-lightning-strikes.patch b/patches/server/0619-Add-methods-to-find-targets-for-lightning-strikes.patch index b94fe69063..f442052cf5 100644 --- a/patches/server/0619-Add-methods-to-find-targets-for-lightning-strikes.patch +++ b/patches/server/0619-Add-methods-to-find-targets-for-lightning-strikes.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add methods to find targets for lightning strikes public net.minecraft.server.level.ServerLevel findLightningRod(Lnet/minecraft/core/BlockPos;)Ljava/util/Optional; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 49c23f4fbafbae516f3546c200448c400a6b0d5d..669c9e43ee76ce2502ed49965aae2703b922f3b5 100644 +index 0a7f98900cf45fdb11e64c2ed7139fcad940f0d5..dd3e5ee62da7b37b51e07796f6a1188e207d49e2 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -994,6 +994,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -757,6 +757,11 @@ public class ServerLevel extends Level implements WorldGenLevel { } protected BlockPos findLightningTargetAround(BlockPos pos) { @@ -22,7 +22,7 @@ index 49c23f4fbafbae516f3546c200448c400a6b0d5d..669c9e43ee76ce2502ed49965aae2703 BlockPos blockposition1 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, pos); Optional optional = this.findLightningRod(blockposition1); -@@ -1008,6 +1013,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -771,6 +776,7 @@ public class ServerLevel extends Level implements WorldGenLevel { if (!list.isEmpty()) { return ((LivingEntity) list.get(this.random.nextInt(list.size()))).blockPosition(); } else { @@ -31,10 +31,10 @@ index 49c23f4fbafbae516f3546c200448c400a6b0d5d..669c9e43ee76ce2502ed49965aae2703 blockposition1 = blockposition1.above(2); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a1557d6904304d510040b8c5ecb06b89cd2fe346..e03bd6419d4c28a329286edc5267b725de554105 100644 +index eb915b7e07666ef1cad55dc32882ecc962ab2ae3..938b3147040a43601f425b056dc4a83ccf2564be 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -651,6 +651,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -661,6 +661,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { return (LightningStrike) lightning.getBukkitEntity(); } diff --git a/patches/server/0629-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0629-Add-Raw-Byte-Entity-Serialization.patch index f84be24459..04b2562669 100644 --- a/patches/server/0629-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/server/0629-Add-Raw-Byte-Entity-Serialization.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add Raw Byte Entity Serialization public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index e5f265d71fe10fe1c9cb1ec95958f0c42063e51c..99b87b783dfb3d0e00e3e03e5721feaef1c1ecf0 100644 +index 8825afb72b3d85840a15b02dbd3d914de06a62a8..c19cc2af8bf0d2f5a778cdd05560340fad6847e1 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2113,6 +2113,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2061,6 +2061,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } } diff --git a/patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch index d39176ce97..5c9a4298ea 100644 --- a/patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch +++ b/patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch @@ -9,10 +9,10 @@ chunk through it. This should also be OK from a leak prevention/ state desync POV because the TE is getting unloaded anyways. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 43f190d5e3805f7260128b1e32c904d5aa67fd64..487b5620361acd54fd36b8996235fc5be053bd09 100644 +index dd3e5ee62da7b37b51e07796f6a1188e207d49e2..46e14d8bcef8ba9ba2b17f6d2e59db7247b38977 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1540,9 +1540,13 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1301,9 +1301,13 @@ public class ServerLevel extends Level implements WorldGenLevel { // Spigot Start for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) { if (tileentity instanceof net.minecraft.world.Container) { @@ -28,10 +28,10 @@ index 43f190d5e3805f7260128b1e32c904d5aa67fd64..487b5620361acd54fd36b8996235fc5b } // Spigot End diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 475ae48f553c902a6635b56faea60d81dba1b0f4..ef51bcd19c2e0a4ba89a26df4b4a21094213937a 100644 +index ef957f0dcea13097e34bf8c9f223eb9790ee282c..e711bb835267e09183c2af1ac0df07b9fd5cefcd 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1626,6 +1626,18 @@ public class ServerPlayer extends Player { +@@ -1582,6 +1582,18 @@ public class ServerPlayer extends Player { this.connection.send(new ClientboundContainerClosePacket(this.containerMenu.containerId)); this.doCloseContainer(); } diff --git a/patches/server/0633-Improve-and-expand-AsyncCatcher.patch b/patches/server/0633-Improve-and-expand-AsyncCatcher.patch index 8f5e4158f8..3277ec0bc2 100644 --- a/patches/server/0633-Improve-and-expand-AsyncCatcher.patch +++ b/patches/server/0633-Improve-and-expand-AsyncCatcher.patch @@ -17,10 +17,10 @@ Async catch modifications to critical entity state Co-authored-by: Jake Potrebic diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index fa6783305aae385723d6bdb83166e147b8ebcfe9..27bcfe893db83bb369186ccf1d48f28e9d2cae82 100644 +index b04460f710ed24ab94011e9d6b79953338d5b7e0..8c82679ced26d540f708c566796ab7ed96faee65 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1570,6 +1570,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1563,6 +1563,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set set) { // Paper @@ -166,10 +166,10 @@ index bbbf6dd8e566ecdca8794e3b03765fe7e426a2bd..66ab901956ca394c251c420338643d39 PersistentEntitySectionManager.LOGGER.warn("Entity {} wasn't found in section {} (destroying due to {})", new Object[]{this.entity, SectionPos.of(this.currentSectionKey), reason}); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e03bd6419d4c28a329286edc5267b725de554105..57b27317f28901df1bb3c10bf462d319d0c7b7c3 100644 +index 938b3147040a43601f425b056dc4a83ccf2564be..605c04d10b47b71787b7f3369d4fdfbb98327c1d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1753,6 +1753,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1724,6 +1724,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void playSound(Location loc, Sound sound, org.bukkit.SoundCategory category, float volume, float pitch, long seed) { @@ -177,7 +177,7 @@ index e03bd6419d4c28a329286edc5267b725de554105..57b27317f28901df1bb3c10bf462d319 if (loc == null || sound == null || category == null) return; double x = loc.getX(); -@@ -1764,6 +1765,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1735,6 +1736,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void playSound(Location loc, String sound, org.bukkit.SoundCategory category, float volume, float pitch, long seed) { @@ -185,7 +185,7 @@ index e03bd6419d4c28a329286edc5267b725de554105..57b27317f28901df1bb3c10bf462d319 if (loc == null || sound == null || category == null) return; double x = loc.getX(); -@@ -1796,6 +1798,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1767,6 +1769,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void playSound(Entity entity, Sound sound, org.bukkit.SoundCategory category, float volume, float pitch, long seed) { @@ -193,7 +193,7 @@ index e03bd6419d4c28a329286edc5267b725de554105..57b27317f28901df1bb3c10bf462d319 if (!(entity instanceof CraftEntity craftEntity) || entity.getWorld() != this || sound == null || category == null) return; ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(CraftSound.bukkitToMinecraftHolder(sound), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed); -@@ -1807,6 +1810,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1778,6 +1781,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void playSound(Entity entity, String sound, org.bukkit.SoundCategory category, float volume, float pitch, long seed) { @@ -214,12 +214,12 @@ index 711f4ca8ee42a14e40af86d93a9685b4b9a2ba99..269664d3894835e5bafc39e65ee5245a return true; } diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java -index 05e94702e42b8f5c35d2a112c486d57948a3acba..d678ca116f9b81ab9d7d99a698e0ce066c132f34 100644 +index 78669fa035b7537ff7e533cf32aaf2995625424f..e8e3cc48cf1c58bd8151d1f28df28781859cd0e3 100644 --- a/src/main/java/org/spigotmc/AsyncCatcher.java +++ b/src/main/java/org/spigotmc/AsyncCatcher.java @@ -11,6 +11,7 @@ public class AsyncCatcher { - if ( !io.papermc.paper.util.TickThread.isTickThread() ) // Paper // Paper - rewrite chunk system + if ( (AsyncCatcher.enabled || io.papermc.paper.util.TickThread.STRICT_THREAD_CHECKS) && Thread.currentThread() != MinecraftServer.getServer().serverThread ) // Paper { + MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); // Paper throw new IllegalStateException( "Asynchronous " + reason + "!" ); diff --git a/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch b/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch index fa2fd82717..869272efd9 100644 --- a/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch +++ b/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch @@ -10,13 +10,13 @@ Also has a hover text on each mob category listing what entity types are in said category diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index 8ff2bcfa05641a022aceff66f2356744caa594da..b2a15f0346c84b03c8947e3231cf0d27a790ebc9 100644 +index a27c90ea7af63b0d42f202ed1a7dab6e42daed9f..1fd0854fb4f8ab3b5da3cda5ddd2535a0faa6adf 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java -@@ -42,6 +42,7 @@ public final class PaperCommand extends Command { +@@ -41,6 +41,7 @@ public final class PaperCommand extends Command { + commands.put(Set.of("fixlight"), new FixLightCommand()); commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand()); commands.put(Set.of("dumpitem"), new DumpItemCommand()); - commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); + commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand()); return commands.entrySet().stream() @@ -278,10 +278,10 @@ index 4ad3a4403f497f4b437209a9e63445f0d29b09f1..28ec1cc4dec6d12627761a58d635fd51 BlockPos blockposition = NaturalSpawner.getRandomPosWithin(world, chunk); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f779364a29ff91e47c44a99533acb9d387a72b48..8d7cf6e0e24d114570967b70a1685a253bbc0f9d 100644 +index 06f14b2adacdbcc4e9f24b8e1fb2224ae3925172..8bf110c0d9f4203559795d804cbee5b9a5f502e3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2279,6 +2279,11 @@ public final class CraftServer implements Server { +@@ -2274,6 +2274,11 @@ public final class CraftServer implements Server { @Override public int getSpawnLimit(SpawnCategory spawnCategory) { @@ -294,10 +294,10 @@ index f779364a29ff91e47c44a99533acb9d387a72b48..8d7cf6e0e24d114570967b70a1685a25 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 57b27317f28901df1bb3c10bf462d319d0c7b7c3..a059b426e2d0280a318bd1c697056352b24ee9c3 100644 +index 605c04d10b47b71787b7f3369d4fdfbb98327c1d..b3a48f238e64f4de3074b1a9d7882cd5b6adfba3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1711,9 +1711,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1682,9 +1682,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null"); Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory); diff --git a/patches/server/0638-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch b/patches/server/0638-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch index be89fb6192..1dec548d03 100644 --- a/patches/server/0638-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch +++ b/patches/server/0638-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch @@ -10,10 +10,10 @@ chunks did get inlined, but the standard CPS.getChunkAt method was not inlined. diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 9c8a2cae9832f2503aed6c2d6e32cdc2f12029c9..709d3e5c506c9dd14f51c455eee7093fb9703168 100644 +index 596bcc62e5754b5a2c29de263ba2f7fd9b6e0bed..e8b9050f9abe6f269aab775bb12993bcf18aff2a 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -372,6 +372,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -363,6 +363,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @Override public final LevelChunk getChunk(int chunkX, int chunkZ) { // Paper - final to help inline diff --git a/patches/server/0639-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch b/patches/server/0639-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch index 8a47c1cb53..c878df9041 100644 --- a/patches/server/0639-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch +++ b/patches/server/0639-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch @@ -8,14 +8,14 @@ Lighting is purged on update anyways, so let's not add more into the conversion process diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java -index af8a8e85742497e8dac7a59a3cd5938e09580e45..cccc3741227402b24c76d31a339d01323610b9f0 100644 +index ab6b4491d4278b3839b7363d9890bd12a757e4cc..eebaf98bc0fa4696af59b2a79563beb73501a554 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java -@@ -51,6 +51,7 @@ public class ChunkStorage implements AutoCloseable { +@@ -44,6 +44,7 @@ public class ChunkStorage implements AutoCloseable { // CraftBukkit start private boolean check(ServerChunkCache cps, int x, int z) { + if (true) return true; // Paper - Perf: this isn't even needed anymore, light is purged updating to 1.14+, why are we holding up the conversion process reading chunk data off disk - return true, we need to set light populated to true so the converter recognizes the chunk as being "full" ChunkPos pos = new ChunkPos(x, z); if (cps != null) { - //com.google.common.base.Preconditions.checkState(org.bukkit.Bukkit.isPrimaryThread(), "primary thread"); // Paper - this function is now MT-Safe + com.google.common.base.Preconditions.checkState(org.bukkit.Bukkit.isPrimaryThread(), "primary thread"); diff --git a/patches/server/0643-Oprimise-map-impl-for-tracked-players.patch b/patches/server/0643-Oprimise-map-impl-for-tracked-players.patch index 2b7347016c..f6826029b1 100644 --- a/patches/server/0643-Oprimise-map-impl-for-tracked-players.patch +++ b/patches/server/0643-Oprimise-map-impl-for-tracked-players.patch @@ -7,10 +7,10 @@ Reference2BooleanOpenHashMap is going to have better lookups than HashMap. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 69d140fbcccc9054f15716e35a7b854b387fe21d..f7ebb560a3f8aebb5e35397814eaa7af098897c3 100644 +index 9706e08511fcfd72abd5e92d7df54dc199451499..3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1119,7 +1119,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1686,7 +1686,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider final Entity entity; private final int range; SectionPos lastSectionPos; diff --git a/patches/server/0646-Fix-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/0645-Fix-merchant-inventory-not-closing-on-entity-removal.patch similarity index 90% rename from patches/server/0646-Fix-merchant-inventory-not-closing-on-entity-removal.patch rename to patches/server/0645-Fix-merchant-inventory-not-closing-on-entity-removal.patch index d4e141ad1b..93adc35a5b 100644 --- a/patches/server/0646-Fix-merchant-inventory-not-closing-on-entity-removal.patch +++ b/patches/server/0645-Fix-merchant-inventory-not-closing-on-entity-removal.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e6a3f377762db8f2f58cb6851b8f713ce591b29f..6ece18d5429217ee53ca5ae5c0eb7450aa5f63ec 100644 +index 46e14d8bcef8ba9ba2b17f6d2e59db7247b38977..2d0d1da27152654ab43aba0ffe51887137190a2e 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2610,6 +2610,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2356,6 +2356,11 @@ public class ServerLevel extends Level implements WorldGenLevel { // Spigot end // Spigot Start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message diff --git a/patches/server/0981-Use-correct-max-stack-size-in-crafter.patch b/patches/server/0646-Use-correct-max-stack-size-in-crafter.patch similarity index 100% rename from patches/server/0981-Use-correct-max-stack-size-in-crafter.patch rename to patches/server/0646-Use-correct-max-stack-size-in-crafter.patch diff --git a/patches/server/0648-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch b/patches/server/0648-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch index f3b2d0191f..3e382f6e71 100644 --- a/patches/server/0648-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch +++ b/patches/server/0648-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch @@ -6,12 +6,12 @@ Subject: [PATCH] Don't respond to ServerboundCommandSuggestionPacket when diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 27bcfe893db83bb369186ccf1d48f28e9d2cae82..0280c215f4e502cd0471523b040d8b54c50f7ab8 100644 +index 8c82679ced26d540f708c566796ab7ed96faee65..277da3de55663e46fec47a3a41345bcd2a111d28 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -733,6 +733,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -726,6 +726,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + return; } - // Paper end // CraftBukkit end + // Paper start - Don't suggest if tab-complete is disabled + if (org.spigotmc.SpigotConfig.tabComplete < 0) { diff --git a/patches/server/0651-Ensure-valid-vehicle-status.patch b/patches/server/0651-Ensure-valid-vehicle-status.patch index 62d62c36bb..285b094a33 100644 --- a/patches/server/0651-Ensure-valid-vehicle-status.patch +++ b/patches/server/0651-Ensure-valid-vehicle-status.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ensure valid vehicle status diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index bb313280236fb5c7dd2713a21edd3694e01a4fd1..20cdb362592714891d7676fbea6096dfe30447b0 100644 +index e711bb835267e09183c2af1ac0df07b9fd5cefcd..1287a714b50723a8512428d62c4d39edcc396ed9 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -572,7 +572,7 @@ public class ServerPlayer extends Player { +@@ -528,7 +528,7 @@ public class ServerPlayer extends Player { } } diff --git a/patches/server/0657-Update-head-rotation-in-missing-places.patch b/patches/server/0657-Update-head-rotation-in-missing-places.patch index d48b54c0ae..ac63ef1129 100644 --- a/patches/server/0657-Update-head-rotation-in-missing-places.patch +++ b/patches/server/0657-Update-head-rotation-in-missing-places.patch @@ -8,10 +8,10 @@ This is because bukkit uses a separate head rotation field for yaw. This issue only applies to players. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 99b87b783dfb3d0e00e3e03e5721feaef1c1ecf0..0dd2fcc51b7d07f68fdc630f7c73dcdc32282e90 100644 +index c19cc2af8bf0d2f5a778cdd05560340fad6847e1..48b1648b749f884d29abe8d48865860791eda9dc 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1830,6 +1830,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1778,6 +1778,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F); this.yRotO = this.getYRot(); this.xRotO = this.getXRot(); @@ -19,7 +19,7 @@ index 99b87b783dfb3d0e00e3e03e5721feaef1c1ecf0..0dd2fcc51b7d07f68fdc630f7c73dcdc } public void absMoveTo(double x, double y, double z) { -@@ -1868,6 +1869,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1816,6 +1817,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.setXRot(pitch); this.setOldPosAndRot(); this.reapplyPosition(); diff --git a/patches/server/0660-Fix-upstreams-block-state-factories.patch b/patches/server/0660-Fix-upstreams-block-state-factories.patch index 23a0382bf4..cd44e53b99 100644 --- a/patches/server/0660-Fix-upstreams-block-state-factories.patch +++ b/patches/server/0660-Fix-upstreams-block-state-factories.patch @@ -13,7 +13,7 @@ the material type of the block at that location. public net.minecraft.world.level.block.entity.BlockEntityType validBlocks diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index d156f7cc71050f13b2feca00c52ca6b64572b60e..e3557f4c8cee7c88b3e352cd246078da7762effc 100644 +index 53443b472d21633f49c102b330c8406c92f09d8d..4893eaf93738da860014ddf3ad003334c9ebc9fa 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java @@ -247,7 +247,7 @@ public abstract class BlockEntity { diff --git a/patches/server/0661-Configurable-feature-seeds.patch b/patches/server/0661-Configurable-feature-seeds.patch index c376ba2260..3eef86b255 100644 --- a/patches/server/0661-Configurable-feature-seeds.patch +++ b/patches/server/0661-Configurable-feature-seeds.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable feature seeds Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com> diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java -index 1080e1f67afe5574baca0df50cdb1d029a7a586a..a2f71a6d1a9e98133dff6cd0f625da9435a8af14 100644 +index 38f01952153348d937e326da0ec102cd9b0f80af..2d4090b95193de431f56eaafd4d4561ecccdf99c 100644 --- a/src/main/java/co/aikar/timings/TimingsExport.java +++ b/src/main/java/co/aikar/timings/TimingsExport.java -@@ -288,7 +288,7 @@ public class TimingsExport extends Thread { +@@ -284,7 +284,7 @@ public class TimingsExport extends Thread { JSONObject object = new JSONObject(); for (String key : config.getKeys(false)) { String fullKey = (parentKey != null ? parentKey + "." + key : key); @@ -19,7 +19,7 @@ index 1080e1f67afe5574baca0df50cdb1d029a7a586a..a2f71a6d1a9e98133dff6cd0f625da94 } final Object val = config.get(key); diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -index 180f8ae443d1ea44a748c7f3ebb82a0bab8d31f1..f8306b4d0d1c0a4e7336bd5f99222f59920ab796 100644 +index a6d5b3fa7e3437e0aec54eec4079e9f3267c64b8..567103d635087bf894a8c0473baf03bdb5ff052f 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java @@ -431,7 +431,14 @@ public abstract class ChunkGenerator { diff --git a/patches/server/0662-Add-root-admin-user-detection.patch b/patches/server/0662-Add-root-admin-user-detection.patch index e00d1ab16a..5bb88a6088 100644 --- a/patches/server/0662-Add-root-admin-user-detection.patch +++ b/patches/server/0662-Add-root-admin-user-detection.patch @@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..6bd0afddbcc461149dfe9a5c7a86fff6 + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 70fd0256a58f66122629572a72f90fb22e30bddc..3cc0aa9fa1ba11d85ce07013de86ad6f89c52f67 100644 +index 212ce0957d623776a11779c4a476c76bc7c1c0bd..c39b19bee3aca093a2087e19875a50ff21cf1ab3 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -179,6 +179,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface diff --git a/patches/server/0664-don-t-attempt-to-teleport-dead-entities.patch b/patches/server/0664-don-t-attempt-to-teleport-dead-entities.patch index a512dbd9ac..77871ece3d 100644 --- a/patches/server/0664-don-t-attempt-to-teleport-dead-entities.patch +++ b/patches/server/0664-don-t-attempt-to-teleport-dead-entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] don't attempt to teleport dead entities diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 0dd2fcc51b7d07f68fdc630f7c73dcdc32282e90..1b9b3e8b2a85c6e921ec665c95061f2d3e3f678d 100644 +index 48b1648b749f884d29abe8d48865860791eda9dc..021d3803ffbf4fb0a6de92c13406c5316e09c4c1 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -757,7 +757,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -705,7 +705,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // CraftBukkit start public void postTick() { // No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle diff --git a/patches/server/0669-Hide-unnecessary-itemmeta-from-clients.patch b/patches/server/0669-Hide-unnecessary-itemmeta-from-clients.patch index 485e08deb0..c9665a328e 100644 --- a/patches/server/0669-Hide-unnecessary-itemmeta-from-clients.patch +++ b/patches/server/0669-Hide-unnecessary-itemmeta-from-clients.patch @@ -18,10 +18,10 @@ index 0a86e72e50d4aab7d19f588c3f11d7465c6fe817..c881d6ea6acbcbd1414a0b7d6b5a2607 } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0280c215f4e502cd0471523b040d8b54c50f7ab8..5aa9f337e1e251485310436f87786b02d181bcbb 100644 +index 277da3de55663e46fec47a3a41345bcd2a111d28..7fa4b7e5980d07ede8a3a7640f361dfa57d8927a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2561,8 +2561,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2554,8 +2554,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Refresh the current entity metadata entity.getEntityData().refresh(ServerGamePacketListenerImpl.this.player); // SPIGOT-7136 - Allays diff --git a/patches/server/0674-Allow-delegation-to-vanilla-chunk-gen.patch b/patches/server/0674-Allow-delegation-to-vanilla-chunk-gen.patch index 702533a18c..f53f363b6a 100644 --- a/patches/server/0674-Allow-delegation-to-vanilla-chunk-gen.patch +++ b/patches/server/0674-Allow-delegation-to-vanilla-chunk-gen.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9ad1645c143d91ae9e08dfe3d875c9b0aa4d0844..492867fb2bf9a94f8fd5fac7d02f7d1538edcf21 100644 +index 8bf110c0d9f4203559795d804cbee5b9a5f502e3..33a3a46e275a6583ca11dfd87bd9fb7e5b60914a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2459,6 +2459,88 @@ public final class CraftServer implements Server { +@@ -2454,6 +2454,88 @@ public final class CraftServer implements Server { return new OldCraftChunkData(world.getMinHeight(), world.getMaxHeight(), handle.registryAccess().registryOrThrow(Registries.BIOME)); } diff --git a/patches/server/0675-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch b/patches/server/0675-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch index d6bf69f20b..6a39da753c 100644 --- a/patches/server/0675-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch +++ b/patches/server/0675-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix ChunkSnapshot#isSectionEmpty(int) and optimize diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 545b14f02ac72dda30891d681eba585d19fd5e1d..d4e0ef75dd12709a0dcf9193821c30b8943e6c36 100644 +index e38643853220cabeac6c30912a9ae4bc1c018d5f..1eff5e4800ad3b628a42113fb3ba67458e56a40d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -291,13 +291,17 @@ public class CraftChunk implements Chunk { +@@ -335,13 +335,17 @@ public class CraftChunk implements Chunk { PalettedContainerRO>[] biome = (includeBiome || includeBiomeTempRain) ? new PalettedContainer[cs.length] : null; Registry iregistry = this.worldServer.registryAccess().registryOrThrow(Registries.BIOME); @@ -31,7 +31,7 @@ index 545b14f02ac72dda30891d681eba585d19fd5e1d..d4e0ef75dd12709a0dcf9193821c30b8 LevelLightEngine lightengine = this.worldServer.getLightEngine(); DataLayer skyLightArray = lightengine.getLayerListener(LightLayer.SKY).getDataLayerData(SectionPos.of(this.x, chunk.getSectionYFromSectionIndex(i), this.z)); // SPIGOT-7498: Convert section index -@@ -316,8 +320,7 @@ public class CraftChunk implements Chunk { +@@ -360,8 +364,7 @@ public class CraftChunk implements Chunk { } if (biome != null) { diff --git a/patches/server/0677-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch b/patches/server/0677-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch index 558dc306f7..4d74f60751 100644 --- a/patches/server/0677-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch +++ b/patches/server/0677-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch @@ -8,10 +8,10 @@ This ensures at least a valid version of the chunk exists on disk, even if outdated diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -index f3d169436ce05f1c56599cfe15a56671b7d13516..4d5ab1771129114ef1e4745c43a4fd1813df2e30 100644 +index 140d6e455c1729f6e31e95facba5520b75ad838c..169e375c814ff814d15101d09dccc67783f50465 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -@@ -430,6 +430,7 @@ public class RegionFile implements AutoCloseable { +@@ -420,6 +420,7 @@ public class RegionFile implements AutoCloseable { } @@ -19,7 +19,7 @@ index f3d169436ce05f1c56599cfe15a56671b7d13516..4d5ab1771129114ef1e4745c43a4fd18 private class ChunkBuffer extends ByteArrayOutputStream { private final ChunkPos pos; -@@ -443,6 +444,23 @@ public class RegionFile implements AutoCloseable { +@@ -433,6 +434,23 @@ public class RegionFile implements AutoCloseable { super.write(RegionFile.this.version.getId()); this.pos = chunkcoordintpair; } @@ -44,10 +44,10 @@ index f3d169436ce05f1c56599cfe15a56671b7d13516..4d5ab1771129114ef1e4745c43a4fd18 public void close() throws IOException { ByteBuffer bytebuffer = ByteBuffer.wrap(this.buf, 0, this.count); diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index 6bcf61c287e6c9ee270279e78e38c7fcb17d453f..59441847d70075efc0fe9272532133872f49559c 100644 +index b5b7b73048eaadfe58961631427da7574d42f5e8..fa086a19f038b929f356292b2f657929765f7b6f 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -@@ -246,10 +246,17 @@ public class RegionFileStorage implements AutoCloseable { +@@ -145,10 +145,17 @@ public class RegionFileStorage implements AutoCloseable { try { NbtIo.write(nbt, (DataOutput) dataoutputstream); @@ -66,7 +66,7 @@ index 6bcf61c287e6c9ee270279e78e38c7fcb17d453f..59441847d70075efc0fe927253213387 } catch (Throwable throwable1) { throwable.addSuppressed(throwable1); } -@@ -257,10 +264,7 @@ public class RegionFileStorage implements AutoCloseable { +@@ -156,10 +163,7 @@ public class RegionFileStorage implements AutoCloseable { throw throwable; } @@ -78,7 +78,7 @@ index 6bcf61c287e6c9ee270279e78e38c7fcb17d453f..59441847d70075efc0fe927253213387 } // Paper start - Chunk save reattempt return; -@@ -308,4 +312,13 @@ public class RegionFileStorage implements AutoCloseable { +@@ -202,4 +206,13 @@ public class RegionFileStorage implements AutoCloseable { } } diff --git a/patches/server/0678-Forward-CraftEntity-in-teleport-command.patch b/patches/server/0678-Forward-CraftEntity-in-teleport-command.patch index 1b4de40b51..bc1ee77e66 100644 --- a/patches/server/0678-Forward-CraftEntity-in-teleport-command.patch +++ b/patches/server/0678-Forward-CraftEntity-in-teleport-command.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Forward CraftEntity in teleport command diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index ef4c3c7329f9d1172118ead69c959f788500906b..463887d7db1c43a24cea7ec8cc48a260be0f33f8 100644 +index 021d3803ffbf4fb0a6de92c13406c5316e09c4c1..f946e0194197febaf8a13ac1f26999ec70456e0b 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3296,6 +3296,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3244,6 +3244,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void restoreFrom(Entity original) { @@ -22,7 +22,7 @@ index ef4c3c7329f9d1172118ead69c959f788500906b..463887d7db1c43a24cea7ec8cc48a260 CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag()); nbttagcompound.remove("Dimension"); -@@ -3386,10 +3393,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3334,10 +3341,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } } // CraftBukkit end diff --git a/patches/server/0688-Validate-usernames.patch b/patches/server/0688-Validate-usernames.patch index 5f46c391be..f06e92bc13 100644 --- a/patches/server/0688-Validate-usernames.patch +++ b/patches/server/0688-Validate-usernames.patch @@ -26,7 +26,7 @@ index d4658328eeecb1c9e3e25eec14dea07e9e2a8b74..ebda34825bbd10145a81d54c345e31c2 GameProfile gameprofile = this.server.getSingleplayerProfile(); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index a4d2ddbb9cee1682fc5d91e90d2fd0b74a47aa3c..e67bcde933d8d64ca1d9d18b938f118994bf222b 100644 +index edeec3dd7887fbde9456e39c023d4a2dd9b6ffc5..f66f7e8070cbe7628a6e4ae69418fb863f684fae 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -678,7 +678,7 @@ public abstract class PlayerList { diff --git a/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch b/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch index f9ec2b868f..059408cd59 100644 --- a/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch +++ b/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose vanilla BiomeProvider from WorldInfo diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0fd9e6f740ce4224144f80027b7aa611bafc0827..30b017e730b48f395642231a8a60abd73ee46fc3 100644 +index 9568e922fb69ff516539aca27a599a4b2e8c647b..d5436fd2037e510ccbcb195036c5056bbc1b374f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -592,7 +592,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver)); LevelStem worlddimension = (LevelStem) dimensions.get(dimensionKey); @@ -18,10 +18,10 @@ index 0fd9e6f740ce4224144f80027b7aa611bafc0827..30b017e730b48f395642231a8a60abd7 biomeProvider = gen.getDefaultBiomeProvider(worldInfo); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 4517d82ea55e919f8a5ce16fde2d401053892fac..3356ebe129757b073c82de59cf67743a96526794 100644 +index 33a3a46e275a6583ca11dfd87bd9fb7e5b60914a..58d46f1a3f2b27d81fed6566e24ed0167d749751 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1258,7 +1258,7 @@ public final class CraftServer implements Server { +@@ -1260,7 +1260,7 @@ public final class CraftServer implements Server { List list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata)); LevelStem worlddimension = iregistry.get(actualDimension); @@ -31,7 +31,7 @@ index 4517d82ea55e919f8a5ce16fde2d401053892fac..3356ebe129757b073c82de59cf67743a biomeProvider = generator.getDefaultBiomeProvider(worldInfo); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a059b426e2d0280a318bd1c697056352b24ee9c3..6233e58820f12b6e0715a2f3c5ce448d24d864fc 100644 +index b3a48f238e64f4de3074b1a9d7882cd5b6adfba3..146dce90630325437ea57b0c496f6ac5e9fefc7a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -205,6 +205,29 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0696-Fix-xp-reward-for-baby-zombies.patch b/patches/server/0696-Fix-xp-reward-for-baby-zombies.patch index 4fa70dea18..f3c6e8841b 100644 --- a/patches/server/0696-Fix-xp-reward-for-baby-zombies.patch +++ b/patches/server/0696-Fix-xp-reward-for-baby-zombies.patch @@ -9,7 +9,7 @@ so this resets it after each call to Zombie#getExperienceReward diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index 5d0e587941253a051839ac7fa877bb3bc887f6b5..3fa43be16cc8d35622c269db37875b4bd0a09405 100644 +index a41a2ffe3b0af5c244a513c839829da3f86e5ed3..5c40e994007dbf46ebc12c1e6a6ca90379471b74 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java @@ -175,11 +175,16 @@ public class Zombie extends Monster { diff --git a/patches/server/0697-Multi-Block-Change-API-Implementation.patch b/patches/server/0697-Multi-Block-Change-API-Implementation.patch index 992864a023..be7d800878 100644 --- a/patches/server/0697-Multi-Block-Change-API-Implementation.patch +++ b/patches/server/0697-Multi-Block-Change-API-Implementation.patch @@ -24,10 +24,10 @@ index f96d61bdeb556665d6e6e5023f9d77fd82204e89..ccdc2345465313991f065e1176b58fb7 public void write(FriendlyByteBuf buf) { buf.writeLong(this.sectionPos.asLong()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 75d06c92de46a8cb374985435e89bb3b03962ee4..b6bf7cf5515400a1f241ebef6cc76073f0a93bfa 100644 +index 85dd644ca86895e91ba639ba4974a05290e4e061..1fe839581edc496826885937ab0e10ec0a056212 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -886,6 +886,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -844,6 +844,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(packet); } diff --git a/patches/server/0699-Freeze-Tick-Lock-API.patch b/patches/server/0699-Freeze-Tick-Lock-API.patch index d6371e1fcf..c665c14b51 100644 --- a/patches/server/0699-Freeze-Tick-Lock-API.patch +++ b/patches/server/0699-Freeze-Tick-Lock-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Freeze Tick Lock API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 463887d7db1c43a24cea7ec8cc48a260be0f33f8..9080d797463dee45587ac9b812da16b931d1e410 100644 +index f946e0194197febaf8a13ac1f26999ec70456e0b..b0c97b12d316463af8c581f5f15c5c5e567eb403 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -404,6 +404,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -16,7 +16,7 @@ index 463887d7db1c43a24cea7ec8cc48a260be0f33f8..9080d797463dee45587ac9b812da16b9 public void setOrigin(@javax.annotation.Nonnull Location location) { this.origin = location.toVector(); -@@ -803,7 +804,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -751,7 +752,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.setRemainingFireTicks(this.remainingFireTicks - 1); } @@ -25,7 +25,7 @@ index 463887d7db1c43a24cea7ec8cc48a260be0f33f8..9080d797463dee45587ac9b812da16b9 this.setTicksFrozen(0); this.level().levelEvent((Player) null, 1009, this.blockPosition, 1); } -@@ -2278,6 +2279,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2226,6 +2227,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (fromNetherPortal) { nbttagcompound.putBoolean("Paper.FromNetherPortal", true); } @@ -35,7 +35,7 @@ index 463887d7db1c43a24cea7ec8cc48a260be0f33f8..9080d797463dee45587ac9b812da16b9 // Paper end return nbttagcompound; } catch (Throwable throwable) { -@@ -2422,6 +2426,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2370,6 +2374,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (spawnReason == null) { spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT; } diff --git a/patches/server/0702-API-for-creating-command-sender-which-forwards-feedb.patch b/patches/server/0702-API-for-creating-command-sender-which-forwards-feedb.patch index 9c6bdd1e20..b241dc2eba 100644 --- a/patches/server/0702-API-for-creating-command-sender-which-forwards-feedb.patch +++ b/patches/server/0702-API-for-creating-command-sender-which-forwards-feedb.patch @@ -122,10 +122,10 @@ index 0000000000000000000000000000000000000000..e3a5f1ec376319bdfda87fa27ae217bf + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index aa4b4504c95826ed7b0dd6dae8388e2280bd1a23..e4b3456bccbb0a3a0d5115c3d47de15352a834ca 100644 +index 58d46f1a3f2b27d81fed6566e24ed0167d749751..0c7bfed8174b19797eda7cfcaf097d85dedeebaa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2110,6 +2110,13 @@ public final class CraftServer implements Server { +@@ -2105,6 +2105,13 @@ public final class CraftServer implements Server { return this.console.console; } diff --git a/patches/server/0703-Add-missing-structure-set-seed-configs.patch b/patches/server/0703-Add-missing-structure-set-seed-configs.patch index 2248ec3351..b6627026af 100644 --- a/patches/server/0703-Add-missing-structure-set-seed-configs.patch +++ b/patches/server/0703-Add-missing-structure-set-seed-configs.patch @@ -20,7 +20,7 @@ seeds/salts to the frequency reducer which has a similar effect. Co-authored-by: William Blake Galbreath diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -index f8306b4d0d1c0a4e7336bd5f99222f59920ab796..aa2a014f5451e780219415fffcb64a6e7cdf9b87 100644 +index 567103d635087bf894a8c0473baf03bdb5ff052f..f767c822a8e86ce689d40d12c4ef2db3829a97cc 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java @@ -568,7 +568,7 @@ public abstract class ChunkGenerator { diff --git a/patches/server/0704-Implement-regenerateChunk.patch b/patches/server/0704-Implement-regenerateChunk.patch index 593c5cbe31..5cf21d70a4 100644 --- a/patches/server/0704-Implement-regenerateChunk.patch +++ b/patches/server/0704-Implement-regenerateChunk.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement regenerateChunk Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 6233e58820f12b6e0715a2f3c5ce448d24d864fc..967ee7a4fed61d229599349d05f7a506aa26a3de 100644 +index 146dce90630325437ea57b0c496f6ac5e9fefc7a..1ae13f0a320160210bd830f990f44de1eef3d5da 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -144,6 +144,7 @@ import org.jetbrains.annotations.NotNull; diff --git a/patches/server/0706-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch b/patches/server/0706-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch index 2377250695..57275a5d74 100644 --- a/patches/server/0706-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch +++ b/patches/server/0706-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add missing Validate calls to CraftServer#getSpawnLimit Copies appropriate checks from CraftWorld#getSpawnLimit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e4b3456bccbb0a3a0d5115c3d47de15352a834ca..145da771363242db9c0460ac9815359740ffbb3b 100644 +index 0c7bfed8174b19797eda7cfcaf097d85dedeebaa..4331b58d553f1b1c3ffc3a980ee41c0a5bf11555 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2287,6 +2287,8 @@ public final class CraftServer implements Server { +@@ -2282,6 +2282,8 @@ public final class CraftServer implements Server { @Override public int getSpawnLimit(SpawnCategory spawnCategory) { // Paper start - Add mobcaps commands diff --git a/patches/server/0707-Add-GameEvent-tags.patch b/patches/server/0707-Add-GameEvent-tags.patch index 54063e4b78..22118e627a 100644 --- a/patches/server/0707-Add-GameEvent-tags.patch +++ b/patches/server/0707-Add-GameEvent-tags.patch @@ -46,10 +46,10 @@ index 0000000000000000000000000000000000000000..e7d9fd2702a1ce96596580fff8f5ee4f + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 145da771363242db9c0460ac9815359740ffbb3b..7233fd7a789e72b9fa978f9c23086e8a23270426 100644 +index 4331b58d553f1b1c3ffc3a980ee41c0a5bf11555..3e0fde65132d53413dcf2ea07c802de28322c6c3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2708,6 +2708,15 @@ public final class CraftServer implements Server { +@@ -2703,6 +2703,15 @@ public final class CraftServer implements Server { return (org.bukkit.Tag) new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey); } } @@ -65,7 +65,7 @@ index 145da771363242db9c0460ac9815359740ffbb3b..7233fd7a789e72b9fa978f9c23086e8a default -> throw new IllegalArgumentException(); } -@@ -2740,6 +2749,13 @@ public final class CraftServer implements Server { +@@ -2735,6 +2744,13 @@ public final class CraftServer implements Server { net.minecraft.core.Registry> entityTags = BuiltInRegistries.ENTITY_TYPE; return entityTags.getTags().map(pair -> (org.bukkit.Tag) new CraftEntityTag(entityTags, pair.getFirst())).collect(ImmutableList.toImmutableList()); } diff --git a/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch index 4f5bb791b0..18ec46d112 100644 --- a/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch +++ b/patches/server/0708-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch @@ -9,10 +9,10 @@ This might result in chunks loading far slower in the nether, for example. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 30b017e730b48f395642231a8a60abd73ee46fc3..ab108b28393b38ab666e6ada5663306fc8053402 100644 +index d5436fd2037e510ccbcb195036c5056bbc1b374f..0207c7f3cc3a3bc130011325a592483531e8c949 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1230,6 +1230,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 967ee7a4fed61d229599349d05f7a506aa26a3de..98a32754545bc8d27f3a10e8509c529e02bedee9 100644 +index 1ae13f0a320160210bd830f990f44de1eef3d5da..923782e94dfbac8a3270c15538e6b85bcaf8e8f2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1403,7 +1403,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1374,7 +1374,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { Preconditions.checkArgument(material != null, "Material cannot be null"); Preconditions.checkArgument(material.isBlock(), "Material.%s must be a block", material); @@ -28,7 +28,7 @@ index 967ee7a4fed61d229599349d05f7a506aa26a3de..98a32754545bc8d27f3a10e8509c529e return (FallingBlock) entity.getBukkitEntity(); } -@@ -1412,7 +1417,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1383,7 +1388,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { Preconditions.checkArgument(location != null, "Location cannot be null"); Preconditions.checkArgument(data != null, "BlockData cannot be null"); diff --git a/patches/server/0722-Don-t-allow-vehicle-movement-from-players-while-tele.patch b/patches/server/0722-Don-t-allow-vehicle-movement-from-players-while-tele.patch index 3d23d4c0b6..0f88f6565b 100644 --- a/patches/server/0722-Don-t-allow-vehicle-movement-from-players-while-tele.patch +++ b/patches/server/0722-Don-t-allow-vehicle-movement-from-players-while-tele.patch @@ -7,7 +7,7 @@ Bring the vehicle move packet behavior in line with the regular player move packet. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 5aa9f337e1e251485310436f87786b02d181bcbb..22d93d04d614ad68d12cddd2b7607a8988da0d3c 100644 +index 7fa4b7e5980d07ede8a3a7640f361dfa57d8927a..180635f6893cf027fdaeec251009e3f18fb5b9a7 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -465,6 +465,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0726-Fix-saving-in-unloadWorld.patch b/patches/server/0726-Fix-saving-in-unloadWorld.patch index 51a9cb25bf..b4b5d989db 100644 --- a/patches/server/0726-Fix-saving-in-unloadWorld.patch +++ b/patches/server/0726-Fix-saving-in-unloadWorld.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix saving in unloadWorld Change savingDisabled to false to ensure ServerLevel's saving logic gets called when unloadWorld is called with save = true diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3651cdff8b5a489d57ffd39470510e0f2e413f71..49a29b5a84fb2c2a18adfbf788f10e6912518bd7 100644 +index a56e8233170de3f95e547ec375f5d839303869fb..8f5fd0b973acde1ba0f49e6a6f3da7244d5cd296 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1336,7 +1336,7 @@ public final class CraftServer implements Server { +@@ -1331,7 +1331,7 @@ public final class CraftServer implements Server { try { if (save) { diff --git a/patches/server/0727-Buffer-OOB-setBlock-calls.patch b/patches/server/0727-Buffer-OOB-setBlock-calls.patch index 51a5d1943e..cc1368326b 100644 --- a/patches/server/0727-Buffer-OOB-setBlock-calls.patch +++ b/patches/server/0727-Buffer-OOB-setBlock-calls.patch @@ -13,7 +13,7 @@ we'll also only gen a trace for the first one, I see no real pressing need to generate more, given that that would *massively* negate this patch otherwise diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index 3f5ba2b2f01d8cc07c4200a60b1b08cb584b170e..1c2ec978f923521322aaec59b4e88d26d656b6cd 100644 +index 23dfc741b31cdc25265fb5daffcae63417102a41..d6a9a6bd95307837ea76c0cb07666641c5e942a6 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java @@ -296,6 +296,7 @@ public class WorldGenRegion implements WorldGenLevel { diff --git a/patches/server/0730-fix-player-loottables-running-when-mob-loot-gamerule.patch b/patches/server/0730-fix-player-loottables-running-when-mob-loot-gamerule.patch index 7e01b2803b..aaec4fa7a4 100644 --- a/patches/server/0730-fix-player-loottables-running-when-mob-loot-gamerule.patch +++ b/patches/server/0730-fix-player-loottables-running-when-mob-loot-gamerule.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix player loottables running when mob loot gamerule is false diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 20cdb362592714891d7676fbea6096dfe30447b0..2778c9a1d31f7798d6b536664418323f0f3c00cb 100644 +index 1287a714b50723a8512428d62c4d39edcc396ed9..f8cb091bb0424d05bfe71b2f56e1489b5f45b38c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -920,12 +920,14 @@ public class ServerPlayer extends Player { +@@ -876,12 +876,14 @@ public class ServerPlayer extends Player { } } } diff --git a/patches/server/0731-Ensure-entity-passenger-world-matches-ridden-entity.patch b/patches/server/0731-Ensure-entity-passenger-world-matches-ridden-entity.patch index 9ba3871a42..00ce9a1099 100644 --- a/patches/server/0731-Ensure-entity-passenger-world-matches-ridden-entity.patch +++ b/patches/server/0731-Ensure-entity-passenger-world-matches-ridden-entity.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Ensure entity passenger world matches ridden entity Bad plugins doing this would cause some obvious problems... diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 9080d797463dee45587ac9b812da16b931d1e410..4880185adc6df0232a1eb3298ae8332577205375 100644 +index b0c97b12d316463af8c581f5f15c5c5e567eb403..b580bb939f3c128ed68e02f2c75764aed49427c6 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2612,7 +2612,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2560,7 +2560,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public boolean startRiding(Entity entity, boolean force) { diff --git a/patches/server/0736-Prevent-tile-entity-copies-loading-chunks.patch b/patches/server/0736-Prevent-tile-entity-copies-loading-chunks.patch index 44efe882ca..d2a730f728 100644 --- a/patches/server/0736-Prevent-tile-entity-copies-loading-chunks.patch +++ b/patches/server/0736-Prevent-tile-entity-copies-loading-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent tile entity copies loading chunks diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 22d93d04d614ad68d12cddd2b7607a8988da0d3c..a5f4bc0160b073c0551107b382889031fed24d52 100644 +index 180635f6893cf027fdaeec251009e3f18fb5b9a7..ff3fc822898a6a9d1eb15be3881faab8a1d9016e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3118,7 +3118,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3111,7 +3111,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound); if (this.player.level().isLoaded(blockposition)) { diff --git a/patches/server/0737-Use-username-instead-of-display-name-in-PlayerList-g.patch b/patches/server/0737-Use-username-instead-of-display-name-in-PlayerList-g.patch index 552c2079bc..063b1192a8 100644 --- a/patches/server/0737-Use-username-instead-of-display-name-in-PlayerList-g.patch +++ b/patches/server/0737-Use-username-instead-of-display-name-in-PlayerList-g.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Use username instead of display name in diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d0037eaf1a1a256d3d7e2e309c476593a93f8273..4602f8a4f22eed417bf3c56f0147ed697e349f37 100644 +index a75e343a03627f1155361c98a45ed8fb66b0c4ec..5d56f1a38b898d5532a995ef7e3146f565e165d7 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1447,7 +1447,7 @@ public abstract class PlayerList { diff --git a/patches/server/0738-Pass-ServerLevel-for-gamerule-callbacks.patch b/patches/server/0738-Pass-ServerLevel-for-gamerule-callbacks.patch index d7ade8d2aa..3541c15f4c 100644 --- a/patches/server/0738-Pass-ServerLevel-for-gamerule-callbacks.patch +++ b/patches/server/0738-Pass-ServerLevel-for-gamerule-callbacks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Pass ServerLevel for gamerule callbacks diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 3cc0aa9fa1ba11d85ce07013de86ad6f89c52f67..46708de7fac39928f52119343fc05cb877235b05 100644 +index c39b19bee3aca093a2087e19875a50ff21cf1ab3..8d7d5cadbd65833d46dce71609e938290c81f772 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -304,7 +304,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -18,10 +18,10 @@ index 3cc0aa9fa1ba11d85ce07013de86ad6f89c52f67..46708de7fac39928f52119343fc05cb8 if (dedicatedserverproperties.enableQuery) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a5f4bc0160b073c0551107b382889031fed24d52..a08cf32d56b6f5491d2f2e8e9486a5d65ec9a825 100644 +index ff3fc822898a6a9d1eb15be3881faab8a1d9016e..b84d748953e03f1852c4edf3d8d9466f2bce67c6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2682,7 +2682,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2675,7 +2675,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player = this.server.getPlayerList().respawn(this.player, false, RespawnReason.DEATH); if (this.server.isHardcore()) { this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper - Expand PlayerGameModeChangeEvent @@ -167,10 +167,10 @@ index f3cdf1fa7731eb7bb1cb89aa6a37204d81257cb0..0112ef51815c4fab38b95d5e917d335e this.onChanged(server); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 98a32754545bc8d27f3a10e8509c529e02bedee9..561ed3b93ba09f17f0f263b90993a7b13ce3f468 100644 +index 923782e94dfbac8a3270c15538e6b85bcaf8e8f2..c35f5a1a42b76b154bfbb161d23348e76f676090 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1988,7 +1988,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1959,7 +1959,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper end - Add WorldGameRuleChangeEvent GameRules.Value handle = this.getHandle().getGameRules().getRule(CraftWorld.getGameRulesNMS().get(rule)); handle.deserialize(event.getValue()); // Paper - Add WorldGameRuleChangeEvent @@ -179,7 +179,7 @@ index 98a32754545bc8d27f3a10e8509c529e02bedee9..561ed3b93ba09f17f0f263b90993a7b1 return true; } -@@ -2029,7 +2029,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2000,7 +2000,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper end - Add WorldGameRuleChangeEvent GameRules.Value handle = this.getHandle().getGameRules().getRule(CraftWorld.getGameRulesNMS().get(rule.getName())); handle.deserialize(event.getValue()); // Paper - Add WorldGameRuleChangeEvent diff --git a/patches/server/0740-WorldCreator-keepSpawnLoaded.patch b/patches/server/0740-WorldCreator-keepSpawnLoaded.patch index b58bfdc439..50ef36da4b 100644 --- a/patches/server/0740-WorldCreator-keepSpawnLoaded.patch +++ b/patches/server/0740-WorldCreator-keepSpawnLoaded.patch @@ -5,10 +5,10 @@ Subject: [PATCH] WorldCreator#keepSpawnLoaded diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 49a29b5a84fb2c2a18adfbf788f10e6912518bd7..28b7694d3ff59cdad838382e207eff6fdc8face7 100644 +index 8f5fd0b973acde1ba0f49e6a6f3da7244d5cd296..1761fac48b832fc35cb916131587120e43ac0b08 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1283,7 +1283,7 @@ public final class CraftServer implements Server { +@@ -1278,7 +1278,7 @@ public final class CraftServer implements Server { ServerLevel internal = (ServerLevel) new ServerLevel(this.console, this.console.executor, worldSession, worlddata, worldKey, worlddimension, this.getServer().progressListenerFactory.create(11), worlddata.isDebugWorld(), j, creator.environment() == Environment.NORMAL ? list : ImmutableList.of(), true, this.console.overworld().getRandomSequences(), creator.environment(), generator, biomeProvider); @@ -17,11 +17,11 @@ index 49a29b5a84fb2c2a18adfbf788f10e6912518bd7..28b7694d3ff59cdad838382e207eff6f if (!(this.worlds.containsKey(name.toLowerCase(java.util.Locale.ENGLISH)))) { return null; -@@ -1295,6 +1295,7 @@ public final class CraftServer implements Server { +@@ -1290,6 +1290,7 @@ public final class CraftServer implements Server { internal.setSpawnSettings(true, true); // Paper - Put world into worldlist before initing the world; move up + internal.keepSpawnInMemory = creator.keepSpawnLoaded().toBooleanOrElse(internal.getWorld().getKeepSpawnInMemory()); // Paper this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal); - //internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API // Paper - rewrite chunk system + internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API diff --git a/patches/server/0747-Don-t-tick-markers.patch b/patches/server/0747-Don-t-tick-markers.patch index 8b52058308..6625ebb691 100644 --- a/patches/server/0747-Don-t-tick-markers.patch +++ b/patches/server/0747-Don-t-tick-markers.patch @@ -23,10 +23,10 @@ index ff99336e0b8131ae161cfa5c4fc83c6905e3dbc8..5e5a018433414af76eaa1e781f61612d } }); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 6ece18d5429217ee53ca5ae5c0eb7450aa5f63ec..9fffd60371500b05c009e0c8ac7d83126fbde866 100644 +index 2d0d1da27152654ab43aba0ffe51887137190a2e..7118f5734c08020cc23555fe84a6afdd7f456190 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2520,6 +2520,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2266,6 +2266,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } public void onTickingStart(Entity entity) { @@ -34,22 +34,3 @@ index 6ece18d5429217ee53ca5ae5c0eb7450aa5f63ec..9fffd60371500b05c009e0c8ac7d8312 ServerLevel.this.entityTickList.add(entity); } -diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index f60eb4bf10c32d2d92fa24992ed20525f0f0f781..dfbcddadea4a89c4cfc879105cfacae6dde742a9 100644 ---- a/src/main/java/org/spigotmc/ActivationRange.java -+++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -138,8 +138,14 @@ public class ActivationRange - - // Paper start - java.util.List entities = world.getEntities((Entity)null, ActivationRange.maxBB, null); -+ boolean tickMarkers = world.paperConfig().entities.markers.tick; // Paper - Configurable marker ticking - for (int i = 0; i < entities.size(); i++) { - Entity entity = entities.get(i); -+ // Paper start - Configurable marker ticking -+ if (!tickMarkers && entity instanceof net.minecraft.world.entity.Marker) { -+ continue; -+ } -+ // Paper end - Configurable marker ticking - ActivationRange.activateEntity(entity); - } - // Paper end diff --git a/patches/server/0750-Add-support-for-Proxy-Protocol.patch b/patches/server/0749-Add-support-for-Proxy-Protocol.patch similarity index 100% rename from patches/server/0750-Add-support-for-Proxy-Protocol.patch rename to patches/server/0749-Add-support-for-Proxy-Protocol.patch diff --git a/patches/server/0751-Fix-OfflinePlayer-getBedSpawnLocation.patch b/patches/server/0750-Fix-OfflinePlayer-getBedSpawnLocation.patch similarity index 100% rename from patches/server/0751-Fix-OfflinePlayer-getBedSpawnLocation.patch rename to patches/server/0750-Fix-OfflinePlayer-getBedSpawnLocation.patch diff --git a/patches/server/0399-Rewrite-chunk-system.patch b/patches/server/0751-Rewrite-chunk-system.patch similarity index 98% rename from patches/server/0399-Rewrite-chunk-system.patch rename to patches/server/0751-Rewrite-chunk-system.patch index fdcd150b7f..cf8d6ad719 100644 --- a/patches/server/0399-Rewrite-chunk-system.patch +++ b/patches/server/0751-Rewrite-chunk-system.patch @@ -924,7 +924,7 @@ index 499c069d64692872924963d3a7ac39664b20468d..ef8ea36b2acefb935afda01396d2699e public static final class LightQueue { diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java -index 38f01952153348d937e326da0ec102cd9b0f80af..1080e1f67afe5574baca0df50cdb1d029a7a586a 100644 +index 2d4090b95193de431f56eaafd4d4561ecccdf99c..a2f71a6d1a9e98133dff6cd0f625da9435a8af14 100644 --- a/src/main/java/co/aikar/timings/TimingsExport.java +++ b/src/main/java/co/aikar/timings/TimingsExport.java @@ -163,7 +163,11 @@ public class TimingsExport extends Thread { @@ -15282,13 +15282,13 @@ index 0000000000000000000000000000000000000000..f7b0e2564ac4bd2db1d2b2bdc230c9f5 + } +} diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index a27c90ea7af63b0d42f202ed1a7dab6e42daed9f..8ff2bcfa05641a022aceff66f2356744caa594da 100644 +index 1fd0854fb4f8ab3b5da3cda5ddd2535a0faa6adf..e2f433ddb7a34b721ba983db84f100aac953e3a4 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java -@@ -41,6 +41,7 @@ public final class PaperCommand extends Command { - commands.put(Set.of("fixlight"), new FixLightCommand()); +@@ -42,6 +42,7 @@ public final class PaperCommand extends Command { commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand()); commands.put(Set.of("dumpitem"), new DumpItemCommand()); + commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand()); + commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); return commands.entrySet().stream() @@ -16644,10 +16644,10 @@ index a5e438a834826161c52ca9db57d234d9ff80a591..b8bc1b9b8e8a33df90a963f9f9769292 @Override diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 5374a6b70a9780cfe9f62207b290b9a3ab82c7e9..0c9f6443663bc567a181393b13311a909602f4a4 100644 +index 7a5e70c99716273d04f4cd28d80a38f6f6b3868e..1cad3585ca122a465572b16d4ecbb7231e87c7de 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -305,6 +305,7 @@ public class Main { +@@ -315,6 +315,7 @@ public class Main { convertable_conversionsession.saveDataTag(iregistrycustom_dimension, savedata); */ @@ -16656,7 +16656,7 @@ index 5374a6b70a9780cfe9f62207b290b9a3ab82c7e9..0c9f6443663bc567a181393b13311a90 DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f03a2995c2eb080ec4db0d6c3aa261a463c08579..ca005f3c60e58a2ac3e391c9107023e982f33ffe 100644 +index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82cff8a37b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -309,7 +309,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop stream = entity.getSelfAndPassengers().map(Entity::getUUID); // CraftBukkit - decompile error @@ -20002,7 +20002,7 @@ index baafe984f2e015e20e57841b5009861cb0a02525..90fae050445fbebe44ec5ef77fdcac65 return false; } else { this.addFreshEntityWithPassengers(entity, reason); // CraftBukkit -@@ -1880,7 +2119,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1906,7 +2145,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } @@ -20011,7 +20011,7 @@ index baafe984f2e015e20e57841b5009861cb0a02525..90fae050445fbebe44ec5ef77fdcac65 bufferedwriter.write(String.format(Locale.ROOT, "block_entity_tickers: %d\n", this.blockEntityTickers.size())); bufferedwriter.write(String.format(Locale.ROOT, "block_ticks: %d\n", this.getBlockTicks().count())); bufferedwriter.write(String.format(Locale.ROOT, "fluid_ticks: %d\n", this.getFluidTicks().count())); -@@ -1929,7 +2168,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1955,7 +2194,7 @@ public class ServerLevel extends Level implements WorldGenLevel { BufferedWriter bufferedwriter2 = Files.newBufferedWriter(path1); try { @@ -20020,7 +20020,7 @@ index baafe984f2e015e20e57841b5009861cb0a02525..90fae050445fbebe44ec5ef77fdcac65 } catch (Throwable throwable4) { if (bufferedwriter2 != null) { try { -@@ -1950,7 +2189,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1976,7 +2215,7 @@ public class ServerLevel extends Level implements WorldGenLevel { BufferedWriter bufferedwriter3 = Files.newBufferedWriter(path2); try { @@ -20029,7 +20029,7 @@ index baafe984f2e015e20e57841b5009861cb0a02525..90fae050445fbebe44ec5ef77fdcac65 } catch (Throwable throwable6) { if (bufferedwriter3 != null) { try { -@@ -2092,7 +2331,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2118,7 +2357,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @VisibleForTesting public String getWatchdogStats() { @@ -20038,7 +20038,7 @@ index baafe984f2e015e20e57841b5009861cb0a02525..90fae050445fbebe44ec5ef77fdcac65 return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString(); }), this.blockEntityTickers.size(), ServerLevel.getTypeCount(this.blockEntityTickers, TickingBlockEntity::getType), this.getBlockTicks().count(), this.getFluidTicks().count(), this.gatherChunkSourceStats()); } -@@ -2152,15 +2391,15 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2178,15 +2417,15 @@ public class ServerLevel extends Level implements WorldGenLevel { @Override public LevelEntityGetter getEntities() { org.spigotmc.AsyncCatcher.catchOp("Chunk getEntities call"); // Spigot @@ -20059,7 +20059,7 @@ index baafe984f2e015e20e57841b5009861cb0a02525..90fae050445fbebe44ec5ef77fdcac65 } public void startTickingChunk(LevelChunk chunk) { -@@ -2176,34 +2415,49 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2202,34 +2441,49 @@ public class ServerLevel extends Level implements WorldGenLevel { @Override public void close() throws IOException { super.close(); @@ -20116,7 +20116,7 @@ index baafe984f2e015e20e57841b5009861cb0a02525..90fae050445fbebe44ec5ef77fdcac65 } @Override -@@ -2224,7 +2478,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2250,7 +2504,7 @@ public class ServerLevel extends Level implements WorldGenLevel { CrashReportCategory crashreportsystemdetails = super.fillReportDetails(report); crashreportsystemdetails.setDetail("Loaded entity count", () -> { @@ -20126,12 +20126,12 @@ index baafe984f2e015e20e57841b5009861cb0a02525..90fae050445fbebe44ec5ef77fdcac65 return crashreportsystemdetails; } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index c4e0fa6c24f9df0d99508ea7d6a9ed974f14835e..c449b40c2252829c5f5fa0978b3f9a41336d6318 100644 +index f8cb091bb0424d05bfe71b2f56e1489b5f45b38c..1ff1c03bad54dfd4aef681466b141b0a314a275c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -275,6 +275,50 @@ public class ServerPlayer extends Player { - public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper - public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent +@@ -277,6 +277,50 @@ public class ServerPlayer extends Player { + public @Nullable String clientBrandName = null; // Paper - Brand support + public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event + // Paper start - replace player chunk loader + private final java.util.concurrent.atomic.AtomicReference viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1)); @@ -20425,10 +20425,10 @@ index 6051e5f272838ef23276a90e21c2fc821ca155d1..658e63ebde81dc14c8ab5850fb246dc0 public static TicketType create(String name, Comparator argumentComparator) { return new TicketType<>(name, argumentComparator, 0L); diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index 23dfc741b31cdc25265fb5daffcae63417102a41..3f5ba2b2f01d8cc07c4200a60b1b08cb584b170e 100644 +index d6a9a6bd95307837ea76c0cb07666641c5e942a6..1c2ec978f923521322aaec59b4e88d26d656b6cd 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -@@ -525,4 +525,21 @@ public class WorldGenRegion implements WorldGenLevel { +@@ -534,4 +534,21 @@ public class WorldGenRegion implements WorldGenLevel { public long nextSubTickCount() { return this.subTickCount.getAndIncrement(); } @@ -20451,34 +20451,36 @@ index 23dfc741b31cdc25265fb5daffcae63417102a41..3f5ba2b2f01d8cc07c4200a60b1b08cb + // Paper end } diff --git a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java -index c509a1318bcef38fd4927e38b6ee9846853e2d15..5de5209e04d631bd6a50e28e8d3abebf148252c1 100644 +index 13209267c26f46492a92e820889a9be0bd2287a0..f3b96a921e7d085b51da62fa5493384a7ded1f9d 100644 --- a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java +++ b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java -@@ -42,14 +42,22 @@ public class PlayerChunkSender { - this.pendingChunks.add(chunk.getPos().toLong()); - } +@@ -44,17 +44,23 @@ public class PlayerChunkSender { -+ // Paper start - rewrite player chunk loader -+ public static void dropChunkStatic(ServerPlayer player, ChunkPos pos) { -+ player.serverLevel().chunkSource.chunkMap.getVisibleChunkIfPresent(pos.toLong()).removePlayer(player); -+ player.connection.send(new ClientboundForgetLevelChunkPacket(pos)); -+ } -+ // Paper end - rewrite player chunk loader -+ public void dropChunk(ServerPlayer player, ChunkPos pos) { if (!this.pendingChunks.remove(pos.toLong()) && player.isAlive()) { -- player.connection.send(new ClientboundForgetLevelChunkPacket(pos)); -+ dropChunkStatic(player, pos); // Paper - rewrite player chunk loader - move into own method - } - ++ // Paper start - rewrite player chunk loader ++ dropChunkStatic(player, pos); ++ } ++ } ++ public static void dropChunkStatic(ServerPlayer player, ChunkPos pos) { ++ player.serverLevel().chunkSource.chunkMap.getVisibleChunkIfPresent(pos.toLong()).removePlayer(player); + player.connection.send(new ClientboundForgetLevelChunkPacket(pos)); + // Paper start - PlayerChunkUnloadEvent + if (io.papermc.paper.event.packet.PlayerChunkUnloadEvent.getHandlerList().getRegisteredListeners().length > 0) { + new io.papermc.paper.event.packet.PlayerChunkUnloadEvent(player.getBukkitEntity().getWorld().getChunkAt(pos.longKey), player.getBukkitEntity()).callEvent(); + } + // Paper end - PlayerChunkUnloadEvent +- } +- } ++ // Paper end - rewrite player chunk loader public void sendNextChunks(ServerPlayer player) { + if (true) return; // Paper - rewrite player chunk loader if (this.unacknowledgedBatches < this.maxUnacknowledgedBatches) { float f = Math.max(1.0F, this.desiredChunksPerTick); this.batchQuota = Math.min(this.batchQuota + this.desiredChunksPerTick, f); -@@ -75,7 +83,8 @@ public class PlayerChunkSender { +@@ -80,7 +86,8 @@ public class PlayerChunkSender { } } @@ -20486,9 +20488,9 @@ index c509a1318bcef38fd4927e38b6ee9846853e2d15..5de5209e04d631bd6a50e28e8d3abebf + public static void sendChunk(ServerGamePacketListenerImpl handler, ServerLevel world, LevelChunk chunk) { // Paper - rewrite chunk loader - public + handler.player.serverLevel().chunkSource.chunkMap.getVisibleChunkIfPresent(chunk.getPos().toLong()).addPlayer(handler.player); handler.send(new ClientboundLevelChunkWithLightPacket(chunk, world.getLightEngine(), (BitSet)null, (BitSet)null)); - ChunkPos chunkPos = chunk.getPos(); - DebugPackets.sendPoiPacketsForChunk(world, chunkPos); -@@ -100,6 +109,7 @@ public class PlayerChunkSender { + // Paper start - PlayerChunkLoadEvent + if (io.papermc.paper.event.packet.PlayerChunkLoadEvent.getHandlerList().getRegisteredListeners().length > 0) { +@@ -110,6 +117,7 @@ public class PlayerChunkSender { } public void onChunkBatchReceivedByClient(float desiredBatchSize) { @@ -20497,28 +20499,28 @@ index c509a1318bcef38fd4927e38b6ee9846853e2d15..5de5209e04d631bd6a50e28e8d3abebf this.desiredChunksPerTick = Double.isNaN((double)desiredBatchSize) ? 0.01F : Mth.clamp(desiredBatchSize, 0.01F, 64.0F); if (this.unacknowledgedBatches == 0) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 48fca15cdc6b0bafc3d8ff13cc96b3258104c1fb..2f8715e200b9b8ae4c4b70ddd7cdc3368a109939 100644 +index b84d748953e03f1852c4edf3d8d9466f2bce67c6..2bca2ae3688a36ee0e7c951f3ced39606dc4e456 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -714,6 +714,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam"))); // Paper - AsyncTabCompleteEvent +@@ -736,6 +736,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl return; } -+ // Paper start -+ String str = packet.getCommand(); int index = -1; -+ if (str.length() > 64 && ((index = str.indexOf(' ')) == -1 || index >= 64)) { -+ server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam"))); // Paper + // Paper end - Don't suggest if tab-complete is disabled ++ // Paper start - rewrite chunk system ++ int index; ++ if (packet.getCommand().length() > 64 && ((index = packet.getCommand().indexOf(' ')) == -1 || index >= 64)) { ++ server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); + return; + } -+ // Paper end - // CraftBukkit end ++ // Paper end - rewrite chunk system // Paper start - AsyncTabCompleteEvent TAB_COMPLETE_EXECUTOR.execute(() -> { + StringReader stringreader = new StringReader(packet.getCommand()); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index a35dda4010c6db1a8e1efb7951ac8732d9a1e16e..172d7c3df8f9aab24d49b2ff12e3cdf5f40727f9 100644 +index 5d56f1a38b898d5532a995ef7e3146f565e165d7..4602f8a4f22eed417bf3c56f0147ed697e349f37 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -292,7 +292,7 @@ public abstract class PlayerList { +@@ -293,7 +293,7 @@ public abstract class PlayerList { boolean flag2 = gamerules.getBoolean(GameRules.RULE_LIMITED_CRAFTING); // Spigot - view distance @@ -20527,7 +20529,7 @@ index a35dda4010c6db1a8e1efb7951ac8732d9a1e16e..172d7c3df8f9aab24d49b2ff12e3cdf5 player.getBukkitEntity().sendSupportedChannels(); // CraftBukkit playerconnection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); playerconnection.send(new ClientboundPlayerAbilitiesPacket(player.getAbilities())); -@@ -881,8 +881,8 @@ public abstract class PlayerList { +@@ -927,8 +927,8 @@ public abstract class PlayerList { LevelData worlddata = worldserver2.getLevelData(); entityplayer1.connection.send(new ClientboundRespawnPacket(entityplayer1.createCommonSpawnInfo(worldserver2), (byte) i)); @@ -20538,7 +20540,7 @@ index a35dda4010c6db1a8e1efb7951ac8732d9a1e16e..172d7c3df8f9aab24d49b2ff12e3cdf5 entityplayer1.connection.teleport(CraftLocation.toBukkit(entityplayer1.position(), worldserver2.getWorld(), entityplayer1.getYRot(), entityplayer1.getXRot())); // CraftBukkit entityplayer1.connection.send(new ClientboundSetDefaultSpawnPositionPacket(worldserver1.getSharedSpawnPos(), worldserver1.getSharedSpawnAngle())); entityplayer1.connection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); -@@ -1433,7 +1433,7 @@ public abstract class PlayerList { +@@ -1492,7 +1492,7 @@ public abstract class PlayerList { public void setViewDistance(int viewDistance) { this.viewDistance = viewDistance; @@ -20547,7 +20549,7 @@ index a35dda4010c6db1a8e1efb7951ac8732d9a1e16e..172d7c3df8f9aab24d49b2ff12e3cdf5 Iterator iterator = this.server.getAllLevels().iterator(); while (iterator.hasNext()) { -@@ -1448,7 +1448,7 @@ public abstract class PlayerList { +@@ -1507,7 +1507,7 @@ public abstract class PlayerList { public void setSimulationDistance(int simulationDistance) { this.simulationDistance = simulationDistance; @@ -20666,10 +20668,10 @@ index 640db9f71608310a64e09f1e3e677c01e6ccd98a..f2a7cb6ebed7a4b4019a09af2a025f62 if (flag1) { ++this.converted; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 70380d5807cac6dec19ebe581d685b1e32d8830b..b5a39909c21888cef3f967435ff89a20fed00d02 100644 +index b580bb939f3c128ed68e02f2c75764aed49427c6..1c47ebb00421d8d690a85fcca2ae2db0ff8250b0 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -433,6 +433,58 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -465,6 +465,58 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } // Paper end @@ -20728,7 +20730,7 @@ index 70380d5807cac6dec19ebe581d685b1e32d8830b..b5a39909c21888cef3f967435ff89a20 public Entity(EntityType type, Level world) { this.id = Entity.ENTITY_COUNTER.incrementAndGet(); this.passengers = ImmutableList.of(); -@@ -2442,11 +2494,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2505,11 +2557,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return InteractionResult.PASS; } @@ -20742,7 +20744,7 @@ index 70380d5807cac6dec19ebe581d685b1e32d8830b..b5a39909c21888cef3f967435ff89a20 return false; } -@@ -3802,6 +3854,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3909,6 +3961,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S }).count(); } @@ -20750,16 +20752,13 @@ index 70380d5807cac6dec19ebe581d685b1e32d8830b..b5a39909c21888cef3f967435ff89a20 + public boolean hasAnyPlayerPassengers() { + // copied from below + if (this.passengers.isEmpty()) { return false; } -+ return this.getIndirectPassengersStream().anyMatch((entity) -> { -+ return entity instanceof Player; -+ }); ++ return this.getIndirectPassengersStream().anyMatch((entity) -> entity instanceof Player); + } + // Paper end - rewrite chunk system -+ public boolean hasExactlyOnePlayerPassenger() { + if (this.passengers.isEmpty()) { return false; } // Paper - Optimize indirect passenger iteration return this.countPlayerPassengers() == 1; - } -@@ -4153,6 +4215,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4261,6 +4320,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return; } // Paper end - Block invalid positions and bounding box @@ -20769,10 +20768,10 @@ index 70380d5807cac6dec19ebe581d685b1e32d8830b..b5a39909c21888cef3f967435ff89a20 + return; + } + // Paper end - rewrite chunk system - if (this.position.x != x || this.position.y != y || this.position.z != z) { - this.position = new Vec3(x, y, z); - int i = Mth.floor(x); -@@ -4266,6 +4334,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S + // Paper start - Fix MC-4 + if (this instanceof ItemEntity) { + if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.fixEntityPositionDesync) { +@@ -4384,6 +4449,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @Override public final void setRemoved(Entity.RemovalReason reason) { @@ -20786,7 +20785,7 @@ index 70380d5807cac6dec19ebe581d685b1e32d8830b..b5a39909c21888cef3f967435ff89a20 if (this.removalReason == null) { this.removalReason = reason; } -@@ -4274,7 +4349,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4392,7 +4464,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.stopRiding(); } @@ -20795,7 +20794,7 @@ index 70380d5807cac6dec19ebe581d685b1e32d8830b..b5a39909c21888cef3f967435ff89a20 this.levelCallback.onRemove(reason); } -@@ -4289,7 +4364,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4407,7 +4479,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @Override public boolean shouldBeSaved() { @@ -21079,10 +21078,10 @@ index e7b6f97d8519a5797903664e5ba2a793e37a4bfc..dbdf124638c35510aa0040100c4d80d6 List getEntities(EntityTypeTest filter, AABB box, Predicate predicate); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 3f1c0f3b879bf562db2b999dd39a3ce37759775d..d6ba5b4f91ba4297f8cdae03b50ba5188702d77f 100644 +index e8b9050f9abe6f269aab775bb12993bcf18aff2a..8c4d618a6641c38d6df1d320a1945cd006b40280 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -533,6 +533,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -549,6 +549,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || (chunk.getFullStatus() != null && chunk.getFullStatus().isOrAfter(FullChunkStatus.BLOCK_TICKING)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement this.sendBlockUpdated(blockposition, iblockdata1, iblockdata, i); @@ -21094,7 +21093,7 @@ index 3f1c0f3b879bf562db2b999dd39a3ce37759775d..d6ba5b4f91ba4297f8cdae03b50ba518 } if ((i & 1) != 0) { -@@ -922,7 +927,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -938,7 +943,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } // Paper end - Perf: Optimize capturedTileEntities lookup // CraftBukkit end @@ -21103,7 +21102,7 @@ index 3f1c0f3b879bf562db2b999dd39a3ce37759775d..d6ba5b4f91ba4297f8cdae03b50ba518 } public void setBlockEntity(BlockEntity blockEntity) { -@@ -1013,26 +1018,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1029,26 +1034,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public List getEntities(@Nullable Entity except, AABB box, Predicate predicate) { this.getProfiler().incrementCounter("getEntities"); List list = Lists.newArrayList(); @@ -21131,7 +21130,7 @@ index 3f1c0f3b879bf562db2b999dd39a3ce37759775d..d6ba5b4f91ba4297f8cdae03b50ba518 return list; } -@@ -1050,34 +1036,23 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1066,34 +1052,23 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public void getEntities(EntityTypeTest filter, AABB box, Predicate predicate, List result, int limit) { this.getProfiler().incrementCounter("getEntities"); @@ -21182,7 +21181,7 @@ index 3f1c0f3b879bf562db2b999dd39a3ce37759775d..d6ba5b4f91ba4297f8cdae03b50ba518 } @Nullable -@@ -1359,4 +1334,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1375,4 +1350,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent } // Paper end - respect global sound events gamerule @@ -21249,7 +21248,7 @@ index cc0d20e9f851268fe8403ac516f426ec1d008150..12eaafdbd324fa36b3f46c3b644bc811 @Nullable default ChunkAccess getChunkIfLoadedImmediately(BlockPos pos) { return this.getChunkIfLoadedImmediately(pos.getX() >> 4, pos.getZ() >> 4);} diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -index 3e57142dd9cb23d43857d5a4cb30962e4b696b74..1eacb6998f99833441dd1dcb8301f25759675f53 100644 +index f767c822a8e86ce689d40d12c4ef2db3829a97cc..aa2a014f5451e780219415fffcb64a6e7cdf9b87 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java @@ -114,7 +114,7 @@ public abstract class ChunkGenerator { @@ -21261,7 +21260,7 @@ index 3e57142dd9cb23d43857d5a4cb30962e4b696b74..1eacb6998f99833441dd1dcb8301f257 } public abstract void applyCarvers(WorldGenRegion chunkRegion, long seed, RandomState noiseConfig, BiomeManager biomeAccess, StructureManager structureAccessor, ChunkAccess chunk, GenerationStep.Carving carverStep); -@@ -288,7 +288,7 @@ public abstract class ChunkGenerator { +@@ -306,7 +306,7 @@ public abstract class ChunkGenerator { return Pair.of(placement.getLocatePos(pos), holder); } @@ -21523,10 +21522,10 @@ index 73e682bb3ef3b2e450ec8c594b5365c7a340615e..6a5756bd333d9b221e7770842e5114d2 public void setFullStatus(Supplier levelTypeProvider) { diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..c1ca83446bb4ccc7c1cb0f5e071850ce15657a69 100644 +index 7ca4790d564846c1ab9560e349005eea8aef35b8..279da8d43f16b4c1372d0d427891389fb7b6c780 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -@@ -106,7 +106,24 @@ public class ChunkSerializer { +@@ -110,6 +110,17 @@ public class ChunkSerializer { } } // Paper end - guard against serializing mismatching coordinates @@ -21542,6 +21541,12 @@ index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..c1ca83446bb4ccc7c1cb0f5e071850ce + } + } public static ProtoChunk read(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt) { + // Paper start - Do not let the server load chunks from newer versions + if (nbt.contains("DataVersion", net.minecraft.nbt.Tag.TAG_ANY_NUMERIC)) { +@@ -120,6 +131,12 @@ public class ChunkSerializer { + } + } + // Paper end - Do not let the server load chunks from newer versions + InProgressChunkHolder holder = readInProgressChunkHolder(world, poiStorage, chunkPos, nbt); + return holder.protoChunk; + } @@ -21551,7 +21556,7 @@ index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..c1ca83446bb4ccc7c1cb0f5e071850ce ChunkPos chunkcoordintpair1 = new ChunkPos(nbt.getInt("xPos"), nbt.getInt("zPos")); // Paper - guard against serializing mismatching coordinates; diff on change, see ChunkSerializer#getChunkCoordinate if (!Objects.equals(chunkPos, chunkcoordintpair1)) { -@@ -172,7 +189,7 @@ public class ChunkSerializer { +@@ -185,7 +202,7 @@ public class ChunkSerializer { achunksection[k] = chunksection; SectionPos sectionposition = SectionPos.of(chunkPos, b0); @@ -21560,7 +21565,7 @@ index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..c1ca83446bb4ccc7c1cb0f5e071850ce } boolean flag3 = nbttagcompound1.contains("BlockLight", 7); -@@ -318,7 +335,7 @@ public class ChunkSerializer { +@@ -331,7 +348,7 @@ public class ChunkSerializer { } if (chunkstatus_type == ChunkStatus.ChunkType.LEVELCHUNK) { @@ -21569,7 +21574,7 @@ index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..c1ca83446bb4ccc7c1cb0f5e071850ce } else { ProtoChunk protochunk1 = (ProtoChunk) object1; -@@ -346,9 +363,41 @@ public class ChunkSerializer { +@@ -359,9 +376,41 @@ public class ChunkSerializer { protochunk1.setCarvingMask(worldgenstage_features, new CarvingMask(nbttagcompound5.getLongArray(s1), ((ChunkAccess) object1).getMinBuildHeight())); } @@ -21612,7 +21617,7 @@ index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..c1ca83446bb4ccc7c1cb0f5e071850ce private static void logErrors(ChunkPos chunkPos, int y, String message) { ChunkSerializer.LOGGER.error("Recoverable errors when loading section [" + chunkPos.x + ", " + y + ", " + chunkPos.z + "]: " + message); -@@ -365,6 +414,11 @@ public class ChunkSerializer { +@@ -378,6 +427,11 @@ public class ChunkSerializer { // CraftBukkit end public static CompoundTag write(ServerLevel world, ChunkAccess chunk) { @@ -21624,7 +21629,7 @@ index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..c1ca83446bb4ccc7c1cb0f5e071850ce // Paper start - rewrite light impl final int minSection = io.papermc.paper.util.WorldUtil.getMinLightSection(world); final int maxSection = io.papermc.paper.util.WorldUtil.getMaxLightSection(world); -@@ -377,7 +431,7 @@ public class ChunkSerializer { +@@ -390,7 +444,7 @@ public class ChunkSerializer { nbttagcompound.putInt("xPos", chunkcoordintpair.x); nbttagcompound.putInt("yPos", chunk.getMinSection()); nbttagcompound.putInt("zPos", chunkcoordintpair.z); @@ -21633,7 +21638,7 @@ index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..c1ca83446bb4ccc7c1cb0f5e071850ce nbttagcompound.putLong("InhabitedTime", chunk.getInhabitedTime()); nbttagcompound.putString("Status", BuiltInRegistries.CHUNK_STATUS.getKey(chunk.getStatus()).toString()); BlendingData blendingdata = chunk.getBlendingData(); -@@ -477,8 +531,17 @@ public class ChunkSerializer { +@@ -490,8 +544,17 @@ public class ChunkSerializer { nbttagcompound.putBoolean("isLightOn", false); // Paper - set to false but still store, this allows us to detect --eraseCache (as eraseCache _removes_) } @@ -21653,7 +21658,7 @@ index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..c1ca83446bb4ccc7c1cb0f5e071850ce CompoundTag nbttagcompound2; -@@ -514,7 +577,14 @@ public class ChunkSerializer { +@@ -527,7 +590,14 @@ public class ChunkSerializer { nbttagcompound.put("CarvingMasks", nbttagcompound2); } @@ -21668,7 +21673,7 @@ index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..c1ca83446bb4ccc7c1cb0f5e071850ce nbttagcompound.put("PostProcessing", ChunkSerializer.packOffsets(chunk.getPostProcessing())); CompoundTag nbttagcompound3 = new CompoundTag(); Iterator iterator1 = chunk.getHeightmaps().iterator(); -@@ -570,7 +640,7 @@ public class ChunkSerializer { +@@ -583,7 +653,7 @@ public class ChunkSerializer { return nbttaglist == null && nbttaglist1 == null ? null : (chunk) -> { if (nbttaglist != null) { @@ -21678,49 +21683,47 @@ index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..c1ca83446bb4ccc7c1cb0f5e071850ce if (nbttaglist1 != null) { diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java -index ab6b4491d4278b3839b7363d9890bd12a757e4cc..4892edc56ea89c57dbeb4d6f2b67b8cec3aa7deb 100644 +index eebaf98bc0fa4696af59b2a79563beb73501a554..645a1773237f2002c233ec1f3ff6f0ca46ca4024 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java -@@ -28,26 +28,33 @@ import net.minecraft.world.level.storage.DimensionDataStorage; +@@ -28,18 +28,21 @@ import net.minecraft.world.level.storage.DimensionDataStorage; public class ChunkStorage implements AutoCloseable { public static final int LAST_MONOLYTH_STRUCTURE_DATA_VERSION = 1493; - private final IOWorker worker; -+ // Paper - nuke IO worker ++ // Paper start - rewrite chunk system; async chunk IO ++ private final Object persistentDataLock = new Object(); ++ public final RegionFileStorage regionFileCache; ++ // Paper end - rewrite chunk system protected final DataFixer fixerUpper; @Nullable private volatile LegacyStructureDataHandler legacyStructureHandler; -+ // Paper start - async chunk loading -+ private final Object persistentDataLock = new Object(); // Paper -+ public final RegionFileStorage regionFileCache; -+ // Paper end - async chunk loading public ChunkStorage(Path directory, DataFixer dataFixer, boolean dsync) { this.fixerUpper = dataFixer; - this.worker = new IOWorker(directory, dsync, "chunk"); -+ // Paper start - async chunk io -+ // remove IO worker -+ this.regionFileCache = new RegionFileStorage(directory, dsync); // Paper - nuke IOWorker -+ // Paper end - async chunk io ++ this.regionFileCache = new RegionFileStorage(directory, dsync); // Paper - rewrite chunk system; async chunk IO } public boolean isOldChunkAround(ChunkPos chunkPos, int checkRadius) { - return this.worker.isOldChunkAround(chunkPos, checkRadius); -+ return true; // Paper - (for now, old unoptimised behavior) TODO implement later? the chunk status that blender uses SHOULD already have this radius loaded, no need to go back for it... ++ return true; // Paper - rewrite chunk system; (for now, unoptimised behavior) TODO implement later? the chunk status that blender uses SHOULD already have this radius loaded, no need to go back later for it... } // CraftBukkit start - private boolean check(ServerChunkCache cps, int x, int z) { +@@ -47,8 +50,9 @@ public class ChunkStorage implements AutoCloseable { + if (true) return true; // Paper - Perf: this isn't even needed anymore, light is purged updating to 1.14+, why are we holding up the conversion process reading chunk data off disk - return true, we need to set light populated to true so the converter recognizes the chunk as being "full" ChunkPos pos = new ChunkPos(x, z); if (cps != null) { - com.google.common.base.Preconditions.checkState(org.bukkit.Bukkit.isPrimaryThread(), "primary thread"); - if (cps.hasChunk(x, z)) { -+ //com.google.common.base.Preconditions.checkState(org.bukkit.Bukkit.isPrimaryThread(), "primary thread"); // Paper - this function is now MT-Safe -+ if (cps.getChunkAtIfCachedImmediately(x, z) != null) { // Paper - isLoaded is a ticket level check, not a chunk loaded check! ++ // Paper start - rewrite chunk system; async chunk IO ++ if (cps.getChunkAtIfCachedImmediately(x, z) != null) { // isLoaded is a ticket level check, not a chunk loaded check! ++ // Paper end - rewrite chunk system return true; } } -@@ -75,6 +82,7 @@ public class ChunkStorage implements AutoCloseable { +@@ -76,6 +80,7 @@ public class ChunkStorage implements AutoCloseable { public CompoundTag upgradeChunkTag(ResourceKey resourcekey, Supplier supplier, CompoundTag nbttagcompound, Optional>> optional, ChunkPos pos, @Nullable LevelAccessor generatoraccess) { // CraftBukkit end @@ -21728,7 +21731,7 @@ index ab6b4491d4278b3839b7363d9890bd12a757e4cc..4892edc56ea89c57dbeb4d6f2b67b8ce int i = ChunkStorage.getVersion(nbttagcompound); // CraftBukkit start -@@ -92,9 +100,11 @@ public class ChunkStorage implements AutoCloseable { +@@ -93,9 +98,11 @@ public class ChunkStorage implements AutoCloseable { if (i < 1493) { ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.CHUNK, nbttagcompound, i, 1493); // Paper - replace chunk converter if (nbttagcompound.getCompound("Level").getBoolean("hasLegacyStructureData")) { @@ -21740,7 +21743,7 @@ index ab6b4491d4278b3839b7363d9890bd12a757e4cc..4892edc56ea89c57dbeb4d6f2b67b8ce } } -@@ -127,7 +137,7 @@ public class ChunkStorage implements AutoCloseable { +@@ -128,7 +135,7 @@ public class ChunkStorage implements AutoCloseable { LegacyStructureDataHandler persistentstructurelegacy = this.legacyStructureHandler; if (persistentstructurelegacy == null) { @@ -21749,7 +21752,7 @@ index ab6b4491d4278b3839b7363d9890bd12a757e4cc..4892edc56ea89c57dbeb4d6f2b67b8ce persistentstructurelegacy = this.legacyStructureHandler; if (persistentstructurelegacy == null) { this.legacyStructureHandler = persistentstructurelegacy = LegacyStructureDataHandler.getLegacyStructureHandler(worldKey, (DimensionDataStorage) stateManagerGetter.get()); -@@ -153,10 +163,20 @@ public class ChunkStorage implements AutoCloseable { +@@ -154,10 +161,20 @@ public class ChunkStorage implements AutoCloseable { } public CompletableFuture> read(ChunkPos chunkPos) { @@ -21772,7 +21775,7 @@ index ab6b4491d4278b3839b7363d9890bd12a757e4cc..4892edc56ea89c57dbeb4d6f2b67b8ce // Paper start - guard against serializing mismatching coordinates if (nbt != null && !chunkPos.equals(ChunkSerializer.getChunkCoordinate(nbt))) { final String world = (this instanceof net.minecraft.server.level.ChunkMap) ? ((net.minecraft.server.level.ChunkMap) this).level.getWorld().getName() : null; -@@ -164,22 +184,33 @@ public class ChunkStorage implements AutoCloseable { +@@ -165,22 +182,33 @@ public class ChunkStorage implements AutoCloseable { + " but compound says coordinate is " + ChunkSerializer.getChunkCoordinate(nbt) + (world == null ? " for an unknown world" : (" for world: " + world))); } // Paper end - guard against serializing mismatching coordinates @@ -21968,7 +21971,7 @@ index 98b3909b536f11eda9c481ffd74066ad0cdb0ebc..0ec0be22f7292d57c40da6f1f4575bde } } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -index 140d6e455c1729f6e31e95facba5520b75ad838c..f3d169436ce05f1c56599cfe15a56671b7d13516 100644 +index 169e375c814ff814d15101d09dccc67783f50465..4d5ab1771129114ef1e4745c43a4fd1813df2e30 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java @@ -44,6 +44,7 @@ public class RegionFile implements AutoCloseable { @@ -22012,7 +22015,7 @@ index 140d6e455c1729f6e31e95facba5520b75ad838c..f3d169436ce05f1c56599cfe15a56671 } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index b5b7b73048eaadfe58961631427da7574d42f5e8..bebcda728952bc0a644b401cd8e003761681e441 100644 +index fa086a19f038b929f356292b2f657929765f7b6f..f1ecc3832da094400ed9d45bfc60af10da682b4a 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java @@ -25,30 +25,98 @@ public class RegionFileStorage implements AutoCloseable { @@ -22158,7 +22161,7 @@ index b5b7b73048eaadfe58961631427da7574d42f5e8..bebcda728952bc0a644b401cd8e00376 // Paper start - Chunk save reattempt int attempts = 0; Exception lastException = null; -@@ -173,9 +251,14 @@ public class RegionFileStorage implements AutoCloseable { +@@ -177,9 +255,14 @@ public class RegionFileStorage implements AutoCloseable { net.minecraft.server.MinecraftServer.LOGGER.error("Failed to save chunk {}", pos, lastException); } // Paper end - Chunk save reattempt @@ -22174,7 +22177,7 @@ index b5b7b73048eaadfe58961631427da7574d42f5e8..bebcda728952bc0a644b401cd8e00376 ExceptionCollector exceptionsuppressor = new ExceptionCollector<>(); ObjectIterator objectiterator = this.regionCache.values().iterator(); -@@ -192,7 +275,7 @@ public class RegionFileStorage implements AutoCloseable { +@@ -196,7 +279,7 @@ public class RegionFileStorage implements AutoCloseable { exceptionsuppressor.throwIfPresent(); } @@ -22614,7 +22617,7 @@ index 9f6c2e5b5d9e8d714a47c770e255d06c0ef7c190..ac807277a6b26d140ea9873d17c7aa4f for(SavedTick savedTick : this.pendingTicks) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index e38643853220cabeac6c30912a9ae4bc1c018d5f..545b14f02ac72dda30891d681eba585d19fd5e1d 100644 +index 1eff5e4800ad3b628a42113fb3ba67458e56a40d..d4e0ef75dd12709a0dcf9193821c30b8943e6c36 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -113,7 +113,7 @@ public class CraftChunk implements Chunk { @@ -22680,19 +22683,18 @@ index e38643853220cabeac6c30912a9ae4bc1c018d5f..545b14f02ac72dda30891d681eba585d @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3aa481599811af7cd9b0c523f66dac469105ee49..c94bc27ef76ee94d5541e5ff2dcdaa176d91cb5e 100644 +index 1761fac48b832fc35cb916131587120e43ac0b08..1a92659da8a6064ab4f54d5e9861633b6b46a8bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1280,7 +1280,7 @@ public final class CraftServer implements Server { - this.console.addLevel(internal); +@@ -1292,7 +1292,6 @@ public final class CraftServer implements Server { + internal.keepSpawnInMemory = creator.keepSpawnLoaded().toBooleanOrElse(internal.getWorld().getKeepSpawnInMemory()); // Paper this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal); - internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API -+ //internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API // Paper - rewrite chunk system this.pluginManager.callEvent(new WorldLoadEvent(internal.getWorld())); return internal.getWorld(); -@@ -1324,7 +1324,7 @@ public final class CraftServer implements Server { +@@ -1336,7 +1335,7 @@ public final class CraftServer implements Server { } handle.getChunkSource().close(save); @@ -22701,7 +22703,7 @@ index 3aa481599811af7cd9b0c523f66dac469105ee49..c94bc27ef76ee94d5541e5ff2dcdaa17 handle.convertable.close(); } catch (Exception ex) { this.getLogger().log(Level.SEVERE, null, ex); -@@ -2239,7 +2239,7 @@ public final class CraftServer implements Server { +@@ -2296,7 +2295,7 @@ public final class CraftServer implements Server { @Override public boolean isPrimaryThread() { @@ -22711,10 +22713,10 @@ index 3aa481599811af7cd9b0c523f66dac469105ee49..c94bc27ef76ee94d5541e5ff2dcdaa17 // Paper start - Adventure diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index fe0095601b41d85d8813af18e1c74b31f26f150d..f248735d48aa5c430752426e9dc02c1ae6644aaf 100644 +index c35f5a1a42b76b154bfbb161d23348e76f676090..561ed3b93ba09f17f0f263b90993a7b13ce3f468 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -410,10 +410,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -477,10 +477,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z)); if (playerChunk == null) return false; @@ -22732,7 +22734,7 @@ index fe0095601b41d85d8813af18e1c74b31f26f150d..f248735d48aa5c430752426e9dc02c1a ClientboundLevelChunkWithLightPacket refreshPacket = new ClientboundLevelChunkWithLightPacket(chunk, this.world.getLightEngine(), null, null); for (ServerPlayer player : playersInRange) { -@@ -421,8 +425,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -488,8 +492,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { player.connection.send(refreshPacket); } @@ -22742,7 +22744,7 @@ index fe0095601b41d85d8813af18e1c74b31f26f150d..f248735d48aa5c430752426e9dc02c1a return true; } -@@ -499,20 +502,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -566,20 +569,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public Collection getPluginChunkTickets(int x, int z) { DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; @@ -22764,7 +22766,7 @@ index fe0095601b41d85d8813af18e1c74b31f26f150d..f248735d48aa5c430752426e9dc02c1a } @Override -@@ -520,7 +510,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -587,7 +577,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { Map> ret = new HashMap<>(); DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; @@ -22773,7 +22775,7 @@ index fe0095601b41d85d8813af18e1c74b31f26f150d..f248735d48aa5c430752426e9dc02c1a long chunkKey = chunkTickets.getLongKey(); SortedArraySet> tickets = chunkTickets.getValue(); -@@ -1143,13 +1133,52 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1227,13 +1217,52 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public int getViewDistance() { @@ -22829,7 +22831,7 @@ index fe0095601b41d85d8813af18e1c74b31f26f150d..f248735d48aa5c430752426e9dc02c1a public BlockMetadataStore getBlockMetadata() { return this.blockMetadata; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 549c14e2d861c0b4692ee56e1de5df13ef72f6f8..4de49a81238ca3d550f85fdcdf921c17f992f65a 100644 +index 1fe839581edc496826885937ab0e10ec0a056212..b6bf7cf5515400a1f241ebef6cc76073f0a93bfa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -199,6 +199,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -22966,27 +22968,8 @@ index 440660dfa70d57e94ae4eef1dce783aee5034f7e..187eda2dd40785eb09528c86718d6b4f + public void getEntitiesByClass(Class clazz, Entity except, AABB box, List into, Predicate predicate) {} + // Paper end } -diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 90df7e83d9166c22a56a31db22d843768229b9ab..f60eb4bf10c32d2d92fa24992ed20525f0f0f781 100644 ---- a/src/main/java/org/spigotmc/ActivationRange.java -+++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -136,7 +136,13 @@ public class ActivationRange - ActivationType.ANIMAL.boundingBox = player.getBoundingBox().inflate( animalActivationRange, 256, animalActivationRange ); - ActivationType.MONSTER.boundingBox = player.getBoundingBox().inflate( monsterActivationRange, 256, monsterActivationRange ); - -- world.getEntities().get(ActivationRange.maxBB, ActivationRange::activateEntity); -+ // Paper start -+ java.util.List entities = world.getEntities((Entity)null, ActivationRange.maxBB, null); -+ for (int i = 0; i < entities.size(); i++) { -+ Entity entity = entities.get(i); -+ ActivationRange.activateEntity(entity); -+ } -+ // Paper end - } - MinecraftTimings.entityActivationCheckTimer.stopTiming(); - } diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java -index 78669fa035b7537ff7e533cf32aaf2995625424f..05e94702e42b8f5c35d2a112c486d57948a3acba 100644 +index e8e3cc48cf1c58bd8151d1f28df28781859cd0e3..2e074c16dab1ead47914070329da0398c3274048 100644 --- a/src/main/java/org/spigotmc/AsyncCatcher.java +++ b/src/main/java/org/spigotmc/AsyncCatcher.java @@ -9,7 +9,7 @@ public class AsyncCatcher @@ -22994,10 +22977,10 @@ index 78669fa035b7537ff7e533cf32aaf2995625424f..05e94702e42b8f5c35d2a112c486d579 public static void catchOp(String reason) { - if ( (AsyncCatcher.enabled || io.papermc.paper.util.TickThread.STRICT_THREAD_CHECKS) && Thread.currentThread() != MinecraftServer.getServer().serverThread ) // Paper -+ if ( !io.papermc.paper.util.TickThread.isTickThread() ) // Paper // Paper - rewrite chunk system ++ if (!(io.papermc.paper.util.TickThread.isTickThread())) // Paper { + MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); // Paper throw new IllegalStateException( "Asynchronous " + reason + "!" ); - } diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java index b1ac7338fa632611ea8332044b09070f78f8f5f1..a284d3b8526a743ba4389ec5b44d80af6d0e5a5f 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java diff --git a/patches/server/0753-Sanitize-sent-BlockEntity-NBT.patch b/patches/server/0753-Sanitize-sent-BlockEntity-NBT.patch index 960684891e..f607c4b19b 100644 --- a/patches/server/0753-Sanitize-sent-BlockEntity-NBT.patch +++ b/patches/server/0753-Sanitize-sent-BlockEntity-NBT.patch @@ -30,7 +30,7 @@ index f47eeb70661661610ef1a96dd9da67785825c126..89e3163b0301f8414c9400a6e00cdd85 } } diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index e3557f4c8cee7c88b3e352cd246078da7762effc..0fdf74317a20a250b474978c9e50a6c533abfbe6 100644 +index 4893eaf93738da860014ddf3ad003334c9ebc9fa..20201430ee8f28245aa845acb172d0f5d80458ff 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java @@ -253,4 +253,11 @@ public abstract class BlockEntity { diff --git a/patches/server/0755-Prevent-entity-loading-causing-async-lookups.patch b/patches/server/0755-Prevent-entity-loading-causing-async-lookups.patch index a118054447..f0a0cf57b8 100644 --- a/patches/server/0755-Prevent-entity-loading-causing-async-lookups.patch +++ b/patches/server/0755-Prevent-entity-loading-causing-async-lookups.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent entity loading causing async lookups diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a848448f14ad4aee3a36aa4ef52efd25d73ebbcb..0d23c58fec4c7a93093107833baeec0936f03641 100644 +index bae70a2385c75b372f96382c6976d18be612ac81..51aee56014ba843cd81667791022ac887aebc6d4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -766,6 +766,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch index ff4b988423..a2ee77aec4 100644 --- a/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch +++ b/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch @@ -7,7 +7,7 @@ There are no plans to support creating worlds while worlds are being ticked themselvess. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2968e4253bb4eed39b28db3f3c87d31e4834540b..773c817bfae580ff6151d33ac7a24274ab335fae 100644 +index 5a9867265d1015e5bbdfd455a625ec82cff8a37b..affe94f919fb56e925d848849b29eb5a72875dfb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -306,6 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1447,7 +1448,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - BlockPhysicsEvent -@@ -1517,6 +1520,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop recipients = new HashSet<>(); for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) { diff --git a/patches/server/0763-Prevent-empty-items-from-being-added-to-world.patch b/patches/server/0763-Prevent-empty-items-from-being-added-to-world.patch index 521e3bb803..a0fbc7a6c6 100644 --- a/patches/server/0763-Prevent-empty-items-from-being-added-to-world.patch +++ b/patches/server/0763-Prevent-empty-items-from-being-added-to-world.patch @@ -7,7 +7,7 @@ The previous solution caused a bunch of bandaid fixes inorder to resolve edge ca Just simply prevent them from being added to the world instead. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 9fffd60371500b05c009e0c8ac7d83126fbde866..ca3ee200c80047aca3c8856b057e5c77840d849c 100644 +index 1c2c942c960326cea641936b0afc5df71c957ba5..0b9c14de016115f9d033e0750d8468ca5dfc183a 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1501,6 +1501,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0767-Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/0767-Add-various-missing-EntityDropItemEvent-calls.patch index 7ebfd38594..1331e09ca4 100644 --- a/patches/server/0767-Add-various-missing-EntityDropItemEvent-calls.patch +++ b/patches/server/0767-Add-various-missing-EntityDropItemEvent-calls.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add various missing EntityDropItemEvent calls diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 8150706b585ae48577a8a6186f02a63b72e7db7c..93c36da55be9f5ce2f1c4aaf58913a89abf90cd3 100644 +index 51aee56014ba843cd81667791022ac887aebc6d4..b6bb76cb369d7edbf1268de3552008e06001908a 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2523,6 +2523,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0769-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/0769-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch index f1f36e6ee8..55d6277f05 100644 --- a/patches/server/0769-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch +++ b/patches/server/0769-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix Spigot Config not using commands.spam-exclusions diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9810c476ba7cdee6a2ed17c48f8f101426596aea..e7985c415e9efa79b1785d1270bcb8f0253000d5 100644 +index 2bca2ae3688a36ee0e7c951f3ced39606dc4e456..41da7f32b59aeeef229a97386fa195f63767cce8 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2299,7 +2299,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0770-More-Teleport-API.patch b/patches/server/0770-More-Teleport-API.patch index 69a0d1d9ae..8524587dcb 100644 --- a/patches/server/0770-More-Teleport-API.patch +++ b/patches/server/0770-More-Teleport-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] More Teleport API diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e7985c415e9efa79b1785d1270bcb8f0253000d5..15a2d3fb2db4abfe66392a22d9a33159a816f285 100644 +index 41da7f32b59aeeef229a97386fa195f63767cce8..3a6ea61d65e24d6d1f89e626e8d6efd7e1943735 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1558,11 +1558,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0771-Add-EntityPortalReadyEvent.patch b/patches/server/0771-Add-EntityPortalReadyEvent.patch index e4beb8b99b..36b6e63125 100644 --- a/patches/server/0771-Add-EntityPortalReadyEvent.patch +++ b/patches/server/0771-Add-EntityPortalReadyEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityPortalReadyEvent diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 93c36da55be9f5ce2f1c4aaf58913a89abf90cd3..0c8cb71f4389dbf6ff044f0108bb064918c9accf 100644 +index b6bb76cb369d7edbf1268de3552008e06001908a..2c0f9433738f9de1cf9df73425bea9dfb873deb1 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2864,6 +2864,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0772-Don-t-use-level-random-in-entity-constructors.patch b/patches/server/0772-Don-t-use-level-random-in-entity-constructors.patch index 1223c386c3..b8da0480ac 100644 --- a/patches/server/0772-Don-t-use-level-random-in-entity-constructors.patch +++ b/patches/server/0772-Don-t-use-level-random-in-entity-constructors.patch @@ -27,7 +27,7 @@ index 459f793a6603d4f98c84df4e549f069298c54985..8aaca29b115a55bf48306e71432c4c20 public ItemEntity(Level world, double x, double y, double z, ItemStack stack, double velocityX, double velocityY, double velocityZ) { diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -index fe51d34f9d764ed4bff4a2a0c566e132dde36e55..2498f942ab55a2ee9af4822c300ec6f45811ef3f 100644 +index 3408337b11f04337bb2f62de343e430d94d3a093..cd7b955754b809826048b80723e2e9055b373a4a 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java @@ -43,7 +43,7 @@ public class PrimedTnt extends Entity implements TraceableEntity { diff --git a/patches/server/0773-Send-block-entities-after-destroy-prediction.patch b/patches/server/0773-Send-block-entities-after-destroy-prediction.patch index d0cf025998..e70b56b1a3 100644 --- a/patches/server/0773-Send-block-entities-after-destroy-prediction.patch +++ b/patches/server/0773-Send-block-entities-after-destroy-prediction.patch @@ -57,7 +57,7 @@ index be25ea71cb3a3bd324935754604c9f7473a88d0a..75967b3526f3f946ffc6784b87b78739 } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 15a2d3fb2db4abfe66392a22d9a33159a816f285..e868c434be0bf223728b439df9a0db6afeaee46e 100644 +index 3a6ea61d65e24d6d1f89e626e8d6efd7e1943735..8bf4ff57791e3800370d79ec1660d47177f9521c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1704,8 +1704,28 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch b/patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch index 1806a9771a..1cda4d0d48 100644 --- a/patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch +++ b/patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Warn on plugins accessing faraway chunks diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 709d3e5c506c9dd14f51c455eee7093fb9703168..9c8623553e12683d99c689e5461aa36257dc5bbd 100644 +index 8c4d618a6641c38d6df1d320a1945cd006b40280..ff8e8a4f1002ca095df232336c4551b115383ef4 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -359,7 +359,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -350,7 +350,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } private static boolean isInWorldBoundsHorizontal(BlockPos pos) { diff --git a/patches/server/0780-Add-Velocity-IP-Forwarding-Support.patch b/patches/server/0780-Add-Velocity-IP-Forwarding-Support.patch index 2d3d408777..e9a700772d 100644 --- a/patches/server/0780-Add-Velocity-IP-Forwarding-Support.patch +++ b/patches/server/0780-Add-Velocity-IP-Forwarding-Support.patch @@ -228,7 +228,7 @@ index ebda34825bbd10145a81d54c345e31c2a4fb5de4..42ae62bdbe11fdfbacebf621d64e7c49 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f1544ea9d189a8aa81e7f742c04173f8bf2b0209..cda293ee6281ba01f9f924ad5c65d8ad96ab50f6 100644 +index f9c03519dca0674478ae7c47947530242b1990c6..020c27007dc7b6071206a649fb9fb3611ebef8e7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -803,7 +803,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch index 1bee3971b8..4439587b2e 100644 --- a/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch +++ b/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch @@ -37,10 +37,10 @@ index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dc + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 773c817bfae580ff6151d33ac7a24274ab335fae..34b17c9ced5ac2b6ad8ef35eb774724a6c78c28e 100644 +index affe94f919fb56e925d848849b29eb5a72875dfb..c18ba90d3809ee1b2a1a1a7c3b7364cdb5ac6b3c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1152,6 +1152,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop Co-authored-by: Spottedleaf diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index d41e3e5382b17d3de41054b496c1707a926a897a..cf22a46fdb45ac86571c93640ce7a8e1117190cd 100644 +index 829c72333664da0c06ce04af93ea39bb90ce0b67..b4f7e3ae855cbf48925f0db916501adf513ae08c 100644 --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java @@ -351,7 +351,7 @@ public interface DispenseItemBehavior { @@ -126,7 +126,7 @@ index f7ebb560a3f8aebb5e35397814eaa7af098897c3..ed6efb22465c4d610a5b12f6ef3ca1aa return this.anyPlayerCloseEnoughForSpawning(pos, false); } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index ca3ee200c80047aca3c8856b057e5c77840d849c..366670bf2e843b91519fbff2b0515e66debcd855 100644 +index 0b9c14de016115f9d033e0750d8468ca5dfc183a..0bfde139536d0ac5230bb4c690a2bd4e6fe306b5 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1007,7 +1007,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -139,7 +139,7 @@ index ca3ee200c80047aca3c8856b057e5c77840d849c..366670bf2e843b91519fbff2b0515e66 if (!list.isEmpty()) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index cc4954ceceeb8636ac1d6f0f0459816d2a98c317..f6701e597ad43d44e6f5809d9cc2b670863df67e 100644 +index d8323a21e81541bce6962d00c02c1af527b27541..2d9d94777916acf79908b7f6325a88fa62050867 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -464,14 +464,14 @@ public class ServerPlayer extends Player { @@ -474,7 +474,7 @@ index c7ba7ac1a3869e4db1ef6b0350b3cab7f31a94c4..d7beeac4a8e4a16221809663a5aa0338 } } diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index 83a5417d14e89c3e582e400543fe41f129bbbf3b..5ea2cad4031d69f0204e3094d9ac5d127ef2438c 100644 +index 2ceadc753eb99a08881f1292de789528f4a3de85..ae9c69176168e53f6270a0bc02240d190630d015 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java @@ -291,7 +291,11 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name diff --git a/patches/server/0796-Remove-unnecessary-onTrackingStart-during-navigation.patch b/patches/server/0796-Remove-unnecessary-onTrackingStart-during-navigation.patch index 646baf136f..876fb8ca9a 100644 --- a/patches/server/0796-Remove-unnecessary-onTrackingStart-during-navigation.patch +++ b/patches/server/0796-Remove-unnecessary-onTrackingStart-during-navigation.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Remove unnecessary onTrackingStart during navigation warning diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 366670bf2e843b91519fbff2b0515e66debcd855..6531c844c8ffef52f4be985c1b0b73a236219bc5 100644 +index 0bfde139536d0ac5230bb4c690a2bd4e6fe306b5..98771dd96a75098f218f9bfbc05c48f6a7baebf3 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2548,7 +2548,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0800-Add-PlayerInventorySlotChangeEvent.patch b/patches/server/0800-Add-PlayerInventorySlotChangeEvent.patch index 7f618d01e7..b53efb820a 100644 --- a/patches/server/0800-Add-PlayerInventorySlotChangeEvent.patch +++ b/patches/server/0800-Add-PlayerInventorySlotChangeEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerInventorySlotChangeEvent diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index f6701e597ad43d44e6f5809d9cc2b670863df67e..160e8ed25c7fcf60b1a9c4188ad636e7fc671ab7 100644 +index 2d9d94777916acf79908b7f6325a88fa62050867..3284928b9f85e1adacd64219141efe2ea7116e7b 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -375,6 +375,25 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0804-Detect-headless-JREs.patch b/patches/server/0804-Detect-headless-JREs.patch index 637c75c82a..baddcbc26a 100644 --- a/patches/server/0804-Detect-headless-JREs.patch +++ b/patches/server/0804-Detect-headless-JREs.patch @@ -27,7 +27,7 @@ index 6bd0afddbcc461149dfe9a5c7a86fff6ea13a5f1..148d233f4f5278ff39eacdaa0f4f0e7d + } } diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index b0a0909fa9501dfacfbe70dc4118062d1154bd15..19009f0c1d572eebad6cce93f8cf56ca820fc33f 100644 +index 1cad3585ca122a465572b16d4ecbb7231e87c7de..15464ef7779d62f1dba5edeabcb91c6e677e676f 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -175,6 +175,18 @@ public class Main { diff --git a/patches/server/0809-Ignore-impossible-spawn-tick.patch b/patches/server/0809-Ignore-impossible-spawn-tick.patch index fc336b2c29..c123aa8370 100644 --- a/patches/server/0809-Ignore-impossible-spawn-tick.patch +++ b/patches/server/0809-Ignore-impossible-spawn-tick.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Ignore impossible spawn tick diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index a9c74ef33182505b6982fea273a760e937ddbf51..7d08099b82dc47cf4b1ce49c721a4aca90b489af 100644 +index 7fdf026bdeb85d149e24aa013181a848ece4c55e..f936f4664584f19bc6720c664035747721ea8231 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -82,6 +82,7 @@ public abstract class BaseSpawner { diff --git a/patches/server/0810-Track-projectile-source-for-fireworks-from-dispenser.patch b/patches/server/0810-Track-projectile-source-for-fireworks-from-dispenser.patch index c5d89093dc..b78dda85fc 100644 --- a/patches/server/0810-Track-projectile-source-for-fireworks-from-dispenser.patch +++ b/patches/server/0810-Track-projectile-source-for-fireworks-from-dispenser.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Track projectile source for fireworks from dispensers diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index cf22a46fdb45ac86571c93640ce7a8e1117190cd..0ae7a1bbb78af9f5b0efa0802a6d2128871da762 100644 +index b4f7e3ae855cbf48925f0db916501adf513ae08c..24b2d57ebe76ce825686a53c94ae994b418a1272 100644 --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java @@ -517,6 +517,7 @@ public interface DispenseItemBehavior { diff --git a/patches/server/0812-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch b/patches/server/0812-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch index d50800f04c..edf29e0905 100644 --- a/patches/server/0812-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch +++ b/patches/server/0812-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix EntityCombustEvent cancellation cant fully prevent diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 0c8cb71f4389dbf6ff044f0108bb064918c9accf..e162b6f906923971e236b47dcd4e5deb49cf969f 100644 +index 2c0f9433738f9de1cf9df73425bea9dfb873deb1..ee534368a317c0f6d2d8189588af9f7088809cae 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -3143,6 +3143,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0818-Add-paper-dumplisteners-command.patch b/patches/server/0818-Add-paper-dumplisteners-command.patch index 724068c3a0..76d91477d5 100644 --- a/patches/server/0818-Add-paper-dumplisteners-command.patch +++ b/patches/server/0818-Add-paper-dumplisteners-command.patch @@ -6,13 +6,13 @@ Subject: [PATCH] Add /paper dumplisteners command Co-authored-by: TwoLeggedCat <80929284+TwoLeggedCat@users.noreply.github.com> diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java -index b2a15f0346c84b03c8947e3231cf0d27a790ebc9..0698dfd7ac84a3453eba437895acb4f0b45caf70 100644 +index e2f433ddb7a34b721ba983db84f100aac953e3a4..bca1b25d12e9c987ba82f26a2a69862dfb3fca86 100644 --- a/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java @@ -43,6 +43,7 @@ public final class PaperCommand extends Command { commands.put(Set.of("dumpitem"), new DumpItemCommand()); - commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand()); + commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); + commands.put(Set.of("dumplisteners"), new DumpListenersCommand()); return commands.entrySet().stream() diff --git a/patches/server/0819-check-global-player-list-where-appropriate.patch b/patches/server/0819-check-global-player-list-where-appropriate.patch index 0fd5e80c30..abfacbd48b 100644 --- a/patches/server/0819-check-global-player-list-where-appropriate.patch +++ b/patches/server/0819-check-global-player-list-where-appropriate.patch @@ -7,7 +7,7 @@ Makes certain entities check all players when searching for a player instead of just checking players in their world. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 6531c844c8ffef52f4be985c1b0b73a236219bc5..b20f0da6b27fe1753ae8283ace2b5df96ee74a77 100644 +index 98771dd96a75098f218f9bfbc05c48f6a7baebf3..ec49e11d151f32557b914ae7822f6e8f79a310ae 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2670,4 +2670,12 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -50,7 +50,7 @@ index d4ac3e566b47cfc8688bcc2ab08385b6de4693f8..7de9d012e7416eaa0189b513a0972c84 if (entityhuman instanceof ServerPlayer) { CriteriaTriggers.CURED_ZOMBIE_VILLAGER.trigger((ServerPlayer) entityhuman, this, entityvillager); diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java -index a25497eec004add7408a63b1a0f09e3fa443b324..8c436d16914e160be8e3074badc1293af2ae6b31 100644 +index dbdf124638c35510aa0040100c4d80d63ab14ada..cc888bbcd6a50124fa553bc4a8ffd1e8885d3856 100644 --- a/src/main/java/net/minecraft/world/level/EntityGetter.java +++ b/src/main/java/net/minecraft/world/level/EntityGetter.java @@ -243,4 +243,11 @@ public interface EntityGetter { diff --git a/patches/server/0825-Sync-offhand-slot-in-menus.patch b/patches/server/0825-Sync-offhand-slot-in-menus.patch index 6fec301aa3..deda1b40ad 100644 --- a/patches/server/0825-Sync-offhand-slot-in-menus.patch +++ b/patches/server/0825-Sync-offhand-slot-in-menus.patch @@ -8,7 +8,7 @@ offhand slot isn't sent. This is not correct because you *can* put stuff into th by pressing the offhand swap item diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 160e8ed25c7fcf60b1a9c4188ad636e7fc671ab7..50400964b30952fcaae04536bff906e44c9a3a3d 100644 +index 3284928b9f85e1adacd64219141efe2ea7116e7b..dc99cf246bfca6543f4e53b0102770d0fd94250f 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -344,6 +344,13 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0826-Player-Entity-Tracking-Events.patch b/patches/server/0826-Player-Entity-Tracking-Events.patch index b4dff68d10..498d378422 100644 --- a/patches/server/0826-Player-Entity-Tracking-Events.patch +++ b/patches/server/0826-Player-Entity-Tracking-Events.patch @@ -21,7 +21,7 @@ index ed6efb22465c4d610a5b12f6ef3ca1aa7a5907ea..e8dfae9d5d899963d1750d0e60a5069b } else if (this.seenBy.remove(player.connection)) { this.serverEntity.removePairing(player); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index e162b6f906923971e236b47dcd4e5deb49cf969f..7908671f55601e06cca224ca26c1b1fc942bdd2c 100644 +index ee534368a317c0f6d2d8189588af9f7088809cae..c2e827e2ff7eb8e4450324e1574fc748eb7a2972 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -3870,7 +3870,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0828-Fixes-and-additions-to-the-SpawnReason-API.patch b/patches/server/0828-Fixes-and-additions-to-the-SpawnReason-API.patch index 3a7ad38e7b..4169921a24 100644 --- a/patches/server/0828-Fixes-and-additions-to-the-SpawnReason-API.patch +++ b/patches/server/0828-Fixes-and-additions-to-the-SpawnReason-API.patch @@ -8,7 +8,7 @@ Fixes some wrong reasons, and adds missing spawn reasons for entities. Co-authored-by: Doc diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 3ddb1cc0edddcf77c1b5d6157247498cb90c57a7..847b2637434561e50e3f4f1a3e58cea50caab9f2 100644 +index bd4ae65070eb4b98dae0529b5985f80093bf8185..dcdc982b22b7fc836e6ad423a75c75c1d33eb7d8 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -353,7 +353,7 @@ public class EntityType implements FeatureElement, EntityTypeT diff --git a/patches/server/0831-Fix-inconsistencies-in-dispense-events-regarding-sta.patch b/patches/server/0831-Fix-inconsistencies-in-dispense-events-regarding-sta.patch index 2ffca4c12c..afdba86d79 100644 --- a/patches/server/0831-Fix-inconsistencies-in-dispense-events-regarding-sta.patch +++ b/patches/server/0831-Fix-inconsistencies-in-dispense-events-regarding-sta.patch @@ -86,7 +86,7 @@ index 90e1914599b43c8bf813596b3b428d8be3bac1b5..6df0db8b4cdab23494ea34236949ece4 } diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index 0ae7a1bbb78af9f5b0efa0802a6d2128871da762..a16fb04c014d3b2f3dac0610f8be81586d41c4e9 100644 +index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea883bba41c 100644 --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java @@ -217,7 +217,7 @@ public interface DispenseItemBehavior { @@ -324,16 +324,16 @@ index 0ae7a1bbb78af9f5b0efa0802a6d2128871da762..a16fb04c014d3b2f3dac0610f8be8158 // CraftBukkit end return stack; } -@@ -620,7 +630,7 @@ public interface DispenseItemBehavior { - BlockState iblockdata = worldserver.getBlockState(blockposition); - if (iblockdata.isAir() || iblockdata.canBeReplaced() || (dispensiblecontaineritem instanceof BucketItem && iblockdata.getBlock() instanceof LiquidBlockContainer && ((LiquidBlockContainer) iblockdata.getBlock()).canPlaceLiquid((Player) null, worldserver, blockposition, iblockdata, ((BucketItem) dispensiblecontaineritem).content))) { +@@ -626,7 +636,7 @@ public interface DispenseItemBehavior { + if (willEmptyContentsSolidBucketItem || willEmptyBucketItem) { + // Paper end - correctly check if the bucket place will succeed org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); - CraftItemStack craftItem = CraftItemStack.asCraftMirror(stack); + CraftItemStack craftItem = CraftItemStack.asCraftMirror(stack.copyWithCount(1)); // Paper - single item in event BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(x, y, z)); if (!DispenserBlock.eventFired) { -@@ -694,7 +704,7 @@ public interface DispenseItemBehavior { +@@ -700,7 +710,7 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -342,7 +342,7 @@ index 0ae7a1bbb78af9f5b0efa0802a6d2128871da762..a16fb04c014d3b2f3dac0610f8be8158 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); if (!DispenserBlock.eventFired) { -@@ -741,7 +751,7 @@ public interface DispenseItemBehavior { +@@ -747,7 +757,7 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -351,7 +351,7 @@ index 0ae7a1bbb78af9f5b0efa0802a6d2128871da762..a16fb04c014d3b2f3dac0610f8be8158 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); if (!DispenserBlock.eventFired) { -@@ -802,7 +812,7 @@ public interface DispenseItemBehavior { +@@ -808,7 +818,7 @@ public interface DispenseItemBehavior { BlockPos blockposition = pointer.pos().relative((Direction) pointer.state().getValue(DispenserBlock.FACING)); // CraftBukkit start org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); @@ -360,7 +360,7 @@ index 0ae7a1bbb78af9f5b0efa0802a6d2128871da762..a16fb04c014d3b2f3dac0610f8be8158 BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); if (!DispenserBlock.eventFired) { -@@ -868,7 +878,7 @@ public interface DispenseItemBehavior { +@@ -874,7 +884,7 @@ public interface DispenseItemBehavior { // CraftBukkit start // EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldserver, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null); @@ -369,7 +369,7 @@ index 0ae7a1bbb78af9f5b0efa0802a6d2128871da762..a16fb04c014d3b2f3dac0610f8be8158 org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); -@@ -878,12 +888,13 @@ public interface DispenseItemBehavior { +@@ -884,12 +894,13 @@ public interface DispenseItemBehavior { } if (event.isCancelled()) { @@ -385,7 +385,7 @@ index 0ae7a1bbb78af9f5b0efa0802a6d2128871da762..a16fb04c014d3b2f3dac0610f8be8158 // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -899,7 +910,7 @@ public interface DispenseItemBehavior { +@@ -905,7 +916,7 @@ public interface DispenseItemBehavior { worldserver.addFreshEntity(entitytntprimed); worldserver.playSound((Player) null, entitytntprimed.getX(), entitytntprimed.getY(), entitytntprimed.getZ(), SoundEvents.TNT_PRIMED, SoundSource.BLOCKS, 1.0F, 1.0F); worldserver.gameEvent((Entity) null, GameEvent.ENTITY_PLACE, blockposition); @@ -394,7 +394,7 @@ index 0ae7a1bbb78af9f5b0efa0802a6d2128871da762..a16fb04c014d3b2f3dac0610f8be8158 return stack; } }); -@@ -926,7 +937,7 @@ public interface DispenseItemBehavior { +@@ -932,7 +943,7 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -403,7 +403,7 @@ index 0ae7a1bbb78af9f5b0efa0802a6d2128871da762..a16fb04c014d3b2f3dac0610f8be8158 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); if (!DispenserBlock.eventFired) { -@@ -975,7 +986,7 @@ public interface DispenseItemBehavior { +@@ -981,7 +992,7 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -412,7 +412,7 @@ index 0ae7a1bbb78af9f5b0efa0802a6d2128871da762..a16fb04c014d3b2f3dac0610f8be8158 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); if (!DispenserBlock.eventFired) { -@@ -1048,7 +1059,7 @@ public interface DispenseItemBehavior { +@@ -1054,7 +1065,7 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); diff --git a/patches/server/0832-Add-BlockLockCheckEvent.patch b/patches/server/0832-Add-BlockLockCheckEvent.patch index 07ffc14ac2..7ae4135105 100644 --- a/patches/server/0832-Add-BlockLockCheckEvent.patch +++ b/patches/server/0832-Add-BlockLockCheckEvent.patch @@ -56,7 +56,7 @@ index fce3a45d09a93ca68a3d49f2e666afa4c860d042..b8b4d74076fa5ed6eb3b2045384db77e @Nullable diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index 5ea2cad4031d69f0204e3094d9ac5d127ef2438c..44660b9f3d8ef6df42dc05e774a5804fdbfa5d14 100644 +index ae9c69176168e53f6270a0bc02240d190630d015..dbcac8b787e9a18193723b5311fe882060397dc6 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java @@ -470,7 +470,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name diff --git a/patches/server/0834-Improve-logging-and-errors.patch b/patches/server/0834-Improve-logging-and-errors.patch index 852cf6ed58..7388835824 100644 --- a/patches/server/0834-Improve-logging-and-errors.patch +++ b/patches/server/0834-Improve-logging-and-errors.patch @@ -40,7 +40,7 @@ index 536f0c496ce36ca3248fc6eeac9bbd77214a36f9..31718823250a1490b783f426fff65bf5 while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e868c434be0bf223728b439df9a0db6afeaee46e..058ee906665d64b3631be5a6b9de39bd65bcf6be 100644 +index 8bf4ff57791e3800370d79ec1660d47177f9521c..8b763089616823cfbf5a16e72f6a586e92379246 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -3316,7 +3316,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0835-Improve-PortalEvents.patch b/patches/server/0835-Improve-PortalEvents.patch index d776067518..2981ab37aa 100644 --- a/patches/server/0835-Improve-PortalEvents.patch +++ b/patches/server/0835-Improve-PortalEvents.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Improve PortalEvents diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7908671f55601e06cca224ca26c1b1fc942bdd2c..2530f8554d124a504387e7018374a3b31355a16e 100644 +index c2e827e2ff7eb8e4450324e1574fc748eb7a2972..c9e1718f6846d4ef9825ad7da45508f09486b458 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -3528,7 +3528,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0837-Add-missing-SpigotConfig-logCommands-check.patch b/patches/server/0837-Add-missing-SpigotConfig-logCommands-check.patch index 32d796a32f..01f7c70a9c 100644 --- a/patches/server/0837-Add-missing-SpigotConfig-logCommands-check.patch +++ b/patches/server/0837-Add-missing-SpigotConfig-logCommands-check.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add missing SpigotConfig logCommands check diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 058ee906665d64b3631be5a6b9de39bd65bcf6be..07850cf4117f05bfbd96a4f02fd57db1566f90af 100644 +index 8b763089616823cfbf5a16e72f6a586e92379246..4b7bde944f62057841840a07295d528d7d1b17a2 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2060,7 +2060,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0840-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch b/patches/server/0840-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch index 51892eae9c..8b46d1fb16 100644 --- a/patches/server/0840-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch +++ b/patches/server/0840-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch @@ -41,7 +41,7 @@ index 8bde8c581796ed11809b80b9a30a33df86116745..f339475185645f7be30963e4f980ce81 public DamageSource outOfBorder() { diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 5097d9f1a3ab4e49e1899ede1742436357b0ad91..4aadf445daee88cc849929783eeddfa4aa005581 100644 +index c7075aaf417b1dc9eab4a19b72fac50d2a44286b..34159798e6617ce13b3ac8aae07d24d9bca6ee36 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -367,7 +367,7 @@ public class Explosion { diff --git a/patches/server/0841-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch b/patches/server/0841-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch index 21aca8cd32..6741cbdd07 100644 --- a/patches/server/0841-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch +++ b/patches/server/0841-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Expose pre-collision moving velocity to diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index ce52cd5d11e4422cb236761b5dff06daa9cad56b..6c8c7b3c701ba258610cef86997ff3bc13e37bcb 100644 +index c9e1718f6846d4ef9825ad7da45508f09486b458..287450e58076e63f9686a1ad2c1148c24a5c7252 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -997,6 +997,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0842-config-for-disabling-entity-tag-tags.patch b/patches/server/0842-config-for-disabling-entity-tag-tags.patch index 345d6b5981..4b98ef2a0c 100644 --- a/patches/server/0842-config-for-disabling-entity-tag-tags.patch +++ b/patches/server/0842-config-for-disabling-entity-tag-tags.patch @@ -5,7 +5,7 @@ Subject: [PATCH] config for disabling entity tag tags diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 847b2637434561e50e3f4f1a3e58cea50caab9f2..a6e20b5ee4fe1841dfc2350264b5935b968fe3f3 100644 +index dcdc982b22b7fc836e6ad423a75c75c1d33eb7d8..fe8efe89c7d390ff9565f388685b57daeebfd08b 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -497,6 +497,13 @@ public class EntityType implements FeatureElement, EntityTypeT diff --git a/patches/server/0843-Use-single-player-info-update-packet-on-join.patch b/patches/server/0843-Use-single-player-info-update-packet-on-join.patch index 404ef91bbe..9b0401d7e0 100644 --- a/patches/server/0843-Use-single-player-info-update-packet-on-join.patch +++ b/patches/server/0843-Use-single-player-info-update-packet-on-join.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use single player info update packet on join diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 07850cf4117f05bfbd96a4f02fd57db1566f90af..50f2c11d98dc4e8aa2e6f577fc802279e33e3e6b 100644 +index 4b7bde944f62057841840a07295d528d7d1b17a2..7d03dd75932682ed22bf98f8052ab045468b9b30 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -3346,7 +3346,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0850-Update-the-flag-when-a-captured-block-state-is-outda.patch b/patches/server/0850-Update-the-flag-when-a-captured-block-state-is-outda.patch index cbd0fdc890..cb0d75807f 100644 --- a/patches/server/0850-Update-the-flag-when-a-captured-block-state-is-outda.patch +++ b/patches/server/0850-Update-the-flag-when-a-captured-block-state-is-outda.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Update the flag when a captured block state is outdated diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 9c8623553e12683d99c689e5461aa36257dc5bbd..f368da2e63f5c42166749789d759056b70973614 100644 +index ff8e8a4f1002ca095df232336c4551b115383ef4..0bf91f88a9385797c508d165501ab18658707d71 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -465,6 +465,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -456,6 +456,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags); this.capturedBlockStates.put(pos.immutable(), blockstate); } diff --git a/patches/server/0862-Treat-sequence-violations-like-they-should-be.patch b/patches/server/0862-Treat-sequence-violations-like-they-should-be.patch index 32175ef982..512bad9e2d 100644 --- a/patches/server/0862-Treat-sequence-violations-like-they-should-be.patch +++ b/patches/server/0862-Treat-sequence-violations-like-they-should-be.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Treat sequence violations like they should be diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 50f2c11d98dc4e8aa2e6f577fc802279e33e3e6b..522cb67c335ae831d560c8d452b263871782c3fd 100644 +index 7d03dd75932682ed22bf98f8052ab045468b9b30..63b340bdc21db8d068d0e8f0e7620fd7f1fb877a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1964,6 +1964,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0864-Prevent-causing-expired-keys-from-impacting-new-join.patch b/patches/server/0864-Prevent-causing-expired-keys-from-impacting-new-join.patch index 68ab96c59a..5c1aff197b 100644 --- a/patches/server/0864-Prevent-causing-expired-keys-from-impacting-new-join.patch +++ b/patches/server/0864-Prevent-causing-expired-keys-from-impacting-new-join.patch @@ -24,7 +24,7 @@ index 0e54e8faa48751a651b953bec72543a94edf74bc..d43106eb89b14667e85cd6e8fa047d64 UPDATE_GAME_MODE((serialized, buf) -> { serialized.gameMode = GameType.byId(buf.readVarInt()); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 522cb67c335ae831d560c8d452b263871782c3fd..d2916743981c6632957ab8bed5ae7a2334c5646b 100644 +index 63b340bdc21db8d068d0e8f0e7620fd7f1fb877a..6fb45dab9cb2bc0319ab185bcbea5386ff1ab252 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -287,6 +287,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0865-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch b/patches/server/0865-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch index 12f3bb6e64..2c8c63916c 100644 --- a/patches/server/0865-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch +++ b/patches/server/0865-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent GameEvents being fired from unloaded chunks diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index b20f0da6b27fe1753ae8283ace2b5df96ee74a77..c711c7221ae001c46dcb82def726c6ed9cca1ac9 100644 +index ec49e11d151f32557b914ae7822f6e8f79a310ae..c17c0fe2b67024513379304e1be79f88474aa4ff 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1638,6 +1638,11 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0868-Fix-demo-flag-not-enabling-demo-mode.patch b/patches/server/0868-Fix-demo-flag-not-enabling-demo-mode.patch index 588524d49e..a105febcd8 100644 --- a/patches/server/0868-Fix-demo-flag-not-enabling-demo-mode.patch +++ b/patches/server/0868-Fix-demo-flag-not-enabling-demo-mode.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix demo flag not enabling demo mode https://github.com/PaperMC/Paper/issues/9046 diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 19009f0c1d572eebad6cce93f8cf56ca820fc33f..61840cfd64caba6595dfc99c91c76a195638d4ee 100644 +index 15464ef7779d62f1dba5edeabcb91c6e677e676f..72d013d06705b08ed696e3d3b6d631d65800c2c9 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -333,7 +333,9 @@ public class Main { diff --git a/patches/server/0876-Refresh-ProjectileSource-for-projectiles.patch b/patches/server/0876-Refresh-ProjectileSource-for-projectiles.patch index 8f394bd9c5..dae5f4e3f7 100644 --- a/patches/server/0876-Refresh-ProjectileSource-for-projectiles.patch +++ b/patches/server/0876-Refresh-ProjectileSource-for-projectiles.patch @@ -14,7 +14,7 @@ clearing the owner. Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com> diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 6c8c7b3c701ba258610cef86997ff3bc13e37bcb..650001a295128f97ce2242b60a6dc93885c84268 100644 +index 287450e58076e63f9686a1ad2c1148c24a5c7252..1ce9f436fee9722fc7367447333db8e13230c156 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -383,6 +383,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0878-Fix-block-place-logic.patch b/patches/server/0878-Fix-block-place-logic.patch index 7e51b26fd8..ed85c474b6 100644 --- a/patches/server/0878-Fix-block-place-logic.patch +++ b/patches/server/0878-Fix-block-place-logic.patch @@ -41,10 +41,10 @@ index 0e9d515381a673e683b63a12c1a9e79a5eedd80b..096eb30dcfdd62b1d946891f7480e9d9 } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index f368da2e63f5c42166749789d759056b70973614..f4db64595f4434c9225923390c4fe7d7e0af6d26 100644 +index 0bf91f88a9385797c508d165501ab18658707d71..16a4a9e28d920e2a3dfdb303ba79caa915fd1646 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -579,17 +579,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -570,17 +570,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // CraftBukkit start iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam CraftWorld world = ((ServerLevel) this).getWorld(); diff --git a/patches/server/0881-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch b/patches/server/0881-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch index f507353a95..cbd650b0fc 100644 --- a/patches/server/0881-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch +++ b/patches/server/0881-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't enforce icanhasbukkit default if alias block exists diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index cda293ee6281ba01f9f924ad5c65d8ad96ab50f6..534d250da9fa7715ff25e3e1b1e7362940e82056 100644 +index 020c27007dc7b6071206a649fb9fb3611ebef8e7..86eb586a443c6cd4ec87582972dafd82ed2e5940 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -352,7 +352,11 @@ public final class CraftServer implements Server { diff --git a/patches/server/0890-Call-missing-BlockDispenseEvent.patch b/patches/server/0890-Call-missing-BlockDispenseEvent.patch index 37ab073a29..10c8842a7a 100644 --- a/patches/server/0890-Call-missing-BlockDispenseEvent.patch +++ b/patches/server/0890-Call-missing-BlockDispenseEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Call missing BlockDispenseEvent diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index a16fb04c014d3b2f3dac0610f8be81586d41c4e9..ad9eb752a2676c6acdba601b63a5fd1611316267 100644 +index b83af374a33a66a6ceeca119b961eea883bba41c..175b965c92b8b8be9c671e1ee478afa9a2f7bf82 100644 --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -@@ -1106,6 +1106,13 @@ public interface DispenseItemBehavior { +@@ -1112,6 +1112,13 @@ public interface DispenseItemBehavior { this.setSuccess(true); if (iblockdata.is(Blocks.RESPAWN_ANCHOR)) { if ((Integer) iblockdata.getValue(RespawnAnchorBlock.CHARGE) != 4) { @@ -22,7 +22,7 @@ index a16fb04c014d3b2f3dac0610f8be81586d41c4e9..ad9eb752a2676c6acdba601b63a5fd16 RespawnAnchorBlock.charge((Entity) null, worldserver, blockposition, iblockdata); stack.shrink(1); } else { -@@ -1128,6 +1135,13 @@ public interface DispenseItemBehavior { +@@ -1134,6 +1141,13 @@ public interface DispenseItemBehavior { Optional optional = HoneycombItem.getWaxed(iblockdata); if (optional.isPresent()) { @@ -36,7 +36,7 @@ index a16fb04c014d3b2f3dac0610f8be81586d41c4e9..ad9eb752a2676c6acdba601b63a5fd16 worldserver.setBlockAndUpdate(blockposition, (BlockState) optional.get()); worldserver.levelEvent(3003, blockposition, 0); stack.shrink(1); -@@ -1153,6 +1167,12 @@ public interface DispenseItemBehavior { +@@ -1159,6 +1173,12 @@ public interface DispenseItemBehavior { if (!worldserver.getBlockState(blockposition1).is(BlockTags.CONVERTABLE_TO_MUD)) { return this.defaultDispenseItemBehavior.dispense(pointer, stack); } else { diff --git a/patches/server/0891-Don-t-load-chunks-for-supporting-block-checks.patch b/patches/server/0891-Don-t-load-chunks-for-supporting-block-checks.patch index 6e0304e143..a007970ad4 100644 --- a/patches/server/0891-Don-t-load-chunks-for-supporting-block-checks.patch +++ b/patches/server/0891-Don-t-load-chunks-for-supporting-block-checks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't load chunks for supporting block checks diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 650001a295128f97ce2242b60a6dc93885c84268..9785571cf5b0059d404ae325047dd57633d83421 100644 +index 1ce9f436fee9722fc7367447333db8e13230c156..53ab3716ae22982a8d94663e3e2a1d7d250a816d 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1240,7 +1240,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0892-Optimize-player-lookups-for-beacons.patch b/patches/server/0892-Optimize-player-lookups-for-beacons.patch index a71b654065..4bc0ad23be 100644 --- a/patches/server/0892-Optimize-player-lookups-for-beacons.patch +++ b/patches/server/0892-Optimize-player-lookups-for-beacons.patch @@ -7,7 +7,7 @@ For larger ranges, it's better to iterate over the player list than the entity slices. diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index 44660b9f3d8ef6df42dc05e774a5804fdbfa5d14..3ccc0a8d2091d45100198f2853c17edf62c27728 100644 +index dbcac8b787e9a18193723b5311fe882060397dc6..bfcf9e0c342f255d285b1ef7f88d71efed653ecd 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java @@ -329,7 +329,22 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name diff --git a/patches/server/0903-Implement-PlayerFailMoveEvent.patch b/patches/server/0903-Implement-PlayerFailMoveEvent.patch index 1214d127e3..23a834dc70 100644 --- a/patches/server/0903-Implement-PlayerFailMoveEvent.patch +++ b/patches/server/0903-Implement-PlayerFailMoveEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement PlayerFailMoveEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index d2916743981c6632957ab8bed5ae7a2334c5646b..51be87480186f1b879f6c847030857aa735155e4 100644 +index 6fb45dab9cb2bc0319ab185bcbea5386ff1ab252..863662dddfe31cef1d9a446efc9a2f0326c23f80 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1279,8 +1279,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0904-Folia-scheduler-and-owned-region-API.patch b/patches/server/0904-Folia-scheduler-and-owned-region-API.patch index fd8d41d360..9c2bf14cd6 100644 --- a/patches/server/0904-Folia-scheduler-and-owned-region-API.patch +++ b/patches/server/0904-Folia-scheduler-and-owned-region-API.patch @@ -1148,10 +1148,10 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 34b17c9ced5ac2b6ad8ef35eb774724a6c78c28e..f1551b0c6a3a466cb755c8061fe7fcbc0b1e34df 100644 +index c18ba90d3809ee1b2a1a1a7c3b7364cdb5ac6b3c..9efd93bd086ea342527b2ff530b4eb4f7df1f777 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1443,6 +1443,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop true, iregistry); + } - long j = BiomeManager.obfuscateSeed(creator.seed()); + long j = BiomeManager.obfuscateSeed(worlddata.worldGenOptions().seed()); // Paper - use world seed diff --git a/patches/server/0918-Deprecate-and-replace-methods-with-old-StructureType.patch b/patches/server/0918-Deprecate-and-replace-methods-with-old-StructureType.patch index 12c37fb854..2e2998ff90 100644 --- a/patches/server/0918-Deprecate-and-replace-methods-with-old-StructureType.patch +++ b/patches/server/0918-Deprecate-and-replace-methods-with-old-StructureType.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Deprecate and replace methods with old StructureType diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 369458e42ed787d75e35bddd4d8514a5d49503bc..7803e3b9d18e213b0d9159b1be4536734cc6e88b 100644 +index 70631060e8890e6a22d0be8bbe8871e39666c4d0..be285f915e669a6b9e29ab80cec4a46546f2d09b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1951,6 +1951,11 @@ public final class CraftServer implements Server { +@@ -1945,6 +1945,11 @@ public final class CraftServer implements Server { ServerLevel worldServer = ((CraftWorld) world).getHandle(); Location structureLocation = world.locateNearestStructure(location, structureType, radius, findUnexplored); @@ -20,7 +20,7 @@ index 369458e42ed787d75e35bddd4d8514a5d49503bc..7803e3b9d18e213b0d9159b1be453673 BlockPos structurePosition = CraftLocation.toBlockPosition(structureLocation); // Create map with trackPlayer = true, unlimitedTracking = true -@@ -1961,6 +1966,31 @@ public final class CraftServer implements Server { +@@ -1955,6 +1960,31 @@ public final class CraftServer implements Server { return CraftItemStack.asBukkitCopy(stack); } diff --git a/patches/server/0919-Don-t-tab-complete-namespaced-commands-if-send-names.patch b/patches/server/0919-Don-t-tab-complete-namespaced-commands-if-send-names.patch index 251f339980..edb74b4913 100644 --- a/patches/server/0919-Don-t-tab-complete-namespaced-commands-if-send-names.patch +++ b/patches/server/0919-Don-t-tab-complete-namespaced-commands-if-send-names.patch @@ -11,7 +11,7 @@ This patch prevents server from sending namespaced commands when player requests tab-complete only commands. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 51be87480186f1b879f6c847030857aa735155e4..b5c1b8884e762bdabd0f8a64662b4a8debd29b10 100644 +index 863662dddfe31cef1d9a446efc9a2f0326c23f80..9f30c8a271db87fff58e28dbec91dab7209c42a7 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -770,6 +770,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0927-Expand-Pose-API.patch b/patches/server/0927-Expand-Pose-API.patch index dba3432d69..cd53e48bb1 100644 --- a/patches/server/0927-Expand-Pose-API.patch +++ b/patches/server/0927-Expand-Pose-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expand Pose API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 90a5cd8735ffa01b5cdbe807ef5fea0467d45813..e6695cf44190734278fc9a01fa928cd53421b260 100644 +index 8fc2dd2c2389657d2de2c4036117eb949a883a97..c610bb83e49fcc97f3f69bbe03b854bcef9acb37 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -418,6 +418,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0929-Deep-clone-unhandled-nbt-tags.patch b/patches/server/0929-Deep-clone-unhandled-nbt-tags.patch index 36686863ba..92b2d6cbb9 100644 --- a/patches/server/0929-Deep-clone-unhandled-nbt-tags.patch +++ b/patches/server/0929-Deep-clone-unhandled-nbt-tags.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Deep clone unhandled nbt tags diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 8af7ef1c12a7826e607b15f1376311e9d38e7f31..4e7f5bfcdb8af7a9237dee3c8ebf9cde6f1248a4 100644 +index d42f4640a53221ffa7a479bce681374527cb3a0c..61813713aa2de0a4761d423e6a2d569fd776f88b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -305,7 +305,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { diff --git a/patches/server/0930-Add-PlayerPickItemEvent.patch b/patches/server/0930-Add-PlayerPickItemEvent.patch index 64af19c7e4..60bdf01f72 100644 --- a/patches/server/0930-Add-PlayerPickItemEvent.patch +++ b/patches/server/0930-Add-PlayerPickItemEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerPickItemEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b5c1b8884e762bdabd0f8a64662b4a8debd29b10..ebdfd3d52e48781c07e92b468220642a1c10b9eb 100644 +index 9f30c8a271db87fff58e28dbec91dab7209c42a7..302ff57c7fb90f5ccddefa222f6b5fdd8fb3cf22 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -907,8 +907,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0936-Add-titleOverride-to-InventoryOpenEvent.patch b/patches/server/0936-Add-titleOverride-to-InventoryOpenEvent.patch index 0385797706..9f28b90369 100644 --- a/patches/server/0936-Add-titleOverride-to-InventoryOpenEvent.patch +++ b/patches/server/0936-Add-titleOverride-to-InventoryOpenEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add titleOverride to InventoryOpenEvent diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 50400964b30952fcaae04536bff906e44c9a3a3d..649e175b6d656fa89c1a59c36230b793c8d07e15 100644 +index dc99cf246bfca6543f4e53b0102770d0fd94250f..3450e5a31437ce17a5b4499b8d08ce0b2623704d 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1568,12 +1568,17 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0940-Add-slot-sanity-checks-in-container-clicks.patch b/patches/server/0940-Add-slot-sanity-checks-in-container-clicks.patch index 474ffdad04..47a29c00d3 100644 --- a/patches/server/0940-Add-slot-sanity-checks-in-container-clicks.patch +++ b/patches/server/0940-Add-slot-sanity-checks-in-container-clicks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add slot sanity checks in container clicks diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ebdfd3d52e48781c07e92b468220642a1c10b9eb..1d22b4ba82b440f163137ea6f8a182a00898c15b 100644 +index 302ff57c7fb90f5ccddefa222f6b5fdd8fb3cf22..fc540b879230b5a5f8d6e01fa435ce140849a712 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2899,6 +2899,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0943-Fix-silent-equipment-change-for-mobs.patch b/patches/server/0943-Fix-silent-equipment-change-for-mobs.patch index f1f8845702..f0c25febe7 100644 --- a/patches/server/0943-Fix-silent-equipment-change-for-mobs.patch +++ b/patches/server/0943-Fix-silent-equipment-change-for-mobs.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix silent equipment change for mobs diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 6482dc12324524b92e0161055ad13d27dfb7f97d..704f63bb90b4268f25c24b724e08d9d74583e818 100644 +index 8cc40521146d02bbfafbb113dda8183840814c96..433d8eccdd225651af8c88babfdb94d19ce546d8 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -1046,13 +1046,20 @@ public abstract class Mob extends LivingEntity implements Targeting { diff --git a/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch b/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch index 6ef49c0dae..7561d0ddff 100644 --- a/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch +++ b/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch @@ -10,7 +10,7 @@ which would cause a crash on Folia but would appear to function fine on Paper. diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index 00e60bba33fe3e100070bb3ded55e5253a8db138..b7aa80f94ae2bbbc94ad335fd1d3078ee78ff2e4 100644 +index 279da8d43f16b4c1372d0d427891389fb7b6c780..5aff6454b5b1c7834adca8f1234ec4848aa3709c 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java @@ -363,6 +363,13 @@ public class ChunkSerializer { diff --git a/patches/server/0953-Fix-missing-map-initialize-event-call.patch b/patches/server/0953-Fix-missing-map-initialize-event-call.patch index 3789e0b4bc..92d235cc79 100644 --- a/patches/server/0953-Fix-missing-map-initialize-event-call.patch +++ b/patches/server/0953-Fix-missing-map-initialize-event-call.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Fix missing map initialize event call public net.minecraft.world.level.storage.DimensionDataStorage readSavedData(Ljava/util/function/Function;Lnet/minecraft/util/datafix/DataFixTypes;Ljava/lang/String;)Lnet/minecraft/world/level/saveddata/SavedData; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c711c7221ae001c46dcb82def726c6ed9cca1ac9..2ab478e0940eae27e6e886a36ed3c1278b3f8ae1 100644 +index c17c0fe2b67024513379304e1be79f88474aa4ff..316f4ef261592b8c508f73d6b3a0e99bcfe5b106 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1927,13 +1927,25 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0969-Add-hand-to-fish-event-for-all-player-interactions.patch b/patches/server/0969-Add-hand-to-fish-event-for-all-player-interactions.patch index 0df08a85bc..92577eb2a1 100644 --- a/patches/server/0969-Add-hand-to-fish-event-for-all-player-interactions.patch +++ b/patches/server/0969-Add-hand-to-fish-event-for-all-player-interactions.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add hand to fish event for all player interactions diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -index a9eaa079a43bc8a5e81deaf6df5ce2f9c53cb319..5706c9b744b660d6f7639b8152dce82799c4b466 100644 +index f3694d432e280cace281eda95d8c2d4dd5d6930a..2378850b5d9e93ad0a52976de65ef35e29703a2c 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java @@ -474,7 +474,15 @@ public class FishingHook extends Projectile { diff --git a/patches/server/0974-Don-t-fire-sync-events-during-worldgen.patch b/patches/server/0974-Don-t-fire-sync-events-during-worldgen.patch index aad124c975..9edbdda6d2 100644 --- a/patches/server/0974-Don-t-fire-sync-events-during-worldgen.patch +++ b/patches/server/0974-Don-t-fire-sync-events-during-worldgen.patch @@ -19,7 +19,7 @@ where generation happened directly to a ServerLevel and the entity still has the flag set. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 2ab478e0940eae27e6e886a36ed3c1278b3f8ae1..b54e89d68ba32f2a79e16d49f86a258b5f6df133 100644 +index 316f4ef261592b8c508f73d6b3a0e99bcfe5b106..09a9452705cc8d4133940c081583d6d38d226f71 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1490,6 +1490,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -31,7 +31,7 @@ index 2ab478e0940eae27e6e886a36ed3c1278b3f8ae1..b54e89d68ba32f2a79e16d49f86a258b if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on {}", entity, new Throwable()); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index e6695cf44190734278fc9a01fa928cd53421b260..6813998a6bf9e74d663194a6be6bc222b8b129b6 100644 +index c610bb83e49fcc97f3f69bbe03b854bcef9acb37..eef69be6cce94d89688f7d485627a8b665b863c7 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -676,7 +676,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -48,7 +48,7 @@ index e6695cf44190734278fc9a01fa928cd53421b260..6813998a6bf9e74d663194a6be6bc222 this.entityData.set(Entity.DATA_POSE, pose); } diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index a6e20b5ee4fe1841dfc2350264b5935b968fe3f3..9da8d56ff3768fb37d1ab89300da4eca19e6218d 100644 +index fe8efe89c7d390ff9565f388685b57daeebfd08b..0f111b76ccbc260a1dad562c9c1d8a0465849dfe 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -588,9 +588,15 @@ public class EntityType implements FeatureElement, EntityTypeT diff --git a/patches/server/0975-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch b/patches/server/0975-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch index 8998416ffa..40da841e83 100644 --- a/patches/server/0975-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch +++ b/patches/server/0975-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix CraftMetaItem#getAttributeModifier duplication check diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 4e7f5bfcdb8af7a9237dee3c8ebf9cde6f1248a4..b2f9a670c5224fb63081466fa594b2b4b3e8bddb 100644 +index 61813713aa2de0a4761d423e6a2d569fd776f88b..95c75aadea68e9b60caa935a88f2829e36948ae5 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -1167,7 +1167,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { diff --git a/patches/server/0976-Restore-vanilla-entity-drops-behavior.patch b/patches/server/0976-Restore-vanilla-entity-drops-behavior.patch index 1f226a4c15..88bfbc47a1 100644 --- a/patches/server/0976-Restore-vanilla-entity-drops-behavior.patch +++ b/patches/server/0976-Restore-vanilla-entity-drops-behavior.patch @@ -50,7 +50,7 @@ index 3450e5a31437ce17a5b4499b8d08ce0b2623704d..e03d2d3d35470cb3971606c66da38267 if (entityitem == null) { return null; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 15646a96a87fce09df13f2c723ea83e2893e764e..58d40a00ea91da905cbca13428029275c667abba 100644 +index eef69be6cce94d89688f7d485627a8b665b863c7..95ef55c232b605691d462aa532f93d338bb6600c 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2528,6 +2528,25 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/0982-add-more-scoreboard-API.patch b/patches/server/0981-add-more-scoreboard-API.patch similarity index 100% rename from patches/server/0982-add-more-scoreboard-API.patch rename to patches/server/0981-add-more-scoreboard-API.patch diff --git a/patches/server/0983-Improve-Registry.patch b/patches/server/0982-Improve-Registry.patch similarity index 100% rename from patches/server/0983-Improve-Registry.patch rename to patches/server/0982-Improve-Registry.patch diff --git a/patches/server/0984-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch b/patches/server/0983-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch similarity index 100% rename from patches/server/0984-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch rename to patches/server/0983-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch diff --git a/patches/server/0985-Add-experience-points-API.patch b/patches/server/0984-Add-experience-points-API.patch similarity index 100% rename from patches/server/0985-Add-experience-points-API.patch rename to patches/server/0984-Add-experience-points-API.patch diff --git a/patches/server/0986-Add-missing-InventoryType.patch b/patches/server/0985-Add-missing-InventoryType.patch similarity index 100% rename from patches/server/0986-Add-missing-InventoryType.patch rename to patches/server/0985-Add-missing-InventoryType.patch diff --git a/patches/server/0987-Add-drops-to-shear-events.patch b/patches/server/0986-Add-drops-to-shear-events.patch similarity index 100% rename from patches/server/0987-Add-drops-to-shear-events.patch rename to patches/server/0986-Add-drops-to-shear-events.patch diff --git a/patches/server/0988-Add-PlayerShieldDisableEvent.patch b/patches/server/0987-Add-PlayerShieldDisableEvent.patch similarity index 100% rename from patches/server/0988-Add-PlayerShieldDisableEvent.patch rename to patches/server/0987-Add-PlayerShieldDisableEvent.patch diff --git a/patches/server/0991-Validate-ResourceLocation-in-NBT-reading.patch b/patches/server/0988-Validate-ResourceLocation-in-NBT-reading.patch similarity index 98% rename from patches/server/0991-Validate-ResourceLocation-in-NBT-reading.patch rename to patches/server/0988-Validate-ResourceLocation-in-NBT-reading.patch index b025bc4297..a88ee23306 100644 --- a/patches/server/0991-Validate-ResourceLocation-in-NBT-reading.patch +++ b/patches/server/0988-Validate-ResourceLocation-in-NBT-reading.patch @@ -40,7 +40,7 @@ index 5f9dcab27a07969c93555ad0892683c62cbebc8c..a4d875df936b6de16f0233482b03af05 this.path = path; } diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 9da8d56ff3768fb37d1ab89300da4eca19e6218d..edc723ea5ca3a325106e7af38c60dbf9f0f5fb77 100644 +index 0f111b76ccbc260a1dad562c9c1d8a0465849dfe..704e0b03d3bdff01eacd7781715f2d3a901155b1 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -618,7 +618,7 @@ public class EntityType implements FeatureElement, EntityTypeT diff --git a/patches/server/0992-Properly-handle-experience-dropping-on-block-break.patch b/patches/server/0989-Properly-handle-experience-dropping-on-block-break.patch similarity index 97% rename from patches/server/0992-Properly-handle-experience-dropping-on-block-break.patch rename to patches/server/0989-Properly-handle-experience-dropping-on-block-break.patch index 65ac0307f5..a89e4dc3ae 100644 --- a/patches/server/0992-Properly-handle-experience-dropping-on-block-break.patch +++ b/patches/server/0989-Properly-handle-experience-dropping-on-block-break.patch @@ -7,10 +7,10 @@ This causes spawnAfterBreak to spawn xp by default, removing the need to manuall For classes that use custom xp amounts, they can drop the resources with disabling diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 8e5b0eb355d2102180288e5e8c37ccaf59b28288..eb91ed53cfc298198089416aae6c91634734985b 100644 +index 035c9c78d848d1dc69ace27e2c139834864d55e5..9a0d648f04063dd7701d1cbe548a6d45fc216928 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -644,7 +644,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -635,7 +635,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { if (drop) { BlockEntity tileentity = iblockdata.hasBlockEntity() ? this.getBlockEntity(pos) : null; diff --git a/patches/server/0993-Fixup-NamespacedKey-handling.patch b/patches/server/0990-Fixup-NamespacedKey-handling.patch similarity index 100% rename from patches/server/0993-Fixup-NamespacedKey-handling.patch rename to patches/server/0990-Fixup-NamespacedKey-handling.patch diff --git a/patches/server/0994-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/patches/server/0991-Reduce-allocation-of-Vec3D-by-entity-tracker.patch similarity index 100% rename from patches/server/0994-Reduce-allocation-of-Vec3D-by-entity-tracker.patch rename to patches/server/0991-Reduce-allocation-of-Vec3D-by-entity-tracker.patch diff --git a/patches/server/0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch b/patches/server/0992-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch similarity index 98% rename from patches/server/0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch rename to patches/server/0992-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch index 83484b5865..6921c1c664 100644 --- a/patches/server/0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch +++ b/patches/server/0992-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch @@ -62,10 +62,10 @@ index bb8e962e63c7a2d931f9bd7f7c002aa35cfa5fd3..0fa131a6c98adb498fc8d534e0e39647 default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) { // Paper start - Add predicate for blocks when raytracing diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index eb91ed53cfc298198089416aae6c91634734985b..5c9b361c1d768de29710a395c77711fa476a152f 100644 +index 9a0d648f04063dd7701d1cbe548a6d45fc216928..d7742e1663101490e6f12f309a079588c7497919 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -343,10 +343,87 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -334,10 +334,87 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return null; } diff --git a/patches/server/0996-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch b/patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch similarity index 96% rename from patches/server/0996-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch rename to patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch index 5b2fde2ea1..3e357fc47f 100644 --- a/patches/server/0996-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch +++ b/patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch @@ -29,10 +29,10 @@ index 369b54b96c682717ef93d05312714b4d30efaceb..beadef19ee136c27601f0d116a869673 this.x = x; this.y = y; diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 5c9b361c1d768de29710a395c77711fa476a152f..eebe293a9307d4fd55b30ae1e88453a4546bafaf 100644 +index d7742e1663101490e6f12f309a079588c7497919..6163a682f12d75fa2658ecd0de33ee56dbc5771b 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -428,7 +428,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -419,7 +419,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // Paper end public boolean isInWorldBounds(BlockPos pos) { diff --git a/patches/server/0997-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/patches/server/0994-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch similarity index 100% rename from patches/server/0997-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch rename to patches/server/0994-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch diff --git a/patches/server/0998-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/patches/server/0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch similarity index 100% rename from patches/server/0998-Optimize-Network-Manager-and-add-advanced-packet-sup.patch rename to patches/server/0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch diff --git a/patches/server/0999-Allow-Saving-of-Oversized-Chunks.patch b/patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch similarity index 97% rename from patches/server/0999-Allow-Saving-of-Oversized-Chunks.patch rename to patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch index 1cba9cff01..f6a81ca166 100644 --- a/patches/server/0999-Allow-Saving-of-Oversized-Chunks.patch +++ b/patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch @@ -141,10 +141,10 @@ index bc8038da65f834249c61a262fc1a5abb7cc91a63..6c89b92cac521808873e9e1eccc36369 private final ChunkPos pos; diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index 0b17369dda00b415ed15c7215f222b891a1dc2ee..aa2ff1e4a07fc3d01414b8a1dbaccb4959e74670 100644 +index f1ecc3832da094400ed9d45bfc60af10da682b4a..f27cf743bbc379520263909541d653dd38d1be58 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -@@ -144,6 +144,43 @@ public class RegionFileStorage implements AutoCloseable { +@@ -121,6 +121,43 @@ public class RegionFileStorage implements AutoCloseable { } } @@ -188,7 +188,7 @@ index 0b17369dda00b415ed15c7215f222b891a1dc2ee..aa2ff1e4a07fc3d01414b8a1dbaccb49 @Nullable public CompoundTag read(ChunkPos pos) throws IOException { // CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing -@@ -155,6 +192,12 @@ public class RegionFileStorage implements AutoCloseable { +@@ -132,6 +169,12 @@ public class RegionFileStorage implements AutoCloseable { try { // Paper DataInputStream datainputstream = regionfile.getChunkDataInputStream(pos); @@ -201,7 +201,7 @@ index 0b17369dda00b415ed15c7215f222b891a1dc2ee..aa2ff1e4a07fc3d01414b8a1dbaccb49 CompoundTag nbttagcompound; label43: { -@@ -246,6 +289,7 @@ public class RegionFileStorage implements AutoCloseable { +@@ -223,6 +266,7 @@ public class RegionFileStorage implements AutoCloseable { try { NbtIo.write(nbt, (DataOutput) dataoutputstream); diff --git a/patches/server/1000-Fix-World-isChunkGenerated-calls.patch b/patches/server/0997-Fix-World-isChunkGenerated-calls.patch similarity index 98% rename from patches/server/1000-Fix-World-isChunkGenerated-calls.patch rename to patches/server/0997-Fix-World-isChunkGenerated-calls.patch index 105088ea4f..d6d244f7be 100644 --- a/patches/server/1000-Fix-World-isChunkGenerated-calls.patch +++ b/patches/server/0997-Fix-World-isChunkGenerated-calls.patch @@ -141,10 +141,10 @@ index 6c89b92cac521808873e9e1eccc363695275cd7a..92ba75254f6ffca40abd5485dbb4789d this.padToFullSector(); } finally { diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index aa2ff1e4a07fc3d01414b8a1dbaccb4959e74670..0d4ca8629707ba5cee10ee94b330404291cd2c30 100644 +index f27cf743bbc379520263909541d653dd38d1be58..0db8ee3b640e6d1268e9c1cccda85459bd447105 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -@@ -289,6 +289,7 @@ public class RegionFileStorage implements AutoCloseable { +@@ -266,6 +266,7 @@ public class RegionFileStorage implements AutoCloseable { try { NbtIo.write(nbt, (DataOutput) dataoutputstream); diff --git a/patches/server/1001-Flat-bedrock-generator-settings.patch b/patches/server/0998-Flat-bedrock-generator-settings.patch similarity index 100% rename from patches/server/1001-Flat-bedrock-generator-settings.patch rename to patches/server/0998-Flat-bedrock-generator-settings.patch diff --git a/patches/server/1002-Entity-Activation-Range-2.0.patch b/patches/server/0999-Entity-Activation-Range-2.0.patch similarity index 97% rename from patches/server/1002-Entity-Activation-Range-2.0.patch rename to patches/server/0999-Entity-Activation-Range-2.0.patch index 842f87192e..42423e9444 100644 --- a/patches/server/1002-Entity-Activation-Range-2.0.patch +++ b/patches/server/0999-Entity-Activation-Range-2.0.patch @@ -111,7 +111,7 @@ index 5f3502b148588a76079c1d9f55e4203f6de56406..4357d45305cdf82659fcc0df9fa42b1a } else { passenger.stopRiding(); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 58d40a00ea91da905cbca13428029275c667abba..dbe4a41b8121d4e8ae8cf12c4a73d8148030c48e 100644 +index f83d16fbd7ddaa71578e3de0b35438e699c6fa22..bcd6201818a2a5ca6656e031e1e3321c9a637420 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -411,6 +411,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -339,7 +339,7 @@ index b149e8bcac034bb3fc118a9adcb0de45e18ed5e9..fc35cfc9d045f3e5b6a50af1d0ba83b6 + } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index eebe293a9307d4fd55b30ae1e88453a4546bafaf..84761bacda56c7288f22e122560f24f4e25f3bf3 100644 +index 6163a682f12d75fa2658ecd0de33ee56dbc5771b..9b574d4aa1faf5814942641c48afe503d6f83bc4 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -162,6 +162,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -371,7 +371,7 @@ index b1061db1d9b3bfde61d5016e10556c4320095827..c71690dbc3dc52803945f1608f0ee3ba } } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index dfbcddadea4a89c4cfc879105cfacae6dde742a9..fafc8b84d6b6368c70b8eedfdb4c3a9deace9c26 100644 +index 90df7e83d9166c22a56a31db22d843768229b9ab..c39894e824334f1dc52e0466cf9d84f7e219be70 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -1,33 +1,43 @@ @@ -525,7 +525,7 @@ index dfbcddadea4a89c4cfc879105cfacae6dde742a9..fafc8b84d6b6368c70b8eedfdb4c3a9d maxRange = Math.min( ( world.spigotConfig.simulationDistance << 4 ) - 8, maxRange ); for ( Player player : world.players() ) -@@ -130,11 +199,17 @@ public class ActivationRange +@@ -130,13 +199,30 @@ public class ActivationRange continue; } @@ -546,9 +546,23 @@ index dfbcddadea4a89c4cfc879105cfacae6dde742a9..fafc8b84d6b6368c70b8eedfdb4c3a9d + ActivationType.VILLAGER.boundingBox = player.getBoundingBox().inflate( villagerActivationRange, worldHeight, villagerActivationRange ); + // Paper end - // Paper start - java.util.List entities = world.getEntities((Entity)null, ActivationRange.maxBB, null); -@@ -181,60 +256,118 @@ public class ActivationRange +- world.getEntities().get(ActivationRange.maxBB, ActivationRange::activateEntity); ++ // Paper start ++ java.util.List entities = world.getEntities((Entity)null, ActivationRange.maxBB, null); ++ boolean tickMarkers = world.paperConfig().entities.markers.tick; // Paper - Configurable marker ticking ++ for (Entity entity : entities) { ++ // Paper start - Configurable marker ticking ++ if (!tickMarkers && entity instanceof net.minecraft.world.entity.Marker) { ++ continue; ++ } ++ // Paper end - Configurable marker ticking ++ ActivationRange.activateEntity(entity); ++ } ++ // Paper end + } + MinecraftTimings.entityActivationCheckTimer.stopTiming(); + } +@@ -169,60 +255,118 @@ public class ActivationRange * @param entity * @return */ @@ -621,7 +635,8 @@ index dfbcddadea4a89c4cfc879105cfacae6dde742a9..fafc8b84d6b6368c70b8eedfdb4c3a9d + ) { + return 20; + } -+ } + } +- if ( entity instanceof Villager && ( (Villager) entity ).canBreed() ) + if ( entity instanceof Villager ) { + Brain behaviorController = ((Villager) entity).getBrain(); + @@ -638,8 +653,7 @@ index dfbcddadea4a89c4cfc879105cfacae6dde742a9..fafc8b84d6b6368c70b8eedfdb4c3a9d + return config.villagersWorkImmunityFor; + } + } - } -- if ( entity instanceof Villager && ( (Villager) entity ).canBreed() ) ++ } + if ( entity instanceof Llama && ( (Llama) entity ).inCaravan() ) { - return true; @@ -684,7 +698,7 @@ index dfbcddadea4a89c4cfc879105cfacae6dde742a9..fafc8b84d6b6368c70b8eedfdb4c3a9d } /** -@@ -249,8 +382,19 @@ public class ActivationRange +@@ -237,8 +381,19 @@ public class ActivationRange if ( entity instanceof FireworkRocketEntity ) { return true; } @@ -705,7 +719,7 @@ index dfbcddadea4a89c4cfc879105cfacae6dde742a9..fafc8b84d6b6368c70b8eedfdb4c3a9d // Should this entity tick? if ( !isActive ) -@@ -258,15 +402,19 @@ public class ActivationRange +@@ -246,15 +401,19 @@ public class ActivationRange if ( ( MinecraftServer.currentTick - entity.activatedTick - 1 ) % 20 == 0 ) { // Check immunities every 20 ticks. diff --git a/patches/server/1003-Optional-per-player-mob-spawns.patch b/patches/server/1000-Optional-per-player-mob-spawns.patch similarity index 100% rename from patches/server/1003-Optional-per-player-mob-spawns.patch rename to patches/server/1000-Optional-per-player-mob-spawns.patch diff --git a/patches/server/1004-Anti-Xray.patch b/patches/server/1001-Anti-Xray.patch similarity index 99% rename from patches/server/1004-Anti-Xray.patch rename to patches/server/1001-Anti-Xray.patch index d90bfc603c..9b8c973f5a 100644 --- a/patches/server/1004-Anti-Xray.patch +++ b/patches/server/1001-Anti-Xray.patch @@ -1139,10 +1139,10 @@ index bc0df2e1401b13737e23faae01ba16edc2a10d21..97490f58aace9bfb6d034e9a97393142 public void destroyAndAck(BlockPos pos, int sequence, String reason) { diff --git a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java -index 43e3c99eafaed42161664e31827dfd0abb127ad2..fb1863d235a61ec977e8ad87a289d935a9c5d0e4 100644 +index f3b96a921e7d085b51da62fa5493384a7ded1f9d..12f2bf95d3ea3d29f6b4b9ec38a92f7102daa4a1 100644 --- a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java +++ b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java -@@ -90,7 +90,10 @@ public class PlayerChunkSender { +@@ -88,7 +88,10 @@ public class PlayerChunkSender { public static void sendChunk(ServerGamePacketListenerImpl handler, ServerLevel world, LevelChunk chunk) { // Paper - rewrite chunk loader - public handler.player.serverLevel().chunkSource.chunkMap.getVisibleChunkIfPresent(chunk.getPos().toLong()).addPlayer(handler.player); @@ -1168,7 +1168,7 @@ index 34bd7e81f9480c97afd69c11eca216b03e6a5a1f..eae6121a2f3fb33146b0a625cc82c8bc } // Paper end - Send empty chunk diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 6d67582fe7108eefb88fd8ebce610c54ced12e7f..3805556aaef0a92fc043e9542876af897b1e3c3c 100644 +index 9b574d4aa1faf5814942641c48afe503d6f83bc4..6dafbbed864feebe73c648cf38cee6d64e9eea85 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -177,6 +177,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1179,7 +1179,7 @@ index 6d67582fe7108eefb88fd8ebce610c54ced12e7f..3805556aaef0a92fc043e9542876af89 public final co.aikar.timings.WorldTimingsHandler timings; // Paper public static BlockPos lastPhysicsProblem; // Spigot private org.spigotmc.TickLimiter entityLimiter; -@@ -211,7 +212,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -202,7 +203,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public abstract ResourceKey getTypeKey(); @@ -1188,7 +1188,7 @@ index 6d67582fe7108eefb88fd8ebce610c54ced12e7f..3805556aaef0a92fc043e9542876af89 this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config this.generator = gen; -@@ -297,6 +298,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -288,6 +289,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper - Option to keep spawn chunks loaded this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); @@ -1196,7 +1196,7 @@ index 6d67582fe7108eefb88fd8ebce610c54ced12e7f..3805556aaef0a92fc043e9542876af89 } // Paper start - Cancel hit for vanished players -@@ -572,6 +574,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -563,6 +565,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // CraftBukkit end BlockState iblockdata1 = chunk.setBlockState(pos, state, (flags & 64) != 0, (flags & 1024) == 0); // CraftBukkit custom NO_PLACE flag @@ -1504,7 +1504,7 @@ index 9a2bf744abd8916d492e901be889223591bac3fd..1dd415c96d17eff8e7555c33d3c52e57 int getSerializedSize(); diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index b7aa80f94ae2bbbc94ad335fd1d3078ee78ff2e4..d25b24eb03d9b2d92c159ac4d0f8039784af1748 100644 +index 5aff6454b5b1c7834adca8f1234ec4848aa3709c..4bef691ad22b6638847aebb471a3c28522c7a461 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java @@ -71,7 +71,7 @@ import org.slf4j.Logger; @@ -1571,10 +1571,10 @@ index d4e0ef75dd12709a0dcf9193821c30b8943e6c36..fd702027e62eb38d51fb7c46ef268e9b private static final byte[] EMPTY_LIGHT = new byte[2048]; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 49c7a4ec810b92b57f6cd491844974219109519f..ad826f052523eb7c0423a6706498664a83c1b4a3 100644 +index be285f915e669a6b9e29ab80cec4a46546f2d09b..ade9c05017f47e904fec7edb4a8dd2e14280ca14 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2616,7 +2616,7 @@ public final class CraftServer implements Server { +@@ -2610,7 +2610,7 @@ public final class CraftServer implements Server { public ChunkGenerator.ChunkData createChunkData(World world) { Preconditions.checkArgument(world != null, "World cannot be null"); ServerLevel handle = ((CraftWorld) world).getHandle(); diff --git a/patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch b/patches/server/1002-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch similarity index 100% rename from patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch rename to patches/server/1002-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch diff --git a/patches/server/1007-Optimize-Collision-to-not-load-chunks.patch b/patches/server/1003-Optimize-Collision-to-not-load-chunks.patch similarity index 98% rename from patches/server/1007-Optimize-Collision-to-not-load-chunks.patch rename to patches/server/1003-Optimize-Collision-to-not-load-chunks.patch index 8a7c09661b..bfcccb5021 100644 --- a/patches/server/1007-Optimize-Collision-to-not-load-chunks.patch +++ b/patches/server/1003-Optimize-Collision-to-not-load-chunks.patch @@ -26,7 +26,7 @@ index eae6121a2f3fb33146b0a625cc82c8bce8efc91b..b71d7714fbaa7d4493ccddf877c9668f // CraftBukkit end entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ()); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index dbe4a41b8121d4e8ae8cf12c4a73d8148030c48e..a3ec39d809ecda5111faeb0fa36831053a7efd90 100644 +index 36daaed2f9b9218dbc3dafa208966680727d8a27..8ba686f9982b44eab7dea965e737d8a564cc55cd 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -241,6 +241,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S diff --git a/patches/server/1008-Optimize-GoalSelector-Goal.Flag-Set-operations.patch b/patches/server/1004-Optimize-GoalSelector-Goal.Flag-Set-operations.patch similarity index 100% rename from patches/server/1008-Optimize-GoalSelector-Goal.Flag-Set-operations.patch rename to patches/server/1004-Optimize-GoalSelector-Goal.Flag-Set-operations.patch diff --git a/patches/server/0554-Entity-load-save-limit-per-chunk.patch b/patches/server/1005-Entity-load-save-limit-per-chunk.patch similarity index 95% rename from patches/server/0554-Entity-load-save-limit-per-chunk.patch rename to patches/server/1005-Entity-load-save-limit-per-chunk.patch index 48d14bb036..65c011c1e1 100644 --- a/patches/server/0554-Entity-load-save-limit-per-chunk.patch +++ b/patches/server/1005-Entity-load-save-limit-per-chunk.patch @@ -9,10 +9,10 @@ defaults are only included for certain entites, this allows setting limits for any entity type. diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index bd4ae65070eb4b98dae0529b5985f80093bf8185..3ddb1cc0edddcf77c1b5d6157247498cb90c57a7 100644 +index 704e0b03d3bdff01eacd7781715f2d3a901155b1..edc723ea5ca3a325106e7af38c60dbf9f0f5fb77 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java -@@ -631,9 +631,20 @@ public class EntityType implements FeatureElement, EntityTypeT +@@ -644,9 +644,20 @@ public class EntityType implements FeatureElement, EntityTypeT final Spliterator spliterator = entityNbtList.spliterator(); return StreamSupport.stream(new Spliterator() { diff --git a/patches/server/0564-Fix-and-optimise-world-force-upgrading.patch b/patches/server/1006-Fix-and-optimise-world-force-upgrading.patch similarity index 95% rename from patches/server/0564-Fix-and-optimise-world-force-upgrading.patch rename to patches/server/1006-Fix-and-optimise-world-force-upgrading.patch index 0551f76827..97285bbc2c 100644 --- a/patches/server/0564-Fix-and-optimise-world-force-upgrading.patch +++ b/patches/server/1006-Fix-and-optimise-world-force-upgrading.patch @@ -247,10 +247,10 @@ index 0000000000000000000000000000000000000000..513833c2ea23df5b079d157bc5cb89d5 + } +} diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 1cad3585ca122a465572b16d4ecbb7231e87c7de..b0a0909fa9501dfacfbe70dc4118062d1154bd15 100644 +index 72d013d06705b08ed696e3d3b6d631d65800c2c9..61840cfd64caba6595dfc99c91c76a195638d4ee 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -385,6 +385,15 @@ public class Main { +@@ -399,6 +399,15 @@ public class Main { return new WorldLoader.InitConfig(worldloader_d, Commands.CommandSelection.DEDICATED, serverPropertiesHandler.functionPermissionLevel); } @@ -267,10 +267,10 @@ index 1cad3585ca122a465572b16d4ecbb7231e87c7de..b0a0909fa9501dfacfbe70dc4118062d Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, dimensionOptionsRegistry, eraseCache); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d4c1b31eb016bb6f39d3a399fb07f3cee40d6391..046ace2307e0196d4b1dbd90714d89e92e0b5ee4 100644 +index 9efd93bd086ea342527b2ff530b4eb4f7df1f777..f1551b0c6a3a466cb755c8061fe7fcbc0b1e34df 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -582,11 +582,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here @@ -318,7 +318,7 @@ index 4117817f3be6a22754a7b948348bf159f4278264..6324aa26d0aac0e5e8cd55231720d571 return this.world; } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index e9cfbee008c1dda2eeac55196d490984fa62ab09..eeccc924dbba6f860245611eb943c9219471f670 100644 +index 0db8ee3b640e6d1268e9c1cccda85459bd447105..42d37bee3a459adcd46408596ccf93abbcff51fe 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java @@ -60,6 +60,29 @@ public class RegionFileStorage implements AutoCloseable { @@ -352,10 +352,10 @@ index e9cfbee008c1dda2eeac55196d490984fa62ab09..eeccc924dbba6f860245611eb943c921 return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ())); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 6e297adce9b20112b566acbdbad8c0197818b9bc..3e2704b652f9bf12169b068505af6a46ecd2fcab 100644 +index ea3e215e619c38839dd20b225b836133e702d236..b9fa6cb9306238b9b070d03b2a8186e76d84bd3d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1251,9 +1251,7 @@ public final class CraftServer implements Server { +@@ -1345,9 +1345,7 @@ public final class CraftServer implements Server { worlddata.checkName(name); worlddata.setModdedInfo(this.console.getServerModName(), this.console.getModdedStatus().shouldReportAsModified()); @@ -364,9 +364,9 @@ index 6e297adce9b20112b566acbdbad8c0197818b9bc..3e2704b652f9bf12169b068505af6a46 - } + // Paper - fix and optimise world upgrading; move down - long j = BiomeManager.obfuscateSeed(creator.seed()); + long j = BiomeManager.obfuscateSeed(worlddata.worldGenOptions().seed()); // Paper - use world seed List list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata)); -@@ -1264,6 +1262,13 @@ public final class CraftServer implements Server { +@@ -1358,6 +1356,13 @@ public final class CraftServer implements Server { biomeProvider = generator.getDefaultBiomeProvider(worldInfo); } diff --git a/patches/server/1009-Improved-Watchdog-Support.patch b/patches/server/1007-Improved-Watchdog-Support.patch similarity index 99% rename from patches/server/1009-Improved-Watchdog-Support.patch rename to patches/server/1007-Improved-Watchdog-Support.patch index ba9bb9759f..b219f24d03 100644 --- a/patches/server/1009-Improved-Watchdog-Support.patch +++ b/patches/server/1007-Improved-Watchdog-Support.patch @@ -468,7 +468,7 @@ index e3b262add194a126e731c68e68f3139a00cacacb..da7d5efd76c9ef92e9ce22860fec7918 String[] split = restartScript.split( " " ); if ( split.length > 0 && new File( split[0] ).isFile() ) diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index de0ad206e8603a7d5b5d5ec3e87d5cab47714eb8..5c62604bdc1483c793677e803aecd7a62e7055f3 100644 +index a284d3b8526a743ba4389ec5b44d80af6d0e5a5f..0234555978d1b13051f876a257e47bafad37b0f8 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -11,6 +11,7 @@ import org.bukkit.Bukkit; diff --git a/patches/server/1010-Optimize-Voxel-Shape-Merging.patch b/patches/server/1008-Optimize-Voxel-Shape-Merging.patch similarity index 100% rename from patches/server/1010-Optimize-Voxel-Shape-Merging.patch rename to patches/server/1008-Optimize-Voxel-Shape-Merging.patch diff --git a/patches/server/1006-Write-SavedData-IO-async.patch b/patches/server/1009-Write-SavedData-IO-async.patch similarity index 100% rename from patches/server/1006-Write-SavedData-IO-async.patch rename to patches/server/1009-Write-SavedData-IO-async.patch diff --git a/patches/server/1011-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch b/patches/server/1010-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch similarity index 99% rename from patches/server/1011-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch rename to patches/server/1010-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch index 144bd68e6a..7429b07205 100644 --- a/patches/server/1011-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch +++ b/patches/server/1010-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch @@ -25,7 +25,7 @@ index 34159798e6617ce13b3ac8aae07d24d9bca6ee36..f54219d2b973136ad00a0f03cbd99f6b if (!this.level.isInWorldBounds(blockposition)) { diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 31c01e222e6223d84f9a3b6e9fc0b3bb42e3fe0b..84ed9046d337175352b1f40f3c8b78e0dbb434ce 100644 +index a7e9faed6873def24986d1d010b797b9c4999024..c07cfd8fdf056bb613ab5b64a58975d0ed9446ee 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -545,6 +545,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/1012-Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/1011-Use-distance-map-to-optimise-entity-tracker.patch similarity index 98% rename from patches/server/1012-Use-distance-map-to-optimise-entity-tracker.patch rename to patches/server/1011-Use-distance-map-to-optimise-entity-tracker.patch index 4bfcc97d26..d7546cf5f5 100644 --- a/patches/server/1012-Use-distance-map-to-optimise-entity-tracker.patch +++ b/patches/server/1011-Use-distance-map-to-optimise-entity-tracker.patch @@ -236,7 +236,7 @@ index e69e68ae3be2760c079338793f33c27f59ebf7cf..c68a14b5b738acabc949cab48b9551cc return object instanceof ChunkMap.TrackedEntity ? ((ChunkMap.TrackedEntity) object).entity.getId() == this.entity.getId() : false; } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a3ec39d809ecda5111faeb0fa36831053a7efd90..b4b8baa0bc303c5bdb7175fcdf00a70c446cd452 100644 +index 8ba686f9982b44eab7dea965e737d8a564cc55cd..d3c7288e33b125eae88fb017f2e746b47c038f8f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -56,6 +56,7 @@ import net.minecraft.network.syncher.EntityDataSerializers; @@ -247,7 +247,7 @@ index a3ec39d809ecda5111faeb0fa36831053a7efd90..b4b8baa0bc303c5bdb7175fcdf00a70c import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; -@@ -533,6 +534,38 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -468,6 +469,38 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.teleportTo(worldserver, null); } // Paper end - make end portalling safe @@ -283,9 +283,9 @@ index a3ec39d809ecda5111faeb0fa36831053a7efd90..b4b8baa0bc303c5bdb7175fcdf00a70c + return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this)); + } + // Paper end - optimise entity tracking - - public Entity(EntityType type, Level world) { - this.id = Entity.ENTITY_COUNTER.incrementAndGet(); + public float getBukkitYaw() { + return this.yRot; + } diff --git a/src/main/java/org/spigotmc/TrackingRange.java b/src/main/java/org/spigotmc/TrackingRange.java index 172d231adecf043f9f06b7f5e0365ae82327998d..ed8378ad022c375b0d18172aeccf65cb026d9d68 100644 --- a/src/main/java/org/spigotmc/TrackingRange.java diff --git a/patches/server/1013-Optimize-Bit-Operations-by-inlining.patch b/patches/server/1012-Optimize-Bit-Operations-by-inlining.patch similarity index 100% rename from patches/server/1013-Optimize-Bit-Operations-by-inlining.patch rename to patches/server/1012-Optimize-Bit-Operations-by-inlining.patch diff --git a/patches/server/1014-Remove-streams-from-hot-code.patch b/patches/server/1013-Remove-streams-from-hot-code.patch similarity index 100% rename from patches/server/1014-Remove-streams-from-hot-code.patch rename to patches/server/1013-Remove-streams-from-hot-code.patch diff --git a/patches/server/1015-Eigencraft-redstone-implementation.patch b/patches/server/1014-Eigencraft-redstone-implementation.patch similarity index 100% rename from patches/server/1015-Eigencraft-redstone-implementation.patch rename to patches/server/1014-Eigencraft-redstone-implementation.patch diff --git a/patches/server/1016-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/patches/server/1015-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch similarity index 100% rename from patches/server/1016-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch rename to patches/server/1015-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch diff --git a/patches/server/1017-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch b/patches/server/1016-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch similarity index 100% rename from patches/server/1017-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch rename to patches/server/1016-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch diff --git a/patches/server/1018-Improve-boat-collision-performance.patch b/patches/server/1017-Improve-boat-collision-performance.patch similarity index 100% rename from patches/server/1018-Improve-boat-collision-performance.patch rename to patches/server/1017-Improve-boat-collision-performance.patch diff --git a/patches/server/1019-Optimise-general-POI-access.patch b/patches/server/1018-Optimise-general-POI-access.patch similarity index 100% rename from patches/server/1019-Optimise-general-POI-access.patch rename to patches/server/1018-Optimise-general-POI-access.patch diff --git a/patches/server/1020-Custom-table-implementation-for-blockstate-state-loo.patch b/patches/server/1019-Custom-table-implementation-for-blockstate-state-loo.patch similarity index 100% rename from patches/server/1020-Custom-table-implementation-for-blockstate-state-loo.patch rename to patches/server/1019-Custom-table-implementation-for-blockstate-state-loo.patch diff --git a/patches/server/1021-Execute-chunk-tasks-mid-tick.patch b/patches/server/1020-Execute-chunk-tasks-mid-tick.patch similarity index 96% rename from patches/server/1021-Execute-chunk-tasks-mid-tick.patch rename to patches/server/1020-Execute-chunk-tasks-mid-tick.patch index cb33fb5e11..f3a69c5898 100644 --- a/patches/server/1021-Execute-chunk-tasks-mid-tick.patch +++ b/patches/server/1020-Execute-chunk-tasks-mid-tick.patch @@ -6,12 +6,12 @@ Subject: [PATCH] Execute chunk tasks mid-tick This will help the server load chunks if tick times are high. diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java -index 7a4234abf620b8394307fa01913bc00215a64e23..4b467f1af93452d13829f756d55dee18b8889d40 100644 +index 6b3cde6d4d1e63bec01f502f2027ee9fddac08aa..46449728f69ee7d4f78470f8da23c055acd53a3b 100644 --- a/src/main/java/co/aikar/timings/MinecraftTimings.java +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java -@@ -49,6 +49,8 @@ public final class MinecraftTimings { +@@ -48,6 +48,8 @@ public final class MinecraftTimings { + public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate"); public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Paper - add timings for scoreboard search - public static final Timing distanceManagerTick = Timings.ofSafe("Distance Manager Tick"); // Paper - add timings for distance manager + public static final Timing midTickChunkTasks = Timings.ofSafe("Mid Tick Chunk Tasks"); + diff --git a/patches/server/1022-Optimise-random-block-ticking.patch b/patches/server/1021-Optimise-random-block-ticking.patch similarity index 99% rename from patches/server/1022-Optimise-random-block-ticking.patch rename to patches/server/1021-Optimise-random-block-ticking.patch index 850bc98d35..4f3d16341d 100644 --- a/patches/server/1022-Optimise-random-block-ticking.patch +++ b/patches/server/1021-Optimise-random-block-ticking.patch @@ -324,7 +324,7 @@ index 1a2a4dcb3cfa2690f2aa936a6c176319d807bd74..f97bdfbd07db000845d3b791de64056c public BlockPos getHomePos() { diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 7070457a13974f0b578dba014d90540896e0c227..e6cd2a60a8ef1f312c243572e635883cacb089e7 100644 +index e221fe55d6ec5e77a82d33570a2ac1a77c221112..fd3828d2074c7e369dbea6a25d9bac436f624750 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -1400,10 +1400,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/1022-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch similarity index 98% rename from patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch rename to patches/server/1022-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch index fbc2c7f3e0..da819eaac8 100644 --- a/patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch +++ b/patches/server/1022-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch @@ -10,7 +10,7 @@ hoping that at least then we don't swap chunks, and maybe recover them all. diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index d25b24eb03d9b2d92c159ac4d0f8039784af1748..2a179e83f847e76a6a57f55aedcc324f987bd398 100644 +index 4bef691ad22b6638847aebb471a3c28522c7a461..ccbdb68e3bcf5f609e96ddd6e5ccfb27abb4d1f5 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java @@ -70,6 +70,18 @@ import net.minecraft.world.ticks.ProtoChunkTicks; @@ -42,18 +42,18 @@ index d25b24eb03d9b2d92c159ac4d0f8039784af1748..2a179e83f847e76a6a57f55aedcc324f nbttagcompound.putString("Status", BuiltInRegistries.CHUNK_STATUS.getKey(chunk.getStatus()).toString()); BlendingData blendingdata = chunk.getBlendingData(); diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java -index 0334924169de23f8b4f4e3b9b773d5e501e76a32..9be8dc63fc01ae6d43d9f22fbfce25c4e2af247b 100644 +index 6d1c8110af0508210aaaae6eef1c59b75e02bf76..08e1df6a2f262c1e20f0ec107bba4a6cc955797e 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java -@@ -41,7 +41,7 @@ public class ChunkStorage implements AutoCloseable { +@@ -38,7 +38,7 @@ public class ChunkStorage implements AutoCloseable { + + public ChunkStorage(Path directory, DataFixer dataFixer, boolean dsync) { this.fixerUpper = dataFixer; - // Paper start - async chunk io - // remove IO worker -- this.regionFileCache = new RegionFileStorage(directory, dsync); // Paper - nuke IOWorker -+ this.regionFileCache = new RegionFileStorage(directory, dsync, true); // Paper - nuke IOWorker // Paper - Attempt to recalculate regionfile header if it is corrupt - // Paper end - async chunk io +- this.regionFileCache = new RegionFileStorage(directory, dsync); // Paper - rewrite chunk system; async chunk IO ++ this.regionFileCache = new RegionFileStorage(directory, dsync, true); // Paper - rewrite chunk system; async chunk IO & Attempt to recalculate regionfile header if it is corrupt } + public boolean isOldChunkAround(ChunkPos chunkPos, int checkRadius) { diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionBitmap.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionBitmap.java index c8298a597818227de33a4afce4698ec0666cf758..6762b0f71ea9e369bb77103b7f1938983cb77a44 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionBitmap.java @@ -685,7 +685,7 @@ index 92ba75254f6ffca40abd5485dbb4789de59edebd..6cf83502a954cce9c562ec036bfeddb4 return bytebuffer; } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index 0d4ca8629707ba5cee10ee94b330404291cd2c30..1e97e2696c953e87a7bbde4a0016bdf55ded5241 100644 +index 42d37bee3a459adcd46408596ccf93abbcff51fe..fe312b1aef579cb4bf81bdd967cf72ff880d7505 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java @@ -24,6 +24,7 @@ public class RegionFileStorage implements AutoCloseable { diff --git a/patches/server/1024-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/1023-Use-Velocity-compression-and-cipher-natives.patch similarity index 100% rename from patches/server/1024-Use-Velocity-compression-and-cipher-natives.patch rename to patches/server/1023-Use-Velocity-compression-and-cipher-natives.patch diff --git a/patches/server/1025-Detail-more-information-in-watchdog-dumps.patch b/patches/server/1024-Detail-more-information-in-watchdog-dumps.patch similarity index 97% rename from patches/server/1025-Detail-more-information-in-watchdog-dumps.patch rename to patches/server/1024-Detail-more-information-in-watchdog-dumps.patch index 9ee90956c9..91a6216c4b 100644 --- a/patches/server/1025-Detail-more-information-in-watchdog-dumps.patch +++ b/patches/server/1024-Detail-more-information-in-watchdog-dumps.patch @@ -122,7 +122,7 @@ index bac2e7c8178696859ff2d38f1e095d86557fc306..5eaf8585df1f885f4a08fdd06ff4bb73 private void tickPassenger(Entity vehicle, Entity passenger) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index b4b8baa0bc303c5bdb7175fcdf00a70c446cd452..7e51a93ac779a6119a09b5b5f0428751849b924b 100644 +index 68b003e9b627dab2c4df6e95643a04a2d7e6e67f..4a32ca5e989395aa97b4859f5ca2f1041a2c0a52 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1051,8 +1051,43 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -183,7 +183,7 @@ index b4b8baa0bc303c5bdb7175fcdf00a70c446cd452..7e51a93ac779a6119a09b5b5f0428751 } private boolean isStateClimbable(BlockState state) { -@@ -4363,7 +4405,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4360,7 +4402,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void setDeltaMovement(Vec3 velocity) { @@ -193,7 +193,7 @@ index b4b8baa0bc303c5bdb7175fcdf00a70c446cd452..7e51a93ac779a6119a09b5b5f0428751 } public void addDeltaMovement(Vec3 velocity) { -@@ -4466,7 +4510,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4463,7 +4507,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } // Paper end - Fix MC-4 if (this.position.x != x || this.position.y != y || this.position.z != z) { @@ -204,7 +204,7 @@ index b4b8baa0bc303c5bdb7175fcdf00a70c446cd452..7e51a93ac779a6119a09b5b5f0428751 int j = Mth.floor(y); int k = Mth.floor(z); diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 5c62604bdc1483c793677e803aecd7a62e7055f3..69c0918c4baa193d49b55bc890d03a89c78a74c5 100644 +index 0234555978d1b13051f876a257e47bafad37b0f8..9e638f72f180ff5ef63ec3dd6cf548c53f7bd4a5 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -22,6 +22,78 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa diff --git a/patches/server/1026-Collision-optimisations.patch b/patches/server/1025-Collision-optimisations.patch similarity index 99% rename from patches/server/1026-Collision-optimisations.patch rename to patches/server/1025-Collision-optimisations.patch index a5a2a44b57..6671614d85 100644 --- a/patches/server/1026-Collision-optimisations.patch +++ b/patches/server/1025-Collision-optimisations.patch @@ -2214,7 +2214,7 @@ index 0ce7ce1899ac4115051353fc3eb0c622846d6748..0dd44f3625ca9383f22e4862ad3e9245 entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ()); } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7e51a93ac779a6119a09b5b5f0428751849b924b..66bc002b7e12b73badfe5707674b946c65f9b5d9 100644 +index fab2915f055cd3c68a523a6e21b58932695fb7a6..00d18d8bd60d4089c8db16c6edc7b5e731111a58 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1238,9 +1238,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2613,7 +2613,7 @@ index cc888bbcd6a50124fa553bc4a8ffd1e8885d3856..f42dd9602805e9d538506ee4e3eac7e2 // Paper start - Affects Spawning API diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index e6cd2a60a8ef1f312c243572e635883cacb089e7..da4e2c9572d602bb622cbe0dc46b842fd62d0a0b 100644 +index fd3828d2074c7e369dbea6a25d9bac436f624750..5e6caf9ca811a2fbca4ac93f6c61d3d8606e02db 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -299,6 +299,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/1027-Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/server/1026-Optimise-collision-checking-in-player-move-packet-ha.patch similarity index 99% rename from patches/server/1027-Optimise-collision-checking-in-player-move-packet-ha.patch rename to patches/server/1026-Optimise-collision-checking-in-player-move-packet-ha.patch index ae3cc0dbf5..1e773118a7 100644 --- a/patches/server/1027-Optimise-collision-checking-in-player-move-packet-ha.patch +++ b/patches/server/1026-Optimise-collision-checking-in-player-move-packet-ha.patch @@ -8,7 +8,7 @@ Move collision logic to just the hasNewCollision call instead of getCubes + hasN CHECK ME diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1d22b4ba82b440f163137ea6f8a182a00898c15b..b760e51f6d1682fe8185c62389f33e0bb4ce884f 100644 +index fc540b879230b5a5f8d6e01fa435ce140849a712..5674b509b6ee594d232507d5487f705c4abf7d9a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -553,7 +553,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/1028-Fix-tripwire-state-inconsistency.patch b/patches/server/1027-Fix-tripwire-state-inconsistency.patch similarity index 100% rename from patches/server/1028-Fix-tripwire-state-inconsistency.patch rename to patches/server/1027-Fix-tripwire-state-inconsistency.patch diff --git a/patches/server/1029-Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/server/1028-Fix-entity-type-tags-suggestions-in-selectors.patch similarity index 100% rename from patches/server/1029-Fix-entity-type-tags-suggestions-in-selectors.patch rename to patches/server/1028-Fix-entity-type-tags-suggestions-in-selectors.patch diff --git a/patches/server/1030-Add-Alternate-Current-redstone-implementation.patch b/patches/server/1029-Add-Alternate-Current-redstone-implementation.patch similarity index 100% rename from patches/server/1030-Add-Alternate-Current-redstone-implementation.patch rename to patches/server/1029-Add-Alternate-Current-redstone-implementation.patch diff --git a/patches/server/1031-optimize-dirt-and-snow-spreading.patch b/patches/server/1030-optimize-dirt-and-snow-spreading.patch similarity index 100% rename from patches/server/1031-optimize-dirt-and-snow-spreading.patch rename to patches/server/1030-optimize-dirt-and-snow-spreading.patch diff --git a/patches/server/1032-Properly-resend-entities.patch b/patches/server/1031-Properly-resend-entities.patch similarity index 99% rename from patches/server/1032-Properly-resend-entities.patch rename to patches/server/1031-Properly-resend-entities.patch index e84590518b..82e40b8e93 100644 --- a/patches/server/1032-Properly-resend-entities.patch +++ b/patches/server/1031-Properly-resend-entities.patch @@ -116,7 +116,7 @@ index 97490f58aace9bfb6d034e9a97393142f73043d1..83e017efd15d0ecaffc327f02d6d5330 return enuminteractionresult; // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b760e51f6d1682fe8185c62389f33e0bb4ce884f..42b433d9461d0912b39542263684323369469ac0 100644 +index 5674b509b6ee594d232507d5487f705c4abf7d9a..6f9ec543185b6f68bb1eaa61a7ebea9d866d688f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1990,6 +1990,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/1033-Optimize-Hoppers.patch b/patches/server/1032-Optimize-Hoppers.patch similarity index 100% rename from patches/server/1033-Optimize-Hoppers.patch rename to patches/server/1032-Optimize-Hoppers.patch diff --git a/patches/server/1034-Improve-performance-of-mass-crafts.patch b/patches/server/1033-Improve-performance-of-mass-crafts.patch similarity index 100% rename from patches/server/1034-Improve-performance-of-mass-crafts.patch rename to patches/server/1033-Improve-performance-of-mass-crafts.patch diff --git a/patches/server/1035-Actually-optimise-explosions.patch b/patches/server/1034-Actually-optimise-explosions.patch similarity index 100% rename from patches/server/1035-Actually-optimise-explosions.patch rename to patches/server/1034-Actually-optimise-explosions.patch diff --git a/patches/server/1036-Optimise-chunk-tick-iteration.patch b/patches/server/1035-Optimise-chunk-tick-iteration.patch similarity index 100% rename from patches/server/1036-Optimise-chunk-tick-iteration.patch rename to patches/server/1035-Optimise-chunk-tick-iteration.patch diff --git a/patches/server/1037-Lag-compensation-ticks.patch b/patches/server/1036-Lag-compensation-ticks.patch similarity index 100% rename from patches/server/1037-Lag-compensation-ticks.patch rename to patches/server/1036-Lag-compensation-ticks.patch diff --git a/patches/server/1038-Optimise-nearby-player-retrieval.patch b/patches/server/1037-Optimise-nearby-player-retrieval.patch similarity index 100% rename from patches/server/1038-Optimise-nearby-player-retrieval.patch rename to patches/server/1037-Optimise-nearby-player-retrieval.patch diff --git a/patches/server/0645-Distance-manager-tick-timings.patch b/patches/server/1038-Distance-manager-tick-timings.patch similarity index 91% rename from patches/server/0645-Distance-manager-tick-timings.patch rename to patches/server/1038-Distance-manager-tick-timings.patch index 451525be15..f946d92596 100644 --- a/patches/server/0645-Distance-manager-tick-timings.patch +++ b/patches/server/1038-Distance-manager-tick-timings.patch @@ -7,7 +7,7 @@ Recently this has been taking up more time, so add a timings to really figure out how much. diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java -index 6b3cde6d4d1e63bec01f502f2027ee9fddac08aa..7a4234abf620b8394307fa01913bc00215a64e23 100644 +index 46449728f69ee7d4f78470f8da23c055acd53a3b..4b467f1af93452d13829f756d55dee18b8889d40 100644 --- a/src/main/java/co/aikar/timings/MinecraftTimings.java +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java @@ -47,6 +47,7 @@ public final class MinecraftTimings { @@ -16,7 +16,7 @@ index 6b3cde6d4d1e63bec01f502f2027ee9fddac08aa..7a4234abf620b8394307fa01913bc002 public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Paper - add timings for scoreboard search + public static final Timing distanceManagerTick = Timings.ofSafe("Distance Manager Tick"); // Paper - add timings for distance manager - private static final Map, String> taskNameCache = new MapMaker().weakKeys().makeMap(); + public static final Timing midTickChunkTasks = Timings.ofSafe("Mid Tick Chunk Tasks"); diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java index 5b446e6ac151f99f64f0c442d0b40b5e251bc4c4..6bc7c6f16a1649fc9e24e7cf90fca401e5bd4875 100644 diff --git a/patches/server/1040-Further-improve-server-tick-loop.patch b/patches/server/1040-Further-improve-server-tick-loop.patch index c7ae92070e..f071acc84f 100644 --- a/patches/server/1040-Further-improve-server-tick-loop.patch +++ b/patches/server/1040-Further-improve-server-tick-loop.patch @@ -141,10 +141,10 @@ index 58da8abd1603359bb9f2772a6420b55108e22ceb..4e1011dca1081a5246981fabb93f1424 this.startMetricsRecordingTick(); this.profiler.push("tick"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ad826f052523eb7c0423a6706498664a83c1b4a3..1aa620a83fb1a618c001b1d94c89543f8e8da773 100644 +index ff9948589c93d4cf5d5b0beda42a0bb105f89539..9d00c98ddfa1b9c04e6d587dcdf779822f35964a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2970,6 +2970,15 @@ public final class CraftServer implements Server { +@@ -2969,6 +2969,15 @@ public final class CraftServer implements Server { return this.getServer().tickTimes5s.getAverage(); } diff --git a/scripts/moveback.py b/scripts/moveback.py index 6135e33d8b..b0f7e2cca3 100644 --- a/scripts/moveback.py +++ b/scripts/moveback.py @@ -3,7 +3,7 @@ import sys # Use inside of server patch dir # py ../../scripts/moveback.py 'Rewrite chunk system' -patch_target = 400 # TODO: Update this +patch_target = 750 # TODO: Update this def increment_number(filename):