From 2cee84193ce938bb8a7b3a02f4b0cb89be9759a3 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 21 Sep 2023 22:41:27 -0700 Subject: [PATCH] and some more --- ...per-exception-on-empty-JsonList-file.patch | 0 ...d-settings-for-mobs-picking-up-loot.patch} | 6 +- ...mplemented-BlockFailedDispenseEvent.patch} | 42 +-- ...-Added-PlayerLecternPageChangeEvent.patch} | 0 ...-Added-PlayerLoomPatternSelectEvent.patch} | 2 +- ...nfigurable-door-breaking-difficulty.patch} | 6 +- ...ty-commands-shall-not-be-dispatched.patch} | 4 +- .../0524-Remove-stale-POIs.patch} | 4 +- .../0525-Fix-villager-boat-exploit.patch} | 4 +- .../0526-Add-sendOpLevel-API.patch} | 10 +- ...0527-TODO-Registry-Modification-API.patch} | 0 .../0528-Add-StructuresLocateEvent.patch} | 2 +- ...-for-requiring-a-player-participant.patch} | 10 +- ...leHitEvent-call-when-fireballs-dead.patch} | 0 ...nent-with-empty-text-instead-of-thr.patch} | 2 +- ...532-Make-schedule-command-per-world.patch} | 0 ...533-Configurable-max-leash-distance.patch} | 6 +- ...534-Implement-BlockPreDispenseEvent.patch} | 18 +- ...ng-of-PlayerChangeBeaconEffectEvent.patch} | 18 +- ...e-for-always-placing-the-dragon-egg.patch} | 2 +- ...-PlayerStonecutterRecipeSelectEvent.patch} | 6 +- ...eash-variable-to-EntityUnleashEvent.patch} | 20 +- ...shield-blocking-on-dimension-change.patch} | 4 +- .../0540-add-DragonEggFormEvent.patch} | 2 +- .../0541-EntityMoveEvent.patch} | 10 +- ...isable-pathfinding-updates-on-block.patch} | 6 +- .../0543-Inline-shift-direction-fields.patch} | 0 ...-adding-items-to-BlockDropItemEvent.patch} | 4 +- ...inThreadExecutor-to-BukkitScheduler.patch} | 0 ...entity-allow-attribute-registration.patch} | 6 +- ...ix-dead-slime-setSize-invincibility.patch} | 0 ...pes-should-return-an-immutable-list.patch} | 0 .../0549-Expose-Tracked-Players.patch} | 2 +- ...0-Remove-streams-from-SensorNearest.patch} | 0 .../0551-Improve-ServerGUI.patch} | 0 ...552-fix-converting-txt-to-json-file.patch} | 8 +- .../0553-Add-worldborder-events.patch} | 0 .../0554-added-PlayerNameEntityEvent.patch} | 0 ...grindstones-from-overstacking-items.patch} | 0 .../0556-Add-recipe-to-cook-events.patch} | 20 +- .../0557-Add-Block-isValidTool.patch} | 0 ...using-signs-inside-spawn-protection.patch} | 4 +- .../0559-Expand-world-key-API.patch} | 12 +- ...ternative-constructor-for-Rotations.patch} | 0 .../0561-Item-Rarity-API.patch} | 4 +- ...d-item-when-player-has-disconnected.patch} | 4 +- ...elist-use-configurable-kick-message.patch} | 4 +- ...gnore-result-of-PlayerEditBookEvent.patch} | 4 +- .../0565-Expose-protocol-version.patch} | 4 +- ...ab-completions-for-brigadier-comman.patch} | 2 +- ...temConsumeEvent-cancelling-properly.patch} | 4 +- .../0568-Add-bypass-host-check.patch} | 6 +- ...0569-Set-area-affect-cloud-rotation.patch} | 0 ...add-isDeeplySleeping-to-HumanEntity.patch} | 2 +- ...add-consumeFuel-to-FurnaceBurnEvent.patch} | 2 +- ...-set-drop-chance-to-EntityEquipment.patch} | 0 ...ix-PigZombieAngerEvent-cancellation.patch} | 8 +- ...ix-PlayerItemHeldEvent-firing-twice.patch} | 4 +- .../0575-Added-PlayerDeepSleepEvent.patch} | 4 +- .../0576-More-World-API.patch} | 4 +- .../0577-Added-PlayerBedFailEnterEvent.patch} | 0 ...-to-convert-between-Component-and-B.patch} | 2 +- ...n-acting-as-a-bed-respawn-from-the-.patch} | 8 +- ...acon-activation-deactivation-events.patch} | 6 +- ...-RespawnFlags-to-PlayerRespawnEvent.patch} | 10 +- ...dd-Channel-initialization-listeners.patch} | 14 +- ...mands-if-tab-completion-is-disabled.patch} | 4 +- .../0584-Add-more-WanderingTrader-API.patch} | 6 +- ...dd-EntityBlockStorage-clearEntities.patch} | 0 ...essage-to-PlayerAdvancementDoneEvent.patch | 31 ++ ...address-to-AsyncPlayerPreLoginEvent.patch} | 14 +- .../0588-Inventory-close.patch} | 0 ...-in-sunlight-API-for-Phantoms-and-S.patch} | 12 +- .../0590-Fix-CraftPotionBrewer-cache.patch} | 0 .../0591-Add-basic-Datapack-API.patch} | 8 +- ...ment-variable-to-disable-server-gui.patch} | 4 +- ...itions-to-PlayerGameModeChangeEvent.patch} | 18 +- .../0594-ItemStack-repair-check-API.patch} | 4 +- .../0595-More-Enchantment-API.patch} | 2 +- ...ve-range-check-for-block-placing-up.patch} | 4 +- ...-and-optimise-world-force-upgrading.patch} | 34 +- .../0598-Add-Mob-lookAt-API.patch} | 0 ...0599-Add-Unix-domain-socket-support.patch} | 34 +- .../0600-Add-EntityInsideBlockEvent.patch} | 26 +- ...01-Attributes-API-for-item-defaults.patch} | 4 +- ...ause-to-Weather-ThunderChangeEvents.patch} | 16 +- .../0603-More-Lidded-Block-API.patch} | 0 ...04-Limit-item-frame-cursors-on-maps.patch} | 6 +- .../0605-Add-PlayerKickEvent-causes.patch} | 304 +++++++++--------- ...0606-Add-PufferFishStateChangeEvent.patch} | 0 ...erBucketEmptyEvent-result-itemstack.patch} | 8 +- ...essage-to-PlayerAdvancementDoneEvent.patch | 32 -- ...587-Entity-load-save-limit-per-chunk.patch | 0 93 files changed, 449 insertions(+), 458 deletions(-) rename patches/{unapplied/server => removed/1.20.1}/0559-Throw-proper-exception-on-empty-JsonList-file.patch (100%) rename patches/{unapplied/server/0526-Added-world-settings-for-mobs-picking-up-loot.patch => server/0518-Added-world-settings-for-mobs-picking-up-loot.patch} (89%) rename patches/{unapplied/server/0527-Implemented-BlockFailedDispenseEvent.patch => server/0519-Implemented-BlockFailedDispenseEvent.patch} (52%) rename patches/{unapplied/server/0528-Added-PlayerLecternPageChangeEvent.patch => server/0520-Added-PlayerLecternPageChangeEvent.patch} (100%) rename patches/{unapplied/server/0529-Added-PlayerLoomPatternSelectEvent.patch => server/0521-Added-PlayerLoomPatternSelectEvent.patch} (96%) rename patches/{unapplied/server/0530-Configurable-door-breaking-difficulty.patch => server/0522-Configurable-door-breaking-difficulty.patch} (89%) rename patches/{unapplied/server/0531-Empty-commands-shall-not-be-dispatched.patch => server/0523-Empty-commands-shall-not-be-dispatched.patch} (84%) rename patches/{unapplied/server/0532-Remove-stale-POIs.patch => server/0524-Remove-stale-POIs.patch} (86%) rename patches/{unapplied/server/0533-Fix-villager-boat-exploit.patch => server/0525-Fix-villager-boat-exploit.patch} (88%) rename patches/{unapplied/server/0534-Add-sendOpLevel-API.patch => server/0526-Add-sendOpLevel-API.patch} (84%) rename patches/{unapplied/server/0535-TODO-Registry-Modification-API.patch => server/0527-TODO-Registry-Modification-API.patch} (100%) rename patches/{unapplied/server/0536-Add-StructuresLocateEvent.patch => server/0528-Add-StructuresLocateEvent.patch} (99%) rename patches/{unapplied/server/0537-Collision-option-for-requiring-a-player-participant.patch => server/0529-Collision-option-for-requiring-a-player-participant.patch} (86%) rename patches/{unapplied/server/0538-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch => server/0530-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch} (100%) rename patches/{unapplied/server/0539-Return-chat-component-with-empty-text-instead-of-thr.patch => server/0531-Return-chat-component-with-empty-text-instead-of-thr.patch} (92%) rename patches/{unapplied/server/0540-Make-schedule-command-per-world.patch => server/0532-Make-schedule-command-per-world.patch} (100%) rename patches/{unapplied/server/0541-Configurable-max-leash-distance.patch => server/0533-Configurable-max-leash-distance.patch} (86%) rename patches/{unapplied/server/0542-Implement-BlockPreDispenseEvent.patch => server/0534-Implement-BlockPreDispenseEvent.patch} (70%) rename patches/{unapplied/server/0543-Added-firing-of-PlayerChangeBeaconEffectEvent.patch => server/0535-Added-firing-of-PlayerChangeBeaconEffectEvent.patch} (63%) rename patches/{unapplied/server/0544-Add-toggle-for-always-placing-the-dragon-egg.patch => server/0536-Add-toggle-for-always-placing-the-dragon-egg.patch} (92%) rename patches/{unapplied/server/0545-Added-PlayerStonecutterRecipeSelectEvent.patch => server/0537-Added-PlayerStonecutterRecipeSelectEvent.patch} (93%) rename patches/{unapplied/server/0546-Add-dropLeash-variable-to-EntityUnleashEvent.patch => server/0538-Add-dropLeash-variable-to-EntityUnleashEvent.patch} (92%) rename patches/{unapplied/server/0547-Reset-shield-blocking-on-dimension-change.patch => server/0539-Reset-shield-blocking-on-dimension-change.patch} (83%) rename patches/{unapplied/server/0548-add-DragonEggFormEvent.patch => server/0540-add-DragonEggFormEvent.patch} (96%) rename patches/{unapplied/server/0549-EntityMoveEvent.patch => server/0541-EntityMoveEvent.patch} (89%) rename patches/{unapplied/server/0550-added-option-to-disable-pathfinding-updates-on-block.patch => server/0542-added-option-to-disable-pathfinding-updates-on-block.patch} (80%) rename patches/{unapplied/server/0551-Inline-shift-direction-fields.patch => server/0543-Inline-shift-direction-fields.patch} (100%) rename patches/{unapplied/server/0552-Allow-adding-items-to-BlockDropItemEvent.patch => server/0544-Allow-adding-items-to-BlockDropItemEvent.patch} (92%) rename patches/{unapplied/server/0553-Add-getMainThreadExecutor-to-BukkitScheduler.patch => server/0545-Add-getMainThreadExecutor-to-BukkitScheduler.patch} (100%) rename patches/{unapplied/server/0554-living-entity-allow-attribute-registration.patch => server/0546-living-entity-allow-attribute-registration.patch} (91%) rename patches/{unapplied/server/0555-fix-dead-slime-setSize-invincibility.patch => server/0547-fix-dead-slime-setSize-invincibility.patch} (100%) rename patches/{unapplied/server/0556-Merchant-getRecipes-should-return-an-immutable-list.patch => server/0548-Merchant-getRecipes-should-return-an-immutable-list.patch} (100%) rename patches/{unapplied/server/0557-Expose-Tracked-Players.patch => server/0549-Expose-Tracked-Players.patch} (92%) rename patches/{unapplied/server/0558-Remove-streams-from-SensorNearest.patch => server/0550-Remove-streams-from-SensorNearest.patch} (100%) rename patches/{unapplied/server/0560-Improve-ServerGUI.patch => server/0551-Improve-ServerGUI.patch} (100%) rename patches/{unapplied/server/0561-fix-converting-txt-to-json-file.patch => server/0552-fix-converting-txt-to-json-file.patch} (91%) rename patches/{unapplied/server/0562-Add-worldborder-events.patch => server/0553-Add-worldborder-events.patch} (100%) rename patches/{unapplied/server/0563-added-PlayerNameEntityEvent.patch => server/0554-added-PlayerNameEntityEvent.patch} (100%) rename patches/{unapplied/server/0564-Prevent-grindstones-from-overstacking-items.patch => server/0555-Prevent-grindstones-from-overstacking-items.patch} (100%) rename patches/{unapplied/server/0565-Add-recipe-to-cook-events.patch => server/0556-Add-recipe-to-cook-events.patch} (68%) rename patches/{unapplied/server/0566-Add-Block-isValidTool.patch => server/0557-Add-Block-isValidTool.patch} (100%) rename patches/{unapplied/server/0567-Allow-using-signs-inside-spawn-protection.patch => server/0558-Allow-using-signs-inside-spawn-protection.patch} (89%) rename patches/{unapplied/server/0568-Expand-world-key-API.patch => server/0559-Expand-world-key-API.patch} (89%) rename patches/{unapplied/server/0569-Add-fast-alternative-constructor-for-Rotations.patch => server/0560-Add-fast-alternative-constructor-for-Rotations.patch} (100%) rename patches/{unapplied/server/0570-Item-Rarity-API.patch => server/0561-Item-Rarity-API.patch} (94%) rename patches/{unapplied/server/0571-Drop-carried-item-when-player-has-disconnected.patch => server/0562-Drop-carried-item-when-player-has-disconnected.patch} (88%) rename patches/{unapplied/server/0572-forced-whitelist-use-configurable-kick-message.patch => server/0563-forced-whitelist-use-configurable-kick-message.patch} (87%) rename patches/{unapplied/server/0573-Don-t-ignore-result-of-PlayerEditBookEvent.patch => server/0564-Don-t-ignore-result-of-PlayerEditBookEvent.patch} (83%) rename patches/{unapplied/server/0574-Expose-protocol-version.patch => server/0565-Expose-protocol-version.patch} (85%) rename patches/{unapplied/server/0575-Enhance-console-tab-completions-for-brigadier-comman.patch => server/0566-Enhance-console-tab-completions-for-brigadier-comman.patch} (99%) rename patches/{unapplied/server/0576-Fix-PlayerItemConsumeEvent-cancelling-properly.patch => server/0567-Fix-PlayerItemConsumeEvent-cancelling-properly.patch} (88%) rename patches/{unapplied/server/0577-Add-bypass-host-check.patch => server/0568-Add-bypass-host-check.patch} (90%) rename patches/{unapplied/server/0578-Set-area-affect-cloud-rotation.patch => server/0569-Set-area-affect-cloud-rotation.patch} (100%) rename patches/{unapplied/server/0579-add-isDeeplySleeping-to-HumanEntity.patch => server/0570-add-isDeeplySleeping-to-HumanEntity.patch} (90%) rename patches/{unapplied/server/0580-add-consumeFuel-to-FurnaceBurnEvent.patch => server/0571-add-consumeFuel-to-FurnaceBurnEvent.patch} (91%) rename patches/{unapplied/server/0581-add-get-set-drop-chance-to-EntityEquipment.patch => server/0572-add-get-set-drop-chance-to-EntityEquipment.patch} (100%) rename patches/{unapplied/server/0582-fix-PigZombieAngerEvent-cancellation.patch => server/0573-fix-PigZombieAngerEvent-cancellation.patch} (87%) rename patches/{unapplied/server/0583-fix-PlayerItemHeldEvent-firing-twice.patch => server/0574-fix-PlayerItemHeldEvent-firing-twice.patch} (85%) rename patches/{unapplied/server/0584-Added-PlayerDeepSleepEvent.patch => server/0575-Added-PlayerDeepSleepEvent.patch} (85%) rename patches/{unapplied/server/0585-More-World-API.patch => server/0576-More-World-API.patch} (96%) rename patches/{unapplied/server/0586-Added-PlayerBedFailEnterEvent.patch => server/0577-Added-PlayerBedFailEnterEvent.patch} (100%) rename patches/{unapplied/server/0588-Implement-methods-to-convert-between-Component-and-B.patch => server/0578-Implement-methods-to-convert-between-Component-and-B.patch} (96%) rename patches/{unapplied/server/0589-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch => server/0579-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch} (87%) rename patches/{unapplied/server/0590-Introduce-beacon-activation-deactivation-events.patch => server/0580-Introduce-beacon-activation-deactivation-events.patch} (89%) rename patches/{unapplied/server/0591-add-RespawnFlags-to-PlayerRespawnEvent.patch => server/0581-add-RespawnFlags-to-PlayerRespawnEvent.patch} (88%) rename patches/{unapplied/server/0592-Add-Channel-initialization-listeners.patch => server/0582-Add-Channel-initialization-listeners.patch} (89%) rename patches/{unapplied/server/0593-Send-empty-commands-if-tab-completion-is-disabled.patch => server/0583-Send-empty-commands-if-tab-completion-is-disabled.patch} (88%) rename patches/{unapplied/server/0594-Add-more-WanderingTrader-API.patch => server/0584-Add-more-WanderingTrader-API.patch} (93%) rename patches/{unapplied/server/0595-Add-EntityBlockStorage-clearEntities.patch => server/0585-Add-EntityBlockStorage-clearEntities.patch} (100%) create mode 100644 patches/server/0586-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch rename patches/{unapplied/server/0597-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch => server/0587-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch} (74%) rename patches/{unapplied/server/0598-Inventory-close.patch => server/0588-Inventory-close.patch} (100%) rename patches/{unapplied/server/0599-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch => server/0589-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch} (92%) rename patches/{unapplied/server/0600-Fix-CraftPotionBrewer-cache.patch => server/0590-Fix-CraftPotionBrewer-cache.patch} (100%) rename patches/{unapplied/server/0601-Add-basic-Datapack-API.patch => server/0591-Add-basic-Datapack-API.patch} (94%) rename patches/{unapplied/server/0602-Add-environment-variable-to-disable-server-gui.patch => server/0592-Add-environment-variable-to-disable-server-gui.patch} (85%) rename patches/{unapplied/server/0603-additions-to-PlayerGameModeChangeEvent.patch => server/0593-additions-to-PlayerGameModeChangeEvent.patch} (92%) rename patches/{unapplied/server/0604-ItemStack-repair-check-API.patch => server/0594-ItemStack-repair-check-API.patch} (95%) rename patches/{unapplied/server/0605-More-Enchantment-API.patch => server/0595-More-Enchantment-API.patch} (98%) rename patches/{unapplied/server/0606-Move-range-check-for-block-placing-up.patch => server/0596-Move-range-check-for-block-placing-up.patch} (84%) rename patches/{unapplied/server/0607-Fix-and-optimise-world-force-upgrading.patch => server/0597-Fix-and-optimise-world-force-upgrading.patch} (93%) rename patches/{unapplied/server/0608-Add-Mob-lookAt-API.patch => server/0598-Add-Mob-lookAt-API.patch} (100%) rename patches/{unapplied/server/0609-Add-Unix-domain-socket-support.patch => server/0599-Add-Unix-domain-socket-support.patch} (83%) rename patches/{unapplied/server/0610-Add-EntityInsideBlockEvent.patch => server/0600-Add-EntityInsideBlockEvent.patch} (95%) rename patches/{unapplied/server/0611-Attributes-API-for-item-defaults.patch => server/0601-Attributes-API-for-item-defaults.patch} (91%) rename patches/{unapplied/server/0612-Add-cause-to-Weather-ThunderChangeEvents.patch => server/0602-Add-cause-to-Weather-ThunderChangeEvents.patch} (90%) rename patches/{unapplied/server/0613-More-Lidded-Block-API.patch => server/0603-More-Lidded-Block-API.patch} (100%) rename patches/{unapplied/server/0614-Limit-item-frame-cursors-on-maps.patch => server/0604-Limit-item-frame-cursors-on-maps.patch} (88%) rename patches/{unapplied/server/0615-Add-PlayerKickEvent-causes.patch => server/0605-Add-PlayerKickEvent-causes.patch} (78%) rename patches/{unapplied/server/0616-Add-PufferFishStateChangeEvent.patch => server/0606-Add-PufferFishStateChangeEvent.patch} (100%) rename patches/{unapplied/server/0617-Fix-PlayerBucketEmptyEvent-result-itemstack.patch => server/0607-Fix-PlayerBucketEmptyEvent-result-itemstack.patch} (88%) delete mode 100644 patches/unapplied/server/0596-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch rename patches/unapplied/{server => skipped}/0587-Entity-load-save-limit-per-chunk.patch (100%) diff --git a/patches/unapplied/server/0559-Throw-proper-exception-on-empty-JsonList-file.patch b/patches/removed/1.20.1/0559-Throw-proper-exception-on-empty-JsonList-file.patch similarity index 100% rename from patches/unapplied/server/0559-Throw-proper-exception-on-empty-JsonList-file.patch rename to patches/removed/1.20.1/0559-Throw-proper-exception-on-empty-JsonList-file.patch diff --git a/patches/unapplied/server/0526-Added-world-settings-for-mobs-picking-up-loot.patch b/patches/server/0518-Added-world-settings-for-mobs-picking-up-loot.patch similarity index 89% rename from patches/unapplied/server/0526-Added-world-settings-for-mobs-picking-up-loot.patch rename to patches/server/0518-Added-world-settings-for-mobs-picking-up-loot.patch index 7228b93ce4..19b35f04ac 100644 --- a/patches/unapplied/server/0526-Added-world-settings-for-mobs-picking-up-loot.patch +++ b/patches/server/0518-Added-world-settings-for-mobs-picking-up-loot.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Added world settings for mobs picking up loot diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -index 4ea7a6bd6fdc98bef30546e19e2676a78fb29007..ef525e5f523966c9af7380e8d09ff5092e56e7c5 100644 +index dadb419a04b343d6ba59353c6caa1a50aa07b67f..6be9e8d693bbb084791d7b30a1891ddb803d6b02 100644 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java @@ -153,7 +153,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @@ -18,10 +18,10 @@ index 4ea7a6bd6fdc98bef30546e19e2676a78fb29007..ef525e5f523966c9af7380e8d09ff509 LocalDate localdate = LocalDate.now(); int i = localdate.get(ChronoField.DAY_OF_MONTH); 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 3ca308bb6668392a4f7ce1296e1ef6094060491f..0911a232dcc334503dbeb5f8198d2acc75a954f0 100644 +index 6b8315ab1bdd963c04e56f214f6bdfd6b5eb8f48..e28718fb76d6c53c31ed358779e28133de49cd7f 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -514,7 +514,7 @@ public class Zombie extends Monster { +@@ -515,7 +515,7 @@ public class Zombie extends Monster { Object object = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt); float f = difficulty.getSpecialMultiplier(); diff --git a/patches/unapplied/server/0527-Implemented-BlockFailedDispenseEvent.patch b/patches/server/0519-Implemented-BlockFailedDispenseEvent.patch similarity index 52% rename from patches/unapplied/server/0527-Implemented-BlockFailedDispenseEvent.patch rename to patches/server/0519-Implemented-BlockFailedDispenseEvent.patch index 02c992577a..982bfcf2b3 100644 --- a/patches/unapplied/server/0527-Implemented-BlockFailedDispenseEvent.patch +++ b/patches/server/0519-Implemented-BlockFailedDispenseEvent.patch @@ -5,37 +5,37 @@ Subject: [PATCH] Implemented BlockFailedDispenseEvent diff --git a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java -index 504ba1588ae0c35c81934d0a09f0ad70d542d968..9ec043ff2cd38e589066a3eb7f42834e4e7592cf 100644 +index e66ed3fcfcbabf4b466c1f7988d337b3b7bcd85d..d86a5f80171e13c2b1a1fd90b4c1471fadd957b4 100644 --- a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java -@@ -83,8 +83,10 @@ public class DispenserBlock extends BaseEntityBlock { - int i = tileentitydispenser.getRandomSlot(world.random); +@@ -89,8 +89,10 @@ public class DispenserBlock extends BaseEntityBlock { + int i = tileentitydispenser.getRandomSlot(world.random); - if (i < 0) { -+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFailedDispenseEvent(world, pos)) {// Paper - BlockFailedDispenseEvent is called here - world.levelEvent(1001, pos, 0); - world.gameEvent(GameEvent.BLOCK_ACTIVATE, pos, GameEvent.Context.of(tileentitydispenser.getBlockState())); -+ } // Paper - } else { - ItemStack itemstack = tileentitydispenser.getItem(i); - DispenseItemBehavior idispensebehavior = this.getDispenseMethod(itemstack); + if (i < 0) { ++ if (orgg.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFailedDispenseEvent(world, pos)) {// Paper - BlockFailedDispenseEvent is called here + world.levelEvent(1001, pos, 0); + world.gameEvent(GameEvent.BLOCK_ACTIVATE, pos, GameEvent.Context.of(tileentitydispenser.getBlockState())); ++ } // Paper + } else { + ItemStack itemstack = tileentitydispenser.getItem(i); + DispenseItemBehavior idispensebehavior = this.getDispenseMethod(itemstack); diff --git a/src/main/java/net/minecraft/world/level/block/DropperBlock.java b/src/main/java/net/minecraft/world/level/block/DropperBlock.java -index 1415ad60163f6584619cc7caa61f1848d6ebaa93..801c4c120e98584bcf218a4ef9bd66d7d18c1097 100644 +index 7dd0570b2457c612484ab89a8efcedd094c4772c..b1ba2c1da9d7b59a5316574deb8247406b55d28d 100644 --- a/src/main/java/net/minecraft/world/level/block/DropperBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DropperBlock.java -@@ -44,6 +44,7 @@ public class DropperBlock extends DispenserBlock { - int i = tileentitydispenser.getRandomSlot(world.random); +@@ -52,6 +52,7 @@ public class DropperBlock extends DispenserBlock { + int i = tileentitydispenser.getRandomSlot(world.random); - if (i < 0) { -+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFailedDispenseEvent(world, pos)) // Paper - BlockFailedDispenseEvent is called here - world.levelEvent(1001, pos, 0); - } else { - ItemStack itemstack = tileentitydispenser.getItem(i); + if (i < 0) { ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFailedDispenseEvent(world, pos)) // Paper - BlockFailedDispenseEvent is called here + world.levelEvent(1001, pos, 0); + } else { + ItemStack itemstack = tileentitydispenser.getItem(i); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index a82a5fd54a962fdcf86f2bc139085ed526cade5e..5c6650892892228dd8e9b4fbd62f4f014d6ddff3 100644 +index 84941643036e4dc1cf135a24360e6a1c011969d5..851ac82b242d513015487c15476a66d2b8b2158d 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1995,4 +1995,12 @@ public class CraftEventFactory { +@@ -1997,4 +1997,12 @@ public class CraftEventFactory { Bukkit.getPluginManager().callEvent(event); return event; } diff --git a/patches/unapplied/server/0528-Added-PlayerLecternPageChangeEvent.patch b/patches/server/0520-Added-PlayerLecternPageChangeEvent.patch similarity index 100% rename from patches/unapplied/server/0528-Added-PlayerLecternPageChangeEvent.patch rename to patches/server/0520-Added-PlayerLecternPageChangeEvent.patch diff --git a/patches/unapplied/server/0529-Added-PlayerLoomPatternSelectEvent.patch b/patches/server/0521-Added-PlayerLoomPatternSelectEvent.patch similarity index 96% rename from patches/unapplied/server/0529-Added-PlayerLoomPatternSelectEvent.patch rename to patches/server/0521-Added-PlayerLoomPatternSelectEvent.patch index 23dca6d928..93e862a643 100644 --- a/patches/unapplied/server/0529-Added-PlayerLoomPatternSelectEvent.patch +++ b/patches/server/0521-Added-PlayerLoomPatternSelectEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Added PlayerLoomPatternSelectEvent diff --git a/src/main/java/net/minecraft/world/inventory/LoomMenu.java b/src/main/java/net/minecraft/world/inventory/LoomMenu.java -index c4766df6d64b484375e5e3474e97dee196c0fef4..0a87996a6ab5b4d67c2aa10daadf6174bc647a44 100644 +index 757ee83a0ec5d381eb328f31f3bef636a9b72d57..e28c1cdf4763e9db3e29b3c0f08d65f978017931 100644 --- a/src/main/java/net/minecraft/world/inventory/LoomMenu.java +++ b/src/main/java/net/minecraft/world/inventory/LoomMenu.java @@ -173,8 +173,35 @@ public class LoomMenu extends AbstractContainerMenu { diff --git a/patches/unapplied/server/0530-Configurable-door-breaking-difficulty.patch b/patches/server/0522-Configurable-door-breaking-difficulty.patch similarity index 89% rename from patches/unapplied/server/0530-Configurable-door-breaking-difficulty.patch rename to patches/server/0522-Configurable-door-breaking-difficulty.patch index 627c3d4ee2..4a11a39806 100644 --- a/patches/unapplied/server/0530-Configurable-door-breaking-difficulty.patch +++ b/patches/server/0522-Configurable-door-breaking-difficulty.patch @@ -10,7 +10,7 @@ public net.minecraft.world.entity.monster.Zombie DOOR_BREAKING_PREDICATE Co-authored-by: Doc diff --git a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java -index e6139ff42470cfa9bcad02d746f15b99b1096b48..2acc531bd9e948251cac77d979f973678f576394 100644 +index 9fec5823d99d1ae8e41d9e21f7ddb8b8e94bf887..ad41bbbf5395ed18c2c9e1e692c7661a6e0cb98c 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java +++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java @@ -197,7 +197,7 @@ public class Vindicator extends AbstractIllager { @@ -23,10 +23,10 @@ index e6139ff42470cfa9bcad02d746f15b99b1096b48..2acc531bd9e948251cac77d979f97367 } 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 0911a232dcc334503dbeb5f8198d2acc75a954f0..e58c3e2163be271ff2668a55098ea8f48f8636ad 100644 +index e28718fb76d6c53c31ed358779e28133de49cd7f..b13365fe65507ad2935797a31baa8474b018f516 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -99,7 +99,7 @@ public class Zombie extends Monster { +@@ -100,7 +100,7 @@ public class Zombie extends Monster { public Zombie(EntityType type, Level world) { super(type, world); diff --git a/patches/unapplied/server/0531-Empty-commands-shall-not-be-dispatched.patch b/patches/server/0523-Empty-commands-shall-not-be-dispatched.patch similarity index 84% rename from patches/unapplied/server/0531-Empty-commands-shall-not-be-dispatched.patch rename to patches/server/0523-Empty-commands-shall-not-be-dispatched.patch index 7f1932a7d6..9b41ebaaf7 100644 --- a/patches/unapplied/server/0531-Empty-commands-shall-not-be-dispatched.patch +++ b/patches/server/0523-Empty-commands-shall-not-be-dispatched.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Empty commands shall not be dispatched diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 87ce129e1d592bcf68169feb559f44d5cda7c486..c034a772b95485a91ab800962b7d9dbf3d074a82 100644 +index 148cfe9eac43cafee016d58a1344a97a2e69aa77..c37d9fb4f1fb388e5c264404de378cee298fd253 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -263,6 +263,7 @@ public class Commands { +@@ -269,6 +269,7 @@ public class Commands { command = event.getCommand(); String[] args = command.split(" "); diff --git a/patches/unapplied/server/0532-Remove-stale-POIs.patch b/patches/server/0524-Remove-stale-POIs.patch similarity index 86% rename from patches/unapplied/server/0532-Remove-stale-POIs.patch rename to patches/server/0524-Remove-stale-POIs.patch index 1d7cd63079..3bba02ef7c 100644 --- a/patches/unapplied/server/0532-Remove-stale-POIs.patch +++ b/patches/server/0524-Remove-stale-POIs.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Remove stale POIs diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 838907e8ae95d72797d01188836a05bff01d8a14..fb256e7c60f4e82b028f6768f591098882e27dd1 100644 +index 720568b34c903c80d916a5915c9733c4ed565dcf..752c7ecd4de3cbeded66f457248941f1604dedf5 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2072,6 +2072,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1831,6 +1831,11 @@ public class ServerLevel extends Level implements WorldGenLevel { }); optional1.ifPresent((holder) -> { this.getServer().execute(() -> { diff --git a/patches/unapplied/server/0533-Fix-villager-boat-exploit.patch b/patches/server/0525-Fix-villager-boat-exploit.patch similarity index 88% rename from patches/unapplied/server/0533-Fix-villager-boat-exploit.patch rename to patches/server/0525-Fix-villager-boat-exploit.patch index b0dd823458..3a44dfaa9a 100644 --- a/patches/unapplied/server/0533-Fix-villager-boat-exploit.patch +++ b/patches/server/0525-Fix-villager-boat-exploit.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix villager boat exploit diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index a474db28f74b698621342510d01bf38775794a8e..13e2fb9e48ed8722b68b2ce2994d9d84bb22cee4 100644 +index ceb8e91ba1f14a6d6ab516753f87bbd5b681a18a..62f2a93fe4c9761251ce63bdb95757c72733da7b 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -598,6 +598,14 @@ public abstract class PlayerList { +@@ -585,6 +585,14 @@ public abstract class PlayerList { PlayerList.LOGGER.debug("Removing player mount"); entityplayer.stopRiding(); entity.getPassengersAndSelf().forEach((entity1) -> { diff --git a/patches/unapplied/server/0534-Add-sendOpLevel-API.patch b/patches/server/0526-Add-sendOpLevel-API.patch similarity index 84% rename from patches/unapplied/server/0534-Add-sendOpLevel-API.patch rename to patches/server/0526-Add-sendOpLevel-API.patch index 7afbb5a3c8..347729ba1e 100644 --- a/patches/unapplied/server/0534-Add-sendOpLevel-API.patch +++ b/patches/server/0526-Add-sendOpLevel-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add sendOpLevel API diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 13e2fb9e48ed8722b68b2ce2994d9d84bb22cee4..600bb44d97b477960108ea8cd84a8e734b7e10d0 100644 +index 62f2a93fe4c9761251ce63bdb95757c72733da7b..f8645e19492b8fb3ca4c36611e2d6e5cf84cf9d4 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1086,6 +1086,11 @@ public abstract class PlayerList { +@@ -1080,6 +1080,11 @@ public abstract class PlayerList { } private void sendPlayerPermissionLevel(ServerPlayer player, int permissionLevel) { @@ -20,7 +20,7 @@ index 13e2fb9e48ed8722b68b2ce2994d9d84bb22cee4..600bb44d97b477960108ea8cd84a8e73 if (player.connection != null) { byte b0; -@@ -1100,8 +1105,10 @@ public abstract class PlayerList { +@@ -1094,8 +1099,10 @@ public abstract class PlayerList { player.connection.send(new ClientboundEntityEventPacket(player, b0)); } @@ -32,10 +32,10 @@ index 13e2fb9e48ed8722b68b2ce2994d9d84bb22cee4..600bb44d97b477960108ea8cd84a8e73 public boolean isWhiteListed(GameProfile profile) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 309b489c11387a0a3555813a848b7be978ba2529..04abb49aa5b947e4c265471358981ed41b36ddd6 100644 +index f4572fdcb6cfbfed75436cdd3a9a829b7f47fe3f..d6617dd0b7b57914a4449ab72873b027a73bcd7c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -638,6 +638,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -598,6 +598,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { ? (org.bukkit.entity.Firework) entity.getBukkitEntity() : null; } diff --git a/patches/unapplied/server/0535-TODO-Registry-Modification-API.patch b/patches/server/0527-TODO-Registry-Modification-API.patch similarity index 100% rename from patches/unapplied/server/0535-TODO-Registry-Modification-API.patch rename to patches/server/0527-TODO-Registry-Modification-API.patch diff --git a/patches/unapplied/server/0536-Add-StructuresLocateEvent.patch b/patches/server/0528-Add-StructuresLocateEvent.patch similarity index 99% rename from patches/unapplied/server/0536-Add-StructuresLocateEvent.patch rename to patches/server/0528-Add-StructuresLocateEvent.patch index b2afd4140f..e78150874e 100644 --- a/patches/unapplied/server/0536-Add-StructuresLocateEvent.patch +++ b/patches/server/0528-Add-StructuresLocateEvent.patch @@ -47,7 +47,7 @@ index 0000000000000000000000000000000000000000..09837f6e6c6ab8a1df2aacdb86646993 + } +} diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -index 4da303d7e15496f04f0e27bfb613176bc2a72b76..3c7920721914588a3e7eaf1faff46f7305823416 100644 +index d70317d0306a7b55ba88b0d2360c9b190454e049..511d0afbd7f3593c8a41e64ef716eaa6f32f3bf8 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java @@ -121,6 +121,24 @@ public abstract class ChunkGenerator { diff --git a/patches/unapplied/server/0537-Collision-option-for-requiring-a-player-participant.patch b/patches/server/0529-Collision-option-for-requiring-a-player-participant.patch similarity index 86% rename from patches/unapplied/server/0537-Collision-option-for-requiring-a-player-participant.patch rename to patches/server/0529-Collision-option-for-requiring-a-player-participant.patch index b7ef2ebcfd..e0891b711a 100644 --- a/patches/unapplied/server/0537-Collision-option-for-requiring-a-player-participant.patch +++ b/patches/server/0529-Collision-option-for-requiring-a-player-participant.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Collision option for requiring a player participant diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1bca9f5d58c5adfff3610ab1e7296de3647adaec..3d1cde6740e2b68d8d6e372cb52a6485fc3f7316 100644 +index 37906167da097b6a6308e8c358d6a344c605d550..f30bafd45d038d6abcb929b138b332a18aa84307 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1919,6 +1919,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1842,6 +1842,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { public void push(Entity entity) { if (!this.isPassengerOfSameVehicle(entity)) { if (!entity.noPhysics && !this.noPhysics) { @@ -17,7 +17,7 @@ index 1bca9f5d58c5adfff3610ab1e7296de3647adaec..3d1cde6740e2b68d8d6e372cb52a6485 double d1 = entity.getZ() - this.getZ(); double d2 = Mth.absMax(d0, d1); diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java -index 1f909082eb123bfe37e1078962ee7d71c78a8194..d948850a44464618117c441cca94775b0319b157 100644 +index a719ea3cd6714686ead9c1817e9592733a980444..350d931f99bea1291f890d87fca6ae644c1a9fe9 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java @@ -840,6 +840,7 @@ public abstract class AbstractMinecart extends Entity { @@ -29,10 +29,10 @@ index 1f909082eb123bfe37e1078962ee7d71c78a8194..d948850a44464618117c441cca94775b // CraftBukkit start VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java -index 415c6fd01dd871729c054f916702f9f3062c346c..a459a7889c7462b9c8e6474d987151f15720a98e 100644 +index 7c233b03bac04520f0be9148fcd12282680bd39d..d958715094c8581c5b008568f8384169c507290b 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java -@@ -246,6 +246,7 @@ public class Boat extends Entity implements VariantHolder { +@@ -265,6 +265,7 @@ public class Boat extends Entity implements VariantHolder { @Override public void push(Entity entity) { diff --git a/patches/unapplied/server/0538-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch b/patches/server/0530-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch similarity index 100% rename from patches/unapplied/server/0538-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch rename to patches/server/0530-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch diff --git a/patches/unapplied/server/0539-Return-chat-component-with-empty-text-instead-of-thr.patch b/patches/server/0531-Return-chat-component-with-empty-text-instead-of-thr.patch similarity index 92% rename from patches/unapplied/server/0539-Return-chat-component-with-empty-text-instead-of-thr.patch rename to patches/server/0531-Return-chat-component-with-empty-text-instead-of-thr.patch index a508906e35..17e9def19b 100644 --- a/patches/unapplied/server/0539-Return-chat-component-with-empty-text-instead-of-thr.patch +++ b/patches/server/0531-Return-chat-component-with-empty-text-instead-of-thr.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Return chat component with empty text instead of throwing diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index 4ac91ba7dc754b120189fd32d24076d51b17d7c6..19b0ae77e99c972159cb236403f420baa0cc46e0 100644 +index 877b80ef3028acd9a783adf933286be0a86227bf..1a19c6dc49cac784ca56d92ec755d6ead9811b20 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java @@ -89,7 +89,12 @@ public abstract class AbstractContainerMenu { diff --git a/patches/unapplied/server/0540-Make-schedule-command-per-world.patch b/patches/server/0532-Make-schedule-command-per-world.patch similarity index 100% rename from patches/unapplied/server/0540-Make-schedule-command-per-world.patch rename to patches/server/0532-Make-schedule-command-per-world.patch diff --git a/patches/unapplied/server/0541-Configurable-max-leash-distance.patch b/patches/server/0533-Configurable-max-leash-distance.patch similarity index 86% rename from patches/unapplied/server/0541-Configurable-max-leash-distance.patch rename to patches/server/0533-Configurable-max-leash-distance.patch index 69bb7838fd..c1ac4b5634 100644 --- a/patches/unapplied/server/0541-Configurable-max-leash-distance.patch +++ b/patches/server/0533-Configurable-max-leash-distance.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable max leash distance diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java -index 5f3a14ca456e65894e824864ccf3cd5fabc9c6bd..d84f49457a759f0dd556df8a9634239b530e2761 100644 +index b5964614823059261c28eb2e998ad54249f07e7b..452f219fde958fb4dc775cd2c56c0576c45a8045 100644 --- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java +++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java -@@ -48,7 +48,7 @@ public abstract class PathfinderMob extends Mob { +@@ -56,7 +56,7 @@ public abstract class PathfinderMob extends Mob { float f = this.distanceTo(entity); if (this instanceof TamableAnimal && ((TamableAnimal) this).isInSittingPose()) { @@ -17,7 +17,7 @@ index 5f3a14ca456e65894e824864ccf3cd5fabc9c6bd..d84f49457a759f0dd556df8a9634239b this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit this.dropLeash(true, true); } -@@ -57,7 +57,7 @@ public abstract class PathfinderMob extends Mob { +@@ -65,7 +65,7 @@ public abstract class PathfinderMob extends Mob { } this.onLeashDistance(f); diff --git a/patches/unapplied/server/0542-Implement-BlockPreDispenseEvent.patch b/patches/server/0534-Implement-BlockPreDispenseEvent.patch similarity index 70% rename from patches/unapplied/server/0542-Implement-BlockPreDispenseEvent.patch rename to patches/server/0534-Implement-BlockPreDispenseEvent.patch index 22f893a72f..cf53058fba 100644 --- a/patches/unapplied/server/0542-Implement-BlockPreDispenseEvent.patch +++ b/patches/server/0534-Implement-BlockPreDispenseEvent.patch @@ -5,22 +5,22 @@ Subject: [PATCH] Implement BlockPreDispenseEvent diff --git a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java -index 9ec043ff2cd38e589066a3eb7f42834e4e7592cf..4720b884e1e311f44a012f1219fe648a411247b4 100644 +index d86a5f80171e13c2b1a1fd90b4c1471fadd957b4..edcdaac8078d131cffacae25764a1c3c6ad79923 100644 --- a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java -@@ -92,6 +92,7 @@ public class DispenserBlock extends BaseEntityBlock { - DispenseItemBehavior idispensebehavior = this.getDispenseMethod(itemstack); +@@ -98,6 +98,7 @@ public class DispenserBlock extends BaseEntityBlock { + DispenseItemBehavior idispensebehavior = this.getDispenseMethod(itemstack); - if (idispensebehavior != DispenseItemBehavior.NOOP) { + if (idispensebehavior != DispenseItemBehavior.NOOP) { + if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockPreDispenseEvent(world, pos, itemstack, i)) return; // Paper - BlockPreDispenseEvent is called here - DispenserBlock.eventFired = false; // CraftBukkit - reset event status - tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack)); - } + DispenserBlock.eventFired = false; // CraftBukkit - reset event status + tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack)); + } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 5c6650892892228dd8e9b4fbd62f4f014d6ddff3..1886310fe234ec615055d49ac0c2c77bc4fc7a60 100644 +index 851ac82b242d513015487c15476a66d2b8b2158d..b6648899c2146dbd41c3e4cafabeb3f7db129738 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -2002,5 +2002,11 @@ public class CraftEventFactory { +@@ -2004,5 +2004,11 @@ public class CraftEventFactory { io.papermc.paper.event.block.BlockFailedDispenseEvent event = new io.papermc.paper.event.block.BlockFailedDispenseEvent(block); return event.callEvent(); } diff --git a/patches/unapplied/server/0543-Added-firing-of-PlayerChangeBeaconEffectEvent.patch b/patches/server/0535-Added-firing-of-PlayerChangeBeaconEffectEvent.patch similarity index 63% rename from patches/unapplied/server/0543-Added-firing-of-PlayerChangeBeaconEffectEvent.patch rename to patches/server/0535-Added-firing-of-PlayerChangeBeaconEffectEvent.patch index ff2199df0b..03d8cdf4c8 100644 --- a/patches/unapplied/server/0543-Added-firing-of-PlayerChangeBeaconEffectEvent.patch +++ b/patches/server/0535-Added-firing-of-PlayerChangeBeaconEffectEvent.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Added firing of PlayerChangeBeaconEffectEvent diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -index 79fba896aabe1ff2a19f6c50f5dfdb351587e391..335d0a85378c04dd466fafd42048b2474c815cb9 100644 +index e6a4e8dcdbc49b427c2802f1a358f8f9ad04d0f0..685c35419de7e3c4e854a28118a243e65250ef59 100644 --- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java +++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -@@ -158,13 +158,27 @@ public class BeaconMenu extends AbstractContainerMenu { +@@ -169,13 +169,27 @@ public class BeaconMenu extends AbstractContainerMenu { public MobEffect getSecondaryEffect() { - return MobEffect.byId(this.beaconData.get(2)); + return BeaconMenu.decodeEffect(this.beaconData.get(2)); } + // Paper start + private static @Nullable org.bukkit.potion.PotionEffectType convert(Optional effect) { @@ -22,17 +22,17 @@ index 79fba896aabe1ff2a19f6c50f5dfdb351587e391..335d0a85378c04dd466fafd42048b247 public void updateEffects(Optional primary, Optional secondary) { if (this.paymentSlot.hasItem()) { -- this.beaconData.set(1, (Integer) primary.map(MobEffect::getId).orElse(-1)); -- this.beaconData.set(2, (Integer) secondary.map(MobEffect::getId).orElse(-1)); +- this.beaconData.set(1, BeaconMenu.encodeEffect((MobEffect) primary.orElse(null))); // CraftBukkit - decompile error +- this.beaconData.set(2, BeaconMenu.encodeEffect((MobEffect) secondary.orElse(null))); // CraftBukkit - decompile error + // Paper start + io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent event = new io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent((org.bukkit.entity.Player) this.player.player.getBukkitEntity(), convert(primary), convert(secondary), this.access.getLocation().getBlock()); + if (event.callEvent()) { -+ this.beaconData.set(1, event.getPrimary() == null ? -1 : event.getPrimary().getId()); -+ this.beaconData.set(2, event.getSecondary() == null ? -1 : event.getSecondary().getId()); -+ if (event.willConsumeItem()) { ++ this.beaconData.set(1, BeaconMenu.encodeEffect(event.getPrimary() == null ? null : org.bukkit.craftbukkit.potion.CraftPotionEffectType.bukkitToMinecraft(event.getPrimary()))); ++ this.beaconData.set(2, BeaconMenu.encodeEffect(event.getSecondary() == null ? null : org.bukkit.craftbukkit.potion.CraftPotionEffectType.bukkitToMinecraft(event.getSecondary()))); ++ if (event.willConsumeItem()) { + // Paper end this.paymentSlot.remove(1); -+ } ++ } this.access.execute(Level::blockEntityChanged); + } // Paper end } diff --git a/patches/unapplied/server/0544-Add-toggle-for-always-placing-the-dragon-egg.patch b/patches/server/0536-Add-toggle-for-always-placing-the-dragon-egg.patch similarity index 92% rename from patches/unapplied/server/0544-Add-toggle-for-always-placing-the-dragon-egg.patch rename to patches/server/0536-Add-toggle-for-always-placing-the-dragon-egg.patch index 2dab2241d2..39e24e6044 100644 --- a/patches/unapplied/server/0544-Add-toggle-for-always-placing-the-dragon-egg.patch +++ b/patches/server/0536-Add-toggle-for-always-placing-the-dragon-egg.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add toggle for always placing the dragon egg diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -index 774f408b1520646dd32eb7d66e33946a7e1e72df..bdd394d5fc5b08d0f40c75924e5ad22ec6637af8 100644 +index 7741b27816636aaa48277b2fe14fd7b88cd3d78a..99321471d2c8c154059ebf345c63f8918a4cd75a 100644 --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java @@ -407,7 +407,7 @@ public class EndDragonFight { diff --git a/patches/unapplied/server/0545-Added-PlayerStonecutterRecipeSelectEvent.patch b/patches/server/0537-Added-PlayerStonecutterRecipeSelectEvent.patch similarity index 93% rename from patches/unapplied/server/0545-Added-PlayerStonecutterRecipeSelectEvent.patch rename to patches/server/0537-Added-PlayerStonecutterRecipeSelectEvent.patch index 68ca096d98..0beb3cedcb 100644 --- a/patches/unapplied/server/0545-Added-PlayerStonecutterRecipeSelectEvent.patch +++ b/patches/server/0537-Added-PlayerStonecutterRecipeSelectEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Added PlayerStonecutterRecipeSelectEvent Co-Authored-By: MiniDigger diff --git a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java -index 00f01ab2eff69c18b50ec07b7623af66c66a28b6..1b1f814770d1a906ed880df578845be2e9a14f46 100644 +index 70ecc3f673ebd56b65ad901e10f40c28368cbfac..b430e8cfc3999b7e15183850b0312b8388dca903 100644 --- a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java +++ b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java -@@ -62,7 +62,7 @@ public class StonecutterMenu extends AbstractContainerMenu { +@@ -63,7 +63,7 @@ public class StonecutterMenu extends AbstractContainerMenu { public StonecutterMenu(int syncId, Inventory playerInventory, final ContainerLevelAccess context) { super(MenuType.STONECUTTER, syncId); @@ -18,7 +18,7 @@ index 00f01ab2eff69c18b50ec07b7623af66c66a28b6..1b1f814770d1a906ed880df578845be2 this.recipes = Lists.newArrayList(); this.input = ItemStack.EMPTY; this.slotUpdateListener = () -> { -@@ -160,7 +160,29 @@ public class StonecutterMenu extends AbstractContainerMenu { +@@ -161,7 +161,29 @@ public class StonecutterMenu extends AbstractContainerMenu { @Override public boolean clickMenuButton(net.minecraft.world.entity.player.Player player, int id) { if (this.isValidRecipeIndex(id)) { diff --git a/patches/unapplied/server/0546-Add-dropLeash-variable-to-EntityUnleashEvent.patch b/patches/server/0538-Add-dropLeash-variable-to-EntityUnleashEvent.patch similarity index 92% rename from patches/unapplied/server/0546-Add-dropLeash-variable-to-EntityUnleashEvent.patch rename to patches/server/0538-Add-dropLeash-variable-to-EntityUnleashEvent.patch index 4771f472bb..d803e01df6 100644 --- a/patches/unapplied/server/0546-Add-dropLeash-variable-to-EntityUnleashEvent.patch +++ b/patches/server/0538-Add-dropLeash-variable-to-EntityUnleashEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add dropLeash variable to EntityUnleashEvent diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index cbdbc859416d51d0311ce5f6032a2b4dfe34d3a7..5b134bd0cc4c2ba20eaf275c190c139d987d9bcb 100644 +index 7bbb68bf06e04b58b6c4fa546fe919e387e00b27..c17ea8bdbbd5581b4a2728564fad72f6bb518f66 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1298,12 +1298,15 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1306,12 +1306,15 @@ public abstract class Mob extends LivingEntity implements Targeting { return InteractionResult.PASS; } else if (this.getLeashHolder() == player) { // CraftBukkit start - fire PlayerUnleashEntityEvent @@ -26,7 +26,7 @@ index cbdbc859416d51d0311ce5f6032a2b4dfe34d3a7..5b134bd0cc4c2ba20eaf275c190c139d this.gameEvent(GameEvent.ENTITY_INTERACT, player); return InteractionResult.sidedSuccess(this.level().isClientSide); } else { -@@ -1471,8 +1474,11 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1479,8 +1482,11 @@ public abstract class Mob extends LivingEntity implements Targeting { if (this.leashHolder != null) { if (!this.isAlive() || !this.leashHolder.isAlive()) { @@ -40,7 +40,7 @@ index cbdbc859416d51d0311ce5f6032a2b4dfe34d3a7..5b134bd0cc4c2ba20eaf275c190c139d } } -@@ -1535,8 +1541,11 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1543,8 +1549,11 @@ public abstract class Mob extends LivingEntity implements Targeting { boolean flag1 = super.startRiding(entity, force); if (flag1 && this.isLeashed()) { @@ -54,7 +54,7 @@ index cbdbc859416d51d0311ce5f6032a2b4dfe34d3a7..5b134bd0cc4c2ba20eaf275c190c139d } return flag1; -@@ -1719,8 +1728,11 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1733,8 +1742,11 @@ public abstract class Mob extends LivingEntity implements Targeting { @Override protected void removeAfterChangingDimensions() { super.removeAfterChangingDimensions(); @@ -69,10 +69,10 @@ index cbdbc859416d51d0311ce5f6032a2b4dfe34d3a7..5b134bd0cc4c2ba20eaf275c190c139d if (!itemstack.isEmpty()) { itemstack.setCount(0); diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java -index d84f49457a759f0dd556df8a9634239b530e2761..a4dfe40d30a5abf5d614d0921b3b23023fdbc4b1 100644 +index 452f219fde958fb4dc775cd2c56c0576c45a8045..8e362ad31208d87f4a69a1747485610e0588be51 100644 --- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java +++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java -@@ -49,8 +49,11 @@ public abstract class PathfinderMob extends Mob { +@@ -57,8 +57,11 @@ public abstract class PathfinderMob extends Mob { if (this instanceof TamableAnimal && ((TamableAnimal) this).isInSittingPose()) { if (f > entity.level().paperConfig().misc.maxLeashDistance) { // Paper @@ -86,7 +86,7 @@ index d84f49457a759f0dd556df8a9634239b530e2761..a4dfe40d30a5abf5d614d0921b3b2302 } return; -@@ -58,8 +61,11 @@ public abstract class PathfinderMob extends Mob { +@@ -66,8 +69,11 @@ public abstract class PathfinderMob extends Mob { this.onLeashDistance(f); if (f > entity.level().paperConfig().misc.maxLeashDistance) { // Paper @@ -122,10 +122,10 @@ index 16784fcc853e23689a854e7dc6c03ed8182a164e..4eb97572a97a8d98af37c4223f42fc63 flag1 = true; } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 1886310fe234ec615055d49ac0c2c77bc4fc7a60..e7e113b9d45dda50a38215088a846cc468a53344 100644 +index b6648899c2146dbd41c3e4cafabeb3f7db129738..afa573305f4fff403b72273b2faee76b1cb0e185 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1590,8 +1590,10 @@ public class CraftEventFactory { +@@ -1592,8 +1592,10 @@ public class CraftEventFactory { return itemInHand; } diff --git a/patches/unapplied/server/0547-Reset-shield-blocking-on-dimension-change.patch b/patches/server/0539-Reset-shield-blocking-on-dimension-change.patch similarity index 83% rename from patches/unapplied/server/0547-Reset-shield-blocking-on-dimension-change.patch rename to patches/server/0539-Reset-shield-blocking-on-dimension-change.patch index 64630d789d..8dd35b6b35 100644 --- a/patches/unapplied/server/0547-Reset-shield-blocking-on-dimension-change.patch +++ b/patches/server/0539-Reset-shield-blocking-on-dimension-change.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Reset shield blocking on dimension change diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 4581bdf4525c05df235e47ab772fbf5c5f2d6b50..03bb3c6a7cca2c5363d8c4a8836fea865b571df0 100644 +index 33f04964a2a56d36853d5ef53b79535bc56e7290..2f91d3938a81b058c95bb1bbd7967e8c309d5c15 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1240,6 +1240,11 @@ public class ServerPlayer extends Player { +@@ -1199,6 +1199,11 @@ public class ServerPlayer extends Player { this.level().getCraftServer().getPluginManager().callEvent(changeEvent); // CraftBukkit end } diff --git a/patches/unapplied/server/0548-add-DragonEggFormEvent.patch b/patches/server/0540-add-DragonEggFormEvent.patch similarity index 96% rename from patches/unapplied/server/0548-add-DragonEggFormEvent.patch rename to patches/server/0540-add-DragonEggFormEvent.patch index 82859c7f59..e4c888b12d 100644 --- a/patches/unapplied/server/0548-add-DragonEggFormEvent.patch +++ b/patches/server/0540-add-DragonEggFormEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] add DragonEggFormEvent diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -index bdd394d5fc5b08d0f40c75924e5ad22ec6637af8..5c0767a0bc37b5f0aa3f8892826e58f93f11cf97 100644 +index 99321471d2c8c154059ebf345c63f8918a4cd75a..c29ccc66c95faba425acb0ca06af15e2783b4bae 100644 --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java @@ -407,9 +407,23 @@ public class EndDragonFight { diff --git a/patches/unapplied/server/0549-EntityMoveEvent.patch b/patches/server/0541-EntityMoveEvent.patch similarity index 89% rename from patches/unapplied/server/0549-EntityMoveEvent.patch rename to patches/server/0541-EntityMoveEvent.patch index e451b0d0b8..2bf474bd6f 100644 --- a/patches/unapplied/server/0549-EntityMoveEvent.patch +++ b/patches/server/0541-EntityMoveEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] EntityMoveEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 892830b2d9a15a832040fbeac5fca3d011082c27..d974b6c0f034722a0d2f143843c5a7b280883d5f 100644 +index 2d2e7fe673962cdf21a7623b51e2731132cd3c01..8788b893329dcd424af53224338868bbf410e5a2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1503,6 +1503,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper @@ -17,7 +17,7 @@ index 892830b2d9a15a832040fbeac5fca3d011082c27..d974b6c0f034722a0d2f143843c5a7b2 this.profiler.push(() -> { return worldserver + " " + worldserver.dimension().location(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index fb256e7c60f4e82b028f6768f591098882e27dd1..cfd0e75ac4e7edbd219cc0f5fb802e37737cc4ba 100644 +index 752c7ecd4de3cbeded66f457248941f1604dedf5..cc5e6c2de2fb3455aab134b43ab207467b832107 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -220,6 +220,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -29,10 +29,10 @@ index fb256e7c60f4e82b028f6768f591098882e27dd1..cfd0e75ac4e7edbd219cc0f5fb802e37 final Throwable thr = new Throwable(entity + " Added to world at " + new java.util.Date()); io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(thr); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index e4fd0bc35064e7962c7e43f9d0ee502463a6085f..816f9b66c5d096ac31585ed29b80e11f5fadec87 100644 +index 6b877e084caf931f8f0908c657ed0c8b6124a165..c5b9963c07ac6fb0ffeb2782b2ae22ab4cde2c08 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3333,6 +3333,20 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3362,6 +3362,20 @@ public abstract class LivingEntity extends Entity implements Attackable { this.pushEntities(); this.level().getProfiler().pop(); diff --git a/patches/unapplied/server/0550-added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/0542-added-option-to-disable-pathfinding-updates-on-block.patch similarity index 80% rename from patches/unapplied/server/0550-added-option-to-disable-pathfinding-updates-on-block.patch rename to patches/server/0542-added-option-to-disable-pathfinding-updates-on-block.patch index 9b9906d86e..fb8ea3e316 100644 --- a/patches/unapplied/server/0550-added-option-to-disable-pathfinding-updates-on-block.patch +++ b/patches/server/0542-added-option-to-disable-pathfinding-updates-on-block.patch @@ -5,10 +5,10 @@ Subject: [PATCH] added option to disable pathfinding updates on block changes diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index cfd0e75ac4e7edbd219cc0f5fb802e37737cc4ba..6fc54777e15cebaef7e30702f8537a9a337ad2ed 100644 +index cc5e6c2de2fb3455aab134b43ab207467b832107..b6e2e23d773ca3b9f35c7905bbc0f7681cb4a309 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1652,6 +1652,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1420,6 +1420,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } this.getChunkSource().blockChanged(pos); @@ -16,7 +16,7 @@ index cfd0e75ac4e7edbd219cc0f5fb802e37737cc4ba..6fc54777e15cebaef7e30702f8537a9a VoxelShape voxelshape = oldState.getCollisionShape(this, pos); VoxelShape voxelshape1 = newState.getCollisionShape(this, pos); -@@ -1693,6 +1694,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1461,6 +1462,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } diff --git a/patches/unapplied/server/0551-Inline-shift-direction-fields.patch b/patches/server/0543-Inline-shift-direction-fields.patch similarity index 100% rename from patches/unapplied/server/0551-Inline-shift-direction-fields.patch rename to patches/server/0543-Inline-shift-direction-fields.patch diff --git a/patches/unapplied/server/0552-Allow-adding-items-to-BlockDropItemEvent.patch b/patches/server/0544-Allow-adding-items-to-BlockDropItemEvent.patch similarity index 92% rename from patches/unapplied/server/0552-Allow-adding-items-to-BlockDropItemEvent.patch rename to patches/server/0544-Allow-adding-items-to-BlockDropItemEvent.patch index fa629d404f..8036fdcc36 100644 --- a/patches/unapplied/server/0552-Allow-adding-items-to-BlockDropItemEvent.patch +++ b/patches/server/0544-Allow-adding-items-to-BlockDropItemEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow adding items to BlockDropItemEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index e7e113b9d45dda50a38215088a846cc468a53344..ecf0a23435532cc6a771ef04787bbef190699edb 100644 +index afa573305f4fff403b72273b2faee76b1cb0e185..5bb610230e5686dd8a35c5c14c506ffacd5868c9 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -449,13 +449,30 @@ public class CraftEventFactory { +@@ -451,13 +451,30 @@ public class CraftEventFactory { } public static void handleBlockDropItemEvent(Block block, BlockState state, ServerPlayer player, List items) { diff --git a/patches/unapplied/server/0553-Add-getMainThreadExecutor-to-BukkitScheduler.patch b/patches/server/0545-Add-getMainThreadExecutor-to-BukkitScheduler.patch similarity index 100% rename from patches/unapplied/server/0553-Add-getMainThreadExecutor-to-BukkitScheduler.patch rename to patches/server/0545-Add-getMainThreadExecutor-to-BukkitScheduler.patch diff --git a/patches/unapplied/server/0554-living-entity-allow-attribute-registration.patch b/patches/server/0546-living-entity-allow-attribute-registration.patch similarity index 91% rename from patches/unapplied/server/0554-living-entity-allow-attribute-registration.patch rename to patches/server/0546-living-entity-allow-attribute-registration.patch index bb7fc5b061..680c5b9408 100644 --- a/patches/unapplied/server/0554-living-entity-allow-attribute-registration.patch +++ b/patches/server/0546-living-entity-allow-attribute-registration.patch @@ -5,10 +5,10 @@ Subject: [PATCH] living entity allow attribute registration diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java -index 03561cb69c58e4ed8115a9e67df28d5df1f79bc4..dd1102d5291ef6f18e82400a6d8a0a376cc071e9 100644 +index d5dfb08f550f5644ff5164170d6c16a3b25a3748..7204b973c3ad9239e82355513f6d538107102e48 100644 --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java -@@ -150,4 +150,12 @@ public class AttributeMap { +@@ -152,4 +152,12 @@ public class AttributeMap { } } @@ -41,7 +41,7 @@ index 233e372ba5d785352c9ac12dac37395bac63315c..0e61caa5c9f21788fbeaa90ed75d23e1 return BuiltInRegistries.ATTRIBUTE.get(CraftNamespacedKey.toMinecraft(attribute.getKey())); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index eae5d75cd93416235690196cf2c88e7a17e1b97a..918a938732cd08756f8498c5422f4475fd3b531d 100644 +index 4d41a73281c851c1ff9506074f7590c06105efbb..13b4873923d64ab4b18795ce7f2dbc9a7abf067e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -710,6 +710,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/patches/unapplied/server/0555-fix-dead-slime-setSize-invincibility.patch b/patches/server/0547-fix-dead-slime-setSize-invincibility.patch similarity index 100% rename from patches/unapplied/server/0555-fix-dead-slime-setSize-invincibility.patch rename to patches/server/0547-fix-dead-slime-setSize-invincibility.patch diff --git a/patches/unapplied/server/0556-Merchant-getRecipes-should-return-an-immutable-list.patch b/patches/server/0548-Merchant-getRecipes-should-return-an-immutable-list.patch similarity index 100% rename from patches/unapplied/server/0556-Merchant-getRecipes-should-return-an-immutable-list.patch rename to patches/server/0548-Merchant-getRecipes-should-return-an-immutable-list.patch diff --git a/patches/unapplied/server/0557-Expose-Tracked-Players.patch b/patches/server/0549-Expose-Tracked-Players.patch similarity index 92% rename from patches/unapplied/server/0557-Expose-Tracked-Players.patch rename to patches/server/0549-Expose-Tracked-Players.patch index 7508d57dbc..706316556e 100644 --- a/patches/unapplied/server/0557-Expose-Tracked-Players.patch +++ b/patches/server/0549-Expose-Tracked-Players.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose Tracked Players diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 2a0299d5dcafb9659ffd66fe2cc12843208a7408..fa31c69a84acd20c23f6d466fb0fb36eb4209206 100644 +index 3f2a8efc6ad9e6e2043bf96894c47e578c68e263..de7deb9c27ffb7628124270091a5ba81b075c824 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1352,5 +1352,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { diff --git a/patches/unapplied/server/0558-Remove-streams-from-SensorNearest.patch b/patches/server/0550-Remove-streams-from-SensorNearest.patch similarity index 100% rename from patches/unapplied/server/0558-Remove-streams-from-SensorNearest.patch rename to patches/server/0550-Remove-streams-from-SensorNearest.patch diff --git a/patches/unapplied/server/0560-Improve-ServerGUI.patch b/patches/server/0551-Improve-ServerGUI.patch similarity index 100% rename from patches/unapplied/server/0560-Improve-ServerGUI.patch rename to patches/server/0551-Improve-ServerGUI.patch diff --git a/patches/unapplied/server/0561-fix-converting-txt-to-json-file.patch b/patches/server/0552-fix-converting-txt-to-json-file.patch similarity index 91% rename from patches/unapplied/server/0561-fix-converting-txt-to-json-file.patch rename to patches/server/0552-fix-converting-txt-to-json-file.patch index b587035b13..98eb8e730e 100644 --- a/patches/unapplied/server/0561-fix-converting-txt-to-json-file.patch +++ b/patches/server/0552-fix-converting-txt-to-json-file.patch @@ -21,7 +21,7 @@ index a20d47f54f12dfc0a5f76dd969238e34c958b618..935dac757280731bfeb0a8f033cbe315 this.saveUserBanList(); this.loadIpBanList(); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 31bdf41a3e914c79e42f85b7f0aef439f35288f1..1545acb625ee97e596ccd54d049d47422b8673b3 100644 +index 5d90fc103577a5dab63daf9a23ba46da7eba1e18..c733f30d81c15984c3ab2eb5568a9b762a35bc96 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -198,6 +198,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -48,14 +48,14 @@ index 31bdf41a3e914c79e42f85b7f0aef439f35288f1..1545acb625ee97e596ccd54d049d4742 if (!OldUsersConverter.serverReadyAfterUserconversion(this)) { return false; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 600bb44d97b477960108ea8cd84a8e734b7e10d0..6d333b75f898fc34c7e739a1246a202329f1b9ff 100644 +index f8645e19492b8fb3ca4c36611e2d6e5cf84cf9d4..4c3d0bee54d6458daea83085e3ad0c9db6e3c759 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -186,6 +186,7 @@ public abstract class PlayerList { +@@ -178,6 +178,7 @@ public abstract class PlayerList { this.maxPlayers = maxPlayers; this.playerIo = saveHandler; } + abstract public void loadAndSaveFiles(); // Paper - moved from DedicatedPlayerList constructor - public void placeNewPlayer(Connection connection, ServerPlayer player) { + public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie clientData) { player.isRealPlayer = true; // Paper diff --git a/patches/unapplied/server/0562-Add-worldborder-events.patch b/patches/server/0553-Add-worldborder-events.patch similarity index 100% rename from patches/unapplied/server/0562-Add-worldborder-events.patch rename to patches/server/0553-Add-worldborder-events.patch diff --git a/patches/unapplied/server/0563-added-PlayerNameEntityEvent.patch b/patches/server/0554-added-PlayerNameEntityEvent.patch similarity index 100% rename from patches/unapplied/server/0563-added-PlayerNameEntityEvent.patch rename to patches/server/0554-added-PlayerNameEntityEvent.patch diff --git a/patches/unapplied/server/0564-Prevent-grindstones-from-overstacking-items.patch b/patches/server/0555-Prevent-grindstones-from-overstacking-items.patch similarity index 100% rename from patches/unapplied/server/0564-Prevent-grindstones-from-overstacking-items.patch rename to patches/server/0555-Prevent-grindstones-from-overstacking-items.patch diff --git a/patches/unapplied/server/0565-Add-recipe-to-cook-events.patch b/patches/server/0556-Add-recipe-to-cook-events.patch similarity index 68% rename from patches/unapplied/server/0565-Add-recipe-to-cook-events.patch rename to patches/server/0556-Add-recipe-to-cook-events.patch index 6599e0cc50..7c85fab78b 100644 --- a/patches/unapplied/server/0565-Add-recipe-to-cook-events.patch +++ b/patches/server/0556-Add-recipe-to-cook-events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add recipe to cook events 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 5ea9a6e9fa197fd00952c5ade426d7de50497a5e..d1eff8a4c83227d74502b5924df43f87c457a537 100644 +index b6e31bede16f7dbc9abb6609f1c39b82883512b2..963386d26c1beef3730bcf65ef74676d881c8c70 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 @@ -437,7 +437,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -18,26 +18,28 @@ index 5ea9a6e9fa197fd00952c5ade426d7de50497a5e..d1eff8a4c83227d74502b5924df43f87 if (furnaceSmeltEvent.isCancelled()) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java -index ca995270c9b8d7024504a9ba885b1c0214b33a8b..0cd019dc20ff5b3e7ee663866f98595081e991a3 100644 +index 24e2063db933bfbc8fc1f34edb8106ae4d7c633c..04b2697ee857e714b1202d02d093b0c60f079a6f 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java -@@ -62,7 +62,9 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { +@@ -63,8 +63,10 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { if (campfire.cookingProgress[i] >= campfire.cookingTime[i]) { SimpleContainer inventorysubcontainer = new SimpleContainer(new ItemStack[]{itemstack}); -- ItemStack itemstack1 = (ItemStack) campfire.quickCheck.getRecipeFor(inventorysubcontainer, world).map((recipecampfire) -> { -+ Optional recipe = campfire.quickCheck.getRecipeFor( inventorysubcontainer, world); -+ ItemStack itemstack1 = (ItemStack) recipe.map((recipecampfire) -> { +- ItemStack itemstack1 = (ItemStack) campfire.quickCheck.getRecipeFor(inventorysubcontainer, world).map((recipeholder) -> { +- return ((CampfireCookingRecipe) recipeholder.value()).assemble(inventorysubcontainer, world.registryAccess()); ++ Optional> recipeHolderOptional = campfire.quickCheck.getRecipeFor( inventorysubcontainer, world); ++ ItemStack itemstack1 = (ItemStack) recipeHolderOptional.map((recipeholder) -> { + // Paper end - return recipecampfire.assemble(inventorysubcontainer, world.registryAccess()); ++ return recipeholder.value().assemble(inventorysubcontainer, world.registryAccess()); }).orElse(itemstack); -@@ -71,7 +73,7 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { + if (itemstack1.isItemEnabled(world.enabledFeatures())) { +@@ -72,7 +74,7 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { CraftItemStack source = CraftItemStack.asCraftMirror(itemstack); org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1); - BlockCookEvent blockCookEvent = new BlockCookEvent(CraftBlock.at(world, pos), source, result); -+ BlockCookEvent blockCookEvent = new BlockCookEvent(CraftBlock.at(world, pos), source, result, (org.bukkit.inventory.CookingRecipe) recipe.map(CampfireCookingRecipe::toBukkitRecipe).orElse(null)); // Paper ++ BlockCookEvent blockCookEvent = new BlockCookEvent(CraftBlock.at(world, pos), source, result, (org.bukkit.inventory.CookingRecipe) recipeHolderOptional.map(RecipeHolder::toBukkitRecipe).orElse(null)); // Paper world.getCraftServer().getPluginManager().callEvent(blockCookEvent); if (blockCookEvent.isCancelled()) { diff --git a/patches/unapplied/server/0566-Add-Block-isValidTool.patch b/patches/server/0557-Add-Block-isValidTool.patch similarity index 100% rename from patches/unapplied/server/0566-Add-Block-isValidTool.patch rename to patches/server/0557-Add-Block-isValidTool.patch diff --git a/patches/unapplied/server/0567-Allow-using-signs-inside-spawn-protection.patch b/patches/server/0558-Allow-using-signs-inside-spawn-protection.patch similarity index 89% rename from patches/unapplied/server/0567-Allow-using-signs-inside-spawn-protection.patch rename to patches/server/0558-Allow-using-signs-inside-spawn-protection.patch index 85554c8409..74e1e4d7a5 100644 --- a/patches/unapplied/server/0567-Allow-using-signs-inside-spawn-protection.patch +++ b/patches/server/0558-Allow-using-signs-inside-spawn-protection.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow using signs inside spawn protection diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 240b1f8efa672fb6d1967ef2b895c6710596e2cd..8a63c2e82360fc90bf9f75c5ec4c580f40d2436d 100644 +index 2921754736ce51b76337e1ef9d052e680af01db5..daca7fecba44a05d61d4537d6660f8707de91941 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1831,7 +1831,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1718,7 +1718,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl int i = this.player.level().getMaxBuildHeight(); if (blockposition.getY() < i) { diff --git a/patches/unapplied/server/0568-Expand-world-key-API.patch b/patches/server/0559-Expand-world-key-API.patch similarity index 89% rename from patches/unapplied/server/0568-Expand-world-key-API.patch rename to patches/server/0559-Expand-world-key-API.patch index 1be399cca7..18aadc903a 100644 --- a/patches/unapplied/server/0568-Expand-world-key-API.patch +++ b/patches/server/0559-Expand-world-key-API.patch @@ -20,10 +20,10 @@ index b5981001d8ad4d6c79b965be9a446352971b0d29..0624ba7f1f5b352a5730b6b4736b2499 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f7acc0c4e385c48ca651166baf33caa247e582f6..16b0ab4e66072e4367212a3977cc075b62716efc 100644 +index d09fb11e67364a2c54bf6412b1a8a48797ece3be..7396ab40cd4b807babf7bbf3ac05c58efd8eb1df 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1137,9 +1137,15 @@ public final class CraftServer implements Server { +@@ -1140,9 +1140,15 @@ public final class CraftServer implements Server { File folder = new File(this.getWorldContainer(), name); World world = this.getWorld(name); @@ -41,7 +41,7 @@ index f7acc0c4e385c48ca651166baf33caa247e582f6..16b0ab4e66072e4367212a3977cc075b if (folder.exists()) { Preconditions.checkArgument(folder.isDirectory(), "File (%s) exists and isn't a folder", name); -@@ -1226,7 +1232,7 @@ public final class CraftServer implements Server { +@@ -1229,7 +1235,7 @@ public final class CraftServer implements Server { } else if (name.equals(levelName + "_the_end")) { worldKey = net.minecraft.world.level.Level.END; } else { @@ -50,7 +50,7 @@ index f7acc0c4e385c48ca651166baf33caa247e582f6..16b0ab4e66072e4367212a3977cc075b } ServerLevel internal = (ServerLevel) new ServerLevel(this.console, console.executor, worldSession, worlddata, worldKey, worlddimension, this.getServer().progressListenerFactory.create(11), -@@ -1318,6 +1324,15 @@ public final class CraftServer implements Server { +@@ -1321,6 +1327,15 @@ public final class CraftServer implements Server { return null; } @@ -67,10 +67,10 @@ index f7acc0c4e385c48ca651166baf33caa247e582f6..16b0ab4e66072e4367212a3977cc075b // Check if a World already exists with the UID. if (this.getWorld(world.getUID()) != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index c168dbfa5bc4aa49a1d743fe4b53d8169f01e1a0..16ef907b9443b9feedd768d0116762799fee9ab3 100644 +index 0fb0c8238be1e199220ef62576547ea6c9484a9c..1f21a5c60c5472b1694d379326d391c0866456cc 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -523,6 +523,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -524,6 +524,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public int nextEntityId() { return net.minecraft.world.entity.Entity.nextEntityId(); } diff --git a/patches/unapplied/server/0569-Add-fast-alternative-constructor-for-Rotations.patch b/patches/server/0560-Add-fast-alternative-constructor-for-Rotations.patch similarity index 100% rename from patches/unapplied/server/0569-Add-fast-alternative-constructor-for-Rotations.patch rename to patches/server/0560-Add-fast-alternative-constructor-for-Rotations.patch diff --git a/patches/unapplied/server/0570-Item-Rarity-API.patch b/patches/server/0561-Item-Rarity-API.patch similarity index 94% rename from patches/unapplied/server/0570-Item-Rarity-API.patch rename to patches/server/0561-Item-Rarity-API.patch index 3e21a97a84..2a9be0545b 100644 --- a/patches/unapplied/server/0570-Item-Rarity-API.patch +++ b/patches/server/0561-Item-Rarity-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Item Rarity API public net.minecraft.world.item.Item rarity diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 16ef907b9443b9feedd768d0116762799fee9ab3..2a08fca2c863717b72341772630cd4b690f34968 100644 +index 1f21a5c60c5472b1694d379326d391c0866456cc..d50b92daec5fec3056af9620681da28b10222829 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -528,6 +528,20 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -529,6 +529,20 @@ public final class CraftMagicNumbers implements UnsafeValues { public String getMainLevelName() { return ((net.minecraft.server.dedicated.DedicatedServer) net.minecraft.server.MinecraftServer.getServer()).getProperties().levelName; } diff --git a/patches/unapplied/server/0571-Drop-carried-item-when-player-has-disconnected.patch b/patches/server/0562-Drop-carried-item-when-player-has-disconnected.patch similarity index 88% rename from patches/unapplied/server/0571-Drop-carried-item-when-player-has-disconnected.patch rename to patches/server/0562-Drop-carried-item-when-player-has-disconnected.patch index 4cc04af3a6..09bf44e024 100644 --- a/patches/unapplied/server/0571-Drop-carried-item-when-player-has-disconnected.patch +++ b/patches/server/0562-Drop-carried-item-when-player-has-disconnected.patch @@ -7,10 +7,10 @@ Fixes disappearance of held items, when a player gets disconnected and PlayerDro Closes #5036 diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 6d333b75f898fc34c7e739a1246a202329f1b9ff..f375947876c5c834bdab66a26a06b3a43c08e65d 100644 +index 4c3d0bee54d6458daea83085e3ad0c9db6e3c759..b1ade7ad31fb7d42379333c9875d26b664135517 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -591,6 +591,14 @@ public abstract class PlayerList { +@@ -578,6 +578,14 @@ public abstract class PlayerList { } // Paper end diff --git a/patches/unapplied/server/0572-forced-whitelist-use-configurable-kick-message.patch b/patches/server/0563-forced-whitelist-use-configurable-kick-message.patch similarity index 87% rename from patches/unapplied/server/0572-forced-whitelist-use-configurable-kick-message.patch rename to patches/server/0563-forced-whitelist-use-configurable-kick-message.patch index 0df3f326fa..c2b3e16df5 100644 --- a/patches/unapplied/server/0572-forced-whitelist-use-configurable-kick-message.patch +++ b/patches/server/0563-forced-whitelist-use-configurable-kick-message.patch @@ -5,10 +5,10 @@ Subject: [PATCH] forced whitelist: use configurable kick message diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d974b6c0f034722a0d2f143843c5a7b280883d5f..17e963f927c81dfb6bf10f621c76c6631fd2dd97 100644 +index 8788b893329dcd424af53224338868bbf410e5a2..a708e61770ebe77cb43791eb033aeba2f6b3abab 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2147,7 +2147,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop type, Level world) { super(type, world); -@@ -76,7 +77,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -72,7 +73,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { protected void addBehaviourGoals() { this.goalSelector.addGoal(2, new ZombieAttackGoal(this, 1.0D, false)); this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D)); @@ -25,7 +25,7 @@ index f1d4a66aa55c4328fe6f834830d70686c95bea51..aff140cfb2bbdce8b512080cf394c84c this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt)); this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true)); } -@@ -184,6 +185,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -180,6 +181,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { this.level().getCraftServer().getPluginManager().callEvent(event); if (event.isCancelled()) { this.setPersistentAngerTarget(null); diff --git a/patches/unapplied/server/0583-fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/0574-fix-PlayerItemHeldEvent-firing-twice.patch similarity index 85% rename from patches/unapplied/server/0583-fix-PlayerItemHeldEvent-firing-twice.patch rename to patches/server/0574-fix-PlayerItemHeldEvent-firing-twice.patch index 740a0421c6..67c50141f5 100644 --- a/patches/unapplied/server/0583-fix-PlayerItemHeldEvent-firing-twice.patch +++ b/patches/server/0574-fix-PlayerItemHeldEvent-firing-twice.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix PlayerItemHeldEvent firing twice diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 4f3ffde225a46439563c3b33f48a0197bf74bbf1..d22f9a39a7655ed41ad21f5794b7b2c77d582310 100644 +index 84d8775c591a8c9f0cd843c20b2f0076139f0810..0c32edbe85d849a1b0a125ad6a9bfc6a2e50c8b7 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2045,6 +2045,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1887,6 +1887,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (this.player.isImmobile()) return; // CraftBukkit if (packet.getSlot() >= 0 && packet.getSlot() < Inventory.getSelectionSize()) { diff --git a/patches/unapplied/server/0584-Added-PlayerDeepSleepEvent.patch b/patches/server/0575-Added-PlayerDeepSleepEvent.patch similarity index 85% rename from patches/unapplied/server/0584-Added-PlayerDeepSleepEvent.patch rename to patches/server/0575-Added-PlayerDeepSleepEvent.patch index cbc35ad165..e77b33f0bb 100644 --- a/patches/unapplied/server/0584-Added-PlayerDeepSleepEvent.patch +++ b/patches/server/0575-Added-PlayerDeepSleepEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Added PlayerDeepSleepEvent 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 b36492efc3d6338e0099988c1ff31e7211b7d010..b3634a1d92182c746948862fc64b2e47d11320ba 100644 +index c44f8ed810b0c9a510d7e1c07987323a8a620ca4..dee00042a780b053cd094081874aad221abf1b2b 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -252,6 +252,11 @@ public abstract class Player extends LivingEntity { +@@ -253,6 +253,11 @@ public abstract class Player extends LivingEntity { if (this.isSleeping()) { ++this.sleepCounter; diff --git a/patches/unapplied/server/0585-More-World-API.patch b/patches/server/0576-More-World-API.patch similarity index 96% rename from patches/unapplied/server/0585-More-World-API.patch rename to patches/server/0576-More-World-API.patch index e37650b54c..01cbab2e38 100644 --- a/patches/unapplied/server/0585-More-World-API.patch +++ b/patches/server/0576-More-World-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] More World API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 3e5ba6392c25e2bf9503a5429e96ffb04147ac99..47f8ad80011142aac611441029d71787c85450f2 100644 +index c4df1d66ecdecef0aa03d4995d9e951421dae6dd..202ebd562ec1e2b3f1087424da60cadca5da7d01 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2088,6 +2088,69 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2093,6 +2093,69 @@ public class CraftWorld extends CraftRegionAccessor implements World { return new CraftStructureSearchResult(CraftStructure.minecraftToBukkit(found.getSecond().value(), this.getHandle().registryAccess()), CraftLocation.toBukkit(found.getFirst(), this)); } diff --git a/patches/unapplied/server/0586-Added-PlayerBedFailEnterEvent.patch b/patches/server/0577-Added-PlayerBedFailEnterEvent.patch similarity index 100% rename from patches/unapplied/server/0586-Added-PlayerBedFailEnterEvent.patch rename to patches/server/0577-Added-PlayerBedFailEnterEvent.patch diff --git a/patches/unapplied/server/0588-Implement-methods-to-convert-between-Component-and-B.patch b/patches/server/0578-Implement-methods-to-convert-between-Component-and-B.patch similarity index 96% rename from patches/unapplied/server/0588-Implement-methods-to-convert-between-Component-and-B.patch rename to patches/server/0578-Implement-methods-to-convert-between-Component-and-B.patch index f90999918d..e03948e6e9 100644 --- a/patches/unapplied/server/0588-Implement-methods-to-convert-between-Component-and-B.patch +++ b/patches/server/0578-Implement-methods-to-convert-between-Component-and-B.patch @@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..dd6012b6a097575b2d1471be5069ecce + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 00a75a9bee2ffac80d334fe60ddd69ee526341fb..36838ed14523c30676762bd8ed8d4ee644ae3422 100644 +index e9f92a8c225f5f035d35c98743ed7af26cb064c0..c0e822386bdc3724ca1f24a0ed4fb60e96d9b9eb 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -209,6 +209,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface diff --git a/patches/unapplied/server/0589-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch b/patches/server/0579-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch similarity index 87% rename from patches/unapplied/server/0589-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch rename to patches/server/0579-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch index e962799f8b..4da17e796d 100644 --- a/patches/unapplied/server/0589-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch +++ b/patches/server/0579-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix anchor respawn acting as a bed respawn from the end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f375947876c5c834bdab66a26a06b3a43c08e65d..f55c2f6f0b18456565cac50b9def91071497dee0 100644 +index b1ade7ad31fb7d42379333c9875d26b664135517..ac52a17c47a35a364c0c6e36b0e4dcd117b3f266 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -810,6 +810,7 @@ public abstract class PlayerList { +@@ -805,6 +805,7 @@ public abstract class PlayerList { // Paper start boolean isBedSpawn = false; @@ -17,7 +17,7 @@ index f375947876c5c834bdab66a26a06b3a43c08e65d..f55c2f6f0b18456565cac50b9def9107 boolean isRespawn = false; boolean isLocAltered = false; // Paper - Fix SPIGOT-5989 // Paper end -@@ -830,6 +831,7 @@ public abstract class PlayerList { +@@ -825,6 +826,7 @@ public abstract class PlayerList { if (optional.isPresent()) { BlockState iblockdata = worldserver1.getBlockState(blockposition); boolean flag3 = iblockdata.is(Blocks.RESPAWN_ANCHOR); @@ -25,7 +25,7 @@ index f375947876c5c834bdab66a26a06b3a43c08e65d..f55c2f6f0b18456565cac50b9def9107 Vec3 vec3d = (Vec3) optional.get(); float f1; -@@ -858,7 +860,7 @@ public abstract class PlayerList { +@@ -853,7 +855,7 @@ public abstract class PlayerList { } Player respawnPlayer = entityplayer1.getBukkitEntity(); diff --git a/patches/unapplied/server/0590-Introduce-beacon-activation-deactivation-events.patch b/patches/server/0580-Introduce-beacon-activation-deactivation-events.patch similarity index 89% rename from patches/unapplied/server/0590-Introduce-beacon-activation-deactivation-events.patch rename to patches/server/0580-Introduce-beacon-activation-deactivation-events.patch index fc24c634c3..d28ff36b79 100644 --- a/patches/unapplied/server/0590-Introduce-beacon-activation-deactivation-events.patch +++ b/patches/server/0580-Introduce-beacon-activation-deactivation-events.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Introduce beacon activation/deactivation events diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index f3fb7e07ca65cb1c948b110b7f7edc8b0bd83b21..147e808c7e2b3ed16861c989c1ba4a0b99a5be38 100644 +index 3a50fe20294048a1c818ae717a918bb1aed74dea..ca91b82a21a46b1a62564b5157882a845eae8737 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 -@@ -212,6 +212,15 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -221,6 +221,15 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name BeaconBlockEntity.playSound(world, pos, SoundEvents.BEACON_AMBIENT); } } @@ -24,7 +24,7 @@ index f3fb7e07ca65cb1c948b110b7f7edc8b0bd83b21..147e808c7e2b3ed16861c989c1ba4a0b if (blockEntity.lastCheckY >= l) { blockEntity.lastCheckY = world.getMinBuildHeight() - 1; -@@ -269,6 +278,10 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -278,6 +287,10 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @Override public void setRemoved() { diff --git a/patches/unapplied/server/0591-add-RespawnFlags-to-PlayerRespawnEvent.patch b/patches/server/0581-add-RespawnFlags-to-PlayerRespawnEvent.patch similarity index 88% rename from patches/unapplied/server/0591-add-RespawnFlags-to-PlayerRespawnEvent.patch rename to patches/server/0581-add-RespawnFlags-to-PlayerRespawnEvent.patch index 567c5d7709..2a885d920d 100644 --- a/patches/unapplied/server/0591-add-RespawnFlags-to-PlayerRespawnEvent.patch +++ b/patches/server/0581-add-RespawnFlags-to-PlayerRespawnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] add RespawnFlags to PlayerRespawnEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index d22f9a39a7655ed41ad21f5794b7b2c77d582310..aa0a524ad7200648731fcc5e702470872c0ac3cb 100644 +index 0c32edbe85d849a1b0a125ad6a9bfc6a2e50c8b7..961bb94f61b7bea88aa9371bf804b503ca405bcf 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2769,7 +2769,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2621,7 +2621,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl case PERFORM_RESPAWN: if (this.player.wonGame) { this.player.wonGame = false; @@ -18,10 +18,10 @@ index d22f9a39a7655ed41ad21f5794b7b2c77d582310..aa0a524ad7200648731fcc5e70247087 } else { if (this.player.getHealth() > 0.0F) { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f55c2f6f0b18456565cac50b9def91071497dee0..3dbad6f9ea70db07a9bfa199b28def6a67353d80 100644 +index ac52a17c47a35a364c0c6e36b0e4dcd117b3f266..43dd6dbbc510320432aaafc1c5e4e91117fd8189 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -769,6 +769,12 @@ public abstract class PlayerList { +@@ -764,6 +764,12 @@ public abstract class PlayerList { } public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason) { @@ -34,7 +34,7 @@ index f55c2f6f0b18456565cac50b9def91071497dee0..3dbad6f9ea70db07a9bfa199b28def6a entityplayer.stopRiding(); // CraftBukkit this.players.remove(entityplayer); this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot -@@ -860,7 +866,7 @@ public abstract class PlayerList { +@@ -855,7 +861,7 @@ public abstract class PlayerList { } Player respawnPlayer = entityplayer1.getBukkitEntity(); diff --git a/patches/unapplied/server/0592-Add-Channel-initialization-listeners.patch b/patches/server/0582-Add-Channel-initialization-listeners.patch similarity index 89% rename from patches/unapplied/server/0592-Add-Channel-initialization-listeners.patch rename to patches/server/0582-Add-Channel-initialization-listeners.patch index e6a071010b..2a9c57a5c7 100644 --- a/patches/unapplied/server/0592-Add-Channel-initialization-listeners.patch +++ b/patches/server/0582-Add-Channel-initialization-listeners.patch @@ -122,10 +122,10 @@ index 0000000000000000000000000000000000000000..0d7e7db9e37ef0183c32b217bd944fb4 + COMPRESSION_DISABLED +} diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index a1467e8edd3ca66c306d01e0688a9fece69652f3..0968827df66057ec73185ce688a62e8b27abba0c 100644 +index 7a98ea71fead97d3e18fa9774eb970359c18d931..07fc88f8d057c59070e5de97b91c5bf5760ff09a 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -644,6 +644,7 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -621,6 +621,7 @@ public class Connection extends SimpleChannelInboundHandler> { } else { this.channel.pipeline().addBefore("encoder", "compress", new CompressionEncoder(compressionThreshold)); } @@ -133,7 +133,7 @@ index a1467e8edd3ca66c306d01e0688a9fece69652f3..0968827df66057ec73185ce688a62e8b } else { if (this.channel.pipeline().get("decompress") instanceof CompressionDecoder) { this.channel.pipeline().remove("decompress"); -@@ -652,6 +653,7 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -629,6 +630,7 @@ public class Connection extends SimpleChannelInboundHandler> { if (this.channel.pipeline().get("compress") instanceof CompressionEncoder) { this.channel.pipeline().remove("compress"); } @@ -142,14 +142,14 @@ index a1467e8edd3ca66c306d01e0688a9fece69652f3..0968827df66057ec73185ce688a62e8b } diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java -index bb9e65eee7e0ca0f715cd5791c47579a57b1b577..29a0a720f22f56ca3d844efef1ecde3980fb1c12 100644 +index c98d3c5afcce17a6f13f8d456b9f77b1f2a4f3f0..2ea40a23539898b9c817440aafc91f4b5fd10977 100644 --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java +++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java @@ -113,6 +113,7 @@ public class ServerConnectionListener { pending.add(object); // Paper - channelpipeline.addLast("packet_handler", (ChannelHandler) object); - ((Connection) object).setListener(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object)); + ((Connection) object).configurePacketHandler(channelpipeline); + ((Connection) object).setListenerForServerboundHandshake(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object)); + io.papermc.paper.network.ChannelInitializeListenerHolder.callListeners(channel); // Paper } - }).group((EventLoopGroup) lazyinitvar.get()).localAddress(address, port)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit + }).group(eventloopgroup).localAddress(address, port)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit } diff --git a/patches/unapplied/server/0593-Send-empty-commands-if-tab-completion-is-disabled.patch b/patches/server/0583-Send-empty-commands-if-tab-completion-is-disabled.patch similarity index 88% rename from patches/unapplied/server/0593-Send-empty-commands-if-tab-completion-is-disabled.patch rename to patches/server/0583-Send-empty-commands-if-tab-completion-is-disabled.patch index 4d853da0a7..d0ff308b9e 100644 --- a/patches/unapplied/server/0593-Send-empty-commands-if-tab-completion-is-disabled.patch +++ b/patches/server/0583-Send-empty-commands-if-tab-completion-is-disabled.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Send empty commands if tab completion is disabled diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index c034a772b95485a91ab800962b7d9dbf3d074a82..14c78028ff51fff6f24174ae16b7c42d34d6041a 100644 +index c37d9fb4f1fb388e5c264404de378cee298fd253..5fd7e5aa0644fda8e2f7f57eef9a6f0011534cb9 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -396,7 +396,12 @@ public class Commands { +@@ -402,7 +402,12 @@ public class Commands { } public void sendCommands(ServerPlayer player) { diff --git a/patches/unapplied/server/0594-Add-more-WanderingTrader-API.patch b/patches/server/0584-Add-more-WanderingTrader-API.patch similarity index 93% rename from patches/unapplied/server/0594-Add-more-WanderingTrader-API.patch rename to patches/server/0584-Add-more-WanderingTrader-API.patch index c46d758e8c..5205274499 100644 --- a/patches/unapplied/server/0594-Add-more-WanderingTrader-API.patch +++ b/patches/server/0584-Add-more-WanderingTrader-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add more WanderingTrader API diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -index 65592c41b1519eff77ccd7ddd3c885058f3ed138..2e7de2378e01aed514e237029d6d64e78871c9b4 100644 +index 5ea5f424c55f60bf63d3a4d3fe51362939f42f4c..1cef116b692ebdf3ade01cde533d1e5182a05a91 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -@@ -56,6 +56,10 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -60,6 +60,10 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill @Nullable private BlockPos wanderTarget; private int despawnDelay; @@ -19,7 +19,7 @@ index 65592c41b1519eff77ccd7ddd3c885058f3ed138..2e7de2378e01aed514e237029d6d64e7 public WanderingTrader(EntityType type, Level world) { super(type, world); -@@ -66,10 +70,10 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -70,10 +74,10 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill protected void registerGoals() { this.goalSelector.addGoal(0, new FloatGoal(this)); this.goalSelector.addGoal(0, new UseItemGoal<>(this, PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.INVISIBILITY), SoundEvents.WANDERING_TRADER_DISAPPEARED, (entityvillagertrader) -> { diff --git a/patches/unapplied/server/0595-Add-EntityBlockStorage-clearEntities.patch b/patches/server/0585-Add-EntityBlockStorage-clearEntities.patch similarity index 100% rename from patches/unapplied/server/0595-Add-EntityBlockStorage-clearEntities.patch rename to patches/server/0585-Add-EntityBlockStorage-clearEntities.patch diff --git a/patches/server/0586-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch b/patches/server/0586-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch new file mode 100644 index 0000000000..85efd06d0c --- /dev/null +++ b/patches/server/0586-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alvinn8 <42838560+Alvinn8@users.noreply.github.com> +Date: Fri, 8 Jan 2021 20:31:13 +0100 +Subject: [PATCH] Add Adventure message to PlayerAdvancementDoneEvent + + +diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java +index d03db10517b2df98b40ab48e450333960508aabf..e38e2e5a7ddba9c140f362021b6be0b0974f7cd1 100644 +--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java ++++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java +@@ -237,11 +237,17 @@ public class PlayerAdvancements { + this.progressChanged.add(advancement); + flag = true; + if (!flag1 && advancementprogress.isDone()) { +- this.player.level().getCraftServer().getPluginManager().callEvent(new org.bukkit.event.player.PlayerAdvancementDoneEvent(this.player.getBukkitEntity(), advancement.toBukkit())); // CraftBukkit ++ // Paper start - Add Adventure message to PlayerAdvancementDoneEvent ++ final net.kyori.adventure.text.Component message = advancement.value().display().flatMap(info -> java.util.Optional.ofNullable(info.shouldAnnounceChat() ? io.papermc.paper.adventure.PaperAdventure.asAdventure(Component.translatable("chat.type.advancement." + info.getFrame().getName(), this.player.getDisplayName(), Advancement.name(advancement))) : null)).orElse(null); ++ final org.bukkit.event.player.PlayerAdvancementDoneEvent event = new org.bukkit.event.player.PlayerAdvancementDoneEvent(this.player.getBukkitEntity(), advancement.toBukkit(), message); ++ this.player.level().getCraftServer().getPluginManager().callEvent(event); // CraftBukkit ++ // Paper end + advancement.value().rewards().grant(this.player); + advancement.value().display().ifPresent((advancementdisplay) -> { +- if (advancementdisplay.shouldAnnounceChat() && this.player.level().getGameRules().getBoolean(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)) { +- this.playerList.broadcastSystemMessage(Component.translatable("chat.type.advancement." + advancementdisplay.getFrame().getName(), this.player.getDisplayName(), Advancement.name(advancement)), false); ++ // Paper start - Add Adventure message to PlayerAdvancementDoneEvent ++ if (event.message() != null && this.player.level().getGameRules().getBoolean(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)) { ++ this.playerList.broadcastSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.message()), false); ++ // Paper end + } + + }); diff --git a/patches/unapplied/server/0597-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch b/patches/server/0587-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch similarity index 74% rename from patches/unapplied/server/0597-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch rename to patches/server/0587-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch index 32ba58aa32..9ded5db62c 100644 --- a/patches/unapplied/server/0597-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch +++ b/patches/server/0587-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch @@ -5,19 +5,19 @@ Subject: [PATCH] Add raw address to AsyncPlayerPreLoginEvent diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index c9f8f61c43428c519c0dac1b7416bad775e3429f..b026c003e1fc02a9ea426f3126acb788fc09a874 100644 +index 25afcd025d32c76232910bcc7d6607eef3c4167d..e0070317d7c51e239cef45c248ab7bd7544fe56c 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -331,12 +331,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - public void fireEvents() throws Exception { - String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName(); +@@ -289,12 +289,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, + public void fireEvents(GameProfile gameprofile) throws Exception { + String playerName = gameprofile.getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); -+ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.channel.remoteAddress()).getAddress(); // Paper - java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId(); ++ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.channel.remoteAddress()).getAddress(); // Paper + java.util.UUID uniqueId = gameprofile.getId(); final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; // Paper start - com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile); + com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(gameprofile); - AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile); + AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile); // Paper - add rawAddress server.getPluginManager().callEvent(asyncEvent); diff --git a/patches/unapplied/server/0598-Inventory-close.patch b/patches/server/0588-Inventory-close.patch similarity index 100% rename from patches/unapplied/server/0598-Inventory-close.patch rename to patches/server/0588-Inventory-close.patch diff --git a/patches/unapplied/server/0599-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch b/patches/server/0589-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch similarity index 92% rename from patches/unapplied/server/0599-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch rename to patches/server/0589-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch index 1e99a5d4c4..33c6b6d97f 100644 --- a/patches/unapplied/server/0599-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch +++ b/patches/server/0589-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add a "should burn in sunlight" API for Phantoms and diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -index ef525e5f523966c9af7380e8d09ff5092e56e7c5..9ca1e9d95e62929c0015d5ca2c2f9c70e421842e 100644 +index 6be9e8d693bbb084791d7b30a1891ddb803d6b02..8e9469fec42f7b6a132cf173f6f5a95777a29b3b 100644 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java @@ -98,9 +98,15 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @@ -48,10 +48,10 @@ index ef525e5f523966c9af7380e8d09ff5092e56e7c5..9ca1e9d95e62929c0015d5ca2c2f9c70 @Override public void setItemSlot(EquipmentSlot slot, ItemStack stack) { diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java -index ab639cb2faaafaeb33be91bfe99ffad6d23088db..4a132c3eff6978e927bcd4df56b9ce0306af6d19 100644 +index a40852acf5d175cc3a06bc17fb021c76f0c11a28..5b4719dd7c3b8f93c898779f45239568f6a5fe43 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java +++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java -@@ -144,7 +144,7 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -145,7 +145,7 @@ public class Phantom extends FlyingMob implements Enemy { @Override public void aiStep() { @@ -60,7 +60,7 @@ index ab639cb2faaafaeb33be91bfe99ffad6d23088db..4a132c3eff6978e927bcd4df56b9ce03 this.setSecondsOnFire(8); } -@@ -175,6 +175,9 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -176,6 +176,9 @@ public class Phantom extends FlyingMob implements Enemy { if (nbt.hasUUID("Paper.SpawningEntity")) { this.spawningEntity = nbt.getUUID("Paper.SpawningEntity"); } @@ -70,7 +70,7 @@ index ab639cb2faaafaeb33be91bfe99ffad6d23088db..4a132c3eff6978e927bcd4df56b9ce03 // Paper end } -@@ -189,6 +192,7 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -190,6 +193,7 @@ public class Phantom extends FlyingMob implements Enemy { if (this.spawningEntity != null) { nbt.putUUID("Paper.SpawningEntity", this.spawningEntity); } @@ -78,7 +78,7 @@ index ab639cb2faaafaeb33be91bfe99ffad6d23088db..4a132c3eff6978e927bcd4df56b9ce03 // Paper end } -@@ -253,6 +257,10 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -258,6 +262,10 @@ public class Phantom extends FlyingMob implements Enemy { return spawningEntity; } public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; } diff --git a/patches/unapplied/server/0600-Fix-CraftPotionBrewer-cache.patch b/patches/server/0590-Fix-CraftPotionBrewer-cache.patch similarity index 100% rename from patches/unapplied/server/0600-Fix-CraftPotionBrewer-cache.patch rename to patches/server/0590-Fix-CraftPotionBrewer-cache.patch diff --git a/patches/unapplied/server/0601-Add-basic-Datapack-API.patch b/patches/server/0591-Add-basic-Datapack-API.patch similarity index 94% rename from patches/unapplied/server/0601-Add-basic-Datapack-API.patch rename to patches/server/0591-Add-basic-Datapack-API.patch index 6d28b1c553..0f023f246b 100644 --- a/patches/unapplied/server/0601-Add-basic-Datapack-API.patch +++ b/patches/server/0591-Add-basic-Datapack-API.patch @@ -92,10 +92,10 @@ index 0000000000000000000000000000000000000000..cf4374493c11057451a62a655514415c + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 16b0ab4e66072e4367212a3977cc075b62716efc..dcfb99b289a35b66cd39b88761684e73c50ab2ba 100644 +index 7396ab40cd4b807babf7bbf3ac05c58efd8eb1df..5dc8db6134c52442cf5abdca152deaaa86495b4d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -301,6 +301,7 @@ public final class CraftServer implements Server { +@@ -304,6 +304,7 @@ public final class CraftServer implements Server { public boolean ignoreVanillaPermissions = false; private final List playerView; public int reloadCount; @@ -103,7 +103,7 @@ index 16b0ab4e66072e4367212a3977cc075b62716efc..dcfb99b289a35b66cd39b88761684e73 public static Exception excessiveVelEx; // Paper - Velocity warnings static { -@@ -390,6 +391,7 @@ public final class CraftServer implements Server { +@@ -393,6 +394,7 @@ public final class CraftServer implements Server { if (this.configuration.getBoolean("settings.use-map-color-cache")) { MapPalette.setMapColorCache(new CraftMapColorCache(this.logger)); } @@ -111,7 +111,7 @@ index 16b0ab4e66072e4367212a3977cc075b62716efc..dcfb99b289a35b66cd39b88761684e73 } public boolean getCommandBlockOverride(String command) { -@@ -2842,5 +2844,11 @@ public final class CraftServer implements Server { +@@ -2845,5 +2847,11 @@ public final class CraftServer implements Server { public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() { return mobGoals; } diff --git a/patches/unapplied/server/0602-Add-environment-variable-to-disable-server-gui.patch b/patches/server/0592-Add-environment-variable-to-disable-server-gui.patch similarity index 85% rename from patches/unapplied/server/0602-Add-environment-variable-to-disable-server-gui.patch rename to patches/server/0592-Add-environment-variable-to-disable-server-gui.patch index 56b953c03b..67817d5306 100644 --- a/patches/unapplied/server/0602-Add-environment-variable-to-disable-server-gui.patch +++ b/patches/server/0592-Add-environment-variable-to-disable-server-gui.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add environment variable to disable server gui diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 27eb466c3f5f4342f892d1c55c15108ae6861912..f035065aa46a8c1a2c3064b82208fbdc5ac4463d 100644 +index 6e89b87dec5f9cb5e5657be0a6d23ae5edf7d2bd..cb986e6aa28729b6037ec380ad41c717cfcb7ef3 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -304,6 +304,7 @@ public class Main { +@@ -299,6 +299,7 @@ public class Main { */ boolean flag1 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui"); diff --git a/patches/unapplied/server/0603-additions-to-PlayerGameModeChangeEvent.patch b/patches/server/0593-additions-to-PlayerGameModeChangeEvent.patch similarity index 92% rename from patches/unapplied/server/0603-additions-to-PlayerGameModeChangeEvent.patch rename to patches/server/0593-additions-to-PlayerGameModeChangeEvent.patch index e3ad37907e..c7ef10a7bc 100644 --- a/patches/unapplied/server/0603-additions-to-PlayerGameModeChangeEvent.patch +++ b/patches/server/0593-additions-to-PlayerGameModeChangeEvent.patch @@ -45,10 +45,10 @@ index aee8618e27b893b72931e925724dd683d2e6d2aa..5cb15e2209d7b315904a1fc6d650ce1e } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 03bb3c6a7cca2c5363d8c4a8836fea865b571df0..0162c504673f5809b28ca58177773c005460f039 100644 +index 2f91d3938a81b058c95bb1bbd7967e8c309d5c15..26733cb73d117af56457f7119f372c33a7dd1649 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1885,8 +1885,16 @@ public class ServerPlayer extends Player { +@@ -1844,8 +1844,16 @@ public class ServerPlayer extends Player { } public boolean setGameMode(GameType gameMode) { @@ -67,7 +67,7 @@ index 03bb3c6a7cca2c5363d8c4a8836fea865b571df0..0162c504673f5809b28ca58177773c00 } else { this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.CHANGE_GAME_MODE, (float) gameMode.getId())); if (gameMode == GameType.SPECTATOR) { -@@ -1898,7 +1906,7 @@ public class ServerPlayer extends Player { +@@ -1857,7 +1865,7 @@ public class ServerPlayer extends Player { this.onUpdateAbilities(); this.updateEffectVisibility(); @@ -76,7 +76,7 @@ index 03bb3c6a7cca2c5363d8c4a8836fea865b571df0..0162c504673f5809b28ca58177773c00 } } -@@ -2317,6 +2325,16 @@ public class ServerPlayer extends Player { +@@ -2264,6 +2272,16 @@ public class ServerPlayer extends Player { } public void loadGameTypes(@Nullable CompoundTag nbt) { @@ -94,7 +94,7 @@ index 03bb3c6a7cca2c5363d8c4a8836fea865b571df0..0162c504673f5809b28ca58177773c00 } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index c256423e9dc9d1837b847da44fb2920c58842c8b..0cb9803e30702de1cc530c1205fe9bbb4dcb2c08 100644 +index 89f0c3d6e4dc9701f02fa7ed5331c3969de81ffc..0a15cda0919c0adf5009a023c17b3e25cc365623 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java @@ -73,21 +73,28 @@ public class ServerPlayerGameMode { @@ -131,10 +131,10 @@ index c256423e9dc9d1837b847da44fb2920c58842c8b..0cb9803e30702de1cc530c1205fe9bbb } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index aa0a524ad7200648731fcc5e702470872c0ac3cb..bb483fbc201c6041bafc75d822b46e5d06cd75dc 100644 +index 961bb94f61b7bea88aa9371bf804b503ca405bcf..4d71ba9c16f4ff72a31eaf51a7264711b5e0ce1f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2778,7 +2778,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2630,7 +2630,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player = this.server.getPlayerList().respawn(this.player, false, RespawnReason.DEATH); if (this.server.isHardcore()) { @@ -144,10 +144,10 @@ index aa0a524ad7200648731fcc5e702470872c0ac3cb..bb483fbc201c6041bafc75d822b46e5d } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 04abb49aa5b947e4c265471358981ed41b36ddd6..d8c95d53b923b2e269ae3f5afa77a5a93187bab8 100644 +index d6617dd0b7b57914a4449ab72873b027a73bcd7c..8b75e41b379c5fb31c579be01dd96e0be88b9bd1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1562,7 +1562,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1522,7 +1522,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Preconditions.checkArgument(mode != null, "GameMode cannot be null"); if (this.getHandle().connection == null) return; diff --git a/patches/unapplied/server/0604-ItemStack-repair-check-API.patch b/patches/server/0594-ItemStack-repair-check-API.patch similarity index 95% rename from patches/unapplied/server/0604-ItemStack-repair-check-API.patch rename to patches/server/0594-ItemStack-repair-check-API.patch index 51821ed50d..77d7423de8 100644 --- a/patches/unapplied/server/0604-ItemStack-repair-check-API.patch +++ b/patches/server/0594-ItemStack-repair-check-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack repair check API diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index e540a219e26ecb1b2f93df01a34dd754faea1f10..cab2f4ae154a6159ead1b95dbf02ebcbb1051dd8 100644 +index da21cb49d986f899ed174c8c1abd35bcb03d31f2..1e70a661ec459edb1bca28ddf0a833c95c2453ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -543,6 +543,14 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -544,6 +544,14 @@ public final class CraftMagicNumbers implements UnsafeValues { return io.papermc.paper.inventory.ItemRarity.values()[getItem(itemStack.getType()).getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()]; } diff --git a/patches/unapplied/server/0605-More-Enchantment-API.patch b/patches/server/0595-More-Enchantment-API.patch similarity index 98% rename from patches/unapplied/server/0605-More-Enchantment-API.patch rename to patches/server/0595-More-Enchantment-API.patch index cfea07c2f9..7cd15497dc 100644 --- a/patches/unapplied/server/0605-More-Enchantment-API.patch +++ b/patches/server/0595-More-Enchantment-API.patch @@ -66,7 +66,7 @@ index 57decf4156f176ebcc988478c17856cbc555c5e4..3d0ce0803e1da8a2681a3cb41096ac94 public net.minecraft.world.item.enchantment.Enchantment getHandle() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 918a938732cd08756f8498c5422f4475fd3b531d..dcc7c8efe0b9d6b57841d8318499d490a3f7aa73 100644 +index 13b4873923d64ab4b18795ce7f2dbc9a7abf067e..9d9616a4adcbcc0d2567bdcf0d57efdabda076d4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -949,5 +949,21 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/patches/unapplied/server/0606-Move-range-check-for-block-placing-up.patch b/patches/server/0596-Move-range-check-for-block-placing-up.patch similarity index 84% rename from patches/unapplied/server/0606-Move-range-check-for-block-placing-up.patch rename to patches/server/0596-Move-range-check-for-block-placing-up.patch index 9aa2d5113f..e12fc1fd3b 100644 --- a/patches/unapplied/server/0606-Move-range-check-for-block-placing-up.patch +++ b/patches/server/0596-Move-range-check-for-block-placing-up.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Move range check for block placing up diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index bb483fbc201c6041bafc75d822b46e5d06cd75dc..b7b9575b84f35757c24ad43bd187e2bd623d672c 100644 +index 4d71ba9c16f4ff72a31eaf51a7264711b5e0ce1f..60b03c03bd5497acc617b81ef9a47910d9a9a8c9 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1817,6 +1817,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1704,6 +1704,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (itemstack.isItemEnabled(worldserver.enabledFeatures())) { BlockHitResult movingobjectpositionblock = packet.getHitResult(); Vec3 vec3d = movingobjectpositionblock.getLocation(); diff --git a/patches/unapplied/server/0607-Fix-and-optimise-world-force-upgrading.patch b/patches/server/0597-Fix-and-optimise-world-force-upgrading.patch similarity index 93% rename from patches/unapplied/server/0607-Fix-and-optimise-world-force-upgrading.patch rename to patches/server/0597-Fix-and-optimise-world-force-upgrading.patch index 6126a02958..f881d3694a 100644 --- a/patches/unapplied/server/0607-Fix-and-optimise-world-force-upgrading.patch +++ b/patches/server/0597-Fix-and-optimise-world-force-upgrading.patch @@ -247,18 +247,18 @@ index 0000000000000000000000000000000000000000..513833c2ea23df5b079d157bc5cb89d5 + } +} diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index f035065aa46a8c1a2c3064b82208fbdc5ac4463d..0303b7f80fe0939ce1e50cdfd3d93456f09a8259 100644 +index cb986e6aa28729b6037ec380ad41c717cfcb7ef3..06a2210ba7d17fe1676d59794639211e20c1d7ea 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -18,6 +18,7 @@ import java.nio.file.Paths; +@@ -16,6 +16,7 @@ import java.nio.file.Path; + import java.nio.file.Paths; import java.util.Optional; - import java.util.UUID; import java.util.function.BooleanSupplier; +import io.papermc.paper.world.ThreadedWorldUpgrader; import joptsimple.NonOptionArgumentSpec; import joptsimple.OptionParser; import joptsimple.OptionSet; -@@ -362,6 +363,15 @@ public class Main { +@@ -357,6 +358,15 @@ public class Main { return new WorldLoader.InitConfig(worldloader_d, Commands.CommandSelection.DEDICATED, serverPropertiesHandler.functionPermissionLevel); } @@ -275,10 +275,10 @@ index f035065aa46a8c1a2c3064b82208fbdc5ac4463d..0303b7f80fe0939ce1e50cdfd3d93456 Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, dimensionOptionsRegistry, eraseCache); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 17e963f927c81dfb6bf10f621c76c6631fd2dd97..3054716dda1fcfe6c457d81dd89c82bf6acc64a3 100644 +index a708e61770ebe77cb43791eb033aeba2f6b3abab..8f24c53f4c0d399d8583a862025da62445b1547d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -551,11 +551,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here @@ -326,10 +326,10 @@ index 1577b7317b85708d39d4171321df785a8107bdb2..51dc136b9a5006382de4b12275a9c2f2 return this.world; } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index 29da08c58200c24fd03003937d30eb41234cabc9..d3d4d10a77af51cff4da201201bac325427fc20c 100644 +index 390569f89b21c375357fb71d7b7730f0ea789545..16346d727a854996ec1d2adb56ebca2a9ff7ab3b 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -@@ -60,6 +60,31 @@ public class RegionFileStorage implements AutoCloseable { +@@ -30,6 +30,31 @@ public final class RegionFileStorage implements AutoCloseable { this.sync = dsync; } @@ -358,14 +358,14 @@ index 29da08c58200c24fd03003937d30eb41234cabc9..d3d4d10a77af51cff4da201201bac325 + } + // Paper end + - // Paper start - public synchronized RegionFile getRegionFileIfLoaded(ChunkPos chunkcoordintpair) { - return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ())); + private RegionFile getRegionFile(ChunkPos chunkcoordintpair, boolean existingOnly) throws IOException { // CraftBukkit + long i = ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()); + RegionFile regionfile = (RegionFile) this.regionCache.getAndMoveToFirst(i); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index dcfb99b289a35b66cd39b88761684e73c50ab2ba..492642f3fad94a0770c94d2090f51a3bdd57638c 100644 +index 5dc8db6134c52442cf5abdca152deaaa86495b4d..a1e10f2dc1786b6f0f1058b3fcac69ca7d10cc15 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1214,9 +1214,7 @@ public final class CraftServer implements Server { +@@ -1217,9 +1217,7 @@ public final class CraftServer implements Server { worlddata.checkName(name); worlddata.setModdedInfo(this.console.getServerModName(), this.console.getModdedStatus().shouldReportAsModified()); @@ -376,7 +376,7 @@ index dcfb99b289a35b66cd39b88761684e73c50ab2ba..492642f3fad94a0770c94d2090f51a3b long j = BiomeManager.obfuscateSeed(creator.seed()); List list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata)); -@@ -1227,6 +1225,13 @@ public final class CraftServer implements Server { +@@ -1230,6 +1228,13 @@ public final class CraftServer implements Server { biomeProvider = generator.getDefaultBiomeProvider(worldInfo); } diff --git a/patches/unapplied/server/0608-Add-Mob-lookAt-API.patch b/patches/server/0598-Add-Mob-lookAt-API.patch similarity index 100% rename from patches/unapplied/server/0608-Add-Mob-lookAt-API.patch rename to patches/server/0598-Add-Mob-lookAt-API.patch diff --git a/patches/unapplied/server/0609-Add-Unix-domain-socket-support.patch b/patches/server/0599-Add-Unix-domain-socket-support.patch similarity index 83% rename from patches/unapplied/server/0609-Add-Unix-domain-socket-support.patch rename to patches/server/0599-Add-Unix-domain-socket-support.patch index bff6d3af8d..f3d44d2321 100644 --- a/patches/unapplied/server/0609-Add-Unix-domain-socket-support.patch +++ b/patches/server/0599-Add-Unix-domain-socket-support.patch @@ -11,7 +11,7 @@ Tested-by: Mariell Hoversholm Reviewed-by: Mariell Hoversholm diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 36838ed14523c30676762bd8ed8d4ee644ae3422..7d917aa8376fed8004f30e92bf88face17165a92 100644 +index c0e822386bdc3724ca1f24a0ed4fb60e96d9b9eb..34728cebe2de88e0a935707ea9969e068c0f6d7e 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -219,6 +219,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -53,10 +53,10 @@ index 36838ed14523c30676762bd8ed8d4ee644ae3422..7d917aa8376fed8004f30e92bf88face DedicatedServer.LOGGER.warn("**** FAILED TO BIND TO PORT!"); DedicatedServer.LOGGER.warn("The exception was: {}", ioexception.toString()); diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java -index 29a0a720f22f56ca3d844efef1ecde3980fb1c12..838244e3680ea6020701e10bafbde7f52976eaa1 100644 +index 2ea40a23539898b9c817440aafc91f4b5fd10977..2e7540b0e100347cd91624c9d61a5c4688a52b26 100644 --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java +++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java -@@ -77,7 +77,12 @@ public class ServerConnectionListener { +@@ -76,7 +76,12 @@ public class ServerConnectionListener { this.running = true; } @@ -69,32 +69,34 @@ index 29a0a720f22f56ca3d844efef1ecde3980fb1c12..838244e3680ea6020701e10bafbde7f5 List list = this.channels; synchronized (this.channels) { -@@ -85,7 +90,11 @@ public class ServerConnectionListener { - LazyLoadedValue lazyinitvar; +@@ -84,7 +89,13 @@ public class ServerConnectionListener { + EventLoopGroup eventloopgroup; if (Epoll.isAvailable() && this.server.isEpollEnabled()) { ++ // Paper start + if (address instanceof io.netty.channel.unix.DomainSocketAddress) { + oclass = io.netty.channel.epoll.EpollServerDomainSocketChannel.class; + } else { oclass = EpollServerSocketChannel.class; + } - lazyinitvar = ServerConnectionListener.SERVER_EPOLL_EVENT_GROUP; ++ // Paper end + eventloopgroup = (EventLoopGroup) ServerConnectionListener.SERVER_EPOLL_EVENT_GROUP.get(); ServerConnectionListener.LOGGER.info("Using epoll channel type"); } else { -@@ -115,7 +124,7 @@ public class ServerConnectionListener { - ((Connection) object).setListener(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object)); +@@ -115,7 +126,7 @@ public class ServerConnectionListener { + ((Connection) object).setListenerForServerboundHandshake(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object)); io.papermc.paper.network.ChannelInitializeListenerHolder.callListeners(channel); // Paper } -- }).group((EventLoopGroup) lazyinitvar.get()).localAddress(address, port)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit -+ }).group((EventLoopGroup) lazyinitvar.get()).localAddress(address)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit // Paper +- }).group(eventloopgroup).localAddress(address, port)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit ++ }).group(eventloopgroup).localAddress(address)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit // Paper } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b7b9575b84f35757c24ad43bd187e2bd623d672c..967ed1f44a4d7c97a14d9415541df000698e8aad 100644 +index 60b03c03bd5497acc617b81ef9a47910d9a9a8c9..b69d5c474d2cb1bd40c09ff1c644db4546530f80 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2612,6 +2612,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2453,6 +2453,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Spigot Start public SocketAddress getRawAddress() { @@ -107,11 +109,11 @@ index b7b9575b84f35757c24ad43bd187e2bd623d672c..967ed1f44a4d7c97a14d9415541df000 } // Spigot End diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -index 50c79be12cf8778a2ce451a8c9bb2cdc277d6830..8393c1a2d15d5ad255c9808b0d0edd6aeb447893 100644 +index 5d372b390f3046b4ce19296803c5fbfee798e69b..2824369960130fa3d0ad416a3961024c8f8d5f52 100644 --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java @@ -45,6 +45,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL - this.connection.setProtocol(ConnectionProtocol.LOGIN); + this.connection.setClientboundProtocolAfterHandshake(ClientIntent.LOGIN); // CraftBukkit start - Connection throttle try { + if (!(this.connection.channel.localAddress() instanceof io.netty.channel.unix.DomainSocketAddress)) { // Paper - the connection throttle is useless when you have a Unix domain socket @@ -132,10 +134,10 @@ index 50c79be12cf8778a2ce451a8c9bb2cdc277d6830..8393c1a2d15d5ad255c9808b0d0edd6a if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.BYPASS_HOSTCHECK || ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { // Paper + // Paper start - Unix domain socket support + java.net.SocketAddress socketAddress = connection.getRemoteAddress(); - packet.hostName = split[0]; + connection.hostname = split[0]; - connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort()); + connection.address = new java.net.InetSocketAddress(split[1], socketAddress instanceof java.net.InetSocketAddress ? ((java.net.InetSocketAddress) socketAddress).getPort() : 0); + // Paper end - connection.spoofedUUID = com.mojang.util.UUIDTypeAdapter.fromString( split[2] ); + connection.spoofedUUID = com.mojang.util.UndashedUuid.fromStringLenient( split[2] ); } else { diff --git a/patches/unapplied/server/0610-Add-EntityInsideBlockEvent.patch b/patches/server/0600-Add-EntityInsideBlockEvent.patch similarity index 95% rename from patches/unapplied/server/0610-Add-EntityInsideBlockEvent.patch rename to patches/server/0600-Add-EntityInsideBlockEvent.patch index 3b92f58b4e..aef98d33da 100644 --- a/patches/unapplied/server/0610-Add-EntityInsideBlockEvent.patch +++ b/patches/server/0600-Add-EntityInsideBlockEvent.patch @@ -29,7 +29,7 @@ index b51e18d01fa9a06a3478694884f465f12dd89b8a..ee4b3ac212483995bb8ae990bebfb8aa int i = this.getSignalForState(state); diff --git a/src/main/java/net/minecraft/world/level/block/BigDripleafBlock.java b/src/main/java/net/minecraft/world/level/block/BigDripleafBlock.java -index 6b1692368df4165f4170380e58a6c2f93db39449..5921f7ebb56e1d5d3004ae327271873093cff357 100644 +index a6f245a516714615cf1f204e54eb7ab5248cafe7..54cf35b0c48d96ecfb27ff13cd685c16a1cd616b 100644 --- a/src/main/java/net/minecraft/world/level/block/BigDripleafBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BigDripleafBlock.java @@ -170,6 +170,7 @@ public class BigDripleafBlock extends HorizontalDirectionalBlock implements Bone @@ -41,10 +41,10 @@ index 6b1692368df4165f4170380e58a6c2f93db39449..5921f7ebb56e1d5d3004ae3272718730 if (state.getValue(BigDripleafBlock.TILT) == Tilt.NONE && BigDripleafBlock.canEntityTilt(pos, entity) && !world.hasNeighborSignal(pos)) { // CraftBukkit start - tilt dripleaf diff --git a/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java b/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java -index 3da8d49f7e36d8f1c0873bec32123971e53d2a31..461288cb56793f11e8dac80720b36cb9b42da518 100644 +index 42265fa901aeb2bb7a564cc94162a938208c1f90..ed36a378b79f62c3dce3da637a337595415f14ac 100644 --- a/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java -@@ -38,6 +38,7 @@ public class BubbleColumnBlock extends Block implements BucketPickup { +@@ -40,6 +40,7 @@ public class BubbleColumnBlock extends Block implements BucketPickup { @Override public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { @@ -77,10 +77,10 @@ index 2c3bbe4f295be9782c11af13c2cf9c05f27313d9..0003fb51ae3a6575575e10b4c86719f3 entity.hurt(world.damageSources().cactus(), 1.0F); CraftEventFactory.blockDamage = null; // CraftBukkit diff --git a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java -index dffd1a48e54b4b15195ba066dc9d73c7a91650ea..219c87dcf065e86512f330fbeec59e55f4675083 100644 +index 495be2b5c4c52d4925385a12f63774d827c8907a..7700461b8cd0bde1bf6c0d5e4b73184bed1adc4e 100644 --- a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java -@@ -92,6 +92,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB +@@ -93,6 +93,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB @Override public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { @@ -89,10 +89,10 @@ index dffd1a48e54b4b15195ba066dc9d73c7a91650ea..219c87dcf065e86512f330fbeec59e55 org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = CraftBlock.at(world, pos); // CraftBukkit entity.hurt(world.damageSources().inFire(), (float) this.fireDamage); diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java -index 4ad158fd18ba9d6723d8e1b697147e8488c71abb..08d442713bf0cc4f01f693c9a2fbd1a17a6fa348 100644 +index feb82a1c55c94702e484a6170c25e72110ecbe8b..c5608f72a8f2ad2640f32fa63c69a6ef69d746da 100644 --- a/src/main/java/net/minecraft/world/level/block/CropBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java -@@ -163,6 +163,7 @@ public class CropBlock extends BushBlock implements BonemealableBlock { +@@ -167,6 +167,7 @@ public class CropBlock extends BushBlock implements BonemealableBlock { @Override public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { @@ -149,7 +149,7 @@ index f2206cea243b2281471bc9e939dd79971b0025eb..745f33ce496a7ce8c788f24c093b3793 this.maybeDoSlideAchievement(entity, pos); this.doSlideMovement(entity); diff --git a/src/main/java/net/minecraft/world/level/block/HopperBlock.java b/src/main/java/net/minecraft/world/level/block/HopperBlock.java -index 151f3e1f8e55b75957b84c495e1c1ed7008a6f28..c8e7e82dd81d9faf8f06612291c40f541304eb82 100644 +index 67833347206a913f0eb2d8d9ae14f14fe0e4d181..4311c97edd2a70e9ed8fed3fdf9471c513ddc1d4 100644 --- a/src/main/java/net/minecraft/world/level/block/HopperBlock.java +++ b/src/main/java/net/minecraft/world/level/block/HopperBlock.java @@ -200,6 +200,7 @@ public class HopperBlock extends BaseEntityBlock { @@ -197,10 +197,10 @@ index 69f34c566bf825259253abbefd7d7ba2e847231b..a6ab0d0defc05e56a91084c498970596 // CraftBukkit start - Entity in portal EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ())); diff --git a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java -index 94e0bf98753d3dee5ad275e4783682025f687ddf..593eae04ecf6dee86c9c3664ddcdc3f86d042e66 100644 +index 2762ec1b3404e8761733119a8ead0aecef328c85..20fdd6cc35bec8f707a83fb682257f68163ed6fc 100644 --- a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java +++ b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java -@@ -96,6 +96,7 @@ public class PitcherCropBlock extends DoublePlantBlock implements BonemealableBl +@@ -87,6 +87,7 @@ public class PitcherCropBlock extends DoublePlantBlock implements BonemealableBl @Override public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { @@ -209,10 +209,10 @@ index 94e0bf98753d3dee5ad275e4783682025f687ddf..593eae04ecf6dee86c9c3664ddcdc3f8 world.destroyBlock(pos, true, entity); } diff --git a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java -index 8a71ef8422be64154dc79eb670def635492fb06a..7e04ecba2a14be0f0d47c917368abd2a2bd64a05 100644 +index 022484a7386a8a02468134fc7b2d7916398cf015..e6fcea4482d5d87ed78beefad4c57bc86089460f 100644 --- a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java +++ b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java -@@ -55,6 +55,7 @@ public class PowderSnowBlock extends Block implements BucketPickup { +@@ -56,6 +56,7 @@ public class PowderSnowBlock extends Block implements BucketPickup { @Override public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { @@ -221,7 +221,7 @@ index 8a71ef8422be64154dc79eb670def635492fb06a..7e04ecba2a14be0f0d47c917368abd2a entity.makeStuckInBlock(state, new Vec3(0.8999999761581421D, 1.5D, 0.8999999761581421D)); if (world.isClientSide) { diff --git a/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java b/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java -index 9421eb279f509872725544bba3e3112a92bbe5a1..08a11888133b97e52535cb49cad218a1b6c6ac97 100644 +index 89c86d10840bc8fa73465a6a548c48fab9ac55ea..34eb7ba1adb51e394bf46a6f643db3529626d9ec 100644 --- a/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java @@ -77,6 +77,7 @@ public class SweetBerryBushBlock extends BushBlock implements BonemealableBlock diff --git a/patches/unapplied/server/0611-Attributes-API-for-item-defaults.patch b/patches/server/0601-Attributes-API-for-item-defaults.patch similarity index 91% rename from patches/unapplied/server/0611-Attributes-API-for-item-defaults.patch rename to patches/server/0601-Attributes-API-for-item-defaults.patch index 003b920e39..46d838e328 100644 --- a/patches/unapplied/server/0611-Attributes-API-for-item-defaults.patch +++ b/patches/server/0601-Attributes-API-for-item-defaults.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Attributes API for item defaults diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index cab2f4ae154a6159ead1b95dbf02ebcbb1051dd8..7f870317139db136103cb72b2aa57bcba9f6e793 100644 +index 1e70a661ec459edb1bca28ddf0a833c95c2453ac..1123bba2af7c707e8237fb1336f0b958861c4119 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -551,6 +551,19 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -552,6 +552,19 @@ public final class CraftMagicNumbers implements UnsafeValues { return CraftMagicNumbers.getItem(itemToBeRepaired.getType()).isValidRepairItem(CraftItemStack.asNMSCopy(itemToBeRepaired), CraftItemStack.asNMSCopy(repairMaterial)); } diff --git a/patches/unapplied/server/0612-Add-cause-to-Weather-ThunderChangeEvents.patch b/patches/server/0602-Add-cause-to-Weather-ThunderChangeEvents.patch similarity index 90% rename from patches/unapplied/server/0612-Add-cause-to-Weather-ThunderChangeEvents.patch rename to patches/server/0602-Add-cause-to-Weather-ThunderChangeEvents.patch index a1eb1bd220..320f771f31 100644 --- a/patches/unapplied/server/0612-Add-cause-to-Weather-ThunderChangeEvents.patch +++ b/patches/server/0602-Add-cause-to-Weather-ThunderChangeEvents.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add cause to Weather/ThunderChangeEvents diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 6fc54777e15cebaef7e30702f8537a9a337ad2ed..e63cb62affc88d1482f9926ae459986e2d213fb0 100644 +index b6e2e23d773ca3b9f35c7905bbc0f7681cb4a309..c16d0e4f30e7b3c6d2c0b320353646589a84c6c8 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -672,8 +672,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -437,8 +437,8 @@ public class ServerLevel extends Level implements WorldGenLevel { this.serverLevelData.setClearWeatherTime(clearDuration); this.serverLevelData.setRainTime(rainDuration); this.serverLevelData.setThunderTime(rainDuration); @@ -19,7 +19,7 @@ index 6fc54777e15cebaef7e30702f8537a9a337ad2ed..e63cb62affc88d1482f9926ae459986e } @Override -@@ -1085,8 +1085,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -855,8 +855,8 @@ public class ServerLevel extends Level implements WorldGenLevel { this.serverLevelData.setThunderTime(j); this.serverLevelData.setRainTime(k); this.serverLevelData.setClearWeatherTime(i); @@ -30,7 +30,7 @@ index 6fc54777e15cebaef7e30702f8537a9a337ad2ed..e63cb62affc88d1482f9926ae459986e } this.oThunderLevel = this.thunderLevel; -@@ -1152,14 +1152,14 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -922,14 +922,14 @@ public class ServerLevel extends Level implements WorldGenLevel { private void resetWeatherCycle() { // CraftBukkit start @@ -48,7 +48,7 @@ index 6fc54777e15cebaef7e30702f8537a9a337ad2ed..e63cb62affc88d1482f9926ae459986e // If we stop due to everyone sleeping we should reset the weather duration to some other random value. // Not that everyone ever manages to get the whole server to sleep at the same time.... diff --git a/src/main/java/net/minecraft/world/level/storage/PrimaryLevelData.java b/src/main/java/net/minecraft/world/level/storage/PrimaryLevelData.java -index 626b861ef2f323a5fc50ab5178d3e108e0f9cc25..31c31a9138cb5f6e41de01a6210f84e72fd7dc58 100644 +index 14b8011c8874e05647eb1636ee1eed5d90da8200..7bfc5bbfcf67e5bbf57e99e648ff5bed4d6b477f 100644 --- a/src/main/java/net/minecraft/world/level/storage/PrimaryLevelData.java +++ b/src/main/java/net/minecraft/world/level/storage/PrimaryLevelData.java @@ -394,6 +394,11 @@ public class PrimaryLevelData implements ServerLevelData, WorldData { @@ -95,10 +95,10 @@ index 626b861ef2f323a5fc50ab5178d3e108e0f9cc25..31c31a9138cb5f6e41de01a6210f84e7 if (weather.isCancelled()) { return; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 47f8ad80011142aac611441029d71787c85450f2..af8cf7c594dc1c099785559f11f3ed7415676895 100644 +index 202ebd562ec1e2b3f1087424da60cadca5da7d01..47a880bfabcd950ff985c2763531c68db80347f2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1186,7 +1186,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1191,7 +1191,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setStorm(boolean hasStorm) { @@ -107,7 +107,7 @@ index 47f8ad80011142aac611441029d71787c85450f2..af8cf7c594dc1c099785559f11f3ed74 this.setWeatherDuration(0); // Reset weather duration (legacy behaviour) this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands) } -@@ -1208,7 +1208,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1213,7 +1213,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setThundering(boolean thundering) { diff --git a/patches/unapplied/server/0613-More-Lidded-Block-API.patch b/patches/server/0603-More-Lidded-Block-API.patch similarity index 100% rename from patches/unapplied/server/0613-More-Lidded-Block-API.patch rename to patches/server/0603-More-Lidded-Block-API.patch diff --git a/patches/unapplied/server/0614-Limit-item-frame-cursors-on-maps.patch b/patches/server/0604-Limit-item-frame-cursors-on-maps.patch similarity index 88% rename from patches/unapplied/server/0614-Limit-item-frame-cursors-on-maps.patch rename to patches/server/0604-Limit-item-frame-cursors-on-maps.patch index fbdd17b851..64dc46158b 100644 --- a/patches/unapplied/server/0614-Limit-item-frame-cursors-on-maps.patch +++ b/patches/server/0604-Limit-item-frame-cursors-on-maps.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Limit item frame cursors on maps diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -index 7a6fbd4be33e93c7f09b1ed146ae25fe6c6b503c..50713f03c783c63f93710d986d94af544be0615a 100644 +index 5992f450f01349ce49286c34b8af56737de01a45..e4c4948e076cd64686dfd16ae0568fafc1437140 100644 --- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java +++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -@@ -295,8 +295,10 @@ public class MapItemSavedData extends SavedData { +@@ -302,8 +302,10 @@ public class MapItemSavedData extends SavedData { MapFrame worldmapframe1 = new MapFrame(blockposition, entityitemframe.getDirection().get2DDataValue() * 90, entityitemframe.getId()); @@ -19,7 +19,7 @@ index 7a6fbd4be33e93c7f09b1ed146ae25fe6c6b503c..50713f03c783c63f93710d986d94af54 } CompoundTag nbttagcompound = stack.getTag(); -@@ -478,7 +480,7 @@ public class MapItemSavedData extends SavedData { +@@ -485,7 +487,7 @@ public class MapItemSavedData extends SavedData { return true; } diff --git a/patches/unapplied/server/0615-Add-PlayerKickEvent-causes.patch b/patches/server/0605-Add-PlayerKickEvent-causes.patch similarity index 78% rename from patches/unapplied/server/0615-Add-PlayerKickEvent-causes.patch rename to patches/server/0605-Add-PlayerKickEvent-causes.patch index 66094563bb..08fa62c12c 100644 --- a/patches/unapplied/server/0615-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0605-Add-PlayerKickEvent-causes.patch @@ -36,10 +36,10 @@ index b5f54ee82905e3e6ab5bfde35ab625f5feeb1393..c0a80824a0307ea673805015119cc834 public boolean shouldDisconnect() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3054716dda1fcfe6c457d81dd89c82bf6acc64a3..64081583ee2a29b43d487b3730342dce7ac85e94 100644 +index 8f24c53f4c0d399d8583a862025da62445b1547d..ee8d5345e8ce8e0e082d82e9e52f5918f92a242e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2150,7 +2150,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return Component.translatable("commands.kick.success", serverPlayer.getDisplayName(), reason); }, true); +diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +index a38ad79aaf4ef5a928370152bdc5c0cc4c59d93e..877dd962a689c016668d1144ad2fef850fdbc31e 100644 +--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +@@ -95,7 +95,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + } else if (!this.isSingleplayerOwner()) { + // Paper start - This needs to be handled on the main thread for plugins + server.submit(() -> { +- this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE); ++ this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause + }); + // Paper endg + } +@@ -126,7 +126,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + } + } catch (Exception ex) { + ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex); +- this.disconnect("Invalid payload REGISTER!"); ++ this.disconnect("Invalid payload REGISTER!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause + } + } else if (identifier.equals(CUSTOM_UNREGISTER)) { + try { +@@ -136,7 +136,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + } + } catch (Exception ex) { + ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex); +- this.disconnect("Invalid payload UNREGISTER!"); ++ this.disconnect("Invalid payload UNREGISTER!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause + } + } else { + try { +@@ -154,7 +154,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), identifier.toString(), data); + } catch (Exception ex) { + ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); +- this.disconnect("Invalid custom payload!"); ++ this.disconnect("Invalid custom payload!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause + } + } + +@@ -177,7 +177,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + PacketUtils.ensureRunningOnSameThread(packet, this, (BlockableEventLoop) this.server); + if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) { + ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.playerProfile().getName()); +- this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect")); ++ this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect"), org.bukkit.event.player.PlayerKickEvent.Cause.RESOURCE_PACK_REJECTION); // Paper - kick event cause + } + // Paper start + PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.getAction().ordinal()]; +@@ -250,18 +250,28 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + } + + // CraftBukkit start +- @Deprecated ++ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper + public void disconnect(String s) { // Paper +- this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s)); // Paper ++ this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s), org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN); // Paper + } + // CraftBukkit end + ++ // Paper start - kick event cause ++ public void disconnect(String s, PlayerKickEvent.Cause cause) { ++ this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s), cause); ++ } ++ + // Paper start ++ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper + public void disconnect(final Component reason) { +- this.disconnect(io.papermc.paper.adventure.PaperAdventure.asAdventure(reason)); ++ this.disconnect(io.papermc.paper.adventure.PaperAdventure.asAdventure(reason), org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN); ++ } ++ ++ public void disconnect(final Component reason, PlayerKickEvent.Cause cause) { ++ this.disconnect(io.papermc.paper.adventure.PaperAdventure.asAdventure(reason), cause); + } + +- public void disconnect(net.kyori.adventure.text.Component reason) { ++ public void disconnect(net.kyori.adventure.text.Component reason, org.bukkit.event.player.PlayerKickEvent.Cause cause) { // Paper - kick event cause + // Paper end + // CraftBukkit start - fire PlayerKickEvent + if (this.processedDisconnect) { +@@ -271,7 +281,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + Waitable waitable = new Waitable() { + @Override + protected Object evaluate() { +- ServerCommonPacketListenerImpl.this.disconnect(reason); // Paper - adventure ++ ServerCommonPacketListenerImpl.this.disconnect(reason, cause); // Paper - adventure + return null; + } + }; +@@ -290,7 +300,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + + net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure + +- PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), reason, leaveMessage); // Paper - adventure ++ PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), reason, leaveMessage, cause); // Paper - adventure + + if (this.cserver.getServer().isRunning()) { + this.cserver.getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d3065b6df08 100644 +index b69d5c474d2cb1bd40c09ff1c644db4546530f80..e73208ed05109b64b3607762224b62a98dd9f9b7 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -364,7 +364,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -340,7 +340,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger() && !this.player.isDeadOrDying()) { if (++this.aboveGroundTickCount > 80) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString()); @@ -100,7 +200,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 return; } } else { -@@ -383,7 +383,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -359,7 +359,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) { if (++this.aboveGroundVehicleTickCount > 80) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString()); @@ -109,16 +209,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 return; } } else { -@@ -405,7 +405,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - if (this.keepAlivePending) { - if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected - ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info -- this.disconnect(Component.translatable("disconnect.timeout", new Object[0])); -+ this.disconnect(Component.translatable("disconnect.timeout", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause - } - } else { - if (elapsedTime >= 15000L) { // 15 seconds -@@ -435,7 +435,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -390,7 +390,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) { this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 @@ -127,55 +218,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } } -@@ -458,16 +458,26 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - return this.server.isSingleplayerOwner(this.player.getGameProfile()); - } - -+ @io.papermc.paper.annotation.DoNotUse // Paper - public void disconnect(String s) { - // Paper start -- this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s)); -+ this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s), org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN); - } - -+ public void disconnect(String s, PlayerKickEvent.Cause cause) { -+ this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s), cause); -+ } -+ -+ @io.papermc.paper.annotation.DoNotUse // Paper - public void disconnect(final Component reason) { -- this.disconnect(PaperAdventure.asAdventure(reason)); -+ this.disconnect(PaperAdventure.asAdventure(reason), org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN); -+ } -+ -+ public void disconnect(final Component reason, PlayerKickEvent.Cause cause) { -+ this.disconnect(PaperAdventure.asAdventure(reason), cause); - } - -- public void disconnect(net.kyori.adventure.text.Component reason) { -+ public void disconnect(net.kyori.adventure.text.Component reason, org.bukkit.event.player.PlayerKickEvent.Cause cause) { - // Paper end - // CraftBukkit start - fire PlayerKickEvent - if (this.processedDisconnect) { -@@ -477,7 +487,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - Waitable waitable = new Waitable() { - @Override - protected Object evaluate() { -- ServerGamePacketListenerImpl.this.disconnect(reason); // Paper - adventure -+ ServerGamePacketListenerImpl.this.disconnect(reason, cause); // Paper - adventure, kick event cause - return null; - } - }; -@@ -496,7 +506,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - - net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure - -- PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), reason, leaveMessage); // Paper - Adventure -+ PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), reason, leaveMessage, cause); // Paper - Adventure & kick event reason - - if (this.cserver.getServer().isRunning()) { - this.cserver.getPluginManager().callEvent(event); -@@ -566,7 +576,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -460,7 +460,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl public void handleMoveVehicle(ServerboundMoveVehiclePacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(), packet.getY(), packet.getZ(), packet.getYRot(), packet.getXRot())) { @@ -184,7 +227,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } else { Entity entity = this.player.getRootVehicle(); -@@ -772,7 +782,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -666,7 +666,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (packet.getId() == this.awaitingTeleport) { if (this.awaitingPositionFromClient == null) { @@ -193,7 +236,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 return; } -@@ -829,13 +839,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -723,7 +723,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async // CraftBukkit start if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable @@ -201,15 +244,8 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 + server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause return; } - // Paper start - String str = packet.getCommand(); int index = -1; - if (str.length() > 64 && ((index = str.indexOf(' ')) == -1 || index >= 64)) { -- server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]))); // Paper -+ server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - return; - } - // Paper end -@@ -988,7 +998,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + // CraftBukkit end +@@ -875,7 +875,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Paper start - validate pick item position if (!(packet.getSlot() >= 0 && packet.getSlot() < this.player.getInventory().items.size())) { ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString()); @@ -218,7 +254,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 return; } this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed -@@ -1171,7 +1181,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1058,7 +1058,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; if (byteLength > 256 * 4) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!"); @@ -227,7 +263,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 return; } byteTotal += byteLength; -@@ -1194,14 +1204,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1081,14 +1081,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (byteTotal > byteAllowed) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); @@ -244,7 +280,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 return; } this.lastBookTick = MinecraftServer.currentTick; -@@ -1325,7 +1335,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1212,7 +1212,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl public void handleMovePlayer(ServerboundMovePlayerPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) { @@ -253,7 +289,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } else { ServerLevel worldserver = this.player.serverLevel(); -@@ -1739,7 +1749,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1626,7 +1626,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.dropCount++; if (this.dropCount >= 20) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!"); @@ -262,16 +298,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 return; } } -@@ -1951,7 +1961,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); - if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) { - ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName()); -- this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect")); -+ this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect"), org.bukkit.event.player.PlayerKickEvent.Cause.RESOURCE_PACK_REJECTION); // Paper - add cause - } - // Paper start - PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()]; -@@ -2067,7 +2077,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1909,7 +1909,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.resetLastActionTime(); } else { ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString()); @@ -280,7 +307,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } } -@@ -2080,7 +2090,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1922,7 +1922,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // CraftBukkit end if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) { @@ -289,7 +316,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } else { Optional optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages()); -@@ -2114,7 +2124,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1955,7 +1955,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleChatCommand(ServerboundChatCommandPacket packet) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) { @@ -298,7 +325,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } else { Optional optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages()); -@@ -2169,7 +2179,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2010,7 +2010,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) { if (exception.shouldDisconnect()) { @@ -307,7 +334,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } else { this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED)); } -@@ -2200,7 +2210,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2041,7 +2041,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private Optional tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { if (!this.updateChatOrder(timestamp)) { ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); @@ -316,7 +343,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 return Optional.empty(); } else { Optional optional = this.unpackAndApplyLastSeen(acknowledgment); -@@ -2223,7 +2233,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2064,7 +2064,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (optional.isEmpty()) { ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); @@ -325,7 +352,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } return optional; -@@ -2419,7 +2429,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2260,7 +2260,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // this.chatSpamTickCount += 20; if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // CraftBukkit end @@ -334,7 +361,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } } -@@ -2431,7 +2441,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2272,7 +2272,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl synchronized (this.lastSeenMessages) { if (!this.lastSeenMessages.applyOffset(packet.offset())) { ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); @@ -343,7 +370,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } } -@@ -2584,7 +2594,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2425,7 +2425,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } if (i > 4096) { @@ -352,16 +379,16 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } } -@@ -2630,7 +2640,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2482,7 +2482,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Spigot Start if ( entity == this.player && !this.player.isSpectator() ) { -- this.disconnect( "Cannot interact with self!" ); -+ this.disconnect( "Cannot interact with self!", org.bukkit.event.player.PlayerKickEvent.Cause.SELF_INTERACTION ); // Paper - add cause +- disconnect( "Cannot interact with self!" ); ++ disconnect( "Cannot interact with self!" , org.bukkit.event.player.PlayerKickEvent.Cause.SELF_INTERACTION ); // Paper - kick event cause return; } // Spigot End -@@ -2729,7 +2739,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2581,7 +2581,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // CraftBukkit end } } else { @@ -370,7 +397,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString()); } } -@@ -3139,7 +3149,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2991,7 +2991,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Paper start if (!org.bukkit.Bukkit.isPrimaryThread()) { if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { @@ -379,43 +406,7 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 return; } } -@@ -3337,7 +3347,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - } else if (!this.isSingleplayerOwner()) { - // Paper start - This needs to be handled on the main thread for plugins - server.submit(() -> { -- this.disconnect(Component.translatable("disconnect.timeout")); -+ this.disconnect(Component.translatable("disconnect.timeout"), org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause - }); - // Paper end - } -@@ -3383,7 +3393,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - } - } catch (Exception ex) { - ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex); -- this.disconnect("Invalid payload REGISTER!"); -+ this.disconnect("Invalid payload REGISTER!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause - } - } else if (packet.identifier.equals(CUSTOM_UNREGISTER)) { - try { -@@ -3393,7 +3403,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - } - } catch (Exception ex) { - ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex); -- this.disconnect("Invalid payload UNREGISTER!"); -+ this.disconnect("Invalid payload UNREGISTER!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause - } - } else { - try { -@@ -3411,7 +3421,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data); - } catch (Exception ex) { - ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); -- this.disconnect("Invalid custom payload!"); -+ this.disconnect("Invalid custom payload!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause - } - } - -@@ -3453,7 +3463,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3225,7 +3225,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (!Objects.equals(profilepublickey_a, profilepublickey_a1)) { if (profilepublickey_a != null && profilepublickey_a1.expiresAt().isBefore(profilepublickey_a.expiresAt())) { @@ -424,8 +415,8 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } else { try { SignatureValidator signaturevalidator = this.server.getProfileKeySignatureValidator(); -@@ -3466,7 +3476,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator, Duration.ZERO)); +@@ -3238,7 +3238,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator)); } catch (ProfilePublicKey.ValidationException profilepublickey_b) { ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); - this.disconnect(profilepublickey_b.getComponent()); @@ -434,10 +425,10 @@ index 967ed1f44a4d7c97a14d9415541df000698e8aad..08a69f7a2d153aee1b9637085be04d30 } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 3dbad6f9ea70db07a9bfa199b28def6a67353d80..77d80170cabc358c75d58ac7ff19054ba6b7617f 100644 +index 43dd6dbbc510320432aaafc1c5e4e91117fd8189..53c453814c840ce8afed27cea4c6f5e01cddf17f 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -678,7 +678,7 @@ public abstract class PlayerList { +@@ -665,7 +665,7 @@ public abstract class PlayerList { while (iterator.hasNext()) { entityplayer = (ServerPlayer) iterator.next(); this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved @@ -446,7 +437,7 @@ index 3dbad6f9ea70db07a9bfa199b28def6a67353d80..77d80170cabc358c75d58ac7ff19054b } // Instead of kicking then returning, we need to store the kick reason -@@ -1314,8 +1314,8 @@ public abstract class PlayerList { +@@ -1308,8 +1308,8 @@ public abstract class PlayerList { // Paper end // CraftBukkit start - disconnect safely for (ServerPlayer player : this.players) { @@ -458,22 +449,19 @@ index 3dbad6f9ea70db07a9bfa199b28def6a67353d80..77d80170cabc358c75d58ac7ff19054b // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/player/ProfilePublicKey.java b/src/main/java/net/minecraft/world/entity/player/ProfilePublicKey.java -index 984c288abf94d9fe47fada33722fea035b832f3b..addd20237b87c9a87bb09fd7addb101a2b7c7d4e 100644 +index 6724d0a1af13e97bc1d3bd94fd43fef742a0deab..20ba0a0c9eae28658888a77dd2170f629bbcb65b 100644 --- a/src/main/java/net/minecraft/world/entity/player/ProfilePublicKey.java +++ b/src/main/java/net/minecraft/world/entity/player/ProfilePublicKey.java -@@ -24,9 +24,9 @@ public record ProfilePublicKey(ProfilePublicKey.Data data) { +@@ -24,7 +24,7 @@ public record ProfilePublicKey(ProfilePublicKey.Data data) { - public static ProfilePublicKey createValidated(SignatureValidator servicesSignatureVerifier, UUID playerUuid, ProfilePublicKey.Data publicKeyData, Duration gracePeriod) throws ProfilePublicKey.ValidationException { - if (publicKeyData.hasExpired(gracePeriod)) { -- throw new ProfilePublicKey.ValidationException(EXPIRED_PROFILE_PUBLIC_KEY); -+ throw new ProfilePublicKey.ValidationException(EXPIRED_PROFILE_PUBLIC_KEY, org.bukkit.event.player.PlayerKickEvent.Cause.EXPIRED_PROFILE_PUBLIC_KEY); // Paper - kick event causes - } else if (!publicKeyData.validateSignature(servicesSignatureVerifier, playerUuid)) { + public static ProfilePublicKey createValidated(SignatureValidator servicesSignatureVerifier, UUID playerUuid, ProfilePublicKey.Data publicKeyData) throws ProfilePublicKey.ValidationException { + if (!publicKeyData.validateSignature(servicesSignatureVerifier, playerUuid)) { - throw new ProfilePublicKey.ValidationException(INVALID_SIGNATURE); + throw new ProfilePublicKey.ValidationException(INVALID_SIGNATURE, org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PUBLIC_KEY_SIGNATURE); // Paper - kick event causes } else { return new ProfilePublicKey(publicKeyData); } -@@ -83,8 +83,16 @@ public record ProfilePublicKey(ProfilePublicKey.Data data) { +@@ -81,8 +81,16 @@ public record ProfilePublicKey(ProfilePublicKey.Data data) { } public static class ValidationException extends ThrowingComponent { @@ -491,10 +479,10 @@ index 984c288abf94d9fe47fada33722fea035b832f3b..addd20237b87c9a87bb09fd7addb101a } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d8c95d53b923b2e269ae3f5afa77a5a93187bab8..54027efe50942ad1ac3fbe45e9a02b7e7eac0f28 100644 +index 8b75e41b379c5fb31c579be01dd96e0be88b9bd1..e19c4f5e016859d702cad249992bebd9016adc5e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -584,7 +584,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -544,7 +544,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot if (this.getHandle().connection == null) return; @@ -503,7 +491,7 @@ index d8c95d53b923b2e269ae3f5afa77a5a93187bab8..54027efe50942ad1ac3fbe45e9a02b7e } // Paper start -@@ -596,10 +596,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -556,10 +556,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void kick(final net.kyori.adventure.text.Component message) { @@ -520,7 +508,7 @@ index d8c95d53b923b2e269ae3f5afa77a5a93187bab8..54027efe50942ad1ac3fbe45e9a02b7e } } -@@ -670,7 +675,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -630,7 +635,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper start - Improve chat handling if (ServerGamePacketListenerImpl.isChatMessageIllegal(msg)) { diff --git a/patches/unapplied/server/0616-Add-PufferFishStateChangeEvent.patch b/patches/server/0606-Add-PufferFishStateChangeEvent.patch similarity index 100% rename from patches/unapplied/server/0616-Add-PufferFishStateChangeEvent.patch rename to patches/server/0606-Add-PufferFishStateChangeEvent.patch diff --git a/patches/unapplied/server/0617-Fix-PlayerBucketEmptyEvent-result-itemstack.patch b/patches/server/0607-Fix-PlayerBucketEmptyEvent-result-itemstack.patch similarity index 88% rename from patches/unapplied/server/0617-Fix-PlayerBucketEmptyEvent-result-itemstack.patch rename to patches/server/0607-Fix-PlayerBucketEmptyEvent-result-itemstack.patch index adbc2300b0..1dbdf33922 100644 --- a/patches/unapplied/server/0617-Fix-PlayerBucketEmptyEvent-result-itemstack.patch +++ b/patches/server/0607-Fix-PlayerBucketEmptyEvent-result-itemstack.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix PlayerBucketEmptyEvent result itemstack Fixes SPIGOT-2560: https://hub.spigotmc.org/jira/projects/SPIGOT/issues/SPIGOT-2560 diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java -index 5510098be25ce06bc5f92eab2f83dc1086c4838f..578c3db52dda4c169b5ea615a4ce4a79f15a4cad 100644 +index e0ca5316fb66ed94f1c5cf541d096d1cb8774196..277555a26e8281dd1a626e572794b08cf51d00c5 100644 --- a/src/main/java/net/minecraft/world/item/BucketItem.java +++ b/src/main/java/net/minecraft/world/item/BucketItem.java @@ -39,6 +39,8 @@ import org.bukkit.event.player.PlayerBucketFillEvent; @@ -18,7 +18,7 @@ index 5510098be25ce06bc5f92eab2f83dc1086c4838f..578c3db52dda4c169b5ea615a4ce4a79 public final Fluid content; public BucketItem(Fluid fluid, Item.Properties settings) { -@@ -120,6 +122,13 @@ public class BucketItem extends Item implements DispensibleContainerItem { +@@ -122,6 +124,13 @@ public class BucketItem extends Item implements DispensibleContainerItem { } public static ItemStack getEmptySuccessItem(ItemStack stack, Player player) { @@ -32,11 +32,11 @@ index 5510098be25ce06bc5f92eab2f83dc1086c4838f..578c3db52dda4c169b5ea615a4ce4a79 return !player.getAbilities().instabuild ? new ItemStack(Items.BUCKET) : stack; } -@@ -150,6 +159,7 @@ public class BucketItem extends Item implements DispensibleContainerItem { +@@ -181,6 +190,7 @@ public class BucketItem extends Item implements DispensibleContainerItem { ((ServerPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541 return false; } + itemLeftInHandAfterPlayerBucketEmptyEvent = event.getItemStack() != null ? event.getItemStack().equals(CraftItemStack.asNewCraftStack(net.minecraft.world.item.Items.BUCKET)) ? null : CraftItemStack.asNMSCopy(event.getItemStack()) : ItemStack.EMPTY; // Paper - fix empty event result itemstack } // CraftBukkit end - if (!flag1) { + if (!flag2) { diff --git a/patches/unapplied/server/0596-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch b/patches/unapplied/server/0596-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch deleted file mode 100644 index 167e55814a..0000000000 --- a/patches/unapplied/server/0596-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Alvinn8 <42838560+Alvinn8@users.noreply.github.com> -Date: Fri, 8 Jan 2021 20:31:13 +0100 -Subject: [PATCH] Add Adventure message to PlayerAdvancementDoneEvent - - -diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java -index 9034faaf7b169788abad01d3da9c65ad5ddc4b8b..acc49f66bf34e2507d0ee6fec0a56b11bfc68f46 100644 ---- a/src/main/java/net/minecraft/server/PlayerAdvancements.java -+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java -@@ -239,10 +239,18 @@ public class PlayerAdvancements { - this.progressChanged.add(advancement); - flag = true; - if (!flag1 && advancementprogress.isDone()) { -- this.player.level().getCraftServer().getPluginManager().callEvent(new org.bukkit.event.player.PlayerAdvancementDoneEvent(this.player.getBukkitEntity(), advancement.bukkit)); // CraftBukkit -+ // Paper start - Add Adventure message to PlayerAdvancementDoneEvent -+ boolean announceToChat = advancement.getDisplay() != null && advancement.getDisplay().shouldAnnounceChat(); -+ net.kyori.adventure.text.Component message = announceToChat ? io.papermc.paper.adventure.PaperAdventure.asAdventure(Component.translatable("chat.type.advancement." + advancement.getDisplay().getFrame().getName(), this.player.getDisplayName(), advancement.getChatComponent())) : null; -+ org.bukkit.event.player.PlayerAdvancementDoneEvent event = new org.bukkit.event.player.PlayerAdvancementDoneEvent(this.player.getBukkitEntity(), advancement.bukkit, message); -+ this.player.level().getCraftServer().getPluginManager().callEvent(event); -+ message = event.message(); -+ // Paper end - advancement.getRewards().grant(this.player); -- if (advancement.getDisplay() != null && advancement.getDisplay().shouldAnnounceChat() && this.player.level().getGameRules().getBoolean(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)) { -- this.playerList.broadcastSystemMessage(Component.translatable("chat.type.advancement." + advancement.getDisplay().getFrame().getName(), this.player.getDisplayName(), advancement.getChatComponent()), false); -+ // Paper start - Add Adventure message to PlayerAdvancementDoneEvent -+ if (message != null && this.player.level().getGameRules().getBoolean(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)) { -+ this.playerList.broadcastSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(message), false); -+ // Paper end - } - } - } diff --git a/patches/unapplied/server/0587-Entity-load-save-limit-per-chunk.patch b/patches/unapplied/skipped/0587-Entity-load-save-limit-per-chunk.patch similarity index 100% rename from patches/unapplied/server/0587-Entity-load-save-limit-per-chunk.patch rename to patches/unapplied/skipped/0587-Entity-load-save-limit-per-chunk.patch