From 834a4c4a8d5f41c2915a09215d42d40fbb4a6137 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 3 Dec 2024 21:24:17 +0100 Subject: [PATCH] Apply remaining patches, fix API --- ...ecate-for-removal-all-OldEnum-related-methods.patch | 4 ++-- patches/api/Improve-entity-effect-API.patch | 4 +--- .../server/API-for-checking-sent-chunks.patch | 0 .../server/API-to-allow-disallow-tick-sleeping.patch | 0 .../API-to-check-if-the-server-is-sleeping.patch | 0 ...Add-Alternate-Current-redstone-implementation.patch | 0 .../Add-startup-flag-to-disable-gamerule-limits.patch | 0 .../server/Allow-using-old-ender-pearl-behavior.patch | 0 ...-to-recalculate-regionfile-header-if-it-is-co.patch | 0 ...ssues-with-certain-tasks-not-processing-durin.patch | 0 .../server/Block-Enderpearl-Travel-Exploit.patch | 0 patches/{unapplied => }/server/Bundle-spark.patch | 0 ...aftPlayer-onEntityRemove-for-all-online-playe.patch | 0 .../server/Configurable-Entity-Despawn-Time.patch | 0 .../{unapplied => }/server/Correct-update-cursor.patch | 0 .../Detail-more-information-in-watchdog-dumps.patch | 0 .../server/Eigencraft-redstone-implementation.patch | 0 .../server/Entity-load-save-limit-per-chunk.patch | 0 patches/{unapplied => }/server/Expanded-Art-API.patch | 0 .../server/Fix-CraftWorld-isChunkGenerated.patch | 0 ...-NPE-when-EntityResurrectEvent-is-uncancelled.patch | 0 ...ity-tracker-desync-when-new-players-are-added.patch | 0 ...onsistencies-in-dispense-events-regarding-sta.patch | 0 ...ix-incorrect-invulnerability-damage-reduction.patch | 0 ...-cancelling-PreCreatureSpawnEvent-with-per-pl.patch | 0 ...Improve-performance-of-RecipeMap-removeRecipe.patch | 0 .../server/Improve-performance-of-mass-crafts.patch | 0 .../server/Improved-Watchdog-Support.patch | 2 +- .../server/Incremental-chunk-and-player-saving.patch | 0 .../server/Lag-compensation-ticks.patch | 0 ...tempt-to-find-spawn-position-if-there-isn-t-a.patch | 0 ...ite-chunk-data-to-disk-if-it-serializes-witho.patch | 0 ...e-collision-checking-in-player-move-packet-ha.patch | 4 ++-- .../server/Optimise-general-POI-access.patch | 10 ++++++++-- .../server/Optional-per-player-mob-spawns.patch | 0 ...work-done-in-CraftMapCanvas.drawImage-by-limi.patch | 0 36 files changed, 14 insertions(+), 10 deletions(-) rename patches/{unapplied => }/server/API-for-checking-sent-chunks.patch (100%) rename patches/{unapplied => }/server/API-to-allow-disallow-tick-sleeping.patch (100%) rename patches/{unapplied => }/server/API-to-check-if-the-server-is-sleeping.patch (100%) rename patches/{unapplied => }/server/Add-Alternate-Current-redstone-implementation.patch (100%) rename patches/{unapplied => }/server/Add-startup-flag-to-disable-gamerule-limits.patch (100%) rename patches/{unapplied => }/server/Allow-using-old-ender-pearl-behavior.patch (100%) rename patches/{unapplied => }/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch (100%) rename patches/{unapplied => }/server/Avoid-issues-with-certain-tasks-not-processing-durin.patch (100%) rename patches/{unapplied => }/server/Block-Enderpearl-Travel-Exploit.patch (100%) rename patches/{unapplied => }/server/Bundle-spark.patch (100%) rename patches/{unapplied => }/server/Call-CraftPlayer-onEntityRemove-for-all-online-playe.patch (100%) rename patches/{unapplied => }/server/Configurable-Entity-Despawn-Time.patch (100%) rename patches/{unapplied => }/server/Correct-update-cursor.patch (100%) rename patches/{unapplied => }/server/Detail-more-information-in-watchdog-dumps.patch (100%) rename patches/{unapplied => }/server/Eigencraft-redstone-implementation.patch (100%) rename patches/{unapplied => }/server/Entity-load-save-limit-per-chunk.patch (100%) rename patches/{unapplied => }/server/Expanded-Art-API.patch (100%) rename patches/{unapplied => }/server/Fix-CraftWorld-isChunkGenerated.patch (100%) rename patches/{unapplied => }/server/Fix-NPE-when-EntityResurrectEvent-is-uncancelled.patch (100%) rename patches/{unapplied => }/server/Fix-entity-tracker-desync-when-new-players-are-added.patch (100%) rename patches/{unapplied => }/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch (100%) rename patches/{unapplied => }/server/Fix-incorrect-invulnerability-damage-reduction.patch (100%) rename patches/{unapplied => }/server/Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch (100%) rename patches/{unapplied => }/server/Improve-performance-of-RecipeMap-removeRecipe.patch (100%) rename patches/{unapplied => }/server/Improve-performance-of-mass-crafts.patch (100%) rename patches/{unapplied => }/server/Improved-Watchdog-Support.patch (99%) rename patches/{unapplied => }/server/Incremental-chunk-and-player-saving.patch (100%) rename patches/{unapplied => }/server/Lag-compensation-ticks.patch (100%) rename patches/{unapplied => }/server/Only-attempt-to-find-spawn-position-if-there-isn-t-a.patch (100%) rename patches/{unapplied => }/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch (100%) rename patches/{unapplied => }/server/Optimise-collision-checking-in-player-move-packet-ha.patch (98%) rename patches/{unapplied => }/server/Optimise-general-POI-access.patch (98%) rename patches/{unapplied => }/server/Optional-per-player-mob-spawns.patch (100%) rename patches/{unapplied => }/server/Reduce-work-done-in-CraftMapCanvas.drawImage-by-limi.patch (100%) diff --git a/patches/api/Deprecate-for-removal-all-OldEnum-related-methods.patch b/patches/api/Deprecate-for-removal-all-OldEnum-related-methods.patch index d5dfe921be..055e3bd689 100644 --- a/patches/api/Deprecate-for-removal-all-OldEnum-related-methods.patch +++ b/patches/api/Deprecate-for-removal-all-OldEnum-related-methods.patch @@ -79,7 +79,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 * @deprecated Biome is no longer an enum, custom biomes will have their own biome instance. */ - @Deprecated(since = "1.21.3") -+ @Deprecated(since = "1.21.3", forRemoval = true) @ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils ++ @Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils Biome CUSTOM = Bukkit.getUnsafe().getCustomBiome(); @NotNull @@ -88,7 +88,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 */ @NotNull - @Deprecated(since = "1.21.3") -+ @Deprecated(since = "1.21.3", forRemoval = true) @ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils ++ @Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils static Biome valueOf(@NotNull String name) { if ("CUSTOM".equals(name)) { return Biome.CUSTOM; diff --git a/patches/api/Improve-entity-effect-API.patch b/patches/api/Improve-entity-effect-API.patch index 1312775fe2..83f43c7991 100644 --- a/patches/api/Improve-entity-effect-API.patch +++ b/patches/api/Improve-entity-effect-API.patch @@ -96,9 +96,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * Does not apply to plain creaking entities as they are not invulnerable like the transient ones spawned by the + * creaking heart. + */ -+ @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) -+ @org.jetbrains.annotations.ApiStatus.Experimental -+ SHAKE(66, org.bukkit.entity.CreakingTransient.class); ++ SHAKE(66, org.bukkit.entity.Creaking.class); + // Paper end - add missing EntityEffect private final byte data; diff --git a/patches/unapplied/server/API-for-checking-sent-chunks.patch b/patches/server/API-for-checking-sent-chunks.patch similarity index 100% rename from patches/unapplied/server/API-for-checking-sent-chunks.patch rename to patches/server/API-for-checking-sent-chunks.patch diff --git a/patches/unapplied/server/API-to-allow-disallow-tick-sleeping.patch b/patches/server/API-to-allow-disallow-tick-sleeping.patch similarity index 100% rename from patches/unapplied/server/API-to-allow-disallow-tick-sleeping.patch rename to patches/server/API-to-allow-disallow-tick-sleeping.patch diff --git a/patches/unapplied/server/API-to-check-if-the-server-is-sleeping.patch b/patches/server/API-to-check-if-the-server-is-sleeping.patch similarity index 100% rename from patches/unapplied/server/API-to-check-if-the-server-is-sleeping.patch rename to patches/server/API-to-check-if-the-server-is-sleeping.patch diff --git a/patches/unapplied/server/Add-Alternate-Current-redstone-implementation.patch b/patches/server/Add-Alternate-Current-redstone-implementation.patch similarity index 100% rename from patches/unapplied/server/Add-Alternate-Current-redstone-implementation.patch rename to patches/server/Add-Alternate-Current-redstone-implementation.patch diff --git a/patches/unapplied/server/Add-startup-flag-to-disable-gamerule-limits.patch b/patches/server/Add-startup-flag-to-disable-gamerule-limits.patch similarity index 100% rename from patches/unapplied/server/Add-startup-flag-to-disable-gamerule-limits.patch rename to patches/server/Add-startup-flag-to-disable-gamerule-limits.patch diff --git a/patches/unapplied/server/Allow-using-old-ender-pearl-behavior.patch b/patches/server/Allow-using-old-ender-pearl-behavior.patch similarity index 100% rename from patches/unapplied/server/Allow-using-old-ender-pearl-behavior.patch rename to patches/server/Allow-using-old-ender-pearl-behavior.patch diff --git a/patches/unapplied/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch similarity index 100% rename from patches/unapplied/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch rename to patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch diff --git a/patches/unapplied/server/Avoid-issues-with-certain-tasks-not-processing-durin.patch b/patches/server/Avoid-issues-with-certain-tasks-not-processing-durin.patch similarity index 100% rename from patches/unapplied/server/Avoid-issues-with-certain-tasks-not-processing-durin.patch rename to patches/server/Avoid-issues-with-certain-tasks-not-processing-durin.patch diff --git a/patches/unapplied/server/Block-Enderpearl-Travel-Exploit.patch b/patches/server/Block-Enderpearl-Travel-Exploit.patch similarity index 100% rename from patches/unapplied/server/Block-Enderpearl-Travel-Exploit.patch rename to patches/server/Block-Enderpearl-Travel-Exploit.patch diff --git a/patches/unapplied/server/Bundle-spark.patch b/patches/server/Bundle-spark.patch similarity index 100% rename from patches/unapplied/server/Bundle-spark.patch rename to patches/server/Bundle-spark.patch diff --git a/patches/unapplied/server/Call-CraftPlayer-onEntityRemove-for-all-online-playe.patch b/patches/server/Call-CraftPlayer-onEntityRemove-for-all-online-playe.patch similarity index 100% rename from patches/unapplied/server/Call-CraftPlayer-onEntityRemove-for-all-online-playe.patch rename to patches/server/Call-CraftPlayer-onEntityRemove-for-all-online-playe.patch diff --git a/patches/unapplied/server/Configurable-Entity-Despawn-Time.patch b/patches/server/Configurable-Entity-Despawn-Time.patch similarity index 100% rename from patches/unapplied/server/Configurable-Entity-Despawn-Time.patch rename to patches/server/Configurable-Entity-Despawn-Time.patch diff --git a/patches/unapplied/server/Correct-update-cursor.patch b/patches/server/Correct-update-cursor.patch similarity index 100% rename from patches/unapplied/server/Correct-update-cursor.patch rename to patches/server/Correct-update-cursor.patch diff --git a/patches/unapplied/server/Detail-more-information-in-watchdog-dumps.patch b/patches/server/Detail-more-information-in-watchdog-dumps.patch similarity index 100% rename from patches/unapplied/server/Detail-more-information-in-watchdog-dumps.patch rename to patches/server/Detail-more-information-in-watchdog-dumps.patch diff --git a/patches/unapplied/server/Eigencraft-redstone-implementation.patch b/patches/server/Eigencraft-redstone-implementation.patch similarity index 100% rename from patches/unapplied/server/Eigencraft-redstone-implementation.patch rename to patches/server/Eigencraft-redstone-implementation.patch diff --git a/patches/unapplied/server/Entity-load-save-limit-per-chunk.patch b/patches/server/Entity-load-save-limit-per-chunk.patch similarity index 100% rename from patches/unapplied/server/Entity-load-save-limit-per-chunk.patch rename to patches/server/Entity-load-save-limit-per-chunk.patch diff --git a/patches/unapplied/server/Expanded-Art-API.patch b/patches/server/Expanded-Art-API.patch similarity index 100% rename from patches/unapplied/server/Expanded-Art-API.patch rename to patches/server/Expanded-Art-API.patch diff --git a/patches/unapplied/server/Fix-CraftWorld-isChunkGenerated.patch b/patches/server/Fix-CraftWorld-isChunkGenerated.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftWorld-isChunkGenerated.patch rename to patches/server/Fix-CraftWorld-isChunkGenerated.patch diff --git a/patches/unapplied/server/Fix-NPE-when-EntityResurrectEvent-is-uncancelled.patch b/patches/server/Fix-NPE-when-EntityResurrectEvent-is-uncancelled.patch similarity index 100% rename from patches/unapplied/server/Fix-NPE-when-EntityResurrectEvent-is-uncancelled.patch rename to patches/server/Fix-NPE-when-EntityResurrectEvent-is-uncancelled.patch diff --git a/patches/unapplied/server/Fix-entity-tracker-desync-when-new-players-are-added.patch b/patches/server/Fix-entity-tracker-desync-when-new-players-are-added.patch similarity index 100% rename from patches/unapplied/server/Fix-entity-tracker-desync-when-new-players-are-added.patch rename to patches/server/Fix-entity-tracker-desync-when-new-players-are-added.patch diff --git a/patches/unapplied/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch b/patches/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch similarity index 100% rename from patches/unapplied/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch rename to patches/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch diff --git a/patches/unapplied/server/Fix-incorrect-invulnerability-damage-reduction.patch b/patches/server/Fix-incorrect-invulnerability-damage-reduction.patch similarity index 100% rename from patches/unapplied/server/Fix-incorrect-invulnerability-damage-reduction.patch rename to patches/server/Fix-incorrect-invulnerability-damage-reduction.patch diff --git a/patches/unapplied/server/Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch b/patches/server/Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch similarity index 100% rename from patches/unapplied/server/Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch rename to patches/server/Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch diff --git a/patches/unapplied/server/Improve-performance-of-RecipeMap-removeRecipe.patch b/patches/server/Improve-performance-of-RecipeMap-removeRecipe.patch similarity index 100% rename from patches/unapplied/server/Improve-performance-of-RecipeMap-removeRecipe.patch rename to patches/server/Improve-performance-of-RecipeMap-removeRecipe.patch diff --git a/patches/unapplied/server/Improve-performance-of-mass-crafts.patch b/patches/server/Improve-performance-of-mass-crafts.patch similarity index 100% rename from patches/unapplied/server/Improve-performance-of-mass-crafts.patch rename to patches/server/Improve-performance-of-mass-crafts.patch diff --git a/patches/unapplied/server/Improved-Watchdog-Support.patch b/patches/server/Improved-Watchdog-Support.patch similarity index 99% rename from patches/unapplied/server/Improved-Watchdog-Support.patch rename to patches/server/Improved-Watchdog-Support.patch index eb9af9491e..698c2d5861 100644 --- a/patches/unapplied/server/Improved-Watchdog-Support.patch +++ b/patches/server/Improved-Watchdog-Support.patch @@ -109,7 +109,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -0,0 +0,0 @@ public class Main { - + @SuppressForbidden(reason = "System.out needed before bootstrap") // CraftBukkit - decompile error @DontObfuscate public static void main(final OptionSet optionset) { // CraftBukkit - replaces main(String[] astring) + io.papermc.paper.util.LogManagerShutdownThread.hook(); // Paper diff --git a/patches/unapplied/server/Incremental-chunk-and-player-saving.patch b/patches/server/Incremental-chunk-and-player-saving.patch similarity index 100% rename from patches/unapplied/server/Incremental-chunk-and-player-saving.patch rename to patches/server/Incremental-chunk-and-player-saving.patch diff --git a/patches/unapplied/server/Lag-compensation-ticks.patch b/patches/server/Lag-compensation-ticks.patch similarity index 100% rename from patches/unapplied/server/Lag-compensation-ticks.patch rename to patches/server/Lag-compensation-ticks.patch diff --git a/patches/unapplied/server/Only-attempt-to-find-spawn-position-if-there-isn-t-a.patch b/patches/server/Only-attempt-to-find-spawn-position-if-there-isn-t-a.patch similarity index 100% rename from patches/unapplied/server/Only-attempt-to-find-spawn-position-if-there-isn-t-a.patch rename to patches/server/Only-attempt-to-find-spawn-position-if-there-isn-t-a.patch diff --git a/patches/unapplied/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch b/patches/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch similarity index 100% rename from patches/unapplied/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch rename to patches/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch diff --git a/patches/unapplied/server/Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/server/Optimise-collision-checking-in-player-move-packet-ha.patch similarity index 98% rename from patches/unapplied/server/Optimise-collision-checking-in-player-move-packet-ha.patch rename to patches/server/Optimise-collision-checking-in-player-move-packet-ha.patch index b644585f98..844e944e51 100644 --- a/patches/unapplied/server/Optimise-collision-checking-in-player-move-packet-ha.patch +++ b/patches/server/Optimise-collision-checking-in-player-move-packet-ha.patch @@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + AABB oldBox = entity.getBoundingBox(); // Paper - copy from player movement packet d6 = d3 - this.vehicleLastGoodX; // Paper - diff on change, used for checking large move vectors above - d7 = d4 - this.vehicleLastGoodY - 1.0E-6D; // Paper - diff on change, used for checking large move vectors above + d7 = d4 - this.vehicleLastGoodY; // Paper - diff on change, used for checking large move vectors above @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } @@ -54,7 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (teleportBack) { // Paper end - optimise out extra getCubes entity.absMoveTo(d0, d1, d2, f, f1); this.player.absMoveTo(d0, d1, d2, this.player.getYRot(), this.player.getXRot()); // CraftBukkit - this.send(new ClientboundMoveVehiclePacket(entity)); + this.send(ClientboundMoveVehiclePacket.fromEntity(entity)); @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } diff --git a/patches/unapplied/server/Optimise-general-POI-access.patch b/patches/server/Optimise-general-POI-access.patch similarity index 98% rename from patches/unapplied/server/Optimise-general-POI-access.patch rename to patches/server/Optimise-general-POI-access.patch index 2d3d312e5e..3f3faadbc8 100644 --- a/patches/unapplied/server/Optimise-general-POI-access.patch +++ b/patches/server/Optimise-general-POI-access.patch @@ -856,11 +856,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - poiPredicate, predicate2, entity.blockPosition(), 48, PoiManager.Occupancy.HAS_SPACE - ) - .limit(5L) +- .filter(pairx -> worldPosBiPredicate.test(world, (BlockPos)pairx.getSecond())) - .collect(Collectors.toSet()); + // Paper start - optimise POI access -+ java.util.List, BlockPos>> poiposes = new java.util.ArrayList<>(); ++ final java.util.List, BlockPos>> poiposes = new java.util.ArrayList<>(); + io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, poiPredicate, predicate2, entity.blockPosition(), 48, 48*48, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes); -+ Set, BlockPos>> set = new java.util.HashSet<>(poiposes); ++ final Set, BlockPos>> set = new java.util.HashSet<>(poiposes.size()); ++ for (final Pair, BlockPos> poiPose : poiposes) { ++ if (worldPosBiPredicate.test(world, poiPose.getSecond())) { ++ set.add(poiPose); ++ } ++ } + // Paper end - optimise POI access Path path = findPathToPois(entity, set); if (path != null && path.canReach()) { diff --git a/patches/unapplied/server/Optional-per-player-mob-spawns.patch b/patches/server/Optional-per-player-mob-spawns.patch similarity index 100% rename from patches/unapplied/server/Optional-per-player-mob-spawns.patch rename to patches/server/Optional-per-player-mob-spawns.patch diff --git a/patches/unapplied/server/Reduce-work-done-in-CraftMapCanvas.drawImage-by-limi.patch b/patches/server/Reduce-work-done-in-CraftMapCanvas.drawImage-by-limi.patch similarity index 100% rename from patches/unapplied/server/Reduce-work-done-in-CraftMapCanvas.drawImage-by-limi.patch rename to patches/server/Reduce-work-done-in-CraftMapCanvas.drawImage-by-limi.patch