diff --git a/build-data/additional-spigot-member-mappings.csrg b/build-data/additional-spigot-member-mappings.csrg index 0df7ebc7e2..05907c24c4 100644 --- a/build-data/additional-spigot-member-mappings.csrg +++ b/build-data/additional-spigot-member-mappings.csrg @@ -2,5 +2,5 @@ # Merchant.getLevel() # Entity.getCommandSenderWorld() # to getWorld(), which confuses our ability to map this method properly. This patch disambiguates it -net/minecraft/world/item/trading/IMerchant fD ()Lnet/minecraft/world/level/World; getLevel -net/minecraft/world/entity/npc/EntityVillagerAbstract fD ()Lnet/minecraft/world/level/World; getLevel +net/minecraft/world/item/trading/IMerchant fE ()Lnet/minecraft/world/level/World; getLevel +net/minecraft/world/entity/npc/EntityVillagerAbstract fE ()Lnet/minecraft/world/level/World; getLevel diff --git a/build-data/mappings-patch.tiny b/build-data/mappings-patch.tiny index d54ddf3d34..3b678102f5 100644 --- a/build-data/mappings-patch.tiny +++ b/build-data/mappings-patch.tiny @@ -35,7 +35,7 @@ c net/minecraft/world/level/block/MultifaceBlock net/minecraft/world/level/block # another missed one c net/minecraft/server/players/UserCache net/minecraft/server/players/GameProfileCache - m (Ljava/lang/String;)Lcom/mojang/authlib/GameProfile; getProfile get + m (Ljava/lang/String;)Ljava/util/Optional; getProfile get p 0 name # change dimension in ServerPlayer diff --git a/build-data/paper.at b/build-data/paper.at index e90ed085ab..be711a45c6 100644 --- a/build-data/paper.at +++ b/build-data/paper.at @@ -228,3 +228,6 @@ public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity recipeT # Improve CraftChunk#getEntities public net.minecraft.world.level.entity.PersistentEntitySectionManager sectionStorage + +# Optimize light engine +public-f net.minecraft.world.level.chunk.DataLayer diff --git a/build.gradle.kts b/build.gradle.kts index f55c9adce5..cf0754603f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -71,7 +71,7 @@ repositories { } dependencies { - paramMappings("org.quiltmc:yarn:1.17+build.2:mergedv2") + paramMappings("org.quiltmc:yarn:1.17.1+build.1:mergedv2") remapper("org.quiltmc:tiny-remapper:0.4.1") decompiler("net.minecraftforge:forgeflower:1.5.498.12") paperclip("io.papermc:paperclip:2.0.1") diff --git a/gradle.properties b/gradle.properties index 0fec65e48e..7864dd3be1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group = io.papermc.paper -version = 1.17-R0.1-SNAPSHOT +version = 1.17.1-R0.1-SNAPSHOT -mcVersion = 1.17 +mcVersion = 1.17.1 org.gradle.parallel=true org.gradle.vfs.watch=false diff --git a/patches/api/0001-Convert-project-to-Gradle.patch b/patches/api/0001-Convert-project-to-Gradle.patch index 6d0de9bba2..779ce3b827 100644 --- a/patches/api/0001-Convert-project-to-Gradle.patch +++ b/patches/api/0001-Convert-project-to-Gradle.patch @@ -19,7 +19,7 @@ index e431e3435737e28394d81b56568a08b3c3148b9b..c484aff2c192bf42059b5689327909e4 /.project diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..db581a25928b3d60906fef0dc8df1bf976e1635e +index 0000000000000000000000000000000000000000..6e64a444fb20aabaabfb15a30d645702c11c2da8 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,67 @@ @@ -85,14 +85,14 @@ index 0000000000000000000000000000000000000000..db581a25928b3d60906fef0dc8df1bf9 +tasks.withType().configureEach { + (options as StandardJavadocDocletOptions).links( + "https://guava.dev/releases/21.0/api/docs/", -+ "https://javadoc.io/doc/org.yaml/snakeyaml/1.27/", -+ "https://javadoc.io/doc/org.jetbrains/annotations-java5/20.1.0/", ++ "https://javadoc.io/doc/org.yaml/snakeyaml/1.28/", ++ "https://javadoc.io/doc/org.jetbrains/annotations-java5/21.0.1/", + "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", + ) +} diff --git a/pom.xml b/pom.xml deleted file mode 100644 -index 10eeaef61be733e63f6680f1675e0b527eb30fd9..0000000000000000000000000000000000000000 +index 6f6a86034a4c312a4af97d6984a6a4547217cbf6..0000000000000000000000000000000000000000 --- a/pom.xml +++ /dev/null @@ -1,262 +0,0 @@ @@ -103,7 +103,7 @@ index 10eeaef61be733e63f6680f1675e0b527eb30fd9..00000000000000000000000000000000 - - org.spigotmc - spigot-api -- 1.17-R0.1-SNAPSHOT +- 1.17.1-R0.1-SNAPSHOT - jar - - Spigot-API @@ -241,7 +241,7 @@ index 10eeaef61be733e63f6680f1675e0b527eb30fd9..00000000000000000000000000000000 - - org.eclipse.jdt - ecj -- 3.24.0 +- 3.26.0 - - - @@ -263,7 +263,7 @@ index 10eeaef61be733e63f6680f1675e0b527eb30fd9..00000000000000000000000000000000 - - org.apache.maven.plugins - maven-shade-plugin -- 3.2.3 +- 3.2.4 - - - package @@ -288,12 +288,12 @@ index 10eeaef61be733e63f6680f1675e0b527eb30fd9..00000000000000000000000000000000 - - org.apache.maven.plugins - maven-javadoc-plugin -- 3.2.0 +- 3.3.0 - - - https://guava.dev/releases/21.0/api/docs/ -- https://javadoc.io/doc/org.yaml/snakeyaml/1.27/ -- https://javadoc.io/doc/org.jetbrains/annotations-java5/20.1.0/ +- https://javadoc.io/doc/org.yaml/snakeyaml/1.28/ +- https://javadoc.io/doc/org.jetbrains/annotations-java5/21.0.1/ - https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/ - - @@ -312,7 +312,7 @@ index 10eeaef61be733e63f6680f1675e0b527eb30fd9..00000000000000000000000000000000 - - org.apache.maven.plugins - maven-checkstyle-plugin -- 3.1.1 +- 3.1.2 - - - process-classes @@ -329,14 +329,14 @@ index 10eeaef61be733e63f6680f1675e0b527eb30fd9..00000000000000000000000000000000 - - com.puppycrawl.tools - checkstyle -- 8.39 +- 8.44 - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin -- 1.19 +- 1.20 - - - process-classes diff --git a/patches/api/0002-Build-system-changes.patch b/patches/api/0002-Build-system-changes.patch index ed26eab09d..6c6ca6f0bd 100644 --- a/patches/api/0002-Build-system-changes.patch +++ b/patches/api/0002-Build-system-changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Build system changes diff --git a/build.gradle.kts b/build.gradle.kts -index db581a25928b3d60906fef0dc8df1bf976e1635e..5a328158622346deee6c83215fa56f64e2ba55e2 100644 +index 6e64a444fb20aabaabfb15a30d645702c11c2da8..db6a7b2e60da0d96ef96545a781f1e056482d6ff 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,12 +17,14 @@ dependencies { @@ -27,8 +27,8 @@ index db581a25928b3d60906fef0dc8df1bf976e1635e..5a328158622346deee6c83215fa56f64 @@ -61,7 +63,7 @@ tasks.withType().configureEach { (options as StandardJavadocDocletOptions).links( "https://guava.dev/releases/21.0/api/docs/", - "https://javadoc.io/doc/org.yaml/snakeyaml/1.27/", -- "https://javadoc.io/doc/org.jetbrains/annotations-java5/20.1.0/", + "https://javadoc.io/doc/org.yaml/snakeyaml/1.28/", +- "https://javadoc.io/doc/org.jetbrains/annotations-java5/21.0.1/", + "https://javadoc.io/doc/org.jetbrains/annotations/21.0.1/", // Paper - we don't want Java 5 annotations "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", ) diff --git a/patches/api/0007-Adventure.patch b/patches/api/0007-Adventure.patch index 5ff84f2d90..1d75b60454 100644 --- a/patches/api/0007-Adventure.patch +++ b/patches/api/0007-Adventure.patch @@ -7,7 +7,7 @@ Co-authored-by: zml Co-authored-by: Jake Potrebic diff --git a/build.gradle.kts b/build.gradle.kts -index f0b501b9a6b2d1d516d644c960bb3be785a1415b..ea3a12608a851b25afa01ee127c6ef91a3d64fff 100644 +index 17fd7162ab32785252bf2579daae8d47aec21684..479d4e3b91e902e9b30d351aa65c8b079555d7e0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,6 +10,8 @@ java { @@ -32,7 +32,7 @@ index f0b501b9a6b2d1d516d644c960bb3be785a1415b..ea3a12608a851b25afa01ee127c6ef91 compileOnly("org.apache.maven:maven-resolver-provider:3.8.1") compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0") @@ -66,5 +73,11 @@ tasks.withType().configureEach { - "https://javadoc.io/doc/org.yaml/snakeyaml/1.27/", + "https://javadoc.io/doc/org.yaml/snakeyaml/1.28/", "https://javadoc.io/doc/org.jetbrains/annotations/21.0.1/", // Paper - we don't want Java 5 annotations "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", + // Paper start @@ -447,7 +447,7 @@ index 0000000000000000000000000000000000000000..77db592d05b754f879f8d1790642e9d9 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 73dafe6093b4c5c385efc8529fab76189085e9d0..f0a28cbb92edf990a3aef076af183cc9796987f3 100644 +index 05595fea641dbbc3d5eefb262731faad5bdb7965..cc208227301b30c3717516ceb9529ca6cb2fd0de 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -302,7 +302,9 @@ public final class Bukkit { @@ -731,7 +731,7 @@ index 803fa0019869127ee8c7e4fb1777a59c43e66f8a..c65f0d6569c130b4920a9e71ad24af64 + // Paper end } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index b72a8d2ca0c5b6d78c0a5ca5cc30d8216c34ee88..650b9afc846b1ead0322a4b3ebcdad2d449670da 100644 +index bc4c4b6a10726347649a9232ee8ede28c967b8f4..cb0f365c4829f382a8fef8c176b7ea4028cac876 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -55,13 +55,13 @@ import org.jetbrains.annotations.Nullable; @@ -1087,7 +1087,7 @@ index bc4417d8ffa92a78f690bfa5705d3e42cdc11fd2..d3519fa5b99e2888a194c63824155377 * Returns a list of entities within a bounding box centered around a * Location. diff --git a/src/main/java/org/bukkit/block/Sign.java b/src/main/java/org/bukkit/block/Sign.java -index a52dff9ef1c1cd7d3705e66510dfa2c91119539c..cdcf02ff9e80f5908a8fa22e82701445d5e2d298 100644 +index ab6b0ec328e94bf65a0dafd0403e5ee3b870296c..c8d37184d8e882a4084a1bfef85faa330588600b 100644 --- a/src/main/java/org/bukkit/block/Sign.java +++ b/src/main/java/org/bukkit/block/Sign.java @@ -7,13 +7,48 @@ import org.jetbrains.annotations.NotNull; @@ -1141,8 +1141,8 @@ index a52dff9ef1c1cd7d3705e66510dfa2c91119539c..cdcf02ff9e80f5908a8fa22e82701445 /** @@ -24,8 +59,10 @@ public interface Sign extends TileState, Colorable { * @param index Line number to get the text from, starting at 0 - * @throws IndexOutOfBoundsException Thrown when the line does not exist * @return Text on the given line + * @throws IndexOutOfBoundsException Thrown when the line does not exist + * @deprecated in favour of {@link #line(int)} */ @NotNull @@ -1976,7 +1976,7 @@ index 9c68c3f2d61500479f48b80264f625aaae2f3204..399afcd19fcb6acd24857ed6ab48cf0d private static final HandlerList handlers = new HandlerList(); private boolean cancel = false; diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java -index c8384da69af61e1970f254a3a9c206ee81d7a989..d3b4219a57fff4519ef8d803c333c854fafa7859 100644 +index 9866c07c999f46cb585709804aaad710c3031d5a..31f6f781a0403bf6388d668f0effaed5aae94468 100644 --- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java @@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull; @@ -2318,10 +2318,10 @@ index 14c337f15fc804f52e52cb0a185aad38d89303a8..5c0efe74237dbe6803ce023fde99682f @NotNull diff --git a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java -index 1db386bb701cb6974daedc6bb5b93a3afbc42100..84521186404b8e43c81a2f9513dce2be40d27840 100644 +index 36b436e145a7215682b692a87ab894df25752c1d..ebd499c1a2d11ea068e8c374edbc3967e4cece3d 100644 --- a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java -@@ -12,18 +12,32 @@ public class PlayerLocaleChangeEvent extends PlayerEvent { +@@ -12,17 +12,31 @@ public class PlayerLocaleChangeEvent extends PlayerEvent { private static final HandlerList handlers = new HandlerList(); // private final String locale; @@ -2344,9 +2344,8 @@ index 1db386bb701cb6974daedc6bb5b93a3afbc42100..84521186404b8e43c81a2f9513dce2be } /** - * @see Player#getLocale() - * * @return the player's new locale + * @see Player#getLocale() + * @deprecated in favour of {@link #locale()} */ @NotNull @@ -3465,7 +3464,7 @@ index 4dba721aefe4fc6699b3b4bfa7ecb0b19c2a2a1a..01dec2c877df58c9dc22445e8b1f9ce2 + // Paper end } diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java -index f5cbf6df32ef169cf0f2266f7c6e9c4f771ccb7d..58bddb11fd534e7c33a4ffd7b72b055ba92c767a 100644 +index 7277f62d77cd94dc34fd8ac4fad64ebeffe056e4..6279957b9bc6d22881f092eabf3a99831d85e3ee 100644 --- a/src/main/java/org/bukkit/scoreboard/Objective.java +++ b/src/main/java/org/bukkit/scoreboard/Objective.java @@ -19,14 +19,35 @@ public interface Objective { @@ -3515,7 +3514,7 @@ index f5cbf6df32ef169cf0f2266f7c6e9c4f771ccb7d..58bddb11fd534e7c33a4ffd7b72b055b /** diff --git a/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/src/main/java/org/bukkit/scoreboard/Scoreboard.java -index 4bfaaea78c9b6aa5d392629aa943d26dbe6a7d4a..f09ff32cc3ffc16af379a378b1948991435393e8 100644 +index d283f6947d775a3bc3a9b2f75db9ab733d819a06..93089ce61d2e1888df13b7c9629a79cd6f5f767a 100644 --- a/src/main/java/org/bukkit/scoreboard/Scoreboard.java +++ b/src/main/java/org/bukkit/scoreboard/Scoreboard.java @@ -27,6 +27,48 @@ public interface Scoreboard { @@ -3590,7 +3589,7 @@ index 4bfaaea78c9b6aa5d392629aa943d26dbe6a7d4a..f09ff32cc3ffc16af379a378b1948991 /** diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java -index da01d2926cc8a2485a3349ac1ebb32cad20e287c..f0af10a5b9ad048be197ed5ec6c8ed2672eb3dd5 100644 +index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..30fce0df75494eb9b7409f08ea3d6ff894f7c79f 100644 --- a/src/main/java/org/bukkit/scoreboard/Team.java +++ b/src/main/java/org/bukkit/scoreboard/Team.java @@ -22,14 +22,95 @@ public interface Team { diff --git a/patches/api/0130-Expand-ArmorStand-API.patch b/patches/api/0130-Expand-ArmorStand-API.patch index c57b85b936..60fe1451e8 100644 --- a/patches/api/0130-Expand-ArmorStand-API.patch +++ b/patches/api/0130-Expand-ArmorStand-API.patch @@ -8,27 +8,27 @@ Add the following: - Enable/Disable slot interactions diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index 575f48213cd8df038e41bead4c9d0fcba717f40f..2f0c6af7fa6688a98d6aa0bd3f0e6556af8330d0 100644 +index bf7ded92ed2d39f57bc828a6290a8e9e7afe3a0c..21c8ec6d8b795799b5b110be57ffd27fc8dcabe3 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java -@@ -13,7 +13,7 @@ public interface ArmorStand extends LivingEntity { - * Returns the item the armor stand is currently holding. +@@ -14,7 +14,7 @@ public interface ArmorStand extends LivingEntity { * * @return the held item + * @see #getEquipment() - * @deprecated prefer {@link EntityEquipment#getItemInHand()} + * @deprecated prefer {@link ArmorStand#getItem(EquipmentSlot)} // Paper - * @see #getEquipment() */ @NotNull -@@ -25,7 +25,7 @@ public interface ArmorStand extends LivingEntity { - * + @Deprecated +@@ -26,7 +26,7 @@ public interface ArmorStand extends LivingEntity { * @param item the item to hold + * @see #getEquipment() * @deprecated prefer - * {@link EntityEquipment#setItemInHand(org.bukkit.inventory.ItemStack)} + * {@link ArmorStand#setItem(EquipmentSlot, ItemStack)} // Paper - * @see #getEquipment() */ @Deprecated + void setItemInHand(@Nullable ItemStack item); @@ -376,5 +376,71 @@ public interface ArmorStand extends LivingEntity { * @param tick {@code true} if this armour stand can tick, {@code false} otherwise */ diff --git a/patches/api/0273-Add-getMainThreadExecutor-to-BukkitScheduler.patch b/patches/api/0273-Add-getMainThreadExecutor-to-BukkitScheduler.patch index 6de1a3b396..430f5aa541 100644 --- a/patches/api/0273-Add-getMainThreadExecutor-to-BukkitScheduler.patch +++ b/patches/api/0273-Add-getMainThreadExecutor-to-BukkitScheduler.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add getMainThreadExecutor to BukkitScheduler diff --git a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java -index ac140fc2c638e22e06b2920db3e376ab9e8c3733..f5e3bfd22d4d38182065b5215e5f78d9bb13381e 100644 +index c239c4de617933d20f75c33f943ba4a88954144e..1ea49965bf72edd862dc0d43e42c61df80966e45 100644 --- a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java +++ b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java -@@ -458,4 +458,15 @@ public interface BukkitScheduler { +@@ -457,4 +457,15 @@ public interface BukkitScheduler { @Deprecated @NotNull public BukkitTask runTaskTimerAsynchronously(@NotNull Plugin plugin, @NotNull BukkitRunnable task, long delay, long period) throws IllegalArgumentException; diff --git a/patches/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch index 27406fe505..6d7bcc9c4b 100644 --- a/patches/server/0001-Setup-Gradle-project.patch +++ b/patches/server/0001-Setup-Gradle-project.patch @@ -161,7 +161,7 @@ index 0000000000000000000000000000000000000000..e9db6b3bad237c0b3fdb14e96b6f0f29 +} diff --git a/pom.xml b/pom.xml deleted file mode 100644 -index 2f0e513c9e5d78a22e7d1e1a5aa64bb8f0f360d2..0000000000000000000000000000000000000000 +index 9dafd60b6dcabf203ee6d60c0ea82d2845b9eec7..0000000000000000000000000000000000000000 --- a/pom.xml +++ /dev/null @@ -1,472 +0,0 @@ @@ -171,7 +171,7 @@ index 2f0e513c9e5d78a22e7d1e1a5aa64bb8f0f360d2..00000000000000000000000000000000 - org.spigotmc - spigot - jar -- 1.17-R0.1-SNAPSHOT +- 1.17.1-R0.1-SNAPSHOT - Spigot - https://www.spigotmc.org/ - @@ -516,7 +516,7 @@ index 2f0e513c9e5d78a22e7d1e1a5aa64bb8f0f360d2..00000000000000000000000000000000 - - org.eclipse.jdt - ecj -- 3.24.0 +- 3.26.0 - - - @@ -552,7 +552,7 @@ index 2f0e513c9e5d78a22e7d1e1a5aa64bb8f0f360d2..00000000000000000000000000000000 - - org.apache.maven.plugins - maven-checkstyle-plugin -- 3.1.1 +- 3.1.2 - - - process-classes @@ -569,7 +569,7 @@ index 2f0e513c9e5d78a22e7d1e1a5aa64bb8f0f360d2..00000000000000000000000000000000 - - com.puppycrawl.tools - checkstyle -- 8.39 +- 8.44 - - - diff --git a/patches/server/0004-Paper-config-files.patch b/patches/server/0004-Paper-config-files.patch index 0ecd7c9932..222445ae2d 100644 --- a/patches/server/0004-Paper-config-files.patch +++ b/patches/server/0004-Paper-config-files.patch @@ -600,10 +600,10 @@ index 1707449cbbfa5eab585657cdde811b34a92e1d17..c8385460701395cb5c65fba41335469f Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, worlds, eraseCache); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 7bad75bd86fcb484e253fca8077d017d3161158b..fe83f13d71f84591f5506e1c6b9dfbf9fba680bd 100644 +index cd65a5bb6da734a39b0bb6e9a0571455d19ceac4..fac993d58bd6e3bb19fd69881092a863c8952c65 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -193,6 +193,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -194,6 +194,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface org.spigotmc.SpigotConfig.init((java.io.File) options.valueOf("spigot-settings")); org.spigotmc.SpigotConfig.registerCommands(); // Spigot end @@ -620,29 +620,21 @@ index 7bad75bd86fcb484e253fca8077d017d3161158b..fe83f13d71f84591f5506e1c6b9dfbf9 this.setPvpAllowed(dedicatedserverproperties.pvp); this.setFlightAllowed(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 16ca2a041139dd06922459df33e6eb058dbda3d2..cfe9930490489d506c91d174b5aad199314ffd17 100644 +index 1ff471fb8a4f69f02debe9c40b13cc1e8b8045d7..9591f50922343283597bad6d9ac17c175d8ae230 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -23,6 +23,7 @@ import net.minecraft.core.BlockPos; - import net.minecraft.core.SectionPos; - import net.minecraft.network.protocol.Packet; - import net.minecraft.server.level.progress.ChunkProgressListener; -+import net.minecraft.util.Mth; - import net.minecraft.util.VisibleForDebug; - import net.minecraft.util.profiling.ProfilerFiller; - import net.minecraft.util.thread.BlockableEventLoop; -@@ -334,6 +335,12 @@ public class ServerChunkCache extends ChunkSource { +@@ -334,6 +334,12 @@ public class ServerChunkCache extends ChunkSource { } } + // Paper start - helper + public boolean isPositionTicking(Entity entity) { -+ return this.isPositionTicking(ChunkPos.asLong(Mth.floor(entity.getX()) >> 4, Mth.floor(entity.getZ()) >> 4)); ++ return this.isPositionTicking(ChunkPos.asLong(net.minecraft.util.Mth.floor(entity.getX()) >> 4, net.minecraft.util.Mth.floor(entity.getZ()) >> 4)); + } + // Paper end + - public boolean isPositionTicking(long i) { - return this.checkChunkFuture(i, (Function>>) ChunkHolder::getTickingChunkFuture); // CraftBukkit - decompile error + public boolean isPositionTicking(long pos) { + return this.checkChunkFuture(pos, (Function>>) ChunkHolder::getTickingChunkFuture); // CraftBukkit - decompile error } diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java index 067216078c7b50390957d1fcfbfbaaeb81cfba21..7f3d83d3d071f6b441ad119b1c93be035e911e70 100644 @@ -668,10 +660,10 @@ index 067216078c7b50390957d1fcfbfbaaeb81cfba21..7f3d83d3d071f6b441ad119b1c93be03 + // Paper end } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index b2083d26e3b239d0f26da77955db6a34b622a1bb..90854842fda0f91ac68c70efbcf8ad9e3297ceb4 100644 +index 7f81dd05ec8945a851b6501854dc894cad240a66..d6b2e7d643f907ddd81d394d9b613e9ce93a786e 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -146,6 +146,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -147,6 +147,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public boolean populating; public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot @@ -680,7 +672,7 @@ index b2083d26e3b239d0f26da77955db6a34b622a1bb..90854842fda0f91ac68c70efbcf8ad9e public final SpigotTimings.WorldTimingsHandler timings; // Spigot public static BlockPos lastPhysicsProblem; // Spigot private org.spigotmc.TickLimiter entityLimiter; -@@ -166,6 +168,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -167,6 +169,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, final DimensionType dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) { this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot @@ -689,7 +681,7 @@ index b2083d26e3b239d0f26da77955db6a34b622a1bb..90854842fda0f91ac68c70efbcf8ad9e this.world = new CraftWorld((ServerLevel) this, gen, env); this.ticksPerAnimalSpawns = this.getCraftServer().getTicksPerAnimalSpawns(); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index cb68f677221c0accb22c2c204f24bb4127a2b542..2bd19cf2ed4144b4f4403afc98fdb8e95f7c95cc 100644 +index 1364a4a95e265c042880c99ea6b59dd2725b18ac..57a44f1d466caeccebe0e2498e3833cb953ffd5a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -805,6 +805,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0005-MC-Dev-fixes.patch b/patches/server/0005-MC-Dev-fixes.patch index 011c068e82..2f795f32e1 100644 --- a/patches/server/0005-MC-Dev-fixes.patch +++ b/patches/server/0005-MC-Dev-fixes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] MC Dev fixes diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java -index 8fd67e0be207561d329b417959f6c537cc8b7c49..23c0914685e51de9dcdbb305c203efd4f2a73128 100644 +index b61eaf223acd703d9c259fb2cd3852481213f93a..771e4b72589d7117a154ab6917bd4a56d55f19db 100644 --- a/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java @@ -306,7 +306,7 @@ public class Util { @@ -18,7 +18,7 @@ index 8fd67e0be207561d329b417959f6c537cc8b7c49..23c0914685e51de9dcdbb305c203efd4 public static CompletableFuture> sequence(List> futures) { diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java -index 891fc7f4cbea8eccd580f371715478265339c0cc..a153ca538d237fab567550b0bfcdf5b2985c56f8 100644 +index 754e65f322ded875ae7614066bab30a8da2aa4a9..59240bb0ce088a14f8ccb62de8b69bc7bf313975 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java @@ -369,12 +369,12 @@ public class BlockPos extends Vec3i { @@ -100,7 +100,7 @@ index 440aa82b4488ed20f9fcf60f1e87cc84ea74e370..08a0327feacd81c6e4c66182cee926c6 default String getAsString() { return (new StringTagVisitor()).visit(this); diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/main/java/net/minecraft/network/ConnectionProtocol.java -index 6b66e1ad66dccacb5c959da924d7857358488678..e722cf3a8e816b0c7405e6282591d9fa8d5bfa61 100644 +index 3db1f50262df75dc99fd5a1224985cd9f5f14c9f..6611aebafb14b83bce3eeb87701e2edc8a0828ab 100644 --- a/src/main/java/net/minecraft/network/ConnectionProtocol.java +++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java @@ -12,6 +12,7 @@ import javax.annotation.Nullable; @@ -144,12 +144,12 @@ index 6b66e1ad66dccacb5c959da924d7857358488678..e722cf3a8e816b0c7405e6282591d9fa public enum ConnectionProtocol { - HANDSHAKING(-1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientIntentionPacket.class, ClientIntentionPacket::new))), -- PLAY(0, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new).addPacket(ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new).addPacket(ClientboundAddMobPacket.class, ClientboundAddMobPacket::new).addPacket(ClientboundAddPaintingPacket.class, ClientboundAddPaintingPacket::new).addPacket(ClientboundAddPlayerPacket.class, ClientboundAddPlayerPacket::new).addPacket(ClientboundAddVibrationSignalPacket.class, ClientboundAddVibrationSignalPacket::new).addPacket(ClientboundAnimatePacket.class, ClientboundAnimatePacket::new).addPacket(ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new).addPacket(ClientboundBlockBreakAckPacket.class, ClientboundBlockBreakAckPacket::new).addPacket(ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new).addPacket(ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new).addPacket(ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new).addPacket(ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new).addPacket(ClientboundBossEventPacket.class, ClientboundBossEventPacket::new).addPacket(ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new).addPacket(ClientboundChatPacket.class, ClientboundChatPacket::new).addPacket(ClientboundClearTitlesPacket.class, ClientboundClearTitlesPacket::new).addPacket(ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new).addPacket(ClientboundCommandsPacket.class, ClientboundCommandsPacket::new).addPacket(ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new).addPacket(ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new).addPacket(ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new).addPacket(ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new).addPacket(ClientboundCooldownPacket.class, ClientboundCooldownPacket::new).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundCustomSoundPacket.class, ClientboundCustomSoundPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new).addPacket(ClientboundExplodePacket.class, ClientboundExplodePacket::new).addPacket(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new).addPacket(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new).addPacket(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new).addPacket(ClientboundInitializeBorderPacket.class, ClientboundInitializeBorderPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundLevelChunkPacket.class, ClientboundLevelChunkPacket::new).addPacket(ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new).addPacket(ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new).addPacket(ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new).addPacket(ClientboundLoginPacket.class, ClientboundLoginPacket::new).addPacket(ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new).addPacket(ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new).addPacket(ClientboundMoveEntityPacket.Pos.class, ClientboundMoveEntityPacket.Pos::read).addPacket(ClientboundMoveEntityPacket.PosRot.class, ClientboundMoveEntityPacket.PosRot::read).addPacket(ClientboundMoveEntityPacket.Rot.class, ClientboundMoveEntityPacket.Rot::read).addPacket(ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new).addPacket(ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new).addPacket(ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new).addPacket(ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new).addPacket(ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new).addPacket(ClientboundPlayerCombatEndPacket.class, ClientboundPlayerCombatEndPacket::new).addPacket(ClientboundPlayerCombatEnterPacket.class, ClientboundPlayerCombatEnterPacket::new).addPacket(ClientboundPlayerCombatKillPacket.class, ClientboundPlayerCombatKillPacket::new).addPacket(ClientboundPlayerInfoPacket.class, ClientboundPlayerInfoPacket::new).addPacket(ClientboundPlayerLookAtPacket.class, ClientboundPlayerLookAtPacket::new).addPacket(ClientboundPlayerPositionPacket.class, ClientboundPlayerPositionPacket::new).addPacket(ClientboundRecipePacket.class, ClientboundRecipePacket::new).addPacket(ClientboundRemoveEntityPacket.class, ClientboundRemoveEntityPacket::new).addPacket(ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new).addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new).addPacket(ClientboundRespawnPacket.class, ClientboundRespawnPacket::new).addPacket(ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new).addPacket(ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new).addPacket(ClientboundSelectAdvancementsTabPacket.class, ClientboundSelectAdvancementsTabPacket::new).addPacket(ClientboundSetActionBarTextPacket.class, ClientboundSetActionBarTextPacket::new).addPacket(ClientboundSetBorderCenterPacket.class, ClientboundSetBorderCenterPacket::new).addPacket(ClientboundSetBorderLerpSizePacket.class, ClientboundSetBorderLerpSizePacket::new).addPacket(ClientboundSetBorderSizePacket.class, ClientboundSetBorderSizePacket::new).addPacket(ClientboundSetBorderWarningDelayPacket.class, ClientboundSetBorderWarningDelayPacket::new).addPacket(ClientboundSetBorderWarningDistancePacket.class, ClientboundSetBorderWarningDistancePacket::new).addPacket(ClientboundSetCameraPacket.class, ClientboundSetCameraPacket::new).addPacket(ClientboundSetCarriedItemPacket.class, ClientboundSetCarriedItemPacket::new).addPacket(ClientboundSetChunkCacheCenterPacket.class, ClientboundSetChunkCacheCenterPacket::new).addPacket(ClientboundSetChunkCacheRadiusPacket.class, ClientboundSetChunkCacheRadiusPacket::new).addPacket(ClientboundSetDefaultSpawnPositionPacket.class, ClientboundSetDefaultSpawnPositionPacket::new).addPacket(ClientboundSetDisplayObjectivePacket.class, ClientboundSetDisplayObjectivePacket::new).addPacket(ClientboundSetEntityDataPacket.class, ClientboundSetEntityDataPacket::new).addPacket(ClientboundSetEntityLinkPacket.class, ClientboundSetEntityLinkPacket::new).addPacket(ClientboundSetEntityMotionPacket.class, ClientboundSetEntityMotionPacket::new).addPacket(ClientboundSetEquipmentPacket.class, ClientboundSetEquipmentPacket::new).addPacket(ClientboundSetExperiencePacket.class, ClientboundSetExperiencePacket::new).addPacket(ClientboundSetHealthPacket.class, ClientboundSetHealthPacket::new).addPacket(ClientboundSetObjectivePacket.class, ClientboundSetObjectivePacket::new).addPacket(ClientboundSetPassengersPacket.class, ClientboundSetPassengersPacket::new).addPacket(ClientboundSetPlayerTeamPacket.class, ClientboundSetPlayerTeamPacket::new).addPacket(ClientboundSetScorePacket.class, ClientboundSetScorePacket::new).addPacket(ClientboundSetSubtitleTextPacket.class, ClientboundSetSubtitleTextPacket::new).addPacket(ClientboundSetTimePacket.class, ClientboundSetTimePacket::new).addPacket(ClientboundSetTitleTextPacket.class, ClientboundSetTitleTextPacket::new).addPacket(ClientboundSetTitlesAnimationPacket.class, ClientboundSetTitlesAnimationPacket::new).addPacket(ClientboundSoundEntityPacket.class, ClientboundSoundEntityPacket::new).addPacket(ClientboundSoundPacket.class, ClientboundSoundPacket::new).addPacket(ClientboundStopSoundPacket.class, ClientboundStopSoundPacket::new).addPacket(ClientboundTabListPacket.class, ClientboundTabListPacket::new).addPacket(ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new).addPacket(ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new).addPacket(ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new).addPacket(ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new).addPacket(ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new).addPacket(ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new).addPacket(ClientboundUpdateRecipesPacket.class, ClientboundUpdateRecipesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundAcceptTeleportationPacket.class, ServerboundAcceptTeleportationPacket::new).addPacket(ServerboundBlockEntityTagQuery.class, ServerboundBlockEntityTagQuery::new).addPacket(ServerboundChangeDifficultyPacket.class, ServerboundChangeDifficultyPacket::new).addPacket(ServerboundChatPacket.class, ServerboundChatPacket::new).addPacket(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new).addPacket(ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new).addPacket(ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new).addPacket(ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new).addPacket(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new).addPacket(ServerboundInteractPacket.class, ServerboundInteractPacket::new).addPacket(ServerboundJigsawGeneratePacket.class, ServerboundJigsawGeneratePacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundLockDifficultyPacket.class, ServerboundLockDifficultyPacket::new).addPacket(ServerboundMovePlayerPacket.Pos.class, ServerboundMovePlayerPacket.Pos::read).addPacket(ServerboundMovePlayerPacket.PosRot.class, ServerboundMovePlayerPacket.PosRot::read).addPacket(ServerboundMovePlayerPacket.Rot.class, ServerboundMovePlayerPacket.Rot::read).addPacket(ServerboundMovePlayerPacket.StatusOnly.class, ServerboundMovePlayerPacket.StatusOnly::read).addPacket(ServerboundMoveVehiclePacket.class, ServerboundMoveVehiclePacket::new).addPacket(ServerboundPaddleBoatPacket.class, ServerboundPaddleBoatPacket::new).addPacket(ServerboundPickItemPacket.class, ServerboundPickItemPacket::new).addPacket(ServerboundPlaceRecipePacket.class, ServerboundPlaceRecipePacket::new).addPacket(ServerboundPlayerAbilitiesPacket.class, ServerboundPlayerAbilitiesPacket::new).addPacket(ServerboundPlayerActionPacket.class, ServerboundPlayerActionPacket::new).addPacket(ServerboundPlayerCommandPacket.class, ServerboundPlayerCommandPacket::new).addPacket(ServerboundPlayerInputPacket.class, ServerboundPlayerInputPacket::new).addPacket(ServerboundPongPacket.class, ServerboundPongPacket::new).addPacket(ServerboundRecipeBookChangeSettingsPacket.class, ServerboundRecipeBookChangeSettingsPacket::new).addPacket(ServerboundRecipeBookSeenRecipePacket.class, ServerboundRecipeBookSeenRecipePacket::new).addPacket(ServerboundRenameItemPacket.class, ServerboundRenameItemPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new).addPacket(ServerboundSeenAdvancementsPacket.class, ServerboundSeenAdvancementsPacket::new).addPacket(ServerboundSelectTradePacket.class, ServerboundSelectTradePacket::new).addPacket(ServerboundSetBeaconPacket.class, ServerboundSetBeaconPacket::new).addPacket(ServerboundSetCarriedItemPacket.class, ServerboundSetCarriedItemPacket::new).addPacket(ServerboundSetCommandBlockPacket.class, ServerboundSetCommandBlockPacket::new).addPacket(ServerboundSetCommandMinecartPacket.class, ServerboundSetCommandMinecartPacket::new).addPacket(ServerboundSetCreativeModeSlotPacket.class, ServerboundSetCreativeModeSlotPacket::new).addPacket(ServerboundSetJigsawBlockPacket.class, ServerboundSetJigsawBlockPacket::new).addPacket(ServerboundSetStructureBlockPacket.class, ServerboundSetStructureBlockPacket::new).addPacket(ServerboundSignUpdatePacket.class, ServerboundSignUpdatePacket::new).addPacket(ServerboundSwingPacket.class, ServerboundSwingPacket::new).addPacket(ServerboundTeleportToEntityPacket.class, ServerboundTeleportToEntityPacket::new).addPacket(ServerboundUseItemOnPacket.class, ServerboundUseItemOnPacket::new).addPacket(ServerboundUseItemPacket.class, ServerboundUseItemPacket::new))), +- PLAY(0, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new).addPacket(ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new).addPacket(ClientboundAddMobPacket.class, ClientboundAddMobPacket::new).addPacket(ClientboundAddPaintingPacket.class, ClientboundAddPaintingPacket::new).addPacket(ClientboundAddPlayerPacket.class, ClientboundAddPlayerPacket::new).addPacket(ClientboundAddVibrationSignalPacket.class, ClientboundAddVibrationSignalPacket::new).addPacket(ClientboundAnimatePacket.class, ClientboundAnimatePacket::new).addPacket(ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new).addPacket(ClientboundBlockBreakAckPacket.class, ClientboundBlockBreakAckPacket::new).addPacket(ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new).addPacket(ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new).addPacket(ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new).addPacket(ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new).addPacket(ClientboundBossEventPacket.class, ClientboundBossEventPacket::new).addPacket(ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new).addPacket(ClientboundChatPacket.class, ClientboundChatPacket::new).addPacket(ClientboundClearTitlesPacket.class, ClientboundClearTitlesPacket::new).addPacket(ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new).addPacket(ClientboundCommandsPacket.class, ClientboundCommandsPacket::new).addPacket(ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new).addPacket(ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new).addPacket(ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new).addPacket(ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new).addPacket(ClientboundCooldownPacket.class, ClientboundCooldownPacket::new).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundCustomSoundPacket.class, ClientboundCustomSoundPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new).addPacket(ClientboundExplodePacket.class, ClientboundExplodePacket::new).addPacket(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new).addPacket(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new).addPacket(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new).addPacket(ClientboundInitializeBorderPacket.class, ClientboundInitializeBorderPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundLevelChunkPacket.class, ClientboundLevelChunkPacket::new).addPacket(ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new).addPacket(ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new).addPacket(ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new).addPacket(ClientboundLoginPacket.class, ClientboundLoginPacket::new).addPacket(ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new).addPacket(ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new).addPacket(ClientboundMoveEntityPacket.Pos.class, ClientboundMoveEntityPacket.Pos::read).addPacket(ClientboundMoveEntityPacket.PosRot.class, ClientboundMoveEntityPacket.PosRot::read).addPacket(ClientboundMoveEntityPacket.Rot.class, ClientboundMoveEntityPacket.Rot::read).addPacket(ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new).addPacket(ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new).addPacket(ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new).addPacket(ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new).addPacket(ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new).addPacket(ClientboundPlayerCombatEndPacket.class, ClientboundPlayerCombatEndPacket::new).addPacket(ClientboundPlayerCombatEnterPacket.class, ClientboundPlayerCombatEnterPacket::new).addPacket(ClientboundPlayerCombatKillPacket.class, ClientboundPlayerCombatKillPacket::new).addPacket(ClientboundPlayerInfoPacket.class, ClientboundPlayerInfoPacket::new).addPacket(ClientboundPlayerLookAtPacket.class, ClientboundPlayerLookAtPacket::new).addPacket(ClientboundPlayerPositionPacket.class, ClientboundPlayerPositionPacket::new).addPacket(ClientboundRecipePacket.class, ClientboundRecipePacket::new).addPacket(ClientboundRemoveEntitiesPacket.class, ClientboundRemoveEntitiesPacket::new).addPacket(ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new).addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new).addPacket(ClientboundRespawnPacket.class, ClientboundRespawnPacket::new).addPacket(ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new).addPacket(ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new).addPacket(ClientboundSelectAdvancementsTabPacket.class, ClientboundSelectAdvancementsTabPacket::new).addPacket(ClientboundSetActionBarTextPacket.class, ClientboundSetActionBarTextPacket::new).addPacket(ClientboundSetBorderCenterPacket.class, ClientboundSetBorderCenterPacket::new).addPacket(ClientboundSetBorderLerpSizePacket.class, ClientboundSetBorderLerpSizePacket::new).addPacket(ClientboundSetBorderSizePacket.class, ClientboundSetBorderSizePacket::new).addPacket(ClientboundSetBorderWarningDelayPacket.class, ClientboundSetBorderWarningDelayPacket::new).addPacket(ClientboundSetBorderWarningDistancePacket.class, ClientboundSetBorderWarningDistancePacket::new).addPacket(ClientboundSetCameraPacket.class, ClientboundSetCameraPacket::new).addPacket(ClientboundSetCarriedItemPacket.class, ClientboundSetCarriedItemPacket::new).addPacket(ClientboundSetChunkCacheCenterPacket.class, ClientboundSetChunkCacheCenterPacket::new).addPacket(ClientboundSetChunkCacheRadiusPacket.class, ClientboundSetChunkCacheRadiusPacket::new).addPacket(ClientboundSetDefaultSpawnPositionPacket.class, ClientboundSetDefaultSpawnPositionPacket::new).addPacket(ClientboundSetDisplayObjectivePacket.class, ClientboundSetDisplayObjectivePacket::new).addPacket(ClientboundSetEntityDataPacket.class, ClientboundSetEntityDataPacket::new).addPacket(ClientboundSetEntityLinkPacket.class, ClientboundSetEntityLinkPacket::new).addPacket(ClientboundSetEntityMotionPacket.class, ClientboundSetEntityMotionPacket::new).addPacket(ClientboundSetEquipmentPacket.class, ClientboundSetEquipmentPacket::new).addPacket(ClientboundSetExperiencePacket.class, ClientboundSetExperiencePacket::new).addPacket(ClientboundSetHealthPacket.class, ClientboundSetHealthPacket::new).addPacket(ClientboundSetObjectivePacket.class, ClientboundSetObjectivePacket::new).addPacket(ClientboundSetPassengersPacket.class, ClientboundSetPassengersPacket::new).addPacket(ClientboundSetPlayerTeamPacket.class, ClientboundSetPlayerTeamPacket::new).addPacket(ClientboundSetScorePacket.class, ClientboundSetScorePacket::new).addPacket(ClientboundSetSubtitleTextPacket.class, ClientboundSetSubtitleTextPacket::new).addPacket(ClientboundSetTimePacket.class, ClientboundSetTimePacket::new).addPacket(ClientboundSetTitleTextPacket.class, ClientboundSetTitleTextPacket::new).addPacket(ClientboundSetTitlesAnimationPacket.class, ClientboundSetTitlesAnimationPacket::new).addPacket(ClientboundSoundEntityPacket.class, ClientboundSoundEntityPacket::new).addPacket(ClientboundSoundPacket.class, ClientboundSoundPacket::new).addPacket(ClientboundStopSoundPacket.class, ClientboundStopSoundPacket::new).addPacket(ClientboundTabListPacket.class, ClientboundTabListPacket::new).addPacket(ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new).addPacket(ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new).addPacket(ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new).addPacket(ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new).addPacket(ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new).addPacket(ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new).addPacket(ClientboundUpdateRecipesPacket.class, ClientboundUpdateRecipesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundAcceptTeleportationPacket.class, ServerboundAcceptTeleportationPacket::new).addPacket(ServerboundBlockEntityTagQuery.class, ServerboundBlockEntityTagQuery::new).addPacket(ServerboundChangeDifficultyPacket.class, ServerboundChangeDifficultyPacket::new).addPacket(ServerboundChatPacket.class, ServerboundChatPacket::new).addPacket(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new).addPacket(ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new).addPacket(ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new).addPacket(ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new).addPacket(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new).addPacket(ServerboundInteractPacket.class, ServerboundInteractPacket::new).addPacket(ServerboundJigsawGeneratePacket.class, ServerboundJigsawGeneratePacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundLockDifficultyPacket.class, ServerboundLockDifficultyPacket::new).addPacket(ServerboundMovePlayerPacket.Pos.class, ServerboundMovePlayerPacket.Pos::read).addPacket(ServerboundMovePlayerPacket.PosRot.class, ServerboundMovePlayerPacket.PosRot::read).addPacket(ServerboundMovePlayerPacket.Rot.class, ServerboundMovePlayerPacket.Rot::read).addPacket(ServerboundMovePlayerPacket.StatusOnly.class, ServerboundMovePlayerPacket.StatusOnly::read).addPacket(ServerboundMoveVehiclePacket.class, ServerboundMoveVehiclePacket::new).addPacket(ServerboundPaddleBoatPacket.class, ServerboundPaddleBoatPacket::new).addPacket(ServerboundPickItemPacket.class, ServerboundPickItemPacket::new).addPacket(ServerboundPlaceRecipePacket.class, ServerboundPlaceRecipePacket::new).addPacket(ServerboundPlayerAbilitiesPacket.class, ServerboundPlayerAbilitiesPacket::new).addPacket(ServerboundPlayerActionPacket.class, ServerboundPlayerActionPacket::new).addPacket(ServerboundPlayerCommandPacket.class, ServerboundPlayerCommandPacket::new).addPacket(ServerboundPlayerInputPacket.class, ServerboundPlayerInputPacket::new).addPacket(ServerboundPongPacket.class, ServerboundPongPacket::new).addPacket(ServerboundRecipeBookChangeSettingsPacket.class, ServerboundRecipeBookChangeSettingsPacket::new).addPacket(ServerboundRecipeBookSeenRecipePacket.class, ServerboundRecipeBookSeenRecipePacket::new).addPacket(ServerboundRenameItemPacket.class, ServerboundRenameItemPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new).addPacket(ServerboundSeenAdvancementsPacket.class, ServerboundSeenAdvancementsPacket::new).addPacket(ServerboundSelectTradePacket.class, ServerboundSelectTradePacket::new).addPacket(ServerboundSetBeaconPacket.class, ServerboundSetBeaconPacket::new).addPacket(ServerboundSetCarriedItemPacket.class, ServerboundSetCarriedItemPacket::new).addPacket(ServerboundSetCommandBlockPacket.class, ServerboundSetCommandBlockPacket::new).addPacket(ServerboundSetCommandMinecartPacket.class, ServerboundSetCommandMinecartPacket::new).addPacket(ServerboundSetCreativeModeSlotPacket.class, ServerboundSetCreativeModeSlotPacket::new).addPacket(ServerboundSetJigsawBlockPacket.class, ServerboundSetJigsawBlockPacket::new).addPacket(ServerboundSetStructureBlockPacket.class, ServerboundSetStructureBlockPacket::new).addPacket(ServerboundSignUpdatePacket.class, ServerboundSignUpdatePacket::new).addPacket(ServerboundSwingPacket.class, ServerboundSwingPacket::new).addPacket(ServerboundTeleportToEntityPacket.class, ServerboundTeleportToEntityPacket::new).addPacket(ServerboundUseItemOnPacket.class, ServerboundUseItemOnPacket::new).addPacket(ServerboundUseItemPacket.class, ServerboundUseItemPacket::new))), - STATUS(1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundStatusRequestPacket.class, ServerboundStatusRequestPacket::new).addPacket(ServerboundPingRequestPacket.class, ServerboundPingRequestPacket::new)).addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundStatusResponsePacket.class, ClientboundStatusResponsePacket::new).addPacket(ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new))), - LOGIN(2, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundLoginDisconnectPacket.class, ClientboundLoginDisconnectPacket::new).addPacket(ClientboundHelloPacket.class, ClientboundHelloPacket::new).addPacket(ClientboundGameProfilePacket.class, ClientboundGameProfilePacket::new).addPacket(ClientboundLoginCompressionPacket.class, ClientboundLoginCompressionPacket::new).addPacket(ClientboundCustomQueryPacket.class, ClientboundCustomQueryPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundHelloPacket.class, ServerboundHelloPacket::new).addPacket(ServerboundKeyPacket.class, ServerboundKeyPacket::new).addPacket(ServerboundCustomQueryPacket.class, ServerboundCustomQueryPacket::new))); + // Paper start - fix decompile error - add correct generic packet listeners (e.g. ServerHandshakePacketListener) to PacketSet's generic type, matching the packet flow direction + HANDSHAKING(-1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientIntentionPacket.class, ClientIntentionPacket::new))), -+ PLAY(0, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new).addPacket(ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new).addPacket(ClientboundAddMobPacket.class, ClientboundAddMobPacket::new).addPacket(ClientboundAddPaintingPacket.class, ClientboundAddPaintingPacket::new).addPacket(ClientboundAddPlayerPacket.class, ClientboundAddPlayerPacket::new).addPacket(ClientboundAddVibrationSignalPacket.class, ClientboundAddVibrationSignalPacket::new).addPacket(ClientboundAnimatePacket.class, ClientboundAnimatePacket::new).addPacket(ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new).addPacket(ClientboundBlockBreakAckPacket.class, ClientboundBlockBreakAckPacket::new).addPacket(ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new).addPacket(ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new).addPacket(ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new).addPacket(ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new).addPacket(ClientboundBossEventPacket.class, ClientboundBossEventPacket::new).addPacket(ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new).addPacket(ClientboundChatPacket.class, ClientboundChatPacket::new).addPacket(ClientboundClearTitlesPacket.class, ClientboundClearTitlesPacket::new).addPacket(ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new).addPacket(ClientboundCommandsPacket.class, ClientboundCommandsPacket::new).addPacket(ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new).addPacket(ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new).addPacket(ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new).addPacket(ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new).addPacket(ClientboundCooldownPacket.class, ClientboundCooldownPacket::new).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundCustomSoundPacket.class, ClientboundCustomSoundPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new).addPacket(ClientboundExplodePacket.class, ClientboundExplodePacket::new).addPacket(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new).addPacket(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new).addPacket(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new).addPacket(ClientboundInitializeBorderPacket.class, ClientboundInitializeBorderPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundLevelChunkPacket.class, ClientboundLevelChunkPacket::new).addPacket(ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new).addPacket(ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new).addPacket(ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new).addPacket(ClientboundLoginPacket.class, ClientboundLoginPacket::new).addPacket(ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new).addPacket(ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new).addPacket(ClientboundMoveEntityPacket.Pos.class, ClientboundMoveEntityPacket.Pos::read).addPacket(ClientboundMoveEntityPacket.PosRot.class, ClientboundMoveEntityPacket.PosRot::read).addPacket(ClientboundMoveEntityPacket.Rot.class, ClientboundMoveEntityPacket.Rot::read).addPacket(ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new).addPacket(ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new).addPacket(ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new).addPacket(ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new).addPacket(ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new).addPacket(ClientboundPlayerCombatEndPacket.class, ClientboundPlayerCombatEndPacket::new).addPacket(ClientboundPlayerCombatEnterPacket.class, ClientboundPlayerCombatEnterPacket::new).addPacket(ClientboundPlayerCombatKillPacket.class, ClientboundPlayerCombatKillPacket::new).addPacket(ClientboundPlayerInfoPacket.class, ClientboundPlayerInfoPacket::new).addPacket(ClientboundPlayerLookAtPacket.class, ClientboundPlayerLookAtPacket::new).addPacket(ClientboundPlayerPositionPacket.class, ClientboundPlayerPositionPacket::new).addPacket(ClientboundRecipePacket.class, ClientboundRecipePacket::new).addPacket(ClientboundRemoveEntityPacket.class, ClientboundRemoveEntityPacket::new).addPacket(ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new).addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new).addPacket(ClientboundRespawnPacket.class, ClientboundRespawnPacket::new).addPacket(ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new).addPacket(ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new).addPacket(ClientboundSelectAdvancementsTabPacket.class, ClientboundSelectAdvancementsTabPacket::new).addPacket(ClientboundSetActionBarTextPacket.class, ClientboundSetActionBarTextPacket::new).addPacket(ClientboundSetBorderCenterPacket.class, ClientboundSetBorderCenterPacket::new).addPacket(ClientboundSetBorderLerpSizePacket.class, ClientboundSetBorderLerpSizePacket::new).addPacket(ClientboundSetBorderSizePacket.class, ClientboundSetBorderSizePacket::new).addPacket(ClientboundSetBorderWarningDelayPacket.class, ClientboundSetBorderWarningDelayPacket::new).addPacket(ClientboundSetBorderWarningDistancePacket.class, ClientboundSetBorderWarningDistancePacket::new).addPacket(ClientboundSetCameraPacket.class, ClientboundSetCameraPacket::new).addPacket(ClientboundSetCarriedItemPacket.class, ClientboundSetCarriedItemPacket::new).addPacket(ClientboundSetChunkCacheCenterPacket.class, ClientboundSetChunkCacheCenterPacket::new).addPacket(ClientboundSetChunkCacheRadiusPacket.class, ClientboundSetChunkCacheRadiusPacket::new).addPacket(ClientboundSetDefaultSpawnPositionPacket.class, ClientboundSetDefaultSpawnPositionPacket::new).addPacket(ClientboundSetDisplayObjectivePacket.class, ClientboundSetDisplayObjectivePacket::new).addPacket(ClientboundSetEntityDataPacket.class, ClientboundSetEntityDataPacket::new).addPacket(ClientboundSetEntityLinkPacket.class, ClientboundSetEntityLinkPacket::new).addPacket(ClientboundSetEntityMotionPacket.class, ClientboundSetEntityMotionPacket::new).addPacket(ClientboundSetEquipmentPacket.class, ClientboundSetEquipmentPacket::new).addPacket(ClientboundSetExperiencePacket.class, ClientboundSetExperiencePacket::new).addPacket(ClientboundSetHealthPacket.class, ClientboundSetHealthPacket::new).addPacket(ClientboundSetObjectivePacket.class, ClientboundSetObjectivePacket::new).addPacket(ClientboundSetPassengersPacket.class, ClientboundSetPassengersPacket::new).addPacket(ClientboundSetPlayerTeamPacket.class, ClientboundSetPlayerTeamPacket::new).addPacket(ClientboundSetScorePacket.class, ClientboundSetScorePacket::new).addPacket(ClientboundSetSubtitleTextPacket.class, ClientboundSetSubtitleTextPacket::new).addPacket(ClientboundSetTimePacket.class, ClientboundSetTimePacket::new).addPacket(ClientboundSetTitleTextPacket.class, ClientboundSetTitleTextPacket::new).addPacket(ClientboundSetTitlesAnimationPacket.class, ClientboundSetTitlesAnimationPacket::new).addPacket(ClientboundSoundEntityPacket.class, ClientboundSoundEntityPacket::new).addPacket(ClientboundSoundPacket.class, ClientboundSoundPacket::new).addPacket(ClientboundStopSoundPacket.class, ClientboundStopSoundPacket::new).addPacket(ClientboundTabListPacket.class, ClientboundTabListPacket::new).addPacket(ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new).addPacket(ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new).addPacket(ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new).addPacket(ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new).addPacket(ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new).addPacket(ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new).addPacket(ClientboundUpdateRecipesPacket.class, ClientboundUpdateRecipesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundAcceptTeleportationPacket.class, ServerboundAcceptTeleportationPacket::new).addPacket(ServerboundBlockEntityTagQuery.class, ServerboundBlockEntityTagQuery::new).addPacket(ServerboundChangeDifficultyPacket.class, ServerboundChangeDifficultyPacket::new).addPacket(ServerboundChatPacket.class, ServerboundChatPacket::new).addPacket(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new).addPacket(ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new).addPacket(ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new).addPacket(ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new).addPacket(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new).addPacket(ServerboundInteractPacket.class, ServerboundInteractPacket::new).addPacket(ServerboundJigsawGeneratePacket.class, ServerboundJigsawGeneratePacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundLockDifficultyPacket.class, ServerboundLockDifficultyPacket::new).addPacket(ServerboundMovePlayerPacket.Pos.class, ServerboundMovePlayerPacket.Pos::read).addPacket(ServerboundMovePlayerPacket.PosRot.class, ServerboundMovePlayerPacket.PosRot::read).addPacket(ServerboundMovePlayerPacket.Rot.class, ServerboundMovePlayerPacket.Rot::read).addPacket(ServerboundMovePlayerPacket.StatusOnly.class, ServerboundMovePlayerPacket.StatusOnly::read).addPacket(ServerboundMoveVehiclePacket.class, ServerboundMoveVehiclePacket::new).addPacket(ServerboundPaddleBoatPacket.class, ServerboundPaddleBoatPacket::new).addPacket(ServerboundPickItemPacket.class, ServerboundPickItemPacket::new).addPacket(ServerboundPlaceRecipePacket.class, ServerboundPlaceRecipePacket::new).addPacket(ServerboundPlayerAbilitiesPacket.class, ServerboundPlayerAbilitiesPacket::new).addPacket(ServerboundPlayerActionPacket.class, ServerboundPlayerActionPacket::new).addPacket(ServerboundPlayerCommandPacket.class, ServerboundPlayerCommandPacket::new).addPacket(ServerboundPlayerInputPacket.class, ServerboundPlayerInputPacket::new).addPacket(ServerboundPongPacket.class, ServerboundPongPacket::new).addPacket(ServerboundRecipeBookChangeSettingsPacket.class, ServerboundRecipeBookChangeSettingsPacket::new).addPacket(ServerboundRecipeBookSeenRecipePacket.class, ServerboundRecipeBookSeenRecipePacket::new).addPacket(ServerboundRenameItemPacket.class, ServerboundRenameItemPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new).addPacket(ServerboundSeenAdvancementsPacket.class, ServerboundSeenAdvancementsPacket::new).addPacket(ServerboundSelectTradePacket.class, ServerboundSelectTradePacket::new).addPacket(ServerboundSetBeaconPacket.class, ServerboundSetBeaconPacket::new).addPacket(ServerboundSetCarriedItemPacket.class, ServerboundSetCarriedItemPacket::new).addPacket(ServerboundSetCommandBlockPacket.class, ServerboundSetCommandBlockPacket::new).addPacket(ServerboundSetCommandMinecartPacket.class, ServerboundSetCommandMinecartPacket::new).addPacket(ServerboundSetCreativeModeSlotPacket.class, ServerboundSetCreativeModeSlotPacket::new).addPacket(ServerboundSetJigsawBlockPacket.class, ServerboundSetJigsawBlockPacket::new).addPacket(ServerboundSetStructureBlockPacket.class, ServerboundSetStructureBlockPacket::new).addPacket(ServerboundSignUpdatePacket.class, ServerboundSignUpdatePacket::new).addPacket(ServerboundSwingPacket.class, ServerboundSwingPacket::new).addPacket(ServerboundTeleportToEntityPacket.class, ServerboundTeleportToEntityPacket::new).addPacket(ServerboundUseItemOnPacket.class, ServerboundUseItemOnPacket::new).addPacket(ServerboundUseItemPacket.class, ServerboundUseItemPacket::new))), ++ PLAY(0, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new).addPacket(ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new).addPacket(ClientboundAddMobPacket.class, ClientboundAddMobPacket::new).addPacket(ClientboundAddPaintingPacket.class, ClientboundAddPaintingPacket::new).addPacket(ClientboundAddPlayerPacket.class, ClientboundAddPlayerPacket::new).addPacket(ClientboundAddVibrationSignalPacket.class, ClientboundAddVibrationSignalPacket::new).addPacket(ClientboundAnimatePacket.class, ClientboundAnimatePacket::new).addPacket(ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new).addPacket(ClientboundBlockBreakAckPacket.class, ClientboundBlockBreakAckPacket::new).addPacket(ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new).addPacket(ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new).addPacket(ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new).addPacket(ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new).addPacket(ClientboundBossEventPacket.class, ClientboundBossEventPacket::new).addPacket(ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new).addPacket(ClientboundChatPacket.class, ClientboundChatPacket::new).addPacket(ClientboundClearTitlesPacket.class, ClientboundClearTitlesPacket::new).addPacket(ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new).addPacket(ClientboundCommandsPacket.class, ClientboundCommandsPacket::new).addPacket(ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new).addPacket(ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new).addPacket(ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new).addPacket(ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new).addPacket(ClientboundCooldownPacket.class, ClientboundCooldownPacket::new).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundCustomSoundPacket.class, ClientboundCustomSoundPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new).addPacket(ClientboundExplodePacket.class, ClientboundExplodePacket::new).addPacket(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new).addPacket(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new).addPacket(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new).addPacket(ClientboundInitializeBorderPacket.class, ClientboundInitializeBorderPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundLevelChunkPacket.class, ClientboundLevelChunkPacket::new).addPacket(ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new).addPacket(ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new).addPacket(ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new).addPacket(ClientboundLoginPacket.class, ClientboundLoginPacket::new).addPacket(ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new).addPacket(ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new).addPacket(ClientboundMoveEntityPacket.Pos.class, ClientboundMoveEntityPacket.Pos::read).addPacket(ClientboundMoveEntityPacket.PosRot.class, ClientboundMoveEntityPacket.PosRot::read).addPacket(ClientboundMoveEntityPacket.Rot.class, ClientboundMoveEntityPacket.Rot::read).addPacket(ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new).addPacket(ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new).addPacket(ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new).addPacket(ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new).addPacket(ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new).addPacket(ClientboundPlayerCombatEndPacket.class, ClientboundPlayerCombatEndPacket::new).addPacket(ClientboundPlayerCombatEnterPacket.class, ClientboundPlayerCombatEnterPacket::new).addPacket(ClientboundPlayerCombatKillPacket.class, ClientboundPlayerCombatKillPacket::new).addPacket(ClientboundPlayerInfoPacket.class, ClientboundPlayerInfoPacket::new).addPacket(ClientboundPlayerLookAtPacket.class, ClientboundPlayerLookAtPacket::new).addPacket(ClientboundPlayerPositionPacket.class, ClientboundPlayerPositionPacket::new).addPacket(ClientboundRecipePacket.class, ClientboundRecipePacket::new).addPacket(ClientboundRemoveEntitiesPacket.class, ClientboundRemoveEntitiesPacket::new).addPacket(ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new).addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new).addPacket(ClientboundRespawnPacket.class, ClientboundRespawnPacket::new).addPacket(ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new).addPacket(ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new).addPacket(ClientboundSelectAdvancementsTabPacket.class, ClientboundSelectAdvancementsTabPacket::new).addPacket(ClientboundSetActionBarTextPacket.class, ClientboundSetActionBarTextPacket::new).addPacket(ClientboundSetBorderCenterPacket.class, ClientboundSetBorderCenterPacket::new).addPacket(ClientboundSetBorderLerpSizePacket.class, ClientboundSetBorderLerpSizePacket::new).addPacket(ClientboundSetBorderSizePacket.class, ClientboundSetBorderSizePacket::new).addPacket(ClientboundSetBorderWarningDelayPacket.class, ClientboundSetBorderWarningDelayPacket::new).addPacket(ClientboundSetBorderWarningDistancePacket.class, ClientboundSetBorderWarningDistancePacket::new).addPacket(ClientboundSetCameraPacket.class, ClientboundSetCameraPacket::new).addPacket(ClientboundSetCarriedItemPacket.class, ClientboundSetCarriedItemPacket::new).addPacket(ClientboundSetChunkCacheCenterPacket.class, ClientboundSetChunkCacheCenterPacket::new).addPacket(ClientboundSetChunkCacheRadiusPacket.class, ClientboundSetChunkCacheRadiusPacket::new).addPacket(ClientboundSetDefaultSpawnPositionPacket.class, ClientboundSetDefaultSpawnPositionPacket::new).addPacket(ClientboundSetDisplayObjectivePacket.class, ClientboundSetDisplayObjectivePacket::new).addPacket(ClientboundSetEntityDataPacket.class, ClientboundSetEntityDataPacket::new).addPacket(ClientboundSetEntityLinkPacket.class, ClientboundSetEntityLinkPacket::new).addPacket(ClientboundSetEntityMotionPacket.class, ClientboundSetEntityMotionPacket::new).addPacket(ClientboundSetEquipmentPacket.class, ClientboundSetEquipmentPacket::new).addPacket(ClientboundSetExperiencePacket.class, ClientboundSetExperiencePacket::new).addPacket(ClientboundSetHealthPacket.class, ClientboundSetHealthPacket::new).addPacket(ClientboundSetObjectivePacket.class, ClientboundSetObjectivePacket::new).addPacket(ClientboundSetPassengersPacket.class, ClientboundSetPassengersPacket::new).addPacket(ClientboundSetPlayerTeamPacket.class, ClientboundSetPlayerTeamPacket::new).addPacket(ClientboundSetScorePacket.class, ClientboundSetScorePacket::new).addPacket(ClientboundSetSubtitleTextPacket.class, ClientboundSetSubtitleTextPacket::new).addPacket(ClientboundSetTimePacket.class, ClientboundSetTimePacket::new).addPacket(ClientboundSetTitleTextPacket.class, ClientboundSetTitleTextPacket::new).addPacket(ClientboundSetTitlesAnimationPacket.class, ClientboundSetTitlesAnimationPacket::new).addPacket(ClientboundSoundEntityPacket.class, ClientboundSoundEntityPacket::new).addPacket(ClientboundSoundPacket.class, ClientboundSoundPacket::new).addPacket(ClientboundStopSoundPacket.class, ClientboundStopSoundPacket::new).addPacket(ClientboundTabListPacket.class, ClientboundTabListPacket::new).addPacket(ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new).addPacket(ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new).addPacket(ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new).addPacket(ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new).addPacket(ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new).addPacket(ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new).addPacket(ClientboundUpdateRecipesPacket.class, ClientboundUpdateRecipesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundAcceptTeleportationPacket.class, ServerboundAcceptTeleportationPacket::new).addPacket(ServerboundBlockEntityTagQuery.class, ServerboundBlockEntityTagQuery::new).addPacket(ServerboundChangeDifficultyPacket.class, ServerboundChangeDifficultyPacket::new).addPacket(ServerboundChatPacket.class, ServerboundChatPacket::new).addPacket(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new).addPacket(ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new).addPacket(ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new).addPacket(ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new).addPacket(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new).addPacket(ServerboundInteractPacket.class, ServerboundInteractPacket::new).addPacket(ServerboundJigsawGeneratePacket.class, ServerboundJigsawGeneratePacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundLockDifficultyPacket.class, ServerboundLockDifficultyPacket::new).addPacket(ServerboundMovePlayerPacket.Pos.class, ServerboundMovePlayerPacket.Pos::read).addPacket(ServerboundMovePlayerPacket.PosRot.class, ServerboundMovePlayerPacket.PosRot::read).addPacket(ServerboundMovePlayerPacket.Rot.class, ServerboundMovePlayerPacket.Rot::read).addPacket(ServerboundMovePlayerPacket.StatusOnly.class, ServerboundMovePlayerPacket.StatusOnly::read).addPacket(ServerboundMoveVehiclePacket.class, ServerboundMoveVehiclePacket::new).addPacket(ServerboundPaddleBoatPacket.class, ServerboundPaddleBoatPacket::new).addPacket(ServerboundPickItemPacket.class, ServerboundPickItemPacket::new).addPacket(ServerboundPlaceRecipePacket.class, ServerboundPlaceRecipePacket::new).addPacket(ServerboundPlayerAbilitiesPacket.class, ServerboundPlayerAbilitiesPacket::new).addPacket(ServerboundPlayerActionPacket.class, ServerboundPlayerActionPacket::new).addPacket(ServerboundPlayerCommandPacket.class, ServerboundPlayerCommandPacket::new).addPacket(ServerboundPlayerInputPacket.class, ServerboundPlayerInputPacket::new).addPacket(ServerboundPongPacket.class, ServerboundPongPacket::new).addPacket(ServerboundRecipeBookChangeSettingsPacket.class, ServerboundRecipeBookChangeSettingsPacket::new).addPacket(ServerboundRecipeBookSeenRecipePacket.class, ServerboundRecipeBookSeenRecipePacket::new).addPacket(ServerboundRenameItemPacket.class, ServerboundRenameItemPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new).addPacket(ServerboundSeenAdvancementsPacket.class, ServerboundSeenAdvancementsPacket::new).addPacket(ServerboundSelectTradePacket.class, ServerboundSelectTradePacket::new).addPacket(ServerboundSetBeaconPacket.class, ServerboundSetBeaconPacket::new).addPacket(ServerboundSetCarriedItemPacket.class, ServerboundSetCarriedItemPacket::new).addPacket(ServerboundSetCommandBlockPacket.class, ServerboundSetCommandBlockPacket::new).addPacket(ServerboundSetCommandMinecartPacket.class, ServerboundSetCommandMinecartPacket::new).addPacket(ServerboundSetCreativeModeSlotPacket.class, ServerboundSetCreativeModeSlotPacket::new).addPacket(ServerboundSetJigsawBlockPacket.class, ServerboundSetJigsawBlockPacket::new).addPacket(ServerboundSetStructureBlockPacket.class, ServerboundSetStructureBlockPacket::new).addPacket(ServerboundSignUpdatePacket.class, ServerboundSignUpdatePacket::new).addPacket(ServerboundSwingPacket.class, ServerboundSwingPacket::new).addPacket(ServerboundTeleportToEntityPacket.class, ServerboundTeleportToEntityPacket::new).addPacket(ServerboundUseItemOnPacket.class, ServerboundUseItemOnPacket::new).addPacket(ServerboundUseItemPacket.class, ServerboundUseItemPacket::new))), + STATUS(1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundStatusRequestPacket.class, ServerboundStatusRequestPacket::new).addPacket(ServerboundPingRequestPacket.class, ServerboundPingRequestPacket::new)).addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundStatusResponsePacket.class, ClientboundStatusResponsePacket::new).addPacket(ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new))), + LOGIN(2, protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundLoginDisconnectPacket.class, ClientboundLoginDisconnectPacket::new).addPacket(ClientboundHelloPacket.class, ClientboundHelloPacket::new).addPacket(ClientboundGameProfilePacket.class, ClientboundGameProfilePacket::new).addPacket(ClientboundLoginCompressionPacket.class, ClientboundLoginCompressionPacket::new).addPacket(ClientboundCustomQueryPacket.class, ClientboundCustomQueryPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundHelloPacket.class, ServerboundHelloPacket::new).addPacket(ServerboundKeyPacket.class, ServerboundKeyPacket::new).addPacket(ServerboundCustomQueryPacket.class, ServerboundCustomQueryPacket::new))); + // Paper end @@ -157,10 +157,10 @@ index 6b66e1ad66dccacb5c959da924d7857358488678..e722cf3a8e816b0c7405e6282591d9fa private static final int MIN_PROTOCOL_ID = -1; private static final int MAX_PROTOCOL_ID = 2; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 729e55535d833f8f6ff65bf226aac5ecdec44990..f0aea7c801b3ef3b1a213ecd473ce9e718f1be46 100644 +index bae8c5ccfc32c2a36a1f7e03ab4fb762dc3ff2c8..b5f3bf8ff585c518326b0dcb5b793f181d52505f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1766,7 +1766,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { diff --git a/src/main/java/net/minecraft/server/level/Ticket.java b/src/main/java/net/minecraft/server/level/Ticket.java -index 2f66abf62d303342f5fe614fb3e35e7844497ffc..b346fa94b23d81da7da073f71dd12e672e0f079c 100644 +index 062da1bddd9704f5fbc46e974e13e60cd500bbe2..ffc43e5d3d0563c9e9c171064511b2c65ddf67e1 100644 --- a/src/main/java/net/minecraft/server/level/Ticket.java +++ b/src/main/java/net/minecraft/server/level/Ticket.java @@ -21,7 +21,7 @@ public final class Ticket implements Comparable> { @@ -209,7 +209,7 @@ index d0f6eb3981a171c0f34870cb0472599d6cca9642..d1b2ba24ef54e01c6249c3b2ca16e80f public static SortedArraySet create(Comparator comparator) { diff --git a/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java b/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java -index d4488ebc4d4f50e1c3ccfeeb8bb82d06a7a90c30..37110c535b9fe25b53b5ebe9aa448ade6dcda2f9 100644 +index a2bab5980a8fd6d98c20aa601ba0ce97044ce996..d7cc7e12d265a47564c3f1d4af27a3ec8cba284a 100644 --- a/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java +++ b/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java @@ -93,7 +93,7 @@ public class ProcessorMailbox implements ProfilerMeasured, ProcessorHandle @@ -222,7 +222,7 @@ index d4488ebc4d4f50e1c3ccfeeb8bb82d06a7a90c30..37110c535b9fe25b53b5ebe9aa448ade }); } finally { diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -index 9bc0ccf6acccd5505bac7b8a6bfb7597a43570cf..396cf81c2a501a09ab742f53d524463741c4d1ed 100644 +index 38dd114fbfa07a18987cd774ae05060d723247e4..057b92a2948543644618c63abd3f61d1120db4dd 100644 --- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java +++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java @@ -75,7 +75,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { diff --git a/patches/server/0006-MC-Utils.patch b/patches/server/0006-MC-Utils.patch index 9f0bc3af89..27e63bf85f 100644 --- a/patches/server/0006-MC-Utils.patch +++ b/patches/server/0006-MC-Utils.patch @@ -2315,11 +2315,11 @@ index 3d374000cd61d4a29dae21035c5ee9a93a1ff0f9..e59475b7bb3e000afece0033c5d3f112 return NbtUtils.loadUUID(this.get(key)); } diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java -index f189a72bd101a99d9350072a06953665fc5d6fee..83e99af925c87433b59f9bed30dfbf4e490c1b84 100644 +index 5bcfbda6fd8bb8a3793ddad18f533f4f31f0bc94..8e9d685d04b93cef73b3fbebd086c970968914d5 100644 --- a/src/main/java/net/minecraft/network/PacketEncoder.java +++ b/src/main/java/net/minecraft/network/PacketEncoder.java @@ -45,7 +45,7 @@ public class PacketEncoder extends MessageToByteEncoder> { - throw new IllegalArgumentException("Packet too big (is " + j + ", should be less than 2097152): " + packet); + throw new IllegalArgumentException("Packet too big (is " + j + ", should be less than 8388608): " + packet); } } catch (Throwable var9) { - LOGGER.error(var9); @@ -2830,10 +2830,10 @@ index 0000000000000000000000000000000000000000..80f8d6ce6dd717d4b37b78539c65b6ac + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 75801343b14a5555e974168170af95f8513926f5..1b76d1b929b85b130639e7937a118342b568e795 100644 +index b5f3bf8ff585c518326b0dcb5b793f181d52505f..571e57affcf81151550184b45934ae810885145f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -941,6 +941,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier persistentStateManagerFactory, int viewDistance, boolean dsync) { super(new File(session.getDimensionPath(world.dimension()), "region"), dataFixer, dsync); this.visibleChunkMap = this.updatingChunkMap.clone(); -@@ -271,6 +292,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -273,6 +294,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } } @@ -3053,7 +3053,7 @@ index a45d5c1156e84ab6e56c95e392fd52ea9ecebcb0..33d17e69fac035c421345e1a8c6eb214 private CompletableFuture, ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkPos centerChunk, int margin, IntFunction distanceToStatus) { List>> list = Lists.newArrayList(); int j = centerChunk.x; -@@ -961,6 +990,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -962,6 +991,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (!flag1) { this.distanceManager.addPlayer(SectionPos.of((Entity) player), player); } @@ -3061,7 +3061,7 @@ index a45d5c1156e84ab6e56c95e392fd52ea9ecebcb0..33d17e69fac035c421345e1a8c6eb214 } else { SectionPos sectionposition = player.getLastSectionPos(); -@@ -968,6 +998,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -969,6 +999,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (!flag2) { this.distanceManager.removePlayer(sectionposition, player); } @@ -3069,7 +3069,7 @@ index a45d5c1156e84ab6e56c95e392fd52ea9ecebcb0..33d17e69fac035c421345e1a8c6eb214 } for (int k = i - this.viewDistance; k <= i + this.viewDistance; ++k) { -@@ -1078,6 +1109,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1079,6 +1110,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } } @@ -3079,10 +3079,10 @@ index a45d5c1156e84ab6e56c95e392fd52ea9ecebcb0..33d17e69fac035c421345e1a8c6eb214 @Override diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index cfe9930490489d506c91d174b5aad199314ffd17..508adf5df266365992f9ee64f6592465e879deaa 100644 +index 9591f50922343283597bad6d9ac17c175d8ae230..8639ffa2347e3d5c44ab30de0aa98623f95d1fe7 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -45,6 +45,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana +@@ -44,6 +44,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana import net.minecraft.world.level.storage.DimensionDataStorage; import net.minecraft.world.level.storage.LevelData; import net.minecraft.world.level.storage.LevelStorageSource; @@ -3090,7 +3090,7 @@ index cfe9930490489d506c91d174b5aad199314ffd17..508adf5df266365992f9ee64f6592465 public class ServerChunkCache extends ChunkSource { -@@ -67,6 +68,158 @@ public class ServerChunkCache extends ChunkSource { +@@ -66,6 +67,158 @@ public class ServerChunkCache extends ChunkSource { @Nullable @VisibleForDebug private NaturalSpawner.SpawnState lastSpawnState; @@ -3249,7 +3249,7 @@ index cfe9930490489d506c91d174b5aad199314ffd17..508adf5df266365992f9ee64f6592465 public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, boolean flag, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkstatusupdatelistener, Supplier supplier) { this.level = world; -@@ -128,6 +281,49 @@ public class ServerChunkCache extends ChunkSource { +@@ -127,6 +280,49 @@ public class ServerChunkCache extends ChunkSource { this.lastChunk[0] = chunk; } @@ -3299,7 +3299,7 @@ index cfe9930490489d506c91d174b5aad199314ffd17..508adf5df266365992f9ee64f6592465 @Nullable @Override public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) { -@@ -426,10 +622,9 @@ public class ServerChunkCache extends ChunkSource { +@@ -425,10 +621,9 @@ public class ServerChunkCache extends ChunkSource { this.lastSpawnState = spawnercreature_d; this.level.getProfiler().pop(); @@ -3313,8 +3313,17 @@ index cfe9930490489d506c91d174b5aad199314ffd17..508adf5df266365992f9ee64f6592465 Optional optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); if (optional.isPresent()) { +@@ -453,7 +648,7 @@ public class ServerChunkCache extends ChunkSource { + } + + this.level.getProfiler().popPush("broadcast"); +- list.forEach((playerchunk) -> { ++ this.chunkMap.getChunks().forEach((playerchunk) -> { // Paper - no... just no... + Optional optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); // CraftBukkit - decompile error + + Objects.requireNonNull(playerchunk); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index bde78718251f9deb439805d41cb05ac063042efc..bcfc6ea89aa3b1df92d2b181d1d23902859e2584 100644 +index a1a4e4fe7b635c632a024f8591c44f20c2f16618..1e1908649a19fe067defe3c0d9c798a6a2988d82 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -9,6 +9,7 @@ import it.unimi.dsi.fastutil.longs.LongSet; @@ -3326,10 +3335,10 @@ index bde78718251f9deb439805d41cb05ac063042efc..bcfc6ea89aa3b1df92d2b181d1d23902 import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet; import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 2889d43857f418eb26600e78940dedc2b7c2b0f4..2b0d989119c9f69a68a6c1c69fb09dbbedd16716 100644 +index 76a07bfb7aef66efb461f82c2a1d4651b6513248..504862eae87d4b58d9588b383993a44919d66759 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -228,6 +228,8 @@ public class ServerPlayer extends Player { +@@ -229,6 +229,8 @@ public class ServerPlayer extends Player { public Integer clientViewDistance; // CraftBukkit end @@ -3338,7 +3347,7 @@ index 2889d43857f418eb26600e78940dedc2b7c2b0f4..2b0d989119c9f69a68a6c1c69fb09dbb public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); this.chatVisibility = ChatVisiblity.FULL; -@@ -295,6 +297,8 @@ public class ServerPlayer extends Player { +@@ -291,6 +293,8 @@ public class ServerPlayer extends Player { this.maxUpStep = 1.0F; this.fudgeSpawnLocation(world); @@ -3391,10 +3400,10 @@ index 391bae98e542333a431fb48bf0675c0e8a1873ac..0f6b534a4c789a2f09f6c4624e5d58b9 public BlockState getBlockState(BlockPos pos) { return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())).getBlockState(pos); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a401610e083b699be2c60a505f673cb3968d452b..e02562f8d0160dc3516768555604ae47f3f55461 100644 +index 1130a8b5e3314d879319b8b60b2408b6c1aa7f5b..d6bef66d1cc0e3915ca5a9b9d5fc6e645eb5a7de 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -219,9 +219,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -218,9 +218,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private final MinecraftServer server; public ServerPlayer player; private int tickCount; @@ -3426,7 +3435,7 @@ index a4c5edee297af6d68d518b77f706732b5ccbe4de..7bf4bf5cb2c1b54a7e2733091f48f3a8 @Override public void tell(R runnable) { diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 595e48db4ce6064c25f3802be54ce34e87948cff..9f68aa235949520b445b368782ccde6b0e26859d 100644 +index e6d003701426a823768966d944384c69b9701967..3b09f76805053802bb779e227749d81482636407 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -259,6 +259,7 @@ public abstract class LivingEntity extends Entity { @@ -3438,10 +3447,10 @@ index 595e48db4ce6064c25f3802be54ce34e87948cff..9f68aa235949520b445b368782ccde6b @Override public float getBukkitYaw() { diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 7ed0498e86fa5cea8edb002146126dcedd5b23f6..e91932d25e7b5d4a95e485bfa8b70632e0641b0a 100644 +index 014a95cac1ad21637c21e2c0c9e189ff9e3b319d..6b4e78af38fe5b2567597d6267ddecd252585b5a 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -230,6 +230,7 @@ public abstract class Mob extends LivingEntity { +@@ -231,6 +231,7 @@ public abstract class Mob extends LivingEntity { return this.target; } @@ -3475,7 +3484,7 @@ index d31c62b612a5a8016ffbfbb9dc85d9a941c08cf4..fc34cfa8bfb3b82a8e1b28d261f0e901 super(type, world); this.xpReward = 5; diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 48902f822ccb6e231201f888a2a92923a946e8cf..280519717d32385a74d6e942a6f42fc12ad8c57e 100644 +index 17267d9d58ece0140171a297deb59dd54993135a..4a1ca04332e5afe0379276f3cefab7e0bf03a07b 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -725,6 +725,24 @@ public final class ItemStack { @@ -3503,7 +3512,7 @@ index 48902f822ccb6e231201f888a2a92923a946e8cf..280519717d32385a74d6e942a6f42fc1 public void setTag(@Nullable CompoundTag tag) { this.tag = tag; if (this.getItem().canBeDepleted()) { -@@ -1128,6 +1146,7 @@ public final class ItemStack { +@@ -1125,6 +1143,7 @@ public final class ItemStack { // CraftBukkit start @Deprecated public void setItem(Item item) { @@ -3613,7 +3622,7 @@ index 3c707d6674b2594b09503b959a31c1f4ad3981e6..c7d499bfc22152e0a49f50a2a8133f31 public BlockState getBlockState(BlockPos pos) { return Blocks.AIR.defaultBlockState(); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..e9dc71fb74698b2f11220e4eb379f21610899d97 100644 +index d6b2e7d643f907ddd81d394d9b613e9ce93a786e..3286beed6bf79f5f6b91227f596fcc43200e8bda 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -84,6 +84,7 @@ import org.bukkit.craftbukkit.CraftServer; @@ -3624,7 +3633,7 @@ index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..e9dc71fb74698b2f11220e4eb379f216 import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.event.block.BlockPhysicsEvent; -@@ -228,9 +229,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -229,9 +230,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { Level.this.getCraftServer().getHandle().sendAll(new ClientboundSetBorderWarningDistancePacket(border), border.world); } @@ -3638,7 +3647,7 @@ index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..e9dc71fb74698b2f11220e4eb379f216 }); // CraftBukkit end this.timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot - code below can generate new world and access timings -@@ -265,18 +268,50 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -266,18 +269,50 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return y < -20000000 || y >= 20000000; } @@ -3693,7 +3702,7 @@ index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..e9dc71fb74698b2f11220e4eb379f216 ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create); if (ichunkaccess == null && create) { -@@ -287,7 +322,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -288,7 +323,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } @Override @@ -3702,7 +3711,7 @@ index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..e9dc71fb74698b2f11220e4eb379f216 return this.setBlock(pos, state, flags, 512); } -@@ -588,7 +623,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -593,7 +628,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { if (this.isOutsideBuildHeight(pos)) { return Blocks.VOID_AIR.defaultBlockState(); } else { diff --git a/patches/server/0009-Timings-v2.patch b/patches/server/0009-Timings-v2.patch index 63c04b601d..86e552fb51 100644 --- a/patches/server/0009-Timings-v2.patch +++ b/patches/server/0009-Timings-v2.patch @@ -767,10 +767,10 @@ index b3a6aeba2363d283f03982cf749f25cfa11a5052..449f1b2f5dca350dc0912e14c8c2bf3e PacketUtils.LOGGER.debug("Ignoring packet due to disconnection: {}", packet); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b403ef2dff6 100644 +index 571e57affcf81151550184b45934ae810885145f..fcc775723bcef7c6b740ee332c21ef70e591c77e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -183,7 +183,7 @@ import org.bukkit.craftbukkit.Main; +@@ -180,7 +180,7 @@ import org.bukkit.craftbukkit.Main; import org.bukkit.event.server.ServerLoadEvent; // CraftBukkit end @@ -779,7 +779,7 @@ index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b40 import org.spigotmc.SlackActivityAccountant; // Spigot public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements SnooperPopulator, CommandSource, AutoCloseable { -@@ -887,6 +887,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 5000000000L) { -@@ -1214,14 +1235,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit @@ -856,7 +856,7 @@ index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b40 } this.profiler.push("snooper"); -@@ -1234,6 +1253,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { // CraftBukkit start - fire RemoteServerCommandEvent -@@ -719,10 +721,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -721,10 +723,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface if (event.isCancelled()) { return; } @@ -1044,7 +1044,7 @@ index fe83f13d71f84591f5506e1c6b9dfbf9fba680bd..844d3b910cfb1c073b8b58b0eff3f28a } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bce50dc3c2 100644 +index 2b62f4664f439808661d559dc99762bfbac09b16..4788946d7fb25c1b0f26e6a038924c4a62978d53 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -1,7 +1,9 @@ @@ -1057,7 +1057,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc import com.google.common.collect.Lists; import com.google.common.collect.Queues; import com.google.common.collect.Sets; -@@ -579,11 +581,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -580,11 +582,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider private CompletableFuture> scheduleChunkLoad(ChunkPos pos) { return CompletableFuture.supplyAsync(() -> { @@ -1075,7 +1075,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc boolean flag = nbttagcompound.contains("Level", 10) && nbttagcompound.getCompound("Level").contains("Status", 8); if (flag) { -@@ -594,7 +599,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -595,7 +600,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } ChunkMap.LOGGER.error("Chunk file at {} is missing level data, skipping", pos); @@ -1084,7 +1084,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc } catch (ReportedException reportedexception) { Throwable throwable = reportedexception.getCause(); -@@ -708,6 +713,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -709,6 +714,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ChunkStatus chunkstatus = ChunkHolder.getStatus(playerchunk.getTicketLevel()); return !chunkstatus.isOrAfter(ChunkStatus.FULL) ? ChunkHolder.UNLOADED_CHUNK : either.mapLeft((ichunkaccess) -> { @@ -1092,7 +1092,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc ChunkPos chunkcoordintpair = playerchunk.getPos(); ProtoChunk protochunk = (ProtoChunk) ichunkaccess; LevelChunk chunk; -@@ -731,6 +737,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -732,6 +738,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } return chunk; @@ -1100,7 +1100,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc }); }, (runnable) -> { ProcessorHandle mailbox = this.mainThreadMailbox; -@@ -1188,6 +1195,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1189,6 +1196,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ChunkMap.TrackedEntity playerchunkmap_entitytracker; ObjectIterator objectiterator; @@ -1108,7 +1108,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc for (objectiterator = this.entityMap.values().iterator(); objectiterator.hasNext(); playerchunkmap_entitytracker.serverEntity.sendChanges()) { playerchunkmap_entitytracker = (ChunkMap.TrackedEntity) objectiterator.next(); -@@ -1205,16 +1213,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1206,16 +1214,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider playerchunkmap_entitytracker.lastSectionPos = sectionposition1; } } @@ -1130,10 +1130,10 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc public void broadcast(Entity entity, Packet packet) { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029eefdbb090 100644 +index 1bb7faf3b25e4a0dd1407c8e9b33cd7afa2c149e..672c6651043a4efd65e472bbd519f54861ec008a 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -349,13 +349,15 @@ public class ServerChunkCache extends ChunkSource { +@@ -348,13 +348,15 @@ public class ServerChunkCache extends ChunkSource { } gameprofilerfiller.incrementCounter("getChunkCacheMiss"); @@ -1151,7 +1151,7 @@ index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029e ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { return ichunkaccess1; }, (playerchunk_failure) -> { -@@ -555,7 +557,9 @@ public class ServerChunkCache extends ChunkSource { +@@ -554,7 +556,9 @@ public class ServerChunkCache extends ChunkSource { public void save(boolean flush) { this.runDistanceManagerUpdates(); @@ -1161,7 +1161,7 @@ index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029e } @Override -@@ -593,7 +597,9 @@ public class ServerChunkCache extends ChunkSource { +@@ -592,7 +596,9 @@ public class ServerChunkCache extends ChunkSource { this.runDistanceManagerUpdates(); this.level.timings.doChunkMap.stopTiming(); // Spigot this.level.getProfiler().popPush("chunks"); @@ -1171,7 +1171,7 @@ index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029e this.level.timings.doChunkUnload.startTiming(); // Spigot this.level.getProfiler().popPush("unload"); this.chunkMap.tick(booleansupplier); -@@ -617,13 +623,16 @@ public class ServerChunkCache extends ChunkSource { +@@ -616,13 +622,16 @@ public class ServerChunkCache extends ChunkSource { boolean flag2 = level.ticksPerAnimalSpawns != 0L && worlddata.getGameTime() % level.ticksPerAnimalSpawns == 0L; // CraftBukkit this.level.getProfiler().push("naturalSpawnCount"); @@ -1188,17 +1188,7 @@ index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029e this.chunkMap.getChunks().forEach((playerchunk) -> { // Paper - no... just no... Optional optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); -@@ -631,7 +640,9 @@ public class ServerChunkCache extends ChunkSource { - this.level.getProfiler().push("broadcast"); - LevelChunk chunk = (LevelChunk) optional.get(); - -+ this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timings - playerchunk.broadcastChanges(chunk); -+ this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timings - this.level.getProfiler().pop(); - ChunkPos chunkcoordintpair = chunk.getPos(); - -@@ -641,24 +652,25 @@ public class ServerChunkCache extends ChunkSource { +@@ -636,15 +645,18 @@ public class ServerChunkCache extends ChunkSource { NaturalSpawner.spawnForChunk(this.level, chunk, spawnercreature_d, this.spawnFriendlies, this.spawnEnemies, flag2); } @@ -1218,6 +1208,21 @@ index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029e + } // Paper - timings } + this.level.getProfiler().popPush("broadcast"); +@@ -652,15 +664,20 @@ public class ServerChunkCache extends ChunkSource { + Optional optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); // CraftBukkit - decompile error + + Objects.requireNonNull(playerchunk); +- optional.ifPresent(playerchunk::broadcastChanges); ++ ++ // Paper start - timings ++ optional.ifPresent(chunk -> { ++ this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timings ++ playerchunk.broadcastChanges(chunk); ++ this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timings ++ }); ++ // Paper end + }); this.level.getProfiler().pop(); this.level.getProfiler().pop(); } @@ -1229,7 +1234,7 @@ index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029e private void getFullChunk(long pos, Consumer chunkConsumer) { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index bcfc6ea89aa3b1df92d2b181d1d23902859e2584..5c5cfc31ced6695af7b1dd06cb867274fa38d85f 100644 +index 1e1908649a19fe067defe3c0d9c798a6a2988d82..1ec05701b0a1d6f6ecd17b2830a7c074675253dd 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1,6 +1,8 @@ @@ -1268,10 +1273,6 @@ index bcfc6ea89aa3b1df92d2b181d1d23902859e2584..5c5cfc31ced6695af7b1dd06cb867274 @@ -469,17 +470,21 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl this.updateSkyBrightness(); this.tickTime(); - gameprofilerfiller.popPush("chunkSource"); -+ this.timings.chunkProviderTick.startTiming(); // Paper - timings - this.getChunkSource().tick(shouldKeepTicking); -+ this.timings.chunkProviderTick.stopTiming(); // Paper - timings gameprofilerfiller.popPush("tickPending"); - timings.doTickPending.startTiming(); // Spigot + timings.scheduledBlocks.startTiming(); // Paper @@ -1286,6 +1287,10 @@ index bcfc6ea89aa3b1df92d2b181d1d23902859e2584..5c5cfc31ced6695af7b1dd06cb867274 + this.timings.raids.startTiming(); // Paper - timings this.raids.tick(); + this.timings.raids.stopTiming(); // Paper - timings + gameprofilerfiller.popPush("chunkSource"); ++ this.timings.chunkProviderTick.startTiming(); // Paper - timings + this.getChunkSource().tick(shouldKeepTicking); ++ this.timings.chunkProviderTick.stopTiming(); // Paper - timings gameprofilerfiller.popPush("blockEvents"); timings.doSounds.startTiming(); // Spigot this.runBlockEvents(); @@ -1360,10 +1365,10 @@ index bcfc6ea89aa3b1df92d2b181d1d23902859e2584..5c5cfc31ced6695af7b1dd06cb867274 this.entityManager.saveAll(); } else { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942 100644 +index d6bef66d1cc0e3915ca5a9b9d5fc6e645eb5a7de..401520c47e63c3d2055e320daaeb1e74b1f627e1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -209,6 +209,7 @@ import org.bukkit.inventory.EquipmentSlot; +@@ -208,6 +208,7 @@ import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.SmithingInventory; import org.bukkit.util.NumberConversions; @@ -1371,7 +1376,7 @@ index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b // CraftBukkit end public class ServerGamePacketListenerImpl implements ServerPlayerConnection, ServerGamePacketListener { -@@ -288,7 +289,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -287,7 +288,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // CraftBukkit end public void tick() { @@ -1379,7 +1384,7 @@ index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b this.resetPosition(); this.player.xo = this.player.getX(); this.player.yo = this.player.getY(); -@@ -364,7 +364,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -363,7 +363,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 this.disconnect(new TranslatableComponent("multiplayer.disconnect.idling")); } @@ -1387,7 +1392,7 @@ index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b } -@@ -1922,7 +1921,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1909,7 +1908,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // CraftBukkit end private void handleCommand(String input) { @@ -1396,7 +1401,7 @@ index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b // CraftBukkit start - whole method if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + input); -@@ -1933,7 +1932,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1920,7 +1919,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.cserver.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -1405,7 +1410,7 @@ index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b return; } -@@ -1946,7 +1945,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1933,7 +1932,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); return; } finally { @@ -1415,7 +1420,7 @@ index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b // this.minecraftServer.getCommandDispatcher().a(this.player.getCommandListener(), s); // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 809b8510d638cc66ca0a72f88edd68e917dbbf26..524428ee32d18c76c0e9c46bbac3664888b1b35c 100644 +index 8c4744b3a3ebf73d31f59d1566320031550aa3bb..c731f22390773bcd43d392b86ae5b42b0da27c1f 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1,5 +1,6 @@ @@ -1425,7 +1430,7 @@ index 809b8510d638cc66ca0a72f88edd68e917dbbf26..524428ee32d18c76c0e9c46bbac36648 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1008,10 +1009,11 @@ public abstract class PlayerList { +@@ -1010,10 +1011,11 @@ public abstract class PlayerList { } public void saveAll() { @@ -1439,7 +1444,7 @@ index 809b8510d638cc66ca0a72f88edd68e917dbbf26..524428ee32d18c76c0e9c46bbac36648 public UserWhiteList getWhiteList() { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 430d286a73cfdd643e85bdaa97bf91c2c74a342c..0b63d81ecbcb56bf3dc25661cc2b219cd8c25592 100644 +index 0b13a1464a9e6c4912e737879b00ae14da99fbf5..e21f83ca4520da2e518950de5f8bc84d666158e6 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -126,7 +126,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent; @@ -1538,7 +1543,7 @@ index 7f3d83d3d071f6b441ad119b1c93be035e911e70..8d5c61a77bea2f2f5dbff26cb479f855 } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952d9a6661c 100644 +index 3b09f76805053802bb779e227749d81482636407..759cd74cda7f0d1f3c0f3bc0a2a941e16258a1c0 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -140,7 +140,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -1550,7 +1555,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952 public abstract class LivingEntity extends Entity { -@@ -2758,7 +2758,6 @@ public abstract class LivingEntity extends Entity { +@@ -2761,7 +2761,6 @@ public abstract class LivingEntity extends Entity { @Override public void tick() { @@ -1558,7 +1563,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952 super.tick(); this.updatingUsingItem(); this.updateSwimAmount(); -@@ -2799,9 +2798,7 @@ public abstract class LivingEntity extends Entity { +@@ -2802,9 +2801,7 @@ public abstract class LivingEntity extends Entity { } } @@ -1568,7 +1573,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952 double d0 = this.getX() - this.xo; double d1 = this.getZ() - this.zo; float f = (float) (d0 * d0 + d1 * d1); -@@ -2881,8 +2878,6 @@ public abstract class LivingEntity extends Entity { +@@ -2884,8 +2881,6 @@ public abstract class LivingEntity extends Entity { if (this.isSleeping()) { this.setXRot(0.0F); } @@ -1577,7 +1582,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952 } public void detectEquipmentUpdates() { -@@ -3064,7 +3059,6 @@ public abstract class LivingEntity extends Entity { +@@ -3067,7 +3062,6 @@ public abstract class LivingEntity extends Entity { this.setDeltaMovement(d4, d5, d6); this.level.getProfiler().push("ai"); @@ -1585,7 +1590,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952 if (this.isImmobile()) { this.jumping = false; this.xxa = 0.0F; -@@ -3074,7 +3068,6 @@ public abstract class LivingEntity extends Entity { +@@ -3077,7 +3071,6 @@ public abstract class LivingEntity extends Entity { this.serverAiStep(); this.level.getProfiler().pop(); } @@ -1593,7 +1598,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952 this.level.getProfiler().pop(); this.level.getProfiler().push("jump"); -@@ -3109,9 +3102,9 @@ public abstract class LivingEntity extends Entity { +@@ -3112,9 +3105,9 @@ public abstract class LivingEntity extends Entity { this.updateFallFlying(); AABB axisalignedbb = this.getBoundingBox(); @@ -1605,7 +1610,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952 this.level.getProfiler().pop(); this.level.getProfiler().push("freezing"); boolean flag1 = this.getType().is((Tag) EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES); -@@ -3140,9 +3133,7 @@ public abstract class LivingEntity extends Entity { +@@ -3143,9 +3136,7 @@ public abstract class LivingEntity extends Entity { this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox()); } @@ -1616,7 +1621,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952 if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) { this.hurt(DamageSource.DROWN, 1.0F); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index e9dc71fb74698b2f11220e4eb379f21610899d97..26f19bd01425e62f825cc51fded953d6376e243c 100644 +index 3286beed6bf79f5f6b91227f596fcc43200e8bda..e38cd4df0924cce7fee4fd98967990945a62ecf4 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -82,7 +82,6 @@ import org.bukkit.Bukkit; @@ -1627,7 +1632,7 @@ index e9dc71fb74698b2f11220e4eb379f21610899d97..26f19bd01425e62f825cc51fded953d6 import org.bukkit.craftbukkit.block.CapturedBlockState; import org.bukkit.craftbukkit.block.CraftBlockState; import org.bukkit.craftbukkit.block.data.CraftBlockData; -@@ -149,7 +148,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -150,7 +149,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper @@ -1636,7 +1641,7 @@ index e9dc71fb74698b2f11220e4eb379f21610899d97..26f19bd01425e62f825cc51fded953d6 public static BlockPos lastPhysicsProblem; // Spigot private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter tileLimiter; -@@ -236,7 +235,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -237,7 +236,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } }); // CraftBukkit end @@ -1645,7 +1650,7 @@ index e9dc71fb74698b2f11220e4eb379f21610899d97..26f19bd01425e62f825cc51fded953d6 this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); } -@@ -720,15 +719,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -725,15 +724,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { timings.tileEntityTick.stopTiming(); // Spigot this.tickingBlockEntities = false; @@ -1716,7 +1721,7 @@ index 0be0c9a9f29f29e2622df49861d30a7edbaf0515..702203f4a4fa4fc03c35ec974a97e08e this.alreadyTicked.clear(); this.currentlyTicking.clear(); diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 198c1092e7db6e0023df77e4707c376696fdbafd..c27e755f93a2b2e203b305e0cae2c782a34e38cc 100644 +index 0cd5448d93091e981374b0c11e95a3baca9defef..72ef08a59dbf72bec2ce54ab76455c4230395959 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java @@ -90,6 +90,15 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -1774,7 +1779,7 @@ index 0d0f721fe80c52d92d91843ae9970c5fd55ca143..3e2bc640a06667f0d4f3c2367ac79451 } } 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 468b67babc628f7ff7c6fa138ed7944a8d77f0a6..22d5c4cc3aea19cbf53ea320765ecceb4daf7428 100644 +index b645a2fc839dbf922ce73b23b7d53e9a5fe1a2ee..1b478ebfe6792a157772a5812d0daa1a3ccc4776 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 @@ -1,5 +1,7 @@ @@ -1812,7 +1817,7 @@ index 468b67babc628f7ff7c6fa138ed7944a8d77f0a6..22d5c4cc3aea19cbf53ea320765ecceb private static CompoundTag packStructureData(ServerLevel world, ChunkPos chunkcoordintpair, Map, StructureStart> map, Map, LongSet> map1) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2bd19cf2ed4144b4f4403afc98fdb8e95f7c95cc..fe1b05555d36f7082a66b9ebd6261b91919aa081 100644 +index 57a44f1d466caeccebe0e2498e3833cb953ffd5a..878af195b64b7c25cb7ef130846d30aea2474897 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2083,12 +2083,31 @@ public final class CraftServer implements Server { @@ -2212,7 +2217,7 @@ index e52ef47b783785dc214746b678e7b549aea9a274..3d90b3426873a3528af14f7f1ab0adae this.value = value; } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 456f0e9e827f61ebdcb42dbc00f5d374e318597f..0f0ffedd2cc3cf1b30b338d8ae3a8ad388dfde53 100644 +index 67cae2e6055389e93fb4b94daf8402ec5fdc6f9a..7a3ba7590249d6a3eb37f894c9cfd414a8ccf3fd 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -156,6 +156,12 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index 07c04a5928..8df5b6bfd3 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -981,7 +981,7 @@ index b82b218be1bd849fa280ea1fe0336e279bebfc18..2fb444653118816f1250841cb4c6c486 public static ChatFormatting getById(int colorIndex) { if (colorIndex < 0) { diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -index 0ae24c8080391410756f101a1e40c2eef887c739..cbc968d0d514f01b26888f3ff8264d8689d9381a 100644 +index ca4d629616136e3362c872c3d10cba67c8225c8c..22bc8fa039375a3205bdfdf05b6c73c856fb1b16 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java @@ -14,6 +14,7 @@ import io.netty.handler.codec.EncoderException; @@ -992,7 +992,7 @@ index 0ae24c8080391410756f101a1e40c2eef887c739..cbc968d0d514f01b26888f3ff8264d86 import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; -@@ -61,6 +62,7 @@ public class FriendlyByteBuf extends ByteBuf { +@@ -62,6 +63,7 @@ public class FriendlyByteBuf extends ByteBuf { private static final int MAX_VARLONG_SIZE = 10; private static final int DEFAULT_NBT_QUOTA = 2097152; private final ByteBuf source; @@ -1000,7 +1000,7 @@ index 0ae24c8080391410756f101a1e40c2eef887c739..cbc968d0d514f01b26888f3ff8264d86 public static final short MAX_STRING_LENGTH = 32767; public static final int MAX_COMPONENT_STRING_LENGTH = 262144; -@@ -326,8 +328,15 @@ public class FriendlyByteBuf extends ByteBuf { +@@ -351,8 +353,15 @@ public class FriendlyByteBuf extends ByteBuf { return Component.Serializer.fromJson(this.readUtf(262144)); } @@ -1018,7 +1018,7 @@ index 0ae24c8080391410756f101a1e40c2eef887c739..cbc968d0d514f01b26888f3ff8264d86 public > T readEnum(Class enumClass) { diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java -index 83e99af925c87433b59f9bed30dfbf4e490c1b84..b8a0c0411fd2caab21672de7f3e721645b61a8ba 100644 +index 8e9d685d04b93cef73b3fbebd086c970968914d5..092d8ecf8d6a7045d2fc379bc0f9ec4ee294d056 100644 --- a/src/main/java/net/minecraft/network/PacketEncoder.java +++ b/src/main/java/net/minecraft/network/PacketEncoder.java @@ -3,6 +3,7 @@ package net.minecraft.network; @@ -1191,10 +1191,10 @@ index 762a9392ffac3042356709dddd15bb3516048bed..3544e2dc2522e9d6305d727d56e73490 buf.writeComponent(this.footer); } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e6d8e511a 100644 +index 504862eae87d4b58d9588b383993a44919d66759..a8a0f65d99ed062467e50a79349dc6b56f325709 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -145,6 +145,7 @@ import net.minecraft.world.scores.Score; +@@ -146,6 +146,7 @@ import net.minecraft.world.scores.Score; import net.minecraft.world.scores.Scoreboard; import net.minecraft.world.scores.Team; import net.minecraft.world.scores.criteria.ObjectiveCriteria; @@ -1202,7 +1202,7 @@ index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.Location; -@@ -216,6 +217,7 @@ public class ServerPlayer extends Player { +@@ -217,6 +218,7 @@ public class ServerPlayer extends Player { // CraftBukkit start public String displayName; @@ -1210,7 +1210,7 @@ index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e public Component listName; public org.bukkit.Location compassTarget; public int newExp = 0; -@@ -301,6 +303,7 @@ public class ServerPlayer extends Player { +@@ -297,6 +299,7 @@ public class ServerPlayer extends Player { // CraftBukkit start this.displayName = this.getScoreboardName(); @@ -1218,7 +1218,7 @@ index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e this.bukkitPickUpLoot = true; this.maxHealthCache = this.getMaxHealth(); } -@@ -736,23 +739,17 @@ public class ServerPlayer extends Player { +@@ -732,23 +735,17 @@ public class ServerPlayer extends Player { Component defaultMessage = this.getCombatTracker().getDeathMessage(); @@ -1246,7 +1246,7 @@ index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e this.connection.send((Packet) (new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent)), (future) -> { if (!future.isSuccess()) { -@@ -1702,6 +1699,7 @@ public class ServerPlayer extends Player { +@@ -1698,6 +1695,7 @@ public class ServerPlayer extends Player { } public String locale = "en_us"; // CraftBukkit - add, lowercase @@ -1254,7 +1254,7 @@ index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e public void updateOptions(ServerboundClientInformationPacket packet) { // CraftBukkit start if (getMainArm() != packet.getMainHand()) { -@@ -1713,6 +1711,10 @@ public class ServerPlayer extends Player { +@@ -1709,6 +1707,10 @@ public class ServerPlayer extends Player { this.server.server.getPluginManager().callEvent(event); } this.locale = packet.language; @@ -1266,10 +1266,10 @@ index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e // CraftBukkit end this.chatVisibility = packet.getChatVisibility(); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91166597f9 100644 +index 401520c47e63c3d2055e320daaeb1e74b1f627e1..da9f4b3337b49597c17b50964656457cd629a0b7 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -162,6 +162,8 @@ import org.apache.logging.log4j.LogManager; +@@ -161,6 +161,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; // CraftBukkit start @@ -1278,7 +1278,7 @@ index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91 import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicInteger; import net.minecraft.world.inventory.AbstractContainerMenu; -@@ -385,21 +387,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -384,21 +386,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser return this.server.isSingleplayerOwner(this.player.getGameProfile()); } @@ -1311,7 +1311,7 @@ index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91 if (this.cserver.getServer().isRunning()) { this.cserver.getPluginManager().callEvent(event); -@@ -410,8 +415,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -409,8 +414,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser return; } // Send the possibly modified leave message @@ -1321,7 +1321,7 @@ index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91 // CraftBukkit end this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), (future) -> { -@@ -1672,9 +1676,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1659,9 +1663,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser */ this.player.disconnect(); @@ -1336,7 +1336,7 @@ index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91 } // CraftBukkit end this.player.getTextFilter().leave(); -@@ -1856,7 +1862,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1843,7 +1849,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.handleCommand(s); } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Do nothing, this is coming from a plugin @@ -1350,7 +1350,7 @@ index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91 Player player = this.getCraftPlayer(); AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server)); this.cserver.getPluginManager().callEvent(event); -@@ -2646,30 +2657,28 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2634,30 +2645,28 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser return; } @@ -1389,7 +1389,7 @@ index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index e61752f3d00c6e2324745b92c880ee494f366765..75118458840caadfa82aa0fa2efd8a753b585ef2 100644 +index 829ebf802b377cc811bf5af8c16aaa6d3a72a51d..c8d8d766de86dc3e47b06a355b28d2279820c570 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -36,6 +36,7 @@ import net.minecraft.world.entity.player.Player; @@ -1438,7 +1438,7 @@ index b632280e057ae6893bf5ebcde75cefac3ee62a09..9baa56d6da9c24706f1dbc8851fd68ca @Override diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4b1d8041c 100644 +index c731f22390773bcd43d392b86ae5b42b0da27c1f..14cf49b910bd789f1dd61d303b88d53a93c3abd6 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -8,6 +8,7 @@ import com.mojang.authlib.GameProfile; @@ -1448,8 +1448,8 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4 +import io.papermc.paper.adventure.PaperAdventure; import java.io.File; import java.net.SocketAddress; - import java.text.SimpleDateFormat; -@@ -89,6 +90,7 @@ import org.apache.logging.log4j.LogManager; + import java.nio.file.Path; +@@ -91,6 +92,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; // CraftBukkit start @@ -1457,7 +1457,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4 import com.google.common.base.Predicate; import java.util.stream.Collectors; import net.minecraft.server.dedicated.DedicatedServer; -@@ -256,7 +258,7 @@ public abstract class PlayerList { +@@ -258,7 +260,7 @@ public abstract class PlayerList { } // CraftBukkit start chatmessage.withStyle(ChatFormatting.YELLOW); @@ -1466,7 +1466,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4 playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot()); this.players.add(player); -@@ -270,19 +272,18 @@ public abstract class PlayerList { +@@ -272,19 +274,18 @@ public abstract class PlayerList { // Ensure that player inventory is populated with its viewer player.containerMenu.transferTo(player.containerMenu, bukkitPlayer); @@ -1491,7 +1491,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4 } // CraftBukkit end -@@ -479,7 +480,7 @@ public abstract class PlayerList { +@@ -481,7 +482,7 @@ public abstract class PlayerList { } @@ -1500,7 +1500,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4 ServerLevel worldserver = entityplayer.getLevel(); entityplayer.awardStat(Stats.LEAVE_GAME); -@@ -490,7 +491,7 @@ public abstract class PlayerList { +@@ -492,7 +493,7 @@ public abstract class PlayerList { entityplayer.closeContainer(); } @@ -1509,7 +1509,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4 this.cserver.getPluginManager().callEvent(playerQuitEvent); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); -@@ -543,7 +544,7 @@ public abstract class PlayerList { +@@ -545,7 +546,7 @@ public abstract class PlayerList { this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity()); // CraftBukkit end @@ -1518,7 +1518,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4 } // CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer -@@ -589,10 +590,10 @@ public abstract class PlayerList { +@@ -591,10 +592,10 @@ public abstract class PlayerList { } // return chatmessage; @@ -1531,7 +1531,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4 } else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) { IpBanListEntry ipbanentry = this.ipBans.get(socketaddress); -@@ -602,17 +603,17 @@ public abstract class PlayerList { +@@ -604,17 +605,17 @@ public abstract class PlayerList { } // return chatmessage; @@ -1552,7 +1552,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4 return null; } return entity; -@@ -1115,7 +1116,7 @@ public abstract class PlayerList { +@@ -1117,7 +1118,7 @@ public abstract class PlayerList { public void removeAll() { // CraftBukkit start - disconnect safely for (ServerPlayer player : this.players) { @@ -1671,7 +1671,7 @@ index 7a0e7961df1e62b311ea2ecc76d7343a8646723b..6859fafa42527d45366018f737c19e6c } collection = icons; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index fe1b05555d36f7082a66b9ebd6261b91919aa081..255e338288eca828edf81d213c16fa84769f2038 100644 +index 878af195b64b7c25cb7ef130846d30aea2474897..d6cb58d5c5f6d2f4aa769f4338ba63b2d55dc971 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -564,8 +564,10 @@ public final class CraftServer implements Server { @@ -2076,7 +2076,7 @@ index 78d1621c1b5f1870829d92720e2151e9f9d9a8b5..6722d97d498fb2951b7dd8af3b68dd77 public void setCustomName(String name) { // sane limit for name length diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index d4ea706d5456e709b95e34be8220a0d39be2c8f4..2db149bf57c561d7f8f49341fbefafb5d3ecab54 100644 +index 042691349dd5659e8db526199641cbcfa21c6005..841dbf4a86b19d7c8ea41930ecb1f88c660fa117 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -317,9 +317,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -2110,7 +2110,7 @@ index d4ea706d5456e709b95e34be8220a0d39be2c8f4..2db149bf57c561d7f8f49341fbefafb5 player.initMenu(container); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 969d5071dbf3356b80da38526351d488ab936c08..9c643472f0c271dcd41721cc121f7af161cafd9b 100644 +index 969d5071dbf3356b80da38526351d488ab936c08..d72354a670ad41b3dba8a7ffe8bc64bb8569d15c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -244,14 +244,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2292,7 +2292,7 @@ index 969d5071dbf3356b80da38526351d488ab936c08..9c643472f0c271dcd41721cc121f7af1 @Override public int getPing() { return this.getHandle().latency; -@@ -1727,6 +1798,159 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1727,6 +1798,160 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getInventory().setItemInMainHand(hand); } @@ -2443,9 +2443,10 @@ index 969d5071dbf3356b80da38526351d488ab936c08..9c643472f0c271dcd41721cc121f7af1 + final ServerGamePacketListenerImpl connection = player.connection; + final net.minecraft.world.entity.player.Inventory inventory = player.getInventory(); + final int slot = inventory.items.size() + inventory.selected; -+ connection.send(new net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket(0, slot, item)); ++ final int stateId = getHandle().containerMenu.getStateId(); ++ connection.send(new net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket(0, stateId, slot, item)); + connection.send(new net.minecraft.network.protocol.game.ClientboundOpenBookPacket(net.minecraft.world.InteractionHand.MAIN_HAND)); -+ connection.send(new net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket(0, slot, inventory.getSelected())); ++ connection.send(new net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket(0, stateId, slot, inventory.getSelected())); + } + // Paper end + @@ -2453,7 +2454,7 @@ index 969d5071dbf3356b80da38526351d488ab936c08..9c643472f0c271dcd41721cc121f7af1 private final Player.Spigot spigot = new Player.Spigot() { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index e260366ca4f0ba7f37b7e78e3b46a05d91079d8d..ae12d4a7b56ec70ac5f529e0f336019e97f667ce 100644 +index 247c00d35647838264e7acd58019abf1939a594d..bd1e9c1bd9af8bf3fb599cfb0a54a0c948cc2b1b 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -787,9 +787,9 @@ public class CraftEventFactory { @@ -2603,10 +2604,10 @@ index 6a64fbb8b4937f39d5fdc2e2cbec26c83c74c486..7d6b5fdb00a5c1614849735634262a36 public String getTitle() { return CraftChatMessage.fromComponent(this.container.getTitle()); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 27bbec5f779e7193818e546dbf02a761ff950719..8f05c6832fc968666f0e6e0a19f6dd74d92d0c28 100644 +index e3c49a85e24340ecc84225bac8f79492801dc48c..4b038b7f4176dc1a1a47d7694d95ce0e4ec38a2d 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -337,4 +337,17 @@ public final class CraftItemFactory implements ItemFactory { +@@ -340,4 +340,17 @@ public final class CraftItemFactory implements ItemFactory { public Material updateMaterial(ItemMeta meta, Material material) throws IllegalArgumentException { return ((CraftMetaItem) meta).updateMaterial(material); } @@ -2864,10 +2865,10 @@ index 00445fc7373c70f4cecc4114f9bcfb4b6f27c0e8..0cf60eb9b6ba1a79c9b603c4349debd4 return builder; } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 2d775fe575e61a6503aee1bc9623aebce75143cc..970fa1e98c873ea4dfd4b58c56b7ea88283b0512 100644 +index a096c9f7fb459200f8d1f2c797a29bc1222c86af..86163b56d10689aa512953c8df869aa45ebac735 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -745,6 +745,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -746,6 +746,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return !(this.hasDisplayName() || this.hasLocalizedName() || this.hasEnchants() || (this.lore != null) || this.hasCustomModelData() || this.hasBlockData() || this.hasRepairCost() || !this.unhandledTags.isEmpty() || !this.persistentDataContainer.isEmpty() || this.hideFlag != 0 || this.isUnbreakable() || this.hasDamage() || this.hasAttributeModifiers()); } @@ -2886,7 +2887,7 @@ index 2d775fe575e61a6503aee1bc9623aebce75143cc..970fa1e98c873ea4dfd4b58c56b7ea88 @Override public String getDisplayName() { return CraftChatMessage.fromJSONComponent(displayName); -@@ -780,6 +792,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -781,6 +793,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return this.lore != null && !this.lore.isEmpty(); } @@ -3193,7 +3194,7 @@ index f9b7b8f7ccc95b73967a51420fd6ce88d80d75fe..0de5a46423ae0403dcbfca630dfd7c5a boolean hadFormat = false; diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 0f0ffedd2cc3cf1b30b338d8ae3a8ad388dfde53..409515c406f5b5cfac9872f925dbc67159a5d41f 100644 +index 7a3ba7590249d6a3eb37f894c9cfd414a8ccf3fd..fa64a0ea5b6dd9c6031fe54c9030bdb1999ef109 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -57,6 +57,33 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0014-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/0014-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch index 8e8fefb750..9deacbf7db 100644 --- a/patches/server/0014-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch +++ b/patches/server/0014-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch @@ -19,7 +19,7 @@ index 78948c42b13194005bdbbbc69c2b7ae0732a78c5..b41e7922dd96c3358eb849ab39982a75 + } } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 0b63d81ecbcb56bf3dc25661cc2b219cd8c25592..018792503e5d18470ad17b9f4b4524d5dfba31e9 100644 +index e21f83ca4520da2e518950de5f8bc84d666158e6..04f2cee8045ba74993e10230c3ad7ca80fb048d6 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1264,6 +1264,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -31,10 +31,10 @@ index 0b63d81ecbcb56bf3dc25661cc2b219cd8c25592..018792503e5d18470ad17b9f4b4524d5 return this.isInWater() || this.isInRain() || this.isInBubbleColumn(); } diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..1dde3e92725883c277f9a8e78cb6a56238af3254 100644 +index 6b4e78af38fe5b2567597d6267ddecd252585b5a..8e2f3ffae0071be4f44c9b04269913d9daed2a4d 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -103,6 +103,7 @@ public abstract class Mob extends LivingEntity { +@@ -104,6 +104,7 @@ public abstract class Mob extends LivingEntity { private final BodyRotationControl bodyRotationControl; protected PathNavigation navigation; public GoalSelector goalSelector; @@ -42,7 +42,7 @@ index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..1dde3e92725883c277f9a8e78cb6a562 public GoalSelector targetSelector; private LivingEntity target; private final Sensing sensing; -@@ -794,7 +795,17 @@ public abstract class Mob extends LivingEntity { +@@ -795,7 +796,17 @@ public abstract class Mob extends LivingEntity { @Override protected final void serverAiStep() { ++this.noActionTime; diff --git a/patches/server/0015-Add-configurable-despawn-distances-for-living-entiti.patch b/patches/server/0015-Add-configurable-despawn-distances-for-living-entiti.patch index c304874a50..a4daa24935 100644 --- a/patches/server/0015-Add-configurable-despawn-distances-for-living-entiti.patch +++ b/patches/server/0015-Add-configurable-despawn-distances-for-living-entiti.patch @@ -30,10 +30,10 @@ index b41e7922dd96c3358eb849ab39982a75736e3476..2f0d582baf0eb2bb477944d0cb1369db + } } diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index a5d90af5275c9c8069932f711069a6d422303d05..697f73cabfe89e716c9fceeb8362237d27ca3d02 100644 +index 8e2f3ffae0071be4f44c9b04269913d9daed2a4d..f8dcd9cb5e6d223f4f5445a4172cc6c4ea160313 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -773,16 +773,16 @@ public abstract class Mob extends LivingEntity { +@@ -774,16 +774,16 @@ public abstract class Mob extends LivingEntity { int i = this.getType().getCategory().getDespawnDistance(); int j = i * i; diff --git a/patches/server/0016-Allow-for-toggling-of-spawn-chunks.patch b/patches/server/0016-Allow-for-toggling-of-spawn-chunks.patch index a1cd24c0d5..ac33756a03 100644 --- a/patches/server/0016-Allow-for-toggling-of-spawn-chunks.patch +++ b/patches/server/0016-Allow-for-toggling-of-spawn-chunks.patch @@ -20,10 +20,10 @@ index 2f0d582baf0eb2bb477944d0cb1369db6ca33956..89e76dd73811fd0f6f8c8e7e5af804d5 + } } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 59730455fcdf22bada7288833cf7e8b6c9b4096a..d106ab5bbe0647aa2ad285baaabb62b79ced3c06 100644 +index e38cd4df0924cce7fee4fd98967990945a62ecf4..a682e7a621b799d0855318788c7f5ad108716256 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -236,6 +236,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -237,6 +237,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { }); // CraftBukkit end timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings diff --git a/patches/server/0018-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0018-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index 63e761acfa..d896f50ffb 100644 --- a/patches/server/0018-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/0018-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -19,10 +19,10 @@ index 2c53a400611c78236c5a1c1270d27c02e94251bf..a1d5c0f8fe2adb2ee56f3217e089211e if (outputStream != null) { try { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4985aa808fa378ab0463470d4635fda9cc15d268..5b68bc18c39bb34a188782b36da59a5d5280bdd9 100644 +index fcc775723bcef7c6b740ee332c21ef70e591c77e..0ee92562ef7c6ac99f5bea0b6d0751d0add50f16 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1418,7 +1418,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop // Spigot - Spigot > // CraftBukkit - cb > vanilla! } - public SystemReport fillSystemReport(SystemReport systemreport) { + public SystemReport fillSystemReport(SystemReport details) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e2564dee0603735d135d1de2af6801a0f2a93e7d..f00844d2953e6ead58bfd383a214695b3dbe5086 100644 +index d6cb58d5c5f6d2f4aa769f4338ba63b2d55dc971..171c78b405d35464ce0f66333a3798b6b8a0fb7b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -227,7 +227,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; diff --git a/patches/server/0020-Add-version-history-to-version-command.patch b/patches/server/0020-Add-version-history-to-version-command.patch index 332461d12c..9351ca63d9 100644 --- a/patches/server/0020-Add-version-history-to-version-command.patch +++ b/patches/server/0020-Add-version-history-to-version-command.patch @@ -202,10 +202,10 @@ index 0000000000000000000000000000000000000000..aac3f66cb23d260729c2a48d8710a9de + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 844d3b910cfb1c073b8b58b0eff3f28af5453701..566390d02b2af4a0f2c867b7ff8116a8301e8497 100644 +index 2b062beaad39f2e86801fdd5b0cc84b253f1348a..bd94277862e0f5546b4df81fbd535d2e4c7ef5b1 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -202,6 +202,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -203,6 +203,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface return false; } com.destroystokyo.paper.PaperConfig.registerCommands(); diff --git a/patches/server/0021-Player-affects-spawning-API.patch b/patches/server/0021-Player-affects-spawning-API.patch index d3e3666507..55710f58d0 100644 --- a/patches/server/0021-Player-affects-spawning-API.patch +++ b/patches/server/0021-Player-affects-spawning-API.patch @@ -21,10 +21,10 @@ index 195989667c7d844399a72787819f62a3fd0d9c78..d17b75ad13bbc8a38cdc2f2d77ee5d88 public static Predicate withinDistance(double x, double y, double z, double max) { double d4 = max * max; diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 26d5b58eb665da53eda30a19300df4c0928c41ef..1039c379b5f39178c568ff9c357a1cf948e0429a 100644 +index f8dcd9cb5e6d223f4f5445a4172cc6c4ea160313..78e2d0165f6f6da4d7d1e1dad76e5edcbe48df9e 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -766,7 +766,7 @@ public abstract class Mob extends LivingEntity { +@@ -767,7 +767,7 @@ public abstract class Mob extends LivingEntity { if (this.level.getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) { this.discard(); } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { @@ -47,7 +47,7 @@ index 7d741c2aebbc1c6cf1ff59cca6480325db6ca29c..2459ae800a5f6b234a4f4bb1cd3738e4 return false; } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index bf51e880b0bb81e36c7ef435e057157adfeaede7..4588d0ac68c56942af6ab59f26c68dc65996c6a1 100644 +index 05c292d08ac98fad408b279d2426ff08472a959c..484b1bf43b897c5ffe47baa340957e3293c7bf92 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -176,6 +176,9 @@ public abstract class Player extends LivingEntity { @@ -117,7 +117,7 @@ index 389985e022b82c675fb21f363422471bd15b84b0..849616d9ad140285f7aa4d2ffafd6371 for(Player player : this.players()) { if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index bc901793055db9481ec32e668386ba33696bc0a5..f14488b00add3b8209554e670ca2ea2f49e04a95 100644 +index 9c643472f0c271dcd41721cc121f7af161cafd9b..f253483eab0610b9c88174d7ae78b24ef5730242 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1778,8 +1778,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0023-Further-improve-server-tick-loop.patch b/patches/server/0023-Further-improve-server-tick-loop.patch index d12042f5b9..e4cd8ff691 100644 --- a/patches/server/0023-Further-improve-server-tick-loop.patch +++ b/patches/server/0023-Further-improve-server-tick-loop.patch @@ -12,10 +12,10 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 26f6a3d2d70078f300412a5076afb8a19818cd25..65b2fa69fd36addc9534f069cce8ec95cf1122a2 100644 +index 0ee92562ef7c6ac99f5bea0b6d0751d0add50f16..6225e9391ddff28d8f71a9f643ef2c41f69e6fe7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -285,7 +285,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -294,7 +294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop getEnchantments(net.minecraft.world.item.ItemStack item) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4bd0536d39 100644 +index 86163b56d10689aa512953c8df869aa45ebac735..05d54f0eff89b721f01e90e79d2571baab297799 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList; @@ -229,7 +229,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.Nonnull; -@@ -271,7 +274,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -272,7 +275,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { private List lore; // null and empty are two different states internally private Integer customModelData; private CompoundTag blockData; @@ -238,7 +238,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b private Multimap attributeModifiers; private int repairCost; private int hideFlag; -@@ -282,7 +285,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -283,7 +286,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); private CompoundTag internalTag; @@ -247,7 +247,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b private CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftMetaItem.DATA_TYPE_REGISTRY); private int version = CraftMagicNumbers.INSTANCE.getDataVersion(); // Internal use only -@@ -303,7 +306,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -304,7 +307,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.blockData = meta.blockData; if (meta.enchantments != null) { // Spigot @@ -256,7 +256,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b } if (meta.hasAttributeModifiers()) { -@@ -386,13 +389,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -387,13 +390,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -272,7 +272,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b for (int i = 0; i < ench.size(); i++) { String id = ((CompoundTag) ench.get(i)).getString(ENCHANTMENTS_ID.NBT); -@@ -545,13 +548,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -546,13 +549,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -288,7 +288,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b for (Map.Entry entry : ench.entrySet()) { // Doctor older enchants String enchantKey = entry.getKey().toString(); -@@ -827,14 +830,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -828,14 +831,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Override public Map getEnchants() { @@ -305,7 +305,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b } if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) { -@@ -1215,7 +1218,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1216,7 +1219,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { clone.customModelData = this.customModelData; clone.blockData = this.blockData; if (this.enchantments != null) { @@ -314,7 +314,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b } if (this.hasAttributeModifiers()) { clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers); -@@ -1448,4 +1451,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1450,4 +1453,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return CraftMetaItem.HANDLED_TAGS; } } diff --git a/patches/server/0064-Add-World-Util-Methods.patch b/patches/server/0064-Add-World-Util-Methods.patch index e567029cd5..1fbf5d0a69 100644 --- a/patches/server/0064-Add-World-Util-Methods.patch +++ b/patches/server/0064-Add-World-Util-Methods.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add World Util Methods Methods that can be used for other patches to help improve logic. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 9b98eddb8238e36b17989d6f685ddc950151a7f8..b8a816a2f58c1ab51271f027f500d08bc3a63503 100644 +index addd1e75b796b01d15d8c087329bfc4fb9823fbe..62bf85a8590c3dc00c74671303b4e7ce790fdc0b 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -202,7 +202,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -19,10 +19,10 @@ index 9b98eddb8238e36b17989d6f685ddc950151a7f8..b8a816a2f58c1ab51271f027f500d08b } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 76182fd83d6dcd2359dd8d8a75e7e15304dc5d0f..9f69dfcb5d9cbbcd01dd2e5e02437967da7a4a17 100644 +index 33b20b43961051d2c116871ad63baa908fa71cd5..8eff4c4b82cd2d0d58af00c6c88f156315d53600 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -309,11 +309,27 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -310,11 +310,27 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } @Override diff --git a/patches/server/0065-Custom-replacement-for-eaten-items.patch b/patches/server/0065-Custom-replacement-for-eaten-items.patch index 434a686c67..b94f64a230 100644 --- a/patches/server/0065-Custom-replacement-for-eaten-items.patch +++ b/patches/server/0065-Custom-replacement-for-eaten-items.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Custom replacement for eaten items diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 46e514bfe80d999f50173866b59fbc9419bbf3d0..89db2afd198366ab94c9c074890aa668d3771a79 100644 +index 6c2adddb3d55e5384d1386788bce13ee4c7a6bbe..a492f0b8393c185f0464f0fb0e5d5dce4d0e3824 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3560,9 +3560,10 @@ public abstract class LivingEntity extends Entity { +@@ -3563,9 +3563,10 @@ public abstract class LivingEntity extends Entity { this.triggerItemUseEffects(this.useItem, 16); // CraftBukkit start - fire PlayerItemConsumeEvent ItemStack itemstack; @@ -20,7 +20,7 @@ index 46e514bfe80d999f50173866b59fbc9419bbf3d0..89db2afd198366ab94c9c074890aa668 level.getCraftServer().getPluginManager().callEvent(event); if (event.isCancelled()) { -@@ -3576,6 +3577,13 @@ public abstract class LivingEntity extends Entity { +@@ -3579,6 +3580,13 @@ public abstract class LivingEntity extends Entity { } else { itemstack = this.useItem.finishUsingItem(this.level, this); } @@ -34,7 +34,7 @@ index 46e514bfe80d999f50173866b59fbc9419bbf3d0..89db2afd198366ab94c9c074890aa668 // CraftBukkit end if (itemstack != this.useItem) { -@@ -3583,6 +3591,11 @@ public abstract class LivingEntity extends Entity { +@@ -3586,6 +3594,11 @@ public abstract class LivingEntity extends Entity { } this.stopUsingItem(); diff --git a/patches/server/0066-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0066-handle-NaN-health-absorb-values-and-repair-bad-data.patch index a810beb63c..53c23f6cb8 100644 --- a/patches/server/0066-handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/patches/server/0066-handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -5,7 +5,7 @@ Subject: [PATCH] handle NaN health/absorb values and repair bad data diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 89db2afd198366ab94c9c074890aa668d3771a79..83eaa3c6581c1a3f588278124fed4c811e81e53c 100644 +index a492f0b8393c185f0464f0fb0e5d5dce4d0e3824..a0d6cc4eeda0a7a09724b6482da71c969abcfeb0 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -764,7 +764,13 @@ public abstract class LivingEntity extends Entity { @@ -34,7 +34,7 @@ index 89db2afd198366ab94c9c074890aa668d3771a79..83eaa3c6581c1a3f588278124fed4c81 // CraftBukkit start - Handle scaled health if (this instanceof ServerPlayer) { org.bukkit.craftbukkit.entity.CraftPlayer player = ((ServerPlayer) this).getBukkitEntity(); -@@ -3395,7 +3405,7 @@ public abstract class LivingEntity extends Entity { +@@ -3398,7 +3408,7 @@ public abstract class LivingEntity extends Entity { } public void setAbsorptionAmount(float amount) { @@ -43,13 +43,13 @@ index 89db2afd198366ab94c9c074890aa668d3771a79..83eaa3c6581c1a3f588278124fed4c81 amount = 0.0F; } -@@ -4000,3 +4010,4 @@ public abstract class LivingEntity extends Entity { +@@ -4003,3 +4013,4 @@ public abstract class LivingEntity extends Entity { this.setDeltaMovement((double) ((float) packet.getXd() / 8000.0F), (double) ((float) packet.getYd() / 8000.0F), (double) ((float) packet.getZd() / 8000.0F)); } } + diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 03b2fd38b31de911ef107006a3d10c5534989247..2dab55e7d807ae8414fbb1f4446df2f38783cfb4 100644 +index 45a8dc649983f1eec3d8eb065cb34d517c55300b..50267f9877898d7108edc057140e3e572eac9461 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1702,6 +1702,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0069-Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/patches/server/0069-Optimize-isValidLocation-getType-and-getBlockData-fo.patch index d5ca410d66..00ae1a0708 100644 --- a/patches/server/0069-Optimize-isValidLocation-getType-and-getBlockData-fo.patch +++ b/patches/server/0069-Optimize-isValidLocation-getType-and-getBlockData-fo.patch @@ -33,10 +33,10 @@ index 964bec1d3fecfe43a43bd9968159fca069f00dfd..e188f130e47ef319477050981de53a74 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 8592de5a5541fbff8ec85bfce8635a780097c4d4..bbe2d5eab844880f2fde674aa1c78d60d6152231 100644 +index 8eff4c4b82cd2d0d58af00c6c88f156315d53600..c6dbace64d19de52112c64c824640cf48db216e3 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -259,7 +259,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -260,7 +260,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } public boolean isInWorldBounds(BlockPos pos) { @@ -90,7 +90,7 @@ index c1beb6d5fc3cabfeacf0ffbf563e53ff7984c5d3..452b513e8b89d865a396066adaf4feb1 @Override public FluidState getFluidState(BlockPos pos) { diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 249f39bc0c5820e313cad7813bd1087cb2e09ed6..b737ffb8af88e7978c3bfc0b2e61639aca3376c0 100644 +index bf5a039553a31ed6e9d9bfa64cbd435b3e551a08..db564e9a866c30d6d7b34fa97185b01e8c788449 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -337,12 +337,28 @@ public class LevelChunk implements ChunkAccess { diff --git a/patches/server/0070-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/0070-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index fe79c43e63..21b2a0c6a3 100644 --- a/patches/server/0070-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/patches/server/0070-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener Saves on some object allocation and processing when no plugin listens to this diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6826d1e4b7f1595f17a118e8f146bb19f3ef9256..e250db8035b2d53e724a47da6dc6118d85ca148b 100644 +index d1267242746fe2aee0fd12ed01900e4e72df3f89..4ed4744c887ca52fa3f85ad4ea41e79543cc13ce 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1363,6 +1363,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return worldserver + " " + worldserver.dimension().location(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 0d6a67fdd83de0c62f6e2a90d0107cbebbac3a37..a846f7136d29bd1d8f8ed30d79fa8936fe386618 100644 +index 9551e819a9a1ae1f4dc52e1a347d8ee5924d092b..aa9278ff7514fd93a8d0d5f925456a66c4ce8736 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -201,6 +201,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -30,10 +30,10 @@ index 0d6a67fdd83de0c62f6e2a90d0107cbebbac3a37..a846f7136d29bd1d8f8ed30d79fa8936 @Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI return this.chunkSource.getChunk(x, z, false); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index bbe2d5eab844880f2fde674aa1c78d60d6152231..285389edd01b1b36dfa8363e7ceea3903229a618 100644 +index c6dbace64d19de52112c64c824640cf48db216e3..5c395ffa57372dee3fc29e9bd4b5545211aec29c 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -470,7 +470,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -471,7 +471,7 @@ 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(); @@ -42,7 +42,7 @@ index bbe2d5eab844880f2fde674aa1c78d60d6152231..285389edd01b1b36dfa8363e7ceea390 BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata)); this.getCraftServer().getPluginManager().callEvent(event); -@@ -579,7 +579,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -584,7 +584,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { try { // CraftBukkit start CraftWorld world = ((ServerLevel) this).getWorld(); @@ -73,7 +73,7 @@ index 24227939493f852a88477c84160bda1605291eb0..1f8cf302d2309aec2955832ffafd87f1 } } diff --git a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java -index 08870ea2431ba27474a275006071801c01cc9b1c..9c010d8359a36f3b2d4af3d828bc2dca792ef2f4 100644 +index 9edf1b87e59d589b053e5b4fee15faa221718c2f..65a163d93a293e1e0a12a300d6335a700099cac2 100644 --- a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java @@ -4,6 +4,7 @@ import javax.annotation.Nullable; @@ -84,7 +84,7 @@ index 08870ea2431ba27474a275006071801c01cc9b1c..9c010d8359a36f3b2d4af3d828bc2dca import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -@@ -85,7 +86,7 @@ public class DoublePlantBlock extends BushBlock { +@@ -93,7 +94,7 @@ public class DoublePlantBlock extends BushBlock { protected static void preventCreativeDropFromBottomPart(Level world, BlockPos pos, BlockState state, Player player) { // CraftBukkit start diff --git a/patches/server/0076-Add-PlayerUseUnknownEntityEvent.patch b/patches/server/0076-Add-PlayerUseUnknownEntityEvent.patch index 80017aa7d4..845e110f98 100644 --- a/patches/server/0076-Add-PlayerUseUnknownEntityEvent.patch +++ b/patches/server/0076-Add-PlayerUseUnknownEntityEvent.patch @@ -20,10 +20,10 @@ index 8834ed411a7db86b4d2b88183a1315317107d719..c45b5ab6776f3ac79f856c3a6467c510 static final ServerboundInteractPacket.Action ATTACK_ACTION = new ServerboundInteractPacket.Action() { @Override diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index cbd7e9b6b3d0cd5cb87ed8b2657daee9368424a0..8e751e9821dc76f33e9e844990c701f69c817c4b 100644 +index edb66e8c4507597ec8c35883460f88de8b263e54..60772b6d6fe171d7dd832cb132f7c56db9439bdb 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2203,8 +2203,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2190,8 +2190,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser }); } } diff --git a/patches/server/0077-Fix-reducedDebugInfo-not-initialized-on-client.patch b/patches/server/0077-Fix-reducedDebugInfo-not-initialized-on-client.patch index da572a349f..5ef0fe3665 100644 --- a/patches/server/0077-Fix-reducedDebugInfo-not-initialized-on-client.patch +++ b/patches/server/0077-Fix-reducedDebugInfo-not-initialized-on-client.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix reducedDebugInfo not initialized on client diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index cf1621fad7f9b3ec03f1c3722856186273c7935e..dd0cde1ef149ae708fa7b0c043acfcc489fe497c 100644 +index 0ea5574ab43141a69e6aa5e05aeb548660f126e1..b2638a7dbe2ead274e9e2e337babe41c90179f8b 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -247,6 +247,7 @@ public abstract class PlayerList { +@@ -249,6 +249,7 @@ public abstract class PlayerList { playerconnection.send(new ClientboundSetCarriedItemPacket(player.getInventory().selected)); playerconnection.send(new ClientboundUpdateRecipesPacket(this.server.getRecipeManager().getRecipes())); playerconnection.send(new ClientboundUpdateTagsPacket(this.server.getTags().serializeToNetwork((RegistryAccess) this.registryHolder))); diff --git a/patches/server/0079-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/patches/server/0079-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch index 2234667343..e07de933c8 100644 --- a/patches/server/0079-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch +++ b/patches/server/0079-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 285389edd01b1b36dfa8363e7ceea3903229a618..ce86590b4060d9705831303ab23f0294129760b9 100644 +index 5c395ffa57372dee3fc29e9bd4b5545211aec29c..22c4c94a4b81c8ca53d717005b6260f0bafbbea4 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -537,6 +537,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -542,6 +542,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public void setBlocksDirty(BlockPos pos, BlockState old, BlockState updated) {} public void updateNeighborsAt(BlockPos pos, Block block) { diff --git a/patches/server/0083-Configurable-Player-Collision.patch b/patches/server/0083-Configurable-Player-Collision.patch index 76136cb7ea..e2a96833d5 100644 --- a/patches/server/0083-Configurable-Player-Collision.patch +++ b/patches/server/0083-Configurable-Player-Collision.patch @@ -32,10 +32,10 @@ index 8885220e4813b34627b42523834bbec995d8950d..4c9660176e783999301565790b8cf6f4 buf.writeComponent(this.playerPrefix); buf.writeComponent(this.playerSuffix); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e250db8035b2d53e724a47da6dc6118d85ca148b..6bed68a09e427f0846f322b5a30a44ed09654fa6 100644 +index 4ed4744c887ca52fa3f85ad4ea41e79543cc13ce..275e7503ec6a0ceec9839c7d11fb3710cf9f15d2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -163,6 +163,7 @@ import net.minecraft.world.level.storage.loot.LootTables; +@@ -160,6 +160,7 @@ import net.minecraft.world.level.storage.loot.LootTables; import net.minecraft.world.level.storage.loot.PredicateManager; import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec3; @@ -43,7 +43,7 @@ index e250db8035b2d53e724a47da6dc6118d85ca148b..6bed68a09e427f0846f322b5a30a44ed import org.apache.commons.lang3.Validate; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -603,6 +604,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop playersByName = new java.util.HashMap<>(); @@ -84,7 +84,7 @@ index dd0cde1ef149ae708fa7b0c043acfcc489fe497c..9af086f022ed41081a77d9cf82b04567 public PlayerList(MinecraftServer server, RegistryAccess.RegistryHolder registryManager, PlayerDataStorage saveHandler, int maxPlayers) { this.cserver = server.server = new CraftServer((DedicatedServer) server, this); -@@ -383,6 +385,13 @@ public abstract class PlayerList { +@@ -385,6 +387,13 @@ public abstract class PlayerList { player.initInventoryMenu(); // CraftBukkit - Moved from above, added world @@ -98,7 +98,7 @@ index dd0cde1ef149ae708fa7b0c043acfcc489fe497c..9af086f022ed41081a77d9cf82b04567 PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ()); } -@@ -502,6 +511,16 @@ public abstract class PlayerList { +@@ -504,6 +513,16 @@ public abstract class PlayerList { entityplayer.doTick(); // SPIGOT-924 // CraftBukkit end @@ -115,7 +115,7 @@ index dd0cde1ef149ae708fa7b0c043acfcc489fe497c..9af086f022ed41081a77d9cf82b04567 this.save(entityplayer); if (entityplayer.isPassenger()) { Entity entity = entityplayer.getRootVehicle(); -@@ -1124,6 +1143,13 @@ public abstract class PlayerList { +@@ -1126,6 +1145,13 @@ public abstract class PlayerList { } // CraftBukkit end diff --git a/patches/server/0085-Configurable-RCON-IP-address.patch b/patches/server/0085-Configurable-RCON-IP-address.patch index c630888dc6..4e2ebf57fb 100644 --- a/patches/server/0085-Configurable-RCON-IP-address.patch +++ b/patches/server/0085-Configurable-RCON-IP-address.patch @@ -6,12 +6,12 @@ Subject: [PATCH] Configurable RCON IP address For servers with multiple IP's, ability to bind to a specific interface. diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java -index 3dc2187035fff8c0c338b35c07ca2164ed753b04..e3409d5f4ddcaa4edecfa4b3c638a12624b09f1b 100644 +index 9793b51080d0f4adba0d6bc684a6927382420a0b..12e55aabf0daf341ec74688e79c43451e820e6dc 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java @@ -67,6 +67,8 @@ public class DedicatedServerProperties extends Settings implements SnooperPopulator, CommandSource, AutoCloseable { @@ -17,7 +17,7 @@ index 15e26dbc38e23c5284246ef55d038eb011759ee2..45bcdf2e644999910784432d8f369e77 public static final Logger LOGGER = LogManager.getLogger(); private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F; private static final int TICK_STATS_SPAN = 100; -@@ -318,6 +319,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { -@@ -2233,7 +2235,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop get(String name) { ++ public synchronized Optional get(String name) { // Paper - synchronize String s1 = name.toLowerCase(Locale.ROOT); GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1); boolean flag = false; @@ -76,8 +75,8 @@ index 1dd9b362384543e17b537dd209665d956214916d..c70b4727fe0ae9ff7b9db08a97112729 + this.save(true); // Paper } - return gameprofile; -@@ -273,7 +273,7 @@ public class GameProfileCache { + return optional; +@@ -270,7 +270,7 @@ public class GameProfileCache { return arraylist; } @@ -86,7 +85,7 @@ index 1dd9b362384543e17b537dd209665d956214916d..c70b4727fe0ae9ff7b9db08a97112729 JsonArray jsonarray = new JsonArray(); DateFormat dateformat = GameProfileCache.createDateFormat(); -@@ -281,6 +281,7 @@ public class GameProfileCache { +@@ -278,6 +278,7 @@ public class GameProfileCache { jsonarray.add(GameProfileCache.writeGameProfile(usercache_usercacheentry, dateformat)); }); String s = this.gson.toJson(jsonarray); @@ -94,10 +93,11 @@ index 1dd9b362384543e17b537dd209665d956214916d..c70b4727fe0ae9ff7b9db08a97112729 try { BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8); -@@ -305,6 +306,14 @@ public class GameProfileCache { +@@ -302,7 +303,14 @@ public class GameProfileCache { } catch (IOException ioexception) { ; } +- + // Paper start + }; + if (asyncSave) { @@ -106,6 +106,6 @@ index 1dd9b362384543e17b537dd209665d956214916d..c70b4727fe0ae9ff7b9db08a97112729 + save.run(); + } + // Paper end - } + private Stream getTopMRUProfiles(int limit) { diff --git a/patches/server/0096-Faster-redstone-torch-rapid-clock-removal.patch b/patches/server/0096-Faster-redstone-torch-rapid-clock-removal.patch index 89a9e109f6..713926c7de 100644 --- a/patches/server/0096-Faster-redstone-torch-rapid-clock-removal.patch +++ b/patches/server/0096-Faster-redstone-torch-rapid-clock-removal.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Faster redstone torch rapid clock removal Only resize the the redstone torch list once, since resizing arrays / lists is costly diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index fa567322ca3f09d81479826b0119ddc922c41d11..e26cb05a91cf2b3ac059dcb55bc52f1e4f30b362 100644 +index 22c4c94a4b81c8ca53d717005b6260f0bafbbea4..6257d002f8ed39065a1a85ff53c6747900e890a5 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -159,6 +159,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -160,6 +160,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { private org.spigotmc.TickLimiter tileLimiter; private int tileTickPosition; public final Map explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions diff --git a/patches/server/0101-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/patches/server/0101-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch index 55abd4d655..a3cd09a3ba 100644 --- a/patches/server/0101-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch +++ b/patches/server/0101-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't lookup game profiles that have no UUID and no name diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java -index c70b4727fe0ae9ff7b9db08a9711272994159b96..87f5f4108796aa12b454bbf39b8c1d699bac78f2 100644 +index cbdd32685ac12c439e3c94a0432595e3052b2cad..caed3ae480f1937e89153287699473abb5e29e39 100644 --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java +++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java -@@ -100,7 +100,7 @@ public class GameProfileCache { +@@ -101,7 +101,7 @@ public class GameProfileCache { repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profilelookupcallback); GameProfile gameprofile = (GameProfile) atomicreference.get(); @@ -16,4 +16,4 @@ index c70b4727fe0ae9ff7b9db08a9711272994159b96..87f5f4108796aa12b454bbf39b8c1d69 + if (!GameProfileCache.usesAuthentication() && gameprofile == null && !org.apache.commons.lang3.StringUtils.isBlank(name)) { // Paper - Don't lookup a profile with a blank name UUID uuid = Player.createPlayerUUID(new GameProfile((UUID) null, name)); - gameprofile = new GameProfile(uuid, name); + return Optional.of(new GameProfile(uuid, name)); diff --git a/patches/server/0102-Add-setting-for-proxy-online-mode-status.patch b/patches/server/0102-Add-setting-for-proxy-online-mode-status.patch index 9a86346c1b..8fd6743c0d 100644 --- a/patches/server/0102-Add-setting-for-proxy-online-mode-status.patch +++ b/patches/server/0102-Add-setting-for-proxy-online-mode-status.patch @@ -32,10 +32,10 @@ index 1b8e5671c9dc8c15ce33d351c1bb20f28919b9a2..c52dc0346f93527965ef29a0ccdc4bf3 + } } diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java -index 87f5f4108796aa12b454bbf39b8c1d699bac78f2..3eb4bee81a8543cc06b9d5898f5f6c0e9dbbf554 100644 +index 7ef77c38537b85deb7d388a7331e895c54a8ba95..6e1b7d5b20e9f6ed1b650eb9d6ac9f8c4867b4b7 100644 --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java +++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java -@@ -97,6 +97,7 @@ public class GameProfileCache { +@@ -98,6 +98,7 @@ public class GameProfileCache { } }; @@ -43,7 +43,7 @@ index 87f5f4108796aa12b454bbf39b8c1d699bac78f2..3eb4bee81a8543cc06b9d5898f5f6c0e repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profilelookupcallback); GameProfile gameprofile = (GameProfile) atomicreference.get(); -@@ -114,7 +115,7 @@ public class GameProfileCache { +@@ -115,7 +116,7 @@ public class GameProfileCache { } private static boolean usesAuthentication() { @@ -53,10 +53,10 @@ index 87f5f4108796aa12b454bbf39b8c1d699bac78f2..3eb4bee81a8543cc06b9d5898f5f6c0e public synchronized void add(GameProfile profile) { // Paper - synchronize diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java -index 8e27b43e2f6ce4d7f5007fe02db1722e73c30a58..6aacc724c8c8d6fbe3067226989039ca9cee4929 100644 +index f6cb864c45f960811acc02829d1f7883b916de29..8703f97dc2f392b136c6851aa09b607cbfdfa5de 100644 --- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java +++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java -@@ -65,7 +65,8 @@ public class OldUsersConverter { +@@ -66,7 +66,8 @@ public class OldUsersConverter { return new String[i]; }); @@ -67,7 +67,7 @@ index 8e27b43e2f6ce4d7f5007fe02db1722e73c30a58..6aacc724c8c8d6fbe3067226989039ca } else { String[] astring1 = astring; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index be2f148d2b045d704df35b952b03cf88279de64f..2e37c23ce815a5e38ac9b823d187d39057e81ec0 100644 +index 6c372692eb6ac813ed071337d6ea98e604133510..94fe09fdf6e477eca467287c68d7a8b5a6fbaee0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1512,7 +1512,7 @@ public final class CraftServer implements Server { @@ -77,5 +77,5 @@ index be2f148d2b045d704df35b952b03cf88279de64f..2e37c23ce815a5e38ac9b823d187d390 - if ( this.getOnlineMode() || org.spigotmc.SpigotConfig.bungee ) + if ( this.getOnlineMode() || com.destroystokyo.paper.PaperConfig.isProxyOnlineMode() ) // Paper - Handle via setting { - profile = this.console.getProfileCache().get( name ); + profile = this.console.getProfileCache().get(name).orElse(null); } diff --git a/patches/server/0104-Configurable-packet-in-spam-threshold.patch b/patches/server/0104-Configurable-packet-in-spam-threshold.patch index b67b855a64..01f19eb47b 100644 --- a/patches/server/0104-Configurable-packet-in-spam-threshold.patch +++ b/patches/server/0104-Configurable-packet-in-spam-threshold.patch @@ -23,10 +23,10 @@ index c52dc0346f93527965ef29a0ccdc4bf3debe302e..64d7c9058ee757a6d3cf3b648596092a + } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 8e751e9821dc76f33e9e844990c701f69c817c4b..13077dcc0ce4e7cfa8146ee71db4c2cce9e36f4a 100644 +index 60772b6d6fe171d7dd832cb132f7c56db9439bdb..451a2ea80c6262008be6b075c122c78a5b435c75 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1496,13 +1496,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1483,13 +1483,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // Spigot start - limit place/interactions private int limitedPackets; private long lastLimitedPacket = -1; diff --git a/patches/server/0105-Configurable-flying-kick-messages.patch b/patches/server/0105-Configurable-flying-kick-messages.patch index d6c717ce3d..29752f20df 100644 --- a/patches/server/0105-Configurable-flying-kick-messages.patch +++ b/patches/server/0105-Configurable-flying-kick-messages.patch @@ -21,10 +21,10 @@ index 64d7c9058ee757a6d3cf3b648596092a810e105c..4e2f243faa209925dcb7c3ef89df3ed8 + } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 13077dcc0ce4e7cfa8146ee71db4c2cce9e36f4a..d05f284b943340fef24481adaa4da4e6d9e0169d 100644 +index 451a2ea80c6262008be6b075c122c78a5b435c75..9026dd91f8d874209bbfd4cdfd3c41e37cdd7560 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -302,7 +302,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -301,7 +301,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser if (this.clientIsFloating && !this.player.isSleeping()) { if (++this.aboveGroundTickCount > 80) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString()); @@ -33,7 +33,7 @@ index 13077dcc0ce4e7cfa8146ee71db4c2cce9e36f4a..d05f284b943340fef24481adaa4da4e6 return; } } else { -@@ -321,7 +321,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -320,7 +320,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) { if (++this.aboveGroundVehicleTickCount > 80) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString()); diff --git a/patches/server/0107-Auto-fix-bad-Y-levels-on-player-login.patch b/patches/server/0107-Auto-fix-bad-Y-levels-on-player-login.patch index a625bd3ac7..fad6eea038 100644 --- a/patches/server/0107-Auto-fix-bad-Y-levels-on-player-login.patch +++ b/patches/server/0107-Auto-fix-bad-Y-levels-on-player-login.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Auto fix bad Y levels on player login Bring down to a saner Y level if super high, as this can cause the server to crash diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index e512cd033317ce2e1437c0ac28f71db47703bc57..3c51b0c3c0cdb55852ca9d9f1609518d5905589a 100644 +index a21496bc07c4691b99f9f58a0493e6e054c02641..d5bdf1e58bf48b5738e98159afb54630220af5b0 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -401,6 +401,7 @@ public class ServerPlayer extends Player { +@@ -397,6 +397,7 @@ public class ServerPlayer extends Player { @Override public void readAdditionalSaveData(CompoundTag nbt) { super.readAdditionalSaveData(nbt); diff --git a/patches/server/0117-Optimize-World.isLoaded-BlockPosition-Z.patch b/patches/server/0117-Optimize-World.isLoaded-BlockPosition-Z.patch index c7b7b83a1d..391a49818e 100644 --- a/patches/server/0117-Optimize-World.isLoaded-BlockPosition-Z.patch +++ b/patches/server/0117-Optimize-World.isLoaded-BlockPosition-Z.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z Reduce method invocations for World.isLoaded(BlockPosition)Z diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 69f74f6e9750b34e735c8fe68a90a3f1e0eed2fb..c85caffd2dcb47d127b508791f78aea8f3657c8d 100644 +index 6257d002f8ed39065a1a85ff53c6747900e890a5..05f94017546f3bb326f445d06add401498524d4d 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -316,6 +316,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -317,6 +317,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return chunk == null ? null : chunk.getFluidState(blockposition); } diff --git a/patches/server/0120-Optimize-ItemStack.isEmpty.patch b/patches/server/0120-Optimize-ItemStack.isEmpty.patch index cea59f6d21..5204dcf7cb 100644 --- a/patches/server/0120-Optimize-ItemStack.isEmpty.patch +++ b/patches/server/0120-Optimize-ItemStack.isEmpty.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimize ItemStack.isEmpty() Remove hashMap lookup every check, simplify code to remove ternary diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index bbaf615a150bc9c1ad61d509209350eec922a9f2..55e2ac3fc3d6e1da40f766ac42c9ca24b8b6e872 100644 +index 7a50160c2cace5ef7a2f1f3834574e389fd32aaa..404a9f22b3a67aa042449fa2c1a1c31095c256b9 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -241,7 +241,7 @@ public final class ItemStack { +@@ -239,7 +239,7 @@ public final class ItemStack { } public boolean isEmpty() { diff --git a/patches/server/0123-Properly-fix-item-duplication-bug.patch b/patches/server/0123-Properly-fix-item-duplication-bug.patch index b789a87f73..14090bab66 100644 --- a/patches/server/0123-Properly-fix-item-duplication-bug.patch +++ b/patches/server/0123-Properly-fix-item-duplication-bug.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Properly fix item duplication bug Credit to prplz for figuring out the real issue diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 3c51b0c3c0cdb55852ca9d9f1609518d5905589a..a580ac8a39612f7b2cc9aad2815e987d4ba77b42 100644 +index d5bdf1e58bf48b5738e98159afb54630220af5b0..823fc38b5bbf5eac2d2e7cc48c4b0557d252f960 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2117,7 +2117,7 @@ public class ServerPlayer extends Player { +@@ -2123,7 +2123,7 @@ public class ServerPlayer extends Player { @Override public boolean isImmobile() { @@ -19,10 +19,10 @@ index 3c51b0c3c0cdb55852ca9d9f1609518d5905589a..a580ac8a39612f7b2cc9aad2815e987d @Override diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index d05f284b943340fef24481adaa4da4e6d9e0169d..a6891c43b674919eecaac5e826b4d979478b300c 100644 +index 9026dd91f8d874209bbfd4cdfd3c41e37cdd7560..6eb01dcf59fda2656b6d93b0c39380302665f930 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2822,7 +2822,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2810,7 +2810,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } public final boolean isDisconnected() { diff --git a/patches/server/0127-Enforce-Sync-Player-Saves.patch b/patches/server/0127-Enforce-Sync-Player-Saves.patch index 6e6bbaae41..e6c33dbf4a 100644 --- a/patches/server/0127-Enforce-Sync-Player-Saves.patch +++ b/patches/server/0127-Enforce-Sync-Player-Saves.patch @@ -7,10 +7,10 @@ Saving players async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 9cd5ed55c8ee13412662a2d7a5b636833e3a813e..3485538af8de78df47b03331c211e0015c214304 100644 +index a9ab9bba799a95351cdb829b84163a564b41e0a8..b08b11bfbc3441fc2899a5e72d7a388383781955 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1033,11 +1033,13 @@ public abstract class PlayerList { +@@ -1035,11 +1035,13 @@ public abstract class PlayerList { } public void saveAll() { diff --git a/patches/server/0129-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/0129-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index 372dd7b239..21b63ed075 100644 --- a/patches/server/0129-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/patches/server/0129-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -129,10 +129,10 @@ index 4000480a14d2ba52149f4fa47f824abfa2e0e5f8..ea01f84448693ca740b5f3381a9c500e @Override diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 2654ff0b458df689d1d27f9e4d3e3b56dc1296da..70804eb057cc7d6605e045baf6b9ffdb8cb2d477 100644 +index 60f966b56adcc232fe8c53ec0a04e69c93f0765d..a3dae798fe63e21f86a380f09ba802b2104ad7e8 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1699,7 +1699,8 @@ public abstract class LivingEntity extends Entity { +@@ -1703,7 +1703,8 @@ public abstract class LivingEntity extends Entity { protected void dropExperience() { // CraftBukkit start - Update getExpReward() above if the removed if() changes! if (true) { @@ -156,7 +156,7 @@ index b8163a04f5aad326e78416b270dc64ffc913ccc5..5a503a255b4e7e684a8f42d819043039 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java -index 0fd1dfacca88cd5399e05cb7ebc0150491e8f59c..c1cdb1905536bda76f34ad3fc796996443839767 100644 +index 0ebf49f7f1046b0606f3608bcc8e496693fe8553..3d15587a8c36d833283cfea0546c589287e7ed48 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java @@ -883,7 +883,7 @@ public class Fox extends Animal { @@ -182,7 +182,7 @@ index bae8340abda9f400450c835946b30aacec261f6d..fa551b1338a21b7b0864bdb9f31cb365 } diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 9d5b78880ea9d7efb8a6c5ffa26122e08b45f494..401a105a161c23a8d3fe45d0a7c845072afb8bd9 100644 +index e17cf38b791f509447ce2c8ef38411530a0fb09b..3a01ffffcc37a93866b8b6774874959dfcabba26 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java @@ -634,7 +634,7 @@ public class EnderDragon extends Mob implements Enemy { @@ -204,7 +204,7 @@ index 9d5b78880ea9d7efb8a6c5ffa26122e08b45f494..401a105a161c23a8d3fe45d0a7c84507 if (this.dragonFight != null) { diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index a8820e811be1adecf864541400dc6907d3c2f0bb..32132911f3431c7d1390edbc69bf4b98e123a713 100644 +index f030c8d7c28039fde273e6b30c63ea791c8de520..b4a3469d85a388100092cc2a1305cdcae37df9fc 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -616,7 +616,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -256,7 +256,7 @@ index 467f9814e0991d31bff7259f266262c81328f05f..11d1db5ef709dfb6fa596ebc4f5fff14 } diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -index 473e17d87637cd1a85880e2956f83de0b510b488..34574f3945d2a7b4ab6a71adb2408b9811a3cb0d 100644 +index c5e4a0aa901d362cb299298fe2426c1c8f546ece..b268645827b7a57b906fd925d694f802a75da25d 100644 --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java @@ -98,7 +98,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { @@ -269,7 +269,7 @@ index 473e17d87637cd1a85880e2956f83de0b510b488..34574f3945d2a7b4ab6a71adb2408b98 world.levelEvent(1042, blockposition, 0); diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index c27e755f93a2b2e203b305e0cae2c782a34e38cc..27016f964d2f6458298a9052d031a44b3d9f5f4b 100644 +index 72ef08a59dbf72bec2ce54ab76455c4230395959..6a31e3a3466369ede28e28bc3b9fda8dcb77e136 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java @@ -374,8 +374,13 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -288,7 +288,7 @@ index c27e755f93a2b2e203b305e0cae2c782a34e38cc..27016f964d2f6458298a9052d031a44b } diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 740cabab47b80ea6eef2761ef14f5960ff309569..cfa095d39843dd4963c817b824228a4b48a8c1cd 100644 +index 98633fe921a30e89715a62ca39b77347a96e5fd7..e43fd7185b4570713d8ee2361d633c94d187fe2b 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java @@ -610,7 +610,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit diff --git a/patches/server/0130-Cap-Entity-Collisions.patch b/patches/server/0130-Cap-Entity-Collisions.patch index 61c0a4afd1..7cb69253c5 100644 --- a/patches/server/0130-Cap-Entity-Collisions.patch +++ b/patches/server/0130-Cap-Entity-Collisions.patch @@ -27,7 +27,7 @@ index 2dc58b9f769ea43b737804456aafab47ecc143b8..c611b5a63498f5ad1f50a75ccd5d7299 + } } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7f080d8aac9198dd935a8af090ee82f618551203..927cc59705c662d319fbee47c8da00d8e6256e72 100644 +index 5acc5d9150961223904b8d0bb9ea880feb60ebf5..01cfa488e7b25b7c65e71908bb6f5e6b7b61ca89 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -321,6 +321,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -39,10 +39,10 @@ index 7f080d8aac9198dd935a8af090ee82f618551203..927cc59705c662d319fbee47c8da00d8 // Spigot end diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 70804eb057cc7d6605e045baf6b9ffdb8cb2d477..8044082ed3ca6076af38e4299e50f1f690d02a72 100644 +index a3dae798fe63e21f86a380f09ba802b2104ad7e8..489ce149e1922ef4bd09716dee079c0cc5aa1de2 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3224,8 +3224,11 @@ public abstract class LivingEntity extends Entity { +@@ -3227,8 +3227,11 @@ public abstract class LivingEntity extends Entity { } } diff --git a/patches/server/0132-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch b/patches/server/0132-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch index 1fb0880f4e..42b2c0ffc8 100644 --- a/patches/server/0132-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch +++ b/patches/server/0132-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index b20c1a772abdbadb72f141a751e954b126ab3de9..f4f0982aa11da0b5bf88a42c02e86f652f8ea615 100644 +index 82b25044e1852f5dbde1a658fe5f4f7526fa2b34..5ce8ac377b0d2b05dd90baa67f420945cc419609 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -185,7 +185,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -15,9 +15,9 @@ index b20c1a772abdbadb72f141a751e954b126ab3de9..f4f0982aa11da0b5bf88a42c02e86f65 - this.unloadQueue = Queues.newConcurrentLinkedQueue(); + this.unloadQueue = new com.destroystokyo.paper.utils.CachedSizeConcurrentLinkedQueue<>(); // Paper - need constant-time size() this.structureManager = structureManager; - this.storageFolder = session.getDimensionPath(world.dimension()); - this.level = world; -@@ -478,7 +478,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + File file = session.getDimensionPath(world.dimension()); + +@@ -479,7 +479,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Spigot start org.spigotmc.SlackActivityAccountant activityAccountant = this.level.getServer().slackActivityAccountant; activityAccountant.startActivity(0.5); @@ -26,7 +26,7 @@ index b20c1a772abdbadb72f141a751e954b126ab3de9..f4f0982aa11da0b5bf88a42c02e86f65 // Spigot end while (longiterator.hasNext()) { // Spigot long j = longiterator.nextLong(); -@@ -500,7 +500,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -501,7 +501,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider Runnable runnable; diff --git a/patches/server/0134-Properly-handle-async-calls-to-restart-the-server.patch b/patches/server/0134-Properly-handle-async-calls-to-restart-the-server.patch index 63f991c007..2c7432b02d 100644 --- a/patches/server/0134-Properly-handle-async-calls-to-restart-the-server.patch +++ b/patches/server/0134-Properly-handle-async-calls-to-restart-the-server.patch @@ -30,10 +30,10 @@ will have plugins and worlds saving to the disk has a high potential to result in corruption/dataloss. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1d70c8b6c807b92a2411f5dd46bf616cb8d05569..3875a2902c6a737fed4e2df3f7aee8fbe6ddda15 100644 +index feab424cbfcb4c8f7ce38cdeeb42dce3fe1ce7aa..14d94990ca8160b0a28b40ae6b8261f50798d7a2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -233,6 +233,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, ServerLevel> levels; private PlayerList playerList; private volatile boolean running; @@ -41,7 +41,7 @@ index 1d70c8b6c807b92a2411f5dd46bf616cb8d05569..3875a2902c6a737fed4e2df3f7aee8fb private boolean stopped; private int tickCount; protected final Proxy proxy; -@@ -917,7 +918,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; -@@ -365,7 +366,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0) { // Trim to filter lines which are just spaces @@ -201,7 +201,7 @@ index e2095308a8ec8471b04acce929d314fd828bc3de..45ae21718df16e16b5a3835a92afbf71 } // CraftBukkit end } -@@ -147,6 +150,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -148,6 +151,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface DedicatedServer.LOGGER.error("Exception handling console input", ioexception); } @@ -210,7 +210,7 @@ index e2095308a8ec8471b04acce929d314fd828bc3de..45ae21718df16e16b5a3835a92afbf71 } }; -@@ -158,6 +163,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -159,6 +164,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } global.addHandler(new org.bukkit.craftbukkit.util.ForwardLogHandler()); @@ -220,7 +220,7 @@ index e2095308a8ec8471b04acce929d314fd828bc3de..45ae21718df16e16b5a3835a92afbf71 final org.apache.logging.log4j.core.Logger logger = ((org.apache.logging.log4j.core.Logger) LogManager.getRootLogger()); for (org.apache.logging.log4j.core.Appender appender : logger.getAppenders().values()) { if (appender instanceof org.apache.logging.log4j.core.appender.ConsoleAppender) { -@@ -166,6 +174,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -167,6 +175,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } new org.bukkit.craftbukkit.util.TerminalConsoleWriterThread(System.out, this.reader).start(); @@ -230,10 +230,10 @@ index e2095308a8ec8471b04acce929d314fd828bc3de..45ae21718df16e16b5a3835a92afbf71 System.setOut(IoBuilder.forLogger(logger).setLevel(Level.INFO).buildPrintStream()); System.setErr(IoBuilder.forLogger(logger).setLevel(Level.WARN).buildPrintStream()); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 2c24e800094d425b40361f8729a03393861f723a..992760580450a9b0e8dc226b73ba0b29707ec04e 100644 +index 24add1cd1f865012c5382548e415218d481ecefe..31dccb0b4ab60d6cedf236fc7d51a363c8367d71 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -152,8 +152,7 @@ public abstract class PlayerList { +@@ -154,8 +154,7 @@ public abstract class PlayerList { public PlayerList(MinecraftServer server, RegistryAccess.RegistryHolder registryManager, PlayerDataStorage saveHandler, int maxPlayers) { this.cserver = server.server = new CraftServer((DedicatedServer) server, this); @@ -244,7 +244,7 @@ index 2c24e800094d425b40361f8729a03393861f723a..992760580450a9b0e8dc226b73ba0b29 this.bans = new UserBanList(PlayerList.USERBANLIST_FILE); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e11d454da896d52fe2a0d1d90027ed539b847911..e95a01e582b6c8996f4b366f5fd9b783658e6bff 100644 +index dadb60f0a1d8d0753e030ed9fd5f4235083e7808..914d2e16dd47db5a44b738d4c45af24b22ff0c2b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -46,7 +46,6 @@ import java.util.function.Consumer; diff --git a/patches/server/0139-Item-canEntityPickup.patch b/patches/server/0139-Item-canEntityPickup.patch index 7f8bbcc2fc..898b5f15f4 100644 --- a/patches/server/0139-Item-canEntityPickup.patch +++ b/patches/server/0139-Item-canEntityPickup.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Item#canEntityPickup diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 18ea26c8e17da03f35c3fd0788a385cc492ff544..85633cd1718783cffe03f750da1c17270eeb4cdd 100644 +index 78e2d0165f6f6da4d7d1e1dad76e5edcbe48df9e..6b18d4dd869b442f06a7e9ae690edd5ff5227cbb 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -614,6 +614,11 @@ public abstract class Mob extends LivingEntity { +@@ -615,6 +615,11 @@ public abstract class Mob extends LivingEntity { ItemEntity entityitem = (ItemEntity) iterator.next(); if (!entityitem.isRemoved() && !entityitem.getItem().isEmpty() && !entityitem.hasPickUpDelay() && this.wantsToPickUp(entityitem.getItem())) { diff --git a/patches/server/0143-Basic-PlayerProfile-API.patch b/patches/server/0143-Basic-PlayerProfile-API.patch index cdab8dee30..5b0eb2136e 100644 --- a/patches/server/0143-Basic-PlayerProfile-API.patch +++ b/patches/server/0143-Basic-PlayerProfile-API.patch @@ -7,14 +7,12 @@ Establishes base extension of profile systems for future edits too diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java new file mode 100644 -index 0000000000000000000000000000000000000000..ef6aab69daa7ab952408b573bff6c6996cbc349a +index 0000000000000000000000000000000000000000..84551164b76bc8f064a3a0c030c3a1b47f567b6f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java -@@ -0,0 +1,303 @@ +@@ -0,0 +1,302 @@ +package com.destroystokyo.paper.profile; + -+import com.destroystokyo.paper.profile.PlayerProfile; -+import com.destroystokyo.paper.profile.ProfileProperty; +import com.destroystokyo.paper.PaperConfig; +import com.google.common.base.Charsets; +import com.mojang.authlib.GameProfile; @@ -24,7 +22,6 @@ index 0000000000000000000000000000000000000000..ef6aab69daa7ab952408b573bff6c699 +import net.minecraft.server.players.GameProfileCache; +import org.apache.commons.lang3.Validate; +import org.bukkit.craftbukkit.entity.CraftPlayer; -+import org.spigotmc.SpigotConfig; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; @@ -32,6 +29,7 @@ index 0000000000000000000000000000000000000000..ef6aab69daa7ab952408b573bff6c699 +import java.util.Collection; +import java.util.Iterator; +import java.util.Objects; ++import java.util.Optional; +import java.util.Set; +import java.util.UUID; + @@ -166,7 +164,7 @@ index 0000000000000000000000000000000000000000..ef6aab69daa7ab952408b573bff6c699 + if (profile.getId() == null) { + final GameProfile profile; + if (onlineMode) { -+ profile = lookupUUID ? userCache.get(name) : userCache.getProfileIfCached(name); ++ profile = lookupUUID ? userCache.get(name).orElse(null) : userCache.getProfileIfCached(name); + } else { + // Make an OfflinePlayer using an offline mode UUID since the name has no profile + profile = new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name); @@ -179,8 +177,9 @@ index 0000000000000000000000000000000000000000..ef6aab69daa7ab952408b573bff6c699 + } + + if ((profile.getName() == null || !hasTextures()) && profile.getId() != null) { -+ GameProfile profile = userCache.get(this.profile.getId()); -+ if (profile != null) { ++ Optional optProfile = userCache.get(this.profile.getId()); ++ if (optProfile.isPresent()) { ++ GameProfile profile = optProfile.get(); + if (this.profile.getName() == null) { + // if old has it, assume its newer, so overwrite, else use cached if it was set and ours wasn't + copyProfileProperties(this.profile, profile); @@ -474,11 +473,11 @@ index c8385460701395cb5c65fba41335469ffb2d9b9a..fb0b3c5770f66cc3590f5ac4e690a33c GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository(); GameProfileCache usercache = new GameProfileCache(gameprofilerepository, new File(file, MinecraftServer.USERID_CACHE_FILE.getName())); diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java -index 3eb4bee81a8543cc06b9d5898f5f6c0e9dbbf554..9a428e166561b4bc028732ec563d3b2e99f81a8e 100644 +index 6e1b7d5b20e9f6ed1b650eb9d6ac9f8c4867b4b7..61405c2b53e03a4b83e2c70c6e4d3739ca9676cb 100644 --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java +++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java -@@ -190,6 +190,13 @@ public class GameProfileCache { - } +@@ -135,6 +135,13 @@ public class GameProfileCache { + return this.operationCount.incrementAndGet(); } + // Paper start @@ -488,11 +487,11 @@ index 3eb4bee81a8543cc06b9d5898f5f6c0e9dbbf554..9a428e166561b4bc028732ec563d3b2e + } + // Paper end + - @Nullable - public GameProfile get(UUID uuid) { - GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByUUID.get(uuid); + public synchronized Optional get(String name) { // Paper - synchronize + String s1 = name.toLowerCase(Locale.ROOT); + GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a3e57ee42a76ec419ad055b4e353f1ca54470af0..d221bad83f1bf2d9f23e457427c15b440e945f42 100644 +index 8667373de82ce335fb0c55e39e6c1e1e791d70ce..df03db15e0a7d90ada2ae2a7990472ec2ca72806 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -226,6 +226,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; diff --git a/patches/server/0144-Shoulder-Entities-Release-API.patch b/patches/server/0144-Shoulder-Entities-Release-API.patch index 5c38ddf29e..66150c50a5 100644 --- a/patches/server/0144-Shoulder-Entities-Release-API.patch +++ b/patches/server/0144-Shoulder-Entities-Release-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 56ce24ab7213776285d09cc0ab91f012d3e58caf..64f916d290df16ecab9ccb8fa029839360b4f4c6 100644 +index 273bb051c3f19e388ccea367ef6b46b509015abd..789a42f997d5f0abf50171db7d747092653817fa 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1953,20 +1953,44 @@ public abstract class Player extends LivingEntity { +@@ -1949,20 +1949,44 @@ public abstract class Player extends LivingEntity { } @@ -58,7 +58,7 @@ index 56ce24ab7213776285d09cc0ab91f012d3e58caf..64f916d290df16ecab9ccb8fa0298393 @Override public abstract boolean isSpectator(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 2db149bf57c561d7f8f49341fbefafb5d3ecab54..bddfc12e8cf896bee5fb518ddacdca434456c6bb 100644 +index 841dbf4a86b19d7c8ea41930ecb1f88c660fa117..54947f02f29dd3dc546ee0d0f4600630242f003d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -500,6 +500,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/patches/server/0149-Implement-ensureServerConversions-API.patch b/patches/server/0149-Implement-ensureServerConversions-API.patch index cd38c5b10e..193f6ef80d 100644 --- a/patches/server/0149-Implement-ensureServerConversions-API.patch +++ b/patches/server/0149-Implement-ensureServerConversions-API.patch @@ -7,10 +7,10 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr to ensure it meets latest minecraft expectations. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 8f05c6832fc968666f0e6e0a19f6dd74d92d0c28..69852a3801439db075e522aa2e2dc51e84c3deda 100644 +index 4b038b7f4176dc1a1a47d7694d95ce0e4ec38a2d..10c09dc9228b1eec784a508c6c0e7a229aab7924 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -349,5 +349,11 @@ public final class CraftItemFactory implements ItemFactory { +@@ -352,5 +352,11 @@ public final class CraftItemFactory implements ItemFactory { public net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component displayName(@org.jetbrains.annotations.NotNull ItemStack itemStack) { return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).getDisplayName()); } diff --git a/patches/server/0150-Implement-getI18NDisplayName.patch b/patches/server/0150-Implement-getI18NDisplayName.patch index 0209464179..06cb047022 100644 --- a/patches/server/0150-Implement-getI18NDisplayName.patch +++ b/patches/server/0150-Implement-getI18NDisplayName.patch @@ -8,10 +8,10 @@ Currently the server only supports the English language. To override this, You must replace the language file embedded in the server jar. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 69852a3801439db075e522aa2e2dc51e84c3deda..001e89e85fb935c539c53c8e9c78927e26e099d8 100644 +index 10c09dc9228b1eec784a508c6c0e7a229aab7924..8f5d71463616e519c2e183af1c2909fd55a3f93a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -355,5 +355,18 @@ public final class CraftItemFactory implements ItemFactory { +@@ -358,5 +358,18 @@ public final class CraftItemFactory implements ItemFactory { public ItemStack ensureServerConversions(ItemStack item) { return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item)); } diff --git a/patches/server/0151-ProfileWhitelistVerifyEvent.patch b/patches/server/0151-ProfileWhitelistVerifyEvent.patch index 663e2d2cb7..1572608b2f 100644 --- a/patches/server/0151-ProfileWhitelistVerifyEvent.patch +++ b/patches/server/0151-ProfileWhitelistVerifyEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ProfileWhitelistVerifyEvent diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 992760580450a9b0e8dc226b73ba0b29707ec04e..9f27c6fa106a11ea56a4be2d41f8a00f2aa4961f 100644 +index 31dccb0b4ab60d6cedf236fc7d51a363c8367d71..1ae11a88b2ab49c13155e2cf41252c8716f30b96 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -613,9 +613,9 @@ public abstract class PlayerList { +@@ -615,9 +615,9 @@ public abstract class PlayerList { // return chatmessage; event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure @@ -21,7 +21,7 @@ index 992760580450a9b0e8dc226b73ba0b29707ec04e..9f27c6fa106a11ea56a4be2d41f8a00f } else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) { IpBanListEntry ipbanentry = this.ipBans.get(socketaddress); -@@ -995,9 +995,25 @@ public abstract class PlayerList { +@@ -997,9 +997,25 @@ public abstract class PlayerList { this.server.getCommands().sendCommands(player); } diff --git a/patches/server/0159-Add-PlayerJumpEvent.patch b/patches/server/0159-Add-PlayerJumpEvent.patch index e793aceb4a..9a463aaf1b 100644 --- a/patches/server/0159-Add-PlayerJumpEvent.patch +++ b/patches/server/0159-Add-PlayerJumpEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerJumpEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 98640f6000067b49e1c15740d45dc29e62b7f249..9255e3d89385fac82a1a2f27bd915cbbd19f69e7 100644 +index 41f1b355a8a90216964e89432244a7d6929c9152..7759bf2afb9edeaca24726aace9358a8d5eafc64 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1187,7 +1187,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1174,7 +1174,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser boolean flag = d8 > 0.0D; if (this.player.isOnGround() && !packet.isOnGround() && flag) { diff --git a/patches/server/0160-handle-PacketPlayInKeepAlive-async.patch b/patches/server/0160-handle-PacketPlayInKeepAlive-async.patch index 520fae314a..b1a73aa4dd 100644 --- a/patches/server/0160-handle-PacketPlayInKeepAlive-async.patch +++ b/patches/server/0160-handle-PacketPlayInKeepAlive-async.patch @@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing random disconnections for clients. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9255e3d89385fac82a1a2f27bd915cbbd19f69e7..20084d956082d4656f50c4e5e5f2b1c1a9cb9cbc 100644 +index 7759bf2afb9edeaca24726aace9358a8d5eafc64..652703b1582e63148658a3a9d2604afa55674c23 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2781,14 +2781,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2769,14 +2769,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @Override public void handleKeepAlive(ServerboundKeepAlivePacket packet) { diff --git a/patches/server/0162-revert-serverside-behavior-of-keepalives.patch b/patches/server/0162-revert-serverside-behavior-of-keepalives.patch index db5a28e6c7..7f70824139 100644 --- a/patches/server/0162-revert-serverside-behavior-of-keepalives.patch +++ b/patches/server/0162-revert-serverside-behavior-of-keepalives.patch @@ -17,10 +17,10 @@ from networking or during connections flood of chunk packets on slower clients, at the cost of dead connections being kept open for longer. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e06179ca9c26368e47ef819f2e7bdf59518842f5..a679b30076cec74976cd04a7fab737fe88a83329 100644 +index 652703b1582e63148658a3a9d2604afa55674c23..cf42d59254f2786bfe8785249ad270d35996417a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -222,9 +222,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -221,9 +221,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private final MinecraftServer server; public ServerPlayer player; private int tickCount; @@ -33,7 +33,7 @@ index e06179ca9c26368e47ef819f2e7bdf59518842f5..a679b30076cec74976cd04a7fab737fe // CraftBukkit start - multithreaded fields private AtomicInteger chatSpamTickCount = new AtomicInteger(); // CraftBukkit end -@@ -253,6 +253,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -252,6 +252,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private int aboveGroundVehicleTickCount; private int receivedMovePacketCount; private int knownMovePacketCount; @@ -41,7 +41,7 @@ index e06179ca9c26368e47ef819f2e7bdf59518842f5..a679b30076cec74976cd04a7fab737fe public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { this.server = server; -@@ -335,18 +336,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -334,18 +335,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } this.server.getProfiler().push("keepAlive"); diff --git a/patches/server/0163-Send-attack-SoundEffects-only-to-players-who-can-see.patch b/patches/server/0163-Send-attack-SoundEffects-only-to-players-who-can-see.patch index b4adb22905..170b1811f4 100644 --- a/patches/server/0163-Send-attack-SoundEffects-only-to-players-who-can-see.patch +++ b/patches/server/0163-Send-attack-SoundEffects-only-to-players-who-can-see.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 64f916d290df16ecab9ccb8fa029839360b4f4c6..eb71f050fcd673ee4d9d1da62e098e2e37d4dd9a 100644 +index 789a42f997d5f0abf50171db7d747092653817fa..615ed6c07a3c20f0bd6b58f7d260e12d34b7ab0a 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -30,6 +30,7 @@ import net.minecraft.network.chat.MutableComponent; @@ -17,7 +17,7 @@ index 64f916d290df16ecab9ccb8fa029839360b4f4c6..eb71f050fcd673ee4d9d1da62e098e2e import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; -@@ -1183,7 +1184,7 @@ public abstract class Player extends LivingEntity { +@@ -1179,7 +1180,7 @@ public abstract class Player extends LivingEntity { int i = b0 + EnchantmentHelper.getKnockbackBonus((LivingEntity) this); if (this.isSprinting() && flag) { @@ -26,7 +26,7 @@ index 64f916d290df16ecab9ccb8fa029839360b4f4c6..eb71f050fcd673ee4d9d1da62e098e2e ++i; flag1 = true; } -@@ -1258,7 +1259,7 @@ public abstract class Player extends LivingEntity { +@@ -1254,7 +1255,7 @@ public abstract class Player extends LivingEntity { } } @@ -35,7 +35,7 @@ index 64f916d290df16ecab9ccb8fa029839360b4f4c6..eb71f050fcd673ee4d9d1da62e098e2e this.sweepAttack(); } -@@ -1286,15 +1287,15 @@ public abstract class Player extends LivingEntity { +@@ -1282,15 +1283,15 @@ public abstract class Player extends LivingEntity { } if (flag2) { @@ -54,7 +54,7 @@ index 64f916d290df16ecab9ccb8fa029839360b4f4c6..eb71f050fcd673ee4d9d1da62e098e2e } } -@@ -1346,7 +1347,7 @@ public abstract class Player extends LivingEntity { +@@ -1342,7 +1343,7 @@ public abstract class Player extends LivingEntity { this.applyExhaustion(level.spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value } else { @@ -63,7 +63,7 @@ index 64f916d290df16ecab9ccb8fa029839360b4f4c6..eb71f050fcd673ee4d9d1da62e098e2e if (flag4) { target.clearFire(); } -@@ -1793,6 +1794,14 @@ public abstract class Player extends LivingEntity { +@@ -1789,6 +1790,14 @@ public abstract class Player extends LivingEntity { public int getXpNeededForNextLevel() { return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2); } diff --git a/patches/server/0164-Add-PlayerArmorChangeEvent.patch b/patches/server/0164-Add-PlayerArmorChangeEvent.patch index d5de1db379..276deaed4a 100644 --- a/patches/server/0164-Add-PlayerArmorChangeEvent.patch +++ b/patches/server/0164-Add-PlayerArmorChangeEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerArmorChangeEvent diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 8044082ed3ca6076af38e4299e50f1f690d02a72..0dc03f53c80aac91a914bea91958a6c11c4f2061 100644 +index 489ce149e1922ef4bd09716dee079c0cc5aa1de2..4da63e5c35b1736f2d55713b39b64cc31ecbc9c9 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -1,5 +1,6 @@ @@ -15,7 +15,7 @@ index 8044082ed3ca6076af38e4299e50f1f690d02a72..0dc03f53c80aac91a914bea91958a6c1 import com.google.common.base.Objects; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -@@ -2937,6 +2938,13 @@ public abstract class LivingEntity extends Entity { +@@ -2940,6 +2941,13 @@ public abstract class LivingEntity extends Entity { ItemStack itemstack1 = this.getItemBySlot(enumitemslot); if (!ItemStack.matches(itemstack1, itemstack)) { diff --git a/patches/server/0166-Fix-MC-117075-TE-Unload-Lag-Spike.patch b/patches/server/0166-Fix-MC-117075-TE-Unload-Lag-Spike.patch index fc6d8ee42c..7e74a847ae 100644 --- a/patches/server/0166-Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ b/patches/server/0166-Fix-MC-117075-TE-Unload-Lag-Spike.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 5b88064b42012f7480adcc9e77da7017347db5af..30347baabcace53bcad0b6ffddab9f1debf03ed5 100644 +index 43febeede5fcc9d52e6682f94afb26c18b61648e..68f6b8fee64b1c0cb6968d69f7edcfb48119aa46 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -723,6 +723,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -728,6 +728,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // Spigot start // Iterator iterator = this.blockEntityTickers.iterator(); int tilesThisCycle = 0; @@ -17,7 +17,7 @@ index 5b88064b42012f7480adcc9e77da7017347db5af..30347baabcace53bcad0b6ffddab9f1d for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0; TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition); -@@ -730,7 +732,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -735,7 +737,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { if (tickingblockentity == null) { this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash"); tilesThisCycle--; @@ -25,7 +25,7 @@ index 5b88064b42012f7480adcc9e77da7017347db5af..30347baabcace53bcad0b6ffddab9f1d continue; } // Spigot end -@@ -738,12 +739,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -743,12 +744,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { if (tickingblockentity.isRemoved()) { // Spigot start tilesThisCycle--; diff --git a/patches/server/0167-use-CB-BlockState-implementations-for-captured-block.patch b/patches/server/0167-use-CB-BlockState-implementations-for-captured-block.patch index c4b31f7212..9a0f3f4614 100644 --- a/patches/server/0167-use-CB-BlockState-implementations-for-captured-block.patch +++ b/patches/server/0167-use-CB-BlockState-implementations-for-captured-block.patch @@ -18,11 +18,11 @@ the blockstate that will be valid for restoration, as opposed to dropping information on restoration when the event is cancelled. diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 30347baabcace53bcad0b6ffddab9f1debf03ed5..08f612b7d2e861ef7e8b91e622c7a278542809f0 100644 +index 68f6b8fee64b1c0cb6968d69f7edcfb48119aa46..e83ad85f2350da4a01fd0c848a821d556c7ea9b2 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -140,7 +140,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - +@@ -141,7 +141,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710 public boolean captureBlockStates = false; public boolean captureTreeGeneration = false; - public Map capturedBlockStates = new java.util.LinkedHashMap<>(); @@ -30,7 +30,7 @@ index 30347baabcace53bcad0b6ffddab9f1debf03ed5..08f612b7d2e861ef7e8b91e622c7a278 public Map capturedTileEntities = new HashMap<>(); public List captureDrops; public long ticksPerAnimalSpawns; -@@ -358,7 +358,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -359,7 +359,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) { // CraftBukkit start - tree generation if (this.captureTreeGeneration) { @@ -39,7 +39,7 @@ index 30347baabcace53bcad0b6ffddab9f1debf03ed5..08f612b7d2e861ef7e8b91e622c7a278 if (blockstate == null) { blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags); this.capturedBlockStates.put(pos.immutable(), blockstate); -@@ -378,7 +378,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -379,7 +379,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // CraftBukkit start - capture blockstates boolean captured = false; if (this.captureBlockStates && !this.capturedBlockStates.containsKey(pos)) { @@ -49,7 +49,7 @@ index 30347baabcace53bcad0b6ffddab9f1debf03ed5..08f612b7d2e861ef7e8b91e622c7a278 this.capturedBlockStates.put(pos.immutable(), blockstate); captured = true; } -@@ -643,7 +644,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -648,7 +649,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public BlockState getBlockState(BlockPos pos) { // CraftBukkit start - tree generation if (this.captureTreeGeneration) { diff --git a/patches/server/0169-AsyncTabCompleteEvent.patch b/patches/server/0169-AsyncTabCompleteEvent.patch index 2a46b38a53..9f1e34c2a6 100644 --- a/patches/server/0169-AsyncTabCompleteEvent.patch +++ b/patches/server/0169-AsyncTabCompleteEvent.patch @@ -14,10 +14,10 @@ completion, such as offline players. Also adds isCommand and getLocation to the sync TabCompleteEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b91362681a3293e1acd044edad34e1e86e36d0f3..e12f0af47108b09e490f2a1e51a98accfcc6bd28 100644 +index cf42d59254f2786bfe8785249ad270d35996417a..8c2242d7e443bee26741608c65d314d8902f5765 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -703,10 +703,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -702,10 +702,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @Override public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { @@ -30,7 +30,7 @@ index b91362681a3293e1acd044edad34e1e86e36d0f3..e12f0af47108b09e490f2a1e51a98acc return; } // CraftBukkit end -@@ -716,12 +716,35 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -715,12 +715,35 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser stringreader.skip(); } @@ -46,14 +46,14 @@ index b91362681a3293e1acd044edad34e1e86e36d0f3..e12f0af47108b09e490f2a1e51a98acc + // If the event isn't handled, we can assume that we have no completions, and so we'll ask the server + if (!event.isHandled()) { + if (!event.isCancelled()) { ++ ++ this.server.scheduleOnMain(() -> { // Paper - This needs to be on main ++ ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); - this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { - if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer - this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions)); - }); -+ this.server.scheduleOnMain(() -> { // Paper - This needs to be on main -+ ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); -+ + this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { + if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer + this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions)); @@ -72,7 +72,7 @@ index b91362681a3293e1acd044edad34e1e86e36d0f3..e12f0af47108b09e490f2a1e51a98acc @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d221bad83f1bf2d9f23e457427c15b440e945f42..7a1c83403f4f6a0eae54c067e1866de7971e0ef2 100644 +index c9de4bda38ae28067b03ceef2e2a6972a6920370..40b0489faa4da7888addfd2a028bbf1e7578e6be 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1856,7 +1856,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0171-Ability-to-apply-mending-to-XP-API.patch b/patches/server/0171-Ability-to-apply-mending-to-XP-API.patch index 06a0c64d66..ed8579cb1b 100644 --- a/patches/server/0171-Ability-to-apply-mending-to-XP-API.patch +++ b/patches/server/0171-Ability-to-apply-mending-to-XP-API.patch @@ -10,10 +10,10 @@ of giving the player experience points. Both an API To standalone mend, and apply mending logic to .giveExp has been added. diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java -index 27cdfbeb6cb2159075b35dd4f9e9557ec0eac7c2..e246bf034a86deba5a15e7c639f5e08213fe7eee 100644 +index 6f25e9f41d93a225acaa6575954967438a6cabbf..d439e8ce87bf7da03683a336941c7673b8b166e4 100644 --- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java +++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java -@@ -246,8 +246,11 @@ public class EnchantmentHelper { +@@ -270,8 +270,11 @@ public class EnchantmentHelper { return getItemEnchantmentLevel(Enchantments.CHANNELING, stack) > 0; } @@ -28,7 +28,7 @@ index 27cdfbeb6cb2159075b35dd4f9e9557ec0eac7c2..e246bf034a86deba5a15e7c639f5e082 return true; }); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6549ffa087f9955849024fa62cfca9e91cbecf30..f1c56823e1e89251c518d9d51ab7442b30a85336 100644 +index a4063d3c280b145c9754c6df22b0b458f7145ea7..c240910d1baadc40a66e4086fb41cb5aee1eabc6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -61,11 +61,14 @@ import net.minecraft.server.level.ServerPlayer; diff --git a/patches/server/0173-PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/0173-PlayerNaturallySpawnCreaturesEvent.patch index 06c420818f..2f2b3a020b 100644 --- a/patches/server/0173-PlayerNaturallySpawnCreaturesEvent.patch +++ b/patches/server/0173-PlayerNaturallySpawnCreaturesEvent.patch @@ -9,10 +9,10 @@ from triggering monster spawns on a server. Also a highly more effecient way to blanket block spawns in a world diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 229e08a3fd8b4fc026ff49af9d163ea26d878bd4..94c5577a887ab4801dae5a1a0accd4b2f448bcc2 100644 +index 5ce8ac377b0d2b05dd90baa67f420945cc419609..919a489a5c7b338659c62ae67fc0a6ceee9dcdf9 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -974,11 +974,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -975,11 +975,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange; chunkRange = (chunkRange > 8) ? 8 : chunkRange; @@ -36,10 +36,10 @@ index 229e08a3fd8b4fc026ff49af9d163ea26d878bd4..94c5577a887ab4801dae5a1a0accd4b2 }); } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index e3abeb839c36b5238ec115329ce05b58e3383a55..853056ad5c5eeff03e7d6fe0dfd6f837a03ad882 100644 +index 672c6651043a4efd65e472bbd519f54861ec008a..6757971ee556da2470de8b4579d906452acd36fe 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -632,6 +632,15 @@ public class ServerChunkCache extends ChunkSource { +@@ -631,6 +631,15 @@ public class ServerChunkCache extends ChunkSource { this.level.getProfiler().pop(); //List list = Lists.newArrayList(this.playerChunkMap.f()); // Paper //Collections.shuffle(list); // Paper @@ -56,7 +56,7 @@ index e3abeb839c36b5238ec115329ce05b58e3383a55..853056ad5c5eeff03e7d6fe0dfd6f837 this.chunkMap.getChunks().forEach((playerchunk) -> { // Paper - no... just no... Optional optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index a580ac8a39612f7b2cc9aad2815e987d4ba77b42..83a2c8e00d8445ad66bb8360f4e0e4b7cba44bb3 100644 +index 823fc38b5bbf5eac2d2e7cc48c4b0557d252f960..fb42d7e3a1a23c02e8fd2cc04e6986ead581018c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1,5 +1,6 @@ @@ -66,7 +66,7 @@ index a580ac8a39612f7b2cc9aad2815e987d4ba77b42..83a2c8e00d8445ad66bb8360f4e0e4b7 import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; import com.mojang.datafixers.util.Either; -@@ -232,6 +233,7 @@ public class ServerPlayer extends Player { +@@ -233,6 +234,7 @@ public class ServerPlayer extends Player { public boolean sentListPacket = false; public Integer clientViewDistance; // CraftBukkit end diff --git a/patches/server/0178-Add-ArmorStand-Item-Meta.patch b/patches/server/0178-Add-ArmorStand-Item-Meta.patch index 636222360f..16543c136b 100644 --- a/patches/server/0178-Add-ArmorStand-Item-Meta.patch +++ b/patches/server/0178-Add-ArmorStand-Item-Meta.patch @@ -256,10 +256,10 @@ index aee796567f11c8b93ac9ec0b8cb8f3a8412b23ce..39b98305632271e7375afe6c7001f241 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 45f4f8265c51a5b08db8aa7f53915c4bd0536d39..4ad6fd7e110f949f0bd859331ed6a5109ade3008 100644 +index 05d54f0eff89b721f01e90e79d2571baab297799..71320d9484842be3a694117de25159f3581bd2a3 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -1442,6 +1442,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1444,6 +1444,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { CraftMetaCrossbow.CHARGED.NBT, CraftMetaCrossbow.CHARGED_PROJECTILES.NBT, CraftMetaSuspiciousStew.EFFECTS.NBT, @@ -275,10 +275,10 @@ index 45f4f8265c51a5b08db8aa7f53915c4bd0536d39..4ad6fd7e110f949f0bd859331ed6a510 CraftMetaCompass.LODESTONE_POS.NBT, CraftMetaCompass.LODESTONE_TRACKED.NBT, diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index c1fc48881dffa61f461078bea5640f8c1a1f6570..b0bb30aebdba99a8fa929ec3c56e46b59d2467c9 100644 +index a7505a08b952431d1dd7e4b332ede0c0d15eea64..f3a0578f53863dd0866b4c2cb957a30fa3bc6cc5 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -@@ -314,6 +314,7 @@ public class ItemMetaTest extends AbstractTestingBase { +@@ -324,6 +324,7 @@ public class ItemMetaTest extends AbstractTestingBase { final CraftMetaArmorStand meta = (CraftMetaArmorStand) cleanStack.getItemMeta(); meta.entityTag = new CompoundTag(); meta.entityTag.putBoolean("Small", true); diff --git a/patches/server/0181-Toggleable-player-crits-helps-mitigate-hacked-client.patch b/patches/server/0181-Toggleable-player-crits-helps-mitigate-hacked-client.patch index 2f1b17bf11..21157a1187 100644 --- a/patches/server/0181-Toggleable-player-crits-helps-mitigate-hacked-client.patch +++ b/patches/server/0181-Toggleable-player-crits-helps-mitigate-hacked-client.patch @@ -21,10 +21,10 @@ index 3577100f850975020b74f077d688f59dbca78962..da4a110809eee691c1d5b072de335d75 private void allChunksAreSlimeChunks() { allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false); diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index eb71f050fcd673ee4d9d1da62e098e2e37d4dd9a..278416af649425890ad00ca6f47d459ebab08e0b 100644 +index 615ed6c07a3c20f0bd6b58f7d260e12d34b7ab0a..da0176ed9d51aef76d9c439a03718c1635c35333 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1191,6 +1191,7 @@ public abstract class Player extends LivingEntity { +@@ -1187,6 +1187,7 @@ public abstract class Player extends LivingEntity { boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity; diff --git a/patches/server/0183-Implement-extended-PaperServerListPingEvent.patch b/patches/server/0183-Implement-extended-PaperServerListPingEvent.patch index db5951c829..702afaf246 100644 --- a/patches/server/0183-Implement-extended-PaperServerListPingEvent.patch +++ b/patches/server/0183-Implement-extended-PaperServerListPingEvent.patch @@ -190,7 +190,7 @@ index 67455a5ba75c9b816213e44d6872c5ddf8e27e98..23efad80934930beadf15e65781551d4 public ClientboundStatusResponsePacket(ServerStatus metadata) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 151d08104ed390905becda5f7ba16c8f933cd3d0..80f8e994d4a85f5d240854ec492adba0633263b2 100644 +index 34e801e225173246ba6f4c2ab68ef3f5f2278d78..2bbed2eb8f992764deac2cd5e08471aa0f967606 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -2,6 +2,9 @@ package net.minecraft.server; @@ -203,7 +203,7 @@ index 151d08104ed390905becda5f7ba16c8f933cd3d0..80f8e994d4a85f5d240854ec492adba0 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1311,7 +1314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 5000000000L) { this.lastServerStatus = i; this.status.setPlayers(new ServerStatus.Players(this.getMaxPlayers(), this.getPlayerCount())); diff --git a/patches/server/0187-getPlayerUniqueId-API.patch b/patches/server/0187-getPlayerUniqueId-API.patch index 7d442b6a17..396f4ed47b 100644 --- a/patches/server/0187-getPlayerUniqueId-API.patch +++ b/patches/server/0187-getPlayerUniqueId-API.patch @@ -9,7 +9,7 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 1d767cf3f63569ce97132c5d0d6043584b54c658..38c7a8befad8633243b55d0f692f49f2e1b61256 100644 +index c9bc580b1fb274ea2af31adab0440132e3775ba6..096caeab9813d59e4b086c379e100d8b22713194 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1514,6 +1514,25 @@ public final class CraftServer implements Server { @@ -26,7 +26,7 @@ index 1d767cf3f63569ce97132c5d0d6043584b54c658..38c7a8befad8633243b55d0f692f49f2 + GameProfile profile; + // Only fetch an online UUID in online mode + if (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode()) { -+ profile = console.getProfileCache().get( name ); ++ profile = console.getProfileCache().get(name).orElse(null); + } else { + // Make an OfflinePlayer using an offline mode UUID since the name has no profile + profile = new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name); diff --git a/patches/server/0192-Add-method-to-open-already-placed-sign.patch b/patches/server/0192-Add-method-to-open-already-placed-sign.patch index 94cbbbf03a..94e5533d2d 100644 --- a/patches/server/0192-Add-method-to-open-already-placed-sign.patch +++ b/patches/server/0192-Add-method-to-open-already-placed-sign.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add method to open already placed sign diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index bddfc12e8cf896bee5fb518ddacdca434456c6bb..c839ea0b68fbdccfb7ed667c705a3f0f347fd89c 100644 +index 54947f02f29dd3dc546ee0d0f4600630242f003d..f1b1d1881d0598503a7ec1022ef5e00f848fb247 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -610,6 +610,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -25,4 +25,4 @@ index bddfc12e8cf896bee5fb518ddacdca434456c6bb..c839ea0b68fbdccfb7ed667c705a3f0f + // Paper end @Override public boolean dropItem(boolean dropAll) { - return this.getHandle().drop(dropAll); + if (!(this.getHandle() instanceof ServerPlayer)) return false; diff --git a/patches/server/0193-Configurable-sprint-interruption-on-attack.patch b/patches/server/0193-Configurable-sprint-interruption-on-attack.patch index 41a662d219..bac8db9758 100644 --- a/patches/server/0193-Configurable-sprint-interruption-on-attack.patch +++ b/patches/server/0193-Configurable-sprint-interruption-on-attack.patch @@ -20,10 +20,10 @@ index da4a110809eee691c1d5b072de335d75e1516eae..9225372cb9ef51a8cfbd4cee543c250a + } } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 91f96f5718f7a7f2e0ce56f4dbf894d8a052630c..8932cb934d77c0c120cad8392acbbc1c049dcfa7 100644 +index f9593486e5382c629e0febd43b3d7464481f0045..28b1d0291d5ffce2606b42394ea22de7a382f9fd 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1240,7 +1240,11 @@ public abstract class Player extends LivingEntity { +@@ -1236,7 +1236,11 @@ public abstract class Player extends LivingEntity { } this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D)); diff --git a/patches/server/0194-Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/patches/server/0194-Fix-exploit-that-allowed-colored-signs-to-be-created.patch index 305249236b..98a1b490e5 100644 --- a/patches/server/0194-Fix-exploit-that-allowed-colored-signs-to-be-created.patch +++ b/patches/server/0194-Fix-exploit-that-allowed-colored-signs-to-be-created.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix exploit that allowed colored signs to be created diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e12f0af47108b09e490f2a1e51a98accfcc6bd28..f3f0229c4fbbc1c54d3472b3ee6357ff1f542a1f 100644 +index 8c2242d7e443bee26741608c65d314d8902f5765..4cbdf64b0e6271a1cf0f31d486d8fad4f941b913 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2787,9 +2787,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2775,9 +2775,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser for (int i = 0; i < list.size(); ++i) { if (this.player.isTextFilteringEnabled()) { diff --git a/patches/server/0211-Make-shield-blocking-delay-configurable.patch b/patches/server/0211-Make-shield-blocking-delay-configurable.patch index 062134ef5e..a3cdaced94 100644 --- a/patches/server/0211-Make-shield-blocking-delay-configurable.patch +++ b/patches/server/0211-Make-shield-blocking-delay-configurable.patch @@ -19,10 +19,10 @@ index a0a846a2e60bdc17537bd697137f65321c1a61d8..e1110274a9f6b8f7007537732ec8eff7 + } } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 0dc03f53c80aac91a914bea91958a6c11c4f2061..08c29388621bf460e1704f6edba59d08a12e75d0 100644 +index 4da63e5c35b1736f2d55713b39b64cc31ecbc9c9..848a000d7a959e161011b21012e5d9c438b55455 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3665,12 +3665,24 @@ public abstract class LivingEntity extends Entity { +@@ -3668,12 +3668,24 @@ public abstract class LivingEntity extends Entity { if (this.isUsingItem() && !this.useItem.isEmpty()) { Item item = this.useItem.getItem(); diff --git a/patches/server/0213-PlayerReadyArrowEvent.patch b/patches/server/0213-PlayerReadyArrowEvent.patch index eb576cec03..8b83871bd8 100644 --- a/patches/server/0213-PlayerReadyArrowEvent.patch +++ b/patches/server/0213-PlayerReadyArrowEvent.patch @@ -7,10 +7,10 @@ Called when a player is firing a bow and the server is choosing an arrow to use. Plugins can skip selection of certain arrows and control which is used. diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 8932cb934d77c0c120cad8392acbbc1c049dcfa7..543a1c9bc5aa97262424758c69cb28127fa0ee75 100644 +index 28b1d0291d5ffce2606b42394ea22de7a382f9fd..ce8b5394f418583608bb8965c058660264ddf66c 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -2186,6 +2186,17 @@ public abstract class Player extends LivingEntity { +@@ -2182,6 +2182,17 @@ public abstract class Player extends LivingEntity { return ImmutableList.of(Pose.STANDING, Pose.CROUCHING, Pose.SWIMMING); } @@ -28,7 +28,7 @@ index 8932cb934d77c0c120cad8392acbbc1c049dcfa7..543a1c9bc5aa97262424758c69cb2812 @Override public ItemStack getProjectile(ItemStack stack) { if (!(stack.getItem() instanceof ProjectileWeaponItem)) { -@@ -2202,7 +2213,7 @@ public abstract class Player extends LivingEntity { +@@ -2198,7 +2209,7 @@ public abstract class Player extends LivingEntity { for (int i = 0; i < this.inventory.getContainerSize(); ++i) { ItemStack itemstack2 = this.inventory.getItem(i); diff --git a/patches/server/0214-Implement-EntityKnockbackByEntityEvent.patch b/patches/server/0214-Implement-EntityKnockbackByEntityEvent.patch index 50cd53aa9c..0e6b10bf7b 100644 --- a/patches/server/0214-Implement-EntityKnockbackByEntityEvent.patch +++ b/patches/server/0214-Implement-EntityKnockbackByEntityEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement EntityKnockbackByEntityEvent This event is called when an entity receives knockback by another entity. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 08c29388621bf460e1704f6edba59d08a12e75d0..7bb2ce6b378547d593f8487626b5a4d4b3361397 100644 +index 848a000d7a959e161011b21012e5d9c438b55455..ab34cf7d603ba0fd8624db821b2c0e9e22286c63 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -1437,7 +1437,7 @@ public abstract class LivingEntity extends Entity { @@ -27,7 +27,7 @@ index 08c29388621bf460e1704f6edba59d08a12e75d0..7bb2ce6b378547d593f8487626b5a4d4 } private boolean checkTotemDeathProtection(DamageSource source) { -@@ -1733,6 +1733,11 @@ public abstract class LivingEntity extends Entity { +@@ -1737,6 +1737,11 @@ public abstract class LivingEntity extends Entity { } public void knockback(double strength, double x, double z) { @@ -39,7 +39,7 @@ index 08c29388621bf460e1704f6edba59d08a12e75d0..7bb2ce6b378547d593f8487626b5a4d4 strength *= 1.0D - this.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE); if (strength > 0.0D) { this.hasImpulse = true; -@@ -1740,6 +1745,15 @@ public abstract class LivingEntity extends Entity { +@@ -1744,6 +1749,15 @@ public abstract class LivingEntity extends Entity { Vec3 vec3d1 = (new Vec3(x, 0.0D, z)).normalize().scale(strength); this.setDeltaMovement(vec3d.x / 2.0D - vec3d1.x, this.onGround ? Math.min(0.4D, vec3d.y / 2.0D + strength) : vec3d.y, vec3d.z / 2.0D - vec3d1.z); @@ -56,10 +56,10 @@ index 08c29388621bf460e1704f6edba59d08a12e75d0..7bb2ce6b378547d593f8487626b5a4d4 } diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 85633cd1718783cffe03f750da1c17270eeb4cdd..5595150b0da580fce4d5d23993d77314e225ad58 100644 +index 6b18d4dd869b442f06a7e9ae690edd5ff5227cbb..e9e89608c4b77868fed92717c837db76d6bb5a54 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1532,7 +1532,7 @@ public abstract class Mob extends LivingEntity { +@@ -1533,7 +1533,7 @@ public abstract class Mob extends LivingEntity { if (flag) { if (f1 > 0.0F && target instanceof LivingEntity) { @@ -69,10 +69,10 @@ index 85633cd1718783cffe03f750da1c17270eeb4cdd..5595150b0da580fce4d5d23993d77314 } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 543a1c9bc5aa97262424758c69cb28127fa0ee75..022bff6ac8ed5f2da438929c5ac455505bb16da7 100644 +index ce8b5394f418583608bb8965c058660264ddf66c..3db5b3adb9fe4a1682b0a4e75ae3e1f6febb7822 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1234,7 +1234,7 @@ public abstract class Player extends LivingEntity { +@@ -1230,7 +1230,7 @@ public abstract class Player extends LivingEntity { if (flag5) { if (i > 0) { if (target instanceof LivingEntity) { @@ -81,7 +81,7 @@ index 543a1c9bc5aa97262424758c69cb28127fa0ee75..022bff6ac8ed5f2da438929c5ac45550 } else { target.push((double) (-Mth.sin(this.getYRot() * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (Mth.cos(this.getYRot() * 0.017453292F) * (float) i * 0.5F)); } -@@ -1258,7 +1258,7 @@ public abstract class Player extends LivingEntity { +@@ -1254,7 +1254,7 @@ public abstract class Player extends LivingEntity { if (entityliving != this && entityliving != target && !this.isAlliedTo(entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) { // CraftBukkit start - Only apply knockback if the damage hits if (entityliving.hurt(DamageSource.playerAttack(this).sweep(), f4)) { diff --git a/patches/server/0220-InventoryCloseEvent-Reason-API.patch b/patches/server/0220-InventoryCloseEvent-Reason-API.patch index fec00ee185..a7a5d7a826 100644 --- a/patches/server/0220-InventoryCloseEvent-Reason-API.patch +++ b/patches/server/0220-InventoryCloseEvent-Reason-API.patch @@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 9fb3998a9fc8ce6ffd50e800dccc331df5ab86df..4d816f0b2225677b31f39730ac13dcea28f55520 100644 +index 673af9a823d7b16c6dd37a3db700aba676fb5585..eaaf2887bfeccb18fc2b011ba39180ee6b7838a5 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1055,7 +1055,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -29,10 +29,10 @@ index 9fb3998a9fc8ce6ffd50e800dccc331df5ab86df..4d816f0b2225677b31f39730ac13dcea } // 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 73fa8277ab107ef0ec690d81caac0e98535a3110..47f1a0e409f42e6694f143ce340eda7bb6a359c2 100644 +index fb42d7e3a1a23c02e8fd2cc04e6986ead581018c..2c32d7c37d7d9b9c12c5af3a9af576ac88618049 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -602,7 +602,7 @@ public class ServerPlayer extends Player { +@@ -598,7 +598,7 @@ public class ServerPlayer extends Player { } // Paper end if (!this.level.isClientSide && !this.containerMenu.stillValid(this)) { @@ -41,7 +41,7 @@ index 73fa8277ab107ef0ec690d81caac0e98535a3110..47f1a0e409f42e6694f143ce340eda7b this.containerMenu = this.inventoryMenu; } -@@ -754,7 +754,7 @@ public class ServerPlayer extends Player { +@@ -750,7 +750,7 @@ public class ServerPlayer extends Player { // SPIGOT-943 - only call if they have an inventory open if (this.containerMenu != this.inventoryMenu) { @@ -50,7 +50,7 @@ index 73fa8277ab107ef0ec690d81caac0e98535a3110..47f1a0e409f42e6694f143ce340eda7b } net.kyori.adventure.text.Component deathMessage = event.deathMessage() != null ? event.deathMessage() : net.kyori.adventure.text.Component.empty(); // Paper - Adventure -@@ -1341,7 +1341,7 @@ public class ServerPlayer extends Player { +@@ -1337,7 +1337,7 @@ public class ServerPlayer extends Player { return OptionalInt.empty(); } else { if (this.containerMenu != this.inventoryMenu) { @@ -59,7 +59,7 @@ index 73fa8277ab107ef0ec690d81caac0e98535a3110..47f1a0e409f42e6694f143ce340eda7b } this.nextContainerCounter(); -@@ -1401,7 +1401,7 @@ public class ServerPlayer extends Player { +@@ -1397,7 +1397,7 @@ public class ServerPlayer extends Player { } // CraftBukkit end if (this.containerMenu != this.inventoryMenu) { @@ -68,7 +68,7 @@ index 73fa8277ab107ef0ec690d81caac0e98535a3110..47f1a0e409f42e6694f143ce340eda7b } // this.nextContainerCounter(); // CraftBukkit - moved up -@@ -1430,7 +1430,13 @@ public class ServerPlayer extends Player { +@@ -1426,7 +1426,13 @@ public class ServerPlayer extends Player { @Override public void closeContainer() { @@ -84,10 +84,10 @@ index 73fa8277ab107ef0ec690d81caac0e98535a3110..47f1a0e409f42e6694f143ce340eda7b this.doCloseContainer(); } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f3f0229c4fbbc1c54d3472b3ee6357ff1f542a1f..f07dcd1b01780b2980e021a008e8fc506bc2b3d7 100644 +index 4cbdf64b0e6271a1cf0f31d486d8fad4f941b913..897a950a5a0b669aff05387efb9c403764a0e8ea 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -188,6 +188,7 @@ import org.bukkit.event.inventory.ClickType; +@@ -187,6 +187,7 @@ import org.bukkit.event.inventory.ClickType; import org.bukkit.event.inventory.CraftItemEvent; import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryClickEvent; @@ -95,7 +95,7 @@ index f3f0229c4fbbc1c54d3472b3ee6357ff1f542a1f..f07dcd1b01780b2980e021a008e8fc50 import org.bukkit.event.inventory.InventoryCreativeEvent; import org.bukkit.event.inventory.InventoryType.SlotType; import org.bukkit.event.inventory.SmithItemEvent; -@@ -2333,10 +2334,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2320,10 +2321,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @Override public void handleContainerClose(ServerboundContainerClosePacket packet) { @@ -114,10 +114,10 @@ index f3f0229c4fbbc1c54d3472b3ee6357ff1f542a1f..f07dcd1b01780b2980e021a008e8fc50 this.player.doCloseContainer(); } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 9f27c6fa106a11ea56a4be2d41f8a00f2aa4961f..a68e342112002782560268350b88f617b9bf86e1 100644 +index 1ae11a88b2ab49c13155e2cf41252c8716f30b96..8be7cf4533792315965c4e227b0ef73d06c0577a 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -500,7 +500,7 @@ public abstract class PlayerList { +@@ -502,7 +502,7 @@ public abstract class PlayerList { // CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it // See SPIGOT-5799, SPIGOT-6145 if (entityplayer.containerMenu != entityplayer.inventoryMenu) { @@ -127,7 +127,7 @@ index 9f27c6fa106a11ea56a4be2d41f8a00f2aa4961f..a68e342112002782560268350b88f617 PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 022bff6ac8ed5f2da438929c5ac455505bb16da7..1a7bd2462bab95fa6986cef705e5e5b82da30063 100644 +index 3db5b3adb9fe4a1682b0a4e75ae3e1f6febb7822..5dc5c12f341282f296082ce9c972808b8f155b1d 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -264,7 +264,7 @@ public abstract class Player extends LivingEntity { @@ -154,7 +154,7 @@ index 022bff6ac8ed5f2da438929c5ac455505bb16da7..1a7bd2462bab95fa6986cef705e5e5b8 this.containerMenu = this.inventoryMenu; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index c839ea0b68fbdccfb7ed667c705a3f0f347fd89c..43cee8b0b2b94d6db6303a1631731ed515eb806d 100644 +index f1b1d1881d0598503a7ec1022ef5e00f848fb247..a9f8ffa1772de39c74394f8cf324ab77ff4e0450 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -373,7 +373,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -185,7 +185,7 @@ index c839ea0b68fbdccfb7ed667c705a3f0f347fd89c..43cee8b0b2b94d6db6303a1631731ed5 @Override public boolean isBlocking() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 60b8d4f974952c131c94c0dd23e44e28135beff9..1800119160d5711b694c14e9dde175b11c06ce61 100644 +index c674ff33ebbb7e214205b3521d414a0442a46cbb..295f82fcdc42103e99bb5c0ab472388f83ac5646 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -921,7 +921,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -198,7 +198,7 @@ index 60b8d4f974952c131c94c0dd23e44e28135beff9..1800119160d5711b694c14e9dde175b1 // Check if the fromWorld and toWorld are the same. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index deb331a95d1c8e53c21e2ab68f205c2427cdbef4..378e09eca16738bce048837752149f212a6e2cc3 100644 +index aa1487318dd8c3287c32817e71920cc2ac931cdf..e9a7c4a29491b4281f7c96c002bf405b10eb97a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1170,7 +1170,7 @@ public class CraftEventFactory { diff --git a/patches/server/0222-Refresh-player-inventory-when-cancelling-PlayerInter.patch b/patches/server/0222-Refresh-player-inventory-when-cancelling-PlayerInter.patch index 6c17e108c9..4bad4fa0b6 100644 --- a/patches/server/0222-Refresh-player-inventory-when-cancelling-PlayerInter.patch +++ b/patches/server/0222-Refresh-player-inventory-when-cancelling-PlayerInter.patch @@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is cancelled to avoid this problem. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 832233eea019b9a10b182ef1a2a072ece4b88ee4..f8787bda0652affef90300e334200c34db6b1675 100644 +index 897a950a5a0b669aff05387efb9c403764a0e8ea..857fa3a4f2d5afd27df7ce943359705b3ea131d3 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2218,6 +2218,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2205,6 +2205,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } if (event.isCancelled()) { diff --git a/patches/server/0232-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/patches/server/0232-Option-to-prevent-armor-stands-from-doing-entity-loo.patch index ecfe3af822..e24e15c8fe 100644 --- a/patches/server/0232-Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/patches/server/0232-Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -31,10 +31,10 @@ index 6d717d3852afb3a3a4bef30c68980c402bdfefff..b47b1215e685c453c3496439bb350a91 for (int i = 0; i < list.size(); ++i) { diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 45a9c7d5b8999d1abd7f5ef805f068f5b532dcfa..00e6ad6ce3bc8e4542284f426fd601abb669b57d 100644 +index e83ad85f2350da4a01fd0c848a821d556c7ea9b2..a84c8e135511eed9db5895bdf7fc68b3952a5521 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -767,6 +767,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -772,6 +772,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // Paper end } } diff --git a/patches/server/0233-Vanished-players-don-t-have-rights.patch b/patches/server/0233-Vanished-players-don-t-have-rights.patch index 0d00e2dc44..530f282134 100644 --- a/patches/server/0233-Vanished-players-don-t-have-rights.patch +++ b/patches/server/0233-Vanished-players-don-t-have-rights.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Vanished players don't have rights diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index c25cb17ef1a7c56e10ce3ccb5665c9dce3e6efa6..30118ff975da9491fa41db2133d217c2a797a8e3 100644 +index b09f52330b50879d5594b21302e70ca676b60951..d7d4aa7ed2f321df8099adb97a3c699ed38ae6fc 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java @@ -209,7 +209,14 @@ public abstract class Projectile extends Entity { @@ -38,7 +38,7 @@ index 86d245c9a817be5fd2be7f331d3a3a5f3169e8c2..44b28773fe8e79931e738d493bd9405e BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), context.getClickedPos()), player, CraftBlockData.fromData(state), defaultReturn); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 2d13cbfb5e4ea359106fc008f203b104a179b9c0..f820232e037fa05f7d666fddac6ad1b8b18b04e0 100644 +index a84c8e135511eed9db5895bdf7fc68b3952a5521..1fef077a6d5efc8bdc171b5c6e2a49129f8589ce 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -71,6 +71,10 @@ import net.minecraft.world.level.saveddata.maps.MapItemSavedData; @@ -52,7 +52,7 @@ index 2d13cbfb5e4ea359106fc008f203b104a179b9c0..f820232e037fa05f7d666fddac6ad1b8 import net.minecraft.world.scores.Scoreboard; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -248,6 +252,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -249,6 +253,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable { this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); } @@ -99,7 +99,7 @@ index 2d13cbfb5e4ea359106fc008f203b104a179b9c0..f820232e037fa05f7d666fddac6ad1b8 public boolean isClientSide() { return this.isClientSide; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 378e09eca16738bce048837752149f212a6e2cc3..4e5128629ccbb884d88b369be5010e6b20763707 100644 +index e9a7c4a29491b4281f7c96c002bf405b10eb97a2..5d2e1c12feac542463edc7b0e44501c241812310 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1206,6 +1206,14 @@ public class CraftEventFactory { diff --git a/patches/server/0236-Don-t-call-getItemMeta-on-hasItemMeta.patch b/patches/server/0236-Don-t-call-getItemMeta-on-hasItemMeta.patch index d86eef41ce..4cbca43b72 100644 --- a/patches/server/0236-Don-t-call-getItemMeta-on-hasItemMeta.patch +++ b/patches/server/0236-Don-t-call-getItemMeta-on-hasItemMeta.patch @@ -11,10 +11,10 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set. Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 982da5f98601c6b3095d78e69e02554640708c64..fa6819fe0eaf52a1f7182ffb775e0a210530aa9b 100644 +index efdcccac85626835ff29ed00976978d5bb900356..b3acc23d54c593b599517a481ad6ac86e5661fa2 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -@@ -571,7 +571,7 @@ public final class CraftItemStack extends ItemStack { +@@ -574,7 +574,7 @@ public final class CraftItemStack extends ItemStack { @Override public boolean hasItemMeta() { @@ -24,10 +24,10 @@ index 982da5f98601c6b3095d78e69e02554640708c64..fa6819fe0eaf52a1f7182ffb775e0a21 static boolean hasItemMeta(net.minecraft.world.item.ItemStack item) { diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index b0bb30aebdba99a8fa929ec3c56e46b59d2467c9..34eba991c838950c16d565ef6c767bd6a6159bdc 100644 +index f3a0578f53863dd0866b4c2cb957a30fa3bc6cc5..44bc92bea0fa0742ef861e16eba3e57d9c6e49ce 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -@@ -97,6 +97,34 @@ public class ItemMetaTest extends AbstractTestingBase { +@@ -99,6 +99,34 @@ public class ItemMetaTest extends AbstractTestingBase { assertThat(itemMeta.hasConflictingEnchant(null), is(false)); } diff --git a/patches/server/0239-Add-hand-to-bucket-events.patch b/patches/server/0239-Add-hand-to-bucket-events.patch index 5dfb7deb05..a07a433923 100644 --- a/patches/server/0239-Add-hand-to-bucket-events.patch +++ b/patches/server/0239-Add-hand-to-bucket-events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add hand to bucket events diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index d1c1cf5061f9294d67086b5361166e940536a8a0..e9b1d967f5e97ec9a85465e8cfbcac98020d5ecc 100644 +index eaaf2887bfeccb18fc2b011ba39180ee6b7838a5..9eca5fc914400c1118927cd4424b3eed9f8ed8dc 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1413,15 +1413,17 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -49,10 +49,10 @@ index fe90b59a71b85afd3f4b5f7c4d4ba66ed74a05df..c9dcbc2dcb2736d0f448496c67121db2 if (event.isCancelled()) { return InteractionResult.PASS; diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -index f6aa7ac23288c67178e22b194f831d337dd4dda0..580f3e8de2e10ddc01430e84fc42e243736c4810 100644 +index 454e07a47d35b8dc8e5f1fb38da74669b4f7cdc7..15787afad42f9299638a1c9e57d26678805f18ee 100644 --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -@@ -166,7 +166,7 @@ public class Goat extends Animal { +@@ -180,7 +180,7 @@ public class Goat extends Animal { if (itemstack.is(Items.BUCKET) && !this.isBaby()) { // CraftBukkit start - Got milk? @@ -117,10 +117,10 @@ index 24272b384b96bb98a8231fe8583f404ad0c96de5..7c3e94c6bf8337ef660473d8ed451606 int i = blockposition.getX(); int j = blockposition.getY(); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index a74895271378571583e33c8d3992f2eb863b5a40..c9e6dd18193c7dc2ae76f688e6bbf9463a1149c7 100644 +index 1fef077a6d5efc8bdc171b5c6e2a49129f8589ce..ac46dac8be79953720fab6485caf677f2c3ad87b 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -291,6 +291,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -292,6 +292,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return true; } // Paper end @@ -139,7 +139,7 @@ index a74895271378571583e33c8d3992f2eb863b5a40..c9e6dd18193c7dc2ae76f688e6bbf946 public boolean isClientSide() { return this.isClientSide; diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index be667bb12e1ee186b8d9ad1d7ac4534454d0e787..cf6bcbe7d75a52fe509e3b6c6c24b64bf9d460ad 100644 +index f208239b69dbd8788b799d8b28e457017edef9d5..4ce706eed9e1a96b6f9be9b8e4c5283d575ab671 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java @@ -580,3 +580,4 @@ public final class NaturalSpawner { @@ -148,7 +148,7 @@ index be667bb12e1ee186b8d9ad1d7ac4534454d0e787..cf6bcbe7d75a52fe509e3b6c6c24b64b } + diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 4e5128629ccbb884d88b369be5010e6b20763707..8f44cabc1a92dc3e9afe988b23ac982e85d49fc8 100644 +index 5d2e1c12feac542463edc7b0e44501c241812310..52597fe89ed9bb42dcd74f8e9a9d80e1644b2dca 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -222,7 +222,7 @@ public class CraftEventFactory { diff --git a/patches/server/0241-Break-up-and-make-tab-spam-limits-configurable.patch b/patches/server/0241-Break-up-and-make-tab-spam-limits-configurable.patch index 34c79ced0d..64703fe4cf 100644 --- a/patches/server/0241-Break-up-and-make-tab-spam-limits-configurable.patch +++ b/patches/server/0241-Break-up-and-make-tab-spam-limits-configurable.patch @@ -45,10 +45,10 @@ index 77a03abd59db4a43f6f2d59d4c7ef176e782f205..bd508025b771424c942fd856c31d520b + } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f8787bda0652affef90300e334200c34db6b1675..eb52ca159e895608a6a662821f14910970759dd2 100644 +index 857fa3a4f2d5afd27df7ce943359705b3ea131d3..265d147de39e306fac27913b2dc3899e82c63796 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -228,6 +228,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -227,6 +227,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private long keepAliveChallenge; // CraftBukkit start - multithreaded fields private AtomicInteger chatSpamTickCount = new AtomicInteger(); @@ -56,7 +56,7 @@ index f8787bda0652affef90300e334200c34db6b1675..eb52ca159e895608a6a662821f149109 // CraftBukkit end private int dropSpamTickCount; private double firstGoodX; -@@ -360,6 +361,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -359,6 +360,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.server.getProfiler().pop(); // CraftBukkit start for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; @@ -64,7 +64,7 @@ index f8787bda0652affef90300e334200c34db6b1675..eb52ca159e895608a6a662821f149109 /* Use thread-safe field access instead if (this.chatSpamTickCount > 0) { --this.chatSpamTickCount; -@@ -706,7 +708,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -705,7 +707,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { // PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); // Paper - run this async // CraftBukkit start diff --git a/patches/server/0243-Fix-client-rendering-skulls-from-same-user.patch b/patches/server/0243-Fix-client-rendering-skulls-from-same-user.patch index 760f7cabf8..ac7687061a 100644 --- a/patches/server/0243-Fix-client-rendering-skulls-from-same-user.patch +++ b/patches/server/0243-Fix-client-rendering-skulls-from-same-user.patch @@ -12,10 +12,10 @@ This allows the client to render multiple skull textures from the same user, for when different skins were used when skull was made. diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -index e38e53bd39c384bac4d7111e6a2c721744a122f1..70fb9001b12b105fbf471bd0127d8414e03f9329 100644 +index b10cf0c5800397520f57c0bbc88a52e52db6a4c8..e3b80334164ba48e83cca0b9a7f3a8ddf05dd598 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -@@ -472,9 +472,18 @@ public class FriendlyByteBuf extends ByteBuf { +@@ -497,9 +497,18 @@ public class FriendlyByteBuf extends ByteBuf { if (item.canBeDepleted() || item.shouldOverrideMultiplayerNbt()) { // Spigot start - filter stack = stack.copy(); @@ -35,7 +35,7 @@ index e38e53bd39c384bac4d7111e6a2c721744a122f1..70fb9001b12b105fbf471bd0127d8414 } this.writeNbt(nbttagcompound); -@@ -494,7 +503,16 @@ public class FriendlyByteBuf extends ByteBuf { +@@ -519,7 +528,16 @@ public class FriendlyByteBuf extends ByteBuf { itemstack.setTag(this.readNbt()); // CraftBukkit start if (itemstack.getTag() != null) { @@ -66,18 +66,18 @@ index 3bdb09ab00ec05ed532a0c26b9fd321e1f05c1a0..1451a98d69b185dd15a2d1d7681bcecb } diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java -index eaf586eb386e13e954bc593f6ddbc45929cec204..172413fc0f303d5e15bc2bc55c09ce4faf5298a0 100644 +index 836c52bfc170788553b639e9a8a82f3f21be670b..6381544b0038de9a09c01238638e4e127e4eddc6 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java -@@ -10,6 +10,7 @@ import java.util.function.Consumer; - import javax.annotation.Nullable; +@@ -11,6 +11,7 @@ import javax.annotation.Nullable; + import net.minecraft.Util; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.ListTag; import net.minecraft.nbt.NbtUtils; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; import net.minecraft.server.players.GameProfileCache; -@@ -91,9 +92,37 @@ public class SkullBlockEntity extends BlockEntity { +@@ -95,9 +96,37 @@ public class SkullBlockEntity extends BlockEntity { @Nullable @Override public ClientboundBlockEntityDataPacket getUpdatePacket() { diff --git a/patches/server/0244-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/patches/server/0244-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index 9e3b69e6ec..9c422e313b 100644 --- a/patches/server/0244-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/patches/server/0244-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -8,10 +8,10 @@ Add -Ddebug.entities=true to your JVM flags to gain more information 1.17: Needs to be reworked for new entity storage system diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 94c5577a887ab4801dae5a1a0accd4b2f448bcc2..b794922eeccc845632f2442a3ed923f1d826a9e1 100644 +index 919a489a5c7b338659c62ae67fc0a6ceee9dcdf9..db4dac607cf24d3d2cd407255c60678ae4be1a1b 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1156,6 +1156,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1157,6 +1157,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } else { ChunkMap.TrackedEntity playerchunkmap_entitytracker = new ChunkMap.TrackedEntity(entity, i, j, entitytypes.trackDeltas()); @@ -19,7 +19,7 @@ index 94c5577a887ab4801dae5a1a0accd4b2f448bcc2..b794922eeccc845632f2442a3ed923f1 this.entityMap.put(entity.getId(), playerchunkmap_entitytracker); playerchunkmap_entitytracker.updatePlayers(this.level.players()); if (entity instanceof ServerPlayer) { -@@ -1198,7 +1199,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1199,7 +1200,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (playerchunkmap_entitytracker1 != null) { playerchunkmap_entitytracker1.broadcastRemoved(); } @@ -29,7 +29,7 @@ index 94c5577a887ab4801dae5a1a0accd4b2f448bcc2..b794922eeccc845632f2442a3ed923f1 protected void tick() { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 4df153a3b2cc4b6be499107a997a054abe3569d8..774f37e02feb83be3b92620aa4a0227a0c4acc93 100644 +index 9eca5fc914400c1118927cd4424b3eed9f8ed8dc..a33bed2282acba9df7d5d1b38bdab4fe984af2ee 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -202,6 +202,9 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -72,7 +72,7 @@ index 4df153a3b2cc4b6be499107a997a054abe3569d8..774f37e02feb83be3b92620aa4a0227a return false; } else { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a6ba0c7fe05aae72b98072aaa008a1346bf2704e..2138db2c7dc750cc9c2eb49b7878e4f172fb97e5 100644 +index 34bf0fd30a0a3549b35659d65edfe78a4e6e8fd4..35f83b559002886b8728297eb9fecc7588bdc950 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -171,6 +171,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -85,7 +85,7 @@ index a6ba0c7fe05aae72b98072aaa008a1346bf2704e..2138db2c7dc750cc9c2eb49b7878e4f1 if (this.bukkitEntity == null) { this.bukkitEntity = CraftEntity.getEntity(this.level.getCraftServer(), this); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index f354fe35c7fb4b869c9229b14a2cb6b00c7f0973..7bcb67df44a231d9b598a57c1b10bec18823bf74 100644 +index ac46dac8be79953720fab6485caf677f2c3ad87b..de4768e0c1d3665fa22ec1d32596283e778b3961 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -141,6 +141,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -94,8 +94,8 @@ index f354fe35c7fb4b869c9229b14a2cb6b00c7f0973..7bcb67df44a231d9b598a57c1b10bec1 public org.bukkit.generator.ChunkGenerator generator; + public static final boolean DEBUG_ENTITIES = Boolean.getBoolean("debug.entities"); // Paper + public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710 public boolean captureBlockStates = false; - public boolean captureTreeGeneration = false; diff --git a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java index c8cf7da4224dccd9b9e8a73bcfc3ff5babfb8f8c..1d04f35b6755b3a7ee77f93c1a30513a5af7d6cf 100644 --- a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java diff --git a/patches/server/0245-Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/0245-Add-Early-Warning-Feature-to-WatchDog.patch index 49b0467e88..0dfece702c 100644 --- a/patches/server/0245-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/patches/server/0245-Add-Early-Warning-Feature-to-WatchDog.patch @@ -36,10 +36,10 @@ index bd508025b771424c942fd856c31d520b6f548082..62621562137cba4804f0465c58d25ca2 public static int tabSpamLimit = 500; private static void tabSpamLimiters() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d82015cd355a3450faf4cf3eb0f1a1cb10119c77..a7244e66b7bbf2b474304ab41ad31a606ab6ba9c 100644 +index 2bbed2eb8f992764deac2cd5e08471aa0f967606..d0d524bfe7ae90f6d2edefa4063bf009cddee17b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1076,6 +1076,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return true; }); - this.flushWorker(); + this.level.asyncChunkTaskManager.flush(); // Paper - flush to preserve behavior compat with pre-async behaviour +// this.i(); // Paper - nuke IOWorker - ChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.storageFolder.getName()); } else { this.visibleChunkMap.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).forEach((playerchunk) -> { -@@ -458,16 +460,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + ChunkAccess ichunkaccess = (ChunkAccess) playerchunk.getChunkToSave().getNow(null); // CraftBukkit - decompile error +@@ -459,16 +461,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } @@ -2387,7 +2387,7 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1 } gameprofilerfiller.pop(); -@@ -488,12 +494,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -489,12 +495,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (playerchunk != null) { this.pendingUnloads.put(j, playerchunk); this.modified = true; @@ -2402,7 +2402,7 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1 } } activityAccountant.endActivity(); // Spigot -@@ -507,6 +514,46 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -508,6 +515,46 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } @@ -2449,7 +2449,7 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1 private void scheduleUnload(long pos, ChunkHolder holder) { CompletableFuture completablefuture = holder.getChunkToSave(); Consumer consumer = (ichunkaccess) -> { // CraftBukkit - decompile error -@@ -520,7 +567,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -521,7 +568,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ((LevelChunk) ichunkaccess).setLoaded(false); } @@ -2467,7 +2467,7 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1 if (this.entitiesInLevel.remove(pos) && ichunkaccess instanceof LevelChunk) { LevelChunk chunk = (LevelChunk) ichunkaccess; -@@ -581,19 +637,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -582,19 +638,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } private CompletableFuture> scheduleChunkLoad(ChunkPos pos) { @@ -2500,7 +2500,7 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1 this.markPosition(pos, protochunk.getStatus().getChunkType()); return Either.left(protochunk); -@@ -616,7 +676,32 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -617,7 +677,32 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.markPositionReplaceable(pos); return Either.left(new ProtoChunk(pos, UpgradeData.EMPTY, this.level)); @@ -2534,7 +2534,7 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1 } private void markPositionReplaceable(ChunkPos chunkcoordintpair) { -@@ -798,6 +883,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -799,6 +884,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public boolean save(ChunkAccess chunk) { @@ -2542,7 +2542,7 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1 this.poiManager.flush(chunk.getPos()); if (!chunk.isUnsaved()) { return false; -@@ -809,7 +895,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -810,7 +896,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ChunkStatus chunkstatus = chunk.getStatus(); if (chunkstatus.getChunkType() != ChunkStatus.ChunkType.LEVELCHUNK) { @@ -2551,7 +2551,7 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1 return false; } -@@ -819,9 +905,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -820,9 +906,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } this.level.getProfiler().incrementCounter("chunkSave"); @@ -2570,7 +2570,7 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1 this.markPosition(chunkcoordintpair, chunkstatus.getChunkType()); return true; } catch (Exception exception) { -@@ -830,6 +923,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -831,6 +924,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return false; } } @@ -2578,7 +2578,7 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1 } private boolean isExistingChunkFull(ChunkPos chunkcoordintpair) { -@@ -957,6 +1051,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -958,6 +1052,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } } @@ -2614,7 +2614,7 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1 @Nullable private CompoundTag readChunk(ChunkPos pos) throws IOException { CompoundTag nbttagcompound = this.read(pos); -@@ -1311,6 +1434,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1312,6 +1435,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } @@ -2623,10 +2623,10 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1 return this.poiManager; } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 03c90069e8fca2291e66f5d99175f029530a4434..1176dd8ebd59c5bda1b74c532ca21ae335078805 100644 +index 6757971ee556da2470de8b4579d906452acd36fe..68b618168c8c484e3902561f290adaa6568551c1 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -323,10 +323,128 @@ public class ServerChunkCache extends ChunkSource { +@@ -322,10 +322,128 @@ public class ServerChunkCache extends ChunkSource { return ret; } // Paper end @@ -2755,7 +2755,7 @@ index 03c90069e8fca2291e66f5d99175f029530a4434..1176dd8ebd59c5bda1b74c532ca21ae3 if (Thread.currentThread() != this.mainThread) { return (ChunkAccess) CompletableFuture.supplyAsync(() -> { return this.getChunk(x, z, leastStatus, create); -@@ -349,13 +467,18 @@ public class ServerChunkCache extends ChunkSource { +@@ -348,13 +466,18 @@ public class ServerChunkCache extends ChunkSource { } gameprofilerfiller.incrementCounter("getChunkCacheMiss"); @@ -2775,7 +2775,7 @@ index 03c90069e8fca2291e66f5d99175f029530a4434..1176dd8ebd59c5bda1b74c532ca21ae3 this.level.timings.syncChunkLoad.stopTiming(); // Paper } // Paper ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { -@@ -442,6 +565,11 @@ public class ServerChunkCache extends ChunkSource { +@@ -441,6 +564,11 @@ public class ServerChunkCache extends ChunkSource { } private CompletableFuture> getChunkFutureMainThread(int i, int j, ChunkStatus chunkstatus, boolean flag) { @@ -2787,7 +2787,7 @@ index 03c90069e8fca2291e66f5d99175f029530a4434..1176dd8ebd59c5bda1b74c532ca21ae3 ChunkPos chunkcoordintpair = new ChunkPos(i, j); long k = chunkcoordintpair.toLong(); int l = 33 + ChunkStatus.getDistance(chunkstatus); -@@ -830,11 +958,12 @@ public class ServerChunkCache extends ChunkSource { +@@ -837,11 +965,12 @@ public class ServerChunkCache extends ChunkSource { // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task public boolean pollTask() { try { @@ -2802,7 +2802,7 @@ index 03c90069e8fca2291e66f5d99175f029530a4434..1176dd8ebd59c5bda1b74c532ca21ae3 } finally { chunkMap.callbackExecutor.run(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 70e4e10ee3f3ace590881a9284160324ad882243..ab4dba5af019b60cbb82360eae7f6008aafcd38c 100644 +index a33bed2282acba9df7d5d1b38bdab4fe984af2ee..863981519bf0c62c00484cf9ee6d7ff1ea8ed946 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -210,6 +210,79 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -2907,10 +2907,10 @@ index 0d536d72ac918fbd403397ff369d10143ee9c204..be677d437d17b74c6188ce1bd5fc6fdc private final String name; private final Comparator comparator; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 4cddb545fded4a7dc543f523902702e8b01b019c..76dfbd19e15d123d9138dc3fce12236a804ce3b6 100644 +index 265d147de39e306fac27913b2dc3899e82c63796..912171f8b3280a6c45311104216e04d661daff8a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -712,6 +712,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -711,6 +711,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser server.scheduleOnMain(() -> this.disconnect(new TranslatableComponent("disconnect.spam", new Object[0]))); // Paper return; } @@ -3019,7 +3019,7 @@ index 3af31dc2c82c11ee78d497c5777615c17cb13c7a..3b8c04f6ffd7e6c197465aa1caf633ba this.type = t; this.triggerTick = time; 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 22d5c4cc3aea19cbf53ea320765ecceb4daf7428..d126c038ae56312acc2e8be2726065d4eddb08c8 100644 +index 1b478ebfe6792a157772a5812d0daa1a3ccc4776..9e9ffb575c68c7044ab289e1f3f79ff821b30c24 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 @@ -69,7 +69,30 @@ public class ChunkSerializer { @@ -3270,7 +3270,7 @@ index 22d5c4cc3aea19cbf53ea320765ecceb4daf7428..d126c038ae56312acc2e8be2726065d4 nbttagcompound1.put("LiquidTicks", world.getLiquidTicks().save(chunkcoordintpair)); } 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 00470d96be2500a0516125771304e76dfd4268a4..6f13c7adce7d4b3d170045ea5ef2a841d34ae7b0 100644 +index 8121470cdd94bde4d84f70882f3bdb3dc067cf15..6f13c7adce7d4b3d170045ea5ef2a841d34ae7b0 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 @@ -21,27 +21,38 @@ import net.minecraft.world.level.storage.DimensionDataStorage; @@ -3355,7 +3355,7 @@ index 00470d96be2500a0516125771304e76dfd4268a4..6f13c7adce7d4b3d170045ea5ef2a841 } public void flushWorker() { -- this.worker.synchronize().join(); +- this.worker.synchronize(true).join(); + com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.flush(); // Paper - nuke IO worker } diff --git a/patches/server/0261-Add-ray-tracing-methods-to-LivingEntity.patch b/patches/server/0261-Add-ray-tracing-methods-to-LivingEntity.patch index 403365fbbd..21dbc3f1e5 100644 --- a/patches/server/0261-Add-ray-tracing-methods-to-LivingEntity.patch +++ b/patches/server/0261-Add-ray-tracing-methods-to-LivingEntity.patch @@ -28,10 +28,10 @@ index 49fd3486a6c595749f33bbe1c1bec0454e4725c5..5c290f263fc2b643987c96ea75729bf1 switch (enumDirection) { case DOWN: diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 7bb2ce6b378547d593f8487626b5a4d4b3361397..dd61eacfa417ed77bf09f482249bdd3a5a566ace 100644 +index ab34cf7d603ba0fd8624db821b2c0e9e22286c63..9c2a6fd75f4380230256d9de91082d1bfe2eb961 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3686,6 +3686,23 @@ public abstract class LivingEntity extends Entity { +@@ -3689,6 +3689,23 @@ public abstract class LivingEntity extends Entity { } // Paper start diff --git a/patches/server/0262-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0262-Expose-attack-cooldown-methods-for-Player.patch index e9b5851764..3c74fb85c4 100644 --- a/patches/server/0262-Expose-attack-cooldown-methods-for-Player.patch +++ b/patches/server/0262-Expose-attack-cooldown-methods-for-Player.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 295f82fcdc42103e99bb5c0ab472388f83ac5646..96d924299f20f96fbf94b491da0ff3f692344334 100644 +index 37d1d84d05812adb48e6116c0506f1d460de4038..abe7052b7b5c98328e4ecc1d199e911d5e9dcc2b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2233,6 +2233,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2234,6 +2234,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { connection.send(new net.minecraft.network.protocol.game.ClientboundOpenBookPacket(net.minecraft.world.InteractionHand.MAIN_HAND)); - connection.send(new net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket(0, slot, inventory.getSelected())); + connection.send(new net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket(0, stateId, slot, inventory.getSelected())); } + + @Override diff --git a/patches/server/0263-Improve-death-events.patch b/patches/server/0263-Improve-death-events.patch index d66a82af80..4f4c5fc18f 100644 --- a/patches/server/0263-Improve-death-events.patch +++ b/patches/server/0263-Improve-death-events.patch @@ -19,10 +19,10 @@ maybe more (please check patch overrides for drops for more): - players, armor stands, foxes, chested donkeys/llamas diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index b9fdccfc9815b0aec7bb5f5ad633c69b8eba6af2..df02d712e7daf1603885547995d69cb7fa3962ca 100644 +index 2c32d7c37d7d9b9c12c5af3a9af576ac88618049..b4d2b9a25ee1c407b3803d59c4fd80f793873192 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -218,6 +218,10 @@ public class ServerPlayer extends Player { +@@ -219,6 +219,10 @@ public class ServerPlayer extends Player { public int latency; public boolean wonGame; private int containerUpdateDelay; // Paper @@ -33,7 +33,7 @@ index b9fdccfc9815b0aec7bb5f5ad633c69b8eba6af2..df02d712e7daf1603885547995d69cb7 // CraftBukkit start public String displayName; -@@ -751,6 +755,15 @@ public class ServerPlayer extends Player { +@@ -747,6 +751,15 @@ public class ServerPlayer extends Player { Component defaultMessage = this.getCombatTracker().getDeathMessage(); org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, PaperAdventure.asAdventure(defaultMessage), defaultMessage.getString(), keepInventory); // Paper - Adventure @@ -49,7 +49,7 @@ index b9fdccfc9815b0aec7bb5f5ad633c69b8eba6af2..df02d712e7daf1603885547995d69cb7 // SPIGOT-943 - only call if they have an inventory open if (this.containerMenu != this.inventoryMenu) { -@@ -898,8 +911,17 @@ public class ServerPlayer extends Player { +@@ -894,8 +907,17 @@ public class ServerPlayer extends Player { } } } @@ -70,7 +70,7 @@ index b9fdccfc9815b0aec7bb5f5ad633c69b8eba6af2..df02d712e7daf1603885547995d69cb7 } } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index dd61eacfa417ed77bf09f482249bdd3a5a566ace..3e7a2e37108f07c6057d1cd0bf673b0ed162f16a 100644 +index 9c2a6fd75f4380230256d9de91082d1bfe2eb961..4e7ecdde929466120004c4e2b9848c2b0c01686a 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -261,6 +261,7 @@ public abstract class LivingEntity extends Entity { @@ -108,13 +108,17 @@ index dd61eacfa417ed77bf09f482249bdd3a5a566ace..3e7a2e37108f07c6057d1cd0bf673b0e if (this.deathScore >= 0 && entityliving != null) { entityliving.awardKillScore(this, this.deathScore, source); } -@@ -1609,20 +1609,43 @@ public abstract class LivingEntity extends Entity { +@@ -1609,24 +1609,47 @@ public abstract class LivingEntity extends Entity { if (this.isSleeping()) { this.stopSleeping(); } + */ // Paper - move down to make death event cancellable - this is the runKillTrigger below + + if (!this.level.isClientSide && this.hasCustomName()) { + LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); + } + this.dead = true; - this.getCombatTracker().recheckStatus(); + // Paper - moved into if below @@ -155,7 +159,7 @@ index dd61eacfa417ed77bf09f482249bdd3a5a566ace..3e7a2e37108f07c6057d1cd0bf673b0e } } -@@ -1630,7 +1653,7 @@ public abstract class LivingEntity extends Entity { +@@ -1634,7 +1657,7 @@ public abstract class LivingEntity extends Entity { if (!this.level.isClientSide) { boolean flag = false; @@ -164,7 +168,7 @@ index dd61eacfa417ed77bf09f482249bdd3a5a566ace..3e7a2e37108f07c6057d1cd0bf673b0e if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { BlockPos blockposition = this.blockPosition(); BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState(); -@@ -1658,7 +1681,7 @@ public abstract class LivingEntity extends Entity { +@@ -1662,7 +1685,7 @@ public abstract class LivingEntity extends Entity { } } @@ -173,7 +177,7 @@ index dd61eacfa417ed77bf09f482249bdd3a5a566ace..3e7a2e37108f07c6057d1cd0bf673b0e Entity entity = source.getEntity(); int i; -@@ -1676,15 +1699,18 @@ public abstract class LivingEntity extends Entity { +@@ -1680,15 +1703,18 @@ public abstract class LivingEntity extends Entity { this.dropCustomDeathLoot(source, i, flag); } // CraftBukkit start - Call death event @@ -193,7 +197,7 @@ index dd61eacfa417ed77bf09f482249bdd3a5a566ace..3e7a2e37108f07c6057d1cd0bf673b0e // CraftBukkit start public int getExpReward() { -@@ -1762,6 +1788,7 @@ public abstract class LivingEntity extends Entity { +@@ -1766,6 +1792,7 @@ public abstract class LivingEntity extends Entity { return SoundEvents.GENERIC_HURT; } @@ -202,7 +206,7 @@ index dd61eacfa417ed77bf09f482249bdd3a5a566ace..3e7a2e37108f07c6057d1cd0bf673b0e protected SoundEvent getDeathSound() { return SoundEvents.GENERIC_DEATH; diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java -index c1cdb1905536bda76f34ad3fc796996443839767..31f4e4a93ea5fd3ffe7e60dff2e2a9642b51daa2 100644 +index 3d15587a8c36d833283cfea0546c589287e7ed48..21274d2c8c78d8454dbfc19076a52e54876bd78d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java @@ -691,15 +691,25 @@ public class Fox extends Animal { @@ -274,7 +278,7 @@ index d545349f659b2a164a28d06e9ff0f9fff8fa8ecf..bbde9b758643c087733064a126d90689 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6950e36b5e0522ba40874d3c786e5dff2ad12fed..2502b7a78796784446b3856474492e0869c60630 100644 +index 96d924299f20f96fbf94b491da0ff3f692344334..39b307074f7addc6223a2a2212a3f92feffc4379 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1862,7 +1862,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -294,7 +298,7 @@ index 6950e36b5e0522ba40874d3c786e5dff2ad12fed..2502b7a78796784446b3856474492e08 public void injectScaledMaxHealth(Collection collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 8f44cabc1a92dc3e9afe988b23ac982e85d49fc8..9a84ac5aa03c645037daec23cc4422106a6ace1d 100644 +index 52597fe89ed9bb42dcd74f8e9a9d80e1644b2dca..cd82e2068ea87f3e596cbbd7e304654956c36ddd 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -787,9 +787,16 @@ public class CraftEventFactory { diff --git a/patches/server/0264-Allow-chests-to-be-placed-with-NBT-data.patch b/patches/server/0264-Allow-chests-to-be-placed-with-NBT-data.patch index 6ee46cdcb1..4ba4908ed9 100644 --- a/patches/server/0264-Allow-chests-to-be-placed-with-NBT-data.patch +++ b/patches/server/0264-Allow-chests-to-be-placed-with-NBT-data.patch @@ -5,17 +5,17 @@ Subject: [PATCH] Allow chests to be placed with NBT data diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index c873ceb15330e528aef31a8dcbddabe2e1164ecd..d402b73e5876600f09c509c837c77b597da988bb 100644 +index 404a9f22b3a67aa042449fa2c1a1c31095c256b9..4348ecf7ca91fc38d59365aa5560d9d24f7b0703 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -339,6 +339,7 @@ public final class ItemStack { +@@ -337,6 +337,7 @@ public final class ItemStack { enuminteractionresult = InteractionResult.FAIL; // cancel placement // PAIL: Remove this when MC-99075 fixed placeEvent.getPlayer().updateInventory(); + world.capturedTileEntities.clear(); // Paper - clear out tile entities as chests and such will pop loot // revert back all captured blocks + world.preventPoiUpdated = true; // CraftBukkit - SPIGOT-5710 for (BlockState blockstate : blocks) { - blockstate.update(true, false); diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java index f2c9755c2b55bee2a0b981313e1fcd1f8ab5e3d8..52de9852f87d346714a950b60a0004d386ac10f0 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java diff --git a/patches/server/0267-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/patches/server/0267-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index 9cd5ce0cec..7f8d0e6dc2 100644 --- a/patches/server/0267-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/patches/server/0267-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b66632bb7 100644 +index 71320d9484842be3a694117de25159f3581bd2a3..0aa7854119ab876f0e46bb7667282d79d2a57e3d 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -83,6 +83,12 @@ import org.bukkit.persistence.PersistentDataContainer; @@ -21,7 +21,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b /** * Children must include the following: * -@@ -267,6 +273,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -268,6 +274,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Specific(Specific.To.NBT) static final ItemMetaKey BLOCK_DATA = new ItemMetaKey("BlockStateTag"); static final ItemMetaKey BUKKIT_CUSTOM_TAG = new ItemMetaKey("PublicBukkitValues"); @@ -32,7 +32,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b // We store the raw original JSON representation of all text data. See SPIGOT-5063, SPIGOT-5656, SPIGOT-5304 private String displayName; -@@ -280,6 +290,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -281,6 +291,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { private int hideFlag; private boolean unbreakable; private int damage; @@ -43,7 +43,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b private static final Set HANDLED_TAGS = Sets.newHashSet(); private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); -@@ -317,6 +331,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -318,6 +332,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.hideFlag = meta.hideFlag; this.unbreakable = meta.unbreakable; this.damage = meta.damage; @@ -59,7 +59,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b this.unhandledTags.putAll(meta.unhandledTags); this.persistentDataContainer.putAll(meta.persistentDataContainer.getRaw()); -@@ -380,6 +403,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -381,6 +404,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.persistentDataContainer.put(key, compound.get(key)); } } @@ -91,7 +91,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b Set keys = tag.getAllKeys(); for (String key : keys) { -@@ -518,6 +566,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -519,6 +567,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.setDamage(damage); } @@ -126,7 +126,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b String internal = SerializableMeta.getString(map, "internal", true); if (internal != null) { ByteArrayInputStream buf = new ByteArrayInputStream(Base64.decodeBase64(internal)); -@@ -646,6 +722,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -647,6 +723,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { if (this.hasDamage()) { itemTag.putInt(DAMAGE.NBT, damage); } @@ -150,7 +150,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b for (Map.Entry e : this.unhandledTags.entrySet()) { itemTag.put(e.getKey(), e.getValue()); -@@ -662,6 +755,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -663,6 +756,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -172,7 +172,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b ListTag createStringList(List list) { if (list == null) { return null; -@@ -745,7 +853,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -746,7 +854,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Overridden boolean isEmpty() { @@ -181,7 +181,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b } // Paper start -@@ -1169,7 +1277,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1170,7 +1278,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { && (this.hideFlag == that.hideFlag) && (this.isUnbreakable() == that.isUnbreakable()) && (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage()) @@ -194,7 +194,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b } /** -@@ -1204,6 +1316,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1205,6 +1317,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { hash = 61 * hash + (this.hasDamage() ? this.damage : 0); hash = 61 * hash + (this.hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0); hash = 61 * hash + this.version; @@ -205,7 +205,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b return hash; } -@@ -1228,6 +1344,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1229,6 +1345,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { clone.unbreakable = this.unbreakable; clone.damage = this.damage; clone.version = this.version; @@ -220,7 +220,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b return clone; } catch (CloneNotSupportedException e) { throw new Error(e); -@@ -1285,6 +1409,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1286,6 +1410,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { builder.put(DAMAGE.BUKKIT, damage); } @@ -244,7 +244,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b final Map internalTags = new HashMap(this.unhandledTags); this.serializeInternal(internalTags); if (!internalTags.isEmpty()) { -@@ -1449,6 +1590,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1451,6 +1592,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { CraftMetaArmorStand.SHOW_ARMS.NBT, CraftMetaArmorStand.SMALL.NBT, CraftMetaArmorStand.MARKER.NBT, @@ -253,7 +253,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b // Paper end CraftMetaCompass.LODESTONE_DIMENSION.NBT, CraftMetaCompass.LODESTONE_POS.NBT, -@@ -1477,4 +1620,147 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1479,4 +1622,147 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } // Paper end diff --git a/patches/server/0276-Add-LivingEntity-getTargetEntity.patch b/patches/server/0276-Add-LivingEntity-getTargetEntity.patch index 2cbe1f217c..d9abf795b2 100644 --- a/patches/server/0276-Add-LivingEntity-getTargetEntity.patch +++ b/patches/server/0276-Add-LivingEntity-getTargetEntity.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 3e7a2e37108f07c6057d1cd0bf673b0ed162f16a..5e781d0af08ba7faba84ee774e87f1c0d484ae9f 100644 +index 4e7ecdde929466120004c4e2b9848c2b0c01686a..af2ab0847127c1c1c7024570fbb9a23ef33fc80a 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -116,6 +116,7 @@ import net.minecraft.world.level.storage.loot.LootTable; @@ -16,7 +16,7 @@ index 3e7a2e37108f07c6057d1cd0bf673b0ed162f16a..5e781d0af08ba7faba84ee774e87f1c0 import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; import net.minecraft.world.scores.PlayerTeam; -@@ -3730,6 +3731,38 @@ public abstract class LivingEntity extends Entity { +@@ -3733,6 +3734,38 @@ public abstract class LivingEntity extends Entity { return level.clip(raytrace); } diff --git a/patches/server/0279-Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/0279-Call-player-spectator-target-events-and-improve-impl.patch index a8da6d273d..94aced8265 100644 --- a/patches/server/0279-Call-player-spectator-target-events-and-improve-impl.patch +++ b/patches/server/0279-Call-player-spectator-target-events-and-improve-impl.patch @@ -19,10 +19,10 @@ spectate the target entity. Co-authored-by: Spottedleaf diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index df02d712e7daf1603885547995d69cb7fa3962ca..72d17bfbe0830721caa7d1fd0aa50916e75b1ed7 100644 +index b4d2b9a25ee1c407b3803d59c4fd80f793873192..924d69db24158c3cb72e2fb569a38225c9cf8f89 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1822,14 +1822,58 @@ public class ServerPlayer extends Player { +@@ -1818,14 +1818,58 @@ public class ServerPlayer extends Player { } public void setCamera(Entity entity) { diff --git a/patches/server/0284-Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/0284-Add-option-to-prevent-players-from-moving-into-unloa.patch index 02e02af31e..fb7a8ccdef 100644 --- a/patches/server/0284-Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/patches/server/0284-Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -20,10 +20,10 @@ index c17c504acdc12b6ef37d6643eb98a57fa5ca40c9..13e730b18c346934c061fb570048623a + } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 05d5d976c18149491124263b056224a384eee06d..5999417f4a357a895757e13f9b69fc970595be2e 100644 +index 912171f8b3280a6c45311104216e04d661daff8a..38a48add445e8dd6888bc5bb22e7bf5482682536 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -532,6 +532,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -531,6 +531,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } speed *= 2f; // TODO: Get the speed of the vehicle instead of the player @@ -37,7 +37,7 @@ index 05d5d976c18149491124263b056224a384eee06d..5999417f4a357a895757e13f9b69fc97 if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // CraftBukkit end ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getName().getString(), this.player.getName().getString(), d6, d7, d8); -@@ -1168,9 +1175,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1155,9 +1162,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser float prevYaw = this.player.getYRot(); float prevPitch = this.player.getXRot(); // CraftBukkit end @@ -49,7 +49,7 @@ index 05d5d976c18149491124263b056224a384eee06d..5999417f4a357a895757e13f9b69fc97 double d6 = this.player.getY(); double d7 = d0 - this.firstGoodX; double d8 = d1 - this.firstGoodY; -@@ -1208,6 +1215,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1195,6 +1202,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } else { speed = this.player.getAbilities().walkingSpeed * 10f; } diff --git a/patches/server/0285-Reset-players-airTicks-on-respawn.patch b/patches/server/0285-Reset-players-airTicks-on-respawn.patch index f58a943a60..ef7522583c 100644 --- a/patches/server/0285-Reset-players-airTicks-on-respawn.patch +++ b/patches/server/0285-Reset-players-airTicks-on-respawn.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Reset players airTicks on respawn diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 72d17bfbe0830721caa7d1fd0aa50916e75b1ed7..085bdf17a0e844ff813bf1107b686b33943659ba 100644 +index 924d69db24158c3cb72e2fb569a38225c9cf8f89..635aa1cf7343a242fb01a49f2215d2af25a09760 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2210,6 +2210,7 @@ public class ServerPlayer extends Player { +@@ -2216,6 +2216,7 @@ public class ServerPlayer extends Player { } this.setHealth(this.getMaxHealth()); diff --git a/patches/server/0287-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/patches/server/0287-Improve-Server-Thread-Pool-and-Thread-Priorities.patch index f92a992676..3eb97aa04b 100644 --- a/patches/server/0287-Improve-Server-Thread-Pool-and-Thread-Priorities.patch +++ b/patches/server/0287-Improve-Server-Thread-Pool-and-Thread-Priorities.patch @@ -67,10 +67,10 @@ index 65e0ca442980f273d2fe5f131e174cd92f80da20..81f4f26a6b83079d36acd1fd86dede0e return executorService; } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 627887227e266155c025592b50defede4271d978..b008f3360ded33b185d28ed8555839eb21bf16d9 100644 +index 7671731bee6df3766127448e0ee983970b94230e..18e272de9238c0b0cbc2182b18bfcb98f6218d17 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -318,6 +318,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> { @@ -27,7 +27,7 @@ index 0c5c62be83223e20f216df84413b8c2438db81ff..8bbf13a7aea1142b3154a1c76837a98a Connection.LOGGER.debug("Skipping packet due to errors", throwable.getCause()); } else { diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java -index b8a0c0411fd2caab21672de7f3e721645b61a8ba..c0df136c408d7f001395291d8c80da5b4b54d462 100644 +index 092d8ecf8d6a7045d2fc379bc0f9ec4ee294d056..b039a32b805fc02033fa862a1c40c4a51639e69a 100644 --- a/src/main/java/net/minecraft/network/PacketEncoder.java +++ b/src/main/java/net/minecraft/network/PacketEncoder.java @@ -54,7 +54,31 @@ public class PacketEncoder extends MessageToByteEncoder> { @@ -80,26 +80,26 @@ index 10c1f2d8a92f848c3f2be9d1d06fd254978e6dcc..74bfe0d3942259c45702b099efdc4e10 return false; } diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java -index a27d46e90ad04c624d41f6cbededcd3121dfeee8..d5ca796408f975f4f002a5b385574d3516915507 100644 +index 0e076173033278587df2b5dfbd01cc9005651eb5..a8a1ecfa349d4cb8daa1d426920988c64b392b14 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java -@@ -10,6 +10,16 @@ public class ClientboundContainerSetContentPacket implements Packet items; +@@ -31,6 +31,16 @@ public class ClientboundContainerSetContentPacket implements Packet contents) { - this.containerId = syncId; - this.items = NonNullList.withSize(contents.size(), ItemStack.EMPTY); + @Override + public void write(FriendlyByteBuf buf) { + buf.writeByte(this.containerId); diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacket.java index 1451a98d69b185dd15a2d1d7681bcecb6a4f99c1..96626835fee3c0fdb452acacdc9f737ad90c08de 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacket.java diff --git a/patches/server/0297-force-entity-dismount-during-teleportation.patch b/patches/server/0297-force-entity-dismount-during-teleportation.patch index f664096774..67e5c3d72e 100644 --- a/patches/server/0297-force-entity-dismount-during-teleportation.patch +++ b/patches/server/0297-force-entity-dismount-during-teleportation.patch @@ -20,10 +20,10 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 8e896afe43307a46ad8375ff8b35b107d2524502..eb70747ec90770752a45ddf28cf207e2281d3a37 100644 +index 635aa1cf7343a242fb01a49f2215d2af25a09760..efb759fe76540b51509029d40884eb85a31cda86 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1299,11 +1299,13 @@ public class ServerPlayer extends Player { +@@ -1295,11 +1295,13 @@ public class ServerPlayer extends Player { } } @@ -41,7 +41,7 @@ index 8e896afe43307a46ad8375ff8b35b107d2524502..eb70747ec90770752a45ddf28cf207e2 if (entity1 != entity && this.connection != null) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index ca03f791a44cc3c44f42c705fb1715826eefa664..3518044845ec400ff6c2ddf7fc7dc32f1f7769b6 100644 +index 35f83b559002886b8728297eb9fecc7588bdc950..dbf002a6967812fd58ed9bcfa615dc525586c1a0 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2239,12 +2239,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -93,10 +93,10 @@ index ca03f791a44cc3c44f42c705fb1715826eefa664..3518044845ec400ff6c2ddf7fc7dc32f if (this.valid) { Bukkit.getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 5e781d0af08ba7faba84ee774e87f1c0d484ae9f..4e366fd032cf0ac37a7a851994625b905029cd4a 100644 +index af2ab0847127c1c1c7024570fbb9a23ef33fc80a..330d72b8851e3a9fb9988117f908c561ee9c65f8 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3329,11 +3329,13 @@ public abstract class LivingEntity extends Entity { +@@ -3332,11 +3332,13 @@ public abstract class LivingEntity extends Entity { return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 4) != 0; } @@ -114,10 +114,10 @@ index 5e781d0af08ba7faba84ee774e87f1c0d484ae9f..4e366fd032cf0ac37a7a851994625b90 this.dismountVehicle(entity); } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 1a7bd2462bab95fa6986cef705e5e5b82da30063..857346b755454956268cc594bb03dc060f2a4aac 100644 +index 5dc5c12f341282f296082ce9c972808b8f155b1d..4ce8bdb30e24822273d6c608c8a2002877fa99fc 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1096,9 +1096,11 @@ public abstract class Player extends LivingEntity { +@@ -1092,9 +1092,11 @@ public abstract class Player extends LivingEntity { return -0.35D; } diff --git a/patches/server/0299-Book-Size-Limits.patch b/patches/server/0299-Book-Size-Limits.patch index 0439a6bab4..ae4429c991 100644 --- a/patches/server/0299-Book-Size-Limits.patch +++ b/patches/server/0299-Book-Size-Limits.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Book Size Limits Puts some limits on the size of books. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 11d628869a9a6eda8bf21a4f213ff23ad753b18e..8bf4d2b8c38c02d6a5b2fea37113689a252f1571 100644 +index 11d628869a9a6eda8bf21a4f213ff23ad753b18e..4c97fa63d912548324e93f366c86666d52738bfb 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -347,6 +347,13 @@ public class PaperConfig { @@ -16,7 +16,7 @@ index 11d628869a9a6eda8bf21a4f213ff23ad753b18e..8bf4d2b8c38c02d6a5b2fea37113689a + public static int maxBookPageSize = 2560; + public static double maxBookTotalSizeMultiplier = 0.98D; + private static void maxBookSize() { -+ maxBookPageSize = getInt("settings.book-size.page-max", maxBookPageSize); ++ maxBookPageSize = Math.min(8192, getInt("settings.book-size.page-max", maxBookPageSize)); + maxBookTotalSizeMultiplier = getDouble("settings.book-size.total-multiplier", maxBookTotalSizeMultiplier); + } + @@ -24,28 +24,21 @@ index 11d628869a9a6eda8bf21a4f213ff23ad753b18e..8bf4d2b8c38c02d6a5b2fea37113689a private static void asyncChunks() { ConfigurationSection section; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 59154fbdba07e812ca99fbd2d3b70d24ae9dbfd5..f0eda343820087497d20ed75d925ea6044f70816 100644 +index 12f722ad55abff59d133f91da804f7cfa09dbdb6..9e85045638d3496c80a215d2b589033ed5169981 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1002,6 +1002,52 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1001,6 +1001,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @Override public void handleEditBook(ServerboundEditBookPacket packet) { + // Paper start -+ ItemStack testStack = packet.getBook(); -+ if (!this.cserver.isPrimaryThread() && !testStack.isEmpty() && testStack.getTag() != null) { -+ ListTag pageList = testStack.getTag().getList("pages", 8); -+ if (pageList.size() > 100) { -+ ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with too many pages"); -+ server.scheduleOnMain(() -> this.disconnect("Book too large!")); -+ return; -+ } ++ if (!this.cserver.isPrimaryThread()) { ++ List pageList = packet.getPages(); + long byteTotal = 0; + int maxBookPageSize = com.destroystokyo.paper.PaperConfig.maxBookPageSize; + double multiplier = Math.max(0.3D, Math.min(1D, com.destroystokyo.paper.PaperConfig.maxBookTotalSizeMultiplier)); + long byteAllowed = maxBookPageSize; -+ for (int i = 0; i < pageList.size(); ++i) { -+ String testString = pageList.getString(i); ++ for (String testString : pageList) { + 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!"); diff --git a/patches/server/0302-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0302-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index 8f21e8f92a..58f90fa1ca 100644 --- a/patches/server/0302-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/patches/server/0302-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -16,10 +16,10 @@ intent to remove) and replace it with two new methods, clearly named and documented as to their purpose. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index eb70747ec90770752a45ddf28cf207e2281d3a37..f047ea518bcc1ee7117fcc21af06e9ba4c97e2c0 100644 +index efb759fe76540b51509029d40884eb85a31cda86..d2667305c73821df221cf9aaca2ca494aa1836ad 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -218,6 +218,7 @@ public class ServerPlayer extends Player { +@@ -219,6 +219,7 @@ public class ServerPlayer extends Player { public int latency; public boolean wonGame; private int containerUpdateDelay; // Paper @@ -28,17 +28,17 @@ index eb70747ec90770752a45ddf28cf207e2281d3a37..f047ea518bcc1ee7117fcc21af06e9ba public boolean queueHealthUpdatePacket = false; public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 4d2af64c5f084a7f1e5bb01e9d005b031c3731f6..726e0bf623d17ee88e64d3cab1747133500c5d72 100644 +index 9ce6687635181ac3f28cf116fc0c3c6fda56f965..b345e46ac004b6854fa91b5c65ea873705e111ca 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -170,6 +170,7 @@ public abstract class PlayerList { +@@ -172,6 +172,7 @@ public abstract class PlayerList { } public void placeNewPlayer(Connection connection, ServerPlayer player) { + player.loginTime = System.currentTimeMillis(); // Paper GameProfile gameprofile = player.getGameProfile(); GameProfileCache usercache = this.server.getProfileCache(); - GameProfile gameprofile1 = usercache.get(gameprofile.getId()); + Optional optional = usercache.get(gameprofile.getId()); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java index 93de44b05a698515457052c9c684c4ef44c5cc40..b20bfe5ab165bf86985e5ff2f93f415d9710e0e4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -106,7 +106,7 @@ index 93de44b05a698515457052c9c684c4ef44c5cc40..b20bfe5ab165bf86985e5ff2f93f415d public Location getBedSpawnLocation() { CompoundTag data = this.getData(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 2502b7a78796784446b3856474492e0869c60630..0e27598d8b05c09e0ae3aae618573fe774b84cca 100644 +index 39b307074f7addc6223a2a2212a3f92feffc4379..8563dca3c712ebb579056a3e2a344616018b7274 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -150,6 +150,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0303-Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/patches/server/0303-Workaround-for-vehicle-tracking-issue-on-disconnect.patch index c7cf9b898d..f4077c28bb 100644 --- a/patches/server/0303-Workaround-for-vehicle-tracking-issue-on-disconnect.patch +++ b/patches/server/0303-Workaround-for-vehicle-tracking-issue-on-disconnect.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Workaround for vehicle tracking issue on disconnect diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index c5635f20a64a2d3dfcf4aeab8dff8de59b85bbe1..401b8f203ac0147c250ffd999003d0a6f2fd90fd 100644 +index d2667305c73821df221cf9aaca2ca494aa1836ad..958d796a09e9a33b36285e9a1465b981f6d919ac 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1538,6 +1538,13 @@ public class ServerPlayer extends Player { +@@ -1534,6 +1534,13 @@ public class ServerPlayer extends Player { public void disconnect() { this.disconnected = true; this.ejectPassengers(); diff --git a/patches/server/0305-Block-Entity-remove-from-being-called-on-Players.patch b/patches/server/0305-Block-Entity-remove-from-being-called-on-Players.patch index f8385ad26f..074953c0a7 100644 --- a/patches/server/0305-Block-Entity-remove-from-being-called-on-Players.patch +++ b/patches/server/0305-Block-Entity-remove-from-being-called-on-Players.patch @@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 8563dca3c712ebb579056a3e2a344616018b7274..29d1f363348c67f158b8f4aac923e5f30d54b080 100644 +index d0dbbdc1a99befeb63235cd2b51424dbba023e94..4d5c07031cf38c6acc5b5cda65eabb78f4edffb1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2280,6 +2280,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2281,6 +2281,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void resetCooldown() { getHandle().resetAttackStrengthTicker(); } diff --git a/patches/server/0306-BlockDestroyEvent.patch b/patches/server/0306-BlockDestroyEvent.patch index 9768f9ae66..509c9bff5e 100644 --- a/patches/server/0306-BlockDestroyEvent.patch +++ b/patches/server/0306-BlockDestroyEvent.patch @@ -11,7 +11,7 @@ floating in the air. This can replace many uses of BlockPhysicsEvent diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 81ca3bf1a8f43b7c31cdb8dbba5fd234c28373ad..c85f6fedfaf756f8b17b554bcb2d94d0f00f01f1 100644 +index de4768e0c1d3665fa22ec1d32596283e778b3961..0b62b8ef775a774799a56205a97f6d9a6defb583 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -28,6 +28,7 @@ import net.minecraft.nbt.CompoundTag; @@ -22,7 +22,7 @@ index 81ca3bf1a8f43b7c31cdb8dbba5fd234c28373ad..c85f6fedfaf756f8b17b554bcb2d94d0 import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ChunkHolder; import net.minecraft.server.level.ServerLevel; -@@ -567,8 +568,20 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -572,8 +573,20 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return false; } else { FluidState fluid = this.getFluidState(pos); diff --git a/patches/server/0308-Limit-Client-Sign-length-more.patch b/patches/server/0308-Limit-Client-Sign-length-more.patch index 52761d0f65..6e7e68b2b0 100644 --- a/patches/server/0308-Limit-Client-Sign-length-more.patch +++ b/patches/server/0308-Limit-Client-Sign-length-more.patch @@ -22,10 +22,10 @@ it only impacts data sent from the client. Set -DPaper.maxSignLength=XX to change limit or -1 to disable diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 649db78f7f1e2269d46c856aff95449d5ca6114a..569528a80fdb54cb461f71f712db1e22286f155e 100644 +index 9e85045638d3496c80a215d2b589033ed5169981..fee09331f7a65ca11827bff68bf19fbffdbaf67c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -255,6 +255,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -254,6 +254,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private int aboveGroundVehicleTickCount; private int receivedMovePacketCount; private int knownMovePacketCount; @@ -33,7 +33,7 @@ index 649db78f7f1e2269d46c856aff95449d5ca6114a..569528a80fdb54cb461f71f712db1e22 private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { -@@ -2866,10 +2867,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2847,10 +2848,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser List lines = new java.util.ArrayList<>(); for (int i = 0; i < list.size(); ++i) { diff --git a/patches/server/0312-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch b/patches/server/0312-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch index d2d9632f5b..9ed883072c 100644 --- a/patches/server/0312-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch +++ b/patches/server/0312-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch @@ -11,10 +11,10 @@ everything to the Whitelist object. https://github.com/PaperMC/Paper/issues/1880 diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 726e0bf623d17ee88e64d3cab1747133500c5d72..20b218c658710055172c61fae5eaf255af5708a8 100644 +index b345e46ac004b6854fa91b5c65ea873705e111ca..1f7376340248fc29734bab09715a28eab18849d1 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -62,6 +62,7 @@ import net.minecraft.network.protocol.game.ClientboundUpdateMobEffectPacket; +@@ -64,6 +64,7 @@ import net.minecraft.network.protocol.game.ClientboundUpdateMobEffectPacket; import net.minecraft.network.protocol.game.ClientboundUpdateRecipesPacket; import net.minecraft.network.protocol.game.ClientboundUpdateTagsPacket; import net.minecraft.resources.ResourceKey; @@ -22,7 +22,7 @@ index 726e0bf623d17ee88e64d3cab1747133500c5d72..20b218c658710055172c61fae5eaf255 import net.minecraft.server.MinecraftServer; import net.minecraft.server.PlayerAdvancements; import net.minecraft.server.ServerScoreboard; -@@ -1002,9 +1003,9 @@ public abstract class PlayerList { +@@ -1004,9 +1005,9 @@ public abstract class PlayerList { } public boolean isWhitelisted(GameProfile gameprofile, org.bukkit.event.player.PlayerLoginEvent loginEvent) { boolean isOp = this.ops.contains(gameprofile); diff --git a/patches/server/0314-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/patches/server/0314-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch index 6f87538a4b..da3b632ad4 100644 --- a/patches/server/0314-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch +++ b/patches/server/0314-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 20b218c658710055172c61fae5eaf255af5708a8..f1e3ea6b023119adc69eb0b414994bc7f9f3ed4a 100644 +index 1f7376340248fc29734bab09715a28eab18849d1..2c17e723a1b1613c06b53c1e426c4ce1c072e8ad 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1121,6 +1121,7 @@ public abstract class PlayerList { +@@ -1123,6 +1123,7 @@ public abstract class PlayerList { } public void setUsingWhiteList(boolean whitelistEnabled) { diff --git a/patches/server/0316-Entity-getEntitySpawnReason.patch b/patches/server/0316-Entity-getEntitySpawnReason.patch index 7a9e5b17ac..76b3195076 100644 --- a/patches/server/0316-Entity-getEntitySpawnReason.patch +++ b/patches/server/0316-Entity-getEntitySpawnReason.patch @@ -10,7 +10,7 @@ persistenting Living Entity, SPAWNER for spawners, or DEFAULT since data was not stored. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index ab4dba5af019b60cbb82360eae7f6008aafcd38c..cdb19ab7e0d90dcd6885226aa2fd3a58ed53d29b 100644 +index 863981519bf0c62c00484cf9ee6d7ff1ea8ed946..ac9c9b32100de0e2f542f38c87451fb3e55c4edd 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1111,6 +1111,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -22,10 +22,10 @@ index ab4dba5af019b60cbb82360eae7f6008aafcd38c..cdb19ab7e0d90dcd6885226aa2fd3a58 // Paper start if (DEBUG_ENTITIES) { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f1e3ea6b023119adc69eb0b414994bc7f9f3ed4a..42b7568d1c3ce145b2816202e6f5c8ca9e904de7 100644 +index 2c17e723a1b1613c06b53c1e426c4ce1c072e8ad..abba62b7252c6d6ee92a4b1a9b23df7758ab6a77 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -341,7 +341,7 @@ public abstract class PlayerList { +@@ -343,7 +343,7 @@ public abstract class PlayerList { // CraftBukkit start ServerLevel finalWorldServer = worldserver1; Entity entity = EntityType.loadEntityRecursive(nbttagcompound1.getCompound("Entity"), finalWorldServer, (entity1) -> { @@ -35,7 +35,7 @@ index f1e3ea6b023119adc69eb0b414994bc7f9f3ed4a..42b7568d1c3ce145b2816202e6f5c8ca }); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3518044845ec400ff6c2ddf7fc7dc32f1f7769b6..16c1b0135cbd466c7e404e2f3ee638c511dc8e37 100644 +index dbf002a6967812fd58ed9bcfa615dc525586c1a0..a8a91ed20c1b97368acdbb6ed7cd73ddaf7e1ea0 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -67,6 +67,8 @@ import net.minecraft.world.InteractionHand; diff --git a/patches/server/0317-Update-entity-Metadata-for-all-tracked-players.patch b/patches/server/0317-Update-entity-Metadata-for-all-tracked-players.patch index f587272e06..c4cb90f14b 100644 --- a/patches/server/0317-Update-entity-Metadata-for-all-tracked-players.patch +++ b/patches/server/0317-Update-entity-Metadata-for-all-tracked-players.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Update entity Metadata for all tracked players diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index ad9bbda31a4cdb306ca40f2b99e4b815c4f136bd..28afe2f238ded241acf77c3272a44068646b9133 100644 +index f835ef1c7109f56f32da394c9afc9fd35b05b51a..58cae4202e61cded7d5dfa9652bbfb9735927f7e 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java @@ -392,6 +392,12 @@ public class ServerEntity { @@ -22,10 +22,10 @@ index ad9bbda31a4cdb306ca40f2b99e4b815c4f136bd..28afe2f238ded241acf77c3272a44068 this.broadcast.accept(packet); if (this.entity instanceof ServerPlayer) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 58baed7f75ff0b573e072ad19026b7ef94a56172..4184b8c002c0d36574c6710558d85930d3f72279 100644 +index fee09331f7a65ca11827bff68bf19fbffdbaf67c..921dbdec095b0e527865de86992a5867d3e288e6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2288,7 +2288,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2268,7 +2268,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser if (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem) { // Refresh the current entity metadata diff --git a/patches/server/0319-Implement-PlayerPostRespawnEvent.patch b/patches/server/0319-Implement-PlayerPostRespawnEvent.patch index 0babace25f..8259ef3e0f 100644 --- a/patches/server/0319-Implement-PlayerPostRespawnEvent.patch +++ b/patches/server/0319-Implement-PlayerPostRespawnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerPostRespawnEvent diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 42b7568d1c3ce145b2816202e6f5c8ca9e904de7..16e625d0a2777ddd14576952d704833fd0fb4f1a 100644 +index abba62b7252c6d6ee92a4b1a9b23df7758ab6a77..7dd874c6aa1268665d4a64dfc41013c304991273 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -721,9 +721,14 @@ public abstract class PlayerList { +@@ -723,9 +723,14 @@ public abstract class PlayerList { boolean flag2 = false; @@ -24,7 +24,7 @@ index 42b7568d1c3ce145b2816202e6f5c8ca9e904de7..16e625d0a2777ddd14576952d704833f ServerLevel worldserver1 = this.server.getLevel(entityplayer.getRespawnDimension()); if (worldserver1 != null) { Optional optional; -@@ -774,6 +779,7 @@ public abstract class PlayerList { +@@ -776,6 +781,7 @@ public abstract class PlayerList { location = respawnEvent.getRespawnLocation(); if (!flag) entityplayer.reset(); // SPIGOT-4785 @@ -32,7 +32,7 @@ index 42b7568d1c3ce145b2816202e6f5c8ca9e904de7..16e625d0a2777ddd14576952d704833f } else { location.setWorld(worldserver.getWorld()); } -@@ -831,6 +837,13 @@ public abstract class PlayerList { +@@ -833,6 +839,13 @@ public abstract class PlayerList { if (entityplayer.connection.isDisconnected()) { this.save(entityplayer); } diff --git a/patches/server/0321-Server-Tick-Events.patch b/patches/server/0321-Server-Tick-Events.patch index b7246a56b0..af0cc020a6 100644 --- a/patches/server/0321-Server-Tick-Events.patch +++ b/patches/server/0321-Server-Tick-Events.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Server Tick Events Fires event at start and end of a server tick diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index dfbdc5ead05821ebf4c08d6e829a9ce925061e1a..d7ab2d4a470fed4b13bad6cf5811a7ce36e748cc 100644 +index df69838ab551d9b7e47785abd0a5acea869ab9c5..8908b61dc601dc8fd16976df350197ff1d3e3bd7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1310,6 +1310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> getFutureIfPresentUnchecked(ChunkStatus leastStatus) { diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 36bc19cbb5242207ff019f62f59205e1a6336728..f271d7b32fef73401778682a1d4832bfbfd49b2f 100644 +index 6d024db8bfbd5139d4c94be3d3a48cfa1a240c62..6f5e1f7c23b19257c89b7c5a992ad76623bf4006 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -84,6 +84,7 @@ import net.minecraft.world.level.chunk.ProtoChunk; @@ -43,7 +43,7 @@ index 36bc19cbb5242207ff019f62f59205e1a6336728..f271d7b32fef73401778682a1d4832bf import net.minecraft.world.level.entity.ChunkStatusUpdateListener; import net.minecraft.world.level.levelgen.structure.StructureStart; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager; -@@ -1081,12 +1082,61 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1082,12 +1083,61 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper end @Nullable @@ -108,10 +108,10 @@ index 36bc19cbb5242207ff019f62f59205e1a6336728..f271d7b32fef73401778682a1d4832bf // Spigot start return this.isOutsideOfRange(chunkPos, false); diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 1176dd8ebd59c5bda1b74c532ca21ae335078805..ddaa4dfa4611e8d659e9d0211873b6f503e3d230 100644 +index 68b618168c8c484e3902561f290adaa6568551c1..d81d84b948842088c93a32e307b7430d81438da9 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -324,6 +324,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -323,6 +323,7 @@ public class ServerChunkCache extends ChunkSource { } // Paper end // Paper start - async chunk io @@ -142,7 +142,7 @@ index 6e0cf8ee76143301c939fc4af5eeb091abdcbc5c..1c7b18db0053bca6e7750225a79f7d95 return (ChunkStatus) Registry.CHUNK_STATUS.get(ResourceLocation.tryParse(id)); } 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 d126c038ae56312acc2e8be2726065d4eddb08c8..812444e92e35879bda66913df5ef2502a9107224 100644 +index 9e9ffb575c68c7044ab289e1f3f79ff821b30c24..ea3279113358b41281ee2e92f2371a0f1e36b472 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 @@ -563,6 +563,17 @@ public class ChunkSerializer { diff --git a/patches/server/0341-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch b/patches/server/0341-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch index 4a48360f2e..e9c0d7a4e2 100644 --- a/patches/server/0341-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch +++ b/patches/server/0341-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch @@ -7,10 +7,10 @@ If the Bukkit generator already has a spawn, use it immediately instead of spending time generating one that we won't use diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 29c1b3a43dd369419e8c93b571679a2ba024e4f6..38b92db7591c060a45c4bf8bb7e4a25bb649a742 100644 +index 01969206a55f332126169cd1e9c89abde01309e9..a1b19ba18620931ddf471579f365bb8082e4deac 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -678,12 +678,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getChunkRangeFuture(chunkcoordintpair, 1, (i) -> { diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java -index ed26c290dfbf11735728716577ff564ba84437f0..624fd443d2cc71605cfff996140b00f37c8d8841 100644 +index ba3509510bdada588100d481a9124e928cfe760e..a56cfcf5ac735147f3f2bd029a2b1a4e889d5b4f 100644 --- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java +++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java @@ -61,7 +61,21 @@ public class PersistentEntitySectionManager implements A @@ -210,14 +210,14 @@ index ed26c290dfbf11735728716577ff564ba84437f0..624fd443d2cc71605cfff996140b00f3 this.processChunkUnload(pos); @@ -290,7 +304,7 @@ public class PersistentEntitySectionManager implements A while(!longSet.isEmpty()) { - this.permanentStorage.flush(); + this.permanentStorage.flush(false); this.processPendingLoads(); - longSet.removeIf((pos) -> { + longSet.removeIf((java.util.function.LongPredicate) (pos) -> { // Paper - decompile fix boolean bl = this.chunkVisibility.get(pos) == Visibility.HIDDEN; return bl ? this.processChunkUnload(pos) : this.storeChunkSections(pos, (entityAccess) -> { }); -@@ -327,7 +341,7 @@ public class PersistentEntitySectionManager implements A +@@ -328,7 +342,7 @@ public class PersistentEntitySectionManager implements A public void dumpSections(Writer writer) throws IOException { CsvOutput csvOutput = CsvOutput.builder().addColumn("x").addColumn("y").addColumn("z").addColumn("visibility").addColumn("load_status").addColumn("entity_count").build(writer); diff --git a/patches/server/0353-Optimize-Hoppers.patch b/patches/server/0353-Optimize-Hoppers.patch index 6e2dc88285..89279e58d7 100644 --- a/patches/server/0353-Optimize-Hoppers.patch +++ b/patches/server/0353-Optimize-Hoppers.patch @@ -32,10 +32,10 @@ index 9860f5a0ddff83f1393ee13a96b38c3b14077512..bf704993d0abd50dba91682a7fbb575e } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 38b92db7591c060a45c4bf8bb7e4a25bb649a742..670b4687c660526f806dd5e8214af1113912199b 100644 +index a1b19ba18620931ddf471579f365bb8082e4deac..677966d14c56d121bc39ba0a1fb358f6b7610c4e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1422,6 +1422,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper @@ -62,7 +62,7 @@ index 449d2e7b18608ca36282f1a29e69457fc525307e..c738cb0433ea4a86d82372bf66e29c01 public double getLevelX() { return this.getX(); diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index d402b73e5876600f09c509c837c77b597da988bb..2fd3d56768f9121c1e5de3f193258bb360bb103b 100644 +index 4348ecf7ca91fc38d59365aa5560d9d24f7b0703..30a339f56eb1edb730e4ce72b4ce314555bc8c15 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -601,11 +601,12 @@ public final class ItemStack { diff --git a/patches/server/0354-PlayerDeathEvent-shouldDropExperience.patch b/patches/server/0354-PlayerDeathEvent-shouldDropExperience.patch index f954fe4663..e94ab6d42a 100644 --- a/patches/server/0354-PlayerDeathEvent-shouldDropExperience.patch +++ b/patches/server/0354-PlayerDeathEvent-shouldDropExperience.patch @@ -5,10 +5,10 @@ Subject: [PATCH] PlayerDeathEvent#shouldDropExperience diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index e1d70824fd200c93848d5bec9cecad773f387765..7ce027a7352d2ab34c27046d86ae32100c0baeb4 100644 +index c7629749204f20e64b7fb8b68a58465553585c14..c15adaa8c5472682331bd3cb78f3badbc1264f3f 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -849,7 +849,7 @@ public class ServerPlayer extends Player { +@@ -845,7 +845,7 @@ public class ServerPlayer extends Player { this.tellNeutralMobsThatIDied(); } // SPIGOT-5478 must be called manually now diff --git a/patches/server/0360-Lag-compensate-eating.patch b/patches/server/0360-Lag-compensate-eating.patch index fcd173f2e0..fadcf805a9 100644 --- a/patches/server/0360-Lag-compensate-eating.patch +++ b/patches/server/0360-Lag-compensate-eating.patch @@ -7,10 +7,10 @@ When the server is lagging, players will wait longer when eating. Change to also use a time check instead if it passes. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 53951f2c4dc77e9723d0a6314781d9ee0aa8ce54..d03d0c896ef7758dbfbf5b9aa3119e07e6ef389c 100644 +index f635e60e55ae43c0f2acf7e82ca6014e757da186..3df3bc95bff4a170f4fc5757239c7e0efd6fae62 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3492,6 +3492,11 @@ public abstract class LivingEntity extends Entity { +@@ -3495,6 +3495,11 @@ public abstract class LivingEntity extends Entity { return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 2) > 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND; } @@ -22,7 +22,7 @@ index 53951f2c4dc77e9723d0a6314781d9ee0aa8ce54..d03d0c896ef7758dbfbf5b9aa3119e07 private void updatingUsingItem() { if (this.isUsingItem()) { if (ItemStack.isSameIgnoreDurability(this.getItemInHand(this.getUsedItemHand()), this.useItem)) { -@@ -3509,8 +3514,12 @@ public abstract class LivingEntity extends Entity { +@@ -3512,8 +3517,12 @@ public abstract class LivingEntity extends Entity { if (this.shouldTriggerItemUseEffects()) { this.triggerItemUseEffects(stack, 5); } @@ -37,7 +37,7 @@ index 53951f2c4dc77e9723d0a6314781d9ee0aa8ce54..d03d0c896ef7758dbfbf5b9aa3119e07 this.completeUsingItem(); } -@@ -3556,7 +3565,10 @@ public abstract class LivingEntity extends Entity { +@@ -3559,7 +3568,10 @@ public abstract class LivingEntity extends Entity { if (!itemstack.isEmpty() && !this.isUsingItem() || forceUpdate) { // Paper use override flag this.useItem = itemstack; @@ -49,7 +49,7 @@ index 53951f2c4dc77e9723d0a6314781d9ee0aa8ce54..d03d0c896ef7758dbfbf5b9aa3119e07 if (!this.level.isClientSide) { this.setLivingEntityFlag(1, true); this.setLivingEntityFlag(2, enumhand == InteractionHand.OFF_HAND); -@@ -3580,7 +3592,10 @@ public abstract class LivingEntity extends Entity { +@@ -3583,7 +3595,10 @@ public abstract class LivingEntity extends Entity { } } else if (!this.isUsingItem() && !this.useItem.isEmpty()) { this.useItem = ItemStack.EMPTY; @@ -61,7 +61,7 @@ index 53951f2c4dc77e9723d0a6314781d9ee0aa8ce54..d03d0c896ef7758dbfbf5b9aa3119e07 } } -@@ -3706,7 +3721,10 @@ public abstract class LivingEntity extends Entity { +@@ -3709,7 +3724,10 @@ public abstract class LivingEntity extends Entity { } this.useItem = ItemStack.EMPTY; diff --git a/patches/server/0364-Entity-Activation-Range-2.0.patch b/patches/server/0364-Entity-Activation-Range-2.0.patch index c5f4a4098d..dd5bc730d5 100644 --- a/patches/server/0364-Entity-Activation-Range-2.0.patch +++ b/patches/server/0364-Entity-Activation-Range-2.0.patch @@ -14,7 +14,7 @@ Adds flying monsters to control ghast and phantoms Adds villagers as separate config diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 95fed7617c2b37886e912e35e7ad446c39e791ab..22db34272c6635438d11f525fb4f08e2aa631f55 100644 +index 0941e9aa40aed7b872bb953ee7df8fa9cbde2962..175e911f8d12c5870d167a65cdeeb4470e7ff4cc 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2,7 +2,6 @@ package net.minecraft.server.level; @@ -124,7 +124,7 @@ index 95fed7617c2b37886e912e35e7ad446c39e791ab..22db34272c6635438d11f525fb4f08e2 } 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 5bd250a9f9edb0391aaf935d51334bdb0a4e8575..0a3b0919f3de645de6d63d67a2e6bf64d1d3048c 100644 +index a8a91ed20c1b97368acdbb6ed7cd73ddaf7e1ea0..6ce232c623d86af20b74d7ee1e7b258cd7342d24 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -326,6 +326,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -158,10 +158,10 @@ index 5bd250a9f9edb0391aaf935d51334bdb0a4e8575..0a3b0919f3de645de6d63d67a2e6bf64 movement = this.maybeBackOffFromEdge(movement, movementType); Vec3 vec3d1 = this.collide(movement); diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 5595150b0da580fce4d5d23993d77314e225ad58..9306340721e2aae4dfb2025e47b4624a8e351420 100644 +index e9e89608c4b77868fed92717c837db76d6bb5a54..eec836e5e66a7255a31f1e9311cdb4e9819c84b2 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -198,6 +198,19 @@ public abstract class Mob extends LivingEntity { +@@ -199,6 +199,19 @@ public abstract class Mob extends LivingEntity { return this.lookControl; } @@ -262,7 +262,7 @@ index 27ea9c10b7f66c2133b0829c0b1c37143dd80b56..c28ade67f6a59146064a57bf016a6461 } } diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index 555cf6d39108d40998adbbaf6b09dd9973f5f2e3..426fa33c9e5ddf2de5435859ee4a5f352313869c 100644 +index 0ba4e6111726a1ca3cc5b6ce21e0500cc57a4aa3..cbec6decd12dae4f1b9f05f863b493d7379f46ed 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -227,17 +227,29 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -317,10 +317,10 @@ index 555cf6d39108d40998adbbaf6b09dd9973f5f2e3..426fa33c9e5ddf2de5435859ee4a5f35 super.customServerAiStep(); } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 76ef2337d87b6ae3f190d4bd5410b04af917a507..fff1d38e07439ab1bc83aa9e7153b3666a351129 100644 +index af0dd46e352115d1984f07fff746c7ad41486ac2..fb6da4bccd33b9e079f4bcf84f8ff59ad24a5fe6 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -154,6 +154,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -155,6 +155,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public long ticksPerWaterSpawns; public long ticksPerWaterAmbientSpawns; public long ticksPerAmbientSpawns; diff --git a/patches/server/0365-Increase-Light-Queue-Size.patch b/patches/server/0365-Increase-Light-Queue-Size.patch index cfe7cca467..3c238a67da 100644 --- a/patches/server/0365-Increase-Light-Queue-Size.patch +++ b/patches/server/0365-Increase-Light-Queue-Size.patch @@ -29,10 +29,10 @@ index bf704993d0abd50dba91682a7fbb575e3696be62..a91a7d8f56a068b18d50a8b987b71510 } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 670b4687c660526f806dd5e8214af1113912199b..ac53eb7bc69e1566d20df3b7cba33034c344952a 100644 +index 677966d14c56d121bc39ba0a1fb358f6b7610c4e..ce438760cbc92c08c079d06a8b97eaeda1018491 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -832,7 +832,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop (max 5) to automatically fix all light data in the chunks. diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index 71ffa66973d8994e2a480435ac1ada3fe61600a4..7b5afc5d34b78e6404c1a5c6bb823d9589471f13 100644 +index 43067ef5733a29145b3e2ce386999ba518042dd7..c6254f39f98b821f75a21c0ecea457f73247385f 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -10,7 +10,8 @@ import net.minecraft.server.MinecraftServer; @@ -134,7 +134,7 @@ index 71ffa66973d8994e2a480435ac1ada3fe61600a4..7b5afc5d34b78e6404c1a5c6bb823d95 + } } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index e6c42a52d687a418c92e8f628d589ac31ae90626..513876fc53fe5790e5bc6271a1a9ec345a614b98 100644 +index 1273ef4f7f0dff15f8630c0ca3dd1fffcae6acdf..6ddb24ae627b9bfdfd82b19b1a746f32bb8d0532 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -128,6 +128,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -150,7 +150,7 @@ index e6c42a52d687a418c92e8f628d589ac31ae90626..513876fc53fe5790e5bc6271a1a9ec34 public final ChunkProgressListener progressListener; private final ChunkStatusUpdateListener chunkStatusListener; public final ChunkMap.ChunkDistanceManager distanceManager; -@@ -204,11 +210,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -206,11 +212,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.progressListener = worldGenerationProgressListener; this.chunkStatusListener = chunkStatusChangeListener; diff --git a/patches/server/0367-Anti-Xray.patch b/patches/server/0367-Anti-Xray.patch index ce8b01b2d2..db74b579f4 100644 --- a/patches/server/0367-Anti-Xray.patch +++ b/patches/server/0367-Anti-Xray.patch @@ -1091,10 +1091,10 @@ index c28879f32b004f36ff746ea2274f91ddd9501e71..60d72e488bc77cd913328be400ca374a } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index badac53382c776eba3efccfda42283912d07b99a..06e581bc0c0ea4e8141f7b9610cc5a7ef350c287 100644 +index 6ddb24ae627b9bfdfd82b19b1a746f32bb8d0532..5e7fe43d1b27bed51f8a7c0fcddb8604d40f6954 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1485,7 +1485,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1486,7 +1486,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public void playerLoadedChunk(ServerPlayer player, Packet[] packets, LevelChunk chunk) { if (packets[0] == null) { @@ -1104,7 +1104,7 @@ index badac53382c776eba3efccfda42283912d07b99a..06e581bc0c0ea4e8141f7b9610cc5a7e } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c0a897aa1fe275f308cf594f0c875096850f5271..d6e7b8ee31372c2c92da8ab4f5915f95c9382ae3 100644 +index 175e911f8d12c5870d167a65cdeeb4470e7ff4cc..59f14aa0ffcd61848ae6747d7a0330129a97d5a2 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -292,7 +292,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -1139,10 +1139,10 @@ index f4a056185990181e486f452960159a5287947382..b932580dc10703c8a7dbecd4cf389548 public void destroyAndAck(BlockPos pos, ServerboundPlayerActionPacket.Action action, String reason) { diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index d59126240c568614cb43ea42ad3e2c9eb8701071..2c6cd2909bdc41d4a1deaeb1ed41aab81189e540 100644 +index fb6da4bccd33b9e079f4bcf84f8ff59ad24a5fe6..2007b0b04e7037e1444b5d1964638ccd06e7a2df 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -164,6 +164,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -165,6 +165,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper @@ -1150,7 +1150,7 @@ index d59126240c568614cb43ea42ad3e2c9eb8701071..2c6cd2909bdc41d4a1deaeb1ed41aab8 public final co.aikar.timings.WorldTimingsHandler timings; // Paper public static BlockPos lastPhysicsProblem; // Spigot -@@ -185,7 +186,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -186,7 +187,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return this.typeKey; } @@ -1159,7 +1159,7 @@ index d59126240c568614cb43ea42ad3e2c9eb8701071..2c6cd2909bdc41d4a1deaeb1ed41aab8 this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), this.spigotConfig); // Paper this.generator = gen; -@@ -258,6 +259,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -259,6 +260,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable { this.keepSpawnInMemory = this.paperConfig.keepSpawnInMemory; // Paper this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); @@ -1169,7 +1169,7 @@ index d59126240c568614cb43ea42ad3e2c9eb8701071..2c6cd2909bdc41d4a1deaeb1ed41aab8 } // Paper start -@@ -448,6 +452,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -449,6 +453,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // CraftBukkit end BlockState iblockdata1 = chunk.setType(pos, state, (flags & 64) != 0, (flags & 1024) == 0); // CraftBukkit custom NO_PLACE flag @@ -1415,7 +1415,7 @@ index 64cb0658021866c3875d145cc4266896e57c081e..78bd3274866fed3d627a3eda7b96b927 + // Paper end } 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 abd02d88911cbbbe6f770039aa0649cff85d85ee..45c571b475b8fac19fd7b5ccbf5fdae5b435c37f 100644 +index 79a7221b0462931e94f31ccd7c6dc2720ddfb752..afbb42595afeb151208880dcf48b94d7c00a8733 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 @@ -136,7 +136,7 @@ public class ChunkSerializer { diff --git a/patches/server/0368-No-Tick-view-distance-implementation.patch b/patches/server/0368-No-Tick-view-distance-implementation.patch index 7007fa4f43..292d9cb38d 100644 --- a/patches/server/0368-No-Tick-view-distance-implementation.patch +++ b/patches/server/0368-No-Tick-view-distance-implementation.patch @@ -53,7 +53,7 @@ index 5c1421620e02b7d4ab4171ebff41076c7ee8cd55..4bc418f45c6f16a9a1c78b6688625268 worldData.addProperty("keep-spawn-loaded-range", world.paperConfig.keepLoadedRange); worldData.addProperty("visible-chunk-count", visibleChunks.size()); diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index a066ac00ad3274a7c70edbb9cc442dc9be78a3bb..edf0432967c4621e101611924c4ce826f54e3e34 100644 +index 2720f4a51ffc8c9748932be55cebd5072cd4ffb2..1dd1b9afaee38fdc994ad0a069bd63b02eedf55c 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -75,6 +75,17 @@ public class ChunkHolder { @@ -145,7 +145,7 @@ index a066ac00ad3274a7c70edbb9cc442dc9be78a3bb..edf0432967c4621e101611924c4ce826 public CompletableFuture> getOrScheduleFuture(ChunkStatus targetStatus, ChunkMap chunkStorage) { diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f9dcddb2c 100644 +index 5e7fe43d1b27bed51f8a7c0fcddb8604d40f6954..404dcacd14e9fa81c54287216ce7b53dc5bb5c03 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -127,7 +127,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -226,9 +226,9 @@ index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f } // Paper end -@@ -221,6 +268,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -223,6 +270,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.overworldDataStorage = persistentStateManagerFactory; - this.poiManager = new PoiManager(new File(this.storageFolder, "poi"), dataFixer, dsync, world); + this.poiManager = new PoiManager(new File(file, "poi"), dataFixer, dsync, world); this.setViewDistance(viewDistance); + // Paper start - no-tick view distance + this.setNoTickViewDistance(this.level.paperConfig.noTickViewDistance); @@ -272,7 +272,7 @@ index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f } private static double euclideanDistanceSquared(ChunkPos pos, Entity entity) { -@@ -904,14 +990,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -905,14 +991,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider completablefuture1.thenAcceptAsync((either) -> { either.ifLeft((chunk) -> { this.tickingGenerated.getAndIncrement(); @@ -289,7 +289,7 @@ index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f }); return completablefuture1; } -@@ -1004,27 +1086,34 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1005,27 +1087,34 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public void setViewDistance(int watchDistance) { @@ -337,7 +337,7 @@ index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f } } -@@ -1036,7 +1125,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1037,7 +1126,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos.toLong()); if (playerchunk != null) { @@ -346,7 +346,7 @@ index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f if (chunk != null) { this.playerLoadedChunk(player, packets, chunk); -@@ -1132,7 +1221,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1133,7 +1222,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper end @Nullable @@ -355,7 +355,7 @@ index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f CompoundTag nbttagcompound = this.read(pos); // Paper start - Cache chunk status on disk if (nbttagcompound == null) { -@@ -1243,13 +1332,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1244,13 +1333,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.removePlayerFromDistanceMaps(player); // Paper - distance maps } @@ -370,7 +370,7 @@ index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f } -@@ -1257,7 +1340,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1258,7 +1341,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider SectionPos sectionposition = SectionPos.of((Entity) player); player.setLastSectionPos(sectionposition); @@ -379,7 +379,7 @@ index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f return sectionposition; } -@@ -1312,6 +1395,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1313,6 +1396,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider int k1; int l1; @@ -387,7 +387,7 @@ index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f if (Math.abs(i1 - i) <= this.viewDistance * 2 && Math.abs(j1 - j) <= this.viewDistance * 2) { k1 = Math.min(i, i1) - this.viewDistance; l1 = Math.min(j, j1) - this.viewDistance; -@@ -1350,6 +1434,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1351,6 +1435,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } } } @@ -395,7 +395,7 @@ index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f this.updateMaps(player); // Paper - distance maps -@@ -1357,11 +1442,46 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1358,11 +1443,46 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @Override public Stream getPlayers(ChunkPos chunkPos, boolean onlyOnWatchDistanceEdge) { @@ -447,7 +447,7 @@ index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f } public void addEntity(Entity entity) { -@@ -1483,6 +1603,47 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1484,6 +1604,47 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } @@ -520,10 +520,10 @@ index 45c7ebe67019cdbe88b6617a95d5c40d3a68286c..38eebda226e007c8910e04f502ce218c if (withinViewDistance) { DistanceManager.this.ticketThrottlerInput.tell(ChunkTaskPriorityQueueSorter.message(() -> { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 1cd7072a84caf38a4f8495480f824c71f2f51fed..cbc8a0c6ad214cfea8ac1476c1eda074f3128aaf 100644 +index c15adaa8c5472682331bd3cb78f3badbc1264f3f..74ad39234b89db61fab89ce6bac4f3f8b3eccb7c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -241,6 +241,7 @@ public class ServerPlayer extends Player { +@@ -242,6 +242,7 @@ public class ServerPlayer extends Player { public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper @@ -532,10 +532,10 @@ index 1cd7072a84caf38a4f8495480f824c71f2f51fed..cbc8a0c6ad214cfea8ac1476c1eda074 public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 35f56aae927e97a8abaaebb444053b0ef1a57f09..43f2d2bbb2bcb4b77b4f11916143f3566b3dcaef 100644 +index 4ba978af436cb114aa5274df5cd8bd25ff7be2c9..10eb562d2089dc20c9ec33956c3e2f98084de748 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -242,7 +242,7 @@ public abstract class PlayerList { +@@ -244,7 +244,7 @@ public abstract class PlayerList { boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO); // Spigot - view distance @@ -544,7 +544,7 @@ index 35f56aae927e97a8abaaebb444053b0ef1a57f09..43f2d2bbb2bcb4b77b4f11916143f356 player.getBukkitEntity().sendSupportedChannels(); // CraftBukkit playerconnection.send(new ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.BRAND, (new FriendlyByteBuf(Unpooled.buffer())).writeUtf(this.getServer().getServerModName()))); playerconnection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); -@@ -795,7 +795,7 @@ public abstract class PlayerList { +@@ -797,7 +797,7 @@ public abstract class PlayerList { // CraftBukkit start LevelData worlddata = worldserver1.getLevelData(); entityplayer1.connection.send(new ClientboundRespawnPacket(worldserver1.dimensionType(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), entityplayer1.gameMode.getGameModeForPlayer(), entityplayer1.gameMode.getPreviousGameModeForPlayer(), worldserver1.isDebug(), worldserver1.isFlat(), flag)); @@ -553,7 +553,7 @@ index 35f56aae927e97a8abaaebb444053b0ef1a57f09..43f2d2bbb2bcb4b77b4f11916143f356 entityplayer1.setLevel(worldserver1); entityplayer1.unsetRemoved(); entityplayer1.connection.teleport(new Location(worldserver1.getWorld(), entityplayer1.getX(), entityplayer1.getY(), entityplayer1.getZ(), entityplayer1.getYRot(), entityplayer1.getXRot())); -@@ -1279,7 +1279,7 @@ public abstract class PlayerList { +@@ -1282,7 +1282,7 @@ public abstract class PlayerList { public void setViewDistance(int viewDistance) { this.viewDistance = viewDistance; @@ -563,10 +563,10 @@ index 35f56aae927e97a8abaaebb444053b0ef1a57f09..43f2d2bbb2bcb4b77b4f11916143f356 while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 83673e66aab4988e912d78fb8d1a45f807e38bd9..d58a7adb58abc91f66fc893ee7a7a7bded3619a8 100644 +index 2007b0b04e7037e1444b5d1964638ccd06e7a2df..fa8cf70d7d24a82757326ff8f7f240cff3dcbe73 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -527,8 +527,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -528,8 +528,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { this.setBlocksDirty(blockposition, iblockdata1, iblockdata2); } @@ -582,7 +582,7 @@ index 83673e66aab4988e912d78fb8d1a45f807e38bd9..d58a7adb58abc91f66fc893ee7a7a7bd if ((i & 1) != 0) { diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index fbb82d344f654b90809582916442c520f344aa39..750895bed591c9f15cd2ea2d8f0611864782c912 100644 +index 7661f956e7c900602ceedbcd030d3049d90b8cca..fc8214a082da0f8eedaf86e7730ac62e77b76687 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -33,7 +33,10 @@ import net.minecraft.core.Registry; diff --git a/patches/server/0370-Tracking-Range-Improvements.patch b/patches/server/0370-Tracking-Range-Improvements.patch index eb75f1951f..60a01cade3 100644 --- a/patches/server/0370-Tracking-Range-Improvements.patch +++ b/patches/server/0370-Tracking-Range-Improvements.patch @@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code Also ignores Enderdragon, defaulting it to Mojang's setting diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 6f4c350f486aa70b94be8cf5a7b0e22599283ba9..dde0d2be31e686b4d5324affd03743345d8af2ed 100644 +index 404dcacd14e9fa81c54287216ce7b53dc5bb5c03..c7d708cc5c20d46ed085f1f1db7666246614a57d 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1832,6 +1832,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -1837,6 +1837,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); int j = entity.getType().clientTrackingRange() * 16; diff --git a/patches/server/0372-implement-optional-per-player-mob-spawns.patch b/patches/server/0372-implement-optional-per-player-mob-spawns.patch index 1989389186..baf6534aad 100644 --- a/patches/server/0372-implement-optional-per-player-mob-spawns.patch +++ b/patches/server/0372-implement-optional-per-player-mob-spawns.patch @@ -545,7 +545,7 @@ index 0000000000000000000000000000000000000000..11de56afaf059b00fa5bec293516bcdc + } +} diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 13dbeae83158d174032e3de1c447bd32555a6dfa..f921bc3a0e2b448ae0f9cccc608fc9d735d7936a 100644 +index c7d708cc5c20d46ed085f1f1db7666246614a57d..b2d88e0423d93fdb45dc8ca7d53c98069ade749e 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -145,6 +145,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -556,15 +556,15 @@ index 13dbeae83158d174032e3de1c447bd32555a6dfa..f921bc3a0e2b448ae0f9cccc608fc9d7 // CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback() public final CallbackExecutor callbackExecutor = new CallbackExecutor(); -@@ -268,6 +269,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -270,6 +271,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.overworldDataStorage = persistentStateManagerFactory; - this.poiManager = new PoiManager(new File(this.storageFolder, "poi"), dataFixer, dsync, world); + this.poiManager = new PoiManager(new File(file, "poi"), dataFixer, dsync, world); this.setViewDistance(viewDistance); + this.playerMobDistanceMap = this.level.paperConfig.perPlayerMobSpawns ? new com.destroystokyo.paper.util.PlayerMobDistanceMap() : null; // Paper // Paper start - no-tick view distance this.setNoTickViewDistance(this.level.paperConfig.noTickViewDistance); this.playerViewDistanceTickMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, -@@ -309,6 +311,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -311,6 +313,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper end - no-tick view distance } @@ -591,10 +591,10 @@ index 13dbeae83158d174032e3de1c447bd32555a6dfa..f921bc3a0e2b448ae0f9cccc608fc9d7 double d0 = (double) SectionPos.sectionToBlockCoord(pos.x, 8); double d1 = (double) SectionPos.sectionToBlockCoord(pos.z, 8); diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index ddaa4dfa4611e8d659e9d0211873b6f503e3d230..1ed75e33d566e58314f733d02ff89d5f174a606a 100644 +index d81d84b948842088c93a32e307b7430d81438da9..136c6db28ca4d9244ce9341e341b1f36cd643ea3 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -754,7 +754,22 @@ public class ServerChunkCache extends ChunkSource { +@@ -753,7 +753,22 @@ public class ServerChunkCache extends ChunkSource { this.level.getProfiler().push("naturalSpawnCount"); this.level.timings.countNaturalMobs.startTiming(); // Paper - timings int l = this.distanceManager.getNaturalSpawnChunkCount(); @@ -619,10 +619,10 @@ index ddaa4dfa4611e8d659e9d0211873b6f503e3d230..1ed75e33d566e58314f733d02ff89d5f this.lastSpawnState = spawnercreature_d; diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index cbc8a0c6ad214cfea8ac1476c1eda074f3128aaf..4ea2203d1acbaa60839acb9cdf48fbcc73e4eff0 100644 +index 74ad39234b89db61fab89ce6bac4f3f8b3eccb7c..f7e199a375a49756f9bbbc17b54d74c71923457e 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -223,6 +223,11 @@ public class ServerPlayer extends Player { +@@ -224,6 +224,11 @@ public class ServerPlayer extends Player { public boolean queueHealthUpdatePacket = false; public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket; // Paper end @@ -634,7 +634,7 @@ index cbc8a0c6ad214cfea8ac1476c1eda074f3128aaf..4ea2203d1acbaa60839acb9cdf48fbcc // CraftBukkit start public String displayName; -@@ -317,6 +322,7 @@ public class ServerPlayer extends Player { +@@ -313,6 +318,7 @@ public class ServerPlayer extends Player { this.adventure$displayName = net.kyori.adventure.text.Component.text(this.getScoreboardName()); // Paper this.bukkitPickUpLoot = true; this.maxHealthCache = this.getMaxHealth(); diff --git a/patches/server/0373-Avoid-hopper-searches-if-there-are-no-items.patch b/patches/server/0373-Avoid-hopper-searches-if-there-are-no-items.patch index ecc0cb593c..1178cde9fe 100644 --- a/patches/server/0373-Avoid-hopper-searches-if-there-are-no-items.patch +++ b/patches/server/0373-Avoid-hopper-searches-if-there-are-no-items.patch @@ -14,10 +14,10 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear Combined, this adds up a lot. diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 864b3efc014bf1c499257d01a7e8bce910ae85d0..7ffe9718188ba57cb2a7b934a40d5f893543a63a 100644 +index fa8cf70d7d24a82757326ff8f7f240cff3dcbe73..fd23c7913b7a426443515e14be0ac9814a5e934e 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -989,7 +989,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -994,7 +994,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } } diff --git a/patches/server/0375-Optimise-getChunkAt-calls-for-loaded-chunks.patch b/patches/server/0375-Optimise-getChunkAt-calls-for-loaded-chunks.patch index ae9005672a..e893ed12f3 100644 --- a/patches/server/0375-Optimise-getChunkAt-calls-for-loaded-chunks.patch +++ b/patches/server/0375-Optimise-getChunkAt-calls-for-loaded-chunks.patch @@ -7,10 +7,10 @@ bypass the need to get a player chunk, then get the either, then unwrap it... diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 26f99965e63d36ce4b8cd0482ae21b0c37994caa..c849ded5448112289a3c37f05dc49fadbf619f81 100644 +index 136c6db28ca4d9244ce9341e341b1f36cd643ea3..b336b3ff4425dc6ba3dc55a6faa48660b7a4fc99 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -451,6 +451,12 @@ public class ServerChunkCache extends ChunkSource { +@@ -450,6 +450,12 @@ public class ServerChunkCache extends ChunkSource { return this.getChunk(x, z, leastStatus, create); }, this.mainThreadProcessor).join(); } else { @@ -23,7 +23,7 @@ index 26f99965e63d36ce4b8cd0482ae21b0c37994caa..c849ded5448112289a3c37f05dc49fad ProfilerFiller gameprofilerfiller = this.level.getProfiler(); gameprofilerfiller.incrementCounter("getChunk"); -@@ -502,39 +508,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -501,39 +507,7 @@ public class ServerChunkCache extends ChunkSource { if (Thread.currentThread() != this.mainThread) { return null; } else { diff --git a/patches/server/0376-Add-debug-for-sync-chunk-loads.patch b/patches/server/0376-Add-debug-for-sync-chunk-loads.patch index 388b94680e..16508218c5 100644 --- a/patches/server/0376-Add-debug-for-sync-chunk-loads.patch +++ b/patches/server/0376-Add-debug-for-sync-chunk-loads.patch @@ -10,7 +10,7 @@ chunks, however it must be enabled by setting the startup flag To get a debug log for sync loads, the command is /paper syncloadinfo diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index 7b5afc5d34b78e6404c1a5c6bb823d9589471f13..de45163023f436d386e90e6ded5e6105ba3ecf35 100644 +index c6254f39f98b821f75a21c0ecea457f73247385f..42583cc3a6e2631614a4b9c303b1cfa4c9ae92c6 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -1,11 +1,17 @@ @@ -279,10 +279,10 @@ index 0000000000000000000000000000000000000000..524f33371b9de1d4dd6972fe59ffbe18 + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index c849ded5448112289a3c37f05dc49fadbf619f81..77f88e081991e85d03540e30b9def5dac9ad59be 100644 +index b336b3ff4425dc6ba3dc55a6faa48660b7a4fc99..fa95d7aae33e7cd0c5d178247cf785cb58041a0d 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -483,6 +483,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -482,6 +482,7 @@ public class ServerChunkCache extends ChunkSource { this.level.asyncChunkTaskManager.raisePriority(x1, z1, com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGHEST_PRIORITY); com.destroystokyo.paper.io.chunk.ChunkTaskManager.pushChunkWait(this.level, x1, z1); // Paper end @@ -291,7 +291,7 @@ index c849ded5448112289a3c37f05dc49fadbf619f81..77f88e081991e85d03540e30b9def5da chunkproviderserver_a.managedBlock(completablefuture::isDone); com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index fcf5c7b28e927db977ad5b851edaf68e59de8d5b..87a18dcbfbb55410f04e99e84958f22f21193066 100644 +index 59f14aa0ffcd61848ae6747d7a0330129a97d5a2..f0ce4150e863ea0d1f4a2f6a22d1be6a482cc78d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -280,6 +280,12 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl diff --git a/patches/server/0379-Entity-Jump-API.patch b/patches/server/0379-Entity-Jump-API.patch index 0f8e406121..b9b798bf6c 100644 --- a/patches/server/0379-Entity-Jump-API.patch +++ b/patches/server/0379-Entity-Jump-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity Jump API diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index d03d0c896ef7758dbfbf5b9aa3119e07e6ef389c..6388c03176449cb7b22ed9cfb26ab0bfbcf75ccc 100644 +index 3df3bc95bff4a170f4fc5757239c7e0efd6fae62..cac53191c09e434a952d463d55eb525ecdf3fb38 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3159,8 +3159,10 @@ public abstract class LivingEntity extends Entity { +@@ -3162,8 +3162,10 @@ public abstract class LivingEntity extends Entity { } else if (this.isInLava() && (!this.onGround || d7 > d8)) { this.jumpInLiquid((Tag) FluidTags.LAVA); } else if ((this.onGround || flag && d7 <= d8) && this.noJumpDelay == 0) { diff --git a/patches/server/0383-Prevent-teleporting-dead-entities.patch b/patches/server/0383-Prevent-teleporting-dead-entities.patch index b33d4c3cd7..413bf3cf6a 100644 --- a/patches/server/0383-Prevent-teleporting-dead-entities.patch +++ b/patches/server/0383-Prevent-teleporting-dead-entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent teleporting dead entities diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f0c22ac0765cf3efa105f99c3f5c4ca3243914eb..fae06882217adf20c6f81db2793ee3930cba30c0 100644 +index 4d3d6a7bb4be76004539fd33c06a421b7052f4f5..b946747bf864369e5010689ee44bbc462a644d20 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1500,6 +1500,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1480,6 +1480,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set set, boolean flag) { diff --git a/patches/server/0388-Optimise-TickListServer-by-rewriting-it.patch b/patches/server/0388-Optimise-TickListServer-by-rewriting-it.patch index c883a57aef..75078ea709 100644 --- a/patches/server/0388-Optimise-TickListServer-by-rewriting-it.patch +++ b/patches/server/0388-Optimise-TickListServer-by-rewriting-it.patch @@ -924,10 +924,10 @@ index 1dd1b9afaee38fdc994ad0a069bd63b02eedf55c..8104b9be5a8e8d57f6f50475788aec6a }); // Paper end diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index d2d0350bd16cd818be328afcc2c07f4381dac169..0d948d4d247a12a49fae99e68874a9e65bf76a68 100644 +index fa95d7aae33e7cd0c5d178247cf785cb58041a0d..b9516560183d37ef2917a3f9aaba60a53bcdfd72 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -220,6 +220,12 @@ public class ServerChunkCache extends ChunkSource { +@@ -219,6 +219,12 @@ public class ServerChunkCache extends ChunkSource { }, this.mainThreadProcessor); } // Paper end @@ -941,7 +941,7 @@ index d2d0350bd16cd818be328afcc2c07f4381dac169..0d948d4d247a12a49fae99e68874a9e6 public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, boolean flag, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkstatusupdatelistener, Supplier supplier) { this.level = world; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 29e41754cca805c281ee48c35b149ebb58c3f2f6..755b413ff2c28f9811e4b4c44461beca2ebd5273 100644 +index f0ce4150e863ea0d1f4a2f6a22d1be6a482cc78d..2b7e10a65221a7ffd6211306f974c79deb897852 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -295,6 +295,15 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl diff --git a/patches/server/0389-Pillager-patrol-spawn-settings-and-per-player-option.patch b/patches/server/0389-Pillager-patrol-spawn-settings-and-per-player-option.patch index c768cbca55..c09082cbfb 100644 --- a/patches/server/0389-Pillager-patrol-spawn-settings-and-per-player-option.patch +++ b/patches/server/0389-Pillager-patrol-spawn-settings-and-per-player-option.patch @@ -36,10 +36,10 @@ index 9dc8a9e49cac89e236d9fa0c053b70bf10ed6f6e..2d038185846ae34bc301ab93d881022a private void entitiesTargetWithFollowRange() { entitiesTargetWithFollowRange = getBoolean("entities-target-with-follow-range", entitiesTargetWithFollowRange); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 4ea2203d1acbaa60839acb9cdf48fbcc73e4eff0..0f0b8ea55c4917e5ee8698eb19970af876b65978 100644 +index f7e199a375a49756f9bbbc17b54d74c71923457e..1ec947d1b6b6e15e4c854e95abf9270ba48e70ae 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -219,6 +219,7 @@ public class ServerPlayer extends Player { +@@ -220,6 +220,7 @@ public class ServerPlayer extends Player { public boolean wonGame; private int containerUpdateDelay; // Paper public long loginTime; // Paper diff --git a/patches/server/0390-Remote-Connections-shouldn-t-hold-up-shutdown.patch b/patches/server/0390-Remote-Connections-shouldn-t-hold-up-shutdown.patch index 64931753ef..85da045b99 100644 --- a/patches/server/0390-Remote-Connections-shouldn-t-hold-up-shutdown.patch +++ b/patches/server/0390-Remote-Connections-shouldn-t-hold-up-shutdown.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Remote Connections shouldn't hold up shutdown Bugs in the connection logic appears to leave stale connections even, preventing shutdown diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 6f9b7c3cf22d0c44f31b81bcbfa3cb1f8c065083..0511f1921193b78cbf4d8426136bf1f79746f955 100644 +index 047ec5fe63789fb0ac003ecee641542f5e9cba2f..b6ccc8cacb615a35a60c73f145b7bd1cf0b891ee 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -439,11 +439,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -441,11 +441,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } if (this.rconThread != null) { diff --git a/patches/server/0392-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch b/patches/server/0392-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch index 45f752e863..5140816a25 100644 --- a/patches/server/0392-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch +++ b/patches/server/0392-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch @@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding Stack will identify any causer of this and warn instead of crashing. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 1d22a2179fcd3b613bea609770b551c7702a581e..db7eb46f3b77835d1b5b67674d2e66fb99cc2fb7 100644 +index b2d88e0423d93fdb45dc8ca7d53c98069ade749e..2b291296821dc6d6a8437bd977eeba517cdb5003 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1507,6 +1507,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1508,6 +1508,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public void addEntity(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot @@ -26,7 +26,7 @@ index 1d22a2179fcd3b613bea609770b551c7702a581e..db7eb46f3b77835d1b5b67674d2e66fb EntityType entitytypes = entity.getType(); int i = entitytypes.clientTrackingRange() * 16; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index cafd2299ccc0a803f6c7e131c49644b6bdf508a6..a3b7bcdda3465e4ae8a9cdb8169673f2c7dbce5d 100644 +index 2b7e10a65221a7ffd6211306f974c79deb897852..4ab1b6b8fb2e320c5654f8d0399bd40b40e3e0cf 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2100,7 +2100,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl diff --git a/patches/server/0393-Optimize-Collision-to-not-load-chunks.patch b/patches/server/0393-Optimize-Collision-to-not-load-chunks.patch index 531d6374a2..3b0b30660b 100644 --- a/patches/server/0393-Optimize-Collision-to-not-load-chunks.patch +++ b/patches/server/0393-Optimize-Collision-to-not-load-chunks.patch @@ -14,10 +14,10 @@ movement will load only the chunk the player enters anyways and avoids loading massive amounts of surrounding chunks due to large AABB lookups. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 43f2d2bbb2bcb4b77b4f11916143f3566b3dcaef..22c1aacb517c8bb4a745a52437cfa687de2fe272 100644 +index 10eb562d2089dc20c9ec33956c3e2f98084de748..b828d6b2ce20a058acbabba5594e743d91df3060 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -789,6 +789,7 @@ public abstract class PlayerList { +@@ -791,6 +791,7 @@ public abstract class PlayerList { entityplayer1.forceSetPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); // CraftBukkit end @@ -26,7 +26,7 @@ index 43f2d2bbb2bcb4b77b4f11916143f3566b3dcaef..22c1aacb517c8bb4a745a52437cfa687 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 d7a4fd6ce9d35500a7c6a21b456f5f0a075e43e8..1a3d6368b84aa24b6d0361dd30bc06b79f1d5133 100644 +index 57a6f748891720ee65ba6fae700fe673967ade8c..6e9bf4154e1c3bdec3d63c21c85b5ad67323c386 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -172,6 +172,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n diff --git a/patches/server/0394-Don-t-tick-dead-players.patch b/patches/server/0394-Don-t-tick-dead-players.patch index d6aed1b75a..6c8c54b28a 100644 --- a/patches/server/0394-Don-t-tick-dead-players.patch +++ b/patches/server/0394-Don-t-tick-dead-players.patch @@ -7,10 +7,10 @@ Causes sync chunk loads and who knows what all else. This is safe because Spectators are skipped in unloaded chunks too in vanilla. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 0f0b8ea55c4917e5ee8698eb19970af876b65978..572b0e5911d8a7b0f3dea07301241696958d53fe 100644 +index 1ec947d1b6b6e15e4c854e95abf9270ba48e70ae..9a78729da82e0e8625ccdd33e221b019bad91a1c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -643,7 +643,7 @@ public class ServerPlayer extends Player { +@@ -639,7 +639,7 @@ public class ServerPlayer extends Player { public void doTick() { try { diff --git a/patches/server/0395-Dead-Player-s-shouldn-t-be-able-to-move.patch b/patches/server/0395-Dead-Player-s-shouldn-t-be-able-to-move.patch index ca71554c13..8cf5a182b3 100644 --- a/patches/server/0395-Dead-Player-s-shouldn-t-be-able-to-move.patch +++ b/patches/server/0395-Dead-Player-s-shouldn-t-be-able-to-move.patch @@ -7,10 +7,10 @@ This fixes a lot of game state issues where packets were delayed for processing due to 1.15's new queue but processed while dead. diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 857346b755454956268cc594bb03dc060f2a4aac..1b47cf893174a64dcbf3771738b6c6d443c193af 100644 +index 4ce8bdb30e24822273d6c608c8a2002877fa99fc..d8f4dc4b6b923e70c70e9c607cda2c19c372fa75 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1106,7 +1106,7 @@ public abstract class Player extends LivingEntity { +@@ -1102,7 +1102,7 @@ public abstract class Player extends LivingEntity { @Override protected boolean isImmobile() { diff --git a/patches/server/0396-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch b/patches/server/0396-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch index e378e35b2e..140aad5ab3 100644 --- a/patches/server/0396-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch +++ b/patches/server/0396-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch @@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..f6ff4d8132a95895680f5bc81f8f873e + } +} diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 530916b8d0c5eb3b7b379100df1e6e0d4ade273d..4d82abf234f67af124dff3f726a6a2e39313a780 100644 +index 4bc418f45c6f16a9a1c78b6688625268870a96ad..2d5b8e35d52b0dfd075af81a3a936d8a21053b31 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -614,7 +614,7 @@ public final class MCUtil { @@ -70,7 +70,7 @@ index 530916b8d0c5eb3b7b379100df1e6e0d4ade273d..4d82abf234f67af124dff3f726a6a2e3 List allChunks = new ArrayList<>(visibleChunks.values()); List players = world.players; diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index f75a78f60565be1c8e8b0ce5f3937441f59e1f29..22f6898b96c68fa53ca5900985c18a6f2f5a8b57 100644 +index 2b291296821dc6d6a8437bd977eeba517cdb5003..962028a58ee54b99be20905c1fd16cfe15c82175 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -112,9 +112,36 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -121,7 +121,7 @@ index f75a78f60565be1c8e8b0ce5f3937441f59e1f29..22f6898b96c68fa53ca5900985c18a6f this.pendingUnloads = new Long2ObjectLinkedOpenHashMap(); this.entitiesInLevel = new LongOpenHashSet(); this.toDrop = new LongOpenHashSet(); -@@ -376,9 +403,52 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -378,9 +405,52 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return (ChunkHolder) this.updatingChunkMap.get(pos); } @@ -175,7 +175,7 @@ index f75a78f60565be1c8e8b0ce5f3937441f59e1f29..22f6898b96c68fa53ca5900985c18a6f } protected IntSupplier getChunkQueueLevel(long pos) { -@@ -535,8 +605,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -537,8 +607,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } protected void saveAllChunks(boolean flush) { @@ -186,16 +186,16 @@ index f75a78f60565be1c8e8b0ce5f3937441f59e1f29..22f6898b96c68fa53ca5900985c18a6f MutableBoolean mutableboolean = new MutableBoolean(); do { -@@ -567,7 +638,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -568,7 +639,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + this.level.asyncChunkTaskManager.flush(); // Paper - flush to preserve behavior compat with pre-async behaviour // this.i(); // Paper - nuke IOWorker - ChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.storageFolder.getName()); } else { - this.visibleChunkMap.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).forEach((playerchunk) -> { + visibleChunks.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).forEach((playerchunk) -> { ChunkAccess ichunkaccess = (ChunkAccess) playerchunk.getChunkToSave().getNow(null); // CraftBukkit - decompile error if (ichunkaccess instanceof ImposterProtoChunk || ichunkaccess instanceof LevelChunk) { -@@ -725,7 +796,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -726,7 +797,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (!this.modified) { return false; } else { @@ -217,7 +217,7 @@ index f75a78f60565be1c8e8b0ce5f3937441f59e1f29..22f6898b96c68fa53ca5900985c18a6f this.modified = false; return true; } -@@ -1172,12 +1256,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1173,12 +1257,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } protected Iterable getChunks() { @@ -233,10 +233,10 @@ index f75a78f60565be1c8e8b0ce5f3937441f59e1f29..22f6898b96c68fa53ca5900985c18a6f while (objectbidirectionaliterator.hasNext()) { Entry entry = (Entry) objectbidirectionaliterator.next(); diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 43007f8cc9a88d7e6fb435551edac4d93a5668a9..6d999e0de0497114e46445981c64ee70f882c782 100644 +index b9516560183d37ef2917a3f9aaba60a53bcdfd72..b3c66e3f3ef47949f90efa023610ede55aabdf91 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -767,7 +767,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -766,7 +766,7 @@ public class ServerChunkCache extends ChunkSource { }; // Paper end this.level.timings.chunkTicks.startTiming(); // Paper diff --git a/patches/server/0397-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch b/patches/server/0397-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch index a9d8f548a7..822a2cd84b 100644 --- a/patches/server/0397-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch +++ b/patches/server/0397-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch @@ -42,7 +42,7 @@ index b47b7dce26805badd422c1867733ff4bfd00e9f4..b9cdbf8acccfd6b207a0116f068168f3 public static final Timing commandFunctionsTimer = Timings.ofSafe("Command Functions"); public static final Timing connectionTimer = Timings.ofSafe("Connection Handler"); diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index da93d38fe63035e4ff198ada84a4431f52d97c01..ddbc8cb712c50038922eded75dd6ca85fe851078 100644 +index bfdf4b302860d56dec485af77c69d18db22dc6f4..5c67c51dd0a19357086d4ceb3ca724401e4d26b8 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -410,4 +410,9 @@ public class PaperConfig { @@ -56,10 +56,10 @@ index da93d38fe63035e4ff198ada84a4431f52d97c01..ddbc8cb712c50038922eded75dd6ca85 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ac53eb7bc69e1566d20df3b7cba33034c344952a..f1c08a811c05a29eda4686c1143cc27fd91d7311 100644 +index ce438760cbc92c08c079d06a8b97eaeda1018491..0115ffe84356468ddc254d8d5bdd719bc5e7e3f8 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1112,6 +1112,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { @@ -108,7 +108,7 @@ index ac53eb7bc69e1566d20df3b7cba33034c344952a..f1c08a811c05a29eda4686c1143cc27f return !this.canOversleep(); }); isOversleep = false;MinecraftTimings.serverOversleep.stopTiming(); -@@ -1379,13 +1398,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); if (optional.isPresent()) { -@@ -784,6 +786,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -777,6 +779,7 @@ public class ServerChunkCache extends ChunkSource { chunk.setInhabitedTime(chunk.getInhabitedTime() + j); if (flag1 && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunk.getPos()) && !this.chunkMap.isOutsideOfRange(chunkcoordintpair, true)) { // Spigot NaturalSpawner.spawnForChunk(this.level, chunk, spawnercreature_d, this.spawnFriendlies, this.spawnEnemies, flag2); @@ -183,7 +183,16 @@ index 6d999e0de0497114e46445981c64ee70f882c782..0c76218134bdf8d80e3680227934ff5f } // this.level.timings.doTickTiles.startTiming(); // Spigot // Paper -@@ -951,6 +954,41 @@ public class ServerChunkCache extends ChunkSource { +@@ -794,7 +797,7 @@ public class ServerChunkCache extends ChunkSource { + } + + this.level.getProfiler().popPush("broadcast"); +- this.chunkMap.getChunks().forEach((playerchunk) -> { // Paper - no... just no... ++ this.chunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping + Optional optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); // CraftBukkit - decompile error + + Objects.requireNonNull(playerchunk); +@@ -958,6 +961,41 @@ public class ServerChunkCache extends ChunkSource { super.doRunTask(task); } @@ -226,10 +235,10 @@ index 6d999e0de0497114e46445981c64ee70f882c782..0c76218134bdf8d80e3680227934ff5f // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task public boolean pollTask() { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index fca0453ee83f7592e7ad7c572e238202247a93a1..16ff687d16bef0a485aacbcd80a3bcfa1bb08224 100644 +index 4ab1b6b8fb2e320c5654f8d0399bd40b40e3e0cf..c05b5cdd26abcf90f4c44099d186938ccdd57608 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -587,6 +587,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl +@@ -583,6 +583,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl } timings.scheduledBlocks.stopTiming(); // Paper diff --git a/patches/server/0398-Don-t-move-existing-players-to-world-spawn.patch b/patches/server/0398-Don-t-move-existing-players-to-world-spawn.patch index 7f15dfd70d..875a722e71 100644 --- a/patches/server/0398-Don-t-move-existing-players-to-world-spawn.patch +++ b/patches/server/0398-Don-t-move-existing-players-to-world-spawn.patch @@ -10,10 +10,10 @@ larger than the keep loaded range. By skipping this, we avoid potential for a large spike on server start. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 572b0e5911d8a7b0f3dea07301241696958d53fe..bb69775a9c96b064be24fe740b3eaa2c916a6760 100644 +index 9a78729da82e0e8625ccdd33e221b019bad91a1c..f555559f88634a1ec962dedd3fc96e044546f496 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -314,7 +314,7 @@ public class ServerPlayer extends Player { +@@ -310,7 +310,7 @@ public class ServerPlayer extends Player { this.stats = server.getPlayerList().getStatisticManager(this); this.advancements = server.getPlayerList().getPlayerAdvancements(this); this.maxUpStep = 1.0F; @@ -22,7 +22,7 @@ index 572b0e5911d8a7b0f3dea07301241696958d53fe..bb69775a9c96b064be24fe740b3eaa2c this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper -@@ -533,7 +533,7 @@ public class ServerPlayer extends Player { +@@ -529,7 +529,7 @@ public class ServerPlayer extends Player { position = Vec3.atCenterOf(((ServerLevel) world).getSharedSpawnPos()); } this.level = world; @@ -32,10 +32,10 @@ index 572b0e5911d8a7b0f3dea07301241696958d53fe..bb69775a9c96b064be24fe740b3eaa2c this.gameMode.setLevel((ServerLevel) world); } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 18dbd79b02e032e082eba3ab42c729cadee79af7..99711578f0f0281f71990a0fac0a727fdd49449f 100644 +index b828d6b2ce20a058acbabba5594e743d91df3060..6f3187aae34c24c6a9b22074d487006926afe524 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -208,6 +208,8 @@ public abstract class PlayerList { +@@ -210,6 +210,8 @@ public abstract class PlayerList { worldserver1 = worldserver; } diff --git a/patches/server/0399-Add-tick-times-API-and-mspt-command.patch b/patches/server/0399-Add-tick-times-API-and-mspt-command.patch index b1f8fb838e..c413d68f86 100644 --- a/patches/server/0399-Add-tick-times-API-and-mspt-command.patch +++ b/patches/server/0399-Add-tick-times-API-and-mspt-command.patch @@ -87,10 +87,10 @@ index ddbc8cb712c50038922eded75dd6ca85fe851078..78271b400c79578d043b20a5389a37b1 version = getInt("config-version", 20); set("config-version", 20); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index efc6760e3ff4f062f64150ce0f3493da00a37928..04bc9fdfb75bc311f382181d7b02542a7d5878ff 100644 +index 0115ffe84356468ddc254d8d5bdd719bc5e7e3f8..def1edb961ba41819ce30c427b1616578a513433 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -249,6 +249,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; @@ -83,7 +83,7 @@ index 04bc9fdfb75bc311f382181d7b02542a7d5878ff..d1b5cba7c5a5edc3810ea63e30d60898 // CraftBukkit end // Spigot start public static final int TPS = 20; -@@ -311,6 +311,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); Thread thread = new Thread(() -> { -@@ -908,6 +911,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { CompletableFuture completablefuture; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 99711578f0f0281f71990a0fac0a727fdd49449f..c9bfb48d487a777fdd6750902e1e2e8f80e15b54 100644 +index 6f3187aae34c24c6a9b22074d487006926afe524..11079851f8a375d987933b53409b789030b3220d 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -511,7 +511,7 @@ public abstract class PlayerList { +@@ -513,7 +513,7 @@ public abstract class PlayerList { this.cserver.getPluginManager().callEvent(playerQuitEvent); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); @@ -299,10 +299,10 @@ index 7bf4bf5cb2c1b54a7e2733091f48f3a824336d36..dcce05d2f4ab16424db4ab103a12188e } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index b754595caea63081e86476f508b14f3522076a66..b0e953cb4fb6c4ccd39ee02e572f7f7c525fc4cb 100644 +index fd23c7913b7a426443515e14be0ac9814a5e934e..9cf64082555d848e4149f9a982dd770db9defa3c 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -843,6 +843,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -848,6 +848,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { try { tickConsumer.accept(entity); } catch (Throwable throwable) { @@ -323,7 +323,7 @@ index fcacaa9e41c2418484d2fe9e7952be47943a2177..7d33ad1ec939de4527d0acb0915f0587 final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 814b64b792b76204f51b1ed49c72afb41e4589ff..c913c4e5d1a61d46c84c4c5f901da9195a6879bb 100644 +index e3fc72a86aea884b9bd85803baf8cd2c0bb7eb1c..7af2baea88a29d43afffbaa11ce57d69ca606be0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1845,7 +1845,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0409-Prevent-opening-inventories-when-frozen.patch b/patches/server/0409-Prevent-opening-inventories-when-frozen.patch index f7409d4c41..f053698740 100644 --- a/patches/server/0409-Prevent-opening-inventories-when-frozen.patch +++ b/patches/server/0409-Prevent-opening-inventories-when-frozen.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent opening inventories when frozen diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index bb69775a9c96b064be24fe740b3eaa2c916a6760..cb547b06724d5d4947580232198597deee9e480d 100644 +index f555559f88634a1ec962dedd3fc96e044546f496..22aefdc7a096993c15c9b4e2f37ad84d1279a2df 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -614,7 +614,7 @@ public class ServerPlayer extends Player { +@@ -610,7 +610,7 @@ public class ServerPlayer extends Player { containerUpdateDelay = level.paperConfig.containerUpdateTickRate; } // Paper end @@ -17,7 +17,7 @@ index bb69775a9c96b064be24fe740b3eaa2c916a6760..cb547b06724d5d4947580232198597de this.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper this.containerMenu = this.inventoryMenu; } -@@ -1455,7 +1455,7 @@ public class ServerPlayer extends Player { +@@ -1451,7 +1451,7 @@ public class ServerPlayer extends Player { } else { // CraftBukkit start this.containerMenu = container; @@ -27,7 +27,7 @@ index bb69775a9c96b064be24fe740b3eaa2c916a6760..cb547b06724d5d4947580232198597de this.initMenu(container); return OptionalInt.of(this.containerCounter); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 43cee8b0b2b94d6db6303a1631731ed515eb806d..31b62dc1ee06b254c398cbfe157283fb199ef0fe 100644 +index a9f8ffa1772de39c74394f8cf324ab77ff4e0450..c52a075ebc9ff041d9b08c38ed02dee80dd15bb9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -322,7 +322,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/patches/server/0411-Don-t-run-entity-collision-code-if-not-needed.patch b/patches/server/0411-Don-t-run-entity-collision-code-if-not-needed.patch index bbe2a62a45..24f15aeb5a 100644 --- a/patches/server/0411-Don-t-run-entity-collision-code-if-not-needed.patch +++ b/patches/server/0411-Don-t-run-entity-collision-code-if-not-needed.patch @@ -7,10 +7,10 @@ Will not run if max entity craming is disabled and the max collisions per entity is less than or equal to 0 diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 6388c03176449cb7b22ed9cfb26ab0bfbcf75ccc..f91c7cdd918ec1d329903beae9f3c0fd1da710c8 100644 +index cac53191c09e434a952d463d55eb525ecdf3fb38..2941786fd39f4feb99e7b40fc28410863eb20961 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3256,10 +3256,16 @@ public abstract class LivingEntity extends Entity { +@@ -3259,10 +3259,16 @@ public abstract class LivingEntity extends Entity { protected void serverAiStep() {} protected void pushEntities() { diff --git a/patches/server/0413-Implement-Player-Client-Options-API.patch b/patches/server/0413-Implement-Player-Client-Options-API.patch index 2906f79e78..0ba7dc94d1 100644 --- a/patches/server/0413-Implement-Player-Client-Options-API.patch +++ b/patches/server/0413-Implement-Player-Client-Options-API.patch @@ -85,10 +85,10 @@ index 0000000000000000000000000000000000000000..b6f4400df3d8ec7e06a996de54f8cabb + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index cb547b06724d5d4947580232198597deee9e480d..017a809ce774ea63104c952151786a214a00f29d 100644 +index 22aefdc7a096993c15c9b4e2f37ad84d1279a2df..3cab5fbfc1cae65efbf53b69cc0da012370f9a17 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1807,6 +1807,7 @@ public class ServerPlayer extends Player { +@@ -1803,6 +1803,7 @@ public class ServerPlayer extends Player { public String locale = null; // CraftBukkit - add, lowercase // Paper - default to null public java.util.Locale adventure$locale = java.util.Locale.US; // Paper public void updateOptions(ServerboundClientInformationPacket packet) { diff --git a/patches/server/0414-Fix-Chunk-Post-Processing-deadlock-risk.patch b/patches/server/0414-Fix-Chunk-Post-Processing-deadlock-risk.patch index e4336ead15..d8728f4549 100644 --- a/patches/server/0414-Fix-Chunk-Post-Processing-deadlock-risk.patch +++ b/patches/server/0414-Fix-Chunk-Post-Processing-deadlock-risk.patch @@ -25,7 +25,7 @@ This successfully fixed a reoccurring and highly reproduceable crash for heightmaps. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 538bb603b1a516f33bbe8c4e1974efc902c4bc85..7ef52d0ae501312590802acb5f54fcf6f7cdac9e 100644 +index 6d810cdb538d078dbf7ccd2ef84a4be27eb1f3e7..aa9846c7d6b8499e01bf0ffeece6a940e0879328 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -195,6 +195,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -36,7 +36,7 @@ index 538bb603b1a516f33bbe8c4e1974efc902c4bc85..7ef52d0ae501312590802acb5f54fcf6 // Paper start - distance maps private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>(); // Paper start - no-tick view distance -@@ -1090,7 +1091,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1091,7 +1092,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return Either.left(chunk); }); }, (runnable) -> { @@ -46,10 +46,10 @@ index 538bb603b1a516f33bbe8c4e1974efc902c4bc85..7ef52d0ae501312590802acb5f54fcf6 completablefuture1.thenAcceptAsync((either) -> { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 0c76218134bdf8d80e3680227934ff5f70c26df2..0bb931ae8faa8e1fe36895d8321a9b36d325c3ed 100644 +index de0ef9f056f86e1e0d75f40c9b842ffbe4b37b41..da2a7abd3d2bd1a83e2a3f3a458287730e5a29da 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -1001,6 +1001,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -1008,6 +1008,7 @@ public class ServerChunkCache extends ChunkSource { return super.pollTask() || execChunkTask; // Paper } } finally { diff --git a/patches/server/0416-Broadcast-join-message-to-console.patch b/patches/server/0416-Broadcast-join-message-to-console.patch index dc3db9e413..1f8a36b70f 100644 --- a/patches/server/0416-Broadcast-join-message-to-console.patch +++ b/patches/server/0416-Broadcast-join-message-to-console.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Broadcast join message to console diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 449845bc547211fc0568871a60773c713a68a876..c14fba206e2f124cded3e00e2cb584e21a43971d 100644 +index 11079851f8a375d987933b53409b789030b3220d..c6d7d546ca79f71aadafe92d5d91f7ace8a07a0d 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -292,7 +292,9 @@ public abstract class PlayerList { +@@ -294,7 +294,9 @@ public abstract class PlayerList { if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure joinMessage = PaperAdventure.asVanilla(jm); // Paper - Adventure diff --git a/patches/server/0417-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch b/patches/server/0417-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch index 85a3c65faf..14f179bc82 100644 --- a/patches/server/0417-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch +++ b/patches/server/0417-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch @@ -28,10 +28,10 @@ receives a deterministic result, and should no longer require 1 tick delays anymore. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index bebdff5bc9d2e25d8799d4a9c1b388efd00b66e0..38a23cf4e5ab8d5d4a8af5cbf4990dca219e6ce2 100644 +index aa9846c7d6b8499e01bf0ffeece6a940e0879328..2b4c35d9bd186fd7c3650a7ad791cd67fb64e635 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1600,6 +1600,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1601,6 +1601,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider .printStackTrace(); return; } @@ -40,10 +40,10 @@ index bebdff5bc9d2e25d8799d4a9c1b388efd00b66e0..38a23cf4e5ab8d5d4a8af5cbf4990dca if (!(entity instanceof EnderDragonPart)) { EntityType entitytypes = entity.getType(); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 017a809ce774ea63104c952151786a214a00f29d..7603ad40ede34625be1cb906062a43e9b0eb9ab3 100644 +index 3cab5fbfc1cae65efbf53b69cc0da012370f9a17..8548d24c2344ee32edbea65614d8bea557a17f42 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -242,6 +242,7 @@ public class ServerPlayer extends Player { +@@ -243,6 +243,7 @@ public class ServerPlayer extends Player { public double maxHealthCache; public boolean joining = true; public boolean sentListPacket = false; @@ -52,10 +52,10 @@ index 017a809ce774ea63104c952151786a214a00f29d..7603ad40ede34625be1cb906062a43e9 // CraftBukkit end public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 7fdc16e91cbac7fbe07e1cca1f68c7c14497d5a7..cb2024035fbb6352e4be46be0cdbaf85fdc0ed40 100644 +index c6d7d546ca79f71aadafe92d5d91f7ace8a07a0d..9609579e6d61c3975740d07a394680aeef952516 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -275,6 +275,12 @@ public abstract class PlayerList { +@@ -277,6 +277,12 @@ public abstract class PlayerList { this.playersByUUID.put(player.getUUID(), player); // this.sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[]{entityplayer})); // CraftBukkit - replaced with loop below @@ -68,7 +68,7 @@ index 7fdc16e91cbac7fbe07e1cca1f68c7c14497d5a7..cb2024035fbb6352e4be46be0cdbaf85 // CraftBukkit start CraftPlayer bukkitPlayer = player.getBukkitEntity(); -@@ -315,6 +321,8 @@ public abstract class PlayerList { +@@ -317,6 +323,8 @@ public abstract class PlayerList { player.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, new ServerPlayer[] { entityplayer1})); } player.sentListPacket = true; @@ -77,7 +77,7 @@ index 7fdc16e91cbac7fbe07e1cca1f68c7c14497d5a7..cb2024035fbb6352e4be46be0cdbaf85 // CraftBukkit end player.connection.send(new ClientboundSetEntityDataPacket(player.getId(), player.getEntityData(), true)); // CraftBukkit - BungeeCord#2321, send complete data to self on spawn -@@ -340,6 +348,11 @@ public abstract class PlayerList { +@@ -342,6 +350,11 @@ public abstract class PlayerList { playerconnection.send(new ClientboundUpdateMobEffectPacket(player.getId(), mobeffect)); } @@ -89,7 +89,7 @@ index 7fdc16e91cbac7fbe07e1cca1f68c7c14497d5a7..cb2024035fbb6352e4be46be0cdbaf85 if (nbttagcompound != null && nbttagcompound.contains("RootVehicle", 10)) { CompoundTag nbttagcompound1 = nbttagcompound.getCompound("RootVehicle"); // CraftBukkit start -@@ -388,6 +401,10 @@ public abstract class PlayerList { +@@ -390,6 +403,10 @@ public abstract class PlayerList { } } @@ -100,7 +100,7 @@ index 7fdc16e91cbac7fbe07e1cca1f68c7c14497d5a7..cb2024035fbb6352e4be46be0cdbaf85 player.initInventoryMenu(); // CraftBukkit - Moved from above, added world // Paper start - Add to collideRule team if needed -@@ -397,6 +414,7 @@ public abstract class PlayerList { +@@ -399,6 +416,7 @@ public abstract class PlayerList { scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam); } // Paper end diff --git a/patches/server/0418-Load-Chunks-for-Login-Asynchronously.patch b/patches/server/0418-Load-Chunks-for-Login-Asynchronously.patch index 0b3231ac76..79e5ff17b0 100644 --- a/patches/server/0418-Load-Chunks-for-Login-Asynchronously.patch +++ b/patches/server/0418-Load-Chunks-for-Login-Asynchronously.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Load Chunks for Login Asynchronously diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 7603ad40ede34625be1cb906062a43e9b0eb9ab3..8f67cbf2b66adfcebff1c6caef5b0996bb7c24ae 100644 +index 8548d24c2344ee32edbea65614d8bea557a17f42..bd51cf65e05b2c6303a4a454f8eee04a97331a69 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -177,6 +177,7 @@ public class ServerPlayer extends Player { +@@ -178,6 +178,7 @@ public class ServerPlayer extends Player { private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32; private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; public ServerGamePacketListenerImpl connection; @@ -16,7 +16,7 @@ index 7603ad40ede34625be1cb906062a43e9b0eb9ab3..8f67cbf2b66adfcebff1c6caef5b0996 public final MinecraftServer server; public final ServerPlayerGameMode gameMode; private final PlayerAdvancements advancements; -@@ -243,6 +244,7 @@ public class ServerPlayer extends Player { +@@ -244,6 +245,7 @@ public class ServerPlayer extends Player { public boolean joining = true; public boolean sentListPacket = false; public boolean supressTrackerForLogin = false; // Paper @@ -37,10 +37,10 @@ index be677d437d17b74c6188ce1bd5fc6fdc228fd92f..78fbb4c3e52e900956ae0811aaf934c8 public static final TicketType UNKNOWN = TicketType.create("unknown", Comparator.comparingLong(ChunkPos::toLong), 1); public static final TicketType PLUGIN = TicketType.create("plugin", (a, b) -> 0); // CraftBukkit diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index aed93f66cdf8c5a97b04da59129b2ee1371816de..35b2c45991e2470fc565e7206f94c67f54fcdcd6 100644 +index 596eddd7d3814b7e25bbf253612c7a650b368b65..304cc4a82b92a8e27f3abc7a93d1ab8fcfd277f4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -221,6 +221,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -220,6 +220,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private static final int LATENCY_CHECK_INTERVAL = 15000; public final Connection connection; private final MinecraftServer server; @@ -48,7 +48,7 @@ index aed93f66cdf8c5a97b04da59129b2ee1371816de..35b2c45991e2470fc565e7206f94c67f public ServerPlayer player; private int tickCount; private long keepAliveTime = Util.getMillis(); -@@ -295,6 +296,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -294,6 +295,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // CraftBukkit end public void tick() { @@ -64,7 +64,7 @@ index aed93f66cdf8c5a97b04da59129b2ee1371816de..35b2c45991e2470fc565e7206f94c67f this.resetPosition(); this.player.xo = this.player.getX(); this.player.yo = this.player.getY(); -@@ -336,7 +346,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -335,7 +345,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.lastVehicle = null; this.clientVehicleIsFloating = false; this.aboveGroundVehicleTickCount = 0; @@ -74,7 +74,7 @@ index aed93f66cdf8c5a97b04da59129b2ee1371816de..35b2c45991e2470fc565e7206f94c67f this.server.getProfiler().push("keepAlive"); // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 12f945e91827470a9a61951e45c062deee8cf281..195f5d1519c3fc2fdd03ecd0d49d7fba74037692 100644 +index b5d8987d2903086d69bbd6ba8092e568c94be63f..bd1203a5b58bac7cccf1f81337fa2967a0e9eb40 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -88,7 +88,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener @@ -96,10 +96,10 @@ index 12f945e91827470a9a61951e45c062deee8cf281..195f5d1519c3fc2fdd03ecd0d49d7fba try { ServerPlayer entityplayer1 = this.server.getPlayerList().processLogin(this.gameProfile, s); // CraftBukkit - add player reference diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index cb2024035fbb6352e4be46be0cdbaf85fdc0ed40..dccba18f87fa8e288d05a1df51fb9ee2489af567 100644 +index 9609579e6d61c3975740d07a394680aeef952516..6b23b9389ff92ae8016d4adb289ac2a097670be5 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -38,6 +38,7 @@ import net.minecraft.network.protocol.Packet; +@@ -40,6 +40,7 @@ import net.minecraft.network.protocol.Packet; import net.minecraft.network.protocol.game.ClientboundChangeDifficultyPacket; import net.minecraft.network.protocol.game.ClientboundChatPacket; import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket; @@ -107,7 +107,7 @@ index cb2024035fbb6352e4be46be0cdbaf85fdc0ed40..dccba18f87fa8e288d05a1df51fb9ee2 import net.minecraft.network.protocol.game.ClientboundEntityEventPacket; import net.minecraft.network.protocol.game.ClientboundGameEventPacket; import net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket; -@@ -133,6 +134,7 @@ public abstract class PlayerList { +@@ -135,6 +136,7 @@ public abstract class PlayerList { private final IpBanList ipBans; private final ServerOpList ops; private final UserWhiteList whitelist; @@ -115,7 +115,7 @@ index cb2024035fbb6352e4be46be0cdbaf85fdc0ed40..dccba18f87fa8e288d05a1df51fb9ee2 // CraftBukkit start // private final Map stats; // private final Map advancements; -@@ -171,6 +173,11 @@ public abstract class PlayerList { +@@ -173,6 +175,11 @@ public abstract class PlayerList { } public void placeNewPlayer(Connection connection, ServerPlayer player) { @@ -127,7 +127,7 @@ index cb2024035fbb6352e4be46be0cdbaf85fdc0ed40..dccba18f87fa8e288d05a1df51fb9ee2 player.loginTime = System.currentTimeMillis(); // Paper GameProfile gameprofile = player.getGameProfile(); GameProfileCache usercache = this.server.getProfileCache(); -@@ -184,7 +191,7 @@ public abstract class PlayerList { +@@ -186,7 +193,7 @@ public abstract class PlayerList { if (nbttagcompound != null && nbttagcompound.contains("bukkit")) { CompoundTag bukkit = nbttagcompound.getCompound("bukkit"); s = bukkit.contains("lastKnownName", 8) ? bukkit.getString("lastKnownName") : s; @@ -136,7 +136,7 @@ index cb2024035fbb6352e4be46be0cdbaf85fdc0ed40..dccba18f87fa8e288d05a1df51fb9ee2 // CraftBukkit end if (nbttagcompound != null) { -@@ -258,6 +265,52 @@ public abstract class PlayerList { +@@ -260,6 +267,52 @@ public abstract class PlayerList { player.getRecipeBook().sendInitialRecipeBook(player); this.updateEntireScoreboard(worldserver1.getScoreboard(), player); this.server.invalidateStatus(); @@ -189,7 +189,7 @@ index cb2024035fbb6352e4be46be0cdbaf85fdc0ed40..dccba18f87fa8e288d05a1df51fb9ee2 TranslatableComponent chatmessage; if (player.getGameProfile().getName().equalsIgnoreCase(s)) { -@@ -501,6 +554,7 @@ public abstract class PlayerList { +@@ -503,6 +556,7 @@ public abstract class PlayerList { protected void save(ServerPlayer player) { if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit @@ -197,7 +197,7 @@ index cb2024035fbb6352e4be46be0cdbaf85fdc0ed40..dccba18f87fa8e288d05a1df51fb9ee2 this.playerIo.save(player); ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit -@@ -528,7 +582,7 @@ public abstract class PlayerList { +@@ -530,7 +584,7 @@ public abstract class PlayerList { } PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); @@ -206,7 +206,7 @@ index cb2024035fbb6352e4be46be0cdbaf85fdc0ed40..dccba18f87fa8e288d05a1df51fb9ee2 entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); if (server.isSameThread()) entityplayer.doTick(); // SPIGOT-924 // Paper - don't tick during emergency shutdowns (Watchdog) -@@ -573,6 +627,13 @@ public abstract class PlayerList { +@@ -575,6 +629,13 @@ public abstract class PlayerList { // this.advancements.remove(uuid); // CraftBukkit end } @@ -220,7 +220,7 @@ index cb2024035fbb6352e4be46be0cdbaf85fdc0ed40..dccba18f87fa8e288d05a1df51fb9ee2 // CraftBukkit start // this.sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, new EntityPlayer[]{entityplayer})); -@@ -590,7 +651,7 @@ public abstract class PlayerList { +@@ -592,7 +653,7 @@ public abstract class PlayerList { this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity()); // CraftBukkit end @@ -229,7 +229,7 @@ index cb2024035fbb6352e4be46be0cdbaf85fdc0ed40..dccba18f87fa8e288d05a1df51fb9ee2 } // CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer -@@ -609,6 +670,13 @@ public abstract class PlayerList { +@@ -611,6 +672,13 @@ public abstract class PlayerList { list.add(entityplayer); } } @@ -244,7 +244,7 @@ index cb2024035fbb6352e4be46be0cdbaf85fdc0ed40..dccba18f87fa8e288d05a1df51fb9ee2 Iterator iterator = list.iterator(); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index c11d1fddd54a0a909bf9952086bff25a3aa82188..9783b06104f6dfe12988733f580ce5e3c5cf1e28 100644 +index 6e9bf4154e1c3bdec3d63c21c85b5ad67323c386..f7feec88a4f3c240eee4e2d9f866957bd00b5e4a 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1511,7 +1511,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n diff --git a/patches/server/0420-Add-PlayerAttackEntityCooldownResetEvent.patch b/patches/server/0420-Add-PlayerAttackEntityCooldownResetEvent.patch index c0ac523d6f..6e04b14102 100644 --- a/patches/server/0420-Add-PlayerAttackEntityCooldownResetEvent.patch +++ b/patches/server/0420-Add-PlayerAttackEntityCooldownResetEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index f91c7cdd918ec1d329903beae9f3c0fd1da710c8..de5ea38fd6103cd70b646199b4e0327f981cec9f 100644 +index 2941786fd39f4feb99e7b40fc28410863eb20961..00610ef5a724a9ab6ec6df29c721a93f3b12bd1d 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2033,7 +2033,16 @@ public abstract class LivingEntity extends Entity { +@@ -2037,7 +2037,16 @@ public abstract class LivingEntity extends Entity { EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption); if (damagesource.getEntity() instanceof net.minecraft.world.entity.player.Player) { diff --git a/patches/server/0425-Implement-Brigadier-Mojang-API.patch b/patches/server/0425-Implement-Brigadier-Mojang-API.patch index b54bd4ef1b..69d821b5b9 100644 --- a/patches/server/0425-Implement-Brigadier-Mojang-API.patch +++ b/patches/server/0425-Implement-Brigadier-Mojang-API.patch @@ -10,7 +10,7 @@ Adds CommandRegisteredEvent - Allows manipulating the CommandNode to add more children/metadata for the client diff --git a/build.gradle.kts b/build.gradle.kts -index f66a20f09f86f754d020d8f1cd2d57f47003fe85..2d738d1c3c8da84bc9b1b88fd5d2fedc89f04fbf 100644 +index 4ec40f9556cecbf1c3ffdce7d253e2b10875d496..35eb06c3b55a93d46c61703c806f4048dcdb8734 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,6 +19,7 @@ repositories { @@ -22,7 +22,7 @@ index f66a20f09f86f754d020d8f1cd2d57f47003fe85..2d738d1c3c8da84bc9b1b88fd5d2fedc implementation("org.jline:jline-terminal-jansi:3.12.1") implementation("net.minecrell:terminalconsoleappender:1.2.0") diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index 60b503dd85706bd2593a5e9d3314540ff1012652..42d97bc67c8f4e5b65a81159179c43dc6edc804c 100644 +index 880fc9fea286384d002518137972935fdf1d2d72..a59d14e61fcbca7861a5593d0717b81262ccbdc5 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java @@ -37,7 +37,7 @@ import net.minecraft.world.phys.Vec2; @@ -81,10 +81,10 @@ index 13e358e0eac3bfd426d924b6f745e001df76c64a..7156dea53be828acd01734fa1f9f7b9a event.getPlayer().getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index c57b5cf7d61eab5a45e3fa69e8804fd0ef4a54ad..ba2bff392a60a2d39f397be97d81f14430f773b3 100644 +index 304cc4a82b92a8e27f3abc7a93d1ab8fcfd277f4..a18a9f86da8015fff02c3efe98c8afbb3ef61235 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -760,8 +760,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -759,8 +759,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { @@ -99,7 +99,7 @@ index c57b5cf7d61eab5a45e3fa69e8804fd0ef4a54ad..ba2bff392a60a2d39f397be97d81f144 }); }); } -@@ -770,7 +774,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -769,7 +773,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser builder = builder.createOffset(builder.getInput().lastIndexOf(' ') + 1); completions.forEach(builder::suggest); diff --git a/patches/server/0427-Validate-PickItem-Packet-and-kick-for-invalid.patch b/patches/server/0427-Validate-PickItem-Packet-and-kick-for-invalid.patch index a17a8b3e62..117af58a11 100644 --- a/patches/server/0427-Validate-PickItem-Packet-and-kick-for-invalid.patch +++ b/patches/server/0427-Validate-PickItem-Packet-and-kick-for-invalid.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Validate PickItem Packet and kick for invalid diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ba2bff392a60a2d39f397be97d81f14430f773b3..f936386b67027b4e8782367cf62ab3332c0711f3 100644 +index a18a9f86da8015fff02c3efe98c8afbb3ef61235..ca3991e3cea5de32418469540fe70b99ff21bed0 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -877,7 +877,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -876,7 +876,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @Override public void handlePickItem(ServerboundPickItemPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); @@ -21,6 +21,6 @@ index ba2bff392a60a2d39f397be97d81f14430f773b3..f936386b67027b4e8782367cf62ab333 + } + this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed + // Paper end - this.player.connection.send(new ClientboundContainerSetSlotPacket(-2, this.player.getInventory().selected, this.player.getInventory().getItem(this.player.getInventory().selected))); - this.player.connection.send(new ClientboundContainerSetSlotPacket(-2, packet.getSlot(), this.player.getInventory().getItem(packet.getSlot()))); + this.player.connection.send(new ClientboundContainerSetSlotPacket(-2, 0, this.player.getInventory().selected, this.player.getInventory().getItem(this.player.getInventory().selected))); + this.player.connection.send(new ClientboundContainerSetSlotPacket(-2, 0, packet.getSlot(), this.player.getInventory().getItem(packet.getSlot()))); this.player.connection.send(new ClientboundSetCarriedItemPacket(this.player.getInventory().selected)); diff --git a/patches/server/0432-Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/0432-Use-distance-map-to-optimise-entity-tracker.patch index ea3e20f83d..7500facde1 100644 --- a/patches/server/0432-Use-distance-map-to-optimise-entity-tracker.patch +++ b/patches/server/0432-Use-distance-map-to-optimise-entity-tracker.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Use distance map to optimise entity tracker Use the distance map to find candidate players for tracking. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index c643919e17081c85717b0b00c227b914d7abcc0a..9ce330be998f3392288d8eb0386a48237ff3a880 100644 +index e7c78106aa34d948a77cf72d5716e17d10beae72..073aa637fcaf14a5ae8b203604d75b74829cbc4e 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -63,6 +63,7 @@ import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket; @@ -79,8 +79,8 @@ index c643919e17081c85717b0b00c227b914d7abcc0a..9ce330be998f3392288d8eb0386a4823 // Paper start - no-tick view distance int effectiveTickViewDistance = this.getEffectiveViewDistance(); int effectiveNoTickViewDistance = Math.max(this.getEffectiveNoTickViewDistance(), effectiveTickViewDistance); -@@ -310,6 +345,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - this.poiManager = new PoiManager(new File(this.storageFolder, "poi"), dataFixer, dsync, world); +@@ -312,6 +347,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + this.poiManager = new PoiManager(new File(file, "poi"), dataFixer, dsync, world); this.setViewDistance(viewDistance); this.playerMobDistanceMap = this.level.paperConfig.perPlayerMobSpawns ? new com.destroystokyo.paper.util.PlayerMobDistanceMap() : null; // Paper + // Paper start - use distance map to optimise entity tracker @@ -125,7 +125,7 @@ index c643919e17081c85717b0b00c227b914d7abcc0a..9ce330be998f3392288d8eb0386a4823 // Paper start - no-tick view distance this.setNoTickViewDistance(this.level.paperConfig.noTickViewDistance); this.playerViewDistanceTickMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, -@@ -1464,17 +1538,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1465,17 +1539,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public void move(ServerPlayer player) { @@ -144,7 +144,7 @@ index c643919e17081c85717b0b00c227b914d7abcc0a..9ce330be998f3392288d8eb0386a4823 int i = SectionPos.blockToSectionCoord(player.getBlockX()); int j = SectionPos.blockToSectionCoord(player.getBlockZ()); -@@ -1629,7 +1693,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1630,7 +1694,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker this.entityMap.put(entity.getId(), playerchunkmap_entitytracker); @@ -153,7 +153,7 @@ index c643919e17081c85717b0b00c227b914d7abcc0a..9ce330be998f3392288d8eb0386a4823 if (entity instanceof ServerPlayer) { ServerPlayer entityplayer = (ServerPlayer) entity; -@@ -1673,7 +1737,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1674,7 +1738,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider entity.tracker = null; // Paper - We're no longer tracked } @@ -191,7 +191,7 @@ index c643919e17081c85717b0b00c227b914d7abcc0a..9ce330be998f3392288d8eb0386a4823 List list = Lists.newArrayList(); List list1 = this.level.players(); -@@ -1782,23 +1876,31 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -1783,23 +1877,31 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially DebugPackets.sendPoiPacketsForChunk(this.level, chunk.getPos()); List list = Lists.newArrayList(); List list1 = Lists.newArrayList(); @@ -235,7 +235,7 @@ index c643919e17081c85717b0b00c227b914d7abcc0a..9ce330be998f3392288d8eb0386a4823 Iterator iterator; Entity entity1; -@@ -1877,6 +1979,42 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -1882,6 +1984,42 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially this.lastSectionPos = SectionPos.of(entity); } @@ -278,7 +278,7 @@ index c643919e17081c85717b0b00c227b914d7abcc0a..9ce330be998f3392288d8eb0386a4823 public boolean equals(Object object) { return object instanceof ChunkMap.TrackedEntity ? ((ChunkMap.TrackedEntity) object).entity.getId() == this.entity.getId() : false; } -@@ -1962,7 +2100,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -1967,7 +2105,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially int j = entity.getType().clientTrackingRange() * 16; j = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, j); // Paper @@ -288,7 +288,7 @@ index c643919e17081c85717b0b00c227b914d7abcc0a..9ce330be998f3392288d8eb0386a4823 } } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 677124d720105e9bda9d05a1fcc46ce10f44539d..fe4b09f82d36e5d7e109c86e8f4c003e92ba4e9d 100644 +index 5e261f5d591f7f34073d65aad20feced0e94586f..581f1ba9a24f5c5267dea29c892c6dfe03468f0c 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -50,6 +50,7 @@ import net.minecraft.network.syncher.EntityDataSerializers; diff --git a/patches/server/0433-Optimize-isOutsideRange-to-use-distance-maps.patch b/patches/server/0433-Optimize-isOutsideRange-to-use-distance-maps.patch index e311b59d5b..700a52b77e 100644 --- a/patches/server/0433-Optimize-isOutsideRange-to-use-distance-maps.patch +++ b/patches/server/0433-Optimize-isOutsideRange-to-use-distance-maps.patch @@ -37,7 +37,7 @@ index 8104b9be5a8e8d57f6f50475788aec6a762a0f7e..e6883cad6c604673535deacc19463aee // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index d2ac486acadd3a1ac829208f9f4594418594f459..19bf44ab6b1f6803eb41208fd07ec0f3dad22c6e 100644 +index 073aa637fcaf14a5ae8b203604d75b74829cbc4e..1b2e7af2824cecc5010f2beefa4f5b838c5ca09d 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -241,6 +241,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -92,16 +92,16 @@ index d2ac486acadd3a1ac829208f9f4594418594f459..19bf44ab6b1f6803eb41208fd07ec0f3 // Paper start - no-tick view distance int effectiveTickViewDistance = this.getEffectiveViewDistance(); int effectiveNoTickViewDistance = Math.max(this.getEffectiveNoTickViewDistance(), effectiveTickViewDistance); -@@ -340,7 +364,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -342,7 +366,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.mainThreadMailbox = this.queueSorter.getProcessor(mailbox, false); this.mailboxLight = this.queueSorter.getProcessor(lightthreaded, false);// Paper this.lightEngine = new ThreadedLevelLightEngine(chunkProvider, this, this.level.dimensionType().hasSkyLight(), threadedmailbox1, this.queueSorter.getProcessor(threadedmailbox1, false)); - this.distanceManager = new ChunkMap.ChunkDistanceManager(executor, mainThreadExecutor); + this.distanceManager = new ChunkMap.ChunkDistanceManager(executor, mainThreadExecutor); this.distanceManager.chunkMap = this; // Paper this.overworldDataStorage = persistentStateManagerFactory; - this.poiManager = new PoiManager(new File(this.storageFolder, "poi"), dataFixer, dsync, world); + this.poiManager = new PoiManager(new File(file, "poi"), dataFixer, dsync, world); this.setViewDistance(viewDistance); -@@ -384,6 +408,38 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -386,6 +410,38 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.playerEntityTrackerTrackMaps[ordinal] = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets); } // Paper end - use distance map to optimise entity tracker @@ -140,7 +140,7 @@ index d2ac486acadd3a1ac829208f9f4594418594f459..19bf44ab6b1f6803eb41208fd07ec0f3 // Paper start - no-tick view distance this.setNoTickViewDistance(this.level.paperConfig.noTickViewDistance); this.playerViewDistanceTickMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, -@@ -653,6 +709,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -655,6 +711,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } else { if (holder != null) { holder.setTicketLevel(level); @@ -148,7 +148,7 @@ index d2ac486acadd3a1ac829208f9f4594418594f459..19bf44ab6b1f6803eb41208fd07ec0f3 } if (holder != null) { -@@ -1474,29 +1531,50 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1475,29 +1532,50 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return this.isOutsideOfRange(chunkPos, false); } @@ -291,10 +291,10 @@ index b49d380ef088aed3204ec71abc437c348ef004fa..577b391dcba1db712c1e2c83296e1c87 public String getDebugStatus() { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index ba10da7899143e8a8c16bc1413fd8de4e5645f46..147f6fd5174a2c489dfb7ea2ce2d2dc7dacfb89d 100644 +index da2a7abd3d2bd1a83e2a3f3a458287730e5a29da..d6cb161981d3cdef4669522ba51cb1db83f9e04c 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -730,6 +730,37 @@ public class ServerChunkCache extends ChunkSource { +@@ -729,6 +729,37 @@ public class ServerChunkCache extends ChunkSource { boolean flag1 = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit if (!flag) { @@ -332,7 +332,7 @@ index ba10da7899143e8a8c16bc1413fd8de4e5645f46..147f6fd5174a2c489dfb7ea2ce2d2dc7 this.level.getProfiler().push("pollingChunks"); int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING); boolean flag2 = level.ticksPerAnimalSpawns != 0L && worlddata.getGameTime() % level.ticksPerAnimalSpawns == 0L; // CraftBukkit -@@ -759,15 +790,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -758,15 +789,7 @@ public class ServerChunkCache extends ChunkSource { this.level.getProfiler().pop(); //List list = Lists.newArrayList(this.playerChunkMap.f()); // Paper //Collections.shuffle(list); // Paper @@ -349,8 +349,8 @@ index ba10da7899143e8a8c16bc1413fd8de4e5645f46..147f6fd5174a2c489dfb7ea2ce2d2dc7 this.level.timings.chunkTicks.startTiming(); // Paper final int[] chunksTicked = {0}; this.chunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping Optional optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); -@@ -782,9 +805,9 @@ public class ServerChunkCache extends ChunkSource { - this.level.getProfiler().pop(); +@@ -775,9 +798,9 @@ public class ServerChunkCache extends ChunkSource { + LevelChunk chunk = (LevelChunk) optional.get(); ChunkPos chunkcoordintpair = chunk.getPos(); - if (this.level.isPositionEntityTicking(chunkcoordintpair) && !this.chunkMap.noPlayersCloseForSpawning(chunkcoordintpair)) { @@ -362,10 +362,10 @@ index ba10da7899143e8a8c16bc1413fd8de4e5645f46..147f6fd5174a2c489dfb7ea2ce2d2dc7 if (chunksTicked[0]++ % 10 == 0) this.level.getServer().midTickLoadChunks(); // Paper } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 8f67cbf2b66adfcebff1c6caef5b0996bb7c24ae..eefe6f77d616768d3cfc93b7e2030d59b49b9e21 100644 +index bd51cf65e05b2c6303a4a454f8eee04a97331a69..9fab262e420ca693778c6d41a0cf7b2783875ae2 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -249,6 +249,7 @@ public class ServerPlayer extends Player { +@@ -250,6 +250,7 @@ public class ServerPlayer extends Player { // CraftBukkit end public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper diff --git a/patches/server/0440-Wait-for-Async-Tasks-during-shutdown.patch b/patches/server/0440-Wait-for-Async-Tasks-during-shutdown.patch index 02fd1005d5..cdd572a457 100644 --- a/patches/server/0440-Wait-for-Async-Tasks-during-shutdown.patch +++ b/patches/server/0440-Wait-for-Async-Tasks-during-shutdown.patch @@ -10,10 +10,10 @@ Adds a 5 second grace period for any async tasks to finish and warns if any are still running after that delay just as reload does. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index eb82dd9db7fef4b1f0f764ce153439c69c64168b..407f18a9c7a688eaac8ad7018ae4f1a5fc628379 100644 +index 736cbb3430ba1d8c00ea43a80c978949108d8b6c..d285967a60903a73608a1f9cdc306e63066824ab 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -945,6 +945,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements A +@@ -327,6 +327,11 @@ public class PersistentEntitySectionManager implements A public LevelEntityGetter getEntityGetter() { return this.entityGetter; } diff --git a/patches/server/0449-Optimize-sending-packets-to-nearby-locations-sounds-.patch b/patches/server/0449-Optimize-sending-packets-to-nearby-locations-sounds-.patch index 891edd159c..a8b6cd6335 100644 --- a/patches/server/0449-Optimize-sending-packets-to-nearby-locations-sounds-.patch +++ b/patches/server/0449-Optimize-sending-packets-to-nearby-locations-sounds-.patch @@ -11,10 +11,10 @@ This will drastically cut down on packet sending cost for worlds with lots of players in them. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 95f229dcb1b003215c602847a351b313fb0980ba..67c5d0a53f50896daa6bba3ac2816cfc15b0af75 100644 +index 6b23b9389ff92ae8016d4adb289ac2a097670be5..f5334be5d9c799da16198ecb0f69f17a2bf4a1eb 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1135,16 +1135,40 @@ public abstract class PlayerList { +@@ -1137,16 +1137,40 @@ public abstract class PlayerList { } public void broadcast(@Nullable net.minecraft.world.entity.player.Player player, double x, double y, double z, double distance, ResourceKey worldKey, Packet packet) { diff --git a/patches/server/0456-incremental-chunk-saving.patch b/patches/server/0456-incremental-chunk-saving.patch index 5f55357f04..538adff847 100644 --- a/patches/server/0456-incremental-chunk-saving.patch +++ b/patches/server/0456-incremental-chunk-saving.patch @@ -31,10 +31,10 @@ index 9e5810eb0085ad956f0bd1cd69fa88909d9d638a..77e90a6b7d29ad989fd961e00a6fd97c config.addDefault("world-settings.default." + path, def); return config.getBoolean("world-settings." + worldName + "." + path, config.getBoolean("world-settings.default." + path)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a57af6cd317c56e28db060c50e55a4531c90e069..aed08b85e24c1c8c8e703d6c5c42075c5fbeda9e 100644 +index d285967a60903a73608a1f9cdc306e63066824ab..a36fa61313baf9ab260b8805860ac4bce24bc3c6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -300,6 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; @@ -42,7 +42,7 @@ index a57af6cd317c56e28db060c50e55a4531c90e069..aed08b85e24c1c8c8e703d6c5c42075c public Commands vanillaCommandDispatcher; public boolean forceTicks; // Paper // CraftBukkit end -@@ -1411,14 +1412,23 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> completablefuture = (CompletableFuture) this.futures.get(i); diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 36a9c0e442aa811dd85cede375640e0610197aa6..8d97e0a38a1cf6fcbc458654e2e85a8eb6033dd9 100644 +index a1529fef41543486d29271b1de62a6246d07d384..f518fc7a39a807bff2e141fd238ab1bfc34ce890 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -97,6 +97,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana @@ -150,7 +150,7 @@ index 36a9c0e442aa811dd85cede375640e0610197aa6..8d97e0a38a1cf6fcbc458654e2e85a8e import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -748,6 +749,64 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -750,6 +751,64 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } @@ -215,7 +215,7 @@ index 36a9c0e442aa811dd85cede375640e0610197aa6..8d97e0a38a1cf6fcbc458654e2e85a8e protected void saveAllChunks(boolean flush) { Long2ObjectLinkedOpenHashMap visibleChunks = this.getVisibleChunks(); // Paper remove clone of visible Chunks unless saving off main thread (watchdog kill) if (flush) { -@@ -887,6 +946,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -888,6 +947,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider asyncSaveData, chunk); chunk.setUnsaved(false); @@ -223,7 +223,7 @@ index 36a9c0e442aa811dd85cede375640e0610197aa6..8d97e0a38a1cf6fcbc458654e2e85a8e } // Paper end -@@ -918,6 +978,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -919,6 +979,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.level.unload(chunk); } @@ -231,7 +231,7 @@ index 36a9c0e442aa811dd85cede375640e0610197aa6..8d97e0a38a1cf6fcbc458654e2e85a8e this.lightEngine.updateChunkStatus(ichunkaccess.getPos()); this.lightEngine.tryScheduleUpdate(); -@@ -1271,6 +1332,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1272,6 +1333,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (!chunk.isUnsaved()) { return false; } else { @@ -240,10 +240,10 @@ index 36a9c0e442aa811dd85cede375640e0610197aa6..8d97e0a38a1cf6fcbc458654e2e85a8e ChunkPos chunkcoordintpair = chunk.getPos(); diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 147f6fd5174a2c489dfb7ea2ce2d2dc7dacfb89d..6c565751c36daa0084196dce5d2f82df64a0c77a 100644 +index d6cb161981d3cdef4669522ba51cb1db83f9e04c..aaeb50d7980a910ff21f9c1ea903acf994392ef8 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -672,6 +672,15 @@ public class ServerChunkCache extends ChunkSource { +@@ -671,6 +671,15 @@ public class ServerChunkCache extends ChunkSource { } // Paper - Timings } @@ -260,7 +260,7 @@ index 147f6fd5174a2c489dfb7ea2ce2d2dc7dacfb89d..6c565751c36daa0084196dce5d2f82df public void close() throws IOException { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 5fbe0f6b152d92f4415361709e7394c114104812..74efffabe349a5272694c3af9bd2c36221779f73 100644 +index 8ebcd5947688a1f0a8216e934ac90da0e5a8540e..8cd2764e5d07975304b52ec5d995f4e7a9b5ff4d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1003,6 +1003,37 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl diff --git a/patches/server/0461-Prevent-position-desync-in-playerconnection-causing-.patch b/patches/server/0461-Prevent-position-desync-in-playerconnection-causing-.patch index 1f7792cd57..a34f110074 100644 --- a/patches/server/0461-Prevent-position-desync-in-playerconnection-causing-.patch +++ b/patches/server/0461-Prevent-position-desync-in-playerconnection-causing-.patch @@ -14,10 +14,10 @@ behaviour, we need to move all of this dangerous logic outside of the move call and into an appropriate place in the tick method. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f936386b67027b4e8782367cf62ab3332c0711f3..9c71188b1e193b4937eed07ff80c5a61b2db8643 100644 +index 1e25d05b157f79c9d77224676b2dc6b7940aaf05..cfdf6e6e4ef5921bfcbb8a010ea42f0c182b344c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1345,6 +1345,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1325,6 +1325,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9)); this.player.setOnGround(packet.isOnGround()); // CraftBukkit - SPIGOT-5810, SPIGOT-5835: reset by this.player.move diff --git a/patches/server/0464-Add-and-implement-PlayerRecipeBookClickEvent.patch b/patches/server/0464-Add-and-implement-PlayerRecipeBookClickEvent.patch index 2b2b74e761..880d6f4e73 100644 --- a/patches/server/0464-Add-and-implement-PlayerRecipeBookClickEvent.patch +++ b/patches/server/0464-Add-and-implement-PlayerRecipeBookClickEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add and implement PlayerRecipeBookClickEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9c71188b1e193b4937eed07ff80c5a61b2db8643..03a98771e828696fef2685fbde040293645a3c17 100644 +index cfdf6e6e4ef5921bfcbb8a010ea42f0c182b344c..18392c098fb24ba0be7856dbd5ef946b41fab2cf 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2777,9 +2777,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2763,9 +2763,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); this.player.resetLastActionTime(); if (!this.player.isSpectator() && this.player.containerMenu.containerId == packet.getContainerId() && this.player.containerMenu instanceof RecipeBookMenu) { diff --git a/patches/server/0466-Add-permission-for-command-blocks.patch b/patches/server/0466-Add-permission-for-command-blocks.patch index 6162ca76f7..d8883b1509 100644 --- a/patches/server/0466-Add-permission-for-command-blocks.patch +++ b/patches/server/0466-Add-permission-for-command-blocks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add permission for command blocks diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index a695e5a0c2e8846333ccb9aea499b5656af35163..c21c5134308a2a83fb50bfe37f05d19c8e96ca7c 100644 +index b932580dc10703c8a7dbecd4cf38954872f1cab6..51d7c59e6b3f4ca84905b186d9b173ec2c36a0b1 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java @@ -391,7 +391,7 @@ public class ServerPlayerGameMode { @@ -18,10 +18,10 @@ index a695e5a0c2e8846333ccb9aea499b5656af35163..c21c5134308a2a83fb50bfe37f05d19c return false; } else if (this.player.blockActionRestricted((Level) this.level, pos, this.gameModeForPlayer)) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 03a98771e828696fef2685fbde040293645a3c17..38f2b5ef4f4a96e5cf919eaa22f82a6909d9c909 100644 +index 15762cb1a627b4b23353a8e9c65465a9c44faaa0..f6f243552a73d17a5ac26a945822935a2562ba2e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -788,7 +788,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -787,7 +787,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (!this.server.isCommandBlockEnabled()) { this.player.sendMessage(new TranslatableComponent("advMode.notEnabled"), Util.NIL_UUID); @@ -30,7 +30,7 @@ index 03a98771e828696fef2685fbde040293645a3c17..38f2b5ef4f4a96e5cf919eaa22f82a69 this.player.sendMessage(new TranslatableComponent("advMode.notAllowed"), Util.NIL_UUID); } else { BaseCommandBlock commandblocklistenerabstract = null; -@@ -855,7 +855,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -854,7 +854,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (!this.server.isCommandBlockEnabled()) { this.player.sendMessage(new TranslatableComponent("advMode.notEnabled"), Util.NIL_UUID); diff --git a/patches/server/0469-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0469-Fix-Per-World-Difficulty-Remembering-Difficulty.patch index 9b6923eb9d..ce3b4d5782 100644 --- a/patches/server/0469-Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/patches/server/0469-Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -8,10 +8,10 @@ makes it so that the server keeps the last difficulty used instead of restoring the server.properties every single load. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 9f80206f966689b79df4e3b9b82ef9f4d2170bfe..21c16bf341e846f90a24fe2395ff89f1ace70d73 100644 +index a36fa61313baf9ab260b8805860ac4bce24bc3c6..3ac5ab881913a90d5b59610e81d598e121320930 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1721,11 +1721,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= i; } -@@ -271,18 +273,21 @@ public class SkyLightSectionStorage extends LayerLightSectionStorage { int currentLowestY; diff --git a/patches/server/0476-Convert-legacy-attributes-in-Item-Meta.patch b/patches/server/0476-Convert-legacy-attributes-in-Item-Meta.patch index 02350badd6..373747c12d 100644 --- a/patches/server/0476-Convert-legacy-attributes-in-Item-Meta.patch +++ b/patches/server/0476-Convert-legacy-attributes-in-Item-Meta.patch @@ -30,10 +30,10 @@ index 0520c45197629cbdc2777d9ae11eef572e793160..46c313d581b9af6aa0a48f97ae3cc800 public CraftAttributeMap(AttributeMap handle) { this.handle = handle; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 9288588af4e0f9dd4c9711260cd4b73b66632bb7..55ad7f0d75d88c9848b65149002d2bd3a91719ca 100644 +index 0aa7854119ab876f0e46bb7667282d79d2a57e3d..3a125e7018b57aa6a802e99662fa784493fec5fc 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -479,7 +479,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -480,7 +480,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier); diff --git a/patches/server/0479-Optimize-NibbleArray-to-use-pooled-buffers.patch b/patches/server/0479-Optimize-NibbleArray-to-use-pooled-buffers.patch index 7fa5c525b6..757564a97e 100644 --- a/patches/server/0479-Optimize-NibbleArray-to-use-pooled-buffers.patch +++ b/patches/server/0479-Optimize-NibbleArray-to-use-pooled-buffers.patch @@ -84,10 +84,10 @@ index 24d5a44cb81ec5f10bfcce002a193f4566de88fc..d8be2ad889f46491e50404916fb4ae0d } diff --git a/src/main/java/net/minecraft/world/level/chunk/DataLayer.java b/src/main/java/net/minecraft/world/level/chunk/DataLayer.java -index 88a2a5c3d588c15989f7cf6df9d2afc3d2ed8ae9..25570730f376665ca6477263d3b3f94d725ecd21 100644 +index 689a3bc80e753ecb3194ae81c0c48d2eef61f700..c561d69b4b903cd3625468b239cb1ace3e317700 100644 --- a/src/main/java/net/minecraft/world/level/chunk/DataLayer.java +++ b/src/main/java/net/minecraft/world/level/chunk/DataLayer.java -@@ -12,11 +12,65 @@ public class DataLayer { +@@ -13,11 +13,65 @@ public class DataLayer { private static final int NIBBLE_SIZE = 4; @Nullable protected byte[] data; @@ -151,19 +151,19 @@ index 88a2a5c3d588c15989f7cf6df9d2afc3d2ed8ae9..25570730f376665ca6477263d3b3f94d + registerCleaner(); + // Paper end if (bytes.length != 2048) { - throw (IllegalArgumentException) Util.pauseInIde((Throwable) (new IllegalArgumentException("ChunkNibbleArrays should be 2048 bytes not: " + bytes.length))); + throw (IllegalArgumentException) Util.pauseInIde((Throwable) (new IllegalArgumentException("DataLayer should be 2048 bytes not: " + bytes.length))); } -@@ -50,7 +104,8 @@ public class DataLayer { +@@ -52,7 +106,8 @@ public class DataLayer { - public void set(int index, int value) { // PAIL: private -> public + private void set(int index, int value) { if (this.data == null) { - this.data = new byte[2048]; + this.data = BYTE_2048.acquire(); // Paper + registerCleaner();// Paper } - int k = this.getPosition(index); -@@ -72,13 +127,33 @@ public class DataLayer { + int k = DataLayer.getByteIndex(index); +@@ -74,13 +129,33 @@ public class DataLayer { public byte[] getData() { if (this.data == null) { this.data = new byte[2048]; @@ -199,7 +199,7 @@ index 88a2a5c3d588c15989f7cf6df9d2afc3d2ed8ae9..25570730f376665ca6477263d3b3f94d public String toString() { 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 b875bf80181255117cdd2fdfc1d861220ac13a3a..e9043403c0bd3edc11f8a4f55f3a512a630ec08b 100644 +index e850b8db05f4d66aec8eb74a5a48357b90ca77a5..f4cecd000ba4c4595c8db45524ec9d899193abe6 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 @@ -490,11 +490,11 @@ public class ChunkSerializer { @@ -231,28 +231,6 @@ index f357a3473682c2d37a20fb862522c67b9979402a..52682471adc13dffc0383fc4abacbd33 this.clearCache(); } -diff --git a/src/main/java/net/minecraft/world/level/lighting/FlatDataLayer.java b/src/main/java/net/minecraft/world/level/lighting/FlatDataLayer.java -index 0a65818e68605a3fa944c2de808ebc069f3f8007..cdc7d890841818f615aa09b6068cf98c3936e9a7 100644 ---- a/src/main/java/net/minecraft/world/level/lighting/FlatDataLayer.java -+++ b/src/main/java/net/minecraft/world/level/lighting/FlatDataLayer.java -@@ -11,7 +11,7 @@ public class FlatDataLayer extends DataLayer { - - public FlatDataLayer(DataLayer chunkNibbleArray, int offset) { - super(128); -- System.arraycopy(chunkNibbleArray.getData(), offset * 128, this.data, 0, 128); -+ System.arraycopy(chunkNibbleArray.getIfSet(), offset * 128, this.data, 0, 128); // Paper - } - - @Override -@@ -21,7 +21,7 @@ public class FlatDataLayer extends DataLayer { - - @Override - public byte[] getData() { -- byte[] bs = new byte[2048]; -+ byte[] bs = BYTE_2048.acquire(); // Paper - - for(int i = 0; i < 16; ++i) { - System.arraycopy(this.data, 0, bs, i * 128, 128); diff --git a/src/main/java/net/minecraft/world/level/lighting/LayerLightSectionStorage.java b/src/main/java/net/minecraft/world/level/lighting/LayerLightSectionStorage.java index cc9eb8273d5157fb649d84a3ec589b0b923b5bc9..fd1cdb6e2023713f947b9497c605cf6f4bae8994 100644 --- a/src/main/java/net/minecraft/world/level/lighting/LayerLightSectionStorage.java @@ -282,22 +260,36 @@ index cc9eb8273d5157fb649d84a3ec589b0b923b5bc9..fd1cdb6e2023713f947b9497c605cf6f } diff --git a/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java b/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java -index f6df52403a1068a0779e4ff8c2ce5dc06176e061..7dc194b4f04b2d59dcb100b0a3b2ca0132f832cf 100644 +index 24030bcb3303d0419c7859ded7613608c5f82308..ec3837a64e8ac6892028611d57a111a7fd5c58f7 100644 --- a/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java +++ b/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java -@@ -161,9 +161,9 @@ public class SkyLightSectionStorage extends LayerLightSectionStorage(Lists.transform(this.lore, CraftChatMessage::fromJSONComponent)); } @@ -47,7 +47,7 @@ index 55ad7f0d75d88c9848b65149002d2bd3a91719ca..f9f1c5665adb703042ac7fca76ce2e9f @Override public void setLore(List lore) { if (lore == null || lore.isEmpty()) { -@@ -1034,6 +1054,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1035,6 +1055,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -69,7 +69,7 @@ index 55ad7f0d75d88c9848b65149002d2bd3a91719ca..f9f1c5665adb703042ac7fca76ce2e9f @Override public boolean hasCustomModelData() { return this.customModelData != null; -@@ -1494,6 +1529,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1495,6 +1530,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } for (Object object : addFrom) { diff --git a/patches/server/0483-Update-itemstack-legacy-name-and-lore.patch b/patches/server/0483-Update-itemstack-legacy-name-and-lore.patch index d9a5f4478b..214be4b75b 100644 --- a/patches/server/0483-Update-itemstack-legacy-name-and-lore.patch +++ b/patches/server/0483-Update-itemstack-legacy-name-and-lore.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Update itemstack legacy name and lore diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 1496035b925b47c45fa3a9d4f68060d2e0408a9c..41de19cc0cf5d4a2e5963a4226d08585d396fe42 100644 +index 30a339f56eb1edb730e4ce72b4ce314555bc8c15..d9f832241cd8697c65bfb5add035aee1e77c6165 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -170,6 +170,44 @@ public final class ItemStack { +@@ -168,6 +168,44 @@ public final class ItemStack { list.sort((Comparator) enchantSorter); // Paper } catch (Exception ignored) {} } @@ -53,7 +53,7 @@ index 1496035b925b47c45fa3a9d4f68060d2e0408a9c..41de19cc0cf5d4a2e5963a4226d08585 // Paper end public ItemStack(ItemLike item) { -@@ -216,6 +254,7 @@ public final class ItemStack { +@@ -214,6 +252,7 @@ public final class ItemStack { this.tag = (CompoundTag) nbttagcompound.getCompound("tag").copy(); // CraftBukkit end this.processEnchantOrder(this.tag); // Paper diff --git a/patches/server/0484-Spawn-player-in-correct-world-on-login.patch b/patches/server/0484-Spawn-player-in-correct-world-on-login.patch index 79d2f2f970..bb38fbd9c4 100644 --- a/patches/server/0484-Spawn-player-in-correct-world-on-login.patch +++ b/patches/server/0484-Spawn-player-in-correct-world-on-login.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Spawn player in correct world on login diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 67c5d0a53f50896daa6bba3ac2816cfc15b0af75..71fce0c38386b3f0a63a5d9bc1cb47e01027d10c 100644 +index f5334be5d9c799da16198ecb0f69f17a2bf4a1eb..e0c9857a922d8a3f421d7df0f056b82c4775390e 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -194,7 +194,18 @@ public abstract class PlayerList { +@@ -196,7 +196,18 @@ public abstract class PlayerList { }String lastKnownName = s; // Paper // CraftBukkit end diff --git a/patches/server/0485-Add-PrepareResultEvent.patch b/patches/server/0485-Add-PrepareResultEvent.patch index 36745ce5fd..687bf140f0 100644 --- a/patches/server/0485-Add-PrepareResultEvent.patch +++ b/patches/server/0485-Add-PrepareResultEvent.patch @@ -8,10 +8,10 @@ Adds a new event for all crafting stations that generate a result slot item Anvil, Grindstone and Smithing now extend this event diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java -index 1dad9577370bb58b27b32b997a505ce5145a6769..56d3ed1cdafd7904c35be5db568b9975a97418a7 100644 +index 0d1e828debc87c6ddc569dfa8f85be9918365dc1..3070ad3a4bbe83485c6b4a68aa634045c70cafdd 100644 --- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java -@@ -317,6 +317,7 @@ public class AnvilMenu extends ItemCombinerMenu { +@@ -316,6 +316,7 @@ public class AnvilMenu extends ItemCombinerMenu { } this.createResult(); @@ -20,7 +20,7 @@ index 1dad9577370bb58b27b32b997a505ce5145a6769..56d3ed1cdafd7904c35be5db568b9975 public int getCost() { diff --git a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java b/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java -index 528fc4ee870303c6c42c603a9869f7e47825fd40..c96abb8945fe5dc2f963f548ccdd87272a445a7a 100644 +index 93ebd73b94efac5f671b0459e0075959f5ce8bdf..aaf67ac2a73fa3b4420ec99ee185bceda2cb4c2b 100644 --- a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java +++ b/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java @@ -150,6 +150,7 @@ public class CartographyTableMenu extends AbstractContainerMenu { @@ -32,7 +32,7 @@ index 528fc4ee870303c6c42c603a9869f7e47825fd40..c96abb8945fe5dc2f963f548ccdd8727 private void setupResultSlot(ItemStack map, ItemStack item, ItemStack oldResult) { diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -index 34574f3945d2a7b4ab6a71adb2408b9811a3cb0d..b260216460b0bbf75edc631bb69e3e4fc94d459a 100644 +index b268645827b7a57b906fd925d694f802a75da25d..dda6c4948b903221fa8020c76d109216d2dd82bf 100644 --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java @@ -160,6 +160,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { @@ -44,7 +44,7 @@ index 34574f3945d2a7b4ab6a71adb2408b9811a3cb0d..b260216460b0bbf75edc631bb69e3e4f } diff --git a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java -index 982b7ac02335bfa2b752d900a5d0392c6660745b..eb1a0c6ce8ceab4955a5ac3d2fdf4d869a2a34ae 100644 +index 8819347987a8072eede52a57fec763711d9bab92..9cc246f43230e87c6bd2377ef77ab2dcb9509a5c 100644 --- a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java @@ -78,6 +78,7 @@ public abstract class ItemCombinerMenu extends AbstractContainerMenu { @@ -56,7 +56,7 @@ index 982b7ac02335bfa2b752d900a5d0392c6660745b..eb1a0c6ce8ceab4955a5ac3d2fdf4d86 } diff --git a/src/main/java/net/minecraft/world/inventory/LoomMenu.java b/src/main/java/net/minecraft/world/inventory/LoomMenu.java -index 6d40ef2459e0ba5927ee723495cd6f5fd3101859..7e8b6e0e69876cb7bfd444a8dd72edf8289e6dd1 100644 +index b490e87d95c3a140323aa9da95b90381392f64f8..9bcab01324612a905b21623a09109d404f8dadf7 100644 --- a/src/main/java/net/minecraft/world/inventory/LoomMenu.java +++ b/src/main/java/net/minecraft/world/inventory/LoomMenu.java @@ -196,7 +196,8 @@ public class LoomMenu extends AbstractContainerMenu { @@ -70,7 +70,7 @@ index 6d40ef2459e0ba5927ee723495cd6f5fd3101859..7e8b6e0e69876cb7bfd444a8dd72edf8 public void registerUpdateListener(Runnable inventoryChangeListener) { diff --git a/src/main/java/net/minecraft/world/inventory/SmithingMenu.java b/src/main/java/net/minecraft/world/inventory/SmithingMenu.java -index edb88d59a7b81b9d8b0328ce54ff1fbcf47323ae..c2b997bff39c8bf51c5f8f788696c92920b04868 100644 +index 92dd2ea23185bba311e184b2ac9744a423c102ea..cb3f522a586b841056c35378a49dd50bfa673f61 100644 --- a/src/main/java/net/minecraft/world/inventory/SmithingMenu.java +++ b/src/main/java/net/minecraft/world/inventory/SmithingMenu.java @@ -76,6 +76,7 @@ public class SmithingMenu extends ItemCombinerMenu { @@ -82,7 +82,7 @@ index edb88d59a7b81b9d8b0328ce54ff1fbcf47323ae..c2b997bff39c8bf51c5f8f788696c929 @Override diff --git a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java -index ddd34b07f7cf39a8b5ad51bdefb6e9d7cbf8f393..eac9765ecf0b33cab8b04204591de8d56c6f75c7 100644 +index 3df5031ec2c50dc6eb2533318cf8a98f21b03d2a..c971a534ded962e3be92c71059c75cc1d54970b5 100644 --- a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java +++ b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java @@ -176,6 +176,7 @@ public class StonecutterMenu extends AbstractContainerMenu { @@ -94,7 +94,7 @@ index ddd34b07f7cf39a8b5ad51bdefb6e9d7cbf8f393..eac9765ecf0b33cab8b04204591de8d5 private void setupRecipeList(Container input, ItemStack stack) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 1ee76da3b609bf91e9e8529eb402d670b32e4b18..7159d63c7708cebda60da33eefc8a492d8de6219 100644 +index 1c0f8d636658133b1f5152a3325791d05ae0d4cb..b9cfd8ea29351fb712b90f810c2b7078f5cbaa7c 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1529,19 +1529,44 @@ public class CraftEventFactory { diff --git a/patches/server/0487-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch b/patches/server/0487-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch index 6d0e9537b3..b989c136bb 100644 --- a/patches/server/0487-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch +++ b/patches/server/0487-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't check chunk for portal on world gen entity add diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index a491ae3aab195b8247bd0caee998c5ec608ce567..a524ea7ff8206036de07d24683adadee8bd41eac 100644 +index 00610ef5a724a9ab6ec6df29c721a93f3b12bd1d..eb4089aa6986edd709d2b0a7853a19a020f02e57 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3353,7 +3353,7 @@ public abstract class LivingEntity extends Entity { +@@ -3356,7 +3356,7 @@ public abstract class LivingEntity extends Entity { Entity entity = this.getVehicle(); super.stopRiding(suppressCancellation); // Paper - suppress diff --git a/patches/server/0488-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/patches/server/0488-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch index 069efbbc9c..81065c008f 100644 --- a/patches/server/0488-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch +++ b/patches/server/0488-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch @@ -312,7 +312,7 @@ index e26b65c3b2594ae45b68bcbd135152130663be7f..3e004f391668865c0e6f1c38cef9661f if (chunk != null) { chunkStorage.callbackExecutor.execute(() -> { diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index ed4ff389a175d8708c667ee212e11a3f7a1d3a79..84245016423e9d151f98b5ef8d2c9fbf3a3136ab 100644 +index f518fc7a39a807bff2e141fd238ab1bfc34ce890..dd0f9ab476735e0a61533bdfed5868fa5f523b68 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -149,6 +149,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -339,7 +339,7 @@ index ed4ff389a175d8708c667ee212e11a3f7a1d3a79..84245016423e9d151f98b5ef8d2c9fbf if (this.queue == null) { return; } -@@ -351,6 +354,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -353,6 +356,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.level = world; this.generator = chunkGenerator; this.mainThreadExecutor = mainThreadExecutor; @@ -355,7 +355,7 @@ index ed4ff389a175d8708c667ee212e11a3f7a1d3a79..84245016423e9d151f98b5ef8d2c9fbf ProcessorMailbox threadedmailbox = ProcessorMailbox.create(executor, "worldgen"); Objects.requireNonNull(mainThreadExecutor); -@@ -446,6 +458,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -448,6 +460,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.playerViewDistanceTickMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, (ServerPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet newState) -> { @@ -363,7 +363,7 @@ index ed4ff389a175d8708c667ee212e11a3f7a1d3a79..84245016423e9d151f98b5ef8d2c9fbf if (newState.size() != 1) { return; } -@@ -464,7 +477,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -466,7 +479,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } ChunkPos chunkPos = new ChunkPos(rangeX, rangeZ); ChunkMap.this.level.getChunkSource().removeTicketAtLevel(TicketType.PLAYER, chunkPos, 31, chunkPos); // entity ticking level, TODO check on update @@ -379,7 +379,7 @@ index ed4ff389a175d8708c667ee212e11a3f7a1d3a79..84245016423e9d151f98b5ef8d2c9fbf this.playerViewDistanceNoTickMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets); this.playerViewDistanceBroadcastMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, (ServerPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, -@@ -482,6 +502,116 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -484,6 +504,116 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper end - no-tick view distance } @@ -496,7 +496,7 @@ index ed4ff389a175d8708c667ee212e11a3f7a1d3a79..84245016423e9d151f98b5ef8d2c9fbf // Paper start public void updatePlayerMobTypeMap(Entity entity) { if (!this.level.paperConfig.perPlayerMobSpawns) { -@@ -640,6 +770,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -642,6 +772,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider List>> list = Lists.newArrayList(); int j = centerChunk.x; int k = centerChunk.z; @@ -504,7 +504,7 @@ index ed4ff389a175d8708c667ee212e11a3f7a1d3a79..84245016423e9d151f98b5ef8d2c9fbf for (int l = -margin; l <= margin; ++l) { for (int i1 = -margin; i1 <= margin; ++i1) { -@@ -658,6 +789,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -660,6 +791,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ChunkStatus chunkstatus = (ChunkStatus) distanceToStatus.apply(j1); CompletableFuture> completablefuture = playerchunk.getOrScheduleFuture(chunkstatus, this); @@ -519,7 +519,7 @@ index ed4ff389a175d8708c667ee212e11a3f7a1d3a79..84245016423e9d151f98b5ef8d2c9fbf list.add(completablefuture); } -@@ -1102,14 +1241,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1103,14 +1242,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }; CompletableFuture chunkSaveFuture = this.level.asyncChunkTaskManager.getChunkSaveFuture(pos.x, pos.z); @@ -549,7 +549,7 @@ index ed4ff389a175d8708c667ee212e11a3f7a1d3a79..84245016423e9d151f98b5ef8d2c9fbf return ret; // Paper end } -@@ -1241,7 +1390,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1242,7 +1391,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider long i = playerchunk.getPos().toLong(); Objects.requireNonNull(playerchunk); @@ -941,10 +941,10 @@ index d94241bcca4f2fd5e464a860bd356af504dc68b7..1cc4e0a1f3d8235ef88b48e01ca8b78a } } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 6c565751c36daa0084196dce5d2f82df64a0c77a..0b22fd8ac75146bc7b647cfbefc73ce890ccb033 100644 +index aaeb50d7980a910ff21f9c1ea903acf994392ef8..82b047364608f6ef38b177079fd9543812c198b4 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -446,6 +446,26 @@ public class ServerChunkCache extends ChunkSource { +@@ -445,6 +445,26 @@ public class ServerChunkCache extends ChunkSource { public void removeTicketAtLevel(TicketType ticketType, ChunkPos chunkPos, int ticketLevel, T identifier) { this.distanceManager.removeTicketAtLevel(ticketType, chunkPos, ticketLevel, identifier); } @@ -971,7 +971,7 @@ index 6c565751c36daa0084196dce5d2f82df64a0c77a..0b22fd8ac75146bc7b647cfbefc73ce8 // Paper end - async chunk io @Nullable -@@ -486,6 +506,8 @@ public class ServerChunkCache extends ChunkSource { +@@ -485,6 +505,8 @@ public class ServerChunkCache extends ChunkSource { Objects.requireNonNull(completablefuture); if (!completablefuture.isDone()) { // Paper // Paper start - async chunk io/loading @@ -980,7 +980,7 @@ index 6c565751c36daa0084196dce5d2f82df64a0c77a..0b22fd8ac75146bc7b647cfbefc73ce8 this.level.asyncChunkTaskManager.raisePriority(x1, z1, com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGHEST_PRIORITY); com.destroystokyo.paper.io.chunk.ChunkTaskManager.pushChunkWait(this.level, x1, z1); // Paper end -@@ -494,6 +516,8 @@ public class ServerChunkCache extends ChunkSource { +@@ -493,6 +515,8 @@ public class ServerChunkCache extends ChunkSource { chunkproviderserver_a.managedBlock(completablefuture::isDone); com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug this.level.timings.syncChunkLoad.stopTiming(); // Paper @@ -989,7 +989,7 @@ index 6c565751c36daa0084196dce5d2f82df64a0c77a..0b22fd8ac75146bc7b647cfbefc73ce8 } // Paper ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { return ichunkaccess1; -@@ -567,10 +591,12 @@ public class ServerChunkCache extends ChunkSource { +@@ -566,10 +590,12 @@ public class ServerChunkCache extends ChunkSource { if (flag && !currentlyUnloading) { // CraftBukkit end this.distanceManager.addTicket(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair); @@ -1002,7 +1002,7 @@ index 6c565751c36daa0084196dce5d2f82df64a0c77a..0b22fd8ac75146bc7b647cfbefc73ce8 this.runDistanceManagerUpdates(); playerchunk = this.getVisibleChunkIfPresent(k); gameprofilerfiller.pop(); -@@ -579,8 +605,13 @@ public class ServerChunkCache extends ChunkSource { +@@ -578,8 +604,13 @@ public class ServerChunkCache extends ChunkSource { } } } @@ -1018,7 +1018,7 @@ index 6c565751c36daa0084196dce5d2f82df64a0c77a..0b22fd8ac75146bc7b647cfbefc73ce8 } private boolean chunkAbsent(@Nullable ChunkHolder holder, int maxLevel) { -@@ -632,6 +663,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -631,6 +662,7 @@ public class ServerChunkCache extends ChunkSource { } public boolean runDistanceManagerUpdates() { @@ -1027,10 +1027,10 @@ index 6c565751c36daa0084196dce5d2f82df64a0c77a..0b22fd8ac75146bc7b647cfbefc73ce8 boolean flag1 = this.chunkMap.promoteChunkMap(); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index eefe6f77d616768d3cfc93b7e2030d59b49b9e21..24223a6a58047312bd82cd1e29b5db61b0853159 100644 +index 9fab262e420ca693778c6d41a0cf7b2783875ae2..ca83d167b12422f4d7490d2ebdff401200444d42 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -188,6 +188,14 @@ public class ServerPlayer extends Player { +@@ -189,6 +189,14 @@ public class ServerPlayer extends Player { private int lastRecordedArmor = Integer.MIN_VALUE; private int lastRecordedLevel = Integer.MIN_VALUE; private int lastRecordedExperience = Integer.MIN_VALUE; @@ -1045,7 +1045,7 @@ index eefe6f77d616768d3cfc93b7e2030d59b49b9e21..24223a6a58047312bd82cd1e29b5db61 private float lastSentHealth = -1.0E8F; private int lastSentFood = -99999999; private boolean lastFoodSaturationZero = true; -@@ -329,6 +337,21 @@ public class ServerPlayer extends Player { +@@ -325,6 +333,21 @@ public class ServerPlayer extends Player { this.maxHealthCache = this.getMaxHealth(); this.cachedSingleMobDistanceMap = new com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper } @@ -1067,7 +1067,7 @@ index eefe6f77d616768d3cfc93b7e2030d59b49b9e21..24223a6a58047312bd82cd1e29b5db61 // Yes, this doesn't match Vanilla, but it's the best we can do for now. // If this is an issue, PRs are welcome -@@ -650,6 +673,7 @@ public class ServerPlayer extends Player { +@@ -646,6 +669,7 @@ public class ServerPlayer extends Player { if (valid && !this.isSpectator() || !this.touchingUnloadedChunk()) { // Paper - don't tick dead players that are not in the world currently (pending respawn) super.tick(); } @@ -1101,10 +1101,10 @@ index 8770fe0db46b01e8b608637df4f1a669a3f4cdde..3c1698ba0d3bc412ab957777d9b5211d private final String name; private final Comparator comparator; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 92e8257734a8d46bf63b8bd9173b0d680f41fe97..80bf42c9586ba45b2174b89e3d432409b37eca7f 100644 +index d182b6ef4431c5ca291619bc8920a18cccad6327..aec4d7987ed168bc6a70c178d44b8d0d1822b845 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1565,6 +1565,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1545,6 +1545,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.awaitingTeleportTime = this.tickCount; this.player.absMoveTo(d0, d1, d2, f, f1); @@ -1113,10 +1113,10 @@ index 92e8257734a8d46bf63b8bd9173b0d680f41fe97..80bf42c9586ba45b2174b89e3d432409 } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 10d3a8477502f991c03c665a192eda91a288f4c3..45b48275a3f944d495cc090abc4af5a4f8512028 100644 +index e0c9857a922d8a3f421d7df0f056b82c4775390e..4918f89401cdf6a85d8b71f3e3a6608239a388bd 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -284,8 +284,8 @@ public abstract class PlayerList { +@@ -286,8 +286,8 @@ public abstract class PlayerList { net.minecraft.server.level.ChunkMap playerChunkMap = worldserver1.getChunkSource().chunkMap; net.minecraft.server.level.DistanceManager distanceManager = playerChunkMap.distanceManager; distanceManager.addTicketAtLevel(net.minecraft.server.level.TicketType.LOGIN, pos, 31, pos.toLong()); @@ -1127,7 +1127,7 @@ index 10d3a8477502f991c03c665a192eda91a288f4c3..45b48275a3f944d495cc090abc4af5a4 net.minecraft.server.level.ChunkHolder updatingChunk = playerChunkMap.getUpdatingChunkIfPresent(pos.toLong()); if (updatingChunk != null) { return updatingChunk.getEntityTickingChunkFuture(); -@@ -703,6 +703,7 @@ public abstract class PlayerList { +@@ -705,6 +705,7 @@ public abstract class PlayerList { SocketAddress socketaddress = loginlistener.connection.getRemoteAddress(); ServerPlayer entity = new ServerPlayer(this.server, this.server.getLevel(Level.OVERWORLD), gameprofile); @@ -1135,7 +1135,7 @@ index 10d3a8477502f991c03c665a192eda91a288f4c3..45b48275a3f944d495cc090abc4af5a4 Player player = entity.getBukkitEntity(); PlayerLoginEvent event = new PlayerLoginEvent(player, hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.getRawAddress()).getAddress()); -@@ -891,6 +892,7 @@ public abstract class PlayerList { +@@ -893,6 +894,7 @@ public abstract class PlayerList { // CraftBukkit end worldserver1.getChunkSource().addRegionTicket(net.minecraft.server.level.TicketType.POST_TELEPORT, new net.minecraft.world.level.ChunkPos(location.getBlockX() >> 4, location.getBlockZ() >> 4), 1, entityplayer.getId()); // Paper @@ -1144,7 +1144,7 @@ index 10d3a8477502f991c03c665a192eda91a288f4c3..45b48275a3f944d495cc090abc4af5a4 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 0b50701b64cbeb8884dca3b7d89583a9e1721a16..9f8e210961ff61db67b274236b9f906b7a3b3da1 100644 +index ef5cfd14a2adee048a4ebb61349dad1020aa4842..f948d0de66920e562f2edb0171637d586fb6baba 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -223,7 +223,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n diff --git a/patches/server/0489-Improve-Chunk-Status-Transition-Speed.patch b/patches/server/0489-Improve-Chunk-Status-Transition-Speed.patch index 44f0967036..5847780c47 100644 --- a/patches/server/0489-Improve-Chunk-Status-Transition-Speed.patch +++ b/patches/server/0489-Improve-Chunk-Status-Transition-Speed.patch @@ -36,7 +36,7 @@ scenario / path: Previously would have hopped to SERVER around 12+ times there extra. diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index f9207e3661ba630ee1791d0842e0de684b22fd17..2d81fce2f5d9320b4cc9310fd0428b96318c7237 100644 +index 3e004f391668865c0e6f1c38cef9661f7372fffe..4114c0fa58e41383b5469cbc6abb44416a7af247 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -242,6 +242,13 @@ public class ChunkHolder { @@ -54,10 +54,10 @@ index f9207e3661ba630ee1791d0842e0de684b22fd17..2d81fce2f5d9320b4cc9310fd0428b96 public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) { this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size()); diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 15dba7f2e6a7c670b415f67345fad37873a1130c..7f7bc04a30a0422b2d589adb488082c0aa5326dc 100644 +index dd0f9ab476735e0a61533bdfed5868fa5f523b68..017ed8e1db45d49de67b17b5979721cfd57fb9c7 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -839,7 +839,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -841,7 +841,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return either.mapLeft((list) -> { return (LevelChunk) list.get(list.size() / 2); }); @@ -66,7 +66,7 @@ index 15dba7f2e6a7c670b415f67345fad37873a1130c..7f7bc04a30a0422b2d589adb488082c0 } @Nullable -@@ -1281,6 +1281,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1282,6 +1282,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return "chunkGenerate " + requiredStatus.getName(); }); Executor executor = (runnable) -> { diff --git a/patches/server/0493-Thread-Safe-Vanilla-Command-permission-checking.patch b/patches/server/0493-Thread-Safe-Vanilla-Command-permission-checking.patch index a297a9a47f..85b55a1357 100644 --- a/patches/server/0493-Thread-Safe-Vanilla-Command-permission-checking.patch +++ b/patches/server/0493-Thread-Safe-Vanilla-Command-permission-checking.patch @@ -26,7 +26,7 @@ index aa3a1795850a419f624f14bd7c4daab0020779d0..39708be1b445791b053023dec16ad7d4 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index 42d97bc67c8f4e5b65a81159179c43dc6edc804c..6a330170ec1ea9d06593a1bbd1bdb8d98c0904fb 100644 +index a59d14e61fcbca7861a5593d0717b81262ccbdc5..134bb2a4826419110c10a483834747b942576e58 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java @@ -54,7 +54,7 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy @@ -36,8 +36,8 @@ index 42d97bc67c8f4e5b65a81159179c43dc6edc804c..6a330170ec1ea9d06593a1bbd1bdb8d9 - public volatile CommandNode currentCommand; // CraftBukkit + public ThreadLocal currentCommand = new ThreadLocal<>(); // CraftBukkit // Paper - public CommandSourceStack(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String simpleName, Component name, MinecraftServer server, @Nullable Entity entity) { - this(output, pos, rot, world, level, simpleName, name, server, entity, false, (commandcontext, flag, j) -> { + public CommandSourceStack(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String name, Component displayName, MinecraftServer server, @Nullable Entity entity) { + this(output, pos, rot, world, level, name, displayName, server, entity, false, (commandcontext, flag, j) -> { @@ -175,9 +175,11 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy @Override public boolean hasPermission(int level) { diff --git a/patches/server/0494-Move-range-check-for-block-placing-up.patch b/patches/server/0494-Move-range-check-for-block-placing-up.patch index 11d1765101..1dd09de2a0 100644 --- a/patches/server/0494-Move-range-check-for-block-placing-up.patch +++ b/patches/server/0494-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 3e91275b318904ffa31183987fcbc7b28692781a..ea17f9263bef3a2a36dde15d0d75b8a5a695aa93 100644 +index aec4d7987ed168bc6a70c178d44b8d0d1822b845..2ebb62c1326e988d28d4fd608f3ee009a975397f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1693,17 +1693,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1673,17 +1673,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser BlockPos blockposition = movingobjectpositionblock.getBlockPos(); Direction enumdirection = movingobjectpositionblock.getDirection(); diff --git a/patches/server/0495-Optimize-Light-Engine.patch b/patches/server/0495-Optimize-Light-Engine.patch index 123256ca51..235c6c304f 100644 --- a/patches/server/0495-Optimize-Light-Engine.patch +++ b/patches/server/0495-Optimize-Light-Engine.patch @@ -37,7 +37,7 @@ index 4114c0fa58e41383b5469cbc6abb44416a7af247..e649e6a8b354be45eed808ee02082ca7 if (this.queueLevel != priority) { this.onLevelChange.onLevelChange(this.pos, () -> this.queueLevel, priority, p -> this.queueLevel = p); // use preferred priority diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 6ed95a0cff3e9c874f14bc90283f750e15765c67..5d57461d33f442e2ff0363348555357ba90f2f58 100644 +index 017ed8e1db45d49de67b17b5979721cfd57fb9c7..42fd259f4492e539112b5bcb310aaaadab58a443 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -97,6 +97,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana @@ -56,7 +56,7 @@ index 6ed95a0cff3e9c874f14bc90283f750e15765c67..5d57461d33f442e2ff0363348555357b public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier persistentStateManagerFactory, int viewDistance, boolean dsync) { super(new File(session.getDimensionPath(world.dimension()), "region"), dataFixer, dsync); //this.visibleChunks = this.updatingChunks.clone(); // Paper - no more cloning -@@ -370,7 +372,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -372,7 +374,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.progressListener = worldGenerationProgressListener; this.chunkStatusListener = chunkStatusChangeListener; @@ -73,7 +73,7 @@ index 6ed95a0cff3e9c874f14bc90283f750e15765c67..5d57461d33f442e2ff0363348555357b this.queueSorter = new ChunkTaskPriorityQueueSorter(ImmutableList.of(threadedmailbox, mailbox, threadedmailbox1), executor, Integer.MAX_VALUE); this.worldgenMailbox = this.queueSorter.getProcessor(threadedmailbox, false); -@@ -879,6 +889,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -881,6 +891,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @Override public void close() throws IOException { try { @@ -126,10 +126,10 @@ index d3d6651eb51c852ed1d1eeb5689569d5308b246d..c2d36600a0081c78425868154bdcf7f4 m = Long.MAX_VALUE; } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 0b22fd8ac75146bc7b647cfbefc73ce890ccb033..f27160640c7c63075d41e52a74227c1168cce6b2 100644 +index ac9cb37dd91ac449f8943b1279f247846a35025a..ce1b73363f8a1a012aa7b3cbcc54164d87abc195 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -1061,7 +1061,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -1068,7 +1068,7 @@ public class ServerChunkCache extends ChunkSource { if (ServerChunkCache.this.runDistanceManagerUpdates()) { return true; } else { @@ -139,7 +139,7 @@ index 0b22fd8ac75146bc7b647cfbefc73ce890ccb033..f27160640c7c63075d41e52a74227c11 } } finally { diff --git a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java b/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java -index de228b677810ce49c4e953ca0b4e590413b20e45..f05e9dbb5f9b9fa23cf51f72f744c445c54234cd 100644 +index 2c4aa4b66d83b6e7a104479860b7982629c63c3b..84f86e51fca587887c4b2277205a188a92696110 100644 --- a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java +++ b/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java @@ -1,6 +1,7 @@ @@ -350,26 +350,23 @@ index de228b677810ce49c4e953ca0b4e590413b20e45..f05e9dbb5f9b9fa23cf51f72f744c445 LevelChunkSection[] levelChunkSections = chunk.getSections(); for(int i = 0; i < chunk.getSectionsCount(); ++i) { -@@ -161,53 +304,48 @@ public class ThreadedLevelLightEngine extends LevelLightEngine implements AutoCl - }); - } +@@ -163,51 +306,45 @@ public class ThreadedLevelLightEngine extends LevelLightEngine implements AutoCl -- this.chunkMap.releaseLightTicket(chunkPos); -+ // this.chunkMap.releaseLightTicket(chunkPos); // Paper - move into post task below }, () -> { return "lightChunk " + chunkPos + " " + excludeBlocks; - })); - return CompletableFuture.supplyAsync(() -> { + // Paper start - merge the 2 together + }), () -> { -+ this.chunkMap.releaseLightTicket(chunkPos); // Paper - release light tickets as post task to ensure they stay loaded until fully done ++ this.chunkMap.releaseLightTicket(chunkPos); // Paper - moved from below, we want to call this even when returning early + if (skippedPre[0]) return; // Paper - future's already complete chunk.setLightCorrect(true); super.retainData(chunkPos, false); +- this.chunkMap.releaseLightTicket(chunkPos); - return chunk; - }, (runnable) -> { - this.addTask(chunkPos.x, chunkPos.z, ThreadedLevelLightEngine.TaskType.POST_UPDATE, runnable); -+ // Paper start ++ //this.chunkMap.releaseLightTicket(chunkPos); // Paper - moved up + future.complete(chunk); }); + return future; @@ -429,10 +426,10 @@ index de228b677810ce49c4e953ca0b4e590413b20e45..f05e9dbb5f9b9fa23cf51f72f744c445 public void setTaskPerBatch(int taskBatchSize) { diff --git a/src/main/java/net/minecraft/world/level/chunk/DataLayer.java b/src/main/java/net/minecraft/world/level/chunk/DataLayer.java -index 25570730f376665ca6477263d3b3f94d725ecd21..0570adf7e3caf97be77c5400fb76c3ec31a0d679 100644 +index c561d69b4b903cd3625468b239cb1ace3e317700..c4acc7e0035d37167cf5a56f8d90ba17f85cbbe3 100644 --- a/src/main/java/net/minecraft/world/level/chunk/DataLayer.java +++ b/src/main/java/net/minecraft/world/level/chunk/DataLayer.java -@@ -13,6 +13,13 @@ public class DataLayer { +@@ -14,6 +14,13 @@ public class DataLayer { @Nullable protected byte[] data; // Paper start @@ -1217,7 +1214,7 @@ index d122475c1a9d340046c478087d3ff5bf1ff8932c..a3189dd7b537deb4a30a32c8e9891b07 if (direction == Direction.DOWN) { continue; diff --git a/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java b/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java -index 7dc194b4f04b2d59dcb100b0a3b2ca0132f832cf..c30fb3ad6716599c50acb918b40909e5dc052841 100644 +index ec3837a64e8ac6892028611d57a111a7fd5c58f7..006a4b02df0f7d9229b1f3791d4f3b9243919c18 100644 --- a/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java +++ b/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java @@ -30,7 +30,12 @@ public class SkyLightSectionStorage extends LayerLightSectionStorage 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit // Paper - move down // MinecraftServer.LOGGER.debug("Autosave started"); // Paper serverAutoSave = (autosavePeriod > 0 && this.tickCount % autosavePeriod == 0); // Paper @@ -55,10 +55,10 @@ index 913f2aee362e574ae39df64c392e1c0fe2d77b98..4440e429f13767c675f0450a534e9885 } // Paper start for (ServerLevel level : this.getAllLevels()) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 24223a6a58047312bd82cd1e29b5db61b0853159..af74e31b0e55038b04198e80f2fc021e3069e6a1 100644 +index ca83d167b12422f4d7490d2ebdff401200444d42..8c5445f845c5a1d30a4046ef78ea930d684e1942 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -174,6 +174,7 @@ public class ServerPlayer extends Player { +@@ -175,6 +175,7 @@ public class ServerPlayer extends Player { public final int getViewDistance() { return this.getLevel().getChunkSource().chunkMap.viewDistance - 1; } // Paper - placeholder private static final Logger LOGGER = LogManager.getLogger(); @@ -67,10 +67,10 @@ index 24223a6a58047312bd82cd1e29b5db61b0853159..af74e31b0e55038b04198e80f2fc021e private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; public ServerGamePacketListenerImpl connection; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 4f37d3e95c4f20fccbff16dd619bfe841431f548..28c073fd8877280dd0433d748748a98b03bc092f 100644 +index 83df832b1fe5be1c1114ce3ae10c1985bf564a0c..13f1b62e6f3adce54f82d6d131dd60976dc6f548 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -567,6 +567,7 @@ public abstract class PlayerList { +@@ -569,6 +569,7 @@ public abstract class PlayerList { protected void save(ServerPlayer player) { if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit if (!player.didPlayerJoinEvent) return; // Paper - If we never fired PJE, we disconnected during login. Data has not changed, and additionally, our saved vehicle is not loaded! If we save now, we will lose our vehicle (CraftBukkit bug) @@ -78,7 +78,7 @@ index 4f37d3e95c4f20fccbff16dd619bfe841431f548..28c073fd8877280dd0433d748748a98b this.playerIo.save(player); ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit -@@ -1206,10 +1207,21 @@ public abstract class PlayerList { +@@ -1208,10 +1209,21 @@ public abstract class PlayerList { } public void saveAll() { diff --git a/patches/server/0506-Brand-support.patch b/patches/server/0506-Brand-support.patch index 9ab51c9dfb..120b342c00 100644 --- a/patches/server/0506-Brand-support.patch +++ b/patches/server/0506-Brand-support.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Brand support diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 758e3169b163dccfceffb2537fd37d1a2ee05994..fc16032f5693b0fb39974d027f237f88aabc2e7b 100644 +index 2ebb62c1326e988d28d4fd608f3ee009a975397f..00ce5bfdae67befdb72b01c152ab403fe60ab663 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -4,6 +4,7 @@ import com.google.common.collect.Lists; @@ -24,7 +24,7 @@ index 758e3169b163dccfceffb2537fd37d1a2ee05994..fc16032f5693b0fb39974d027f237f88 import net.minecraft.network.chat.ChatType; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -@@ -259,6 +261,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -258,6 +260,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit @@ -33,7 +33,7 @@ index 758e3169b163dccfceffb2537fd37d1a2ee05994..fc16032f5693b0fb39974d027f237f88 public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { this.server = server; this.connection = connection; -@@ -3000,6 +3004,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2981,6 +2985,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private static final ResourceLocation CUSTOM_REGISTER = new ResourceLocation("register"); private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister"); @@ -42,7 +42,7 @@ index 758e3169b163dccfceffb2537fd37d1a2ee05994..fc16032f5693b0fb39974d027f237f88 @Override public void handleCustomPayload(ServerboundCustomPayloadPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); -@@ -3027,6 +3033,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3008,6 +3014,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser try { byte[] data = new byte[packet.data.readableBytes()]; packet.data.readBytes(data); @@ -58,7 +58,7 @@ index 758e3169b163dccfceffb2537fd37d1a2ee05994..fc16032f5693b0fb39974d027f237f88 this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data); } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); -@@ -3036,6 +3051,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3017,6 +3032,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } @@ -72,10 +72,10 @@ index 758e3169b163dccfceffb2537fd37d1a2ee05994..fc16032f5693b0fb39974d027f237f88 return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5aba300b2aa99bcf17fdf19f8203a52bc814168e..be7b69f8279bbb95d49c5b6ac24fde356d5caaf2 100644 +index 7e1af7f10b53a86de38a8d440c1a8d2037eca6e0..a0b6f9e2e7adab1aacec22bcbd47892fa7f0c01d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2421,6 +2421,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2422,6 +2422,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end }; diff --git a/patches/server/0507-Add-setMaxPlayers-API.patch b/patches/server/0507-Add-setMaxPlayers-API.patch index d4351404bf..01a06e23a6 100644 --- a/patches/server/0507-Add-setMaxPlayers-API.patch +++ b/patches/server/0507-Add-setMaxPlayers-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add #setMaxPlayers API diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index b64b7ea33576cdcc9179e5849667b0cb5f52dcd6..fd6d9fd1469190435abe16fb3ba15e9522243d42 100644 +index 13f1b62e6f3adce54f82d6d131dd60976dc6f548..f2b139d565662fca1bbad46e50b5ccb0d08c4e37 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -143,7 +143,7 @@ public abstract class PlayerList { +@@ -145,7 +145,7 @@ public abstract class PlayerList { public final PlayerDataStorage playerIo; private boolean doWhiteList; private final RegistryAccess.RegistryHolder registryHolder; @@ -18,7 +18,7 @@ index b64b7ea33576cdcc9179e5849667b0cb5f52dcd6..fd6d9fd1469190435abe16fb3ba15e95 private boolean allowCheatsForAllPlayers; private static final boolean ALLOW_LOGOUTIVATOR = false; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ac7034a922facb772a67580100627a7c85510693..f6fd414e639f2880f1abc2e4c4ef0fbe05a562db 100644 +index 2b8fa52a7a80ce48673cfcae3bb6c1f1de004372..3572d362aa0773ea27353bfd0e11b591190a7908 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -612,6 +612,13 @@ public final class CraftServer implements Server { diff --git a/patches/server/0522-Create-HoverEvent-from-ItemStack-Entity.patch b/patches/server/0522-Create-HoverEvent-from-ItemStack-Entity.patch index 312798c243..fb9f275acf 100644 --- a/patches/server/0522-Create-HoverEvent-from-ItemStack-Entity.patch +++ b/patches/server/0522-Create-HoverEvent-from-ItemStack-Entity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Create HoverEvent from ItemStack Entity diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 001e89e85fb935c539c53c8e9c78927e26e099d8..d1ca61f394c0efa1688069e5d1fb529348d5985f 100644 +index 8f5d71463616e519c2e183af1c2909fd55a3f93a..1a8ff7339c58a4fffb051a090a7b8c34cb346a61 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -368,5 +368,40 @@ public final class CraftItemFactory implements ItemFactory { +@@ -371,5 +371,40 @@ public final class CraftItemFactory implements ItemFactory { return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId()) : null; } diff --git a/patches/server/0523-Cache-block-data-strings.patch b/patches/server/0523-Cache-block-data-strings.patch index 72c9e2eca1..c7c201a261 100644 --- a/patches/server/0523-Cache-block-data-strings.patch +++ b/patches/server/0523-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 a962209749c7cc7f6d304073f5f2bce55014a29e..1f086b02405efbae67299853105b96457825e9fe 100644 +index 2c0b2bb254e9f4d39b526f170c11f481805d43d1..ffec95cde36b961545a3fe1bc5fc9f0cb1d38c65 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2037,6 +2037,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop capturedBlockStates = new java.util.LinkedHashMap<>(); // Paper diff --git a/patches/server/0553-Add-API-for-quit-reason.patch b/patches/server/0553-Add-API-for-quit-reason.patch index 599412f222..75140a3c25 100644 --- a/patches/server/0553-Add-API-for-quit-reason.patch +++ b/patches/server/0553-Add-API-for-quit-reason.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add API for quit reason diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 01b9c360c6d687c6a774bf3375802be487cb0e0c..35a03d15f87be8eb86d65e1863a3e0cb2dd201ee 100644 +index 7f6405ac44fef423dc8b21f3dbeaae26a1005077..bdd4f4db9849d9107b5c62d5e83b1277621f49f1 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -142,12 +142,15 @@ public class Connection extends SimpleChannelInboundHandler> { @@ -25,10 +25,10 @@ index 01b9c360c6d687c6a774bf3375802be487cb0e0c..35a03d15f87be8eb86d65e1863a3e0cb Connection.LOGGER.debug("Failed to sent packet", throwable); ConnectionProtocol enumprotocol = this.getCurrentProtocol(); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index af74e31b0e55038b04198e80f2fc021e3069e6a1..ca954dc06a76fc42af476e2a1733e5c1232db6ba 100644 +index 8c5445f845c5a1d30a4046ef78ea930d684e1942..979c3c08024f398997cd9f27bdff36391cc584a9 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -261,6 +261,7 @@ public class ServerPlayer extends Player { +@@ -262,6 +262,7 @@ public class ServerPlayer extends Player { public double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper boolean needsChunkCenterUpdate; // Paper - no-tick view distance @@ -37,10 +37,10 @@ index af74e31b0e55038b04198e80f2fc021e3069e6a1..ca954dc06a76fc42af476e2a1733e5c1 public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e98d20b0790a2bb581e8916ec17627830eedbd26..1a5c33407bfe3cdb91953a7067b00f38b92189c5 100644 +index 85d6f50dd7394e20eeb0383b0d7d5e6653c29dda..fdf4a8078112ccef9087d5fa3e9b189bc5154561 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -444,6 +444,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -443,6 +443,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser final Component ichatbasecomponent = PaperAdventure.asVanilla(event.reason()); // Paper - Adventure // CraftBukkit end @@ -49,10 +49,10 @@ index e98d20b0790a2bb581e8916ec17627830eedbd26..1a5c33407bfe3cdb91953a7067b00f38 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 91ce39579e9e46f2c10df5f750f52ba68777e4cc..81571c7af33ef273fd2833eb9e0ad38c5787e96b 100644 +index f2b139d565662fca1bbad46e50b5ccb0d08c4e37..b9f6f8441cafeb3e64ce7943bfd1e92fe983a5c5 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -594,7 +594,7 @@ public abstract class PlayerList { +@@ -596,7 +596,7 @@ public abstract class PlayerList { entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper } diff --git a/patches/server/0557-Expose-world-spawn-angle.patch b/patches/server/0557-Expose-world-spawn-angle.patch index 6435f7bd1f..909ddc6ea9 100644 --- a/patches/server/0557-Expose-world-spawn-angle.patch +++ b/patches/server/0557-Expose-world-spawn-angle.patch @@ -5,10 +5,10 @@ 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 4cf9e944bf4a88391a290f703931e551e26cf7f5..ff4ff0d2ab9870c16a4f7b2ee11bfcb5e95ce7a0 100644 +index b9f6f8441cafeb3e64ce7943bfd1e92fe983a5c5..f8b917b2d1a1744f7a6c3b9cf60be41764ed2815 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -872,7 +872,7 @@ public abstract class PlayerList { +@@ -874,7 +874,7 @@ public abstract class PlayerList { if (location == null) { worldserver1 = this.server.getLevel(Level.OVERWORLD); blockposition = entityplayer1.getSpawnPoint(worldserver1); diff --git a/patches/server/0563-Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/0563-Climbing-should-not-bypass-cramming-gamerule.patch index eac5222942..0cf4189fff 100644 --- a/patches/server/0563-Climbing-should-not-bypass-cramming-gamerule.patch +++ b/patches/server/0563-Climbing-should-not-bypass-cramming-gamerule.patch @@ -21,7 +21,7 @@ index 935bb237f8ecd63ca4cec64a7c7a341c9d3358e5..208690ceca2485b54acde5123ba494d7 private void keepLoadedRange() { keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index bf9813eee5865e7363fce3c015a3b8e3e637ce75..408d0f51353c745cbdc5c314dd25fa0c8a13441c 100644 +index d857359e315f56afd9218e29bc43b898f41d22e5..3fb8a99fceaf7d271737046b9411b9a536e38ab6 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1723,6 +1723,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -61,10 +61,10 @@ index 8fb89326395a7e70982c0d757b506565e98b12a4..a060cca08631fb42041e3a79a9abc422 } else if (entity.level.isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) { return false; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index a524ea7ff8206036de07d24683adadee8bd41eac..34304fd25a73b3b7e4f078e85b6bee94ab2cc8c8 100644 +index eb4089aa6986edd709d2b0a7853a19a020f02e57..c0dbfa4a03c2c575b24fd960bea338532d64eac7 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3271,7 +3271,7 @@ public abstract class LivingEntity extends Entity { +@@ -3274,7 +3274,7 @@ public abstract class LivingEntity extends Entity { return; } // Paper end - don't run getEntities if we're not going to use its result @@ -73,7 +73,7 @@ index a524ea7ff8206036de07d24683adadee8bd41eac..34304fd25a73b3b7e4f078e85b6bee94 if (!list.isEmpty()) { // Paper - move up -@@ -3438,9 +3438,16 @@ public abstract class LivingEntity extends Entity { +@@ -3441,9 +3441,16 @@ public abstract class LivingEntity extends Entity { return !this.isRemoved() && this.collides; // CraftBukkit } @@ -120,10 +120,10 @@ index 23f87848b42d180c94b5659b184a768a756deed8..345fe87d5d6c3883c28d2c1b34d1020e @Override diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java -index 6ce4c3938fb5331b4d439c6a42a7bb5fffb1d0a0..ba58e066cca533dfed7610a730c4dd7423fe124d 100644 +index e9cfe18bc6be3bc6f2d18c25b6b69e67d62ee946..5c104bf219e5e4acb8acfb160bd92f0a0621d864 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java -@@ -240,7 +240,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -239,7 +239,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, } @Override diff --git a/patches/server/0568-Limit-recipe-packets.patch b/patches/server/0568-Limit-recipe-packets.patch index 1d9c304fad..bec98cca72 100644 --- a/patches/server/0568-Limit-recipe-packets.patch +++ b/patches/server/0568-Limit-recipe-packets.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Limit recipe packets diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 7d50aded88f5b7dfebaea1aebc86231f7b5c4e25..652d87fc5d566dba8018c81676329f0e0bca471b 100644 +index 3e486376a49a61d52cdcd32ea877996d81186a73..e62bb33852b0dca346aeb3cb2747d1a5686dea2d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -334,6 +334,13 @@ public class PaperConfig { @@ -23,10 +23,10 @@ index 7d50aded88f5b7dfebaea1aebc86231f7b5c4e25..652d87fc5d566dba8018c81676329f0e public static boolean velocityOnlineMode; public static byte[] velocitySecretKey; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1b6610cc04f6bcb6d3153886e62ce117c6a17e15..6d88ec99a634d58ba51a87db9e25d746ec746862 100644 +index 6dccd2288e2fbce173fa60529ee161725e0f983c..11cc3a6f04371b9217c201fd5d583213c2fbe57d 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -232,6 +232,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -231,6 +231,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // CraftBukkit start - multithreaded fields private AtomicInteger chatSpamTickCount = new AtomicInteger(); private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits @@ -34,7 +34,7 @@ index 1b6610cc04f6bcb6d3153886e62ce117c6a17e15..6d88ec99a634d58ba51a87db9e25d746 // CraftBukkit end private int dropSpamTickCount; private double firstGoodX; -@@ -377,6 +378,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -376,6 +377,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // CraftBukkit start for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable @@ -42,7 +42,7 @@ index 1b6610cc04f6bcb6d3153886e62ce117c6a17e15..6d88ec99a634d58ba51a87db9e25d746 /* Use thread-safe field access instead if (this.chatSpamTickCount > 0) { --this.chatSpamTickCount; -@@ -2794,6 +2796,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2780,6 +2782,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @Override public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { diff --git a/patches/server/0571-Player-Chunk-Load-Unload-Events.patch b/patches/server/0571-Player-Chunk-Load-Unload-Events.patch index 860e0f49d2..491cb0d825 100644 --- a/patches/server/0571-Player-Chunk-Load-Unload-Events.patch +++ b/patches/server/0571-Player-Chunk-Load-Unload-Events.patch @@ -5,16 +5,16 @@ Subject: [PATCH] Player Chunk Load/Unload Events diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index ca954dc06a76fc42af476e2a1733e5c1232db6ba..430ffb96e137cdfc02634ddf3050dd5a3012cc28 100644 +index 979c3c08024f398997cd9f27bdff36391cc584a9..3fce21f8a7a48099dd6c2cce6b96fcae7975ac96 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2094,11 +2094,21 @@ public class ServerPlayer extends Player { - public void trackChunk(ChunkPos chunkcoordintpair, Packet packet, Packet packet1) { - this.connection.send(packet1); - this.connection.send(packet); +@@ -2090,11 +2090,21 @@ public class ServerPlayer extends Player { + public void trackChunk(ChunkPos chunkPos, Packet chunkDataPacket, Packet lightUpdatePacket) { + this.connection.send(lightUpdatePacket); + this.connection.send(chunkDataPacket); + // Paper start + if(io.papermc.paper.event.packet.PlayerChunkLoadEvent.getHandlerList().getRegisteredListeners().length > 0){ -+ new io.papermc.paper.event.packet.PlayerChunkLoadEvent(this.getBukkitEntity().getWorld().getChunkAt(chunkcoordintpair.longKey), this.getBukkitEntity()).callEvent(); ++ new io.papermc.paper.event.packet.PlayerChunkLoadEvent(this.getBukkitEntity().getWorld().getChunkAt(chunkPos.longKey), this.getBukkitEntity()).callEvent(); + } + // Paper end } diff --git a/patches/server/0585-Fix-interact-event-not-being-called-in-adventure.patch b/patches/server/0585-Fix-interact-event-not-being-called-in-adventure.patch index 85341edb6c..a52fc6ff3f 100644 --- a/patches/server/0585-Fix-interact-event-not-being-called-in-adventure.patch +++ b/patches/server/0585-Fix-interact-event-not-being-called-in-adventure.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix interact event not being called in adventure Call PlayerInteractEvent when left-clicking on a block in adventure mode diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 6d88ec99a634d58ba51a87db9e25d746ec746862..16e0feef7dc99d0a06252a8d395a7c160d1e16e8 100644 +index 11cc3a6f04371b9217c201fd5d583213c2fbe57d..7318dc5e3ed94a00b675912e2c73c53aee9e93d4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1733,7 +1733,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1713,7 +1713,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser MutableComponent ichatmutablecomponent = (new TranslatableComponent("build.tooHigh", new Object[]{i - 1})).withStyle(ChatFormatting.RED); this.player.sendMessage((Component) ichatmutablecomponent, ChatType.GAME_INFO, Util.NIL_UUID); @@ -18,7 +18,7 @@ index 6d88ec99a634d58ba51a87db9e25d746ec746862..16e0feef7dc99d0a06252a8d395a7c16 this.player.swing(enumhand, true); } } -@@ -2205,7 +2205,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2185,7 +2185,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser Vec3 vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3); HitResult movingobjectposition = this.player.level.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, this.player)); diff --git a/patches/server/0591-Added-ServerResourcesReloadedEvent.patch b/patches/server/0591-Added-ServerResourcesReloadedEvent.patch index 07768a8c59..935c9460fa 100644 --- a/patches/server/0591-Added-ServerResourcesReloadedEvent.patch +++ b/patches/server/0591-Added-ServerResourcesReloadedEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Added ServerResourcesReloadedEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2672f9ea9c1213fea5ec212012cb0fbd173c7324..bbc96d35ffb0d6cd0f8964ea25e1d6585fbee1d7 100644 +index abc6ed89ffaa9c70a25265d1fee271ec841bc586..e6da0975b46ef7dbce4dd4025d5f27f990a310bf 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2016,7 +2016,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop completablefuture = CompletableFuture.supplyAsync(() -> { Stream stream = datapacks.stream(); // CraftBukkit - decompile error PackRepository resourcepackrepository = this.packRepository; -@@ -2032,6 +2038,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { diff --git a/patches/server/0601-Add-sendOpLevel-API.patch b/patches/server/0601-Add-sendOpLevel-API.patch index 175b4f9f5d..73672abc6c 100644 --- a/patches/server/0601-Add-sendOpLevel-API.patch +++ b/patches/server/0601-Add-sendOpLevel-API.patch @@ -5,10 +5,10 @@ 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 d4de245b36e299c87b2c62d8e341c0fd027e6fc0..db4d33bdb00fd1eb40cae10ce4dedc31b57bfc41 100644 +index 6ac6d05390359bd858673c4941e7d90f4cf98a02..f80e4e2d8311ccfb62b7a61a71d8ae43d5d35cf4 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1121,22 +1121,29 @@ public abstract class PlayerList { +@@ -1123,22 +1123,29 @@ public abstract class PlayerList { } private void sendPlayerPermissionLevel(ServerPlayer player, int permissionLevel) { @@ -46,7 +46,7 @@ index d4de245b36e299c87b2c62d8e341c0fd027e6fc0..db4d33bdb00fd1eb40cae10ce4dedc31 // Paper start diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f0ea99248db07e3b992fed5d950014bcbc951370..85187e7b0d965b7930e6b2ab8d321d6d27211a35 100644 +index 1a2ed6e414b190f7ccb390fa1923222bf38bc36c..5b5c9d1bedb5fb87f390e39942a64f4d87098eeb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -552,6 +552,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0605-Return-chat-component-with-empty-text-instead-of-thr.patch b/patches/server/0605-Return-chat-component-with-empty-text-instead-of-thr.patch index bd4cd61eb2..598bfd9a8f 100644 --- a/patches/server/0605-Return-chat-component-with-empty-text-instead-of-thr.patch +++ b/patches/server/0605-Return-chat-component-with-empty-text-instead-of-thr.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Return chat component with empty text instead of throwing diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index 92681e56cea92a4600ef268b21c1b56e15fe3a03..b4c1e62c6ed1ea0319ebb268bf8032218a306e78 100644 +index 60a67f75b4f772654e064e2b19f68a907ca4c93b..1b6111084e963281b453b9c29736cee61d422abf 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -@@ -20,6 +20,7 @@ import net.minecraft.ReportedException; +@@ -21,6 +21,7 @@ import net.minecraft.ReportedException; import net.minecraft.core.NonNullList; import net.minecraft.core.Registry; import net.minecraft.network.chat.Component; @@ -17,7 +17,7 @@ index 92681e56cea92a4600ef268b21c1b56e15fe3a03..b4c1e62c6ed1ea0319ebb268bf803221 import net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket; import net.minecraft.server.level.ServerPlayer; import net.minecraft.util.Mth; -@@ -82,7 +83,12 @@ public abstract class AbstractContainerMenu { +@@ -84,7 +85,12 @@ public abstract class AbstractContainerMenu { } private Component title; public final Component getTitle() { diff --git a/patches/server/0608-Implement-BlockPreDispenseEvent.patch b/patches/server/0608-Implement-BlockPreDispenseEvent.patch index cefd57a26c..ef69779d9c 100644 --- a/patches/server/0608-Implement-BlockPreDispenseEvent.patch +++ b/patches/server/0608-Implement-BlockPreDispenseEvent.patch @@ -17,10 +17,10 @@ index 501a5483160dba050261bb3448317a097cdb7ef2..2dcac4b638073aa1748f26f61219dbf9 tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack)); } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 7823477b8fc18901014ba397f711de50cb9880f3..fefb8ff3caff61d8ea2c52d5b280e5af03b76bbf 100644 +index a2c8deb54e9a8448f2473b58a01329b44f6a3d8f..c2ddbde78c861c33f25c63483fc8928307161f1a 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1809,5 +1809,11 @@ public class CraftEventFactory { +@@ -1810,5 +1810,11 @@ public class CraftEventFactory { io.papermc.paper.event.block.BlockFailedDispenseEvent event = new io.papermc.paper.event.block.BlockFailedDispenseEvent(block); return event.callEvent(); } diff --git a/patches/server/0615-Add-dropLeash-variable-to-EntityUnleashEvent.patch b/patches/server/0615-Add-dropLeash-variable-to-EntityUnleashEvent.patch index b7a5b5f779..d1c56185b7 100644 --- a/patches/server/0615-Add-dropLeash-variable-to-EntityUnleashEvent.patch +++ b/patches/server/0615-Add-dropLeash-variable-to-EntityUnleashEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add dropLeash variable to EntityUnleashEvent diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 108c5871c2171f22a8e0db8c00bfcaa4438b6137..c4c5c35e37b793f3b74349ff03c0829f4913b91c 100644 +index eec836e5e66a7255a31f1e9311cdb4e9819c84b2..0ce0e7a923da812a02d9ab83607d3cc9c87047df 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1208,12 +1208,15 @@ public abstract class Mob extends LivingEntity { +@@ -1209,12 +1209,15 @@ public abstract class Mob extends LivingEntity { return InteractionResult.PASS; } else if (this.getLeashHolder() == player) { // CraftBukkit start - fire PlayerUnleashEntityEvent @@ -26,7 +26,7 @@ index 108c5871c2171f22a8e0db8c00bfcaa4438b6137..c4c5c35e37b793f3b74349ff03c0829f return InteractionResult.sidedSuccess(this.level.isClientSide); } else { InteractionResult enuminteractionresult = this.checkAndHandleImportantInteractions(player, hand); -@@ -1371,8 +1374,11 @@ public abstract class Mob extends LivingEntity { +@@ -1372,8 +1375,11 @@ public abstract class Mob extends LivingEntity { if (this.leashHolder != null) { if (!this.isAlive() || !this.leashHolder.isAlive()) { @@ -40,7 +40,7 @@ index 108c5871c2171f22a8e0db8c00bfcaa4438b6137..c4c5c35e37b793f3b74349ff03c0829f } } -@@ -1435,8 +1441,11 @@ public abstract class Mob extends LivingEntity { +@@ -1436,8 +1442,11 @@ public abstract class Mob extends LivingEntity { boolean flag1 = super.startRiding(entity, force); if (flag1 && this.isLeashed()) { @@ -54,7 +54,7 @@ index 108c5871c2171f22a8e0db8c00bfcaa4438b6137..c4c5c35e37b793f3b74349ff03c0829f } return flag1; -@@ -1606,8 +1615,11 @@ public abstract class Mob extends LivingEntity { +@@ -1607,8 +1616,11 @@ public abstract class Mob extends LivingEntity { @Override protected void removeAfterChangingDimensions() { super.removeAfterChangingDimensions(); @@ -122,7 +122,7 @@ index b9b67134f02fd7484ed19905c9ae1f9b8a26ce26..c05f173b7642380900fdd77ce5d2c020 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index fefb8ff3caff61d8ea2c52d5b280e5af03b76bbf..4991ee6671f73b446e5dff958427b10aac78c63a 100644 +index c2ddbde78c861c33f25c63483fc8928307161f1a..b4509c4a03b82d7c49329aa74087818499430e58 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1466,8 +1466,10 @@ public class CraftEventFactory { diff --git a/patches/server/0616-Skip-distance-map-update-when-spawning-disabled.patch b/patches/server/0616-Skip-distance-map-update-when-spawning-disabled.patch index 3ee6974d73..9474f2cf97 100644 --- a/patches/server/0616-Skip-distance-map-update-when-spawning-disabled.patch +++ b/patches/server/0616-Skip-distance-map-update-when-spawning-disabled.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Skip distance map update when spawning disabled. diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index f27160640c7c63075d41e52a74227c1168cce6b2..8a8df01ff3990e4bb17e048575617b9254677cdf 100644 +index 8c15f7821864032319665f9fc5183f302856637e..3613d09a88b283d693ca0e39117e8337d6e4b034 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -811,7 +811,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -810,7 +810,7 @@ public class ServerChunkCache extends ChunkSource { int l = this.distanceManager.getNaturalSpawnChunkCount(); // Paper start - per player mob spawning NaturalSpawner.SpawnState spawnercreature_d; // moved down diff --git a/patches/server/0617-Reset-shield-blocking-on-dimension-change.patch b/patches/server/0617-Reset-shield-blocking-on-dimension-change.patch index 868c6784bb..ed6f5e8137 100644 --- a/patches/server/0617-Reset-shield-blocking-on-dimension-change.patch +++ b/patches/server/0617-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 430ffb96e137cdfc02634ddf3050dd5a3012cc28..afbab46c35338470cd1e1b2ccf8bcf04d200c8a4 100644 +index 4f97ddea0317d51b09da1a6b7de899c749e35bd5..cfa63b5f90869dd3af88684a4dfc633cb0c5127d 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1146,6 +1146,11 @@ public class ServerPlayer extends Player { +@@ -1142,6 +1142,11 @@ public class ServerPlayer extends Player { this.level.getCraftServer().getPluginManager().callEvent(changeEvent); // CraftBukkit end } diff --git a/patches/server/0619-EntityMoveEvent.patch b/patches/server/0619-EntityMoveEvent.patch index 28df990f98..2fcb3a4771 100644 --- a/patches/server/0619-EntityMoveEvent.patch +++ b/patches/server/0619-EntityMoveEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] EntityMoveEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index bbc96d35ffb0d6cd0f8964ea25e1d6585fbee1d7..127691d19e02ef5e725ce338d732fcced428fa66 100644 +index e6da0975b46ef7dbce4dd4025d5f27f990a310bf..2309d2f307569070ebb4c9b388021c0130d4b168 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1524,6 +1524,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper @@ -17,7 +17,7 @@ index bbc96d35ffb0d6cd0f8964ea25e1d6585fbee1d7..127691d19e02ef5e725ce338d732fcce this.profiler.push(() -> { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 021efe5bae6a7e95e9080ab28ed69607d03f2af0..2f3dc805d3015ce083865050a4b99f2ba8d69bce 100644 +index 30d4188c3c7c0419ea3aaa4b0b1175940e5c089e..9098a6515c732197f843a4612add23fde3dd189c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -200,6 +200,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -29,10 +29,10 @@ index 021efe5bae6a7e95e9080ab28ed69607d03f2af0..2f3dc805d3015ce083865050a4b99f2b return new Throwable(entity + " Added to world at " + new java.util.Date()); } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 34304fd25a73b3b7e4f078e85b6bee94ab2cc8c8..89dc5a1a70ab31ea3a1a7924e0ecaadebcfb524d 100644 +index c0dbfa4a03c2c575b24fd960bea338532d64eac7..820ac7b271e2fc5d541e48d87e444ab9bf96134b 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3217,6 +3217,20 @@ public abstract class LivingEntity extends Entity { +@@ -3220,6 +3220,20 @@ public abstract class LivingEntity extends Entity { this.pushEntities(); this.level.getProfiler().pop(); diff --git a/patches/server/0627-misc-debugging-dumps.patch b/patches/server/0627-misc-debugging-dumps.patch index c481b00fbf..58192d9dbc 100644 --- a/patches/server/0627-misc-debugging-dumps.patch +++ b/patches/server/0627-misc-debugging-dumps.patch @@ -29,10 +29,10 @@ index 0000000000000000000000000000000000000000..2d5494d2813b773e60ddba6790b750a9 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 127691d19e02ef5e725ce338d732fcced428fa66..7c1ae542ea9da28ccc40b4608a970ef0617b03e8 100644 +index 2309d2f307569070ebb4c9b388021c0130d4b168..9feebee9c125642799cf8d3b22616db5ccd2a648 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -913,6 +913,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { +@@ -90,7 +90,18 @@ public class EntityStorage implements EntityPersistentStorage { } else { ListTag listTag = new ListTag(); diff --git a/patches/server/0653-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch b/patches/server/0653-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch index 2825a8de8a..7b09d2b80e 100644 --- a/patches/server/0653-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch +++ b/patches/server/0653-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow for Component suggestion tooltips in diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 6a40ce317bd0e5a0043cd156d4c32de95d5d2827..78ad9688a9acab75fb059f2a37528692faf71e86 100644 +index 5969d66ba88b4509b03f315721c8b2d8a1f07d43..6a0bda9711fedac3662ebe86d3b592935536694f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -758,12 +758,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -757,12 +757,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // Paper start - async tab completion com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event; @@ -24,7 +24,7 @@ index 6a40ce317bd0e5a0043cd156d4c32de95d5d2827..78ad9688a9acab75fb059f2a37528692 // If the event isn't handled, we can assume that we have no completions, and so we'll ask the server if (!event.isHandled()) { if (!event.isCancelled()) { -@@ -782,10 +781,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -781,10 +780,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser }); } } else if (!completions.isEmpty()) { diff --git a/patches/server/0655-Fix-PlayerItemConsumeEvent-cancelling-properly.patch b/patches/server/0655-Fix-PlayerItemConsumeEvent-cancelling-properly.patch index 6e7ae39e71..ee70e26b73 100644 --- a/patches/server/0655-Fix-PlayerItemConsumeEvent-cancelling-properly.patch +++ b/patches/server/0655-Fix-PlayerItemConsumeEvent-cancelling-properly.patch @@ -9,10 +9,10 @@ till their item is switched. This patch clears the active item when the event is cancelled diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 89dc5a1a70ab31ea3a1a7924e0ecaadebcfb524d..0f62182cc570b6a1e687744c01333253456081f4 100644 +index 820ac7b271e2fc5d541e48d87e444ab9bf96134b..ae0d3e15ef92e4a58e5c95c407681850d6ba419c 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3696,6 +3696,7 @@ public abstract class LivingEntity extends Entity { +@@ -3699,6 +3699,7 @@ public abstract class LivingEntity extends Entity { level.getCraftServer().getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/patches/server/0659-Fix-duplicating-give-items-on-item-drop-cancel.patch b/patches/server/0659-Fix-duplicating-give-items-on-item-drop-cancel.patch index 18a1af6096..97bc3c93bd 100644 --- a/patches/server/0659-Fix-duplicating-give-items-on-item-drop-cancel.patch +++ b/patches/server/0659-Fix-duplicating-give-items-on-item-drop-cancel.patch @@ -42,10 +42,10 @@ index 58941830a4bd024fcdb97df47783c82062e9167f..a0dc380e90415de9068ea408d62a1605 itemEntity2.makeFakeItem(); } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 1b47cf893174a64dcbf3771738b6c6d443c193af..183b621cbf6fbe7cec144af69fd74461b2471142 100644 +index d8f4dc4b6b923e70c70e9c607cda2c19c372fa75..48c7b81b320b5b4da07dbbefcc0d29f8b8a506d7 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -689,6 +689,13 @@ public abstract class Player extends LivingEntity { +@@ -685,6 +685,13 @@ public abstract class Player extends LivingEntity { @Nullable public ItemEntity drop(ItemStack stack, boolean throwRandomly, boolean retainOwnership) { @@ -59,7 +59,7 @@ index 1b47cf893174a64dcbf3771738b6c6d443c193af..183b621cbf6fbe7cec144af69fd74461 if (stack.isEmpty()) { return null; } else { -@@ -730,7 +737,7 @@ public abstract class Player extends LivingEntity { +@@ -726,7 +733,7 @@ public abstract class Player extends LivingEntity { PlayerDropItemEvent event = new PlayerDropItemEvent(player, drop); this.level.getCraftServer().getPluginManager().callEvent(event); diff --git a/patches/server/0664-fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/0664-fix-PlayerItemHeldEvent-firing-twice.patch index 17f015d33a..b25ed6e6ce 100644 --- a/patches/server/0664-fix-PlayerItemHeldEvent-firing-twice.patch +++ b/patches/server/0664-fix-PlayerItemHeldEvent-firing-twice.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix PlayerItemHeldEvent firing twice diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 78ad9688a9acab75fb059f2a37528692faf71e86..2958ff7f1ac66120fc9880d17ec4b46c72821aaa 100644 +index 9038d3c5683588fc6b2e1ef6dacc3e889eeb05f0..d11282c6c39a90dfb4c773aced4b4f0ada33c5fb 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1926,6 +1926,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1906,6 +1906,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (this.player.isImmobile()) return; // CraftBukkit if (packet.getSlot() >= 0 && packet.getSlot() < Inventory.getSelectionSize()) { diff --git a/patches/server/0668-Implement-methods-to-convert-between-Component-and-B.patch b/patches/server/0668-Implement-methods-to-convert-between-Component-and-B.patch index 118a2c4e3a..2db6bccc49 100644 --- a/patches/server/0668-Implement-methods-to-convert-between-Component-and-B.patch +++ b/patches/server/0668-Implement-methods-to-convert-between-Component-and-B.patch @@ -42,10 +42,10 @@ 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 eadacfa8449336c024f6154f46bb514d8e1230ec..f5cb59aa72dfd22ec143360a131818bef4f1b701 100644 +index 41d1816543d0b98bd6a3ff5600cdd26257c7497a..9b5430bae4a863004aaa0fc41e7b75a7d5797b92 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -219,6 +219,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -220,6 +220,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } com.destroystokyo.paper.PaperConfig.registerCommands(); com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now diff --git a/patches/server/0669-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch b/patches/server/0669-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch index 3cf84fb3a9..c780be74e2 100644 --- a/patches/server/0669-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch +++ b/patches/server/0669-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix anchor respawn acting as a bed respawn from the end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 0b5c58f36cea1950c63a35cc0ded8abe5569df2f..23dc5fcbfb64170a7b2d5ab42a1ffcc33092b516 100644 +index 27a99d225515ceeb3eff15efc609136cccd2fc30..84548f5786bf0d8715cd7f52e164e647605757ab 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -847,6 +847,7 @@ public abstract class PlayerList { +@@ -849,6 +849,7 @@ public abstract class PlayerList { // Paper start boolean isBedSpawn = false; @@ -17,7 +17,7 @@ index 0b5c58f36cea1950c63a35cc0ded8abe5569df2f..23dc5fcbfb64170a7b2d5ab42a1ffcc3 boolean isRespawn = false; boolean isLocAltered = false; // Paper - Fix SPIGOT-5989 // Paper end -@@ -867,6 +868,7 @@ public abstract class PlayerList { +@@ -869,6 +870,7 @@ public abstract class PlayerList { if (optional.isPresent()) { BlockState iblockdata = worldserver1.getBlockState(blockposition); boolean flag3 = iblockdata.is(Blocks.RESPAWN_ANCHOR); @@ -25,7 +25,7 @@ index 0b5c58f36cea1950c63a35cc0ded8abe5569df2f..23dc5fcbfb64170a7b2d5ab42a1ffcc3 Vec3 vec3d = (Vec3) optional.get(); float f1; -@@ -894,7 +896,7 @@ public abstract class PlayerList { +@@ -896,7 +898,7 @@ public abstract class PlayerList { } Player respawnPlayer = entityplayer1.getBukkitEntity(); diff --git a/patches/server/0671-add-RespawnFlags-to-PlayerRespawnEvent.patch b/patches/server/0671-add-RespawnFlags-to-PlayerRespawnEvent.patch index 0aec62c38c..e1ecb53a32 100644 --- a/patches/server/0671-add-RespawnFlags-to-PlayerRespawnEvent.patch +++ b/patches/server/0671-add-RespawnFlags-to-PlayerRespawnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] add RespawnFlags to PlayerRespawnEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 097eb55439cb3c8557fa4e1f8db227d526ffdd5a..65975bc2aa2a00a1b371f965361e7994b4ad5197 100644 +index d11282c6c39a90dfb4c773aced4b4f0ada33c5fb..351c293d794d77750740df2e64129786f47cd0fa 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2460,7 +2460,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2440,7 +2440,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser case PERFORM_RESPAWN: if (this.player.wonGame) { this.player.wonGame = false; @@ -18,10 +18,10 @@ index 097eb55439cb3c8557fa4e1f8db227d526ffdd5a..65975bc2aa2a00a1b371f965361e7994 } 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 23dc5fcbfb64170a7b2d5ab42a1ffcc33092b516..aa8e3c9b5884b9de1cf6805b3033ca1c8cdb9cc6 100644 +index 84548f5786bf0d8715cd7f52e164e647605757ab..fffb31c761625b803ac397799af890df84f26951 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -806,6 +806,12 @@ public abstract class PlayerList { +@@ -808,6 +808,12 @@ public abstract class PlayerList { } public ServerPlayer moveToWorld(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation) { @@ -34,7 +34,7 @@ index 23dc5fcbfb64170a7b2d5ab42a1ffcc33092b516..aa8e3c9b5884b9de1cf6805b3033ca1c entityplayer.stopRiding(); // CraftBukkit this.players.remove(entityplayer); this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot -@@ -896,7 +902,7 @@ public abstract class PlayerList { +@@ -898,7 +904,7 @@ public abstract class PlayerList { } Player respawnPlayer = entityplayer1.getBukkitEntity(); diff --git a/patches/server/0679-call-PortalCreateEvent-players-and-end-platform.patch b/patches/server/0679-call-PortalCreateEvent-players-and-end-platform.patch index 9e25520164..5ad81a97c1 100644 --- a/patches/server/0679-call-PortalCreateEvent-players-and-end-platform.patch +++ b/patches/server/0679-call-PortalCreateEvent-players-and-end-platform.patch @@ -5,10 +5,10 @@ Subject: [PATCH] call PortalCreateEvent players and end platform diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index afbab46c35338470cd1e1b2ccf8bcf04d200c8a4..d5949a9733da55dc547cff04f4937ed7d6188609 100644 +index cfa63b5f90869dd3af88684a4dfc633cb0c5127d..eef88ba763edfc6515c5e0f8c0b3e13145bea822 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1173,15 +1173,21 @@ public class ServerPlayer extends Player { +@@ -1169,15 +1169,21 @@ public class ServerPlayer extends Player { private void createEndPlatform(ServerLevel world, BlockPos centerPos) { BlockPos.MutableBlockPos blockposition_mutableblockposition = centerPos.mutable(); diff --git a/patches/server/0684-additions-to-PlayerGameModeChangeEvent.patch b/patches/server/0684-additions-to-PlayerGameModeChangeEvent.patch index 3f4ee04400..4a8352c4c2 100644 --- a/patches/server/0684-additions-to-PlayerGameModeChangeEvent.patch +++ b/patches/server/0684-additions-to-PlayerGameModeChangeEvent.patch @@ -45,10 +45,10 @@ index d75f78d2e3fb1376e8f6a8668c98a04a693c99e1..79f6089b934124c3309c6bee2e48b36b } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index d5949a9733da55dc547cff04f4937ed7d6188609..a0acaac510aa2206a5c58f2b7aafdbc2bdf7a3dd 100644 +index eef88ba763edfc6515c5e0f8c0b3e13145bea822..aa366b5facbcb3575aa63da444561700eeb39051 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1790,8 +1790,15 @@ public class ServerPlayer extends Player { +@@ -1786,8 +1786,15 @@ public class ServerPlayer extends Player { } public boolean setGameMode(GameType gameMode) { @@ -66,7 +66,7 @@ index d5949a9733da55dc547cff04f4937ed7d6188609..a0acaac510aa2206a5c58f2b7aafdbc2 } else { this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.CHANGE_GAME_MODE, (float) gameMode.getId())); if (gameMode == GameType.SPECTATOR) { -@@ -1803,7 +1810,7 @@ public class ServerPlayer extends Player { +@@ -1799,7 +1806,7 @@ public class ServerPlayer extends Player { this.onUpdateAbilities(); this.updateEffectVisibility(); @@ -75,7 +75,7 @@ index d5949a9733da55dc547cff04f4937ed7d6188609..a0acaac510aa2206a5c58f2b7aafdbc2 } } -@@ -2185,6 +2192,14 @@ public class ServerPlayer extends Player { +@@ -2181,6 +2188,14 @@ public class ServerPlayer extends Player { } public void loadGameTypes(@Nullable CompoundTag nbt) { @@ -123,10 +123,10 @@ index ddacf7ca035d4d0802572ce806e21b484c366550..e572088cad8b9e09b1d64f7971bacac2 } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 8440aadf080a9a9669f62d1c01923389e17ceb5f..da99d8c01db614941239a695cc0c22add9b0d938 100644 +index 351c293d794d77750740df2e64129786f47cd0fa..32538258b8af2a239f9ab6d6ab4eac7a1f517653 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2469,7 +2469,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2449,7 +2449,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.player = this.server.getPlayerList().respawn(this.player, false); if (this.server.isHardcore()) { diff --git a/patches/server/0689-Fix-and-optimise-world-force-upgrading.patch b/patches/server/0689-Fix-and-optimise-world-force-upgrading.patch index 300b7a4f87..53374dd277 100644 --- a/patches/server/0689-Fix-and-optimise-world-force-upgrading.patch +++ b/patches/server/0689-Fix-and-optimise-world-force-upgrading.patch @@ -265,10 +265,10 @@ index cf0a74b8a1c31d4bc493eb09a69ee2bd94cb6485..cfd43069ee2b6f79afb12e10d223f6bf Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, worlds, eraseCache); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a741d644be29b4ec4b5afa0625c6a784ae0cdbbc..d8c2263a7fa89719dc653ba12635488fc36420a7 100644 +index 2399625457421a1c16d0f22a82cabe6e80ef9b43..f5f1b1741b08344a4247d096d60865cc267bd50f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -563,13 +563,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here @@ -352,7 +352,7 @@ index 43510774d489bfdd30f10d521e424fa1363b8919..6496108953effae82391b5c1ea6fdec8 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 79e0b079c61860e348d476c1689bf0397e9f8c64..b020d44f95ab8aafb270ca6e36abe86d6589fc9b 100644 +index 85f2feec921184d2c20aac740d3d4328a730ae8a..9f2cc053cc0262405dc377716688e0c97f63b30f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1138,14 +1138,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0691-Add-Unix-domain-socket-support.patch b/patches/server/0691-Add-Unix-domain-socket-support.patch index 290442e6ba..33845a8fe1 100644 --- a/patches/server/0691-Add-Unix-domain-socket-support.patch +++ b/patches/server/0691-Add-Unix-domain-socket-support.patch @@ -11,7 +11,7 @@ Tested-by: Mariell Hoversholm Reviewed-by: Mariell Hoversholm diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 35a03d15f87be8eb86d65e1863a3e0cb2dd201ee..c203a78a28e6457bd25b34b5c5ecaa35e3f9211e 100644 +index bdd4f4db9849d9107b5c62d5e83b1277621f49f1..9d09ec3b127e3440bef6b248578dec109407f9ff 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -614,6 +614,11 @@ public class Connection extends SimpleChannelInboundHandler> { @@ -27,10 +27,10 @@ index 35a03d15f87be8eb86d65e1863a3e0cb2dd201ee..c203a78a28e6457bd25b34b5c5ecaa35 } // Spigot End diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index f5cb59aa72dfd22ec143360a131818bef4f1b701..eeefbb86cb88bd1b132bb6e22b4a4572cfb5e22c 100644 +index 9b5430bae4a863004aaa0fc41e7b75a7d5797b92..db0110120f88bc06954fa8c44b2a45f0c8229574 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -230,6 +230,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -231,6 +231,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface this.setEnforceWhitelist(dedicatedserverproperties.enforceWhitelist); // this.worldData.setGameType(dedicatedserverproperties.gamemode); // CraftBukkit - moved to world loading DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode); @@ -51,7 +51,7 @@ index f5cb59aa72dfd22ec143360a131818bef4f1b701..eeefbb86cb88bd1b132bb6e22b4a4572 InetAddress inetaddress = null; if (!this.getLocalIp().isEmpty()) { -@@ -239,12 +253,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -240,12 +254,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface if (this.getPort() < 0) { this.setPort(dedicatedserverproperties.serverPort); } diff --git a/patches/server/0699-Add-PlayerKickEvent-causes.patch b/patches/server/0699-Add-PlayerKickEvent-causes.patch index e486e7ab39..a7ba39392b 100644 --- a/patches/server/0699-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0699-Add-PlayerKickEvent-causes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerKickEvent causes diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2b7b63ea08c8e4f43c9678671fb8d08628b48b36..3bf39c2d2aa3fc4fd0815dacea57e4899ec0da0e 100644 +index f5f1b1741b08344a4247d096d60865cc267bd50f..3dded5c491ace6b073a7bc3178976bd70f0b9393 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2124,7 +2124,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 80) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString()); @@ -69,7 +69,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa return; } } else { -@@ -340,7 +340,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -339,7 +339,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) { if (++this.aboveGroundVehicleTickCount > 80) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString()); @@ -78,7 +78,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa return; } } else { -@@ -362,7 +362,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -361,7 +361,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser if (this.keepAlivePending) { if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info @@ -87,7 +87,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa } } else { if (elapsedTime >= 15000L) { // 15 seconds -@@ -392,7 +392,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -391,7 +391,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) (this.server.getPlayerIdleTimeout() * 1000 * 60)) { this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 @@ -96,7 +96,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa } } -@@ -417,14 +417,22 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -416,14 +416,22 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser public void disconnect(String s) { // Paper start @@ -122,7 +122,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa // Paper end // CraftBukkit start - fire PlayerKickEvent if (this.processedDisconnect) { -@@ -432,7 +440,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -431,7 +439,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, this.player.getBukkitEntity().displayName()); // Paper - Adventure @@ -131,7 +131,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa if (this.cserver.getServer().isRunning()) { this.cserver.getPluginManager().callEvent(event); -@@ -504,7 +512,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -503,7 +511,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser public void handleMoveVehicle(ServerboundMoveVehiclePacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(), packet.getY(), packet.getZ(), packet.getYRot(), packet.getXRot())) { @@ -140,7 +140,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa } else { Entity entity = this.player.getRootVehicle(); -@@ -739,13 +747,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -738,13 +746,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); // Paper - run this async // CraftBukkit start if (this.chatSpamTickCount.addAndGet(com.destroystokyo.paper.PaperConfig.tabSpamIncrement) > com.destroystokyo.paper.PaperConfig.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable @@ -156,7 +156,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa return; } // Paper end -@@ -897,7 +905,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -896,7 +904,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // 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()); @@ -165,16 +165,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa return; } this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed -@@ -1051,7 +1059,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser - ListTag pageList = testStack.getTag().getList("pages", 8); - if (pageList.size() > 100) { - ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with too many pages"); -- server.scheduleOnMain(() -> this.disconnect("Book too large!")); -+ server.scheduleOnMain(() -> this.disconnect("Book too large!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause - return; - } - long byteTotal = 0; -@@ -1063,7 +1071,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1055,7 +1063,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser 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!"); @@ -183,7 +174,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa return; } byteTotal += byteLength; -@@ -1086,14 +1094,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1078,14 +1086,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser 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()); @@ -200,7 +191,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa return; } this.lastBookTick = MinecraftServer.currentTick; -@@ -1229,7 +1237,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1209,7 +1217,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser public void handleMovePlayer(ServerboundMovePlayerPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) { @@ -209,7 +200,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa } else { ServerLevel worldserver = this.player.getLevel(); -@@ -1640,7 +1648,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1620,7 +1628,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.dropCount++; if (this.dropCount >= 20) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!"); @@ -218,7 +209,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa return; } } -@@ -1838,7 +1846,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1818,7 +1826,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) { ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName()); @@ -227,7 +218,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa } // Paper start PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()]; -@@ -1943,7 +1951,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1923,7 +1931,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.player.resetLastActionTime(); } else { ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString()); @@ -236,7 +227,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa } } -@@ -1959,7 +1967,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1939,7 +1947,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser for (int i = 0; i < s.length(); ++i) { if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) { @@ -245,7 +236,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa return; } } -@@ -2032,7 +2040,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2012,7 +2020,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser Waitable waitable = new Waitable() { @Override protected Object evaluate() { @@ -254,7 +245,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa return null; } }; -@@ -2047,7 +2055,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2027,7 +2035,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser throw new RuntimeException(e); } } else { @@ -263,7 +254,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa } // CraftBukkit end } -@@ -2320,7 +2328,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2300,7 +2308,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // Spigot Start if ( entity == this.player && !this.player.isSpectator() ) { @@ -272,7 +263,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa return; } // Spigot End -@@ -2411,7 +2419,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2391,7 +2399,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } // CraftBukkit end } else { @@ -281,7 +272,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString()); } } -@@ -2805,7 +2813,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2791,7 +2799,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // Paper start if (!org.bukkit.Bukkit.isPrimaryThread()) { if (recipeSpamPackets.addAndGet(com.destroystokyo.paper.PaperConfig.autoRecipeIncrement) > com.destroystokyo.paper.PaperConfig.autoRecipeLimit) { @@ -290,7 +281,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa return; } } -@@ -2998,7 +3006,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2979,7 +2987,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } else if (!this.isSingleplayerOwner()) { // Paper start - This needs to be handled on the main thread for plugins server.submit(() -> { @@ -299,7 +290,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa }); // Paper end } -@@ -3044,7 +3052,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3025,7 +3033,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex); @@ -308,7 +299,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa } } else if (packet.identifier.equals(CUSTOM_UNREGISTER)) { try { -@@ -3054,7 +3062,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3035,7 +3043,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex); @@ -317,7 +308,7 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa } } else { try { -@@ -3072,7 +3080,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3053,7 +3061,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data); } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); @@ -327,10 +318,10 @@ index a6ea73a95963d1bb51e83c127acca8e1be326ab0..44a9021d6a1e7a9d4ed368aebaf917fa } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index aa8e3c9b5884b9de1cf6805b3033ca1c8cdb9cc6..a6ecbb7eb1df7923d58366327e0f00512a3a1677 100644 +index fffb31c761625b803ac397799af890df84f26951..65657c009f6d5a5d5740e80f912a5893333c7085 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -714,7 +714,7 @@ public abstract class PlayerList { +@@ -716,7 +716,7 @@ public abstract class PlayerList { while (iterator.hasNext()) { entityplayer = (ServerPlayer) iterator.next(); this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved @@ -339,7 +330,7 @@ index aa8e3c9b5884b9de1cf6805b3033ca1c8cdb9cc6..a6ecbb7eb1df7923d58366327e0f0051 } // Instead of kicking then returning, we need to store the kick reason -@@ -1366,8 +1366,8 @@ public abstract class PlayerList { +@@ -1368,8 +1368,8 @@ public abstract class PlayerList { // Paper end // CraftBukkit start - disconnect safely for (ServerPlayer player : this.players) { @@ -351,7 +342,7 @@ index aa8e3c9b5884b9de1cf6805b3033ca1c8cdb9cc6..a6ecbb7eb1df7923d58366327e0f0051 // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f50772b5c07d5aa7dcd0ed015507c3f6440328c8..76e2ae09855e0efaaa0856d2f49e4968adbccbdc 100644 +index 3e52ce2bc3a4b1327ab0e01b78966558d77cec9a..4e95bf2eb6434d8ca44d478262329c56b0b0a079 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -498,16 +498,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0709-Make-item-validations-configurable.patch b/patches/server/0709-Make-item-validations-configurable.patch index 078f6bb115..07b6cf2a20 100644 --- a/patches/server/0709-Make-item-validations-configurable.patch +++ b/patches/server/0709-Make-item-validations-configurable.patch @@ -56,10 +56,10 @@ index a33dd184ea51df7e59ed08e5e2b0ea4ed9dadff5..a13e75797d612d79aa26c4891f66ecf0 } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index f9f1c5665adb703042ac7fca76ce2e9f8ebde9d3..9b61187cde84fd1a64c3aaf09b72ad327000c291 100644 +index 808eb6b9ec535b1179a1d7b88877c9ce1755c45b..c88ab49f60857d5687facc8523f9edc4d652c81b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -356,18 +356,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -357,18 +357,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { CompoundTag display = tag.getCompound(DISPLAY.NBT); if (display.contains(NAME.NBT)) { diff --git a/patches/server/0710-Add-more-line-of-sight-methods.patch b/patches/server/0710-Add-more-line-of-sight-methods.patch index d248fdd76d..a7af81bfb0 100644 --- a/patches/server/0710-Add-more-line-of-sight-methods.patch +++ b/patches/server/0710-Add-more-line-of-sight-methods.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add more line of sight methods diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 0f62182cc570b6a1e687744c01333253456081f4..57c448ee93df76fc2a17c75fafc78408d720ced3 100644 +index ae0d3e15ef92e4a58e5c95c407681850d6ba419c..ed745776316c5346ee1b44c8f022c40359b7e642 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3424,6 +3424,7 @@ public abstract class LivingEntity extends Entity { +@@ -3427,6 +3427,7 @@ public abstract class LivingEntity extends Entity { Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ()); Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ()); diff --git a/patches/server/0715-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0715-Fix-PlayerDropItemEvent-using-wrong-item.patch index af70eddb7c..4802171670 100644 --- a/patches/server/0715-Fix-PlayerDropItemEvent-using-wrong-item.patch +++ b/patches/server/0715-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/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index d286d88a3c3f93dbfa92de9421e320c92cd96350..1bccd932851045c374e3092d33dc77fab680d0db 100644 +index d197a63bac1238020cd6cacf209bc7c1b463040d..19980b2d627eb3cacf8d0c3e6785ad2206910fbc 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -709,6 +709,11 @@ public abstract class Player extends LivingEntity { +@@ -705,6 +705,11 @@ public abstract class Player extends LivingEntity { } double d0 = this.getEyeY() - 0.30000001192092896D; diff --git a/patches/server/0717-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0717-Deobfuscate-stacktraces-in-log-messages-crash-report.patch index 96d5c032d8..4297ae4e59 100644 --- a/patches/server/0717-Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/0717-Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -396,10 +396,10 @@ index 2d5494d2813b773e60ddba6790b750a9a08f21f8..7695bf44503f161523ea612ef8a884ae } } diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java -index 09f56e49383d3f5413ad4c28f3a7664e4d9570bd..afb4fd59bfc8cf71d3a7fdc1cdf1b4c565146952 100644 +index 62c3c597732e6fb30ed5367d902ea8763507a6b8..b9a618eba86656289e20d051c3f0023ec93bb733 100644 --- a/src/main/java/net/minecraft/CrashReport.java +++ b/src/main/java/net/minecraft/CrashReport.java -@@ -29,6 +29,7 @@ public class CrashReport { +@@ -30,6 +30,7 @@ public class CrashReport { private final SystemReport systemReport = new SystemReport(); public CrashReport(String message, Throwable cause) { @@ -420,10 +420,10 @@ index 3941e14d1c3e6e688e28904948039c8b2200de5f..a4fda4a3bae9ce600e778b44cd3ef432 } } diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index eeefbb86cb88bd1b132bb6e22b4a4572cfb5e22c..6a1fd7a983724d9e16e8aef06052108ba7ed46f1 100644 +index db0110120f88bc06954fa8c44b2a45f0c8229574..6d7eef79de7a899ccdbc3194d925bb4caa0a4b03 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -220,6 +220,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -221,6 +221,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface com.destroystokyo.paper.PaperConfig.registerCommands(); com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider diff --git a/patches/server/0719-Ensure-disconnect-for-book-edit-is-called-on-main.patch b/patches/server/0719-Ensure-disconnect-for-book-edit-is-called-on-main.patch index 9a84f362c1..078feace52 100644 --- a/patches/server/0719-Ensure-disconnect-for-book-edit-is-called-on-main.patch +++ b/patches/server/0719-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 0c295854f31422cf3ad699d229805c5881a65eed..8708eb173fbb17cf84a0c6d9a42623750472f650 100644 +index 784fc77a5b98f1e085edc4aea3c6bed524b1fb0e..6c6e5b7562d9051709f76bf968060de7212dc182 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1101,7 +1101,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1093,7 +1093,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // Paper end // CraftBukkit start if (this.lastBookTick + 20 > MinecraftServer.currentTick) { diff --git a/patches/server/0724-Don-t-complete-skull-lookups-on-main-thread-MC-22743.patch b/patches/server/0724-Don-t-complete-skull-lookups-on-main-thread-MC-22743.patch deleted file mode 100644 index 2ad42afa60..0000000000 --- a/patches/server/0724-Don-t-complete-skull-lookups-on-main-thread-MC-22743.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Tue, 29 Jun 2021 17:17:34 +0100 -Subject: [PATCH] Don't complete skull lookups on main thread (MC-227435) - - -diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java -index 172413fc0f303d5e15bc2bc55c09ce4faf5298a0..96863338e1642105f71e681ec2b32c882b3ea342 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java -@@ -145,15 +145,28 @@ public class SkullBlockEntity extends BlockEntity { - - public static void updateGameprofile(@Nullable GameProfile owner, Consumer callback) { - if (owner != null && !StringUtil.isNullOrEmpty(owner.getName()) && (!owner.isComplete() || !owner.getProperties().containsKey("textures")) && SkullBlockEntity.profileCache != null && SkullBlockEntity.sessionService != null) { -- SkullBlockEntity.profileCache.getAsync(owner.getName(), (gameprofile1) -> { -+ // Paper start -+ SkullBlockEntity.profileCache.getAsync(owner.getName(), (gameprofile) -> { -+ if (gameprofile == null) { -+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> callback.accept(owner)); -+ return; -+ } -+ Runnable runnable = () -> { -+ GameProfile gameprofile1 = gameprofile; - Property property = (Property) Iterables.getFirst(gameprofile1.getProperties().get("textures"), (Object) null); - - if (property == null) { - gameprofile1 = SkullBlockEntity.sessionService.fillProfileProperties(gameprofile1, true); - } - -- SkullBlockEntity.profileCache.add(gameprofile1); -- callback.accept(gameprofile1); -+ GameProfile finalGameprofile = gameprofile1; -+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> { -+ SkullBlockEntity.profileCache.add(finalGameprofile); -+ callback.accept(finalGameprofile); -+ }); -+ }; -+ net.minecraft.Util.backgroundExecutor().execute(runnable); -+ // Paper end - }); - } else { - callback.accept(owner); diff --git a/patches/server/0726-Use-getChunkIfLoadedImmediately-in-places.patch b/patches/server/0724-Use-getChunkIfLoadedImmediately-in-places.patch similarity index 87% rename from patches/server/0726-Use-getChunkIfLoadedImmediately-in-places.patch rename to patches/server/0724-Use-getChunkIfLoadedImmediately-in-places.patch index 2434d97ffe..b87d8076c4 100644 --- a/patches/server/0726-Use-getChunkIfLoadedImmediately-in-places.patch +++ b/patches/server/0724-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 87b3eee23441717660aa6bb81248986cb7ef2fb4..8154ca39ec7e2e8559cd125d73a59b8d2b00714c 100644 +index db1884bde77bb46ccd65ced67928928b1e569b84..6ecf60c69a27f8db1c245db15449bba581c3dbf5 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -206,7 +206,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -21,10 +21,10 @@ index 87b3eee23441717660aa6bb81248986cb7ef2fb4..8154ca39ec7e2e8559cd125d73a59b8d // Paper start - Asynchronous IO diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 8708eb173fbb17cf84a0c6d9a42623750472f650..35fa416a8ce332e823ed5077a8fd3492683d7ad0 100644 +index 6c6e5b7562d9051709f76bf968060de7212dc182..6ff04fc7202a7eb1f2b5978a2e2a573945d9dde1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1318,7 +1318,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1298,7 +1298,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser speed = this.player.getAbilities().walkingSpeed * 10f; } // Paper start - Prevent moving into unloaded chunks @@ -34,10 +34,10 @@ index 8708eb173fbb17cf84a0c6d9a42623750472f650..35fa416a8ce332e823ed5077a8fd3492 return; } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 1c171599dbde44389013dc08ca8263742d58d721..17281575ff83bbf1e720335619a78a6d0a0e5077 100644 +index b85d0222bb151ff3c7377e444a431212e262c95f..474078b68f1bf22037495f42bae59b790fd8cb46 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -191,6 +191,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -192,6 +192,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return (CraftServer) Bukkit.getServer(); } @@ -51,7 +51,7 @@ index 1c171599dbde44389013dc08ca8263742d58d721..17281575ff83bbf1e720335619a78a6d public ResourceKey getTypeKey() { return this.typeKey; } -@@ -1366,7 +1373,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1371,7 +1378,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { for (int l1 = j; l1 <= l; ++l1) { for (int i2 = k; i2 <= i1; ++i2) { diff --git a/patches/server/0725-Backport-MC-229191-ore-distribution-changes.patch b/patches/server/0725-Backport-MC-229191-ore-distribution-changes.patch deleted file mode 100644 index bd24cc6fc9..0000000000 --- a/patches/server/0725-Backport-MC-229191-ore-distribution-changes.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Wed, 30 Jun 2021 22:11:11 +0100 -Subject: [PATCH] Backport MC-229191 ore distribution changes - - -diff --git a/src/main/java/net/minecraft/data/worldgen/Features.java b/src/main/java/net/minecraft/data/worldgen/Features.java -index 5b82e84a31d744e1c452c22f44c1316e94e0b90f..96ebb347898ad9758e34a767b921ce67fc30893f 100644 ---- a/src/main/java/net/minecraft/data/worldgen/Features.java -+++ b/src/main/java/net/minecraft/data/worldgen/Features.java -@@ -280,7 +280,7 @@ public class Features { - public static final ConfiguredFeature ORE_REDSTONE = register("ore_redstone", Feature.ORE.configured(ORE_REDSTONE_CONFIG).rangeUniform(VerticalAnchor.bottom(), VerticalAnchor.absolute(15)).squared().count(8)); - public static final ConfiguredFeature PROTOTYPE_ORE_REDSTONE = register("prototype_ore_redstone", Feature.ORE.configured(ORE_REDSTONE_CONFIG).rangeUniform(VerticalAnchor.bottom(), VerticalAnchor.absolute(15)).squared().count(4)); - public static final ConfiguredFeature PROTOTYPE_ORE_REDSTONE_LOWER = register("prototype_ore_redstone_lower", Feature.ORE.configured(ORE_REDSTONE_CONFIG).rangeTriangle(VerticalAnchor.aboveBottom(-32), VerticalAnchor.aboveBottom(32)).squared().count(8)); -- public static final ConfiguredFeature ORE_DIAMOND = register("ore_diamond", Feature.ORE.configured(new OreConfiguration(ORE_DIAMOND_TARGET_LIST, 8)).rangeUniform(VerticalAnchor.bottom(), VerticalAnchor.absolute(16)).squared()); -+ public static final ConfiguredFeature ORE_DIAMOND = register("ore_diamond", Feature.ORE.configured(new OreConfiguration(ORE_DIAMOND_TARGET_LIST, 8)).rangeUniform(VerticalAnchor.bottom(), VerticalAnchor.absolute(15)).squared()); // Paper - public static final ConfiguredFeature PROTOTYPE_ORE_DIAMOND = register("prototype_ore_diamond", Feature.ORE.configured(new OreConfiguration(ORE_DIAMOND_TARGET_LIST, 4, 0.5F)).rangeTriangle(VerticalAnchor.aboveBottom(-80), VerticalAnchor.aboveBottom(80)).squared().count(6)); - public static final ConfiguredFeature PROTOTYPE_ORE_DIAMOND_LARGE = register("prototype_ore_diamond_large", Feature.ORE.configured(new OreConfiguration(ORE_DIAMOND_TARGET_LIST, 12, 0.7F)).rangeTriangle(VerticalAnchor.aboveBottom(-80), VerticalAnchor.aboveBottom(80)).squared().rarity(9)); - public static final ConfiguredFeature ORE_LAPIS = register("ore_lapis", Feature.ORE.configured(new OreConfiguration(ORE_LAPIS_TARGET_LIST, 7)).rangeTriangle(VerticalAnchor.absolute(0), VerticalAnchor.absolute(30)).squared()); -@@ -288,7 +288,7 @@ public class Features { - public static final ConfiguredFeature PROTOTYPE_ORE_LAPIS_BURIED = register("prototype_ore_lapis_buried", Feature.SCATTERED_ORE.configured(new OreConfiguration(ORE_LAPIS_TARGET_LIST, 7, 1.0F)).rangeUniform(VerticalAnchor.bottom(), VerticalAnchor.absolute(64)).squared().count(4)); - public static final ConfiguredFeature ORE_INFESTED = register("ore_infested", Feature.ORE.configured(new OreConfiguration(ORE_INFESTED_TARGET_LIST, 9)).rangeUniform(VerticalAnchor.bottom(), VerticalAnchor.absolute(63)).squared().count(7)); - public static final ConfiguredFeature PROTOTYPE_ORE_INFESTED = register("prototype_ore_infested", Feature.ORE.configured(new OreConfiguration(ORE_INFESTED_TARGET_LIST, 9)).rangeUniform(VerticalAnchor.bottom(), VerticalAnchor.absolute(63)).squared().count(14)); -- public static final ConfiguredFeature ORE_EMERALD = register("ore_emerald", Feature.REPLACE_SINGLE_BLOCK.configured(new ReplaceBlockConfiguration(ORE_EMERALD_TARGET_LIST)).rangeUniform(VerticalAnchor.absolute(4), VerticalAnchor.absolute(31)).squared().count(UniformInt.of(6, 24))); -+ public static final ConfiguredFeature ORE_EMERALD = register("ore_emerald", Feature.REPLACE_SINGLE_BLOCK.configured(new ReplaceBlockConfiguration(ORE_EMERALD_TARGET_LIST)).rangeUniform(VerticalAnchor.absolute(4), VerticalAnchor.absolute(31)).squared().count(UniformInt.of(3, 8))); // Paper - public static final ConfiguredFeature PROTOTYPE_ORE_EMERALD = register("prototype_ore_emerald", Feature.ORE.configured(new OreConfiguration(ORE_EMERALD_TARGET_LIST, 3)).rangeTriangle(VerticalAnchor.absolute(32), VerticalAnchor.absolute(480)).squared().count(50)); - public static final ConfiguredFeature ORE_DEBRIS_LARGE = register("ore_debris_large", Feature.SCATTERED_ORE.configured(new OreConfiguration(OreConfiguration.Predicates.NETHER_ORE_REPLACEABLES, Features.States.ANCIENT_DEBRIS, 3, 1.0F)).rangeTriangle(VerticalAnchor.absolute(8), VerticalAnchor.absolute(24)).squared()); - public static final ConfiguredFeature ORE_DEBRIS_SMALL = register("ore_debris_small", Feature.SCATTERED_ORE.configured(new OreConfiguration(OreConfiguration.Predicates.NETHER_ORE_REPLACEABLES, Features.States.ANCIENT_DEBRIS, 2, 1.0F)).range(Features.Decorators.RANGE_8_8).squared()); diff --git a/work/BuildData b/work/BuildData index 3cec511b16..a478570497 160000 --- a/work/BuildData +++ b/work/BuildData @@ -1 +1 @@ -Subproject commit 3cec511b16ffa31cb414997a14be313716882e12 +Subproject commit a4785704979a469daa2b7f6826c84e7fe886bb03 diff --git a/work/Bukkit b/work/Bukkit index 214b9f14e8..d8198b3ec5 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 214b9f14e8f28d3dfb1b9344d649063eba38c166 +Subproject commit d8198b3ec5d3a9d15cfb0dde7307c3b549574c55 diff --git a/work/CraftBukkit b/work/CraftBukkit index b121d3b953..fb556bfa14 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit b121d3b9534b9eeceb3a3592860e9cc2c8519ddf +Subproject commit fb556bfa1404661b38cc3abd1f0a7d02764f8f5b diff --git a/work/Spigot b/work/Spigot index f773da845c..610a8c06f4 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit f773da845ca2da21064a4025b6ad12178da0ed7c +Subproject commit 610a8c06f422aecbe72d4fa38fae6f634b8d1ceb