From ef6a41195d87f82b074bd6b3ff570729a570ed9a Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 21 Sep 2023 15:26:51 -0700 Subject: [PATCH] some more work --- patches/server/0010-Adventure.patch | 16 +++-- patches/server/0014-Timings-v2.patch | 8 +-- ...051-Improve-Player-chat-API-handling.patch | 6 +- ...0083-Add-PlayerUseUnknownEntityEvent.patch | 4 +- ...onfigurable-packet-in-spam-threshold.patch | 2 +- ...08-Configurable-flying-kick-messages.patch | 2 +- ...ke-parrots-stay-on-shoulders-despite.patch | 4 +- patches/server/0156-Add-PlayerJumpEvent.patch | 2 +- .../server/0166-AsyncTabCompleteEvent.patch | 2 +- .../0181-Player.setPlayerProfile-API.patch | 2 +- .../0215-InventoryCloseEvent-Reason-API.patch | 4 +- ...nventory-when-cancelling-PlayerInter.patch | 4 +- ...nd-make-tab-spam-limits-configurable.patch | 2 +- ...-attack-cooldown-methods-for-Player.patch} | 4 +- .../0252-Improve-death-events.patch} | 66 +++++++++---------- ...w-chests-to-be-placed-with-NBT-data.patch} | 4 +- .../0254-Mob-Pathfinding-API.patch} | 4 +- ...for-CanPlaceOn-and-CanDestroy-NBT-v.patch} | 0 ...nt-Mob-AI-Rules-from-Loading-Chunks.patch} | 0 ...ning-from-loading-generating-chunks.patch} | 2 +- ...t-furnace-cook-speed-multiplier-API.patch} | 22 ++++--- .../0259-Honor-EntityAgeable.ageLock.patch} | 0 ...le-connection-throttle-kick-message.patch} | 2 +- ...nt-chunk-loading-from-Fluid-Flowing.patch} | 10 +-- .../0262-Hook-into-CB-plugin-rewrites.patch} | 0 .../0263-PreSpawnerSpawnEvent.patch} | 0 ...64-Add-LivingEntity-getTargetEntity.patch} | 6 +- .../0265-Add-sun-related-API.patch} | 4 +- ...rseException-in-Entity-and-TE-names.patch} | 37 ++++------- .../0267-Turtle-API.patch} | 6 +- ...ator-target-events-and-improve-impl.patch} | 6 +- ...her-worlds-for-shooter-of-projectil.patch} | 0 .../0270-Add-more-Witch-API.patch} | 12 ++-- ...wned-for-Villager-Aggression-Config.patch} | 0 ...vent-players-from-moving-into-unloa.patch} | 10 +-- ...3-Reset-players-airTicks-on-respawn.patch} | 4 +- ...after-profile-lookups-if-not-needed.patch} | 12 ++-- ...r-Thread-Pool-and-Thread-Priorities.patch} | 10 +-- .../0276-Optimize-World-Time-Updates.patch} | 4 +- ...tore-custom-InventoryHolder-support.patch} | 0 .../0278-Use-Vanilla-Minecart-Speeds.patch} | 4 +- ...0279-Fix-SpongeAbsortEvent-handling.patch} | 4 +- ...-allow-digging-into-unloaded-chunks.patch} | 4 +- ...ult-permission-message-configurable.patch} | 8 +-- ...revent-rayTrace-from-loading-chunks.patch} | 0 ...-Large-Packets-disconnecting-client.patch} | 50 ++++++++------ ...ntity-dismount-during-teleportation.patch} | 18 ++--- .../0285-Add-more-Zombie-API.patch} | 12 ++-- .../0286-Book-Size-Limits.patch} | 4 +- ...0287-Add-PlayerConnectionCloseEvent.patch} | 11 ++-- ...revent-Enderman-from-loading-chunks.patch} | 6 +- ...replace-OfflinePlayer-getLastPlayed.patch} | 22 +++---- ...ehicle-tracking-issue-on-disconnect.patch} | 4 +- ...remove-from-being-called-on-Players.patch} | 4 +- .../0292-BlockDestroyEvent.patch} | 4 +- .../0293-Async-command-map-building.patch} | 10 +-- 56 files changed, 225 insertions(+), 223 deletions(-) rename patches/{unapplied/server/0252-Expose-attack-cooldown-methods-for-Player.patch => server/0251-Expose-attack-cooldown-methods-for-Player.patch} (86%) rename patches/{unapplied/server/0253-Improve-death-events.patch => server/0252-Improve-death-events.patch} (90%) rename patches/{unapplied/server/0254-Allow-chests-to-be-placed-with-NBT-data.patch => server/0253-Allow-chests-to-be-placed-with-NBT-data.patch} (91%) rename patches/{unapplied/server/0255-Mob-Pathfinding-API.patch => server/0254-Mob-Pathfinding-API.patch} (98%) rename patches/{unapplied/server/0256-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch => server/0255-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch} (100%) rename patches/{unapplied/server/0257-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch => server/0256-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch} (100%) rename patches/{unapplied/server/0258-Prevent-mob-spawning-from-loading-generating-chunks.patch => server/0257-Prevent-mob-spawning-from-loading-generating-chunks.patch} (95%) rename patches/{unapplied/server/0259-Implement-furnace-cook-speed-multiplier-API.patch => server/0258-Implement-furnace-cook-speed-multiplier-API.patch} (86%) rename patches/{unapplied/server/0260-Honor-EntityAgeable.ageLock.patch => server/0259-Honor-EntityAgeable.ageLock.patch} (100%) rename patches/{unapplied/server/0261-Configurable-connection-throttle-kick-message.patch => server/0260-Configurable-connection-throttle-kick-message.patch} (94%) rename patches/{unapplied/server/0262-Prevent-chunk-loading-from-Fluid-Flowing.patch => server/0261-Prevent-chunk-loading-from-Fluid-Flowing.patch} (92%) rename patches/{unapplied/server/0263-Hook-into-CB-plugin-rewrites.patch => server/0262-Hook-into-CB-plugin-rewrites.patch} (100%) rename patches/{unapplied/server/0264-PreSpawnerSpawnEvent.patch => server/0263-PreSpawnerSpawnEvent.patch} (100%) rename patches/{unapplied/server/0265-Add-LivingEntity-getTargetEntity.patch => server/0264-Add-LivingEntity-getTargetEntity.patch} (95%) rename patches/{unapplied/server/0266-Add-sun-related-API.patch => server/0265-Add-sun-related-API.patch} (90%) rename patches/{unapplied/server/0267-Catch-JsonParseException-in-Entity-and-TE-names.patch => server/0266-Catch-JsonParseException-in-Entity-and-TE-names.patch} (81%) rename patches/{unapplied/server/0268-Turtle-API.patch => server/0267-Turtle-API.patch} (96%) rename patches/{unapplied/server/0269-Call-player-spectator-target-events-and-improve-impl.patch => server/0268-Call-player-spectator-target-events-and-improve-impl.patch} (91%) rename patches/{unapplied/server/0270-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch => server/0269-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch} (100%) rename patches/{unapplied/server/0271-Add-more-Witch-API.patch => server/0270-Add-more-Witch-API.patch} (94%) rename patches/{unapplied/server/0272-Check-Drowned-for-Villager-Aggression-Config.patch => server/0271-Check-Drowned-for-Villager-Aggression-Config.patch} (100%) rename patches/{unapplied/server/0273-Add-option-to-prevent-players-from-moving-into-unloa.patch => server/0272-Add-option-to-prevent-players-from-moving-into-unloa.patch} (90%) rename patches/{unapplied/server/0274-Reset-players-airTicks-on-respawn.patch => server/0273-Reset-players-airTicks-on-respawn.patch} (83%) rename patches/{unapplied/server/0275-Don-t-sleep-after-profile-lookups-if-not-needed.patch => server/0274-Don-t-sleep-after-profile-lookups-if-not-needed.patch} (71%) rename patches/{unapplied/server/0276-Improve-Server-Thread-Pool-and-Thread-Priorities.patch => server/0275-Improve-Server-Thread-Pool-and-Thread-Priorities.patch} (93%) rename patches/{unapplied/server/0277-Optimize-World-Time-Updates.patch => server/0276-Optimize-World-Time-Updates.patch} (94%) rename patches/{unapplied/server/0278-Restore-custom-InventoryHolder-support.patch => server/0277-Restore-custom-InventoryHolder-support.patch} (100%) rename patches/{unapplied/server/0279-Use-Vanilla-Minecart-Speeds.patch => server/0278-Use-Vanilla-Minecart-Speeds.patch} (87%) rename patches/{unapplied/server/0280-Fix-SpongeAbsortEvent-handling.patch => server/0279-Fix-SpongeAbsortEvent-handling.patch} (88%) rename patches/{unapplied/server/0281-Don-t-allow-digging-into-unloaded-chunks.patch => server/0280-Don-t-allow-digging-into-unloaded-chunks.patch} (96%) rename patches/{unapplied/server/0282-Make-the-default-permission-message-configurable.patch => server/0281-Make-the-default-permission-message-configurable.patch} (85%) rename patches/{unapplied/server/0283-Prevent-rayTrace-from-loading-chunks.patch => server/0282-Prevent-rayTrace-from-loading-chunks.patch} (100%) rename patches/{unapplied/server/0284-Handle-Large-Packets-disconnecting-client.patch => server/0283-Handle-Large-Packets-disconnecting-client.patch} (73%) rename patches/{unapplied/server/0285-force-entity-dismount-during-teleportation.patch => server/0284-force-entity-dismount-during-teleportation.patch} (87%) rename patches/{unapplied/server/0286-Add-more-Zombie-API.patch => server/0285-Add-more-Zombie-API.patch} (90%) rename patches/{unapplied/server/0287-Book-Size-Limits.patch => server/0286-Book-Size-Limits.patch} (93%) rename patches/{unapplied/server/0288-Add-PlayerConnectionCloseEvent.patch => server/0287-Add-PlayerConnectionCloseEvent.patch} (92%) rename patches/{unapplied/server/0289-Prevent-Enderman-from-loading-chunks.patch => server/0288-Prevent-Enderman-from-loading-chunks.patch} (90%) rename patches/{unapplied/server/0290-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch => server/0289-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch} (89%) rename patches/{unapplied/server/0291-Workaround-for-vehicle-tracking-issue-on-disconnect.patch => server/0290-Workaround-for-vehicle-tracking-issue-on-disconnect.patch} (85%) rename patches/{unapplied/server/0292-Block-Entity-remove-from-being-called-on-Players.patch => server/0291-Block-Entity-remove-from-being-called-on-Players.patch} (90%) rename patches/{unapplied/server/0293-BlockDestroyEvent.patch => server/0292-BlockDestroyEvent.patch} (93%) rename patches/{unapplied/server/0294-Async-command-map-building.patch => server/0293-Async-command-map-building.patch} (90%) diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index d03acf8461..10336d2d21 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -2419,7 +2419,7 @@ index e7a9dd7791a0dd200c4d74922c6e5adaa5013669..b9062fe651de34d5b3f9d5f146ae0b4f this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index bbd256d088879f04762fcf628573f1348e4961a8..92b18f382e91936aad54b083284a393684747d9d 100644 +index bbd256d088879f04762fcf628573f1348e4961a8..463d268c3e9450996f58f9820dbd8fc527c213ea 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -45,6 +45,7 @@ import net.minecraft.nbt.ListTag; @@ -2454,11 +2454,13 @@ index bbd256d088879f04762fcf628573f1348e4961a8..92b18f382e91936aad54b083284a3936 } // CraftBukkit end this.player.getTextFilter().leave(); -@@ -1754,10 +1759,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - CompletableFuture completablefuture = this.filterTextPacket(playerchatmessage.signedContent()); - Component ichatbasecomponent = this.server.getChatDecorator().decorate(this.player, playerchatmessage.decoratedContent()); +@@ -1752,12 +1757,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + } + CompletableFuture completablefuture = this.filterTextPacket(playerchatmessage.signedContent()); +- Component ichatbasecomponent = this.server.getChatDecorator().decorate(this.player, playerchatmessage.decoratedContent()); + CompletableFuture componentFuture = this.server.getChatDecorator().decorate(this.player, null, playerchatmessage.decoratedContent()); // Paper + this.chatMessageChain.append((executor) -> { - return completablefuture.thenAcceptAsync((filteredtext) -> { - PlayerChatMessage playerchatmessage1 = playerchatmessage.withUnsignedContent(ichatbasecomponent).filter(filteredtext.mask()); @@ -2468,7 +2470,7 @@ index bbd256d088879f04762fcf628573f1348e4961a8..92b18f382e91936aad54b083284a3936 this.broadcastChatMessage(playerchatmessage1); }, this.server.chatExecutor); // CraftBukkit - async chat }); -@@ -1862,7 +1867,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1862,7 +1866,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl Optional optional = this.unpackAndApplyLastSeen(acknowledgment); if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales @@ -2477,7 +2479,7 @@ index bbd256d088879f04762fcf628573f1348e4961a8..92b18f382e91936aad54b083284a3936 return Optional.empty(); } else { this.player.resetLastActionTime(); -@@ -1920,7 +1925,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1920,7 +1924,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.handleCommand(s); } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Do nothing, this is coming from a plugin @@ -2491,7 +2493,7 @@ index bbd256d088879f04762fcf628573f1348e4961a8..92b18f382e91936aad54b083284a3936 Player player = this.getCraftPlayer(); AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(server)); String originalFormat = event.getFormat(), originalMessage = event.getMessage(); -@@ -2044,7 +2054,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2044,7 +2053,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } }); } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Re-add "Command Only" flag check diff --git a/patches/server/0014-Timings-v2.patch b/patches/server/0014-Timings-v2.patch index 3fd85ad9d1..a3ae1ea3c5 100644 --- a/patches/server/0014-Timings-v2.patch +++ b/patches/server/0014-Timings-v2.patch @@ -1275,7 +1275,7 @@ index e2eff46cae9771931b2e0dfee5e73fd4842e3ab5..988a17cd0b960a07795d999dd125eae3 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 92b18f382e91936aad54b083284a393684747d9d..d755ce65ffd22a7f39bb19c547f655f8539b3dbf 100644 +index 463d268c3e9450996f58f9820dbd8fc527c213ea..e85268e4c20371d4264effb70ae9fa8e435f8766 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -320,7 +320,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1294,7 +1294,7 @@ index 92b18f382e91936aad54b083284a393684747d9d..d755ce65ffd22a7f39bb19c547f655f8 } -@@ -2006,7 +2004,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2005,7 +2003,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } private void handleCommand(String s) { @@ -1303,7 +1303,7 @@ index 92b18f382e91936aad54b083284a393684747d9d..d755ce65ffd22a7f39bb19c547f655f8 if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); -@@ -2016,7 +2014,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2015,7 +2013,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.cserver.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -1312,7 +1312,7 @@ index 92b18f382e91936aad54b083284a393684747d9d..d755ce65ffd22a7f39bb19c547f655f8 return; } -@@ -2029,7 +2027,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2028,7 +2026,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); return; } finally { diff --git a/patches/server/0051-Improve-Player-chat-API-handling.patch b/patches/server/0051-Improve-Player-chat-API-handling.patch index 6c3ba50049..0adb63d379 100644 --- a/patches/server/0051-Improve-Player-chat-API-handling.patch +++ b/patches/server/0051-Improve-Player-chat-API-handling.patch @@ -17,10 +17,10 @@ Co-authored-by: Jake Potrebic Co-authored-by: SoSeDiK diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index d755ce65ffd22a7f39bb19c547f655f8539b3dbf..0f264a3efe33935df463cc8048bc70ab14526386 100644 +index e85268e4c20371d4264effb70ae9fa8e435f8766..98266c0349d21fc1ebf0d34a3d898825d477d6e5 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1919,7 +1919,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1918,7 +1918,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } OutgoingChatMessage outgoing = OutgoingChatMessage.create(original); @@ -29,7 +29,7 @@ index d755ce65ffd22a7f39bb19c547f655f8539b3dbf..0f264a3efe33935df463cc8048bc70ab this.handleCommand(s); } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Do nothing, this is coming from a plugin -@@ -2003,7 +2003,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2002,7 +2002,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } diff --git a/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch b/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch index e1c27e951b..532519ab03 100644 --- a/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch +++ b/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch @@ -28,10 +28,10 @@ index 644a0fdea6576647539b96528717dbaeab498d93..221e64a66ff12a8de5c75992fc26a54a + // Paper end - PlayerUseUnknownEntityEvent } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0f264a3efe33935df463cc8048bc70ab14526386..e58a87d933b916dd246f392577432d8022f117f7 100644 +index 98266c0349d21fc1ebf0d34a3d898825d477d6e5..a4e010b9195d0afeb4724dc64c85964a843eb59a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2386,8 +2386,38 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2385,8 +2385,38 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl }); } } diff --git a/patches/server/0107-Configurable-packet-in-spam-threshold.patch b/patches/server/0107-Configurable-packet-in-spam-threshold.patch index 1f630f5fcd..60ec35618b 100644 --- a/patches/server/0107-Configurable-packet-in-spam-threshold.patch +++ b/patches/server/0107-Configurable-packet-in-spam-threshold.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable packet in spam threshold diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e58a87d933b916dd246f392577432d8022f117f7..0ce757dd60d167886d56eb651140cec93b1af41e 100644 +index a4e010b9195d0afeb4724dc64c85964a843eb59a..2233a21dfe7a745a95886784dcbcbf1d95a93f7a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1498,13 +1498,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0108-Configurable-flying-kick-messages.patch b/patches/server/0108-Configurable-flying-kick-messages.patch index dc06ceb4e9..9cb4f579da 100644 --- a/patches/server/0108-Configurable-flying-kick-messages.patch +++ b/patches/server/0108-Configurable-flying-kick-messages.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable flying kick messages diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0ce757dd60d167886d56eb651140cec93b1af41e..4c9454589b5fe98d8b6be84fe07970efa5f07732 100644 +index 2233a21dfe7a745a95886784dcbcbf1d95a93f7a..855bb02f3879bc2ab74ceb7e837b562496aca30e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -336,7 +336,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0131-Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/patches/server/0131-Add-option-to-make-parrots-stay-on-shoulders-despite.patch index 33949db6ad..5727c9be30 100644 --- a/patches/server/0131-Add-option-to-make-parrots-stay-on-shoulders-despite.patch +++ b/patches/server/0131-Add-option-to-make-parrots-stay-on-shoulders-despite.patch @@ -14,10 +14,10 @@ To be converted into a Paper-API event at some point in the future? public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 4c9454589b5fe98d8b6be84fe07970efa5f07732..4ab881766975eb4853094ad0d70e9e0647a0c23e 100644 +index 855bb02f3879bc2ab74ceb7e837b562496aca30e..4f420687d7afc6cdb8175d510c54a0d8dd3847b6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2163,6 +2163,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2162,6 +2162,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl switch (packet.getAction()) { case PRESS_SHIFT_KEY: this.player.setShiftKeyDown(true); diff --git a/patches/server/0156-Add-PlayerJumpEvent.patch b/patches/server/0156-Add-PlayerJumpEvent.patch index 6199ca6d01..62a093ea68 100644 --- a/patches/server/0156-Add-PlayerJumpEvent.patch +++ b/patches/server/0156-Add-PlayerJumpEvent.patch @@ -5,7 +5,7 @@ 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 4ab881766975eb4853094ad0d70e9e0647a0c23e..d849ca56d36f4652a5c1526a92f183a2defb3e0d 100644 +index 4f420687d7afc6cdb8175d510c54a0d8dd3847b6..875c98d4f93b3fdd93af3a1087a818f7250515b1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1192,7 +1192,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0166-AsyncTabCompleteEvent.patch b/patches/server/0166-AsyncTabCompleteEvent.patch index aff93af70c..d1e3c29612 100644 --- a/patches/server/0166-AsyncTabCompleteEvent.patch +++ b/patches/server/0166-AsyncTabCompleteEvent.patch @@ -16,7 +16,7 @@ Also adds isCommand and getLocation to the sync TabCompleteEvent Co-authored-by: Aikar diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index d849ca56d36f4652a5c1526a92f183a2defb3e0d..8e27c443b31566a8e57c29ba29fa914fe4a53275 100644 +index 875c98d4f93b3fdd93af3a1087a818f7250515b1..c14ebcc46c033834a14de5d6335a4dcc7830069d 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -687,27 +687,58 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0181-Player.setPlayerProfile-API.patch b/patches/server/0181-Player.setPlayerProfile-API.patch index ce22e62303..222f8e4ef1 100644 --- a/patches/server/0181-Player.setPlayerProfile-API.patch +++ b/patches/server/0181-Player.setPlayerProfile-API.patch @@ -9,7 +9,7 @@ This can be useful for changing name or skins after a player has logged in. public-f net.minecraft.world.entity.player.Player gameProfile diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 8e27c443b31566a8e57c29ba29fa914fe4a53275..2addf6dfbe808d4a74d74812ae024925cb3bdb13 100644 +index c14ebcc46c033834a14de5d6335a4dcc7830069d..6ad9b294aadf96465834cde1ff1cda1710441c79 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1430,7 +1430,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0215-InventoryCloseEvent-Reason-API.patch b/patches/server/0215-InventoryCloseEvent-Reason-API.patch index a426d229d7..ef8f7f2603 100644 --- a/patches/server/0215-InventoryCloseEvent-Reason-API.patch +++ b/patches/server/0215-InventoryCloseEvent-Reason-API.patch @@ -75,7 +75,7 @@ index 491dffdcbb065acf5861dc01b403d1a895c92baa..3a9fd9ea736d1b3dbb261158d690e218 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 2addf6dfbe808d4a74d74812ae024925cb3bdb13..025eacdf53f42b47f5815cbacfe74d0990da0e42 100644 +index 6ad9b294aadf96465834cde1ff1cda1710441c79..f32e04f1c6394769983dec0d931798e0b5fda2fe 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -215,6 +215,7 @@ import org.bukkit.event.inventory.ClickType; @@ -86,7 +86,7 @@ index 2addf6dfbe808d4a74d74812ae024925cb3bdb13..025eacdf53f42b47f5815cbacfe74d09 import org.bukkit.event.inventory.InventoryCreativeEvent; import org.bukkit.event.inventory.InventoryType.SlotType; import org.bukkit.event.inventory.SmithItemEvent; -@@ -2517,10 +2518,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2516,10 +2517,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleContainerClose(ServerboundContainerClosePacket packet) { diff --git a/patches/server/0217-Refresh-player-inventory-when-cancelling-PlayerInter.patch b/patches/server/0217-Refresh-player-inventory-when-cancelling-PlayerInter.patch index a878920e56..faec5db369 100644 --- a/patches/server/0217-Refresh-player-inventory-when-cancelling-PlayerInter.patch +++ b/patches/server/0217-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 025eacdf53f42b47f5815cbacfe74d0990da0e42..4af898571bfe218d38ce8a1ec042f142317cd00d 100644 +index f32e04f1c6394769983dec0d931798e0b5fda2fe..c63b0a3ff5fe5c03199693d8e2cbf08a25f33d70 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2398,6 +2398,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2397,6 +2397,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } if (event.isCancelled()) { diff --git a/patches/server/0232-Break-up-and-make-tab-spam-limits-configurable.patch b/patches/server/0232-Break-up-and-make-tab-spam-limits-configurable.patch index 1499cf875c..f1e78a18b8 100644 --- a/patches/server/0232-Break-up-and-make-tab-spam-limits-configurable.patch +++ b/patches/server/0232-Break-up-and-make-tab-spam-limits-configurable.patch @@ -22,7 +22,7 @@ to take the burden of this into their own hand without having to rely on plugins doing unsafe things. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 4af898571bfe218d38ce8a1ec042f142317cd00d..879b27c58a8a3479e2ab83b020b6ee9e98b93d2b 100644 +index c63b0a3ff5fe5c03199693d8e2cbf08a25f33d70..423390ff2508ab9af804925044142ea289068bae 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -253,6 +253,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/unapplied/server/0252-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0251-Expose-attack-cooldown-methods-for-Player.patch similarity index 86% rename from patches/unapplied/server/0252-Expose-attack-cooldown-methods-for-Player.patch rename to patches/server/0251-Expose-attack-cooldown-methods-for-Player.patch index 5f46dcad2d..2279f97625 100644 --- a/patches/unapplied/server/0252-Expose-attack-cooldown-methods-for-Player.patch +++ b/patches/server/0251-Expose-attack-cooldown-methods-for-Player.patch @@ -5,10 +5,10 @@ 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 240f90460ddddf8168b7bc661a55fe7e5c94c67d..b5e85e664dda27c1fb342e47d901909742aec67d 100644 +index 9366cc71807cc88d5dd70138b9ce5d49335731db..42034c3ce08ef4432cb71dfd10dc561bda7c8dc8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2827,6 +2827,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2801,6 +2801,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.adventure$pointers; } diff --git a/patches/unapplied/server/0253-Improve-death-events.patch b/patches/server/0252-Improve-death-events.patch similarity index 90% rename from patches/unapplied/server/0253-Improve-death-events.patch rename to patches/server/0252-Improve-death-events.patch index c541ef2d08..64b2a0fb6d 100644 --- a/patches/unapplied/server/0253-Improve-death-events.patch +++ b/patches/server/0252-Improve-death-events.patch @@ -19,11 +19,11 @@ public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sou public net.minecraft.world.entity.LivingEntity getSoundVolume()F diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index bd7b8ede44a5971b034ffb75fbddbadda8f42702..41e0b2826bae59e48fef7e35caeb3ce6e46031ea 100644 +index 3a9fd9ea736d1b3dbb261158d690e218baa4df96..9f36555177b98f4d66a8b45fc2b3a032c6bbce0d 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -243,6 +243,10 @@ public class ServerPlayer extends Player { - public int latency; +@@ -241,6 +241,10 @@ public class ServerPlayer extends Player { + private int containerCounter; public boolean wonGame; private int containerUpdateDelay; // Paper + // Paper start - cancellable death event @@ -33,7 +33,7 @@ index bd7b8ede44a5971b034ffb75fbddbadda8f42702..41e0b2826bae59e48fef7e35caeb3ce6 // CraftBukkit start public String displayName; -@@ -872,6 +876,15 @@ public class ServerPlayer extends Player { +@@ -831,6 +835,15 @@ public class ServerPlayer extends Player { String deathmessage = defaultMessage.getString(); this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, PaperAdventure.asAdventure(defaultMessage), defaultMessage.getString(), keepInventory); // Paper - Adventure @@ -49,7 +49,7 @@ index bd7b8ede44a5971b034ffb75fbddbadda8f42702..41e0b2826bae59e48fef7e35caeb3ce6 // SPIGOT-943 - only call if they have an inventory open if (this.containerMenu != this.inventoryMenu) { -@@ -1023,8 +1036,17 @@ public class ServerPlayer extends Player { +@@ -982,8 +995,17 @@ public class ServerPlayer extends Player { } } } @@ -70,7 +70,7 @@ index bd7b8ede44a5971b034ffb75fbddbadda8f42702..41e0b2826bae59e48fef7e35caeb3ce6 } } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2f995633e 100644 +index 8f8f343139444cc6fddf0d13083194ec7bbce545..4fdf034205ea0ff9d6803928672b23c185fd3065 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -260,6 +260,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -81,7 +81,7 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2 @Override public float getBukkitYaw() { -@@ -1494,13 +1495,12 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1526,13 +1527,12 @@ public abstract class LivingEntity extends Entity implements Attackable { if (knockbackCancelled) this.level().broadcastEntityEvent(this, (byte) 2); // Paper - Disable explosion knockback if (this.isDeadOrDying()) { if (!this.checkTotemDeathProtection(source)) { @@ -99,7 +99,7 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2 } } else if (flag1) { this.playHurtSound(source); -@@ -1652,7 +1652,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1685,7 +1685,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (!this.isRemoved() && !this.dead) { Entity entity = damageSource.getEntity(); LivingEntity entityliving = this.getKillCredit(); @@ -108,7 +108,7 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2 if (this.deathScore >= 0 && entityliving != null) { entityliving.awardKillScore(this, this.deathScore, damageSource); } -@@ -1664,24 +1664,59 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1697,24 +1697,59 @@ public abstract class LivingEntity extends Entity implements Attackable { if (!this.level().isClientSide && this.hasCustomName()) { if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot } @@ -173,7 +173,7 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2 } } -@@ -1689,7 +1724,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1722,7 +1757,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (!this.level().isClientSide) { boolean flag = false; @@ -182,7 +182,7 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2 if (this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { BlockPos blockposition = this.blockPosition(); BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState(); -@@ -1718,7 +1753,11 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1751,7 +1786,11 @@ public abstract class LivingEntity extends Entity implements Attackable { } } @@ -195,7 +195,7 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2 Entity entity = source.getEntity(); int i; -@@ -1733,18 +1772,27 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1766,18 +1805,27 @@ public abstract class LivingEntity extends Entity implements Attackable { this.dropEquipment(); // CraftBukkit - from below if (this.shouldDropLoot() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { this.dropFromLootTable(source, flag); @@ -225,10 +225,10 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2 // CraftBukkit start public int getExpReward() { diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 2fc099e2fb17073f3ab4ac5e868b1c583bf8a594..3081c1370a0854f07214cbc50b06cbb005d171fb 100644 +index 2b5f5aed31bd235a213f57b9d65b0ea1fae8de08..df0cc02f9bbea857226765c6066a2b945036a0d9 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1068,7 +1068,13 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1076,7 +1076,13 @@ public abstract class Mob extends LivingEntity implements Targeting { } this.spawnAtLocation(itemstack); @@ -243,10 +243,10 @@ index 2fc099e2fb17073f3ab4ac5e868b1c583bf8a594..3081c1370a0854f07214cbc50b06cbb0 } 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 44b6d232d940d4020fa7664e48a483c20959dde0..24ae11d300d0856350f185f03552ba592f3d218a 100644 +index 0d4b86411d2d064b04334b508b1cb65695afaebd..df06cad9447982ebe57d07c9967cb68c6dd20ca3 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java -@@ -706,15 +706,25 @@ public class Fox extends Animal implements VariantHolder { +@@ -712,15 +712,25 @@ public class Fox extends Animal implements VariantHolder { } @Override @@ -274,12 +274,12 @@ index 44b6d232d940d4020fa7664e48a483c20959dde0..24ae11d300d0856350f185f03552ba59 + return deathEvent; // Paper } - public static boolean isPathClear(Fox fox, LivingEntity chasedEntity) { + @Override diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java -index ebe207e2c4d8b7e125fec8a5182fe4882c9339e3..8ac82d3efc0f6d8ff40226e4f8084435c136eba4 100644 +index bb399f775a5530a01f59332848c8ab9b8eceb2b5..14edfe103e61024b569f33de0b6608f39e749319 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java -@@ -69,11 +69,19 @@ public abstract class AbstractChestedHorse extends AbstractHorse { +@@ -70,11 +70,19 @@ public abstract class AbstractChestedHorse extends AbstractHorse { this.spawnAtLocation(Blocks.CHEST); } @@ -301,10 +301,10 @@ index ebe207e2c4d8b7e125fec8a5182fe4882c9339e3..8ac82d3efc0f6d8ff40226e4f8084435 public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7e10b34d7 100644 +index 6483ad071c119353267a4f13b192a50931995c2a..7eecbe85949e47b367014c04d7a37c2cbea80168 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -@@ -491,8 +491,10 @@ public class ArmorStand extends LivingEntity { +@@ -492,8 +492,10 @@ public class ArmorStand extends LivingEntity { } // CraftBukkit end if (source.is(DamageTypeTags.IS_EXPLOSION)) { @@ -317,7 +317,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7 return false; } else if (source.is(DamageTypeTags.IGNITES_ARMOR_STANDS)) { if (this.isOnFire()) { -@@ -536,9 +538,9 @@ public class ArmorStand extends LivingEntity { +@@ -549,9 +551,9 @@ public class ArmorStand extends LivingEntity { this.gameEvent(GameEvent.ENTITY_DAMAGE, source.getEntity()); this.lastHit = i; } else { @@ -329,7 +329,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7 } return true; -@@ -590,8 +592,10 @@ public class ArmorStand extends LivingEntity { +@@ -603,8 +605,10 @@ public class ArmorStand extends LivingEntity { f1 -= amount; if (f1 <= 0.5F) { @@ -342,7 +342,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7 } else { this.setHealth(f1); this.gameEvent(GameEvent.ENTITY_DAMAGE, damageSource.getEntity()); -@@ -599,7 +603,7 @@ public class ArmorStand extends LivingEntity { +@@ -612,7 +616,7 @@ public class ArmorStand extends LivingEntity { } @@ -351,7 +351,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7 ItemStack itemstack = new ItemStack(Items.ARMOR_STAND); if (this.hasCustomName()) { -@@ -607,10 +611,10 @@ public class ArmorStand extends LivingEntity { +@@ -620,10 +624,10 @@ public class ArmorStand extends LivingEntity { } drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops @@ -364,7 +364,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7 this.playBrokenSound(); // this.dropAllDeathLoot(damagesource); // CraftBukkit - moved down -@@ -632,7 +636,7 @@ public class ArmorStand extends LivingEntity { +@@ -645,7 +649,7 @@ public class ArmorStand extends LivingEntity { this.armorItems.set(i, ItemStack.EMPTY); } } @@ -373,7 +373,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7 } -@@ -764,7 +768,16 @@ public class ArmorStand extends LivingEntity { +@@ -772,7 +776,16 @@ public class ArmorStand extends LivingEntity { @Override public void kill() { @@ -392,10 +392,10 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7 this.gameEvent(GameEvent.ENTITY_DIE); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b5e85e664dda27c1fb342e47d901909742aec67d..1c09e955e34380b99572cc5950806417ac10bfc8 100644 +index 42034c3ce08ef4432cb71dfd10dc561bda7c8dc8..874f515eb8cf7bc3fa2e37f09993fd4454ec089e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2327,7 +2327,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2301,7 +2301,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void sendHealthUpdate() { FoodData foodData = this.getHandle().getFoodData(); @@ -412,10 +412,10 @@ index b5e85e664dda27c1fb342e47d901909742aec67d..1c09e955e34380b99572cc5950806417 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 53af54ffecd7fdb20588d75a8c32003cb89a75b1..eaca76dfec9cbe3cbb9972a0c9cf30599816fcda 100644 +index f423e98fccb7712f7d989ee5780dd5e7b824255f..01ce54dba8c3efcc147b694ba57e070686375f68 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -863,9 +863,16 @@ public class CraftEventFactory { +@@ -865,9 +865,16 @@ public class CraftEventFactory { public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, List drops) { CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity(); EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward()); @@ -432,7 +432,7 @@ index 53af54ffecd7fdb20588d75a8c32003cb89a75b1..eaca76dfec9cbe3cbb9972a0c9cf3059 victim.expToDrop = event.getDroppedExp(); for (org.bukkit.inventory.ItemStack stack : event.getDrops()) { -@@ -882,8 +889,15 @@ public class CraftEventFactory { +@@ -884,8 +891,15 @@ public class CraftEventFactory { PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage, stringDeathMessage); // Paper - Adventure event.setKeepInventory(keepInventory); event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel @@ -448,7 +448,7 @@ index 53af54ffecd7fdb20588d75a8c32003cb89a75b1..eaca76dfec9cbe3cbb9972a0c9cf3059 victim.keepLevel = event.getKeepLevel(); victim.newLevel = event.getNewLevel(); -@@ -900,6 +914,31 @@ public class CraftEventFactory { +@@ -902,6 +916,31 @@ public class CraftEventFactory { return event; } diff --git a/patches/unapplied/server/0254-Allow-chests-to-be-placed-with-NBT-data.patch b/patches/server/0253-Allow-chests-to-be-placed-with-NBT-data.patch similarity index 91% rename from patches/unapplied/server/0254-Allow-chests-to-be-placed-with-NBT-data.patch rename to patches/server/0253-Allow-chests-to-be-placed-with-NBT-data.patch index 1fad6b599e..348aba5a8b 100644 --- a/patches/unapplied/server/0254-Allow-chests-to-be-placed-with-NBT-data.patch +++ b/patches/server/0253-Allow-chests-to-be-placed-with-NBT-data.patch @@ -5,10 +5,10 @@ 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 c33660718c0ea281d7bcdb15df0568d4d46547e2..0caf3eeb7984e842f7a0bdfed3021d0b231a0dd0 100644 +index cae548dbb5a3027e2de0bfbe38918ec7c2803e8e..77db59d433d4189f96b9da006898bded5edbb0ba 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -381,6 +381,7 @@ public final class ItemStack { +@@ -386,6 +386,7 @@ public final class ItemStack { enuminteractionresult = InteractionResult.FAIL; // cancel placement // PAIL: Remove this when MC-99075 fixed placeEvent.getPlayer().updateInventory(); diff --git a/patches/unapplied/server/0255-Mob-Pathfinding-API.patch b/patches/server/0254-Mob-Pathfinding-API.patch similarity index 98% rename from patches/unapplied/server/0255-Mob-Pathfinding-API.patch rename to patches/server/0254-Mob-Pathfinding-API.patch index 3021c06d6e..e8e958cebd 100644 --- a/patches/unapplied/server/0255-Mob-Pathfinding-API.patch +++ b/patches/server/0254-Mob-Pathfinding-API.patch @@ -160,10 +160,10 @@ index 0000000000000000000000000000000000000000..064712e7b27a200b29c72076a82f4f56 + } +} diff --git a/src/main/java/net/minecraft/world/level/pathfinder/Path.java b/src/main/java/net/minecraft/world/level/pathfinder/Path.java -index 4ad2ac8d1e9111933fa58c47442fa1f5e8173fd3..2a335f277bd0e4b8ad0f60d8226eb8aaa80a871f 100644 +index 539dc45c3c7ffc60cf3fb47ae4df65e604e8627b..eea4c932d909145e7af848cf76e3f49dbb2deff2 100644 --- a/src/main/java/net/minecraft/world/level/pathfinder/Path.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/Path.java -@@ -21,6 +21,7 @@ public class Path { +@@ -18,6 +18,7 @@ public class Path { private final BlockPos target; private final float distToTarget; private final boolean reached; diff --git a/patches/unapplied/server/0256-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/patches/server/0255-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch similarity index 100% rename from patches/unapplied/server/0256-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch rename to patches/server/0255-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch diff --git a/patches/unapplied/server/0257-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch b/patches/server/0256-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch similarity index 100% rename from patches/unapplied/server/0257-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch rename to patches/server/0256-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch diff --git a/patches/unapplied/server/0258-Prevent-mob-spawning-from-loading-generating-chunks.patch b/patches/server/0257-Prevent-mob-spawning-from-loading-generating-chunks.patch similarity index 95% rename from patches/unapplied/server/0258-Prevent-mob-spawning-from-loading-generating-chunks.patch rename to patches/server/0257-Prevent-mob-spawning-from-loading-generating-chunks.patch index e96efae246..4a0e2020ca 100644 --- a/patches/unapplied/server/0258-Prevent-mob-spawning-from-loading-generating-chunks.patch +++ b/patches/server/0257-Prevent-mob-spawning-from-loading-generating-chunks.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Prevent mob spawning from loading/generating chunks also prevents if out of world border bounds diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 6ac513d3044fab1cb1ca0b0c7e85ff871d49d572..2503d4691e47083a9d99a38c4ed3f50a2374821a 100644 +index b3a7d065900f63b15ee2a8e3c1d69d5513f7b85c..9ed7abddf30d298a5abb04974efd1b470d015b09 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java @@ -170,9 +170,9 @@ public final class NaturalSpawner { diff --git a/patches/unapplied/server/0259-Implement-furnace-cook-speed-multiplier-API.patch b/patches/server/0258-Implement-furnace-cook-speed-multiplier-API.patch similarity index 86% rename from patches/unapplied/server/0259-Implement-furnace-cook-speed-multiplier-API.patch rename to patches/server/0258-Implement-furnace-cook-speed-multiplier-API.patch index 97b17392e3..4afc712bed 100644 --- a/patches/unapplied/server/0259-Implement-furnace-cook-speed-multiplier-API.patch +++ b/patches/server/0258-Implement-furnace-cook-speed-multiplier-API.patch @@ -11,7 +11,7 @@ to the nearest Integer when updating its current cook time. Modified by: Eric Su 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 d56a64b058d8848e405e33d9884a61ea952a8f71..40dc29288a13ae9c1f8b0434922fdb5c7d02daa9 100644 +index 2f628f36c32752d1bac910e180b90639c1ae2c9d..d7a89c2b70de20f632ee210780ede0bc36369710 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 @@ -77,11 +77,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -58,7 +58,7 @@ index d56a64b058d8848e405e33d9884a61ea952a8f71..40dc29288a13ae9c1f8b0434922fdb5c @@ -359,7 +368,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit CraftItemStack source = CraftItemStack.asCraftMirror(blockEntity.items.get(0)); - CookingRecipe recipe = (CookingRecipe) irecipe.toBukkitRecipe(); + CookingRecipe recipe = (CookingRecipe) recipeholder.toBukkitRecipe(); - FurnaceStartSmeltEvent event = new FurnaceStartSmeltEvent(CraftBlock.at(world, pos), source, recipe); + FurnaceStartSmeltEvent event = new FurnaceStartSmeltEvent(CraftBlock.at(world, pos), source, recipe, AbstractFurnaceBlockEntity.getTotalCookTime(world, blockEntity.recipeType, blockEntity, blockEntity.cookSpeedMultiplier)); // Paper - cook speed multiplier API @@ -74,26 +74,28 @@ index d56a64b058d8848e405e33d9884a61ea952a8f71..40dc29288a13ae9c1f8b0434922fdb5c blockEntity.cookingProgress = 0; - blockEntity.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(world, blockEntity); + blockEntity.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(world, blockEntity.recipeType, blockEntity, blockEntity.cookSpeedMultiplier); // Paper - if (AbstractFurnaceBlockEntity.burn(blockEntity.level, blockEntity.worldPosition, world.registryAccess(), irecipe, blockEntity.items, i)) { // CraftBukkit - blockEntity.setRecipeUsed(irecipe); + if (AbstractFurnaceBlockEntity.burn(blockEntity.level, blockEntity.worldPosition, world.registryAccess(), recipeholder, blockEntity.items, i)) { // CraftBukkit + blockEntity.setRecipeUsed(recipeholder); } -@@ -469,9 +478,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -469,11 +478,12 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit } } - private static int getTotalCookTime(Level world, AbstractFurnaceBlockEntity furnace) { -- return (world != null) ? (Integer) furnace.quickCheck.getRecipeFor(furnace, world).map(AbstractCookingRecipe::getCookingTime).orElse(200) : 200; // CraftBukkit - SPIGOT-4302 +- if (world == null) return 200; // CraftBukkit - SPIGOT-4302 +- return (Integer) furnace.quickCheck.getRecipeFor(furnace, world).map((recipeholder) -> { +- return ((AbstractCookingRecipe) recipeholder.value()).getCookingTime(); +- }).orElse(200); + // Paper start + public static int getTotalCookTime(@Nullable Level world, RecipeType recipeType, AbstractFurnaceBlockEntity furnace, double cookSpeedMultiplier) { + /* Scale the recipe's cooking time to the current cookSpeedMultiplier */ -+ int cookTime = world != null ? furnace.quickCheck.getRecipeFor(furnace, world).map(AbstractCookingRecipe::getCookingTime).orElse(200) : (net.minecraft.server.MinecraftServer.getServer().getRecipeManager().getRecipeFor(recipeType, furnace, world /* passing a null level here is safe. world is only used for map extending recipes which won't happen here */).map(AbstractCookingRecipe::getCookingTime).orElse(200)); ++ int cookTime = world != null ? furnace.quickCheck.getRecipeFor(furnace, world).map(holder -> holder.value().getCookingTime()).orElse(200) : (net.minecraft.server.MinecraftServer.getServer().getRecipeManager().getRecipeFor(recipeType, furnace, world /* passing a null level here is safe. world is only used for map extending recipes which won't happen here */).map(holder -> holder.value().getCookingTime()).orElse(200)); + return (int) Math.ceil (cookTime / cookSpeedMultiplier); ++ // Paper end } -+ // Paper end public static boolean isFuel(ItemStack stack) { - return AbstractFurnaceBlockEntity.getFuel().containsKey(stack.getItem()); -@@ -540,7 +553,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -543,7 +553,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit } if (slot == 0 && !flag) { diff --git a/patches/unapplied/server/0260-Honor-EntityAgeable.ageLock.patch b/patches/server/0259-Honor-EntityAgeable.ageLock.patch similarity index 100% rename from patches/unapplied/server/0260-Honor-EntityAgeable.ageLock.patch rename to patches/server/0259-Honor-EntityAgeable.ageLock.patch diff --git a/patches/unapplied/server/0261-Configurable-connection-throttle-kick-message.patch b/patches/server/0260-Configurable-connection-throttle-kick-message.patch similarity index 94% rename from patches/unapplied/server/0261-Configurable-connection-throttle-kick-message.patch rename to patches/server/0260-Configurable-connection-throttle-kick-message.patch index 534b0eb1cc..01647cb733 100644 --- a/patches/unapplied/server/0261-Configurable-connection-throttle-kick-message.patch +++ b/patches/server/0260-Configurable-connection-throttle-kick-message.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable connection throttle kick message diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -index a3b610cb1ed97a635677bc46ccdf0463c9918585..94b062874ef9d4935a7ad2c7b45b2e6b786eaa81 100644 +index 17f01fa589cb7c4eff4233a27e60a5928cbd604d..1cdcb62ead4b9f2e88f1e282813d990ddf2297a5 100644 --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java @@ -51,7 +51,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL diff --git a/patches/unapplied/server/0262-Prevent-chunk-loading-from-Fluid-Flowing.patch b/patches/server/0261-Prevent-chunk-loading-from-Fluid-Flowing.patch similarity index 92% rename from patches/unapplied/server/0262-Prevent-chunk-loading-from-Fluid-Flowing.patch rename to patches/server/0261-Prevent-chunk-loading-from-Fluid-Flowing.patch index 8f748f1408..2a66b5c9da 100644 --- a/patches/unapplied/server/0262-Prevent-chunk-loading-from-Fluid-Flowing.patch +++ b/patches/server/0261-Prevent-chunk-loading-from-Fluid-Flowing.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent chunk loading from Fluid Flowing diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java -index fbf699e777d45db3dcf1606d34f509ca1a5bbb7a..c694b16be7c276fbf34aed2fd2aa6d6b79625561 100644 +index 818c83934a97c4b2ad4db69f4b0fcf0a500ea918..f7527ed1d47901e52df4e3fffbdcd838782c90db 100644 --- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java +++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java -@@ -175,7 +175,8 @@ public abstract class FlowingFluid extends Fluid { +@@ -176,7 +176,8 @@ public abstract class FlowingFluid extends Fluid { Direction enumdirection = (Direction) entry.getKey(); FluidState fluid1 = (FluidState) entry.getValue(); BlockPos blockposition1 = pos.relative(enumdirection); @@ -18,7 +18,7 @@ index fbf699e777d45db3dcf1606d34f509ca1a5bbb7a..c694b16be7c276fbf34aed2fd2aa6d6b if (this.canSpreadTo(world, pos, blockState, enumdirection, blockposition1, iblockdata1, world.getFluidState(blockposition1), fluid1.getType())) { // CraftBukkit start -@@ -202,7 +203,9 @@ public abstract class FlowingFluid extends Fluid { +@@ -203,7 +204,9 @@ public abstract class FlowingFluid extends Fluid { while (iterator.hasNext()) { Direction enumdirection = (Direction) iterator.next(); BlockPos blockposition1 = pos.relative(enumdirection); @@ -29,7 +29,7 @@ index fbf699e777d45db3dcf1606d34f509ca1a5bbb7a..c694b16be7c276fbf34aed2fd2aa6d6b FluidState fluid = iblockdata1.getFluidState(); if (fluid.getType().isSame(this) && this.canPassThroughWall(enumdirection, world, pos, state, blockposition1, iblockdata1)) { -@@ -319,11 +322,18 @@ public abstract class FlowingFluid extends Fluid { +@@ -320,11 +323,18 @@ public abstract class FlowingFluid extends Fluid { if (enumdirection1 != direction) { BlockPos blockposition2 = pos.relative(enumdirection1); short short0 = FlowingFluid.getCacheKey(fromPos, blockposition2); @@ -52,7 +52,7 @@ index fbf699e777d45db3dcf1606d34f509ca1a5bbb7a..c694b16be7c276fbf34aed2fd2aa6d6b BlockState iblockdata1 = (BlockState) pair.getFirst(); FluidState fluid = (FluidState) pair.getSecond(); -@@ -395,11 +405,16 @@ public abstract class FlowingFluid extends Fluid { +@@ -396,11 +406,16 @@ public abstract class FlowingFluid extends Fluid { Direction enumdirection = (Direction) iterator.next(); BlockPos blockposition1 = pos.relative(enumdirection); short short0 = FlowingFluid.getCacheKey(pos, blockposition1); diff --git a/patches/unapplied/server/0263-Hook-into-CB-plugin-rewrites.patch b/patches/server/0262-Hook-into-CB-plugin-rewrites.patch similarity index 100% rename from patches/unapplied/server/0263-Hook-into-CB-plugin-rewrites.patch rename to patches/server/0262-Hook-into-CB-plugin-rewrites.patch diff --git a/patches/unapplied/server/0264-PreSpawnerSpawnEvent.patch b/patches/server/0263-PreSpawnerSpawnEvent.patch similarity index 100% rename from patches/unapplied/server/0264-PreSpawnerSpawnEvent.patch rename to patches/server/0263-PreSpawnerSpawnEvent.patch diff --git a/patches/unapplied/server/0265-Add-LivingEntity-getTargetEntity.patch b/patches/server/0264-Add-LivingEntity-getTargetEntity.patch similarity index 95% rename from patches/unapplied/server/0265-Add-LivingEntity-getTargetEntity.patch rename to patches/server/0264-Add-LivingEntity-getTargetEntity.patch index 20032d4569..05ddea3a69 100644 --- a/patches/unapplied/server/0265-Add-LivingEntity-getTargetEntity.patch +++ b/patches/server/0264-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 d84375984c67a8ad2790efc1c584f7e2f995633e..f800b3e4debcd141a75de9e6025a87e81cee083c 100644 +index 4fdf034205ea0ff9d6803928672b23c185fd3065..ffed90c0fc1240fc10b4cdd8df8377647b75beda 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 d84375984c67a8ad2790efc1c584f7e2f995633e..f800b3e4debcd141a75de9e6025a87e8 import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; import net.minecraft.world.scores.PlayerTeam; -@@ -3833,6 +3834,38 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3892,6 +3893,38 @@ public abstract class LivingEntity extends Entity implements Attackable { return this.level().clip(raytrace); } @@ -56,7 +56,7 @@ index d84375984c67a8ad2790efc1c584f7e2f995633e..f800b3e4debcd141a75de9e6025a87e8 public int getShieldBlockingDelay() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 0707329670292551d966afe30818f17d079fcb3b..2913ad431b09a75106115257729960f8ba1637f4 100644 +index 3d9e4ebb29f670d32bfe044ad22daaf82313498d..d5f53ddf1bb24c933bf38efbe142411663ec2470 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -1,5 +1,6 @@ diff --git a/patches/unapplied/server/0266-Add-sun-related-API.patch b/patches/server/0265-Add-sun-related-API.patch similarity index 90% rename from patches/unapplied/server/0266-Add-sun-related-API.patch rename to patches/server/0265-Add-sun-related-API.patch index 46beb73be4..54c247facb 100644 --- a/patches/unapplied/server/0266-Add-sun-related-API.patch +++ b/patches/server/0265-Add-sun-related-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add sun related API public net.minecraft.world.entity.Mob isSunBurnTick()Z diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 57f9324aa73be4fcbb9668ef7be6b6e64d57800e..be17e1a4afc2fd5490a59aa7bcb199fb61643d35 100644 +index b7c5d1c9db8284e2ed51da603ebed36be1563046..7d9942004b52b4deae7ca09dafb43795d0d9c31d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -692,6 +692,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -702,6 +702,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { } } diff --git a/patches/unapplied/server/0267-Catch-JsonParseException-in-Entity-and-TE-names.patch b/patches/server/0266-Catch-JsonParseException-in-Entity-and-TE-names.patch similarity index 81% rename from patches/unapplied/server/0267-Catch-JsonParseException-in-Entity-and-TE-names.patch rename to patches/server/0266-Catch-JsonParseException-in-Entity-and-TE-names.patch index 4deee947dd..31dae70550 100644 --- a/patches/unapplied/server/0267-Catch-JsonParseException-in-Entity-and-TE-names.patch +++ b/patches/server/0266-Catch-JsonParseException-in-Entity-and-TE-names.patch @@ -13,40 +13,29 @@ Shulkers) may need to be changed in order for it to re-save properly No more crashing though. diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java -index 82a1a87822e3fc323b92e1aa30ddb0cdb351d89c..c69088a2ec374b2d236fec61e267f42afa2967b1 100644 +index ff8876b7e7cc2172a2cb5e12d6836b9875cc9aa1..b9949b44553a8ac91565b6e614ac7bd7cd140dd0 100644 --- a/src/main/java/io/papermc/paper/util/MCUtil.java +++ b/src/main/java/io/papermc/paper/util/MCUtil.java -@@ -18,6 +18,8 @@ import net.minecraft.core.BlockPos; - import net.minecraft.core.Direction; - import net.minecraft.core.Vec3i; - import net.minecraft.server.MinecraftServer; -+import net.minecraft.nbt.CompoundTag; -+import net.minecraft.network.chat.Component; - import net.minecraft.server.level.ChunkHolder; - import net.minecraft.server.level.ChunkMap; - import net.minecraft.server.level.DistanceManager; -@@ -551,6 +553,21 @@ public final class MCUtil { - } +@@ -538,4 +538,19 @@ public final class MCUtil { + public static int getTicketLevelFor(net.minecraft.world.level.chunk.ChunkStatus status) { + return net.minecraft.server.level.ChunkMap.MAX_VIEW_DISTANCE + net.minecraft.world.level.chunk.ChunkStatus.getDistance(status); } - ++ + @Nullable -+ public static Component getBaseComponentFromNbt(String key, CompoundTag compound) { ++ public static net.minecraft.network.chat.Component getBaseComponentFromNbt(String key, net.minecraft.nbt.CompoundTag compound) { + if (!compound.contains(key)) { + return null; + } + String string = compound.getString(key); + try { -+ return Component.Serializer.fromJson(string); ++ return net.minecraft.network.chat.Component.Serializer.fromJson(string); + } catch (com.google.gson.JsonParseException e) { + org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage()); + } + + return null; + } -+ - public static ChunkStatus getChunkStatus(ChunkHolder chunk) { - return chunk.getChunkHolderStatus(); - } + } diff --git a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java index 7f1efe0d9bc059a86166e8e3c5ef4ad23217f6a7..9c7b7434ccd64668eb5d7bb61d03a9cb4105ea6e 100644 --- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java @@ -61,7 +50,7 @@ index 7f1efe0d9bc059a86166e8e3c5ef4ad23217f6a7..9c7b7434ccd64668eb5d7bb61d03a9cb if (nbt.contains("TrackOutput", 1)) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java -index 6b983e3e867bdd8cdffaf4575bbf67ad96b57ec7..66e2137f9379e885294f2b9f67f7e35296792770 100644 +index c6194fa1611412ac119fed493d5eab5a160e593d..d89037a83ae1b6d2afa6a589c1b8098cbedf3d2d 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java @@ -98,7 +98,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable { @@ -87,12 +76,12 @@ index e85022b31f2bc2783e88f5ba4c5173ac8a096c96..f1acd19432877a833f0d4339f9de4830 } diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index 8b79df496e1fad57e8c5c0aa97d0d84ab0deed1e..154e4652a93b50e9b26c93531a4e854601ed75e1 100644 +index 18349957bd6d1a4bc21aff781a791f912dddff1d..cd28ee0cbc69713a641a21c9a626c694a4bcbfc9 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -@@ -367,7 +367,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name - this.levels = nbt.getInt("Levels"); // SPIGOT-5053, use where available - // CraftBukkit end +@@ -389,7 +389,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name + this.secondaryPower = BeaconBlockEntity.loadEffect(nbt, "secondary_effect"); + this.levels = nbt.getInt("Levels"); // CraftBukkit - SPIGOT-5053, use where available if (nbt.contains("CustomName", 8)) { - this.name = Component.Serializer.fromJson(nbt.getString("CustomName")); + this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException diff --git a/patches/unapplied/server/0268-Turtle-API.patch b/patches/server/0267-Turtle-API.patch similarity index 96% rename from patches/unapplied/server/0268-Turtle-API.patch rename to patches/server/0267-Turtle-API.patch index 27129d8957..89bc808f04 100644 --- a/patches/unapplied/server/0268-Turtle-API.patch +++ b/patches/server/0267-Turtle-API.patch @@ -25,10 +25,10 @@ index 60e291abb3ebdf8676c13a2138d8eb436d033fa2..d27e5f9dac4703b839ab8444f6b54bf5 private final int searchRange; private final int verticalSearchRange; diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -index 3a3f5e567fdefad6887e42c8e9147194ae0c4d89..fd6ce6e8a3a7c889276e06fb427e0d17ed093149 100644 +index ed1f6e77d5fc9b6f5f52b1a10275783b514c162c..652a8150f7343050b6da6c01f4e73a755138d491 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -@@ -487,14 +487,18 @@ public class Turtle extends Animal { +@@ -496,14 +496,18 @@ public class Turtle extends Animal { if (!this.turtle.isInWater() && this.isReachedTarget()) { if (this.turtle.layEggCounter < 1) { @@ -50,7 +50,7 @@ index 3a3f5e567fdefad6887e42c8e9147194ae0c4d89..fd6ce6e8a3a7c889276e06fb427e0d17 world.setBlock(blockposition1, iblockdata, 3); world.gameEvent(GameEvent.BLOCK_PLACE, blockposition1, GameEvent.Context.of(this.turtle, iblockdata)); -@@ -564,7 +568,7 @@ public class Turtle extends Animal { +@@ -573,7 +577,7 @@ public class Turtle extends Animal { @Override public boolean canUse() { diff --git a/patches/unapplied/server/0269-Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/0268-Call-player-spectator-target-events-and-improve-impl.patch similarity index 91% rename from patches/unapplied/server/0269-Call-player-spectator-target-events-and-improve-impl.patch rename to patches/server/0268-Call-player-spectator-target-events-and-improve-impl.patch index 64867b6055..1c9a88c431 100644 --- a/patches/unapplied/server/0269-Call-player-spectator-target-events-and-improve-impl.patch +++ b/patches/server/0268-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 41e0b2826bae59e48fef7e35caeb3ce6e46031ea..040f93638d3c71fb8f23301b8903e7cfda980e5d 100644 +index 9f36555177b98f4d66a8b45fc2b3a032c6bbce0d..ddc3522e38b3bafb3c3b32492d842d588efd1495 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1978,6 +1978,19 @@ public class ServerPlayer extends Player { +@@ -1942,6 +1942,19 @@ public class ServerPlayer extends Player { this.camera = (Entity) (entity == null ? this : entity); if (entity1 != this.camera) { @@ -42,7 +42,7 @@ index 41e0b2826bae59e48fef7e35caeb3ce6e46031ea..040f93638d3c71fb8f23301b8903e7cf Level world = this.camera.level(); if (world instanceof ServerLevel) { -@@ -1993,7 +2006,6 @@ public class ServerPlayer extends Player { +@@ -1957,7 +1970,6 @@ public class ServerPlayer extends Player { this.connection.send(new ClientboundSetCameraPacket(this.camera)); this.connection.resetPosition(); } diff --git a/patches/unapplied/server/0270-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch b/patches/server/0269-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch similarity index 100% rename from patches/unapplied/server/0270-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch rename to patches/server/0269-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch diff --git a/patches/unapplied/server/0271-Add-more-Witch-API.patch b/patches/server/0270-Add-more-Witch-API.patch similarity index 94% rename from patches/unapplied/server/0271-Add-more-Witch-API.patch rename to patches/server/0270-Add-more-Witch-API.patch index 7fd4790d82..5de246f125 100644 --- a/patches/unapplied/server/0271-Add-more-Witch-API.patch +++ b/patches/server/0270-Add-more-Witch-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add more Witch API public net.minecraft.world.entity.monster.Witch usingTime diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java -index df024c3108df807772fc487f5c59004a59938bf2..701f6bf1d558cf0ec4bc1abb9e1f66d96ea5a6c9 100644 +index ca24b592273208e61e0e0ba59b7e5a3c11ebf952..580dff41d746d9591f718081d9dfe4ac77e7eeaa 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Witch.java +++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java -@@ -157,21 +157,11 @@ public class Witch extends Raider implements RangedAttackMob { +@@ -160,21 +160,10 @@ public class Witch extends Raider implements RangedAttackMob { } if (potionregistry != null) { @@ -28,13 +28,13 @@ index df024c3108df807772fc487f5c59004a59938bf2..701f6bf1d558cf0ec4bc1abb9e1f66d9 - } - - AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); - -- attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING); +- +- attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.getId()); - attributemodifiable.addTransientModifier(Witch.SPEED_MODIFIER_DRINKING); } } -@@ -183,6 +173,24 @@ public class Witch extends Raider implements RangedAttackMob { +@@ -186,6 +175,24 @@ public class Witch extends Raider implements RangedAttackMob { super.aiStep(); } @@ -51,7 +51,7 @@ index df024c3108df807772fc487f5c59004a59938bf2..701f6bf1d558cf0ec4bc1abb9e1f66d9 + + AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); + -+ attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING); ++ attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.getId()); + attributemodifiable.addTransientModifier(Witch.SPEED_MODIFIER_DRINKING); + } + // Paper end diff --git a/patches/unapplied/server/0272-Check-Drowned-for-Villager-Aggression-Config.patch b/patches/server/0271-Check-Drowned-for-Villager-Aggression-Config.patch similarity index 100% rename from patches/unapplied/server/0272-Check-Drowned-for-Villager-Aggression-Config.patch rename to patches/server/0271-Check-Drowned-for-Villager-Aggression-Config.patch diff --git a/patches/unapplied/server/0273-Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/0272-Add-option-to-prevent-players-from-moving-into-unloa.patch similarity index 90% rename from patches/unapplied/server/0273-Add-option-to-prevent-players-from-moving-into-unloa.patch rename to patches/server/0272-Add-option-to-prevent-players-from-moving-into-unloa.patch index 39dfd45c36..5c4d6841b8 100644 --- a/patches/unapplied/server/0273-Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/patches/server/0272-Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9092a04f7a98f022c9a9bfe5310643b4b89ce2e7..585376aecc7329975a5d3e6b7c091f5b14daebd2 100644 +index 423390ff2508ab9af804925044142ea289068bae..a0e1010066b34650f5c554bfa8324ed0621f77f0 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -569,9 +569,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -466,9 +466,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d0 = entity.getX(); double d1 = entity.getY(); double d2 = entity.getZ(); @@ -22,7 +22,7 @@ index 9092a04f7a98f022c9a9bfe5310643b4b89ce2e7..585376aecc7329975a5d3e6b7c091f5b float f = Mth.wrapDegrees(packet.getYRot()); float f1 = Mth.wrapDegrees(packet.getXRot()); double d6 = d3 - this.vehicleFirstGoodX; -@@ -606,6 +606,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -503,6 +503,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } speed *= 2f; // TODO: Get the speed of the vehicle instead of the player @@ -39,7 +39,7 @@ index 9092a04f7a98f022c9a9bfe5310643b4b89ce2e7..585376aecc7329975a5d3e6b7c091f5b 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! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8}); -@@ -1259,9 +1269,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1149,9 +1159,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.allowedPlayerTicks = 20; // CraftBukkit } else { this.awaitingTeleportTime = this.tickCount; @@ -52,7 +52,7 @@ index 9092a04f7a98f022c9a9bfe5310643b4b89ce2e7..585376aecc7329975a5d3e6b7c091f5b float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot())); float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot())); -@@ -1316,6 +1326,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1206,6 +1216,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } else { speed = this.player.getAbilities().walkingSpeed * 10f; } diff --git a/patches/unapplied/server/0274-Reset-players-airTicks-on-respawn.patch b/patches/server/0273-Reset-players-airTicks-on-respawn.patch similarity index 83% rename from patches/unapplied/server/0274-Reset-players-airTicks-on-respawn.patch rename to patches/server/0273-Reset-players-airTicks-on-respawn.patch index 4733f523e6..63d5c3d162 100644 --- a/patches/unapplied/server/0274-Reset-players-airTicks-on-respawn.patch +++ b/patches/server/0273-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 040f93638d3c71fb8f23301b8903e7cfda980e5d..715314de7a92a8e06f82c6bff5fe74e3b23044f8 100644 +index ddc3522e38b3bafb3c3b32492d842d588efd1495..10044e1d596665b8f8b88f0baf1c61c8d3af0c4e 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2454,6 +2454,7 @@ public class ServerPlayer extends Player { +@@ -2414,6 +2414,7 @@ public class ServerPlayer extends Player { this.setHealth(this.getMaxHealth()); this.stopUsingItem(); // CraftBukkit - SPIGOT-6682: Clear active item on reset diff --git a/patches/unapplied/server/0275-Don-t-sleep-after-profile-lookups-if-not-needed.patch b/patches/server/0274-Don-t-sleep-after-profile-lookups-if-not-needed.patch similarity index 71% rename from patches/unapplied/server/0275-Don-t-sleep-after-profile-lookups-if-not-needed.patch rename to patches/server/0274-Don-t-sleep-after-profile-lookups-if-not-needed.patch index c4f99ad87b..48b4bba2b0 100644 --- a/patches/unapplied/server/0275-Don-t-sleep-after-profile-lookups-if-not-needed.patch +++ b/patches/server/0274-Don-t-sleep-after-profile-lookups-if-not-needed.patch @@ -7,20 +7,20 @@ Mojang was sleeping even if we had no more requests to go after the current one finished, resulting in 100ms lost per profile lookup diff --git a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java -index cc38e909d1fa83206fa09666599d853a6e89ef36..c48a40155108b6bae18073638a0ba12649344261 100644 +index da26c2e6c5ff88b50606e94cfbff5725da37ac7f..f3e8552e651faf6f50ca1cb66415c8d4484a7f27 100644 --- a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java +++ b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java -@@ -43,6 +43,7 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { - } +@@ -44,6 +44,7 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { + .collect(Collectors.toSet()); final int page = 0; + boolean hasRequested = false; // Paper for (final List request : Iterables.partition(criteria, ENTRIES_PER_PAGE)) { - int failCount = 0; -@@ -68,6 +69,12 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { + final List normalizedRequest = request.stream().map(YggdrasilGameProfileRepository::normalizeName).toList(); +@@ -75,6 +76,12 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { LOGGER.debug("Couldn't find profile {}", name); - callback.onProfileLookupFailed(new GameProfile(null, name), new ProfileNotFoundException("Server did not find the requested profile")); + callback.onProfileLookupFailed(name, new ProfileNotFoundException("Server did not find the requested profile")); } + // Paper start + if (!hasRequested) { diff --git a/patches/unapplied/server/0276-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/patches/server/0275-Improve-Server-Thread-Pool-and-Thread-Priorities.patch similarity index 93% rename from patches/unapplied/server/0276-Improve-Server-Thread-Pool-and-Thread-Priorities.patch rename to patches/server/0275-Improve-Server-Thread-Pool-and-Thread-Priorities.patch index 518734b0a5..a1cd74fc4a 100644 --- a/patches/unapplied/server/0276-Improve-Server-Thread-Pool-and-Thread-Priorities.patch +++ b/patches/server/0275-Improve-Server-Thread-Pool-and-Thread-Priorities.patch @@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..b60f59cf5cc8eb84a6055b7861857dec + } +} diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java -index 0f05d26248d8c999048a88796df227a6a1e3755f..7354711e194ab58b11b68f447c1fc795fe611a65 100644 +index 30237ca94a36197ce21369bdcc7bb1dfafe02680..5e9401f0c2de0743aca9237ee8c4dfba586cfdb9 100644 --- a/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java @@ -81,7 +81,7 @@ public class Util { @@ -47,7 +47,7 @@ index 0f05d26248d8c999048a88796df227a6a1e3755f..7354711e194ab58b11b68f447c1fc795 // Paper start - don't submit BLOCKING PROFILE LOOKUPS to the world gen thread public static final ExecutorService PROFILE_EXECUTOR = Executors.newFixedThreadPool(2, new java.util.concurrent.ThreadFactory() { -@@ -144,14 +144,18 @@ public class Util { +@@ -145,14 +145,18 @@ public class Util { return FILENAME_DATE_TIME_FORMATTER.format(ZonedDateTime.now()); } @@ -70,7 +70,7 @@ index 0f05d26248d8c999048a88796df227a6a1e3755f..7354711e194ab58b11b68f447c1fc795 @Override protected void onTermination(Throwable throwable) { if (throwable != null) { -@@ -167,6 +171,7 @@ public class Util { +@@ -168,6 +172,7 @@ public class Util { return forkJoinWorkerThread; }, Util::onThreadException, true); } @@ -79,10 +79,10 @@ index 0f05d26248d8c999048a88796df227a6a1e3755f..7354711e194ab58b11b68f447c1fc795 return executorService; } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d05f776204a720084a583c6d6dfe47936761b6e3..e5ab15722fe640d4766b9a24fb82b1d60f15a241 100644 +index 715ebeb36f0620eaeafa63bf87a30e63363069a3..c2a2985362672aba907039907605b3ea3e53262c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -311,6 +311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { MinecraftServer.LOGGER.error("Uncaught exception in server thread", throwable); }); diff --git a/patches/unapplied/server/0277-Optimize-World-Time-Updates.patch b/patches/server/0276-Optimize-World-Time-Updates.patch similarity index 94% rename from patches/unapplied/server/0277-Optimize-World-Time-Updates.patch rename to patches/server/0276-Optimize-World-Time-Updates.patch index d542189ef4..5857b16844 100644 --- a/patches/unapplied/server/0277-Optimize-World-Time-Updates.patch +++ b/patches/server/0276-Optimize-World-Time-Updates.patch @@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet object for every player unless they have per-player time enabled. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e5ab15722fe640d4766b9a24fb82b1d60f15a241..1a74b7c252d16e5ab2c303e6e96c62e78ef9311c 100644 +index c2a2985362672aba907039907605b3ea3e53262c..0f50236866984efd7b8cb95373215b240117be0d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1386,12 +1386,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> { +@@ -144,6 +144,22 @@ public class Connection extends SimpleChannelInboundHandler> { } public void exceptionCaught(ChannelHandlerContext channelhandlercontext, Throwable throwable) { + // Paper start + if (throwable instanceof io.netty.handler.codec.EncoderException && throwable.getCause() instanceof PacketEncoder.PacketTooLargeException packetTooLargeException) { -+ if (packetTooLargeException.getPacket().packetTooLarge(this)) { ++ final Packet packet = packetTooLargeException.getPacket(); ++ final io.netty.util.Attribute> codecDataAttribute = channelhandlercontext.channel().attr(packetTooLargeException.codecKey); ++ if (packet.packetTooLarge(this)) { ++ ProtocolSwapHandler.swapProtocolIfNeeded(codecDataAttribute, packet); + return; -+ } else if (packetTooLargeException.getPacket().isSkippable()) { ++ } else if (packet.isSkippable()) { + Connection.LOGGER.debug("Skipping packet due to errors", throwable.getCause()); ++ ProtocolSwapHandler.swapProtocolIfNeeded(codecDataAttribute, packet); + return; + } else { + throwable = throwable.getCause(); @@ -30,29 +34,31 @@ index 7065d8e2b0782f1dbaf9932db9201b94ae455a31..f5106ed464d496420ac575b09d6c9a7d 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 42828edf81bd475b673a9d143f79c0d0711f14f5..fbfadeb83719b81f42724e79c59e92ed88fdece7 100644 +index 3d359f80f52bff6f19fcb484f491a874f9dcff27..45b4f1c295eda2fcc5067a4b21de247218ef117f 100644 --- a/src/main/java/net/minecraft/network/PacketEncoder.java +++ b/src/main/java/net/minecraft/network/PacketEncoder.java -@@ -40,7 +40,7 @@ public class PacketEncoder extends MessageToByteEncoder> { +@@ -41,7 +41,7 @@ public class PacketEncoder extends MessageToByteEncoder> { int j = friendlyByteBuf.writerIndex(); packet.write(friendlyByteBuf); int k = friendlyByteBuf.writerIndex() - j; - if (k > 8388608) { + if (false && k > 8388608) { // Paper - disable throw new IllegalArgumentException("Packet too big (is " + k + ", should be less than 8388608): " + packet); - } else { - int l = channelHandlerContext.channel().attr(Connection.ATTRIBUTE_PROTOCOL).get().getId(); -@@ -54,7 +54,31 @@ public class PacketEncoder extends MessageToByteEncoder> { - throw var10; } + +@@ -54,10 +54,35 @@ public class PacketEncoder extends MessageToByteEncoder> { + + throw var13; + } finally { ++ // Paper start ++ int packetLength = friendlyByteBuf.readableBytes(); ++ if (packetLength > MAX_PACKET_SIZE) { ++ throw new PacketTooLargeException(packet, this.codecKey, packetLength); ++ } ++ // Paper end + ProtocolSwapHandler.swapProtocolIfNeeded(attribute, packet); } -+ -+ // Paper start -+ int packetLength = friendlyByteBuf.readableBytes(); -+ if (packetLength > MAX_PACKET_SIZE) { -+ throw new PacketTooLargeException(packet, packetLength); -+ } -+ // Paper end + } } } @@ -62,23 +68,25 @@ index 42828edf81bd475b673a9d143f79c0d0711f14f5..fbfadeb83719b81f42724e79c59e92ed + + public static class PacketTooLargeException extends RuntimeException { + private final Packet packet; ++ public final AttributeKey> codecKey; + -+ PacketTooLargeException(Packet packet, int packetLength) { ++ PacketTooLargeException(Packet packet, AttributeKey> codecKey, int packetLength) { + super("PacketTooLarge - " + packet.getClass().getSimpleName() + " is " + packetLength + ". Max is " + MAX_PACKET_SIZE); + this.packet = packet; ++ this.codecKey = codecKey; + } + + public Packet getPacket() { -+ return packet; ++ return this.packet; + } + } + // Paper end } diff --git a/src/main/java/net/minecraft/network/protocol/Packet.java b/src/main/java/net/minecraft/network/protocol/Packet.java -index 10c1f2d8a92f848c3f2be9d1d06fd254978e6dcc..74bfe0d3942259c45702b099efdc4e101a4e3022 100644 +index 700418bb0c9fbed3f161611881b1e222248ca4eb..cc658a61065d5c0021a4b88fa58b40211b94f8ec 100644 --- a/src/main/java/net/minecraft/network/protocol/Packet.java +++ b/src/main/java/net/minecraft/network/protocol/Packet.java -@@ -8,6 +8,12 @@ public interface Packet { +@@ -10,6 +10,12 @@ public interface Packet { void handle(T listener); diff --git a/patches/unapplied/server/0285-force-entity-dismount-during-teleportation.patch b/patches/server/0284-force-entity-dismount-during-teleportation.patch similarity index 87% rename from patches/unapplied/server/0285-force-entity-dismount-during-teleportation.patch rename to patches/server/0284-force-entity-dismount-during-teleportation.patch index bc38c348cf..19fe847955 100644 --- a/patches/unapplied/server/0285-force-entity-dismount-during-teleportation.patch +++ b/patches/server/0284-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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7ca89b1a5bbeefd8622cb0f93e0235abcefbc033..dee47ff97e4f08154866d7628c3588a42f9892b9 100644 +index 72c5fde2220524f66a2608ecfa96c7b56f8b198c..d0779d38c56ca1c01abd154720d2865d14479a30 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2564,11 +2564,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2524,11 +2524,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public void removeVehicle() { @@ -41,7 +41,7 @@ index 7ca89b1a5bbeefd8622cb0f93e0235abcefbc033..dee47ff97e4f08154866d7628c3588a4 } } -@@ -2599,7 +2604,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2559,7 +2564,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } } @@ -53,7 +53,7 @@ index 7ca89b1a5bbeefd8622cb0f93e0235abcefbc033..dee47ff97e4f08154866d7628c3588a4 if (entity.getVehicle() == this) { throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); } else { -@@ -2609,7 +2617,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2569,7 +2577,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { VehicleExitEvent event = new VehicleExitEvent( (Vehicle) this.getBukkitEntity(), @@ -62,7 +62,7 @@ index 7ca89b1a5bbeefd8622cb0f93e0235abcefbc033..dee47ff97e4f08154866d7628c3588a4 ); // Suppress during worldgen if (this.valid) { -@@ -2623,7 +2631,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2583,7 +2591,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } // CraftBukkit end // Spigot start @@ -72,10 +72,10 @@ index 7ca89b1a5bbeefd8622cb0f93e0235abcefbc033..dee47ff97e4f08154866d7628c3588a4 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 f800b3e4debcd141a75de9e6025a87e81cee083c..965c5724eb4927f017123c791c4a721c59b6db15 100644 +index ffed90c0fc1240fc10b4cdd8df8377647b75beda..0f7f90a6b358402c7a05217f59768448eabfce53 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3438,9 +3438,15 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3472,9 +3472,15 @@ public abstract class LivingEntity extends Entity implements Attackable { @Override public void stopRiding() { @@ -93,10 +93,10 @@ index f800b3e4debcd141a75de9e6025a87e81cee083c..965c5724eb4927f017123c791c4a721c 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 c7bcbc3f0542a74c30e29bded3bfc0e94daeab25..078986fb32eeecacc954ad6719e981ed8b3a2350 100644 +index ddd43b5e9ab77c1baaa7c777dc0b3e89789d7626..9d252aea2c372f9a6b46319564dc6dc5e94d9a91 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1148,7 +1148,13 @@ public abstract class Player extends LivingEntity { +@@ -1154,7 +1154,13 @@ public abstract class Player extends LivingEntity { @Override public void removeVehicle() { diff --git a/patches/unapplied/server/0286-Add-more-Zombie-API.patch b/patches/server/0285-Add-more-Zombie-API.patch similarity index 90% rename from patches/unapplied/server/0286-Add-more-Zombie-API.patch rename to patches/server/0285-Add-more-Zombie-API.patch index 52e2b083ce..43c7b9d006 100644 --- a/patches/unapplied/server/0286-Add-more-Zombie-API.patch +++ b/patches/server/0285-Add-more-Zombie-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add more Zombie API public net.minecraft.world.entity.monster.Zombie isSunSensitive()Z diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index 86dc8bdfdc4eabef2266f3409366b373fb0ae13d..fed8b065172f40a2a5c251f46303fc4d72c9653a 100644 +index 61ecf5c51fbdf38ec5513453c2de037489fd8c7e..2be074ecbc131b68574cf77ba9cab96424715522 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -95,6 +95,7 @@ public class Zombie extends Monster { +@@ -96,6 +96,7 @@ public class Zombie extends Monster { private int inWaterTime; public int conversionTime; private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field @@ -18,7 +18,7 @@ index 86dc8bdfdc4eabef2266f3409366b373fb0ae13d..fed8b065172f40a2a5c251f46303fc4d public Zombie(EntityType type, Level world) { super(type, world); -@@ -263,6 +264,12 @@ public class Zombie extends Monster { +@@ -264,6 +265,12 @@ public class Zombie extends Monster { super.aiStep(); } @@ -31,7 +31,7 @@ index 86dc8bdfdc4eabef2266f3409366b373fb0ae13d..fed8b065172f40a2a5c251f46303fc4d public void startUnderWaterConversion(int ticksUntilWaterConversion) { this.lastTick = MinecraftServer.currentTick; // CraftBukkit this.conversionTime = ticksUntilWaterConversion; -@@ -292,9 +299,15 @@ public class Zombie extends Monster { +@@ -293,9 +300,15 @@ public class Zombie extends Monster { } public boolean isSunSensitive() { @@ -48,7 +48,7 @@ index 86dc8bdfdc4eabef2266f3409366b373fb0ae13d..fed8b065172f40a2a5c251f46303fc4d @Override public boolean hurt(DamageSource source, float amount) { if (!super.hurt(source, amount)) { -@@ -414,6 +427,7 @@ public class Zombie extends Monster { +@@ -415,6 +428,7 @@ public class Zombie extends Monster { nbt.putBoolean("CanBreakDoors", this.canBreakDoors()); nbt.putInt("InWaterTime", this.isInWater() ? this.inWaterTime : -1); nbt.putInt("DrownedConversionTime", this.isUnderWaterConverting() ? this.conversionTime : -1); @@ -56,7 +56,7 @@ index 86dc8bdfdc4eabef2266f3409366b373fb0ae13d..fed8b065172f40a2a5c251f46303fc4d } @Override -@@ -425,6 +439,11 @@ public class Zombie extends Monster { +@@ -426,6 +440,11 @@ public class Zombie extends Monster { if (nbt.contains("DrownedConversionTime", 99) && nbt.getInt("DrownedConversionTime") > -1) { this.startUnderWaterConversion(nbt.getInt("DrownedConversionTime")); } diff --git a/patches/unapplied/server/0287-Book-Size-Limits.patch b/patches/server/0286-Book-Size-Limits.patch similarity index 93% rename from patches/unapplied/server/0287-Book-Size-Limits.patch rename to patches/server/0286-Book-Size-Limits.patch index 266ebb26c0..7990644879 100644 --- a/patches/unapplied/server/0287-Book-Size-Limits.patch +++ b/patches/server/0286-Book-Size-Limits.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Book Size Limits Puts some limits on the size of books. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9f87d35fb20b63b01252dc844ca3a584c16c7129..c5b682d08ab270d153eb600afe9a21bfa1305072 100644 +index 8b26ce9c8d1003ef611cdc14aee3f5d4cfd6a6fb..08af9c32f8cb40e1e94cfb5c42ee113e8765db86 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1126,6 +1126,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1016,6 +1016,45 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleEditBook(ServerboundEditBookPacket packet) { diff --git a/patches/unapplied/server/0288-Add-PlayerConnectionCloseEvent.patch b/patches/server/0287-Add-PlayerConnectionCloseEvent.patch similarity index 92% rename from patches/unapplied/server/0288-Add-PlayerConnectionCloseEvent.patch rename to patches/server/0287-Add-PlayerConnectionCloseEvent.patch index 78296cb243..733633f48b 100644 --- a/patches/unapplied/server/0288-Add-PlayerConnectionCloseEvent.patch +++ b/patches/server/0287-Add-PlayerConnectionCloseEvent.patch @@ -39,13 +39,13 @@ public net.minecraft.server.network.ServerLoginPacketListenerImpl state public net.minecraft.server.network.ServerLoginPacketListenerImpl gameProfile diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index f5106ed464d496420ac575b09d6c9a7dfeb87bec..b293ac99e436b02c9ef30994a394bcc53ebbf2f9 100644 +index ff97e47cb248ade6530e52583b0b3865d77ace15..ed89f2f96088c5c05fd42a6795e6e6e342a0ab54 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -509,6 +509,26 @@ public class Connection extends SimpleChannelInboundHandler> { - this.getPacketListener().onDisconnect(Component.translatable("multiplayer.disconnect.generic")); +@@ -632,6 +632,27 @@ public class Connection extends SimpleChannelInboundHandler> { + packetlistener1.onDisconnect(ichatbasecomponent); } - this.queue.clear(); // Free up packet queue. + this.pendingActions.clear(); // Free up packet queue. + // Paper start - Add PlayerConnectionCloseEvent + final PacketListener packetListener = this.getPacketListener(); + if (packetListener instanceof net.minecraft.server.network.ServerGamePacketListenerImpl) { @@ -66,6 +66,7 @@ index f5106ed464d496420ac575b09d6c9a7dfeb87bec..b293ac99e436b02c9ef30994a394bcc5 + } + } + // Paper end - } ++ } + } } diff --git a/patches/unapplied/server/0289-Prevent-Enderman-from-loading-chunks.patch b/patches/server/0288-Prevent-Enderman-from-loading-chunks.patch similarity index 90% rename from patches/unapplied/server/0289-Prevent-Enderman-from-loading-chunks.patch rename to patches/server/0288-Prevent-Enderman-from-loading-chunks.patch index 21afd49aab..248a1b8e0b 100644 --- a/patches/unapplied/server/0289-Prevent-Enderman-from-loading-chunks.patch +++ b/patches/server/0288-Prevent-Enderman-from-loading-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent Enderman from loading chunks diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -index 06a0a06f3f4ed20f151ddac35ae7d56852e191ae..f7ad34f38d26ab08bb5dd788bc70ba01b53fc1a1 100644 +index bf5b7b996c9141c7cef9c281323115bd593dc777..5b3da07def02830e4332d7d3a7f7b968e5663c7b 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -@@ -510,7 +510,8 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -517,7 +517,8 @@ public class EnderMan extends Monster implements NeutralMob { int j = Mth.floor(this.enderman.getY() + randomsource.nextDouble() * 2.0D); int k = Mth.floor(this.enderman.getZ() - 1.0D + randomsource.nextDouble() * 2.0D); BlockPos blockposition = new BlockPos(i, j, k); @@ -18,7 +18,7 @@ index 06a0a06f3f4ed20f151ddac35ae7d56852e191ae..f7ad34f38d26ab08bb5dd788bc70ba01 BlockPos blockposition1 = blockposition.below(); BlockState iblockdata1 = world.getBlockState(blockposition1); BlockState iblockdata2 = this.enderman.getCarriedBlock(); -@@ -554,7 +555,8 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -561,7 +562,8 @@ public class EnderMan extends Monster implements NeutralMob { int j = Mth.floor(this.enderman.getY() + randomsource.nextDouble() * 3.0D); int k = Mth.floor(this.enderman.getZ() - 2.0D + randomsource.nextDouble() * 4.0D); BlockPos blockposition = new BlockPos(i, j, k); diff --git a/patches/unapplied/server/0290-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0289-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch similarity index 89% rename from patches/unapplied/server/0290-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch rename to patches/server/0289-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index 5898d2d6bb..c64ea8a108 100644 --- a/patches/unapplied/server/0290-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/patches/server/0289-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -16,11 +16,11 @@ 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 715314de7a92a8e06f82c6bff5fe74e3b23044f8..b59ad5f0cc12082db0c885b29d88c526a4029e22 100644 +index 10044e1d596665b8f8b88f0baf1c61c8d3af0c4e..78405a80e16f44231c0d4ee10d283c521aead686 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -243,6 +243,7 @@ public class ServerPlayer extends Player { - public int latency; +@@ -241,6 +241,7 @@ public class ServerPlayer extends Player { + private int containerCounter; public boolean wonGame; private int containerUpdateDelay; // Paper + public long loginTime; // Paper @@ -28,12 +28,12 @@ index 715314de7a92a8e06f82c6bff5fe74e3b23044f8..b59ad5f0cc12082db0c885b29d88c526 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 2bccba03bb12cf17a82c1e54c2bb10535b7c8964..5657493e215a17f3132f9d411424875160fda6d9 100644 +index 68b6956fc1866fc5b78544cfd348db864b3042e9..7b094b859fe4c865cd369108700d5b0d6573c019 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -189,6 +189,7 @@ public abstract class PlayerList { +@@ -181,6 +181,7 @@ public abstract class PlayerList { - public void placeNewPlayer(Connection connection, ServerPlayer player) { + public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie clientData) { player.isRealPlayer = true; // Paper + player.loginTime = System.currentTimeMillis(); // Paper GameProfile gameprofile = player.getGameProfile(); @@ -106,10 +106,10 @@ index aac78c13361b19efa7b43a0c95458390f1ba8340..f572a74b85df36a6da76b78ec29d8072 public Location getLastDeathLocation() { if (this.getData().contains("LastDeathLocation", 10)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1c09e955e34380b99572cc5950806417ac10bfc8..a9f80c019f5a127d9273833608917c59748ae867 100644 +index 874f515eb8cf7bc3fa2e37f09993fd4454ec089e..574186529adc6d780efb1f9644703d6c472f16d4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -193,6 +193,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -195,6 +195,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; private String resourcePackHash; private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit @@ -117,7 +117,7 @@ index 1c09e955e34380b99572cc5950806417ac10bfc8..a9f80c019f5a127d9273833608917c59 // Paper end public CraftPlayer(CraftServer server, ServerPlayer entity) { -@@ -1950,6 +1951,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1910,6 +1911,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.firstPlayed = firstPlayed; } @@ -136,7 +136,7 @@ index 1c09e955e34380b99572cc5950806417ac10bfc8..a9f80c019f5a127d9273833608917c59 public void readExtraData(CompoundTag nbttagcompound) { this.hasPlayedBefore = true; if (nbttagcompound.contains("bukkit")) { -@@ -1972,6 +1985,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1932,6 +1945,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setExtraData(CompoundTag nbttagcompound) { @@ -145,7 +145,7 @@ index 1c09e955e34380b99572cc5950806417ac10bfc8..a9f80c019f5a127d9273833608917c59 if (!nbttagcompound.contains("bukkit")) { nbttagcompound.put("bukkit", new CompoundTag()); } -@@ -1986,6 +2001,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1946,6 +1961,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { data.putLong("firstPlayed", this.getFirstPlayed()); data.putLong("lastPlayed", System.currentTimeMillis()); data.putString("lastKnownName", handle.getScoreboardName()); diff --git a/patches/unapplied/server/0291-Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/patches/server/0290-Workaround-for-vehicle-tracking-issue-on-disconnect.patch similarity index 85% rename from patches/unapplied/server/0291-Workaround-for-vehicle-tracking-issue-on-disconnect.patch rename to patches/server/0290-Workaround-for-vehicle-tracking-issue-on-disconnect.patch index 562f71d37c..6374eec50b 100644 --- a/patches/unapplied/server/0291-Workaround-for-vehicle-tracking-issue-on-disconnect.patch +++ b/patches/server/0290-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 b59ad5f0cc12082db0c885b29d88c526a4029e22..d29e13aa7bbfbab54f8a3d73279891d65e957d7e 100644 +index 78405a80e16f44231c0d4ee10d283c521aead686..9ad2e953a3b4a7a2f4ce375a1b209820cdef2d47 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1644,6 +1644,13 @@ public class ServerPlayer extends Player { +@@ -1603,6 +1603,13 @@ public class ServerPlayer extends Player { public void disconnect() { this.disconnected = true; this.ejectPassengers(); diff --git a/patches/unapplied/server/0292-Block-Entity-remove-from-being-called-on-Players.patch b/patches/server/0291-Block-Entity-remove-from-being-called-on-Players.patch similarity index 90% rename from patches/unapplied/server/0292-Block-Entity-remove-from-being-called-on-Players.patch rename to patches/server/0291-Block-Entity-remove-from-being-called-on-Players.patch index 8c882dd005..485fcfa1b7 100644 --- a/patches/unapplied/server/0292-Block-Entity-remove-from-being-called-on-Players.patch +++ b/patches/server/0291-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 a9f80c019f5a127d9273833608917c59748ae867..08404472a89192fb0cbae0192793c4c4ae63a9bb 100644 +index 574186529adc6d780efb1f9644703d6c472f16d4..ffac201e99efcc1527956df18cce5aab986332e9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2874,6 +2874,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2848,6 +2848,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void resetCooldown() { getHandle().resetAttackStrengthTicker(); } diff --git a/patches/unapplied/server/0293-BlockDestroyEvent.patch b/patches/server/0292-BlockDestroyEvent.patch similarity index 93% rename from patches/unapplied/server/0293-BlockDestroyEvent.patch rename to patches/server/0292-BlockDestroyEvent.patch index 8aeb73edf5..0b2a57fd43 100644 --- a/patches/unapplied/server/0293-BlockDestroyEvent.patch +++ b/patches/server/0292-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 18234d71eba7d2a2874f3e5c9628d82970acc033..b3a0f4dd651dda29d2064b629da67378c00a6a78 100644 +index e66e35b25dfce6f071173de87c452a9dd38fcf4d..9fa7dd67ebe5d7d4125e970dbe2e3b201b01f6aa 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -30,6 +30,7 @@ import net.minecraft.nbt.CompoundTag; @@ -22,7 +22,7 @@ index 18234d71eba7d2a2874f3e5c9628d82970acc033..b3a0f4dd651dda29d2064b629da67378 import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.FullChunkStatus; import net.minecraft.server.level.ServerLevel; -@@ -666,8 +667,21 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -661,8 +662,21 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return false; } else { FluidState fluid = this.getFluidState(pos); diff --git a/patches/unapplied/server/0294-Async-command-map-building.patch b/patches/server/0293-Async-command-map-building.patch similarity index 90% rename from patches/unapplied/server/0294-Async-command-map-building.patch rename to patches/server/0293-Async-command-map-building.patch index 84b09041b8..2528f49959 100644 --- a/patches/unapplied/server/0294-Async-command-map-building.patch +++ b/patches/server/0293-Async-command-map-building.patch @@ -9,10 +9,10 @@ commands if the server is restarting. Using the default async pool caused issues due to the shutdown logic generally being much later. diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index e3394864e29357fec036f9e616472aeab95d035e..b7f1569c662df13f278fc704cabec0400ba7c382 100644 +index e63632f09d608371aaeaf09a6dac57c1d8a719d4..bbf4db5faf4694e78e01f4e74e277b46a02f7afd 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -398,6 +398,24 @@ public class Commands { +@@ -404,6 +404,24 @@ public class Commands { if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot // CraftBukkit start // Register Vanilla commands into builtRoot as before @@ -37,7 +37,7 @@ index e3394864e29357fec036f9e616472aeab95d035e..b7f1569c662df13f278fc704cabec040 Map, CommandNode> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues RootCommandNode vanillaRoot = new RootCommandNode(); -@@ -415,7 +433,14 @@ public class Commands { +@@ -421,7 +439,14 @@ public class Commands { for (CommandNode node : rootcommandnode.getChildren()) { bukkit.add(node.getName()); } @@ -53,10 +53,10 @@ index e3394864e29357fec036f9e616472aeab95d035e..b7f1569c662df13f278fc704cabec040 event.getPlayer().getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1a74b7c252d16e5ab2c303e6e96c62e78ef9311c..d84ed437e91a620c294533ddcb098cc11bc16c1f 100644 +index 0f50236866984efd7b8cb95373215b240117be0d..bace1ff9e64bd8bec334c5e1d1fd1c621a63cd92 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -895,6 +895,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop