1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-25 00:07:36 +01:00

Apply remaining patches, fix API

This commit is contained in:
Nassim Jahnke 2024-12-03 21:24:17 +01:00
parent e3db6ac6e4
commit 834a4c4a8d
36 changed files with 14 additions and 10 deletions
patches
api
server
API-for-checking-sent-chunks.patchAPI-to-allow-disallow-tick-sleeping.patchAPI-to-check-if-the-server-is-sleeping.patchAdd-Alternate-Current-redstone-implementation.patchAdd-startup-flag-to-disable-gamerule-limits.patchAllow-using-old-ender-pearl-behavior.patchAttempt-to-recalculate-regionfile-header-if-it-is-co.patchAvoid-issues-with-certain-tasks-not-processing-durin.patchBlock-Enderpearl-Travel-Exploit.patchBundle-spark.patchCall-CraftPlayer-onEntityRemove-for-all-online-playe.patchConfigurable-Entity-Despawn-Time.patchCorrect-update-cursor.patchDetail-more-information-in-watchdog-dumps.patchEigencraft-redstone-implementation.patchEntity-load-save-limit-per-chunk.patchExpanded-Art-API.patchFix-CraftWorld-isChunkGenerated.patchFix-NPE-when-EntityResurrectEvent-is-uncancelled.patchFix-entity-tracker-desync-when-new-players-are-added.patchFix-inconsistencies-in-dispense-events-regarding-sta.patchFix-incorrect-invulnerability-damage-reduction.patchImprove-cancelling-PreCreatureSpawnEvent-with-per-pl.patchImprove-performance-of-RecipeMap-removeRecipe.patchImprove-performance-of-mass-crafts.patchImproved-Watchdog-Support.patchIncremental-chunk-and-player-saving.patchLag-compensation-ticks.patchOnly-attempt-to-find-spawn-position-if-there-isn-t-a.patchOnly-write-chunk-data-to-disk-if-it-serializes-witho.patchOptimise-collision-checking-in-player-move-packet-ha.patchOptimise-general-POI-access.patchOptional-per-player-mob-spawns.patchReduce-work-done-in-CraftMapCanvas.drawImage-by-limi.patch

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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
}

View file

@ -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<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
+ final java.util.List<Pair<Holder<PoiType>, 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<Pair<Holder<PoiType>, BlockPos>> set = new java.util.HashSet<>(poiposes);
+ final Set<Pair<Holder<PoiType>, BlockPos>> set = new java.util.HashSet<>(poiposes.size());
+ for (final Pair<Holder<PoiType>, 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()) {