From 2d9d0d8b1dcf64e8790b17119b7480361d5f33e3 Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Wed, 24 Apr 2024 09:46:45 -0400 Subject: [PATCH] Patches! --- ...I.patch => 0420-Add-more-Evoker-API.patch} | 0 ...Add-methods-to-get-translation-keys.patch} | 4 +- ...te-HoverEvent-from-ItemStack-Entity.patch} | 4 +- ...ch => 0423-Cache-block-data-strings.patch} | 10 +- ...rtation-and-cancel-velocity-if-tele.patch} | 20 ++-- ...l-open-container-api-to-HumanEntity.patch} | 4 +- ...aFixerUpper-Rewrite-Rules-on-demand.patch} | 0 ...-capture-to-capture-all-items-added.patch} | 8 +- ...-Counter-to-allow-plugins-to-use-va.patch} | 8 +- ...track-plugin-scoreboards-by-default.patch} | 0 .../0430-Entity-isTicking.patch} | 8 +- ...non-whitelisted-player-when-white-l.patch} | 4 +- ...-Concurrency-issue-in-ShufflingList.patch} | 2 +- ...eset-Ender-Crystals-on-Dragon-Spawn.patch} | 2 +- ...-large-move-vectors-crashing-server.patch} | 16 +-- .../0435-Optimise-getType-calls.patch} | 12 +- .../0436-Villager-resetOffers.patch} | 4 +- ...ce-order-when-capturing-blockstates.patch} | 4 +- ...em-locations-dropped-from-campfires.patch} | 6 +- ...9-Fix-bell-block-entity-memory-leak.patch} | 2 +- ...ing-up-when-item-stack-is-empty-in-.patch} | 6 +- ...Add-getOfflinePlayerIfCached-String.patch} | 4 +- .../0442-Add-ignore-discounts-API.patch} | 104 ++++++++---------- ...Toggle-for-removing-existing-dragon.patch} | 2 +- ...x-client-lag-on-advancement-loading.patch} | 4 +- .../0445-Item-no-age-no-player-pickup.patch} | 0 ...446-Beacon-API-custom-effect-ranges.patch} | 30 ++--- .../0447-Add-API-for-quit-reason.patch} | 18 +-- ...ng-Trader-spawn-rate-config-options.patch} | 2 +- .../0449-Expose-world-spawn-angle.patch} | 4 +- .../0450-Add-Destroy-Speed-API.patch} | 4 +- ...-spawnParticle-x-y-z-precision-loss.patch} | 4 +- ...52-Add-LivingEntity-clearActiveItem.patch} | 4 +- .../0453-Add-PlayerItemCooldownEvent.patch} | 0 ...rove-performance-of-the-end-generat.patch} | 2 +- .../0455-More-lightning-API.patch} | 0 ...should-not-bypass-cramming-gamerule.patch} | 34 +++--- ...-missing-default-perms-for-commands.patch} | 0 .../0458-Add-PlayerShearBlockEvent.patch | 71 ++++++++++++ .../0459-Limit-recipe-packets.patch} | 8 +- ...-CraftSound-backwards-compatibility.patch} | 0 ...461-Player-Chunk-Load-Unload-Events.patch} | 2 +- ...2-Optimize-Dynamic-get-Missing-Keys.patch} | 6 +- ...-Expose-LivingEntity-hurt-direction.patch} | 18 +-- ...OBSTRUCTED-reason-to-BedEnterResult.patch} | 4 +- ...valid-ingredient-lists-in-VillagerA.patch} | 4 +- .../0466-Add-TargetHitEvent.patch} | 4 +- .../0467-MC-4-Fix-item-position-desync.patch} | 4 +- .../0468-Additional-Block-Material-API.patch} | 0 .../0469-Fix-harming-potion-dupe.patch} | 30 +++-- ...t-Material-from-Boats-and-Minecarts.patch} | 0 ...ob-spawner-spawn-egg-transformation.patch} | 6 +- ...ix-Not-a-string-Map-Conversion-spam.patch} | 10 +- ...3-Add-PlayerFlowerPotManipulateEvent.patch | 48 ++++++++ ...ct-event-not-being-called-sometimes.patch} | 6 +- .../0475-Zombie-API-breaking-doors.patch} | 0 ...476-Fix-nerfed-slime-when-splitting.patch} | 4 +- .../0477-Add-EntityLoadCrossbowEvent.patch | 68 ++++++++++++ .../0478-Add-WorldGameRuleChangeEvent.patch} | 14 +-- ...79-Add-ServerResourcesReloadedEvent.patch} | 8 +- ...d-settings-for-mobs-picking-up-loot.patch} | 10 +- .../0481-Add-BlockFailedDispenseEvent.patch} | 16 +-- ...82-Add-PlayerLecternPageChangeEvent.patch} | 0 ...83-Add-PlayerLoomPatternSelectEvent.patch} | 4 +- ...nfigurable-door-breaking-difficulty.patch} | 8 +- ...ty-commands-shall-not-be-dispatched.patch} | 4 +- .../0486-Remove-stale-POIs.patch} | 4 +- .../0487-Fix-villager-boat-exploit.patch} | 4 +- .../0488-Add-sendOpLevel-API.patch} | 10 +- ...0489-TODO-Registry-Modification-API.patch} | 8 +- .../0490-Add-StructuresLocateEvent.patch} | 10 +- ...-for-requiring-a-player-participant.patch} | 12 +- ...leHitEvent-call-when-fireballs-dead.patch} | 4 +- ...nent-with-empty-text-instead-of-thr.patch} | 2 +- ...494-Make-schedule-command-per-world.patch} | 2 +- ...495-Configurable-max-leash-distance.patch} | 6 +- .../0496-Add-BlockPreDispenseEvent.patch} | 14 +-- ...7-Add-PlayerChangeBeaconEffectEvent.patch} | 21 ++-- ...e-for-always-placing-the-dragon-egg.patch} | 2 +- ...-PlayerStonecutterRecipeSelectEvent.patch} | 0 .../0500-Expand-EntityUnleashEvent.patch} | 28 ++--- ...shield-blocking-on-dimension-change.patch} | 4 +- .../0502-Add-DragonEggFormEvent.patch} | 2 +- .../0503-Add-EntityMoveEvent.patch} | 14 +-- ...isable-pathfinding-updates-on-block.patch} | 8 +- .../0505-Inline-shift-direction-fields.patch} | 14 +-- ...-adding-items-to-BlockDropItemEvent.patch} | 4 +- ...inThreadExecutor-to-BukkitScheduler.patch} | 0 ...entity-allow-attribute-registration.patch} | 12 +- ...ix-dead-slime-setSize-invincibility.patch} | 0 ...pes-should-return-an-immutable-list.patch} | 0 .../0511-Expose-Tracked-Players.patch} | 4 +- .../0512-Improve-ServerGUI.patch} | 2 +- ...513-fix-converting-txt-to-json-file.patch} | 10 +- .../0514-Add-worldborder-events.patch} | 2 +- .../0515-Add-PlayerNameEntityEvent.patch} | 20 ++-- .../0516-Add-recipe-to-cook-events.patch} | 10 +- .../0517-Add-Block-isValidTool.patch} | 0 ...using-signs-inside-spawn-protection.patch} | 11 +- .../0519-Expand-world-key-API.patch} | 16 +-- ...ternative-constructor-for-Rotations.patch} | 4 +- .../0521-Item-Rarity-API.patch} | 4 +- ...d-item-when-player-has-disconnected.patch} | 4 +- ...elist-use-configurable-kick-message.patch} | 4 +- ...ignore-result-of-PlayerEditBookEvent.patch | 19 ++++ .../0525-Expose-protocol-version.patch} | 4 +- ...ab-completions-for-brigadier-comman.patch} | 6 +- ...temConsumeEvent-cancelling-properly.patch} | 4 +- .../server/0528-Add-bypass-host-check.patch | 30 +++++ ...0529-Set-area-affect-cloud-rotation.patch} | 6 +- ...add-isDeeplySleeping-to-HumanEntity.patch} | 4 +- ...add-consumeFuel-to-FurnaceBurnEvent.patch} | 4 +- ...-set-drop-chance-to-EntityEquipment.patch} | 0 ...ix-PigZombieAngerEvent-cancellation.patch} | 12 +- ...ix-PlayerItemHeldEvent-firing-twice.patch} | 4 +- .../0535-Add-PlayerDeepSleepEvent.patch} | 4 +- .../0536-More-World-API.patch} | 4 +- .../0537-Add-PlayerBedFailEnterEvent.patch} | 4 +- ...-to-convert-between-Component-and-B.patch} | 4 +- ...awnEvent-fix-passed-parameter-issue.patch} | 14 +-- ...acon-activation-deactivation-events.patch} | 6 +- ...dd-Channel-initialization-listeners.patch} | 12 +- ...mands-if-tab-completion-is-disabled.patch} | 4 +- .../0543-Add-more-WanderingTrader-API.patch} | 4 +- ...dd-EntityBlockStorage-clearEntities.patch} | 12 +- ...ssage-to-PlayerAdvancementDoneEvent.patch} | 2 +- .../0546-Add-HiddenPotionEffect-API.patch} | 10 +- .../0547-Inventory-close.patch} | 0 ...-in-sunlight-API-for-Phantoms-and-S.patch} | 26 ++--- .../0549-Add-basic-Datapack-API.patch} | 6 +- ...ment-variable-to-disable-server-gui.patch} | 8 +- ...51-Expand-PlayerGameModeChangeEvent.patch} | 27 ++--- .../0552-ItemStack-repair-check-API.patch} | 4 +- .../0553-More-Enchantment-API.patch} | 10 +- ...ve-range-check-for-block-placing-up.patch} | 6 +- .../0555-Add-Mob-lookAt-API.patch} | 4 +- ...f-bucket-dispenses-will-succeed-for.patch} | 4 +- ...0557-Add-Unix-domain-socket-support.patch} | 70 ++++++------ .../0473-Add-PlayerShearBlockEvent.patch | 78 ------------- ...9-Add-PlayerFlowerPotManipulateEvent.patch | 32 ------ .../0493-Add-EntityLoadCrossbowEvent.patch | 44 -------- ...ignore-result-of-PlayerEditBookEvent.patch | 19 ---- .../server/0545-Add-bypass-host-check.patch | 30 ----- ...blockpos-allocation-from-pathfinding.patch | 0 .../0486-Cache-burn-durations.patch | 0 ...-grindstones-from-overstacking-items.patch | 0 146 files changed, 767 insertions(+), 747 deletions(-) rename patches/server/{0434-Add-more-Evoker-API.patch => 0420-Add-more-Evoker-API.patch} (100%) rename patches/server/{0435-Add-methods-to-get-translation-keys.patch => 0421-Add-methods-to-get-translation-keys.patch} (97%) rename patches/server/{0436-Create-HoverEvent-from-ItemStack-Entity.patch => 0422-Create-HoverEvent-from-ItemStack-Entity.patch} (94%) rename patches/server/{0437-Cache-block-data-strings.patch => 0423-Cache-block-data-strings.patch} (90%) rename patches/server/{0438-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch => 0424-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch} (84%) rename patches/{unapplied/server/0439-Add-additional-open-container-api-to-HumanEntity.patch => server/0425-Add-additional-open-container-api-to-HumanEntity.patch} (95%) rename patches/{unapplied/server/0440-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch => server/0426-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch} (100%) rename patches/{unapplied/server/0441-Extend-block-drop-capture-to-capture-all-items-added.patch => server/0427-Extend-block-drop-capture-to-capture-all-items-added.patch} (89%) rename patches/{unapplied/server/0442-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch => server/0428-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch} (79%) rename patches/{unapplied/server/0443-Lazily-track-plugin-scoreboards-by-default.patch => server/0429-Lazily-track-plugin-scoreboards-by-default.patch} (100%) rename patches/{unapplied/server/0444-Entity-isTicking.patch => server/0430-Entity-isTicking.patch} (78%) rename patches/{unapplied/server/0445-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch => server/0431-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch} (90%) rename patches/{unapplied/server/0446-Fix-Concurrency-issue-in-ShufflingList.patch => server/0432-Fix-Concurrency-issue-in-ShufflingList.patch} (97%) rename patches/{unapplied/server/0447-Reset-Ender-Crystals-on-Dragon-Spawn.patch => server/0433-Reset-Ender-Crystals-on-Dragon-Spawn.patch} (92%) rename patches/{unapplied/server/0448-Fix-for-large-move-vectors-crashing-server.patch => server/0434-Fix-for-large-move-vectors-crashing-server.patch} (91%) rename patches/{unapplied/server/0449-Optimise-getType-calls.patch => server/0435-Optimise-getType-calls.patch} (89%) rename patches/{unapplied/server/0450-Villager-resetOffers.patch => server/0436-Villager-resetOffers.patch} (91%) rename patches/{unapplied/server/0451-Retain-block-place-order-when-capturing-blockstates.patch => server/0437-Retain-block-place-order-when-capturing-blockstates.patch} (89%) rename patches/{unapplied/server/0453-Fix-item-locations-dropped-from-campfires.patch => server/0438-Fix-item-locations-dropped-from-campfires.patch} (87%) rename patches/{unapplied/server/0454-Fix-bell-block-entity-memory-leak.patch => server/0439-Fix-bell-block-entity-memory-leak.patch} (95%) rename patches/{unapplied/server/0455-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch => server/0440-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch} (93%) rename patches/{unapplied/server/0456-Add-getOfflinePlayerIfCached-String.patch => server/0441-Add-getOfflinePlayerIfCached-String.patch} (89%) rename patches/{unapplied/server/0457-Add-ignore-discounts-API.patch => server/0442-Add-ignore-discounts-API.patch} (58%) rename patches/{unapplied/server/0458-Toggle-for-removing-existing-dragon.patch => server/0443-Toggle-for-removing-existing-dragon.patch} (92%) rename patches/{unapplied/server/0459-Fix-client-lag-on-advancement-loading.patch => server/0444-Fix-client-lag-on-advancement-loading.patch} (92%) rename patches/{unapplied/server/0460-Item-no-age-no-player-pickup.patch => server/0445-Item-no-age-no-player-pickup.patch} (100%) rename patches/{unapplied/server/0461-Beacon-API-custom-effect-ranges.patch => server/0446-Beacon-API-custom-effect-ranges.patch} (84%) rename patches/{unapplied/server/0462-Add-API-for-quit-reason.patch => server/0447-Add-API-for-quit-reason.patch} (88%) rename patches/{unapplied/server/0463-Add-Wandering-Trader-spawn-rate-config-options.patch => server/0448-Add-Wandering-Trader-spawn-rate-config-options.patch} (98%) rename patches/{unapplied/server/0464-Expose-world-spawn-angle.patch => server/0449-Expose-world-spawn-angle.patch} (87%) rename patches/{unapplied/server/0465-Add-Destroy-Speed-API.patch => server/0450-Add-Destroy-Speed-API.patch} (89%) rename patches/{unapplied/server/0466-Fix-Player-spawnParticle-x-y-z-precision-loss.patch => server/0451-Fix-Player-spawnParticle-x-y-z-precision-loss.patch} (89%) rename patches/{unapplied/server/0467-Add-LivingEntity-clearActiveItem.patch => server/0452-Add-LivingEntity-clearActiveItem.patch} (84%) rename patches/{unapplied/server/0468-Add-PlayerItemCooldownEvent.patch => server/0453-Add-PlayerItemCooldownEvent.patch} (100%) rename patches/{unapplied/server/0469-Significantly-improve-performance-of-the-end-generat.patch => server/0454-Significantly-improve-performance-of-the-end-generat.patch} (97%) rename patches/{unapplied/server/0470-More-lightning-API.patch => server/0455-More-lightning-API.patch} (100%) rename patches/{unapplied/server/0471-Climbing-should-not-bypass-cramming-gamerule.patch => server/0456-Climbing-should-not-bypass-cramming-gamerule.patch} (84%) rename patches/{unapplied/server/0472-Add-missing-default-perms-for-commands.patch => server/0457-Add-missing-default-perms-for-commands.patch} (100%) create mode 100644 patches/server/0458-Add-PlayerShearBlockEvent.patch rename patches/{unapplied/server/0474-Limit-recipe-packets.patch => server/0459-Limit-recipe-packets.patch} (90%) rename patches/{unapplied/server/0475-Fix-CraftSound-backwards-compatibility.patch => server/0460-Fix-CraftSound-backwards-compatibility.patch} (100%) rename patches/{unapplied/server/0476-Player-Chunk-Load-Unload-Events.patch => server/0461-Player-Chunk-Load-Unload-Events.patch} (95%) rename patches/{unapplied/server/0477-Optimize-Dynamic-get-Missing-Keys.patch => server/0462-Optimize-Dynamic-get-Missing-Keys.patch} (88%) rename patches/{unapplied/server/0478-Expose-LivingEntity-hurt-direction.patch => server/0463-Expose-LivingEntity-hurt-direction.patch} (77%) rename patches/{unapplied/server/0479-Add-OBSTRUCTED-reason-to-BedEnterResult.patch => server/0464-Add-OBSTRUCTED-reason-to-BedEnterResult.patch} (86%) rename patches/{unapplied/server/0480-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch => server/0465-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch} (89%) rename patches/{unapplied/server/0481-Add-TargetHitEvent.patch => server/0466-Add-TargetHitEvent.patch} (93%) rename patches/{unapplied/server/0482-MC-4-Fix-item-position-desync.patch => server/0467-MC-4-Fix-item-position-desync.patch} (92%) rename patches/{unapplied/server/0483-Additional-Block-Material-API.patch => server/0468-Additional-Block-Material-API.patch} (100%) rename patches/{unapplied/server/0484-Fix-harming-potion-dupe.patch => server/0469-Fix-harming-potion-dupe.patch} (61%) rename patches/{unapplied/server/0485-API-to-get-Material-from-Boats-and-Minecarts.patch => server/0470-API-to-get-Material-from-Boats-and-Minecarts.patch} (100%) rename patches/{unapplied/server/0487-Allow-disabling-mob-spawner-spawn-egg-transformation.patch => server/0471-Allow-disabling-mob-spawner-spawn-egg-transformation.patch} (78%) rename patches/{unapplied/server/0488-Fix-Not-a-string-Map-Conversion-spam.patch => server/0472-Fix-Not-a-string-Map-Conversion-spam.patch} (86%) create mode 100644 patches/server/0473-Add-PlayerFlowerPotManipulateEvent.patch rename patches/{unapplied/server/0490-Fix-interact-event-not-being-called-sometimes.patch => server/0474-Fix-interact-event-not-being-called-sometimes.patch} (94%) rename patches/{unapplied/server/0491-Zombie-API-breaking-doors.patch => server/0475-Zombie-API-breaking-doors.patch} (100%) rename patches/{unapplied/server/0492-Fix-nerfed-slime-when-splitting.patch => server/0476-Fix-nerfed-slime-when-splitting.patch} (84%) create mode 100644 patches/server/0477-Add-EntityLoadCrossbowEvent.patch rename patches/{unapplied/server/0494-Add-WorldGameRuleChangeEvent.patch => server/0478-Add-WorldGameRuleChangeEvent.patch} (92%) rename patches/{unapplied/server/0495-Add-ServerResourcesReloadedEvent.patch => server/0479-Add-ServerResourcesReloadedEvent.patch} (91%) rename patches/{unapplied/server/0496-Add-world-settings-for-mobs-picking-up-loot.patch => server/0480-Add-world-settings-for-mobs-picking-up-loot.patch} (85%) rename patches/{unapplied/server/0497-Add-BlockFailedDispenseEvent.patch => server/0481-Add-BlockFailedDispenseEvent.patch} (79%) rename patches/{unapplied/server/0498-Add-PlayerLecternPageChangeEvent.patch => server/0482-Add-PlayerLecternPageChangeEvent.patch} (100%) rename patches/{unapplied/server/0499-Add-PlayerLoomPatternSelectEvent.patch => server/0483-Add-PlayerLoomPatternSelectEvent.patch} (94%) rename patches/{unapplied/server/0500-Configurable-door-breaking-difficulty.patch => server/0484-Configurable-door-breaking-difficulty.patch} (86%) rename patches/{unapplied/server/0501-Empty-commands-shall-not-be-dispatched.patch => server/0485-Empty-commands-shall-not-be-dispatched.patch} (84%) rename patches/{unapplied/server/0502-Remove-stale-POIs.patch => server/0486-Remove-stale-POIs.patch} (87%) rename patches/{unapplied/server/0503-Fix-villager-boat-exploit.patch => server/0487-Fix-villager-boat-exploit.patch} (89%) rename patches/{unapplied/server/0504-Add-sendOpLevel-API.patch => server/0488-Add-sendOpLevel-API.patch} (85%) rename patches/{unapplied/server/0505-TODO-Registry-Modification-API.patch => server/0489-TODO-Registry-Modification-API.patch} (61%) rename patches/{unapplied/server/0506-Add-StructuresLocateEvent.patch => server/0490-Add-StructuresLocateEvent.patch} (96%) rename patches/{unapplied/server/0507-Collision-option-for-requiring-a-player-participant.patch => server/0491-Collision-option-for-requiring-a-player-participant.patch} (83%) rename patches/{unapplied/server/0508-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch => server/0492-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch} (85%) rename patches/{unapplied/server/0509-Return-chat-component-with-empty-text-instead-of-thr.patch => server/0493-Return-chat-component-with-empty-text-instead-of-thr.patch} (92%) rename patches/{unapplied/server/0510-Make-schedule-command-per-world.patch => server/0494-Make-schedule-command-per-world.patch} (94%) rename patches/{unapplied/server/0511-Configurable-max-leash-distance.patch => server/0495-Configurable-max-leash-distance.patch} (87%) rename patches/{unapplied/server/0512-Add-BlockPreDispenseEvent.patch => server/0496-Add-BlockPreDispenseEvent.patch} (84%) rename patches/{unapplied/server/0513-Add-PlayerChangeBeaconEffectEvent.patch => server/0497-Add-PlayerChangeBeaconEffectEvent.patch} (65%) rename patches/{unapplied/server/0514-Add-toggle-for-always-placing-the-dragon-egg.patch => server/0498-Add-toggle-for-always-placing-the-dragon-egg.patch} (92%) rename patches/{unapplied/server/0515-Add-PlayerStonecutterRecipeSelectEvent.patch => server/0499-Add-PlayerStonecutterRecipeSelectEvent.patch} (100%) rename patches/{unapplied/server/0516-Expand-EntityUnleashEvent.patch => server/0500-Expand-EntityUnleashEvent.patch} (88%) rename patches/{unapplied/server/0517-Reset-shield-blocking-on-dimension-change.patch => server/0501-Reset-shield-blocking-on-dimension-change.patch} (84%) rename patches/{unapplied/server/0518-Add-DragonEggFormEvent.patch => server/0502-Add-DragonEggFormEvent.patch} (96%) rename patches/{unapplied/server/0519-Add-EntityMoveEvent.patch => server/0503-Add-EntityMoveEvent.patch} (85%) rename patches/{unapplied/server/0520-added-option-to-disable-pathfinding-updates-on-block.patch => server/0504-added-option-to-disable-pathfinding-updates-on-block.patch} (78%) rename patches/{unapplied/server/0521-Inline-shift-direction-fields.patch => server/0505-Inline-shift-direction-fields.patch} (78%) rename patches/{unapplied/server/0522-Allow-adding-items-to-BlockDropItemEvent.patch => server/0506-Allow-adding-items-to-BlockDropItemEvent.patch} (93%) rename patches/{unapplied/server/0523-Add-getMainThreadExecutor-to-BukkitScheduler.patch => server/0507-Add-getMainThreadExecutor-to-BukkitScheduler.patch} (100%) rename patches/{unapplied/server/0524-living-entity-allow-attribute-registration.patch => server/0508-living-entity-allow-attribute-registration.patch} (84%) rename patches/{unapplied/server/0525-fix-dead-slime-setSize-invincibility.patch => server/0509-fix-dead-slime-setSize-invincibility.patch} (100%) rename patches/{unapplied/server/0526-Merchant-getRecipes-should-return-an-immutable-list.patch => server/0510-Merchant-getRecipes-should-return-an-immutable-list.patch} (100%) rename patches/{unapplied/server/0527-Expose-Tracked-Players.patch => server/0511-Expose-Tracked-Players.patch} (87%) rename patches/{unapplied/server/0528-Improve-ServerGUI.patch => server/0512-Improve-ServerGUI.patch} (99%) rename patches/{unapplied/server/0529-fix-converting-txt-to-json-file.patch => server/0513-fix-converting-txt-to-json-file.patch} (90%) rename patches/{unapplied/server/0530-Add-worldborder-events.patch => server/0514-Add-worldborder-events.patch} (97%) rename patches/{unapplied/server/0531-Add-PlayerNameEntityEvent.patch => server/0515-Add-PlayerNameEntityEvent.patch} (65%) rename patches/{unapplied/server/0533-Add-recipe-to-cook-events.patch => server/0516-Add-recipe-to-cook-events.patch} (89%) rename patches/{unapplied/server/0534-Add-Block-isValidTool.patch => server/0517-Add-Block-isValidTool.patch} (100%) rename patches/{unapplied/server/0535-Allow-using-signs-inside-spawn-protection.patch => server/0518-Allow-using-signs-inside-spawn-protection.patch} (53%) rename patches/{unapplied/server/0536-Expand-world-key-API.patch => server/0519-Expand-world-key-API.patch} (83%) rename patches/{unapplied/server/0537-Add-fast-alternative-constructor-for-Rotations.patch => server/0520-Add-fast-alternative-constructor-for-Rotations.patch} (88%) rename patches/{unapplied/server/0538-Item-Rarity-API.patch => server/0521-Item-Rarity-API.patch} (94%) rename patches/{unapplied/server/0539-Drop-carried-item-when-player-has-disconnected.patch => server/0522-Drop-carried-item-when-player-has-disconnected.patch} (89%) rename patches/{unapplied/server/0540-forced-whitelist-use-configurable-kick-message.patch => server/0523-forced-whitelist-use-configurable-kick-message.patch} (87%) create mode 100644 patches/server/0524-Don-t-ignore-result-of-PlayerEditBookEvent.patch rename patches/{unapplied/server/0542-Expose-protocol-version.patch => server/0525-Expose-protocol-version.patch} (85%) rename patches/{unapplied/server/0543-Enhance-console-tab-completions-for-brigadier-comman.patch => server/0526-Enhance-console-tab-completions-for-brigadier-comman.patch} (98%) rename patches/{unapplied/server/0544-Fix-PlayerItemConsumeEvent-cancelling-properly.patch => server/0527-Fix-PlayerItemConsumeEvent-cancelling-properly.patch} (88%) create mode 100644 patches/server/0528-Add-bypass-host-check.patch rename patches/{unapplied/server/0546-Set-area-affect-cloud-rotation.patch => server/0529-Set-area-affect-cloud-rotation.patch} (79%) rename patches/{unapplied/server/0547-add-isDeeplySleeping-to-HumanEntity.patch => server/0530-add-isDeeplySleeping-to-HumanEntity.patch} (83%) rename patches/{unapplied/server/0548-add-consumeFuel-to-FurnaceBurnEvent.patch => server/0531-add-consumeFuel-to-FurnaceBurnEvent.patch} (86%) rename patches/{unapplied/server/0549-add-get-set-drop-chance-to-EntityEquipment.patch => server/0532-add-get-set-drop-chance-to-EntityEquipment.patch} (100%) rename patches/{unapplied/server/0550-fix-PigZombieAngerEvent-cancellation.patch => server/0533-fix-PigZombieAngerEvent-cancellation.patch} (81%) rename patches/{unapplied/server/0551-fix-PlayerItemHeldEvent-firing-twice.patch => server/0534-fix-PlayerItemHeldEvent-firing-twice.patch} (88%) rename patches/{unapplied/server/0552-Add-PlayerDeepSleepEvent.patch => server/0535-Add-PlayerDeepSleepEvent.patch} (86%) rename patches/{unapplied/server/0553-More-World-API.patch => server/0536-More-World-API.patch} (95%) rename patches/{unapplied/server/0554-Add-PlayerBedFailEnterEvent.patch => server/0537-Add-PlayerBedFailEnterEvent.patch} (94%) rename patches/{unapplied/server/0555-Implement-methods-to-convert-between-Component-and-B.patch => server/0538-Implement-methods-to-convert-between-Component-and-B.patch} (94%) rename patches/{unapplied/server/0556-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch => server/0539-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch} (89%) rename patches/{unapplied/server/0557-Introduce-beacon-activation-deactivation-events.patch => server/0540-Introduce-beacon-activation-deactivation-events.patch} (89%) rename patches/{unapplied/server/0558-Add-Channel-initialization-listeners.patch => server/0541-Add-Channel-initialization-listeners.patch} (92%) rename patches/{unapplied/server/0559-Send-empty-commands-if-tab-completion-is-disabled.patch => server/0542-Send-empty-commands-if-tab-completion-is-disabled.patch} (88%) rename patches/{unapplied/server/0560-Add-more-WanderingTrader-API.patch => server/0543-Add-more-WanderingTrader-API.patch} (93%) rename patches/{unapplied/server/0561-Add-EntityBlockStorage-clearEntities.patch => server/0544-Add-EntityBlockStorage-clearEntities.patch} (77%) rename patches/{unapplied/server/0562-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch => server/0545-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch} (96%) rename patches/{unapplied/server/0563-Add-HiddenPotionEffect-API.patch => server/0546-Add-HiddenPotionEffect-API.patch} (78%) rename patches/{unapplied/server/0564-Inventory-close.patch => server/0547-Inventory-close.patch} (100%) rename patches/{unapplied/server/0565-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch => server/0548-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch} (87%) rename patches/{unapplied/server/0566-Add-basic-Datapack-API.patch => server/0549-Add-basic-Datapack-API.patch} (95%) rename patches/{unapplied/server/0567-Add-environment-variable-to-disable-server-gui.patch => server/0550-Add-environment-variable-to-disable-server-gui.patch} (74%) rename patches/{unapplied/server/0568-Expand-PlayerGameModeChangeEvent.patch => server/0551-Expand-PlayerGameModeChangeEvent.patch} (89%) rename patches/{unapplied/server/0569-ItemStack-repair-check-API.patch => server/0552-ItemStack-repair-check-API.patch} (95%) rename patches/{unapplied/server/0570-More-Enchantment-API.patch => server/0553-More-Enchantment-API.patch} (94%) rename patches/{unapplied/server/0571-Move-range-check-for-block-placing-up.patch => server/0554-Move-range-check-for-block-placing-up.patch} (82%) rename patches/{unapplied/server/0572-Add-Mob-lookAt-API.patch => server/0555-Add-Mob-lookAt-API.patch} (95%) rename patches/{unapplied/server/0573-Correctly-check-if-bucket-dispenses-will-succeed-for.patch => server/0556-Correctly-check-if-bucket-dispenses-will-succeed-for.patch} (93%) rename patches/{unapplied/server/0574-Add-Unix-domain-socket-support.patch => server/0557-Add-Unix-domain-socket-support.patch} (67%) delete mode 100644 patches/unapplied/server/0473-Add-PlayerShearBlockEvent.patch delete mode 100644 patches/unapplied/server/0489-Add-PlayerFlowerPotManipulateEvent.patch delete mode 100644 patches/unapplied/server/0493-Add-EntityLoadCrossbowEvent.patch delete mode 100644 patches/unapplied/server/0541-Don-t-ignore-result-of-PlayerEditBookEvent.patch delete mode 100644 patches/unapplied/server/0545-Add-bypass-host-check.patch rename {patches/unapplied/server => removed-patches-1-20-5}/0452-Reduce-blockpos-allocation-from-pathfinding.patch (100%) rename {patches/unapplied/server => removed-patches-1-20-5}/0486-Cache-burn-durations.patch (100%) rename {patches/unapplied/server => removed-patches-1-20-5}/0532-Prevent-grindstones-from-overstacking-items.patch (100%) diff --git a/patches/server/0434-Add-more-Evoker-API.patch b/patches/server/0420-Add-more-Evoker-API.patch similarity index 100% rename from patches/server/0434-Add-more-Evoker-API.patch rename to patches/server/0420-Add-more-Evoker-API.patch diff --git a/patches/server/0435-Add-methods-to-get-translation-keys.patch b/patches/server/0421-Add-methods-to-get-translation-keys.patch similarity index 97% rename from patches/server/0435-Add-methods-to-get-translation-keys.patch rename to patches/server/0421-Add-methods-to-get-translation-keys.patch index 26a527c94e..cb88aca4df 100644 --- a/patches/server/0435-Add-methods-to-get-translation-keys.patch +++ b/patches/server/0421-Add-methods-to-get-translation-keys.patch @@ -25,10 +25,10 @@ index f041b5d80bff9c022b007e04ef1558e9116acc6b..a586442422a2b2c06b785af0d261d3e1 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -index f24b4732db849893fd870b4b6a49f1c4b3eacdec..3feaaca5aaee12e48fa2e5f5d05329c9980b161e 100644 +index d839a0edf31f6803e5813b28a23fa17e20916b2c..bb8a3e670924ebcce48669c5dce57e2df03fad77 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -@@ -152,6 +152,11 @@ public class CraftEnchantment extends Enchantment implements Handleable%s", nms, bukkit); } diff --git a/patches/server/0438-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/patches/server/0424-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch similarity index 84% rename from patches/server/0438-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch rename to patches/server/0424-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch index e8f6dba7a8..af952c7cb7 100644 --- a/patches/server/0438-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch +++ b/patches/server/0424-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch @@ -9,10 +9,10 @@ as this is how Vanilla teleports entities. Cancel any pending motion when teleported. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 36ff9acf571d670fda225bce2f4ed16dc1d20fe3..07c5c01c2f5c18b1d6162275ca091b0ababd72c5 100644 +index 51e97ca80f25cd1e49033cfbc41b595f3fa54d66..5175475d75c393bfd5516d7dbede5200b7091b64 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -656,7 +656,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -682,7 +682,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl return; } @@ -21,20 +21,20 @@ index 36ff9acf571d670fda225bce2f4ed16dc1d20fe3..07c5c01c2f5c18b1d6162275ca091b0a this.lastGoodX = this.awaitingPositionFromClient.x; this.lastGoodY = this.awaitingPositionFromClient.y; this.lastGoodZ = this.awaitingPositionFromClient.z; -@@ -1587,7 +1587,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - // CraftBukkit end +@@ -1589,7 +1589,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.awaitingTeleportTime = this.tickCount; + this.player.resetCurrentImpulseContext(); - this.player.absMoveTo(d0, d1, d2, f, f1); + this.player.moveTo(d0, d1, d2, f, f1); // Paper - Fix Entity Teleportation and cancel velocity if teleported this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport)); } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 0c6680bf15b57cf314638ab70d849e033719c0e1..f45b148884b305628411d57f7662ea454fde3906 100644 +index e6422024dd4aa472156d9751dcdeb55b5e210f53..c8e4e37b706bd8cb9698ac2d13d0d8668e2d1d14 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -162,6 +162,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -165,6 +165,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess // CraftBukkit start private static final int CURRENT_LEVEL = 2; @@ -42,7 +42,7 @@ index 0c6680bf15b57cf314638ab70d849e033719c0e1..f45b148884b305628411d57f7662ea45 static boolean isLevelAtLeast(CompoundTag tag, int level) { return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; } -@@ -1785,6 +1786,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1809,6 +1810,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public void moveTo(double x, double y, double z, float yaw, float pitch) { @@ -57,10 +57,10 @@ index 0c6680bf15b57cf314638ab70d849e033719c0e1..f45b148884b305628411d57f7662ea45 this.setYRot(yaw); this.setXRot(pitch); diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index b771f954f3fccd92e15196bf542e0d3703cfb71a..41d2793e69bd664456b5e3c5891b03bdcb31d103 100644 +index b90127f9f805fdb5bb43a4b8ad2b10499b0b6b78..8efc06d29c62fa2be8515ed3359d52a6d4b807d2 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java -@@ -162,6 +162,7 @@ public abstract class BaseSpawner { +@@ -164,6 +164,7 @@ public abstract class BaseSpawner { return; } @@ -69,7 +69,7 @@ index b771f954f3fccd92e15196bf542e0d3703cfb71a..41d2793e69bd664456b5e3c5891b03bd if (entity instanceof Mob) { Mob entityinsentient = (Mob) entity; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 326978aedbd9cc81db2bf1d5398c1cd2ce68a866..f664fd4aa8d79e95787848b5a3e0ed7bc182fa25 100644 +index 40e4b8233e27b8ebd94a89bb43b5c14808edaa68..3da47cf8968c1917e2f216a410eece51a693dfb2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -238,7 +238,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { diff --git a/patches/unapplied/server/0439-Add-additional-open-container-api-to-HumanEntity.patch b/patches/server/0425-Add-additional-open-container-api-to-HumanEntity.patch similarity index 95% rename from patches/unapplied/server/0439-Add-additional-open-container-api-to-HumanEntity.patch rename to patches/server/0425-Add-additional-open-container-api-to-HumanEntity.patch index a65b493089..deb982691b 100644 --- a/patches/unapplied/server/0439-Add-additional-open-container-api-to-HumanEntity.patch +++ b/patches/server/0425-Add-additional-open-container-api-to-HumanEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add additional open container api to HumanEntity diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 3898d583a65e82711fd4415aed32ecf08f42100f..d5a8f019e88de30400733cdc3178eb982ccca341 100644 +index bbd3f0981eb95348ef12c9af8fa1712c022ed869..9393e9d21fcc41cb0f20b98d9f28c95b0e523f62 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -464,6 +464,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -462,6 +462,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { return this.getHandle().containerMenu.getBukkitView(); } diff --git a/patches/unapplied/server/0440-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch b/patches/server/0426-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch similarity index 100% rename from patches/unapplied/server/0440-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch rename to patches/server/0426-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch diff --git a/patches/unapplied/server/0441-Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/0427-Extend-block-drop-capture-to-capture-all-items-added.patch similarity index 89% rename from patches/unapplied/server/0441-Extend-block-drop-capture-to-capture-all-items-added.patch rename to patches/server/0427-Extend-block-drop-capture-to-capture-all-items-added.patch index aa2f0131c1..49994b1316 100644 --- a/patches/unapplied/server/0441-Extend-block-drop-capture-to-capture-all-items-added.patch +++ b/patches/server/0427-Extend-block-drop-capture-to-capture-all-items-added.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 2e42e09d3fa19e5a16374ee6ac1677dd2b2004f1..283f686364691f54d9e9e925b33238526de74219 100644 +index ccc5e57bfaaa51b05c66349475212f2079a4428c..4e1027f00fba2084073aa926805753224aa8b153 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1224,6 +1224,12 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1230,6 +1230,12 @@ public class ServerLevel extends Level implements WorldGenLevel { // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit return false; } else { @@ -23,10 +23,10 @@ index 2e42e09d3fa19e5a16374ee6ac1677dd2b2004f1..283f686364691f54d9e9e925b3323852 if (spawnReason != null && !CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) { return false; diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index c3eb4b6372eed0b7eb636f495ce494b676767b6e..a03d1a85019afdc42de2b8449fc38384c4dac51e 100644 +index 2f0d56c78584abe27ef050258827103fb60d5785..486d9c4dbe3ee23198eba7f34ea8b5f4e9048c0b 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -429,10 +429,12 @@ public class ServerPlayerGameMode { +@@ -432,10 +432,12 @@ public class ServerPlayerGameMode { // return true; // CraftBukkit } // CraftBukkit start diff --git a/patches/unapplied/server/0442-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/0428-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch similarity index 79% rename from patches/unapplied/server/0442-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch rename to patches/server/0428-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index 59a478433f..d1bf76d1de 100644 --- a/patches/unapplied/server/0442-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/server/0428-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index f45b148884b305628411d57f7662ea454fde3906..44610d4e3fb69e6cf5629d9e895e93d8dd5e09e9 100644 +index c8e4e37b706bd8cb9698ac2d13d0d8668e2d1d14..909575a02bf5f7040eb9c8edb034e7b6578e92b9 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4411,4 +4411,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4439,4 +4439,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess void accept(Entity entity, double x, double y, double z); } @@ -21,10 +21,10 @@ index f45b148884b305628411d57f7662ea454fde3906..44610d4e3fb69e6cf5629d9e895e93d8 + // Paper end - Expose entity id counter } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 7579e076793ba90e405b3ac0db600374ee8fdcb3..f4a7da134584a065a34b4f6a8eaebfcb81b6d735 100644 +index 291a9befb2abf95739fdc93faddb4864eb75853a..274747142472119677fa825b174e02aae0bf68eb 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -525,6 +525,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -522,6 +522,11 @@ public final class CraftMagicNumbers implements UnsafeValues { Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!"); return compound; } diff --git a/patches/unapplied/server/0443-Lazily-track-plugin-scoreboards-by-default.patch b/patches/server/0429-Lazily-track-plugin-scoreboards-by-default.patch similarity index 100% rename from patches/unapplied/server/0443-Lazily-track-plugin-scoreboards-by-default.patch rename to patches/server/0429-Lazily-track-plugin-scoreboards-by-default.patch diff --git a/patches/unapplied/server/0444-Entity-isTicking.patch b/patches/server/0430-Entity-isTicking.patch similarity index 78% rename from patches/unapplied/server/0444-Entity-isTicking.patch rename to patches/server/0430-Entity-isTicking.patch index 1b453a84c9..5add9ab4cb 100644 --- a/patches/unapplied/server/0444-Entity-isTicking.patch +++ b/patches/server/0430-Entity-isTicking.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity#isTicking diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 44610d4e3fb69e6cf5629d9e895e93d8dd5e09e9..2c0c41ae455ae5894e6bd85830741143c3d8aaa5 100644 +index 909575a02bf5f7040eb9c8edb034e7b6578e92b9..bbce55b02f848be720ad95cb5b896ff9ad1f66d0 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4416,5 +4416,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4444,5 +4444,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public static int nextEntityId() { return ENTITY_COUNTER.incrementAndGet(); } @@ -19,10 +19,10 @@ index 44610d4e3fb69e6cf5629d9e895e93d8dd5e09e9..2c0c41ae455ae5894e6bd85830741143 // Paper end - Expose entity id counter } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index f664fd4aa8d79e95787848b5a3e0ed7bc182fa25..ef8f8b3f97405250ebe058c67c4099da66a8e773 100644 +index 3da47cf8968c1917e2f216a410eece51a693dfb2..2080733ebae1af51b7b4d3cd2fbd1a4a2703a920 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1035,4 +1035,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1045,4 +1045,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return getHandle().isInLava(); } // Paper end - entity liquid API diff --git a/patches/unapplied/server/0445-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/0431-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch similarity index 90% rename from patches/unapplied/server/0445-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch rename to patches/server/0431-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch index 1b9f9b2d28..87e6cba3e6 100644 --- a/patches/unapplied/server/0445-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch +++ b/patches/server/0431-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index dd98174480eedfcb348798d9070219581009f16f..70ae9d44dd860014fd9a599e3a4e4a3fe80068ff 100644 +index 90cd5e6a5564f3b2002c2a4415fe130bf672b5d8..18efcf55bf13fa17ac532cca4c213e5b6e14979f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2151,13 +2151,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements BehaviorControl diff --git a/patches/unapplied/server/0447-Reset-Ender-Crystals-on-Dragon-Spawn.patch b/patches/server/0433-Reset-Ender-Crystals-on-Dragon-Spawn.patch similarity index 92% rename from patches/unapplied/server/0447-Reset-Ender-Crystals-on-Dragon-Spawn.patch rename to patches/server/0433-Reset-Ender-Crystals-on-Dragon-Spawn.patch index 3a8fa9719c..f727c2200f 100644 --- a/patches/unapplied/server/0447-Reset-Ender-Crystals-on-Dragon-Spawn.patch +++ b/patches/server/0433-Reset-Ender-Crystals-on-Dragon-Spawn.patch @@ -11,7 +11,7 @@ This ensures the crystals/pillars are in expected state when the dragon spawns. See #3522 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 1c716cf65d77e54ba8f90c8cf736e20c64f5df2e..f615b7f43f1444cf1e34b92cb0c05242a5dc26fd 100644 +index 6f9c78b124a33212125e98905efc8a09a1891500..79b63082e849f29244352b9d0d6ac9b7df7813f6 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 @@ -472,6 +472,7 @@ public class EndDragonFight { diff --git a/patches/unapplied/server/0448-Fix-for-large-move-vectors-crashing-server.patch b/patches/server/0434-Fix-for-large-move-vectors-crashing-server.patch similarity index 91% rename from patches/unapplied/server/0448-Fix-for-large-move-vectors-crashing-server.patch rename to patches/server/0434-Fix-for-large-move-vectors-crashing-server.patch index 7260ba146b..5b4918596b 100644 --- a/patches/unapplied/server/0448-Fix-for-large-move-vectors-crashing-server.patch +++ b/patches/server/0434-Fix-for-large-move-vectors-crashing-server.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix for large move vectors crashing server Check movement distance also based on current position. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 07c5c01c2f5c18b1d6162275ca091b0ababd72c5..26c9d483810c8679fb2eff42c9176b8037cd56f8 100644 +index 5175475d75c393bfd5516d7dbede5200b7091b64..355b1726e90eb796fa2c1e21108bcf793637bf6c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -472,9 +472,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -498,9 +498,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl float prevYaw = this.player.getYRot(); float prevPitch = this.player.getXRot(); // CraftBukkit end @@ -22,7 +22,7 @@ index 07c5c01c2f5c18b1d6162275ca091b0ababd72c5..26c9d483810c8679fb2eff42c9176b80 double d3 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX()); final double toX = d3; // Paper - OBFHELPER double d4 = ServerGamePacketListenerImpl.clampVertical(packet.getY()); final double toY = d4; // Paper - OBFHELPER double d5 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ()); final double toZ = d5; // Paper - OBFHELPER -@@ -484,7 +484,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -510,7 +510,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d7 = d4 - this.vehicleFirstGoodY; double d8 = d5 - this.vehicleFirstGoodZ; double d9 = entity.getDeltaMovement().lengthSqr(); @@ -40,7 +40,7 @@ index 07c5c01c2f5c18b1d6162275ca091b0ababd72c5..26c9d483810c8679fb2eff42c9176b80 // CraftBukkit start - handle custom speeds and skipped ticks this.allowedPlayerTicks += (System.currentTimeMillis() / 50) - this.lastTick; -@@ -530,9 +539,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -556,9 +565,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl boolean flag = worldserver.noCollision(entity, entity.getBoundingBox().deflate(0.0625D)); @@ -53,7 +53,7 @@ index 07c5c01c2f5c18b1d6162275ca091b0ababd72c5..26c9d483810c8679fb2eff42c9176b80 boolean flag1 = entity.verticalCollisionBelow; if (entity instanceof LivingEntity) { -@@ -1272,7 +1281,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1265,7 +1274,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d7 = d1 - this.firstGoodY; double d8 = d2 - this.firstGoodZ; double d9 = this.player.getDeltaMovement().lengthSqr(); @@ -71,7 +71,7 @@ index 07c5c01c2f5c18b1d6162275ca091b0ababd72c5..26c9d483810c8679fb2eff42c9176b80 if (this.player.isSleeping()) { if (d10 > 1.0D) { -@@ -1326,9 +1344,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1321,9 +1339,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl AABB axisalignedbb = this.player.getBoundingBox(); @@ -81,6 +81,6 @@ index 07c5c01c2f5c18b1d6162275ca091b0ababd72c5..26c9d483810c8679fb2eff42c9176b80 + d6 = d0 - this.lastGoodX; // Paper - diff on change, used for checking large move vectors above + d7 = d1 - this.lastGoodY; // Paper - diff on change, used for checking large move vectors above + d8 = d2 - this.lastGoodZ; // Paper - diff on change, used for checking large move vectors above - boolean flag = d7 > 0.0D; + boolean flag1 = d7 > 0.0D; - if (this.player.onGround() && !packet.isOnGround() && flag) { + if (this.player.onGround() && !packet.isOnGround() && flag1) { diff --git a/patches/unapplied/server/0449-Optimise-getType-calls.patch b/patches/server/0435-Optimise-getType-calls.patch similarity index 89% rename from patches/unapplied/server/0449-Optimise-getType-calls.patch rename to patches/server/0435-Optimise-getType-calls.patch index 6dd01d7860..988e1865ce 100644 --- a/patches/unapplied/server/0449-Optimise-getType-calls.patch +++ b/patches/server/0435-Optimise-getType-calls.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimise getType calls Remove the map lookup for converting from Block->Bukkit Material diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockState.java b/src/main/java/net/minecraft/world/level/block/state/BlockState.java -index da878e180c6b94f98dc82c6e8395f63ecc9b2c1e..e33a4ade1dd40ba482e2ca51c3b3ddad284106c3 100644 +index 065d140ca4f987e14138a37f4c7d60879dd7b6e1..601135f3368272bf1ca3a43ec9c199e3ee838462 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockState.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockState.java @@ -10,6 +10,16 @@ import net.minecraft.world.level.block.state.properties.Property; @@ -23,7 +23,7 @@ index da878e180c6b94f98dc82c6e8395f63ecc9b2c1e..e33a4ade1dd40ba482e2ca51c3b3ddad + return this.cachedMaterial; + } + // Paper end - optimise getType calls - public BlockState(Block block, ImmutableMap, Comparable> propertyMap, MapCodec codec) { + public BlockState(Block block, Reference2ObjectArrayMap, Comparable> propertyMap, MapCodec codec) { super(block, propertyMap, codec); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java @@ -53,10 +53,10 @@ index a586442422a2b2c06b785af0d261d3e19eb1d59b..aa644231425b9622437538b5c092d406 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -index 8e5279abccdd074d565f246420b2b12b81189b67..928a301627134b49915b0ceaeabb7dc350605dc2 100644 +index fabdec2d66cc6d676ed58fa570e2c318ab0927e2..1002123cd0c6f57cecc4e80f5f21cc6ff5886d37 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -@@ -170,7 +170,7 @@ public class CraftBlockState implements BlockState { +@@ -175,7 +175,7 @@ public class CraftBlockState implements BlockState { @Override public Material getType() { @@ -66,10 +66,10 @@ index 8e5279abccdd074d565f246420b2b12b81189b67..928a301627134b49915b0ceaeabb7dc3 public void setFlag(int flag) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index 587396f5ed01939cd3ddce10fecf86ba80eb9c73..01a1479711b7f7bb87db275a1edfab5a95464cca 100644 +index b875bebb8b63c6f60301180fc2e3fc9c1bc87193..2303525542daa933a8de5978ac43d16223c6e5fd 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -61,7 +61,7 @@ public class CraftBlockData implements BlockData { +@@ -60,7 +60,7 @@ public class CraftBlockData implements BlockData { @Override public Material getMaterial() { diff --git a/patches/unapplied/server/0450-Villager-resetOffers.patch b/patches/server/0436-Villager-resetOffers.patch similarity index 91% rename from patches/unapplied/server/0450-Villager-resetOffers.patch rename to patches/server/0436-Villager-resetOffers.patch index 6068c580b9..e8e71e6b5c 100644 --- a/patches/unapplied/server/0450-Villager-resetOffers.patch +++ b/patches/server/0436-Villager-resetOffers.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Villager#resetOffers diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -index 0ded8ee2deb51bea7506a8fa2d21f5e160694d54..ddc002f269527201724457c0b820788200441e0c 100644 +index 521c9602db7c532470adcd5f024d3dd0f1e88780..79e81fd5490a493b595dc1034641e13451e5a61a 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -@@ -114,6 +114,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa +@@ -116,6 +116,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa return this.tradingPlayer != null; } diff --git a/patches/unapplied/server/0451-Retain-block-place-order-when-capturing-blockstates.patch b/patches/server/0437-Retain-block-place-order-when-capturing-blockstates.patch similarity index 89% rename from patches/unapplied/server/0451-Retain-block-place-order-when-capturing-blockstates.patch rename to patches/server/0437-Retain-block-place-order-when-capturing-blockstates.patch index 81ed0ec42c..5df78528b6 100644 --- a/patches/unapplied/server/0451-Retain-block-place-order-when-capturing-blockstates.patch +++ b/patches/server/0437-Retain-block-place-order-when-capturing-blockstates.patch @@ -10,10 +10,10 @@ In general, look at making this logic more robust (i.e properly handling cases where a captured entry is overriden) - but for now this will do. diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 6d5a0aa8f8cee0897a920c2abf18efc03cad2abb..40f1b4ba266f96629b989590c7c81cd7534e93da 100644 +index eec2ca8306d42e4eafdf3ab0778bf2023739cb83..411841f2d8013ae9142b96c251aabd54d16c5b73 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -154,7 +154,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -151,7 +151,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public boolean captureBlockStates = false; public boolean captureTreeGeneration = false; public Map capturedBlockStates = new java.util.LinkedHashMap<>(); // Paper diff --git a/patches/unapplied/server/0453-Fix-item-locations-dropped-from-campfires.patch b/patches/server/0438-Fix-item-locations-dropped-from-campfires.patch similarity index 87% rename from patches/unapplied/server/0453-Fix-item-locations-dropped-from-campfires.patch rename to patches/server/0438-Fix-item-locations-dropped-from-campfires.patch index d96bf626d4..65034de65e 100644 --- a/patches/unapplied/server/0453-Fix-item-locations-dropped-from-campfires.patch +++ b/patches/server/0438-Fix-item-locations-dropped-from-campfires.patch @@ -7,10 +7,10 @@ Fixes #4259 by not flooring the blockposition among other weirdness Vanilla Issue: MC-267622 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 c4cf6abf0a962794ddbb4d7a691406054062ffee..3a2afa6c1f6dfad7dc18d93b743cbea1eef0e4b8 100644 +index 0de294a2aec50a39d6dbc56b6a61b01b1e538828..66fbad74c2ec2f853ec6c74482c6cae1c1746007 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 -@@ -82,7 +82,14 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { +@@ -87,7 +87,14 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { result = blockCookEvent.getResult(); itemstack1 = CraftItemStack.asNMSCopy(result); // CraftBukkit end @@ -25,4 +25,4 @@ index c4cf6abf0a962794ddbb4d7a691406054062ffee..3a2afa6c1f6dfad7dc18d93b743cbea1 + // Paper end - Fix item locations dropped from campfires campfire.items.set(i, ItemStack.EMPTY); world.sendBlockUpdated(pos, state, state, 3); - world.gameEvent(GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(state)); + world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(state)); diff --git a/patches/unapplied/server/0454-Fix-bell-block-entity-memory-leak.patch b/patches/server/0439-Fix-bell-block-entity-memory-leak.patch similarity index 95% rename from patches/unapplied/server/0454-Fix-bell-block-entity-memory-leak.patch rename to patches/server/0439-Fix-bell-block-entity-memory-leak.patch index 91b7136c9d..5343b073cd 100644 --- a/patches/unapplied/server/0454-Fix-bell-block-entity-memory-leak.patch +++ b/patches/server/0439-Fix-bell-block-entity-memory-leak.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix bell block entity memory leak BellBlockEntity has a list of entities (entitiesAtRing) that was not being cleared at the right time, causing leaks whenever a bell would be rung near a crowd of entities. diff --git a/src/main/java/net/minecraft/world/level/block/entity/BellBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BellBlockEntity.java -index 30e9d4b20005dc6d20baf578f2ae958bdfcea02a..d21f7e9712ac2d9088ce19d415e4ba7863d8cebf 100644 +index e1adfd10a2f67687b7123d20d31eb7d059a3e1e3..86dac3f82da065bf79d94da9df192f51ce4665e2 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BellBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BellBlockEntity.java @@ -63,6 +63,11 @@ public class BellBlockEntity extends BlockEntity { diff --git a/patches/unapplied/server/0455-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch b/patches/server/0440-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch similarity index 93% rename from patches/unapplied/server/0455-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch rename to patches/server/0440-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch index 741bc6d269..87d59f556c 100644 --- a/patches/unapplied/server/0455-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch +++ b/patches/server/0440-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch @@ -8,10 +8,10 @@ This can realistically only happen if there's custom loot active on fishing which can return 0 items. This would disconnect the player who's fishing. diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -index d7548eb7cd6986dcea6fbf4efb76b647cc350642..a87fcd5b837e1c824cbd5587c3350986e2fd7acb 100644 +index 453da998a98eabe5a55a968277b71bd9998f3221..a9ea83ea03ab23abc1eb463dadcdd742bfa20036 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -@@ -504,9 +504,15 @@ public class FishingHook extends Projectile { +@@ -505,9 +505,15 @@ public class FishingHook extends Projectile { while (iterator.hasNext()) { ItemStack itemstack1 = (ItemStack) iterator.next(); @@ -29,7 +29,7 @@ index d7548eb7cd6986dcea6fbf4efb76b647cc350642..a87fcd5b837e1c824cbd5587c3350986 playerFishEvent.setExpToDrop(this.random.nextInt(6) + 1); this.level().getCraftServer().getPluginManager().callEvent(playerFishEvent); -@@ -519,8 +525,12 @@ public class FishingHook extends Projectile { +@@ -520,8 +526,12 @@ public class FishingHook extends Projectile { double d2 = entityhuman.getZ() - this.getZ(); double d3 = 0.1D; diff --git a/patches/unapplied/server/0456-Add-getOfflinePlayerIfCached-String.patch b/patches/server/0441-Add-getOfflinePlayerIfCached-String.patch similarity index 89% rename from patches/unapplied/server/0456-Add-getOfflinePlayerIfCached-String.patch rename to patches/server/0441-Add-getOfflinePlayerIfCached-String.patch index d72a0cdabe..ba41a8d0e7 100644 --- a/patches/unapplied/server/0456-Add-getOfflinePlayerIfCached-String.patch +++ b/patches/server/0441-Add-getOfflinePlayerIfCached-String.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c05fd6a179e8d142b3f5a8977ae7afab8c609a4e..c353f7a3a9ad0099ef7330dde988d1a174a0e327 100644 +index a22b146e2bfdeb66aca8abb5fb23ee5cd6306f4e..99fa8f65801b1816b788fa42d49d6672bf331579 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1921,6 +1921,28 @@ public final class CraftServer implements Server { +@@ -1933,6 +1933,28 @@ public final class CraftServer implements Server { return result; } diff --git a/patches/unapplied/server/0457-Add-ignore-discounts-API.patch b/patches/server/0442-Add-ignore-discounts-API.patch similarity index 58% rename from patches/unapplied/server/0457-Add-ignore-discounts-API.patch rename to patches/server/0442-Add-ignore-discounts-API.patch index a0354c3ea6..82cbdddb4a 100644 --- a/patches/unapplied/server/0457-Add-ignore-discounts-API.patch +++ b/patches/server/0442-Add-ignore-discounts-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add ignore discounts API diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index 0a1a70edda66bf348b3e3a9df4670cd81561cd1f..a01e089ed7689485a7ac33ab29bc27c4b68bc1df 100644 +index 4d7f95d2bd415bacccee145bfc47f2b480530c11..4d3a04e1d7910c4e71ac9a1cebb58e482958671a 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -491,6 +491,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -25,10 +25,21 @@ index 0a1a70edda66bf348b3e3a9df4670cd81561cd1f..a01e089ed7689485a7ac33ab29bc27c4 int k = (int) Math.floor(d0 * (double) merchantrecipe1.getBaseCostA().getCount()); diff --git a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java -index 7da5c4a45f8fd46fedd4386e0faac57445475e3a..02feea12c998f37098b72becf6bfaf6b27d155de 100644 +index 89982d25f60c8b60ba91e559ef88278f338fe215..bffa088b13312d525efaab3d7988a08953c4d9c3 100644 --- a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java +++ b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java -@@ -19,6 +19,7 @@ public class MerchantOffer { +@@ -33,6 +33,10 @@ public class MerchantOffer { + return merchantrecipe.priceMultiplier; + }), Codec.INT.lenientOptionalFieldOf("xp", 1).forGetter((merchantrecipe) -> { + return merchantrecipe.xp; ++ // Paper start ++ }), Codec.BOOL.lenientOptionalFieldOf("Paper.IgnoreDiscounts", false).forGetter((merchantrecipe) -> { ++ return merchantrecipe.ignoreDiscounts; ++ // Paper end + })).apply(instance, MerchantOffer::new); + }); + public static final StreamCodec STREAM_CODEC = StreamCodec.of(MerchantOffer::writeToStream, MerchantOffer::createFromStream); +@@ -46,6 +50,7 @@ public class MerchantOffer { public int demand; public float priceMultiplier; public int xp; @@ -36,65 +47,42 @@ index 7da5c4a45f8fd46fedd4386e0faac57445475e3a..02feea12c998f37098b72becf6bfaf6b // CraftBukkit start private CraftMerchantRecipe bukkitHandle; -@@ -31,7 +32,15 @@ public class MerchantOffer { - } - - public MerchantOffer(ItemStack itemstack, ItemStack itemstack1, ItemStack itemstack2, int uses, int maxUses, int experience, float priceMultiplier, int demand, CraftMerchantRecipe bukkit) { -- this(itemstack, itemstack1, itemstack2, uses, maxUses, experience, priceMultiplier, demand); -+ // Paper start - Add ignore discounts API -+ this(itemstack, itemstack1, itemstack2, uses, maxUses, experience, priceMultiplier, demand, false, bukkit); -+ } -+ public MerchantOffer(ItemStack itemstack, ItemStack itemstack1, ItemStack itemstack2, int uses, int maxUses, int experience, float priceMultiplier, boolean ignoreDiscounts, CraftMerchantRecipe bukkit) { -+ this(itemstack, itemstack1, itemstack2, uses, maxUses, experience, priceMultiplier, 0, ignoreDiscounts, bukkit); -+ } -+ public MerchantOffer(ItemStack itemstack, ItemStack itemstack1, ItemStack itemstack2, int uses, int maxUses, int experience, float priceMultiplier, int demand, boolean ignoreDiscounts, CraftMerchantRecipe bukkit) { -+ this(itemstack, itemstack1, itemstack2, uses, maxUses, experience, priceMultiplier, demand, ignoreDiscounts); -+ // Paper end - Add ignore discounts API - this.bukkitHandle = bukkit; +@@ -59,7 +64,7 @@ public class MerchantOffer { } // CraftBukkit end -@@ -63,6 +72,7 @@ public class MerchantOffer { - this.specialPriceDiff = nbt.getInt("specialPrice"); - this.demand = nbt.getInt("demand"); -+ this.ignoreDiscounts = nbt.getBoolean("Paper.IgnoreDiscounts"); // Paper - Add ignore discounts API - } - - public MerchantOffer(ItemStack buyItem, ItemStack sellItem, int maxUses, int merchantExperience, float priceMultiplier) { -@@ -74,10 +84,19 @@ public class MerchantOffer { - } - - public MerchantOffer(ItemStack firstBuyItem, ItemStack secondBuyItem, ItemStack sellItem, int uses, int maxUses, int merchantExperience, float priceMultiplier) { -- this(firstBuyItem, secondBuyItem, sellItem, uses, maxUses, merchantExperience, priceMultiplier, 0); -+ // Paper start - Add ignore discounts API -+ this(firstBuyItem, secondBuyItem, sellItem, uses, maxUses, merchantExperience, priceMultiplier, false); -+ } -+ public MerchantOffer(ItemStack firstBuyItem, ItemStack secondBuyItem, ItemStack sellItem, int uses, int maxUses, int merchantExperience, float priceMultiplier, boolean ignoreDiscounts) { -+ this(firstBuyItem, secondBuyItem, sellItem, uses, maxUses, merchantExperience, priceMultiplier, 0, ignoreDiscounts); - } - - public MerchantOffer(ItemStack firstBuyItem, ItemStack secondBuyItem, ItemStack sellItem, int uses, int maxUses, int merchantExperience, float priceMultiplier, int demandBonus) { -+ this(firstBuyItem, secondBuyItem, sellItem, uses, maxUses, merchantExperience, priceMultiplier, demandBonus, false); -+ } -+ public MerchantOffer(ItemStack firstBuyItem, ItemStack secondBuyItem, ItemStack sellItem, int uses, int maxUses, int merchantExperience, float priceMultiplier, int demandBonus, boolean ignoreDiscounts) { -+ this.ignoreDiscounts = ignoreDiscounts; -+ // Paper end - Add ignore discounts API - this.rewardExp = true; - this.xp = 1; +- private MerchantOffer(ItemCost firstBuyItem, Optional secondBuyItem, ItemStack sellItem, int uses, int maxUses, boolean rewardingPlayerExperience, int specialPrice, int demandBonus, float priceMultiplier, int merchantExperience) { ++ private MerchantOffer(ItemCost firstBuyItem, Optional secondBuyItem, ItemStack sellItem, int uses, int maxUses, boolean rewardingPlayerExperience, int specialPrice, int demandBonus, float priceMultiplier, int merchantExperience, boolean ignoreDiscounts) { // Paper this.baseCostA = firstBuyItem; -@@ -210,6 +229,7 @@ public class MerchantOffer { - nbttagcompound.putFloat("priceMultiplier", this.priceMultiplier); - nbttagcompound.putInt("specialPrice", this.specialPriceDiff); - nbttagcompound.putInt("demand", this.demand); -+ nbttagcompound.putBoolean("Paper.IgnoreDiscounts", this.ignoreDiscounts); // Paper - Add ignore discounts API - return nbttagcompound; + this.costB = secondBuyItem; + this.result = sellItem; +@@ -70,6 +75,7 @@ public class MerchantOffer { + this.demand = demandBonus; + this.priceMultiplier = priceMultiplier; + this.xp = merchantExperience; ++ this.ignoreDiscounts = ignoreDiscounts; } + public MerchantOffer(ItemCost buyItem, ItemStack sellItem, int maxUses, int merchantExperience, float priceMultiplier) { +@@ -85,11 +91,11 @@ public class MerchantOffer { + } + + public MerchantOffer(ItemCost firstBuyItem, Optional secondBuyItem, ItemStack sellItem, int uses, int maxUses, int merchantExperience, float priceMultiplier, int demandBonus) { +- this(firstBuyItem, secondBuyItem, sellItem, uses, maxUses, true, 0, demandBonus, priceMultiplier, merchantExperience); ++ this(firstBuyItem, secondBuyItem, sellItem, uses, maxUses, true, 0, demandBonus, priceMultiplier, merchantExperience, false); // Paper + } + + private MerchantOffer(MerchantOffer offer) { +- this(offer.baseCostA, offer.costB, offer.result.copy(), offer.uses, offer.maxUses, offer.rewardExp, offer.specialPriceDiff, offer.demand, offer.priceMultiplier, offer.xp); ++ this(offer.baseCostA, offer.costB, offer.result.copy(), offer.uses, offer.maxUses, offer.rewardExp, offer.specialPriceDiff, offer.demand, offer.priceMultiplier, offer.xp, offer.ignoreDiscounts); // Paper + } + + public ItemStack getBaseCostA() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java -index c015b34d2b13a759783da7c0c06dd0563d35fc88..5741a233fb1dd8ad0f83a09b44476a4b88e6aa16 100644 +index 3bf9b5c016fa638fd0377d2a031a7359430b79ce..a18088125254178d362fdd283bff704a9ccdd0a7 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java -@@ -18,11 +18,19 @@ public class CraftMerchantRecipe extends MerchantRecipe { +@@ -22,11 +22,19 @@ public class CraftMerchantRecipe extends MerchantRecipe { @Deprecated public CraftMerchantRecipe(ItemStack result, int uses, int maxUses, boolean experienceReward, int experience, float priceMultiplier) { @@ -114,9 +102,9 @@ index c015b34d2b13a759783da7c0c06dd0563d35fc88..5741a233fb1dd8ad0f83a09b44476a4b + super(result, uses, maxUses, experienceReward, experience, priceMultiplier, demand, specialPrice, ignoreDiscounts); + // Paper end this.handle = new net.minecraft.world.item.trading.MerchantOffer( - net.minecraft.world.item.ItemStack.EMPTY, - net.minecraft.world.item.ItemStack.EMPTY, -@@ -32,6 +40,7 @@ public class CraftMerchantRecipe extends MerchantRecipe { + new ItemCost(Items.AIR), + Optional.empty(), +@@ -36,6 +44,7 @@ public class CraftMerchantRecipe extends MerchantRecipe { experience, priceMultiplier, demand, @@ -124,7 +112,7 @@ index c015b34d2b13a759783da7c0c06dd0563d35fc88..5741a233fb1dd8ad0f83a09b44476a4b this ); this.setSpecialPrice(specialPrice); -@@ -108,6 +117,18 @@ public class CraftMerchantRecipe extends MerchantRecipe { +@@ -112,6 +121,18 @@ public class CraftMerchantRecipe extends MerchantRecipe { this.handle.priceMultiplier = priceMultiplier; } @@ -143,7 +131,7 @@ index c015b34d2b13a759783da7c0c06dd0563d35fc88..5741a233fb1dd8ad0f83a09b44476a4b public net.minecraft.world.item.trading.MerchantOffer toMinecraft() { List ingredients = this.getIngredients(); Preconditions.checkState(!ingredients.isEmpty(), "No offered ingredients"); -@@ -122,7 +143,7 @@ public class CraftMerchantRecipe extends MerchantRecipe { +@@ -128,7 +149,7 @@ public class CraftMerchantRecipe extends MerchantRecipe { if (recipe instanceof CraftMerchantRecipe) { return (CraftMerchantRecipe) recipe; } else { diff --git a/patches/unapplied/server/0458-Toggle-for-removing-existing-dragon.patch b/patches/server/0443-Toggle-for-removing-existing-dragon.patch similarity index 92% rename from patches/unapplied/server/0458-Toggle-for-removing-existing-dragon.patch rename to patches/server/0443-Toggle-for-removing-existing-dragon.patch index 410f6cec83..1bfa511969 100644 --- a/patches/unapplied/server/0458-Toggle-for-removing-existing-dragon.patch +++ b/patches/server/0443-Toggle-for-removing-existing-dragon.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Toggle for removing existing dragon 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 f615b7f43f1444cf1e34b92cb0c05242a5dc26fd..c4555320d1f283a41c47d08d68c2633717f6fda8 100644 +index 79b63082e849f29244352b9d0d6ac9b7df7813f6..3ea0ca395e0561d96044f0f84442a08b42b539bd 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 @@ -209,7 +209,7 @@ public class EndDragonFight { diff --git a/patches/unapplied/server/0459-Fix-client-lag-on-advancement-loading.patch b/patches/server/0444-Fix-client-lag-on-advancement-loading.patch similarity index 92% rename from patches/unapplied/server/0459-Fix-client-lag-on-advancement-loading.patch rename to patches/server/0444-Fix-client-lag-on-advancement-loading.patch index 18483eae32..71a70b4222 100644 --- a/patches/unapplied/server/0459-Fix-client-lag-on-advancement-loading.patch +++ b/patches/server/0444-Fix-client-lag-on-advancement-loading.patch @@ -15,10 +15,10 @@ manually reload the advancement data for all players, which normally takes place as a part of the datapack reloading. diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index f4a7da134584a065a34b4f6a8eaebfcb81b6d735..f10457466cbaaba2d3aa49a64092847f635ce752 100644 +index 274747142472119677fa825b174e02aae0bf68eb..c0878cf9948774986996127e250004f0f21d6b31 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -334,7 +334,13 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -333,7 +333,13 @@ public final class CraftMagicNumbers implements UnsafeValues { Bukkit.getLogger().log(Level.SEVERE, "Error saving advancement " + key, ex); } diff --git a/patches/unapplied/server/0460-Item-no-age-no-player-pickup.patch b/patches/server/0445-Item-no-age-no-player-pickup.patch similarity index 100% rename from patches/unapplied/server/0460-Item-no-age-no-player-pickup.patch rename to patches/server/0445-Item-no-age-no-player-pickup.patch diff --git a/patches/unapplied/server/0461-Beacon-API-custom-effect-ranges.patch b/patches/server/0446-Beacon-API-custom-effect-ranges.patch similarity index 84% rename from patches/unapplied/server/0461-Beacon-API-custom-effect-ranges.patch rename to patches/server/0446-Beacon-API-custom-effect-ranges.patch index 88e2a56086..3420eaaa03 100644 --- a/patches/unapplied/server/0461-Beacon-API-custom-effect-ranges.patch +++ b/patches/server/0446-Beacon-API-custom-effect-ranges.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Beacon API - custom effect ranges 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 a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85cd78c415 100644 +index 18450017bc3df2f0b1a5715e6021e8e5defa24a1..32a242d4b67b4edbc1996fa64a151dc60e7e996e 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 -@@ -82,6 +82,26 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -86,6 +86,26 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name return (BeaconBlockEntity.hasSecondaryEffect(this.levels, this.primaryPower, this.secondaryPower)) ? CraftPotionUtil.toBukkit(new MobEffectInstance(this.secondaryPower, BeaconBlockEntity.getLevel(this.levels), BeaconBlockEntity.getAmplification(this.levels, this.primaryPower, this.secondaryPower), true, true)) : null; } // CraftBukkit end @@ -34,8 +34,8 @@ index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85 + // Paper end - Custom beacon ranges @Nullable - static MobEffect filterEffect(@Nullable MobEffect effect) { -@@ -197,7 +217,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name + static Holder filterEffect(@Nullable Holder effect) { +@@ -201,7 +221,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } if (blockEntity.levels > 0 && !blockEntity.beamSections.isEmpty()) { @@ -44,7 +44,7 @@ index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85 BeaconBlockEntity.playSound(world, pos, SoundEvents.BEACON_AMBIENT); } } -@@ -283,8 +303,13 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -287,8 +307,13 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } public static List getHumansInRange(Level world, BlockPos blockposition, int i) { @@ -59,11 +59,11 @@ index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85 AABB axisalignedbb = (new AABB(blockposition)).inflate(d0).expandTowards(0.0D, (double) world.getHeight(), 0.0D); List list = world.getEntitiesOfClass(Player.class, axisalignedbb); -@@ -325,12 +350,17 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -329,12 +354,17 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } - private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable MobEffect primaryEffect, @Nullable MobEffect secondaryEffect) { -+ // Paper start - Custom beacon ranges + private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable Holder primaryEffect, @Nullable Holder secondaryEffect) { ++ // Paper start - Custom beacon ranges + BeaconBlockEntity.applyEffects(world, pos, beaconLevel, primaryEffect, secondaryEffect, null); + } + private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable MobEffect primaryEffect, @Nullable MobEffect secondaryEffect, @Nullable BeaconBlockEntity blockEntity) { @@ -78,7 +78,7 @@ index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85 BeaconBlockEntity.applyEffect(list, primaryEffect, j, b0, true, pos); // Paper - BeaconEffectEvent -@@ -393,6 +423,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -395,6 +425,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } this.lockKey = LockCode.fromTag(nbt); @@ -86,7 +86,7 @@ index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85 } @Override -@@ -406,6 +437,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -408,6 +439,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } this.lockKey.addToTag(nbt); @@ -95,10 +95,10 @@ index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85 public void setCustomName(@Nullable Component customName) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java -index c4890927419e27fd35e4e373fb09dcb182234fbf..2d77ee30f87491bd413d11687d9fd6def843104c 100644 +index 2dfbe061a064b0c79b96f644a1c3639bb900eca4..3f1bb225c4e6acdd9104e856d6a11d519119c9f4 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java -@@ -32,7 +32,7 @@ public class CraftBeacon extends CraftBlockEntityState implem +@@ -33,7 +33,7 @@ public class CraftBeacon extends CraftBlockEntityState implem if (tileEntity instanceof BeaconBlockEntity) { BeaconBlockEntity beacon = (BeaconBlockEntity) tileEntity; @@ -107,9 +107,9 @@ index c4890927419e27fd35e4e373fb09dcb182234fbf..2d77ee30f87491bd413d11687d9fd6de Collection bukkit = new ArrayList(nms.size()); for (Player human : nms) { -@@ -114,4 +114,21 @@ public class CraftBeacon extends CraftBlockEntityState implem - public CraftBeacon copy() { - return new CraftBeacon(this); +@@ -120,4 +120,21 @@ public class CraftBeacon extends CraftBlockEntityState implem + public CraftBeacon copy(Location location) { + return new CraftBeacon(this, location); } + + // Paper start diff --git a/patches/unapplied/server/0462-Add-API-for-quit-reason.patch b/patches/server/0447-Add-API-for-quit-reason.patch similarity index 88% rename from patches/unapplied/server/0462-Add-API-for-quit-reason.patch rename to patches/server/0447-Add-API-for-quit-reason.patch index a5ab74ddf4..23781bfdeb 100644 --- a/patches/unapplied/server/0462-Add-API-for-quit-reason.patch +++ b/patches/server/0447-Add-API-for-quit-reason.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add API for quit reason diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 1113380f6f142d2faf36191aae158c747bed5bb9..ddc84de84c8a503a01e40c42fe83558af7159f8f 100644 +index 68d5be903a0d13e59c9e4bd6d85baaf0773547a0..fe89e8f509f3972ceb71c9aa6277524baa39985b 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -179,12 +179,15 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -167,12 +167,15 @@ public class Connection extends SimpleChannelInboundHandler> { this.handlingFault = true; if (this.channel.isOpen()) { @@ -18,17 +18,17 @@ index 1113380f6f142d2faf36191aae158c747bed5bb9..ddc84de84c8a503a01e40c42fe83558a + if (player != null) player.quitReason = org.bukkit.event.player.PlayerQuitEvent.QuitReason.TIMED_OUT; // Paper - Add API for quit reason this.disconnect(Component.translatable("disconnect.timeout")); } else { - MutableComponent ichatmutablecomponent = Component.translatable("disconnect.genericReason", "Internal Exception: " + throwable); + MutableComponent ichatmutablecomponent = Component.translatable("disconnect.genericReason", "Internal Exception: " + String.valueOf(throwable)); + if (player != null) player.quitReason = org.bukkit.event.player.PlayerQuitEvent.QuitReason.ERRONEOUS_STATE; // Paper - Add API for quit reason if (flag) { Connection.LOGGER.debug("Failed to sent packet", throwable); if (this.getSending() == PacketFlow.CLIENTBOUND) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 7c7e3d541733ea1784f8b90acbc8b1aecb6d7859..efe511fc6ab121263fe0c09763e09e0cf10a354a 100644 +index a182ab1c06c4644e9c14d7a2eff2620d827dfb2c..edfcfb91d907d6e1837e5a5d0e7abb8c8f6bcb66 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -274,6 +274,7 @@ public class ServerPlayer extends Player { +@@ -290,6 +290,7 @@ public class ServerPlayer extends Player { public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent public @Nullable String clientBrandName = null; // Paper - Brand support @@ -37,10 +37,10 @@ index 7c7e3d541733ea1784f8b90acbc8b1aecb6d7859..efe511fc6ab121263fe0c09763e09e0c public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index 6597e6e9987ddb5906909c22704fdfb6557aee8e..6bb846d3ee2fb54ab3ffa116607f2a83e538460e 100644 +index 215da3c52dc7b9e92c23f352fa7cffc2fb3d8a1a..d947eb533ba4dfd3b711e644d2a68238d1ec007a 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -@@ -315,6 +315,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -360,6 +360,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack final Component ichatbasecomponent = io.papermc.paper.adventure.PaperAdventure.asVanilla(event.reason()); // Paper - Adventure // CraftBukkit end @@ -49,10 +49,10 @@ index 6597e6e9987ddb5906909c22704fdfb6557aee8e..6bb846d3ee2fb54ab3ffa116607f2a83 this.connection.disconnect(ichatbasecomponent); })); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index b43dd483d99a0021ccb0a2e690e19aec5f4da606..f8e6dda015d6feec2d06ca84a734f371d72b5267 100644 +index 7af0239dbcaf46ee9f793072e832978400cdee0c..27069c61441c3abd59d922911f18143045363bdf 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -578,7 +578,7 @@ public abstract class PlayerList { +@@ -576,7 +576,7 @@ public abstract class PlayerList { entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper - Inventory close reason } diff --git a/patches/unapplied/server/0463-Add-Wandering-Trader-spawn-rate-config-options.patch b/patches/server/0448-Add-Wandering-Trader-spawn-rate-config-options.patch similarity index 98% rename from patches/unapplied/server/0463-Add-Wandering-Trader-spawn-rate-config-options.patch rename to patches/server/0448-Add-Wandering-Trader-spawn-rate-config-options.patch index e14e51ab48..98525387d7 100644 --- a/patches/unapplied/server/0463-Add-Wandering-Trader-spawn-rate-config-options.patch +++ b/patches/server/0448-Add-Wandering-Trader-spawn-rate-config-options.patch @@ -11,7 +11,7 @@ in IWorldServerData are removed as they were only used in certain places, with h values used in other places. diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java -index 83d0db5a9f03ee3ead10d9f61e5f425330eae0e9..a089f72695b5fb49c7918e89fd5015e8c3a3dd0e 100644 +index 4b7e9bc8aa253d0eb12a2195416c618cccdc8690..d5d27b0d352ca3fd57a26605cb35c499e88b57fc 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java @@ -40,43 +40,53 @@ public class WanderingTraderSpawner implements CustomSpawner { diff --git a/patches/unapplied/server/0464-Expose-world-spawn-angle.patch b/patches/server/0449-Expose-world-spawn-angle.patch similarity index 87% rename from patches/unapplied/server/0464-Expose-world-spawn-angle.patch rename to patches/server/0449-Expose-world-spawn-angle.patch index ccaebc75f6..b362623c2e 100644 --- a/patches/unapplied/server/0464-Expose-world-spawn-angle.patch +++ b/patches/server/0449-Expose-world-spawn-angle.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose world spawn angle diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f8e6dda015d6feec2d06ca84a734f371d72b5267..b560d28562c27bfa2f4da5e79d73eed8eea80e15 100644 +index 27069c61441c3abd59d922911f18143045363bdf..b665cad02cf3ec79270a99d6733cb075c7e1940c 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -848,7 +848,7 @@ public abstract class PlayerList { +@@ -847,7 +847,7 @@ public abstract class PlayerList { if (location == null) { worldserver1 = this.server.getLevel(Level.OVERWORLD); blockposition = entityplayer1.getSpawnPoint(worldserver1); diff --git a/patches/unapplied/server/0465-Add-Destroy-Speed-API.patch b/patches/server/0450-Add-Destroy-Speed-API.patch similarity index 89% rename from patches/unapplied/server/0465-Add-Destroy-Speed-API.patch rename to patches/server/0450-Add-Destroy-Speed-API.patch index 3b44bc9efc..c7fb04f8fa 100644 --- a/patches/unapplied/server/0465-Add-Destroy-Speed-API.patch +++ b/patches/server/0450-Add-Destroy-Speed-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Destroy Speed API Co-authored-by: Jake Potrebic diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index 01a1479711b7f7bb87db275a1edfab5a95464cca..a4252f9078c3ab7e458504496ebcdeb6875724d1 100644 +index 2303525542daa933a8de5978ac43d16223c6e5fd..48e8d0cc267706d3d8e29333d7fd6b89fdd88553 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -720,4 +720,19 @@ public class CraftBlockData implements BlockData { +@@ -721,4 +721,19 @@ public class CraftBlockData implements BlockData { public BlockState createBlockState() { return CraftBlockStates.getBlockState(this.state, null); } diff --git a/patches/unapplied/server/0466-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0451-Fix-Player-spawnParticle-x-y-z-precision-loss.patch similarity index 89% rename from patches/unapplied/server/0466-Fix-Player-spawnParticle-x-y-z-precision-loss.patch rename to patches/server/0451-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index b11b93ea59..eac02d8a00 100644 --- a/patches/unapplied/server/0466-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0451-Fix-Player-spawnParticle-x-y-z-precision-loss.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7c98519b13326acd8c9c871c0fbd0b8d52f80af2..b9f1848c382a52e6ef05c5d0c68015cfcfcde324 100644 +index 777f48d31b8b1d3a47471caba00ffb77a335c03b..8f437587d8989f3aa709ce36d1a10f237d28f0fa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2621,7 +2621,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2686,7 +2686,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (data != null) { Preconditions.checkArgument(particle.getDataType().isInstance(data), "data (%s) should be %s", data.getClass(), particle.getDataType()); } diff --git a/patches/unapplied/server/0467-Add-LivingEntity-clearActiveItem.patch b/patches/server/0452-Add-LivingEntity-clearActiveItem.patch similarity index 84% rename from patches/unapplied/server/0467-Add-LivingEntity-clearActiveItem.patch rename to patches/server/0452-Add-LivingEntity-clearActiveItem.patch index d6a35cba69..50382e523c 100644 --- a/patches/unapplied/server/0467-Add-LivingEntity-clearActiveItem.patch +++ b/patches/server/0452-Add-LivingEntity-clearActiveItem.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#clearActiveItem diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 87033a5d8dd5b67475657c3749f428a8e841a2f2..6848cdb3271b37972e98af78e85125409c650c4d 100644 +index aff940a7bacf53571f8e7bcd520419994596ebb3..7158f88e90c624b7ed3345ad7fb47745d4491d88 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -949,6 +949,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -934,6 +934,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return this.getHandle().getUseItem().asBukkitMirror(); } diff --git a/patches/unapplied/server/0468-Add-PlayerItemCooldownEvent.patch b/patches/server/0453-Add-PlayerItemCooldownEvent.patch similarity index 100% rename from patches/unapplied/server/0468-Add-PlayerItemCooldownEvent.patch rename to patches/server/0453-Add-PlayerItemCooldownEvent.patch diff --git a/patches/unapplied/server/0469-Significantly-improve-performance-of-the-end-generat.patch b/patches/server/0454-Significantly-improve-performance-of-the-end-generat.patch similarity index 97% rename from patches/unapplied/server/0469-Significantly-improve-performance-of-the-end-generat.patch rename to patches/server/0454-Significantly-improve-performance-of-the-end-generat.patch index ddb86100e5..ed3ee50bc9 100644 --- a/patches/unapplied/server/0469-Significantly-improve-performance-of-the-end-generat.patch +++ b/patches/server/0454-Significantly-improve-performance-of-the-end-generat.patch @@ -12,7 +12,7 @@ Co-authored-by: Dylan Xaldin Co-authored-by: pop4959 diff --git a/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java b/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java -index 92c2df6a6abd9c60e90b0b84ab66987557adb9c8..d5dccab8020e31f818420b8ee59c6d3928f1dfff 100644 +index b09bc1dac649ce9f4826edc1923c843804226993..ac8447e20531ad59d5e26c6db541d6e844d56c0f 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java +++ b/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java @@ -509,6 +509,16 @@ public final class DensityFunctions { diff --git a/patches/unapplied/server/0470-More-lightning-API.patch b/patches/server/0455-More-lightning-API.patch similarity index 100% rename from patches/unapplied/server/0470-More-lightning-API.patch rename to patches/server/0455-More-lightning-API.patch diff --git a/patches/unapplied/server/0471-Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/0456-Climbing-should-not-bypass-cramming-gamerule.patch similarity index 84% rename from patches/unapplied/server/0471-Climbing-should-not-bypass-cramming-gamerule.patch rename to patches/server/0456-Climbing-should-not-bypass-cramming-gamerule.patch index 290c73d192..0640edf4f3 100644 --- a/patches/unapplied/server/0471-Climbing-should-not-bypass-cramming-gamerule.patch +++ b/patches/server/0456-Climbing-should-not-bypass-cramming-gamerule.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Climbing should not bypass cramming gamerule diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2c0c41ae455ae5894e6bd85830741143c3d8aaa5..82ccfd91dfd3cce35a35edf8f73ccdd1ddd1fd6a 100644 +index bbce55b02f848be720ad95cb5b896ff9ad1f66d0..717d596b2479a66861a83445ed87f40c7c0f69d8 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1983,6 +1983,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2011,6 +2011,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public boolean isPushable() { @@ -44,10 +44,10 @@ index ee4495b67c46cf1282cdd6ad15b224b0b7b10bfb..e382a29b441b656f35bc24cb90f95cb4 } else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) { return false; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index b98f82b619a1932e6d820a2c42120efdc03fc839..ed32b3f1107210d56e5653b2d5eddcf1deb39dfc 100644 +index 914c6499eb94665f0e3c4654dd05fc10d93f87d4..e38f0659836be4bebff06e8d8e7848abdcbda455 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3447,7 +3447,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3534,7 +3534,7 @@ public abstract class LivingEntity extends Entity implements Attackable { return; } // Paper end - don't run getEntities if we're not going to use its result @@ -56,7 +56,7 @@ index b98f82b619a1932e6d820a2c42120efdc03fc839..ed32b3f1107210d56e5653b2d5eddcf1 if (!list.isEmpty()) { // Paper - don't run getEntities if we're not going to use its result; moved up -@@ -3637,9 +3637,16 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3724,9 +3724,16 @@ public abstract class LivingEntity extends Entity implements Attackable { return !this.isRemoved() && this.collides; // CraftBukkit } @@ -75,10 +75,10 @@ index b98f82b619a1932e6d820a2c42120efdc03fc839..ed32b3f1107210d56e5653b2d5eddcf1 // CraftBukkit start - collidable API diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -index bc9a710a92662b1f69b0f5b289780fe0a0d5ed32..44fa2d4f90389f5526746bd94a2450c03340bd0b 100644 +index 934fa26b8f347b8b2d90f79370b62165c0cdc312..dc27ddf5131e7398a5390a5187261d4c7fb6ccaa 100644 --- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java +++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -@@ -90,7 +90,7 @@ public class Bat extends AmbientCreature { +@@ -88,7 +88,7 @@ public class Bat extends AmbientCreature { } @Override @@ -88,10 +88,10 @@ index bc9a710a92662b1f69b0f5b289780fe0a0d5ed32..44fa2d4f90389f5526746bd94a2450c0 } diff --git a/src/main/java/net/minecraft/world/entity/animal/Parrot.java b/src/main/java/net/minecraft/world/entity/animal/Parrot.java -index fbad0e512b990c3d6885ecf92766ba6fd851cc20..f3f48225c2a1e4bd3d0091d1b4b7e4e150850ed2 100644 +index 1a129f43dc737218746b21ae5d03e3749bfee092..5ca96541abbb754f4d9fbe01f37ebaf19c532bbb 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java -@@ -383,8 +383,8 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder { +@@ -150,7 +150,7 @@ public class Boat extends VehicleEntity implements VariantHolder { } @Override diff --git a/patches/unapplied/server/0472-Add-missing-default-perms-for-commands.patch b/patches/server/0457-Add-missing-default-perms-for-commands.patch similarity index 100% rename from patches/unapplied/server/0472-Add-missing-default-perms-for-commands.patch rename to patches/server/0457-Add-missing-default-perms-for-commands.patch diff --git a/patches/server/0458-Add-PlayerShearBlockEvent.patch b/patches/server/0458-Add-PlayerShearBlockEvent.patch new file mode 100644 index 0000000000..5f0b292287 --- /dev/null +++ b/patches/server/0458-Add-PlayerShearBlockEvent.patch @@ -0,0 +1,71 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: JRoy +Date: Thu, 27 Aug 2020 15:02:48 -0400 +Subject: [PATCH] Add PlayerShearBlockEvent + + +diff --git a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java +index ce108f1cea8027aa7aab444689f7a29f2e54cc20..7b311f60ceae9942eeee0d2c7a170278e5983f2d 100644 +--- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java +@@ -127,7 +127,7 @@ public class BeehiveBlock extends BaseEntityBlock { + } + + public static void dropHoneycomb(Level world, BlockPos pos) { +- popResource(world, pos, new ItemStack(Items.HONEYCOMB, 3)); ++ popResource(world, pos, new ItemStack(Items.HONEYCOMB, 3)); // Paper - Add PlayerShearBlockEvent; conflict on change, item needs to be set below + } + + @Override +@@ -139,8 +139,19 @@ public class BeehiveBlock extends BaseEntityBlock { + Item item = stack.getItem(); + + if (stack.is(Items.SHEARS)) { ++ // Paper start - Add PlayerShearBlockEvent ++ io.papermc.paper.event.block.PlayerShearBlockEvent event = new io.papermc.paper.event.block.PlayerShearBlockEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand), new java.util.ArrayList<>()); ++ event.getDrops().add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(new ItemStack(Items.HONEYCOMB, 3))); ++ if (!event.callEvent()) { ++ return InteractionResult.PASS; ++ } ++ // Paper end + world.playSound(player, player.getX(), player.getY(), player.getZ(), SoundEvents.BEEHIVE_SHEAR, SoundSource.BLOCKS, 1.0F, 1.0F); +- BeehiveBlock.dropHoneycomb(world, pos); ++ // Paper start - Add PlayerShearBlockEvent ++ for (org.bukkit.inventory.ItemStack itemDrop : event.getDrops()) { ++ popResource(world, pos, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(itemDrop)); ++ } ++ // Paper end - Add PlayerShearBlockEvent + stack.hurtAndBreak(1, player, LivingEntity.getSlotForHand(hand)); + flag = true; + world.gameEvent((Entity) player, (Holder) GameEvent.SHEAR, pos); +diff --git a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java +index aa8667f0b14dc8944dd3457b431162e59bf54ada..4f4667cb036e8f5700ce175da5bf94725c64c9a7 100644 +--- a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java +@@ -40,10 +40,18 @@ public class PumpkinBlock extends Block { + } else if (world.isClientSide) { + return ItemInteractionResult.sidedSuccess(world.isClientSide); + } else { ++ // Paper start - Add PlayerShearBlockEvent ++ io.papermc.paper.event.block.PlayerShearBlockEvent event = new io.papermc.paper.event.block.PlayerShearBlockEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand), new java.util.ArrayList<>()); ++ event.getDrops().add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(new ItemStack(Items.PUMPKIN_SEEDS, 4))); ++ if (!event.callEvent()) { ++ return InteractionResult.PASS; ++ } ++ // Paper end - Add PlayerShearBlockEvent + Direction direction = hit.getDirection(); + Direction direction2 = direction.getAxis() == Direction.Axis.Y ? player.getDirection().getOpposite() : direction; + world.playSound(null, pos, SoundEvents.PUMPKIN_CARVE, SoundSource.BLOCKS, 1.0F, 1.0F); + world.setBlock(pos, Blocks.CARVED_PUMPKIN.defaultBlockState().setValue(CarvedPumpkinBlock.FACING, direction2), 11); ++ for (org.bukkit.inventory.ItemStack item : event.getDrops()) { // Paper - Add PlayerShearBlockEvent + ItemEntity itemEntity = new ItemEntity( + world, + (double)pos.getX() + 0.5 + (double)direction2.getStepX() * 0.65, +@@ -57,6 +65,7 @@ public class PumpkinBlock extends Block { + 0.05 * (double)direction2.getStepZ() + world.random.nextDouble() * 0.02 + ); + world.addFreshEntity(itemEntity); ++ } // Paper - Add PlayerShearBlockEvent + stack.hurtAndBreak(1, player, LivingEntity.getSlotForHand(hand)); + world.gameEvent(player, GameEvent.SHEAR, pos); + player.awardStat(Stats.ITEM_USED.get(Items.SHEARS)); diff --git a/patches/unapplied/server/0474-Limit-recipe-packets.patch b/patches/server/0459-Limit-recipe-packets.patch similarity index 90% rename from patches/unapplied/server/0474-Limit-recipe-packets.patch rename to patches/server/0459-Limit-recipe-packets.patch index 759125e140..39191cbc5e 100644 --- a/patches/unapplied/server/0474-Limit-recipe-packets.patch +++ b/patches/server/0459-Limit-recipe-packets.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Limit recipe packets diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 26c9d483810c8679fb2eff42c9176b8037cd56f8..f66c6167f24941b9cfdf4479d6cfbffcc29a7ba6 100644 +index 355b1726e90eb796fa2c1e21108bcf793637bf6c..10f0a84c119826e52fac6ca8e1d3e6276cc72392 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -257,6 +257,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -267,6 +267,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // CraftBukkit start - multithreaded fields private final AtomicInteger chatSpamTickCount = new AtomicInteger(); private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits @@ -16,7 +16,7 @@ index 26c9d483810c8679fb2eff42c9176b8037cd56f8..f66c6167f24941b9cfdf4479d6cfbffc // CraftBukkit end private int dropSpamTickCount; private double firstGoodX; -@@ -376,6 +377,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -390,6 +391,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // CraftBukkit start for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - configurable tab spam limits @@ -24,7 +24,7 @@ index 26c9d483810c8679fb2eff42c9176b8037cd56f8..f66c6167f24941b9cfdf4479d6cfbffc /* Use thread-safe field access instead if (this.chatSpamTickCount > 0) { --this.chatSpamTickCount; -@@ -2978,6 +2980,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3063,6 +3065,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { diff --git a/patches/unapplied/server/0475-Fix-CraftSound-backwards-compatibility.patch b/patches/server/0460-Fix-CraftSound-backwards-compatibility.patch similarity index 100% rename from patches/unapplied/server/0475-Fix-CraftSound-backwards-compatibility.patch rename to patches/server/0460-Fix-CraftSound-backwards-compatibility.patch diff --git a/patches/unapplied/server/0476-Player-Chunk-Load-Unload-Events.patch b/patches/server/0461-Player-Chunk-Load-Unload-Events.patch similarity index 95% rename from patches/unapplied/server/0476-Player-Chunk-Load-Unload-Events.patch rename to patches/server/0461-Player-Chunk-Load-Unload-Events.patch index 35ae9f9fba..bd58a9a7ec 100644 --- a/patches/unapplied/server/0476-Player-Chunk-Load-Unload-Events.patch +++ b/patches/server/0461-Player-Chunk-Load-Unload-Events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Player Chunk Load/Unload Events diff --git a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java -index 51bc50111ff30856038245f2614543d84874d930..e890162e1cea3538ed7dea7b78ee2e5346a8ce7b 100644 +index 3548be0bfacc7ff2cf0ed5fac4d8de09bd2a415f..c502d9b85eb68b277ae17dfea34e0475f0156647 100644 --- a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java +++ b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java @@ -44,6 +44,11 @@ public class PlayerChunkSender { diff --git a/patches/unapplied/server/0477-Optimize-Dynamic-get-Missing-Keys.patch b/patches/server/0462-Optimize-Dynamic-get-Missing-Keys.patch similarity index 88% rename from patches/unapplied/server/0477-Optimize-Dynamic-get-Missing-Keys.patch rename to patches/server/0462-Optimize-Dynamic-get-Missing-Keys.patch index e58939559a..e8bbac8b76 100644 --- a/patches/unapplied/server/0477-Optimize-Dynamic-get-Missing-Keys.patch +++ b/patches/server/0462-Optimize-Dynamic-get-Missing-Keys.patch @@ -12,10 +12,10 @@ JSON representation of the NBT object. Now we will just skip the value when 99.9999% of the time the text is never even printed. diff --git a/src/main/java/com/mojang/serialization/Dynamic.java b/src/main/java/com/mojang/serialization/Dynamic.java -index a24cc02a62585d7c04d36456739b11bddccf1a15..984e41619230db4579b028af18670c471aa13096 100644 +index d73bb05272d69471644b28f8c704a3bfceca72c2..8b4ea53b891bb7a5ceb791c4afaaf33814d9b6f6 100644 --- a/src/main/java/com/mojang/serialization/Dynamic.java +++ b/src/main/java/com/mojang/serialization/Dynamic.java -@@ -17,6 +17,7 @@ import java.util.stream.Stream; +@@ -19,6 +19,7 @@ import java.util.stream.Stream; @SuppressWarnings("unused") public class Dynamic extends DynamicLike { @@ -23,7 +23,7 @@ index a24cc02a62585d7c04d36456739b11bddccf1a15..984e41619230db4579b028af18670c47 private final T value; public Dynamic(final DynamicOps ops) { -@@ -113,7 +114,7 @@ public class Dynamic extends DynamicLike { +@@ -120,7 +121,7 @@ public class Dynamic extends DynamicLike { return new OptionalDynamic<>(ops, ops.getMap(value).flatMap(m -> { final T value = m.get(key); if (value == null) { diff --git a/patches/unapplied/server/0478-Expose-LivingEntity-hurt-direction.patch b/patches/server/0463-Expose-LivingEntity-hurt-direction.patch similarity index 77% rename from patches/unapplied/server/0478-Expose-LivingEntity-hurt-direction.patch rename to patches/server/0463-Expose-LivingEntity-hurt-direction.patch index fa32a9fe84..a2ec7481d3 100644 --- a/patches/unapplied/server/0478-Expose-LivingEntity-hurt-direction.patch +++ b/patches/server/0463-Expose-LivingEntity-hurt-direction.patch @@ -5,23 +5,23 @@ Subject: [PATCH] Expose LivingEntity hurt direction 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 603e003fbd39870a0e249151885b3b8f3e120afe..6fe21c29aa9d119490fbf1d69eb03c146674cde5 100644 +index 8fe41d4291736fd8c45d73429062a597d54ac30b..ecae1708feee507df1440ad2822e7af8c3c278de 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -180,7 +180,7 @@ public abstract class Player extends LivingEntity { +@@ -187,7 +187,7 @@ public abstract class Player extends LivingEntity { private Optional lastDeathLocation; @Nullable public FishingHook fishing; - protected float hurtDir; + public float hurtDir; // Paper - protected -> public - public boolean affectsSpawning = true; // Paper - Affects Spawning API - - // CraftBukkit start + @Nullable + public Vec3 currentImpulseImpactPos; + @Nullable diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index d5a8f019e88de30400733cdc3178eb982ccca341..e7726862f99cb16b7335b06675af73db773b54e8 100644 +index 9393e9d21fcc41cb0f20b98d9f28c95b0e523f62..796945fb1a8b43987ed9f01375113b2c13ff67c0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -127,6 +127,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -125,6 +125,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } } @@ -36,10 +36,10 @@ index d5a8f019e88de30400733cdc3178eb982ccca341..e7726862f99cb16b7335b06675af73db public int getSleepTicks() { return this.getHandle().sleepCounter; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 6848cdb3271b37972e98af78e85125409c650c4d..4ac52885618bf062eb34672b8fc60331a9c8f76a 100644 +index 7158f88e90c624b7ed3345ad7fb47745d4491d88..b88077ac1ed99057b8a9361ea550cd2b00040f88 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -1006,4 +1006,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -991,4 +991,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { this.getHandle().take(((CraftItem) item).getHandle(), quantity); } // Paper end - pickup animation API diff --git a/patches/unapplied/server/0479-Add-OBSTRUCTED-reason-to-BedEnterResult.patch b/patches/server/0464-Add-OBSTRUCTED-reason-to-BedEnterResult.patch similarity index 86% rename from patches/unapplied/server/0479-Add-OBSTRUCTED-reason-to-BedEnterResult.patch rename to patches/server/0464-Add-OBSTRUCTED-reason-to-BedEnterResult.patch index 1c152184b5..ca3ce280b4 100644 --- a/patches/unapplied/server/0479-Add-OBSTRUCTED-reason-to-BedEnterResult.patch +++ b/patches/server/0464-Add-OBSTRUCTED-reason-to-BedEnterResult.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add OBSTRUCTED reason to BedEnterResult diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 657df7b4aa8c4a19bf8e085d8235aa0d1a1b08da..368c4bddbe6fe88ca408147df1fa58183dd513a4 100644 +index f0e1bb3d9e4254d2c32f28fb715ea429c7646cec..253563371aa05954c19607b98675e37450e772ef 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -303,6 +303,10 @@ public class CraftEventFactory { +@@ -302,6 +302,10 @@ public class CraftEventFactory { return BedEnterResult.TOO_FAR_AWAY; case NOT_SAFE: return BedEnterResult.NOT_SAFE; diff --git a/patches/unapplied/server/0480-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch b/patches/server/0465-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch similarity index 89% rename from patches/unapplied/server/0480-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch rename to patches/server/0465-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch index 50044a8342..762023bb09 100644 --- a/patches/unapplied/server/0480-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch +++ b/patches/server/0465-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix crash from invalid ingredient lists in diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -index ddc002f269527201724457c0b820788200441e0c..9bc5a9592cabe087effc03e5347ea1d75794960b 100644 +index 79e81fd5490a493b595dc1034641e13451e5a61a..6e29b5729b8184d13065c9c4e18f6e450c9d88a6 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -@@ -261,7 +261,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa +@@ -269,7 +269,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa Bukkit.getPluginManager().callEvent(event); } if (!event.isCancelled()) { diff --git a/patches/unapplied/server/0481-Add-TargetHitEvent.patch b/patches/server/0466-Add-TargetHitEvent.patch similarity index 93% rename from patches/unapplied/server/0481-Add-TargetHitEvent.patch rename to patches/server/0466-Add-TargetHitEvent.patch index 2d2b6ef60d..816c525fd2 100644 --- a/patches/unapplied/server/0481-Add-TargetHitEvent.patch +++ b/patches/server/0466-Add-TargetHitEvent.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Add TargetHitEvent diff --git a/src/main/java/net/minecraft/world/level/block/TargetBlock.java b/src/main/java/net/minecraft/world/level/block/TargetBlock.java -index 02f6d5b523c3d4185a68adb419b2710768ed249f..4ae14ee74a83c8b12ac2e3475863e6d77979af0a 100644 +index 549ca8e9b265635bd3d5863682fe240f3f9f3f58..ee4eb863b6c02f2bcbb03ca413fc98811d409ac5 100644 --- a/src/main/java/net/minecraft/world/level/block/TargetBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TargetBlock.java @@ -42,6 +42,10 @@ public class TargetBlock extends Block { @Override - public void onProjectileHit(Level world, BlockState state, BlockHitResult hit, Projectile projectile) { + protected void onProjectileHit(Level world, BlockState state, BlockHitResult hit, Projectile projectile) { int i = updateRedstoneOutput(world, state, hit, projectile); + // Paper start - Add TargetHitEvent + } diff --git a/patches/unapplied/server/0482-MC-4-Fix-item-position-desync.patch b/patches/server/0467-MC-4-Fix-item-position-desync.patch similarity index 92% rename from patches/unapplied/server/0482-MC-4-Fix-item-position-desync.patch rename to patches/server/0467-MC-4-Fix-item-position-desync.patch index 35ddadadc7..56d177e95e 100644 --- a/patches/unapplied/server/0482-MC-4-Fix-item-position-desync.patch +++ b/patches/server/0467-MC-4-Fix-item-position-desync.patch @@ -28,10 +28,10 @@ index ffec3deb9bcd31d51974c1deda2e76bc8374e5c5..a3d247c93ac1a2d872ff0e3841efc3d7 public Vec3 decode(long x, long y, long z) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 82ccfd91dfd3cce35a35edf8f73ccdd1ddd1fd6a..c3ca11cc4abe85132b099af1cb27772dbf40bfe1 100644 +index 717d596b2479a66861a83445ed87f40c7c0f69d8..31911870e5056391d67c49fa68d59010534bf35f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4186,6 +4186,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4212,6 +4212,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return; } // Paper end - Block invalid positions and bounding box diff --git a/patches/unapplied/server/0483-Additional-Block-Material-API.patch b/patches/server/0468-Additional-Block-Material-API.patch similarity index 100% rename from patches/unapplied/server/0483-Additional-Block-Material-API.patch rename to patches/server/0468-Additional-Block-Material-API.patch diff --git a/patches/unapplied/server/0484-Fix-harming-potion-dupe.patch b/patches/server/0469-Fix-harming-potion-dupe.patch similarity index 61% rename from patches/unapplied/server/0484-Fix-harming-potion-dupe.patch rename to patches/server/0469-Fix-harming-potion-dupe.patch index d7fda01e2c..8fdd027d4f 100644 --- a/patches/unapplied/server/0484-Fix-harming-potion-dupe.patch +++ b/patches/server/0469-Fix-harming-potion-dupe.patch @@ -8,36 +8,34 @@ Before this patch, instant effects would be applied before the potion ItemStack This patch makes it so that instant effects are applied after the potion ItemStack is removed, and the glass bottle is only put into the player's inventory if the player is not dead. Otherwise, the glass bottle is dropped on the ground. diff --git a/src/main/java/net/minecraft/world/item/PotionItem.java b/src/main/java/net/minecraft/world/item/PotionItem.java -index bb19a00c24e92058e05076b2ca0278dcae1890ae..5c62741e3a3854a7f674bfec49758f837f3bb9a0 100644 +index de0b68b128e6ffbd31aebb4361e4859d495f89b5..042a9cf9c15fd30bc30e03d0e0311c70e40e6950 100644 --- a/src/main/java/net/minecraft/world/item/PotionItem.java +++ b/src/main/java/net/minecraft/world/item/PotionItem.java -@@ -50,6 +50,7 @@ public class PotionItem extends Item { +@@ -55,12 +55,13 @@ public class PotionItem extends Item { CriteriaTriggers.CONSUME_ITEM.trigger((ServerPlayer) entityhuman, stack); } -+ List instantLater = new java.util.ArrayList<>(); // Paper - Fix harming potion dupe ++ List instantLater = new java.util.ArrayList<>(); // Paper - Fix harming potion dupe if (!world.isClientSide) { - List list = PotionUtils.getMobEffects(stack); - Iterator iterator = list.iterator(); -@@ -58,7 +59,7 @@ public class PotionItem extends Item { - MobEffectInstance mobeffect = (MobEffectInstance) iterator.next(); + PotionContents potioncontents = (PotionContents) stack.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY); - if (mobeffect.getEffect().isInstantenous()) { -- mobeffect.getEffect().applyInstantenousEffect(entityhuman, entityhuman, user, mobeffect.getAmplifier(), 1.0D); -+ instantLater.add(mobeffect); // Paper - Fix harming potion dupe + potioncontents.forEachEffect((mobeffect) -> { + if (((MobEffect) mobeffect.getEffect().value()).isInstantenous()) { +- ((MobEffect) mobeffect.getEffect().value()).applyInstantenousEffect(entityhuman, entityhuman, user, mobeffect.getAmplifier(), 1.0D); ++ instantLater.add(mobeffect); // Paper } else { - user.addEffect(new MobEffectInstance(mobeffect), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.POTION_DRINK); // CraftBukkit + user.addEffect(mobeffect, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.POTION_DRINK); // CraftBukkit } -@@ -72,7 +73,18 @@ public class PotionItem extends Item { - } +@@ -73,7 +74,18 @@ public class PotionItem extends Item { + stack.consume(1, entityhuman); } + // Paper start - Fix harming potion dupe -+ for (MobEffectInstance mobeffect : instantLater) { -+ mobeffect.getEffect().applyInstantenousEffect(entityhuman, entityhuman, user, mobeffect.getAmplifier(), 1.0D); ++ for (net.minecraft.world.effect.MobEffectInstance mobeffect : instantLater) { ++ mobeffect.getEffect().value().applyInstantenousEffect(entityhuman, entityhuman, user, mobeffect.getAmplifier(), 1.0D); + } + // Paper end - Fix harming potion dupe - if (entityhuman == null || !entityhuman.getAbilities().instabuild) { + if (entityhuman == null || !entityhuman.hasInfiniteMaterials()) { + // Paper start - Fix harming potion dupe + if (user.getHealth() <= 0 && !user.level().getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_KEEPINVENTORY)) { + user.spawnAtLocation(new ItemStack(Items.GLASS_BOTTLE), 0); diff --git a/patches/unapplied/server/0485-API-to-get-Material-from-Boats-and-Minecarts.patch b/patches/server/0470-API-to-get-Material-from-Boats-and-Minecarts.patch similarity index 100% rename from patches/unapplied/server/0485-API-to-get-Material-from-Boats-and-Minecarts.patch rename to patches/server/0470-API-to-get-Material-from-Boats-and-Minecarts.patch diff --git a/patches/unapplied/server/0487-Allow-disabling-mob-spawner-spawn-egg-transformation.patch b/patches/server/0471-Allow-disabling-mob-spawner-spawn-egg-transformation.patch similarity index 78% rename from patches/unapplied/server/0487-Allow-disabling-mob-spawner-spawn-egg-transformation.patch rename to patches/server/0471-Allow-disabling-mob-spawner-spawn-egg-transformation.patch index 40171ab920..da8441444c 100644 --- a/patches/unapplied/server/0487-Allow-disabling-mob-spawner-spawn-egg-transformation.patch +++ b/patches/server/0471-Allow-disabling-mob-spawner-spawn-egg-transformation.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow disabling mob spawner spawn egg transformation diff --git a/src/main/java/net/minecraft/world/item/SpawnEggItem.java b/src/main/java/net/minecraft/world/item/SpawnEggItem.java -index 8176b64e49166cc24ef7f011881fda38bc68c2a4..3bfbf7daa190b03f978b9fc72233c18c383b6659 100644 +index 6e91fec416493b2fabe1e8a6214ab7673212e451..9cea8da84f39bb3f687139ef213ccea358724dee 100644 --- a/src/main/java/net/minecraft/world/item/SpawnEggItem.java +++ b/src/main/java/net/minecraft/world/item/SpawnEggItem.java -@@ -63,6 +63,8 @@ public class SpawnEggItem extends Item { +@@ -69,6 +69,8 @@ public class SpawnEggItem extends Item { EntityType entitytypes; if (tileentity instanceof Spawner) { @@ -16,4 +16,4 @@ index 8176b64e49166cc24ef7f011881fda38bc68c2a4..3bfbf7daa190b03f978b9fc72233c18c + Spawner spawner = (Spawner) tileentity; - entitytypes = this.getType(itemstack.getTag()); + entitytypes = this.getType(itemstack); diff --git a/patches/unapplied/server/0488-Fix-Not-a-string-Map-Conversion-spam.patch b/patches/server/0472-Fix-Not-a-string-Map-Conversion-spam.patch similarity index 86% rename from patches/unapplied/server/0488-Fix-Not-a-string-Map-Conversion-spam.patch rename to patches/server/0472-Fix-Not-a-string-Map-Conversion-spam.patch index e434023f48..00f5d0e877 100644 --- a/patches/unapplied/server/0488-Fix-Not-a-string-Map-Conversion-spam.patch +++ b/patches/server/0472-Fix-Not-a-string-Map-Conversion-spam.patch @@ -12,22 +12,22 @@ requesting the world. Track spigot issue to see when fixed: https://hub.spigotmc.org/jira/browse/SPIGOT-6181 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 8f144a357174bbe096ac9b38a5e67a61127d7b87..0ca0808c5eeeba969c048b422af37a273217ff52 100644 +index d42d39dff5aeb91c5b1e6a7fb967ce70f1a88b7e..38c0855a6f9398f8d075f304288cf9e9f695770a 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 -@@ -15,6 +15,8 @@ import net.minecraft.core.BlockPos; +@@ -21,6 +21,8 @@ import net.minecraft.core.component.DataComponents; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.nbt.NbtOps; +import net.minecraft.nbt.NumericTag; +import net.minecraft.nbt.StringTag; import net.minecraft.nbt.Tag; + import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.Component; - import net.minecraft.network.protocol.Packet; -@@ -108,7 +110,26 @@ public class MapItemSavedData extends SavedData { +@@ -120,7 +122,26 @@ public class MapItemSavedData extends SavedData { } - public static MapItemSavedData load(CompoundTag nbt) { + public static MapItemSavedData load(CompoundTag nbt, HolderLookup.Provider registryLookup) { - DataResult> dataresult = DimensionType.parseLegacy(new Dynamic(NbtOps.INSTANCE, nbt.get("dimension"))); // CraftBukkit - decompile error + // Paper start - fix "Not a string" spam + Tag dimension = nbt.get("dimension"); diff --git a/patches/server/0473-Add-PlayerFlowerPotManipulateEvent.patch b/patches/server/0473-Add-PlayerFlowerPotManipulateEvent.patch new file mode 100644 index 0000000000..8b61833059 --- /dev/null +++ b/patches/server/0473-Add-PlayerFlowerPotManipulateEvent.patch @@ -0,0 +1,48 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MisterVector +Date: Tue, 13 Aug 2019 19:45:06 -0700 +Subject: [PATCH] Add PlayerFlowerPotManipulateEvent + + +diff --git a/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java b/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java +index b0c950fa7426dc762b99080d98831b961fc19da2..7194565ad1a910fe300d8664a30b35c4eff18cb7 100644 +--- a/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java +@@ -63,6 +63,18 @@ public class FlowerPotBlock extends Block { + } else if (!this.isEmpty()) { + return ItemInteractionResult.CONSUME; + } else { ++ // Paper start - Add PlayerFlowerPotManipulateEvent ++ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos); ++ org.bukkit.inventory.ItemStack placedStack = org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(stack); ++ ++ io.papermc.paper.event.player.PlayerFlowerPotManipulateEvent event = new io.papermc.paper.event.player.PlayerFlowerPotManipulateEvent((org.bukkit.entity.Player) player.getBukkitEntity(), block, placedStack, true); ++ if (!event.callEvent()) { ++ // Update client ++ player.containerMenu.sendAllDataToRemote(); ++ ++ return ItemInteractionResult.CONSUME; ++ } ++ // Paper end - Add PlayerFlowerPotManipulateEvent + world.setBlock(pos, blockState, 3); + world.gameEvent(player, GameEvent.BLOCK_CHANGE, pos); + player.awardStat(Stats.POT_FLOWER); +@@ -77,6 +89,18 @@ public class FlowerPotBlock extends Block { + return InteractionResult.CONSUME; + } else { + ItemStack itemStack = new ItemStack(this.potted); ++ // Paper start - Add PlayerFlowerPotManipulateEvent ++ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos); ++ org.bukkit.inventory.ItemStack pottedStack = new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.block.CraftBlockType.minecraftToBukkit(this.potted)); ++ ++ io.papermc.paper.event.player.PlayerFlowerPotManipulateEvent event = new io.papermc.paper.event.player.PlayerFlowerPotManipulateEvent((org.bukkit.entity.Player) player.getBukkitEntity(), block, pottedStack, false); ++ if (!event.callEvent()) { ++ // Update client ++ player.containerMenu.sendAllDataToRemote(); ++ ++ return InteractionResult.PASS; ++ } ++ // Paper end - Add PlayerFlowerPotManipulateEvent + if (!player.addItem(itemStack)) { + player.drop(itemStack, false); + } diff --git a/patches/unapplied/server/0490-Fix-interact-event-not-being-called-sometimes.patch b/patches/server/0474-Fix-interact-event-not-being-called-sometimes.patch similarity index 94% rename from patches/unapplied/server/0490-Fix-interact-event-not-being-called-sometimes.patch rename to patches/server/0474-Fix-interact-event-not-being-called-sometimes.patch index 222d664a4e..ea135ba0b1 100644 --- a/patches/unapplied/server/0490-Fix-interact-event-not-being-called-sometimes.patch +++ b/patches/server/0474-Fix-interact-event-not-being-called-sometimes.patch @@ -11,10 +11,10 @@ Subject: [PATCH] Fix interact event not being called sometimes Co-authored-by: Moulberry diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f66c6167f24941b9cfdf4479d6cfbffcc29a7ba6..a16751a23eb6aab8c25520127d4dbea0c991c32c 100644 +index 10f0a84c119826e52fac6ca8e1d3e6276cc72392..e0c11559295d00445d5ba0543a81f49dc2314266 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1760,7 +1760,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1765,7 +1765,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl MutableComponent ichatmutablecomponent = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED); this.player.sendSystemMessage(ichatmutablecomponent, true); @@ -23,7 +23,7 @@ index f66c6167f24941b9cfdf4479d6cfbffcc29a7ba6..a16751a23eb6aab8c25520127d4dbea0 this.player.swing(enumhand, true); } } -@@ -2306,13 +2306,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2381,13 +2381,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d3 = this.player.gameMode.getGameModeForPlayer() == GameType.CREATIVE ? 5.0D : 4.5D; // SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time // SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities diff --git a/patches/unapplied/server/0491-Zombie-API-breaking-doors.patch b/patches/server/0475-Zombie-API-breaking-doors.patch similarity index 100% rename from patches/unapplied/server/0491-Zombie-API-breaking-doors.patch rename to patches/server/0475-Zombie-API-breaking-doors.patch diff --git a/patches/unapplied/server/0492-Fix-nerfed-slime-when-splitting.patch b/patches/server/0476-Fix-nerfed-slime-when-splitting.patch similarity index 84% rename from patches/unapplied/server/0492-Fix-nerfed-slime-when-splitting.patch rename to patches/server/0476-Fix-nerfed-slime-when-splitting.patch index 91c9da2246..2ebdf09288 100644 --- a/patches/unapplied/server/0492-Fix-nerfed-slime-when-splitting.patch +++ b/patches/server/0476-Fix-nerfed-slime-when-splitting.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix nerfed slime when splitting diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java -index 00dcbcbf20995ab6aca508d7ffe703bcb0d9b1a9..0b8bcf9fc13ec6645c9e11cf52047272cdfce68c 100644 +index 7062ef1cfd7d6279a4c6693cbdb80da49f23c542..b32213c5a3a1ecaf602cf34bed44c537521c2846 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Slime.java +++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java -@@ -251,6 +251,7 @@ public class Slime extends Mob implements Enemy { +@@ -252,6 +252,7 @@ public class Slime extends Mob implements Enemy { entityslime.setPersistenceRequired(); } diff --git a/patches/server/0477-Add-EntityLoadCrossbowEvent.patch b/patches/server/0477-Add-EntityLoadCrossbowEvent.patch new file mode 100644 index 0000000000..074e763090 --- /dev/null +++ b/patches/server/0477-Add-EntityLoadCrossbowEvent.patch @@ -0,0 +1,68 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: JRoy +Date: Wed, 7 Oct 2020 12:04:01 -0400 +Subject: [PATCH] Add EntityLoadCrossbowEvent + + +diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java +index 65f23bfb2de91be7560800ff87eab7ad88cb1849..0f6504a7160bc304b3af554f8740c65e2987cd37 100644 +--- a/src/main/java/net/minecraft/world/item/CrossbowItem.java ++++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java +@@ -80,7 +80,14 @@ public class CrossbowItem extends ProjectileWeaponItem { + public void releaseUsing(ItemStack stack, Level world, LivingEntity user, int remainingUseTicks) { + int i = this.getUseDuration(stack) - remainingUseTicks; + float f = getPowerForTime(i, stack); +- if (f >= 1.0F && !isCharged(stack) && tryLoadProjectiles(user, stack)) { ++ // Paper start ++ if (f >= 1.0F && !isCharged(stack)) { ++ final io.papermc.paper.event.entity.EntityLoadCrossbowEvent event = new io.papermc.paper.event.entity.EntityLoadCrossbowEvent(user.getBukkitLivingEntity(), stack.asBukkitMirror(), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(user.getUsedItemHand())); ++ if (!event.callEvent() || !tryLoadProjectiles(user, stack, event.shouldConsumeItem())) { ++ if (user instanceof ServerPlayer player) player.containerMenu.sendAllDataToRemote(); ++ return; ++ } ++ // Paper end - Add EntityLoadCrossbowEvent + world.playSound( + null, + user.getX(), +@@ -94,8 +101,14 @@ public class CrossbowItem extends ProjectileWeaponItem { + } + } + +- private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow) { +- List list = draw(crossbow, shooter.getProjectile(crossbow), shooter); ++ @io.papermc.paper.annotation.DoNotUse // Paper - Add EntityLoadCrossbowEvent ++ private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow) { ++ // Paper start - Add EntityLoadCrossbowEvent ++ return CrossbowItem.tryLoadProjectiles(shooter, crossbow, true); ++ } ++ private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow, boolean consume) { ++ List list = draw(crossbow, shooter.getProjectile(crossbow), shooter, consume); ++ // Paper end - Add EntityLoadCrossbowEvent + if (!list.isEmpty()) { + crossbow.set(DataComponents.CHARGED_PROJECTILES, ChargedProjectiles.of(list)); + return true; +diff --git a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java +index 416bdff5cda842143038180592ad231a1d19d926..f91ce87491b18f4f4ae6458192d1f320b308102a 100644 +--- a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java ++++ b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java +@@ -139,6 +139,11 @@ public abstract class ProjectileWeaponItem extends Item { + } + + protected static List draw(ItemStack weaponStack, ItemStack projectileStack, LivingEntity shooter) { ++ // Paper start ++ return draw(weaponStack, projectileStack, shooter, false); ++ } ++ protected static List draw(ItemStack weaponStack, ItemStack projectileStack, LivingEntity shooter, boolean consume) { ++ // Paper end + if (projectileStack.isEmpty()) { + return List.of(); + } else { +@@ -148,7 +153,7 @@ public abstract class ProjectileWeaponItem extends Item { + ItemStack itemstack2 = projectileStack.copy(); + + for (int k = 0; k < j; ++k) { +- list.add(ProjectileWeaponItem.useAmmo(weaponStack, k == 0 ? projectileStack : itemstack2, shooter, k > 0)); ++ list.add(ProjectileWeaponItem.useAmmo(weaponStack, k == 0 ? projectileStack : itemstack2, shooter, k > 0 || consume)); // Paper + } + + return list; diff --git a/patches/unapplied/server/0494-Add-WorldGameRuleChangeEvent.patch b/patches/server/0478-Add-WorldGameRuleChangeEvent.patch similarity index 92% rename from patches/unapplied/server/0494-Add-WorldGameRuleChangeEvent.patch rename to patches/server/0478-Add-WorldGameRuleChangeEvent.patch index f26393a0b9..41b4b9b772 100644 --- a/patches/unapplied/server/0494-Add-WorldGameRuleChangeEvent.patch +++ b/patches/server/0478-Add-WorldGameRuleChangeEvent.patch @@ -18,10 +18,10 @@ index c8c358531dbc167e249bac2af246c5e34fbdd4df..10c1790226e25da3b9b599c9a40de57d return Component.translatable("commands.gamerule.set", key.getId(), t0.toString()); }, true); diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java -index ba825ff3df79903aefe1a4cb14efab9a302397d7..ac7a5410b01a6741e3b548d153f37ea1d8c1a4cb 100644 +index 0b46ad360be919e4aeb0ffc0eebae9fe712fb861..51e560d7856f230c5aa2dc32706c3a4996720aa5 100644 --- a/src/main/java/net/minecraft/world/level/GameRules.java +++ b/src/main/java/net/minecraft/world/level/GameRules.java -@@ -286,10 +286,10 @@ public class GameRules { +@@ -293,10 +293,10 @@ public class GameRules { this.type = type; } @@ -35,7 +35,7 @@ index ba825ff3df79903aefe1a4cb14efab9a302397d7..ac7a5410b01a6741e3b548d153f37ea1 this.onChanged(((CommandSourceStack) context.getSource()).getLevel()); // CraftBukkit - per-world } -@@ -347,8 +347,11 @@ public class GameRules { +@@ -354,8 +354,11 @@ public class GameRules { } @Override @@ -49,7 +49,7 @@ index ba825ff3df79903aefe1a4cb14efab9a302397d7..ac7a5410b01a6741e3b548d153f37ea1 } public boolean get() { -@@ -412,8 +415,11 @@ public class GameRules { +@@ -427,8 +430,11 @@ public class GameRules { } @Override @@ -64,10 +64,10 @@ index ba825ff3df79903aefe1a4cb14efab9a302397d7..ac7a5410b01a6741e3b548d153f37ea1 public int get() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index afb65de5fbff44b4ca455c778030c3387c2dafc8..3893b70926140f3658f6bab68c5c4f7c41dc603a 100644 +index 4d75cf0ec9e835b4274297275d52f08a6a65aeca..4a51d0125d59b1edd2da7aac1db1ca49374c008c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1884,8 +1884,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1883,8 +1883,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { if (!this.isGameRule(rule)) return false; @@ -82,7 +82,7 @@ index afb65de5fbff44b4ca455c778030c3387c2dafc8..3893b70926140f3658f6bab68c5c4f7c handle.onChanged(this.getHandle()); return true; } -@@ -1921,8 +1926,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1920,8 +1925,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { if (!this.isGameRule(rule.getName())) return false; diff --git a/patches/unapplied/server/0495-Add-ServerResourcesReloadedEvent.patch b/patches/server/0479-Add-ServerResourcesReloadedEvent.patch similarity index 91% rename from patches/unapplied/server/0495-Add-ServerResourcesReloadedEvent.patch rename to patches/server/0479-Add-ServerResourcesReloadedEvent.patch index 78e525f4d8..d691c1ad26 100644 --- a/patches/unapplied/server/0495-Add-ServerResourcesReloadedEvent.patch +++ b/patches/server/0479-Add-ServerResourcesReloadedEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ServerResourcesReloadedEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 70ae9d44dd860014fd9a599e3a4e4a3fe80068ff..23d68feaa060514e6582a9d47a9ca7db9421c29c 100644 +index 18efcf55bf13fa17ac532cca4c213e5b6e14979f..b083298d2bcf0d4c6213d6ac8645b8c084cfc6de 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2036,7 +2036,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop reloadResources(Collection dataPacks, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause cause) { + // Paper end - Add ServerResourcesReloadedEvent - RegistryAccess.Frozen iregistrycustom_dimension = this.registries.getAccessForLoading(RegistryLayer.RELOADABLE); CompletableFuture completablefuture = CompletableFuture.supplyAsync(() -> { Stream stream = dataPacks.stream(); // CraftBukkit - decompile error -@@ -2069,6 +2075,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 0 && id < this.selectablePatterns.size()) { diff --git a/patches/unapplied/server/0500-Configurable-door-breaking-difficulty.patch b/patches/server/0484-Configurable-door-breaking-difficulty.patch similarity index 86% rename from patches/unapplied/server/0500-Configurable-door-breaking-difficulty.patch rename to patches/server/0484-Configurable-door-breaking-difficulty.patch index 18f1e68a47..33c0f6ab52 100644 --- a/patches/unapplied/server/0500-Configurable-door-breaking-difficulty.patch +++ b/patches/server/0484-Configurable-door-breaking-difficulty.patch @@ -10,10 +10,10 @@ 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 89a05518e1b95f6edc1ac57f6ed9c3946b87b93e..0ee020848cdfd0c069f1e8d3a9516a339d82467c 100644 +index d4ed75afc61620cbc79da07b6511c247b829e41f..b3da310d6fd1d533da805c38c2f449cf06d01492 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java +++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java -@@ -196,7 +196,7 @@ public class Vindicator extends AbstractIllager { +@@ -176,7 +176,7 @@ public class Vindicator extends AbstractIllager { static class VindicatorBreakDoorGoal extends BreakDoorGoal { public VindicatorBreakDoorGoal(Mob mob) { @@ -23,10 +23,10 @@ index 89a05518e1b95f6edc1ac57f6ed9c3946b87b93e..0ee020848cdfd0c069f1e8d3a9516a33 } 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 a0cd226d4f5c700c84604527ddde35466c7654bb..a41a2ffe3b0af5c244a513c839829da3f86e5ed3 100644 +index c8ce36d67901e2897f521d5b4f5041348f235ae7..e4fc7f96aac9cc2ed5b4158b6663de397ee1162f 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -100,7 +100,7 @@ public class Zombie extends Monster { +@@ -97,7 +97,7 @@ public class Zombie extends Monster { public Zombie(EntityType type, Level world) { super(type, world); diff --git a/patches/unapplied/server/0501-Empty-commands-shall-not-be-dispatched.patch b/patches/server/0485-Empty-commands-shall-not-be-dispatched.patch similarity index 84% rename from patches/unapplied/server/0501-Empty-commands-shall-not-be-dispatched.patch rename to patches/server/0485-Empty-commands-shall-not-be-dispatched.patch index 7a48e3018e..8d31da240c 100644 --- a/patches/unapplied/server/0501-Empty-commands-shall-not-be-dispatched.patch +++ b/patches/server/0485-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 d39743d9626eb01c942194387dafb1106f13601b..0741c0f85536c5188d8552e999943a9c771a548e 100644 +index 2fb4660147294de9e9dec70bc3527327f2d859ee..83091987b320171ef9071cbef6b10a1bd72d38e2 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -287,6 +287,7 @@ public class Commands { +@@ -290,6 +290,7 @@ public class Commands { command = event.getCommand(); String[] args = command.split(" "); diff --git a/patches/unapplied/server/0502-Remove-stale-POIs.patch b/patches/server/0486-Remove-stale-POIs.patch similarity index 87% rename from patches/unapplied/server/0502-Remove-stale-POIs.patch rename to patches/server/0486-Remove-stale-POIs.patch index ca376b9ba7..f759c441c1 100644 --- a/patches/unapplied/server/0502-Remove-stale-POIs.patch +++ b/patches/server/0486-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 283f686364691f54d9e9e925b33238526de74219..a2113c01d8ea3da13efbf4f0b23460e7fa4e8c68 100644 +index 4e1027f00fba2084073aa926805753224aa8b153..2c1ca55e1919c29956b3d95f65f8f08eb7529d1e 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1795,6 +1795,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1743,6 +1743,11 @@ public class ServerLevel extends Level implements WorldGenLevel { }); optional1.ifPresent((holder) -> { this.getServer().execute(() -> { diff --git a/patches/unapplied/server/0503-Fix-villager-boat-exploit.patch b/patches/server/0487-Fix-villager-boat-exploit.patch similarity index 89% rename from patches/unapplied/server/0503-Fix-villager-boat-exploit.patch rename to patches/server/0487-Fix-villager-boat-exploit.patch index 1f01745885..bc3d3134bd 100644 --- a/patches/unapplied/server/0503-Fix-villager-boat-exploit.patch +++ b/patches/server/0487-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 b560d28562c27bfa2f4da5e79d73eed8eea80e15..6fed863a0400ba23e0e299b0f0a0f28af19fa226 100644 +index b665cad02cf3ec79270a99d6733cb075c7e1940c..c9f4d50834d8544bafe973258b59105b2b83bf1d 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -603,6 +603,14 @@ public abstract class PlayerList { +@@ -601,6 +601,14 @@ public abstract class PlayerList { PlayerList.LOGGER.debug("Removing player mount"); entityplayer.stopRiding(); entity.getPassengersAndSelf().forEach((entity1) -> { diff --git a/patches/unapplied/server/0504-Add-sendOpLevel-API.patch b/patches/server/0488-Add-sendOpLevel-API.patch similarity index 85% rename from patches/unapplied/server/0504-Add-sendOpLevel-API.patch rename to patches/server/0488-Add-sendOpLevel-API.patch index 7426d0591d..b34764a2cf 100644 --- a/patches/unapplied/server/0504-Add-sendOpLevel-API.patch +++ b/patches/server/0488-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 6fed863a0400ba23e0e299b0f0a0f28af19fa226..65c11774b9e3c724b5ac67a557bd84efcd53fbab 100644 +index c9f4d50834d8544bafe973258b59105b2b83bf1d..dd360250ca784421e0f8fffe786bec88a8f38b3d 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1101,6 +1101,11 @@ public abstract class PlayerList { +@@ -1100,6 +1100,11 @@ public abstract class PlayerList { } private void sendPlayerPermissionLevel(ServerPlayer player, int permissionLevel) { @@ -20,7 +20,7 @@ index 6fed863a0400ba23e0e299b0f0a0f28af19fa226..65c11774b9e3c724b5ac67a557bd84ef if (player.connection != null) { byte b0; -@@ -1115,8 +1120,10 @@ public abstract class PlayerList { +@@ -1114,8 +1119,10 @@ public abstract class PlayerList { player.connection.send(new ClientboundEntityEventPacket(player, b0)); } @@ -32,10 +32,10 @@ index 6fed863a0400ba23e0e299b0f0a0f28af19fa226..65c11774b9e3c724b5ac67a557bd84ef 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 b9f1848c382a52e6ef05c5d0c68015cfcfcde324..79a57bafc3b99e58f435bacbc65b9fd4c4c80b8a 100644 +index 8f437587d8989f3aa709ce36d1a10f237d28f0fa..0cfc8b5faa56ae2a3dd94c5dbcb22a7e208b38bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -599,6 +599,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -674,6 +674,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/unapplied/server/0505-TODO-Registry-Modification-API.patch b/patches/server/0489-TODO-Registry-Modification-API.patch similarity index 61% rename from patches/unapplied/server/0505-TODO-Registry-Modification-API.patch rename to patches/server/0489-TODO-Registry-Modification-API.patch index b47ca6aff7..d624aad69b 100644 --- a/patches/unapplied/server/0505-TODO-Registry-Modification-API.patch +++ b/patches/server/0489-TODO-Registry-Modification-API.patch @@ -5,12 +5,12 @@ Subject: [PATCH] TODO Registry Modification API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -index 826c45f35c80ae4bf536fbe3b48354e3626fe2e1..110987de809339b4ce14eaf377782ebf3460164a 100644 +index 4209a45af2bfe772f678b07b49070522de4195a8..480313506bf41410de090c59e047323345ea78da 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -@@ -119,6 +119,7 @@ public class CraftRegistry implements Registry { - if (bukkitClass == DamageType.class) { - return new CraftRegistry<>(DamageType.class, registryHolder.registryOrThrow(Registries.DAMAGE_TYPE), CraftDamageType::new); +@@ -138,6 +138,7 @@ public class CraftRegistry implements Registry { + if (bukkitClass == Wolf.Variant.class) { + return new CraftRegistry<>(Wolf.Variant.class, registryHolder.registryOrThrow(Registries.WOLF_VARIANT), CraftWolf.CraftVariant::new); } + // TODO registry modification API diff --git a/patches/unapplied/server/0506-Add-StructuresLocateEvent.patch b/patches/server/0490-Add-StructuresLocateEvent.patch similarity index 96% rename from patches/unapplied/server/0506-Add-StructuresLocateEvent.patch rename to patches/server/0490-Add-StructuresLocateEvent.patch index 4cbe5b8bc0..4e44861dd1 100644 --- a/patches/unapplied/server/0506-Add-StructuresLocateEvent.patch +++ b/patches/server/0490-Add-StructuresLocateEvent.patch @@ -47,10 +47,10 @@ index 0000000000000000000000000000000000000000..2667067fd13f61e0464ba88ae4e4a707 + } +} 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 4a731b9170222a5a2b0089ef5e9527dbd46a9ad5..edd968686292237e95afdf99a291f501386144ef 100644 +index 7cdb59cd2f2ffe1195d21519ef97dae0e430285b..a8768f1925d5824ca985be1b53694ee233273758 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 { +@@ -127,6 +127,24 @@ public abstract class ChunkGenerator { @Nullable public Pair> findNearestMapStructure(ServerLevel world, HolderSet structures, BlockPos center, int radius, boolean skipReferencedStructures) { @@ -76,11 +76,11 @@ index 4a731b9170222a5a2b0089ef5e9527dbd46a9ad5..edd968686292237e95afdf99a291f501 Map>> map = new Object2ObjectArrayMap(); Iterator iterator = structures.iterator(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -index 110987de809339b4ce14eaf377782ebf3460164a..b12b99253543445475b73a1d3d7c6364856b49e8 100644 +index 480313506bf41410de090c59e047323345ea78da..c7d377dbb53cdc1f823a839e3a113136efc16349 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -@@ -120,6 +120,11 @@ public class CraftRegistry implements Registry { - return new CraftRegistry<>(DamageType.class, registryHolder.registryOrThrow(Registries.DAMAGE_TYPE), CraftDamageType::new); +@@ -139,6 +139,11 @@ public class CraftRegistry implements Registry { + return new CraftRegistry<>(Wolf.Variant.class, registryHolder.registryOrThrow(Registries.WOLF_VARIANT), CraftWolf.CraftVariant::new); } // TODO registry modification API + // Paper start - remove this after a while along with all ConfiguredStructure stuff diff --git a/patches/unapplied/server/0507-Collision-option-for-requiring-a-player-participant.patch b/patches/server/0491-Collision-option-for-requiring-a-player-participant.patch similarity index 83% rename from patches/unapplied/server/0507-Collision-option-for-requiring-a-player-participant.patch rename to patches/server/0491-Collision-option-for-requiring-a-player-participant.patch index 27be6dda95..8d8ebfc1f4 100644 --- a/patches/unapplied/server/0507-Collision-option-for-requiring-a-player-participant.patch +++ b/patches/server/0491-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 c3ca11cc4abe85132b099af1cb27772dbf40bfe1..5b0502cfcc3d9317941d7444750a49832e1a52a1 100644 +index 31911870e5056391d67c49fa68d59010534bf35f..04581cd90272775208a0192ef36f9c7458ad3a0c 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1848,6 +1848,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1872,6 +1872,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public void push(Entity entity) { if (!this.isPassengerOfSameVehicle(entity)) { if (!entity.noPhysics && !this.noPhysics) { @@ -17,10 +17,10 @@ index c3ca11cc4abe85132b099af1cb27772dbf40bfe1..5b0502cfcc3d9317941d7444750a4983 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 be16ab6da56d2aa2a21ee378cfc44dbb14e108b3..9a6b6120c248a57d9dc86ca215146f6de980bd0d 100644 +index 1aecb6cc62b4b411ab0ff3b7fb11a5d9d050b959..2f73ca283f2d6e6bc5265c95ef767b3f606a3d69 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java -@@ -792,6 +792,7 @@ public abstract class AbstractMinecart extends VehicleEntity { +@@ -789,6 +789,7 @@ public abstract class AbstractMinecart extends VehicleEntity { public void push(Entity entity) { if (!this.level().isClientSide) { if (!entity.noPhysics && !this.noPhysics) { @@ -29,10 +29,10 @@ index be16ab6da56d2aa2a21ee378cfc44dbb14e108b3..9a6b6120c248a57d9dc86ca215146f6d // 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 0178eb918179b12d7d8eb56cd72e5bfc34cfdbaf..1ced6d60a74fac028804b3c2d938e89af4706823 100644 +index d1eaadba8ce1f472a174afcfe8e0d059a121612c..549202706396fee91c23f6e34f7faa7672e4b03f 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java -@@ -207,6 +207,7 @@ public class Boat extends VehicleEntity implements VariantHolder { +@@ -200,6 +200,7 @@ public class Boat extends VehicleEntity implements VariantHolder { @Override public void push(Entity entity) { diff --git a/patches/unapplied/server/0508-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch b/patches/server/0492-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch similarity index 85% rename from patches/unapplied/server/0508-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch rename to patches/server/0492-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch index 95ecd8b67e..bb6de57d99 100644 --- a/patches/unapplied/server/0508-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch +++ b/patches/server/0492-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch @@ -7,10 +7,10 @@ The duplicate ProjectileHitEvent in EntityFireball was removed. The event was always called before the duplicate call. diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java -index fba92238d8a025fa5d02a9f3b89980ddb99f84d2..20ce474b72894a8bb3fc21018b9d79bbdc8bb14b 100644 +index b5a46c2c8e7e139a1b5cdad69459a37d4448efb1..a81d6a52674ddf7f818a7665cccd21dd8ea86cbe 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java -@@ -102,7 +102,7 @@ public abstract class AbstractHurtingProjectile extends Projectile { +@@ -92,7 +92,7 @@ public abstract class AbstractHurtingProjectile extends Projectile { // CraftBukkit start - Fire ProjectileHitEvent if (this.isRemoved()) { diff --git a/patches/unapplied/server/0509-Return-chat-component-with-empty-text-instead-of-thr.patch b/patches/server/0493-Return-chat-component-with-empty-text-instead-of-thr.patch similarity index 92% rename from patches/unapplied/server/0509-Return-chat-component-with-empty-text-instead-of-thr.patch rename to patches/server/0493-Return-chat-component-with-empty-text-instead-of-thr.patch index ba3a6a7f92..4dea2ddeed 100644 --- a/patches/unapplied/server/0509-Return-chat-component-with-empty-text-instead-of-thr.patch +++ b/patches/server/0493-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 52e57fa3b25dce10c17682964cbd4bcb4c130dc6..94fe6bd403222049e4e7a407bb6ca99bcaab6acb 100644 +index 810662eeb9ef7f2239a7937e58654a0407f9d8df..00031a013d8e1e9f40bc1ef9491da6df3b061d5f 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/0510-Make-schedule-command-per-world.patch b/patches/server/0494-Make-schedule-command-per-world.patch similarity index 94% rename from patches/unapplied/server/0510-Make-schedule-command-per-world.patch rename to patches/server/0494-Make-schedule-command-per-world.patch index f1854ba4c9..2d8f63ad1e 100644 --- a/patches/unapplied/server/0510-Make-schedule-command-per-world.patch +++ b/patches/server/0494-Make-schedule-command-per-world.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make schedule command per-world diff --git a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java -index 569b645c6d795401c974069d0be7195590cd354a..7b4ee914fb7681760446f864cf3f2f8cab180dd6 100644 +index f2d1430d714debc9e9b53eef0cbcda0d8cdcd459..d090f94a9a8a314df01e83a031dd18d5c6f1caf9 100644 --- a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java +++ b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java @@ -30,7 +30,7 @@ public class ScheduleCommand { diff --git a/patches/unapplied/server/0511-Configurable-max-leash-distance.patch b/patches/server/0495-Configurable-max-leash-distance.patch similarity index 87% rename from patches/unapplied/server/0511-Configurable-max-leash-distance.patch rename to patches/server/0495-Configurable-max-leash-distance.patch index 99a4a50ca9..e228b633f0 100644 --- a/patches/unapplied/server/0511-Configurable-max-leash-distance.patch +++ b/patches/server/0495-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 5e9cf929674888b3a143a0691dc6936b304467f1..85a9bcbd229b56317c2de15670a04c6d0eb51e18 100644 +index 5e2f10f5fd7219ebaefb1c5b5ac9bc7c71fae179..e92831739603ef1b5678c9d44e85ab70d62be0e7 100644 --- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java +++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java -@@ -55,7 +55,7 @@ public abstract class PathfinderMob extends Mob { +@@ -71,7 +71,7 @@ public abstract class PathfinderMob extends Mob { float f = this.distanceTo(entity); if (this instanceof TamableAnimal && ((TamableAnimal) this).isInSittingPose()) { @@ -17,7 +17,7 @@ index 5e9cf929674888b3a143a0691dc6936b304467f1..85a9bcbd229b56317c2de15670a04c6d this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit this.dropLeash(true, true); } -@@ -64,7 +64,7 @@ public abstract class PathfinderMob extends Mob { +@@ -80,7 +80,7 @@ public abstract class PathfinderMob extends Mob { } this.onLeashDistance(f); diff --git a/patches/unapplied/server/0512-Add-BlockPreDispenseEvent.patch b/patches/server/0496-Add-BlockPreDispenseEvent.patch similarity index 84% rename from patches/unapplied/server/0512-Add-BlockPreDispenseEvent.patch rename to patches/server/0496-Add-BlockPreDispenseEvent.patch index 4d04e2d466..2f1b97fbfa 100644 --- a/patches/unapplied/server/0512-Add-BlockPreDispenseEvent.patch +++ b/patches/server/0496-Add-BlockPreDispenseEvent.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Add 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 5593a0aa9e618071b6521b213dde0f628348c3dc..644e64850479cea20a98b8a65503ccf3a34fd32a 100644 +index 94bcbaf7daf7dfe566f508d1170a433930d9d49a..f6edfea463b3725d3a79aca38825e86dbf82175c 100644 --- a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java -@@ -104,6 +104,7 @@ public class DispenserBlock extends BaseEntityBlock { - DispenseItemBehavior idispensebehavior = this.getDispenseMethod(itemstack); +@@ -110,6 +110,7 @@ public class DispenserBlock extends BaseEntityBlock { + DispenseItemBehavior idispensebehavior = this.getDispenseMethod(world, itemstack); if (idispensebehavior != DispenseItemBehavior.NOOP) { + if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockPreDispenseEvent(world, pos, itemstack, i)) return; // Paper - Add BlockPreDispenseEvent @@ -17,10 +17,10 @@ index 5593a0aa9e618071b6521b213dde0f628348c3dc..644e64850479cea20a98b8a65503ccf3 tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, 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 1d13f8a1009d6eda351c697052d499d594a6aaa8..9a8a0fb958e8ec782111507bae957f854b2aac72 100644 +index efa7cf50b5577f87a2dfa61b59bf81052794fbf1..b4a742e8c513e458b34c216d1e907b47e3aac292 100644 --- a/src/main/java/net/minecraft/world/level/block/DropperBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DropperBlock.java -@@ -70,6 +70,7 @@ public class DropperBlock extends DispenserBlock { +@@ -71,6 +71,7 @@ public class DropperBlock extends DispenserBlock { ItemStack itemstack1; if (iinventory == null) { @@ -29,10 +29,10 @@ index 1d13f8a1009d6eda351c697052d499d594a6aaa8..9a8a0fb958e8ec782111507bae957f85 } else { // CraftBukkit start - Fire event when pushing items into other inventories diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index ea26b27279b6e09015908f164a061891f4ab9002..ec6bbab9787e5568e2be7d0a0004d8103ec38ff3 100644 +index 13e4cb7af50b3a03523d84dd72ca6a122ca041ad..e6bb82928af3378847722421ce3bad7f5b994890 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -2046,5 +2046,11 @@ public class CraftEventFactory { +@@ -2041,5 +2041,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/0513-Add-PlayerChangeBeaconEffectEvent.patch b/patches/server/0497-Add-PlayerChangeBeaconEffectEvent.patch similarity index 65% rename from patches/unapplied/server/0513-Add-PlayerChangeBeaconEffectEvent.patch rename to patches/server/0497-Add-PlayerChangeBeaconEffectEvent.patch index 0187e55e0c..e8fbab2ef1 100644 --- a/patches/unapplied/server/0513-Add-PlayerChangeBeaconEffectEvent.patch +++ b/patches/server/0497-Add-PlayerChangeBeaconEffectEvent.patch @@ -5,31 +5,32 @@ Subject: [PATCH] Add PlayerChangeBeaconEffectEvent diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -index e6a4e8dcdbc49b427c2802f1a358f8f9ad04d0f0..b670c0cb3886c99d38a91b5c13aa2cefaae702cf 100644 +index c2fa423e14fc08c10483415baa2148af269c3758..866dd476829bd59501021a8c24bde6d8e8778963 100644 --- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java +++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -@@ -170,12 +170,24 @@ public class BeaconMenu extends AbstractContainerMenu { +@@ -171,12 +171,25 @@ public class BeaconMenu extends AbstractContainerMenu { return BeaconMenu.decodeEffect(this.beaconData.get(2)); } + // Paper start - Add PlayerChangeBeaconEffectEvent -+ private static @Nullable org.bukkit.potion.PotionEffectType convert(Optional optionalEffect) { ++ private static @Nullable org.bukkit.potion.PotionEffectType convert(Optional> optionalEffect) { + return optionalEffect.map(org.bukkit.craftbukkit.potion.CraftPotionEffectType::minecraftToBukkit).orElse(null); + } + // Paper end - Add PlayerChangeBeaconEffectEvent + - public void updateEffects(Optional primary, Optional secondary) { + public void updateEffects(Optional> primary, Optional> secondary) { if (this.paymentSlot.hasItem()) { -- 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 +- this.beaconData.set(1, BeaconMenu.encodeEffect((Holder) primary.orElse(null)));// CraftBukkit - decompile error +- this.beaconData.set(2, BeaconMenu.encodeEffect((Holder) secondary.orElse(null)));// CraftBukkit - decompile error + // Paper start - Add PlayerChangeBeaconEffectEvent + 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, 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 - Add PlayerChangeBeaconEffectEvent ++ this.beaconData.set(1, BeaconMenu.encodeEffect(event.getPrimary() == null ? null : org.bukkit.craftbukkit.potion.CraftPotionEffectType.bukkitToMinecraftHolder(event.getPrimary())));// CraftBukkit - decompile error ++ this.beaconData.set(2, BeaconMenu.encodeEffect(event.getSecondary() == null ? null : org.bukkit.craftbukkit.potion.CraftPotionEffectType.bukkitToMinecraftHolder(event.getSecondary())));// CraftBukkit - decompile error ++ if (event.willConsumeItem()) { // Paper this.paymentSlot.remove(1); -+ } ++ } // Paper this.access.execute(Level::blockEntityChanged); + } // Paper end - Add PlayerChangeBeaconEffectEvent } diff --git a/patches/unapplied/server/0514-Add-toggle-for-always-placing-the-dragon-egg.patch b/patches/server/0498-Add-toggle-for-always-placing-the-dragon-egg.patch similarity index 92% rename from patches/unapplied/server/0514-Add-toggle-for-always-placing-the-dragon-egg.patch rename to patches/server/0498-Add-toggle-for-always-placing-the-dragon-egg.patch index 7d6769dff8..2576990e24 100644 --- a/patches/unapplied/server/0514-Add-toggle-for-always-placing-the-dragon-egg.patch +++ b/patches/server/0498-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 c4555320d1f283a41c47d08d68c2633717f6fda8..45b7efc85f2ec17288cad329c3a78483903c0ea2 100644 +index 3ea0ca395e0561d96044f0f84442a08b42b539bd..f81dab25fedeed08f4d3ba2d7435e2da526e6056 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/0515-Add-PlayerStonecutterRecipeSelectEvent.patch b/patches/server/0499-Add-PlayerStonecutterRecipeSelectEvent.patch similarity index 100% rename from patches/unapplied/server/0515-Add-PlayerStonecutterRecipeSelectEvent.patch rename to patches/server/0499-Add-PlayerStonecutterRecipeSelectEvent.patch diff --git a/patches/unapplied/server/0516-Expand-EntityUnleashEvent.patch b/patches/server/0500-Expand-EntityUnleashEvent.patch similarity index 88% rename from patches/unapplied/server/0516-Expand-EntityUnleashEvent.patch rename to patches/server/0500-Expand-EntityUnleashEvent.patch index cd50019e1f..129bd5e2fb 100644 --- a/patches/unapplied/server/0516-Expand-EntityUnleashEvent.patch +++ b/patches/server/0500-Expand-EntityUnleashEvent.patch @@ -5,28 +5,28 @@ Subject: [PATCH] Expand EntityUnleashEvent diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 3e6706671b3dc06b376eaa9d6d463c6a098104d1..d1833dcc92b1570e62a1941bbea6d66ff0b2ee5f 100644 +index 2b282ba23444110949508dac11a25fee4e472f5d..b7cc2b5ee85e8e6a5c8cb8ce1f3c934773be32e6 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1300,12 +1300,15 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1428,12 +1428,15 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti return InteractionResult.PASS; } else if (this.getLeashHolder() == player) { // CraftBukkit start - fire PlayerUnleashEntityEvent - if (CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand).isCancelled()) { + // Paper start - Expand EntityUnleashEvent -+ org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.getAbilities().instabuild); ++ org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.hasInfiniteMaterials()); + if (event.isCancelled()) { + // Paper end - Expand EntityUnleashEvent ((ServerPlayer) player).connection.send(new ClientboundSetEntityLinkPacket(this, this.getLeashHolder())); return InteractionResult.PASS; } // CraftBukkit end -- this.dropLeash(true, !player.getAbilities().instabuild); +- this.dropLeash(true, !player.hasInfiniteMaterials()); + this.dropLeash(true, event.isDropLeash()); // Paper - Expand EntityUnleashEvent this.gameEvent(GameEvent.ENTITY_INTERACT, player); return InteractionResult.sidedSuccess(this.level().isClientSide); } else { -@@ -1473,8 +1476,11 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1601,8 +1604,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti if (this.leashHolder != null) { if (!this.isAlive() || !this.leashHolder.isAlive()) { @@ -40,7 +40,7 @@ index 3e6706671b3dc06b376eaa9d6d463c6a098104d1..d1833dcc92b1570e62a1941bbea6d66f } } -@@ -1537,8 +1543,11 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1670,8 +1676,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti boolean flag1 = super.startRiding(entity, force); if (flag1 && this.isLeashed()) { @@ -54,7 +54,7 @@ index 3e6706671b3dc06b376eaa9d6d463c6a098104d1..d1833dcc92b1570e62a1941bbea6d66f } return flag1; -@@ -1728,8 +1737,11 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1848,8 +1857,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti @Override protected void removeAfterChangingDimensions() { super.removeAfterChangingDimensions(); @@ -69,10 +69,10 @@ index 3e6706671b3dc06b376eaa9d6d463c6a098104d1..d1833dcc92b1570e62a1941bbea6d66f 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 85a9bcbd229b56317c2de15670a04c6d0eb51e18..d6393210cfee53685f83c8491bea8b9c13b01eea 100644 +index e92831739603ef1b5678c9d44e85ab70d62be0e7..cdd07093342521ff9944bf7a342bbf142ba3f0b7 100644 --- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java +++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java -@@ -56,8 +56,11 @@ public abstract class PathfinderMob extends Mob { +@@ -72,8 +72,11 @@ public abstract class PathfinderMob extends Mob { if (this instanceof TamableAnimal && ((TamableAnimal) this).isInSittingPose()) { if (f > entity.level().paperConfig().misc.maxLeashDistance) { // Paper - Configurable max leash distance @@ -86,7 +86,7 @@ index 85a9bcbd229b56317c2de15670a04c6d0eb51e18..d6393210cfee53685f83c8491bea8b9c } return; -@@ -65,8 +68,11 @@ public abstract class PathfinderMob extends Mob { +@@ -81,8 +84,11 @@ public abstract class PathfinderMob extends Mob { this.onLeashDistance(f); if (f > entity.level().paperConfig().misc.maxLeashDistance) { // Paper - Configurable max leash distance @@ -101,10 +101,10 @@ index 85a9bcbd229b56317c2de15670a04c6d0eb51e18..d6393210cfee53685f83c8491bea8b9c } else if (f > 6.0F) { double d0 = (entity.getX() - this.getX()) / (double) f; diff --git a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java -index 6a6526b7b1b578e08a41f85c0443c5f04177efb0..0b88bd258c4f2bce100bf96bcbe61c20493f8e40 100644 +index b43b1f81828bf1d57e98c52964053db7127519ad..952321d4e34a6524bbb494a56d7658068f74124c 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java +++ b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java -@@ -127,11 +127,14 @@ public class LeashFenceKnotEntity extends HangingEntity { +@@ -120,11 +120,14 @@ public class LeashFenceKnotEntity extends HangingEntity { if (entityinsentient1.isLeashed() && entityinsentient1.getLeashHolder() == this) { // CraftBukkit start @@ -122,10 +122,10 @@ index 6a6526b7b1b578e08a41f85c0443c5f04177efb0..0b88bd258c4f2bce100bf96bcbe61c20 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 ec6bbab9787e5568e2be7d0a0004d8103ec38ff3..ca0cb9ad99992ef2602781adf16da94ca56975f8 100644 +index e6bb82928af3378847722421ce3bad7f5b994890..dadb4f13ec6b9915108603aa34d4112c47337c44 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1570,8 +1570,10 @@ public class CraftEventFactory { +@@ -1565,8 +1565,10 @@ public class CraftEventFactory { Bukkit.getPluginManager().callEvent(new PlayerRecipeBookSettingsChangeEvent(player.getBukkitEntity(), bukkitType, open, filter)); } diff --git a/patches/unapplied/server/0517-Reset-shield-blocking-on-dimension-change.patch b/patches/server/0501-Reset-shield-blocking-on-dimension-change.patch similarity index 84% rename from patches/unapplied/server/0517-Reset-shield-blocking-on-dimension-change.patch rename to patches/server/0501-Reset-shield-blocking-on-dimension-change.patch index e29d07bebd..8d9b5e6d19 100644 --- a/patches/unapplied/server/0517-Reset-shield-blocking-on-dimension-change.patch +++ b/patches/server/0501-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 efe511fc6ab121263fe0c09763e09e0cf10a354a..19baf0ecd04ae058fac709889db34bf27679ab5e 100644 +index edfcfb91d907d6e1837e5a5d0e7abb8c8f6bcb66..2db78d991ef0595a0d8806414a959479e289c0fc 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1198,6 +1198,11 @@ public class ServerPlayer extends Player { +@@ -1265,6 +1265,11 @@ public class ServerPlayer extends Player { this.level().getCraftServer().getPluginManager().callEvent(changeEvent); // CraftBukkit end } diff --git a/patches/unapplied/server/0518-Add-DragonEggFormEvent.patch b/patches/server/0502-Add-DragonEggFormEvent.patch similarity index 96% rename from patches/unapplied/server/0518-Add-DragonEggFormEvent.patch rename to patches/server/0502-Add-DragonEggFormEvent.patch index b92df234cd..c9ec752038 100644 --- a/patches/unapplied/server/0518-Add-DragonEggFormEvent.patch +++ b/patches/server/0502-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 45b7efc85f2ec17288cad329c3a78483903c0ea2..1c9bfcf595bcb247c3b9ffe8b0e0cfee0d0ba91f 100644 +index f81dab25fedeed08f4d3ba2d7435e2da526e6056..609b20e2b222c5b1fddf22c2621d0d7a88cabcfa 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,8 +407,22 @@ public class EndDragonFight { diff --git a/patches/unapplied/server/0519-Add-EntityMoveEvent.patch b/patches/server/0503-Add-EntityMoveEvent.patch similarity index 85% rename from patches/unapplied/server/0519-Add-EntityMoveEvent.patch rename to patches/server/0503-Add-EntityMoveEvent.patch index 01a71e25e3..1016baa882 100644 --- a/patches/unapplied/server/0519-Add-EntityMoveEvent.patch +++ b/patches/server/0503-Add-EntityMoveEvent.patch @@ -5,22 +5,22 @@ Subject: [PATCH] Add EntityMoveEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 23d68feaa060514e6582a9d47a9ca7db9421c29c..a596b3e52e902ed01a526aa9961910d8a3cc2e2d 100644 +index b083298d2bcf0d4c6213d6ac8645b8c084cfc6de..e9ea8ad5689c0e6edd2e7335ab9932b3a6abbbf3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1526,6 +1526,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - BlockPhysicsEvent + worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent this.profiler.push(() -> { - return worldserver + " " + worldserver.dimension().location(); + String s = String.valueOf(worldserver); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index a2113c01d8ea3da13efbf4f0b23460e7fa4e8c68..125e3425af05541e5c848ee0e9390cea44a29302 100644 +index 2c1ca55e1919c29956b3d95f65f8f08eb7529d1e..35ccccfea9aec44a85e08b0e383b6650554b8bd3 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -222,6 +222,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -227,6 +227,7 @@ public class ServerLevel extends Level implements WorldGenLevel { public final LevelStorageSource.LevelStorageAccess convertable; public final UUID uuid; public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent @@ -29,10 +29,10 @@ index a2113c01d8ea3da13efbf4f0b23460e7fa4e8c68..125e3425af05541e5c848ee0e9390cea public LevelChunk getChunkIfLoaded(int x, int z) { return this.chunkSource.getChunk(x, z, false); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index ed32b3f1107210d56e5653b2d5eddcf1deb39dfc..d19a0733fe257eb66a02e263d4e053939f7ec978 100644 +index e38f0659836be4bebff06e8d8e7848abdcbda455..83730b9da452d27b420770adf6ff179b936f2bbd 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3382,6 +3382,20 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3471,6 +3471,20 @@ public abstract class LivingEntity extends Entity implements Attackable { this.pushEntities(); this.level().getProfiler().pop(); diff --git a/patches/unapplied/server/0520-added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/0504-added-option-to-disable-pathfinding-updates-on-block.patch similarity index 78% rename from patches/unapplied/server/0520-added-option-to-disable-pathfinding-updates-on-block.patch rename to patches/server/0504-added-option-to-disable-pathfinding-updates-on-block.patch index fbf9bd1483..7ceefb961a 100644 --- a/patches/unapplied/server/0520-added-option-to-disable-pathfinding-updates-on-block.patch +++ b/patches/server/0504-added-option-to-disable-pathfinding-updates-on-block.patch @@ -5,18 +5,18 @@ 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 125e3425af05541e5c848ee0e9390cea44a29302..0f6a34776482a7eef638911fe01db819962b3ce8 100644 +index 35ccccfea9aec44a85e08b0e383b6650554b8bd3..93d66d85be2dcc52e8f3fa138561f2126d91c732 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1369,6 +1369,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1375,6 +1375,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } this.getChunkSource().blockChanged(pos); + if(this.paperConfig().misc.updatePathfindingOnBlockUpdate) { // Paper - option to disable pathfinding updates + this.pathTypesByPosCache.invalidate(pos); VoxelShape voxelshape = oldState.getCollisionShape(this, pos); VoxelShape voxelshape1 = newState.getCollisionShape(this, pos); - -@@ -1410,6 +1411,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1417,6 +1418,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } diff --git a/patches/unapplied/server/0521-Inline-shift-direction-fields.patch b/patches/server/0505-Inline-shift-direction-fields.patch similarity index 78% rename from patches/unapplied/server/0521-Inline-shift-direction-fields.patch rename to patches/server/0505-Inline-shift-direction-fields.patch index 88027eb7c0..910b881e3a 100644 --- a/patches/unapplied/server/0521-Inline-shift-direction-fields.patch +++ b/patches/server/0505-Inline-shift-direction-fields.patch @@ -7,10 +7,10 @@ Removes a layer of indirection for EnumDirection.getAdjacent(X|Y|Z)(), which is critical section for much of the server, including the lighting engine. diff --git a/src/main/java/net/minecraft/core/Direction.java b/src/main/java/net/minecraft/core/Direction.java -index 14b57310811bb930b40396a02b263cdbccb1076b..75694cfd7d8adde6b9246518c20fe75774297a57 100644 +index c47e6acbd36737aa7af13b452f51b3f017d324f4..03c45ee77276462818a6f774b5945b25924aa3f0 100644 --- a/src/main/java/net/minecraft/core/Direction.java +++ b/src/main/java/net/minecraft/core/Direction.java -@@ -48,6 +48,12 @@ public enum Direction implements StringRepresentable { +@@ -55,6 +55,12 @@ public enum Direction implements StringRepresentable { .sorted(Comparator.comparingInt(direction -> direction.data2d)) .toArray(Direction[]::new); @@ -20,10 +20,10 @@ index 14b57310811bb930b40396a02b263cdbccb1076b..75694cfd7d8adde6b9246518c20fe757 + private final int adjZ; + // Paper end - Perf: Inline shift direction fields + - private Direction(int id, int idOpposite, int idHorizontal, String name, Direction.AxisDirection direction, Direction.Axis axis, Vec3i vector) { - this.data3d = id; - this.data2d = idHorizontal; -@@ -56,6 +62,11 @@ public enum Direction implements StringRepresentable { + private Direction( + final int id, + final int idOpposite, +@@ -71,6 +77,11 @@ public enum Direction implements StringRepresentable { this.axis = axis; this.axisDirection = direction; this.normal = vector; @@ -35,7 +35,7 @@ index 14b57310811bb930b40396a02b263cdbccb1076b..75694cfd7d8adde6b9246518c20fe757 } public static Direction[] orderedByNearest(Entity entity) { -@@ -219,15 +230,15 @@ public enum Direction implements StringRepresentable { +@@ -234,15 +245,15 @@ public enum Direction implements StringRepresentable { } public int getStepX() { diff --git a/patches/unapplied/server/0522-Allow-adding-items-to-BlockDropItemEvent.patch b/patches/server/0506-Allow-adding-items-to-BlockDropItemEvent.patch similarity index 93% rename from patches/unapplied/server/0522-Allow-adding-items-to-BlockDropItemEvent.patch rename to patches/server/0506-Allow-adding-items-to-BlockDropItemEvent.patch index b5abbd7988..ea45c33555 100644 --- a/patches/unapplied/server/0522-Allow-adding-items-to-BlockDropItemEvent.patch +++ b/patches/server/0506-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 ca0cb9ad99992ef2602781adf16da94ca56975f8..5d4fe10d4e3a5d7a9430dbd5b3c850db482f5862 100644 +index dadb4f13ec6b9915108603aa34d4112c47337c44..ea9a12ff01203072975bb2f22a077d1d2e46376f 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -452,13 +452,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/0523-Add-getMainThreadExecutor-to-BukkitScheduler.patch b/patches/server/0507-Add-getMainThreadExecutor-to-BukkitScheduler.patch similarity index 100% rename from patches/unapplied/server/0523-Add-getMainThreadExecutor-to-BukkitScheduler.patch rename to patches/server/0507-Add-getMainThreadExecutor-to-BukkitScheduler.patch diff --git a/patches/unapplied/server/0524-living-entity-allow-attribute-registration.patch b/patches/server/0508-living-entity-allow-attribute-registration.patch similarity index 84% rename from patches/unapplied/server/0524-living-entity-allow-attribute-registration.patch rename to patches/server/0508-living-entity-allow-attribute-registration.patch index b05d18bed0..e143e453a0 100644 --- a/patches/unapplied/server/0524-living-entity-allow-attribute-registration.patch +++ b/patches/server/0508-living-entity-allow-attribute-registration.patch @@ -5,11 +5,11 @@ 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 4228d28b2f697e7dc320525c1ad48a8a2aa0fdb4..b99a080ab27e24d8131fda931ca70d6d271bb01c 100644 +index f03f40e2624d0e8e27a6fb7ae33d82cb614252f4..b02c8514aac174db1c04a6c8240851eff474906f 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 -@@ -138,4 +138,12 @@ public class AttributeMap { - }, () -> LOGGER.warn("Ignoring unknown attribute '{}'", string)); +@@ -106,4 +106,12 @@ public class AttributeMap { + } } } + @@ -22,7 +22,7 @@ index 4228d28b2f697e7dc320525c1ad48a8a2aa0fdb4..b99a080ab27e24d8131fda931ca70d6d + } diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java -index ea48f1119a940056c37d1d203437bfbfdf13663b..8a678df56fcf30535957e111d81ad07be5b501ec 100644 +index a0a34f680e21007ebf2c2497d2e6505eedae6481..5314905063e62f0f5ed56e476718ba7610bb711f 100644 --- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java +++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java @@ -35,4 +35,11 @@ public class CraftAttributeMap implements Attributable { @@ -38,10 +38,10 @@ index ea48f1119a940056c37d1d203437bfbfdf13663b..8a678df56fcf30535957e111d81ad07b + // Paper end - living entity allow attribute registration } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 4ac52885618bf062eb34672b8fc60331a9c8f76a..0a4df9971c66676dba90fb03c840e25a41103bc0 100644 +index b88077ac1ed99057b8a9361ea550cd2b00040f88..2701e53086f4be07c341cd1e4fcd7a351e77c486 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -755,6 +755,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -754,6 +754,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return this.getHandle().craftAttributes.getAttribute(attribute); } diff --git a/patches/unapplied/server/0525-fix-dead-slime-setSize-invincibility.patch b/patches/server/0509-fix-dead-slime-setSize-invincibility.patch similarity index 100% rename from patches/unapplied/server/0525-fix-dead-slime-setSize-invincibility.patch rename to patches/server/0509-fix-dead-slime-setSize-invincibility.patch diff --git a/patches/unapplied/server/0526-Merchant-getRecipes-should-return-an-immutable-list.patch b/patches/server/0510-Merchant-getRecipes-should-return-an-immutable-list.patch similarity index 100% rename from patches/unapplied/server/0526-Merchant-getRecipes-should-return-an-immutable-list.patch rename to patches/server/0510-Merchant-getRecipes-should-return-an-immutable-list.patch diff --git a/patches/unapplied/server/0527-Expose-Tracked-Players.patch b/patches/server/0511-Expose-Tracked-Players.patch similarity index 87% rename from patches/unapplied/server/0527-Expose-Tracked-Players.patch rename to patches/server/0511-Expose-Tracked-Players.patch index 144143bd1f..b15fc67f75 100644 --- a/patches/unapplied/server/0527-Expose-Tracked-Players.patch +++ b/patches/server/0511-Expose-Tracked-Players.patch @@ -5,10 +5,10 @@ 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 ef8f8b3f97405250ebe058c67c4099da66a8e773..524d3118663f5531e530dcdfa5da4ded2415468f 100644 +index 2080733ebae1af51b7b4d3cd2fbd1a4a2703a920..d30e1dd1b4525674c8a52da9b677c09a251b2467 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1042,4 +1042,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1052,4 +1052,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return getHandle().isTicking(); } // Paper end - isTicking API diff --git a/patches/unapplied/server/0528-Improve-ServerGUI.patch b/patches/server/0512-Improve-ServerGUI.patch similarity index 99% rename from patches/unapplied/server/0528-Improve-ServerGUI.patch rename to patches/server/0512-Improve-ServerGUI.patch index 9aec8b6334..872206f5fe 100644 --- a/patches/unapplied/server/0528-Improve-ServerGUI.patch +++ b/patches/server/0512-Improve-ServerGUI.patch @@ -38,7 +38,7 @@ index f93373d28d741e1f8a53e07b4e328ce9c4e1657f..039a86034928a5eb7aaa2d7ca76a7bdd + } } diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java -index 2bbc57b4869caf690f53618d60359c5133ec62a8..c42a9949c4d37d45883867a54222a7ab33944b39 100644 +index 8b570b0c3967a22c085f390110cb29cbd9c8feff..4d3fe4f56e0b264fa030409919caf52d5f421d46 100644 --- a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java +++ b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java @@ -59,6 +59,15 @@ public class MinecraftServerGui extends JComponent { diff --git a/patches/unapplied/server/0529-fix-converting-txt-to-json-file.patch b/patches/server/0513-fix-converting-txt-to-json-file.patch similarity index 90% rename from patches/unapplied/server/0529-fix-converting-txt-to-json-file.patch rename to patches/server/0513-fix-converting-txt-to-json-file.patch index cd8921cdba..6650554faa 100644 --- a/patches/unapplied/server/0529-fix-converting-txt-to-json-file.patch +++ b/patches/server/0513-fix-converting-txt-to-json-file.patch @@ -21,10 +21,10 @@ index 929f59bce01c8e6ed4b0b551744d42e131b8fc80..22c4f8dea99f92a1eb3da2baf0a15bf9 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 ebea8a827aad108dd6d4222e8dfd251d2cea657a..2a0d3212edeee828b9fe04c153ee05ea5b0875ec 100644 +index 4d7c2832a9cd9a88b99c837a02df7fa91e572658..4b00c14332f3d514f402fc82345a02d51c3ac58a 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -199,6 +199,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -212,6 +212,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess()); this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Paper end - initialize global and world-defaults configuration @@ -37,7 +37,7 @@ index ebea8a827aad108dd6d4222e8dfd251d2cea657a..2a0d3212edeee828b9fe04c153ee05ea org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics -@@ -253,9 +259,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -266,9 +272,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file."); } @@ -48,10 +48,10 @@ index ebea8a827aad108dd6d4222e8dfd251d2cea657a..2a0d3212edeee828b9fe04c153ee05ea 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 65c11774b9e3c724b5ac67a557bd84efcd53fbab..6a00304ea9eac600162eae03e70aa28f39149c5f 100644 +index dd360250ca784421e0f8fffe786bec88a8f38b3d..b1cf71350661baf027bd45ebd9c80e8273cbad1e 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -177,6 +177,7 @@ public abstract class PlayerList { +@@ -179,6 +179,7 @@ public abstract class PlayerList { this.maxPlayers = maxPlayers; this.playerIo = saveHandler; } diff --git a/patches/unapplied/server/0530-Add-worldborder-events.patch b/patches/server/0514-Add-worldborder-events.patch similarity index 97% rename from patches/unapplied/server/0530-Add-worldborder-events.patch rename to patches/server/0514-Add-worldborder-events.patch index f39382cd63..2ab55e30ef 100644 --- a/patches/unapplied/server/0530-Add-worldborder-events.patch +++ b/patches/server/0514-Add-worldborder-events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add worldborder events diff --git a/src/main/java/net/minecraft/world/level/border/WorldBorder.java b/src/main/java/net/minecraft/world/level/border/WorldBorder.java -index bf5ac907507bf3b5bfcef45b566c0bc12626e2c0..350aabd20329f429248c84d73ab8b5eb145943a7 100644 +index 580eb275942570da9e68287ca75da886ba1248c0..6c6eb7deed281678c05ef27f933e1693b11dae7c 100644 --- a/src/main/java/net/minecraft/world/level/border/WorldBorder.java +++ b/src/main/java/net/minecraft/world/level/border/WorldBorder.java @@ -123,6 +123,14 @@ public class WorldBorder { diff --git a/patches/unapplied/server/0531-Add-PlayerNameEntityEvent.patch b/patches/server/0515-Add-PlayerNameEntityEvent.patch similarity index 65% rename from patches/unapplied/server/0531-Add-PlayerNameEntityEvent.patch rename to patches/server/0515-Add-PlayerNameEntityEvent.patch index eec1c1a2eb..9287edc1b7 100644 --- a/patches/unapplied/server/0531-Add-PlayerNameEntityEvent.patch +++ b/patches/server/0515-Add-PlayerNameEntityEvent.patch @@ -5,24 +5,22 @@ Subject: [PATCH] Add PlayerNameEntityEvent diff --git a/src/main/java/net/minecraft/world/item/NameTagItem.java b/src/main/java/net/minecraft/world/item/NameTagItem.java -index af072de68435d1678651bdf2fa13b314ca9c9d58..a0b3c2d3b3f86ecd6cb80ff767839d29ca4f4f68 100644 +index 3ce8c725270510dbaaf2c1edc895d37ea9ca424c..774c982f28b4f127fc3f036c19dfb47fb9ae3264 100644 --- a/src/main/java/net/minecraft/world/item/NameTagItem.java +++ b/src/main/java/net/minecraft/world/item/NameTagItem.java -@@ -15,9 +15,14 @@ public class NameTagItem extends Item { - public InteractionResult interactLivingEntity(ItemStack stack, Player user, LivingEntity entity, InteractionHand hand) { - if (stack.hasCustomHoverName() && !(entity instanceof Player)) { +@@ -18,8 +18,13 @@ public class NameTagItem extends Item { + Component component = stack.get(DataComponents.CUSTOM_NAME); + if (component != null && !(entity instanceof Player)) { if (!user.level().isClientSide && entity.isAlive()) { -- entity.setCustomName(stack.getHoverName()); -- if (entity instanceof Mob) { -- ((Mob)entity).setPersistenceRequired(); +- entity.setCustomName(component); +- if (entity instanceof Mob mob) { + // Paper start - Add PlayerNameEntityEvent + io.papermc.paper.event.player.PlayerNameEntityEvent event = new io.papermc.paper.event.player.PlayerNameEntityEvent(((net.minecraft.server.level.ServerPlayer) user).getBukkitEntity(), entity.getBukkitLivingEntity(), io.papermc.paper.adventure.PaperAdventure.asAdventure(stack.getHoverName()), true); + if (!event.callEvent()) return InteractionResult.PASS; + LivingEntity newEntity = ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getEntity()).getHandle(); + newEntity.setCustomName(event.getName() != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(event.getName()) : null); -+ if (event.isPersistent() && newEntity instanceof Mob) { -+ ((Mob) newEntity).setPersistenceRequired(); -+ // Paper end - Add PlayerNameEntityEvent ++ if (event.isPersistent() && newEntity instanceof Mob mob) { ++ // Paper end - Add PlayerNameEntityEvent + mob.setPersistenceRequired(); } - stack.shrink(1); diff --git a/patches/unapplied/server/0533-Add-recipe-to-cook-events.patch b/patches/server/0516-Add-recipe-to-cook-events.patch similarity index 89% rename from patches/unapplied/server/0533-Add-recipe-to-cook-events.patch rename to patches/server/0516-Add-recipe-to-cook-events.patch index 75eb9efb8b..05bf67ef6c 100644 --- a/patches/unapplied/server/0533-Add-recipe-to-cook-events.patch +++ b/patches/server/0516-Add-recipe-to-cook-events.patch @@ -5,10 +5,10 @@ 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 8f7029e602300f68b3c8411caa2d9e0b1e8be62e..d975e80b6a7849bcbabf20bf12f7d63ab1a6335f 100644 +index 4cd7232f538649d99892f3b31f2741b1d7e792e8..e18ebeef377411f1e921e3d769c4a1d379a12be4 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 -@@ -438,7 +438,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -443,7 +443,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit CraftItemStack source = CraftItemStack.asCraftMirror(itemstack); org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1); @@ -18,10 +18,10 @@ index 8f7029e602300f68b3c8411caa2d9e0b1e8be62e..d975e80b6a7849bcbabf20bf12f7d63a 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 3a2afa6c1f6dfad7dc18d93b743cbea1eef0e4b8..5da0c6bf4f04448f640a11931b2cc5b91cf83f12 100644 +index 66fbad74c2ec2f853ec6c74482c6cae1c1746007..e858d32c7e8e228a1f0327a33054671ad105c2eb 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 -@@ -63,7 +63,10 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { +@@ -68,7 +68,10 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { if (campfire.cookingProgress[i] >= campfire.cookingTime[i]) { SimpleContainer inventorysubcontainer = new SimpleContainer(new ItemStack[]{itemstack}); @@ -33,7 +33,7 @@ index 3a2afa6c1f6dfad7dc18d93b743cbea1eef0e4b8..5da0c6bf4f04448f640a11931b2cc5b9 return ((CampfireCookingRecipe) recipeholder.value()).assemble(inventorysubcontainer, world.registryAccess()); }).orElse(itemstack); -@@ -72,7 +75,7 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { +@@ -77,7 +80,7 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { CraftItemStack source = CraftItemStack.asCraftMirror(itemstack); org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1); diff --git a/patches/unapplied/server/0534-Add-Block-isValidTool.patch b/patches/server/0517-Add-Block-isValidTool.patch similarity index 100% rename from patches/unapplied/server/0534-Add-Block-isValidTool.patch rename to patches/server/0517-Add-Block-isValidTool.patch diff --git a/patches/unapplied/server/0535-Allow-using-signs-inside-spawn-protection.patch b/patches/server/0518-Allow-using-signs-inside-spawn-protection.patch similarity index 53% rename from patches/unapplied/server/0535-Allow-using-signs-inside-spawn-protection.patch rename to patches/server/0518-Allow-using-signs-inside-spawn-protection.patch index d32c2c920e..bc14b789b0 100644 --- a/patches/unapplied/server/0535-Allow-using-signs-inside-spawn-protection.patch +++ b/patches/server/0518-Allow-using-signs-inside-spawn-protection.patch @@ -5,15 +5,16 @@ 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 a16751a23eb6aab8c25520127d4dbea0c991c32c..9f9ac6b67123339b77ff85830f7cf2419b0fc330 100644 +index e0c11559295d00445d5ba0543a81f49dc2314266..9446d6c2b2f8e535588264af7e1c852005658a17 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1752,7 +1752,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1753,8 +1753,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl int i = this.player.level().getMaxBuildHeight(); if (blockposition.getY() < i) { -- if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.mayInteract(this.player, blockposition)) { -+ if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && (worldserver.mayInteract(this.player, blockposition) || (worldserver.paperConfig().spawn.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper - Allow using signs inside spawn protection - this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706 +- if (this.awaitingPositionFromClient == null && worldserver.mayInteract(this.player, blockposition)) { +- this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706 ++ if (this.awaitingPositionFromClient == null && (worldserver.mayInteract(this.player, blockposition) || (worldserver.paperConfig().spawn.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper - Allow using signs inside spawn protection InteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock); + if (enuminteractionresult.consumesAction()) { diff --git a/patches/unapplied/server/0536-Expand-world-key-API.patch b/patches/server/0519-Expand-world-key-API.patch similarity index 83% rename from patches/unapplied/server/0536-Expand-world-key-API.patch rename to patches/server/0519-Expand-world-key-API.patch index c0e1a1055a..2cb47729e1 100644 --- a/patches/unapplied/server/0536-Expand-world-key-API.patch +++ b/patches/server/0519-Expand-world-key-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expand world key API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index bb9b4ff9f5c983ef6fe0b295bc868bc1125921d5..b9262b681b51cb68024156b28d33624fddd17b26 100644 +index 9801f78f1d44fd5a72fbdb319681b683e8fb85c4..1e720b96f0367652db6924b8654deaa9467e3d2c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java @@ -511,5 +511,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor { @@ -20,10 +20,10 @@ index bb9b4ff9f5c983ef6fe0b295bc868bc1125921d5..b9262b681b51cb68024156b28d33624f // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c353f7a3a9ad0099ef7330dde988d1a174a0e327..b453673f7bab09a1b10898a7d1f85d133e63ac72 100644 +index 99fa8f65801b1816b788fa42d49d6672bf331579..6debfd5866d4411ef8d51995bd07a0e2ece781b3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1149,9 +1149,15 @@ public final class CraftServer implements Server { +@@ -1150,9 +1150,15 @@ public final class CraftServer implements Server { File folder = new File(this.getWorldContainer(), name); World world = this.getWorld(name); @@ -41,7 +41,7 @@ index c353f7a3a9ad0099ef7330dde988d1a174a0e327..b453673f7bab09a1b10898a7d1f85d13 if (folder.exists()) { Preconditions.checkArgument(folder.isDirectory(), "File (%s) exists and isn't a folder", name); -@@ -1275,7 +1281,7 @@ public final class CraftServer implements Server { +@@ -1278,7 +1284,7 @@ public final class CraftServer implements Server { } else if (name.equals(levelName + "_the_end")) { worldKey = net.minecraft.world.level.Level.END; } else { @@ -49,8 +49,8 @@ index c353f7a3a9ad0099ef7330dde988d1a174a0e327..b453673f7bab09a1b10898a7d1f85d13 + worldKey = ResourceKey.create(Registries.DIMENSION, new net.minecraft.resources.ResourceLocation(creator.key().getNamespace().toLowerCase(java.util.Locale.ENGLISH), creator.key().getKey().toLowerCase(java.util.Locale.ENGLISH))); // Paper } - ServerLevel internal = (ServerLevel) new ServerLevel(this.console, this.console.executor, worldSession, worlddata, worldKey, worlddimension, this.getServer().progressListenerFactory.create(11), -@@ -1368,6 +1374,15 @@ public final class CraftServer implements Server { + // If set to not keep spawn in memory (changed from default) then adjust rule accordingly +@@ -1374,6 +1380,15 @@ public final class CraftServer implements Server { return null; } @@ -67,10 +67,10 @@ index c353f7a3a9ad0099ef7330dde988d1a174a0e327..b453673f7bab09a1b10898a7d1f85d13 // 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 f10457466cbaaba2d3aa49a64092847f635ce752..0768a70cdd48cf03a6dfb3a6a3c7ed4844ea132e 100644 +index c0878cf9948774986996127e250004f0f21d6b31..788a85a65cc77b7c826a9804e52ef5883bb2ab61 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -536,6 +536,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -533,6 +533,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public int nextEntityId() { return net.minecraft.world.entity.Entity.nextEntityId(); } diff --git a/patches/unapplied/server/0537-Add-fast-alternative-constructor-for-Rotations.patch b/patches/server/0520-Add-fast-alternative-constructor-for-Rotations.patch similarity index 88% rename from patches/unapplied/server/0537-Add-fast-alternative-constructor-for-Rotations.patch rename to patches/server/0520-Add-fast-alternative-constructor-for-Rotations.patch index 7c07d6c0ee..e28775fc9a 100644 --- a/patches/unapplied/server/0537-Add-fast-alternative-constructor-for-Rotations.patch +++ b/patches/server/0520-Add-fast-alternative-constructor-for-Rotations.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add fast alternative constructor for Rotations diff --git a/src/main/java/net/minecraft/core/Rotations.java b/src/main/java/net/minecraft/core/Rotations.java -index 63a6512437a3611f73573f9fc97d4f32fb8be861..d6f1002d0f5760383edd641165f6622f8d6672c2 100644 +index e6c97efb3aa89646149d11bb0ae4420b3977d214..27007280dba9e6d19a50dc2a4b160e96b20c67f7 100644 --- a/src/main/java/net/minecraft/core/Rotations.java +++ b/src/main/java/net/minecraft/core/Rotations.java -@@ -19,6 +19,18 @@ public class Rotations { +@@ -34,6 +34,18 @@ public class Rotations { this(serialized.getFloat(0), serialized.getFloat(1), serialized.getFloat(2)); } diff --git a/patches/unapplied/server/0538-Item-Rarity-API.patch b/patches/server/0521-Item-Rarity-API.patch similarity index 94% rename from patches/unapplied/server/0538-Item-Rarity-API.patch rename to patches/server/0521-Item-Rarity-API.patch index e06ec08950..933f1a031c 100644 --- a/patches/unapplied/server/0538-Item-Rarity-API.patch +++ b/patches/server/0521-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 0768a70cdd48cf03a6dfb3a6a3c7ed4844ea132e..a1400e8a7c59ffbfa4cd4ee3f3201b96c1584261 100644 +index 788a85a65cc77b7c826a9804e52ef5883bb2ab61..3781f5bfaf4f156b7c5d383a8591e0853258a04c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -541,6 +541,20 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -538,6 +538,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/0539-Drop-carried-item-when-player-has-disconnected.patch b/patches/server/0522-Drop-carried-item-when-player-has-disconnected.patch similarity index 89% rename from patches/unapplied/server/0539-Drop-carried-item-when-player-has-disconnected.patch rename to patches/server/0522-Drop-carried-item-when-player-has-disconnected.patch index c5c564c74e..7e4983ac73 100644 --- a/patches/unapplied/server/0539-Drop-carried-item-when-player-has-disconnected.patch +++ b/patches/server/0522-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 6a00304ea9eac600162eae03e70aa28f39149c5f..563e287cfb885f212ebe9dfc8309aa123713897a 100644 +index b1cf71350661baf027bd45ebd9c80e8273cbad1e..dd02a271ca6b642ce8567d492c57faf6d9bcf146 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -596,6 +596,14 @@ public abstract class PlayerList { +@@ -594,6 +594,14 @@ public abstract class PlayerList { } // Paper end - Configurable player collision diff --git a/patches/unapplied/server/0540-forced-whitelist-use-configurable-kick-message.patch b/patches/server/0523-forced-whitelist-use-configurable-kick-message.patch similarity index 87% rename from patches/unapplied/server/0540-forced-whitelist-use-configurable-kick-message.patch rename to patches/server/0523-forced-whitelist-use-configurable-kick-message.patch index 890b503e8f..498082f7a1 100644 --- a/patches/unapplied/server/0540-forced-whitelist-use-configurable-kick-message.patch +++ b/patches/server/0523-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 a596b3e52e902ed01a526aa9961910d8a3cc2e2d..d972e82ce41ec0c1ff4f9c55646ed3c21c6381d2 100644 +index e9ea8ad5689c0e6edd2e7335ab9932b3a6abbbf3..5e3566e911194ee0f3552d612b63bb5922a98815 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2167,7 +2167,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop +Date: Mon, 5 Apr 2021 18:35:15 -0700 +Subject: [PATCH] Don't ignore result of PlayerEditBookEvent + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index 9446d6c2b2f8e535588264af7e1c852005658a17..f1bdea575fbc52929076e5adea94af51f1f603ec 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -1158,7 +1158,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + List> list1 = pages.stream().map(this::filterableFromOutgoing).toList(); + + itemstack.set(DataComponents.WRITABLE_BOOK_CONTENT, new WritableBookContent(list1)); +- CraftEventFactory.handleEditBookEvent(this.player, slotId, handItem, itemstack); // CraftBukkit ++ this.player.getInventory().setItem(slotId, CraftEventFactory.handleEditBookEvent(this.player, slotId, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent) + } + } + diff --git a/patches/unapplied/server/0542-Expose-protocol-version.patch b/patches/server/0525-Expose-protocol-version.patch similarity index 85% rename from patches/unapplied/server/0542-Expose-protocol-version.patch rename to patches/server/0525-Expose-protocol-version.patch index 42ca8eaa45..089820d036 100644 --- a/patches/unapplied/server/0542-Expose-protocol-version.patch +++ b/patches/server/0525-Expose-protocol-version.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose protocol version diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index a1400e8a7c59ffbfa4cd4ee3f3201b96c1584261..81c2f1dbadb678907cac3cc18e7d0bb307304f00 100644 +index 3781f5bfaf4f156b7c5d383a8591e0853258a04c..3640e0d4ba4629f78a0030d132e1e1ddb1177557 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -555,6 +555,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -552,6 +552,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public io.papermc.paper.inventory.ItemRarity getItemStackRarity(org.bukkit.inventory.ItemStack itemStack) { return io.papermc.paper.inventory.ItemRarity.values()[getItem(itemStack.getType()).getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()]; } diff --git a/patches/unapplied/server/0543-Enhance-console-tab-completions-for-brigadier-comman.patch b/patches/server/0526-Enhance-console-tab-completions-for-brigadier-comman.patch similarity index 98% rename from patches/unapplied/server/0543-Enhance-console-tab-completions-for-brigadier-comman.patch rename to patches/server/0526-Enhance-console-tab-completions-for-brigadier-comman.patch index c1c74a8470..8e6ac6e4c9 100644 --- a/patches/unapplied/server/0543-Enhance-console-tab-completions-for-brigadier-comman.patch +++ b/patches/server/0526-Enhance-console-tab-completions-for-brigadier-comman.patch @@ -208,10 +208,10 @@ index 0000000000000000000000000000000000000000..dd9d77d7c7f1a5a130a1f4c15e5b1e68 + public void setErrorIndex(final int errorIndex) {} +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 2a0d3212edeee828b9fe04c153ee05ea5b0875ec..dd13627f140ab93901a32901eeb51488421ae91f 100644 +index 4b00c14332f3d514f402fc82345a02d51c3ac58a..e3eaa004ecc4ddb57be4eeb993c37a7876cd55a1 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -173,7 +173,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -186,7 +186,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface thread.setDaemon(true); thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER)); @@ -220,7 +220,7 @@ index 2a0d3212edeee828b9fe04c153ee05ea5b0875ec..dd13627f140ab93901a32901eeb51488 DedicatedServer.LOGGER.info("Starting minecraft server version {}", SharedConstants.getCurrentVersion().getName()); if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) { DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); -@@ -206,6 +206,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -219,6 +219,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface this.getPlayerList().loadAndSaveFiles(); // Must be after convertNames // Paper end - fix converting txt to json file org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread diff --git a/patches/unapplied/server/0544-Fix-PlayerItemConsumeEvent-cancelling-properly.patch b/patches/server/0527-Fix-PlayerItemConsumeEvent-cancelling-properly.patch similarity index 88% rename from patches/unapplied/server/0544-Fix-PlayerItemConsumeEvent-cancelling-properly.patch rename to patches/server/0527-Fix-PlayerItemConsumeEvent-cancelling-properly.patch index a644ea6fc4..36f12103c7 100644 --- a/patches/unapplied/server/0544-Fix-PlayerItemConsumeEvent-cancelling-properly.patch +++ b/patches/server/0527-Fix-PlayerItemConsumeEvent-cancelling-properly.patch @@ -9,10 +9,10 @@ till their item is switched. This patch clears the active item when the event is cancelled diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index d19a0733fe257eb66a02e263d4e053939f7ec978..687f379a811ba46cb3cddda33a62039b3b329cb3 100644 +index 83730b9da452d27b420770adf6ff179b936f2bbd..75ed2ed9fa3e620e48216840bafd9bcfe7123901 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3880,6 +3880,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3965,6 +3965,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.level().getCraftServer().getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/patches/server/0528-Add-bypass-host-check.patch b/patches/server/0528-Add-bypass-host-check.patch new file mode 100644 index 0000000000..8c40f13437 --- /dev/null +++ b/patches/server/0528-Add-bypass-host-check.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Sun, 18 Apr 2021 21:27:01 +0100 +Subject: [PATCH] Add bypass host check + +Paper.bypassHostCheck + +Seriously, fix your firewalls. -.- + +diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +index bcdb2cc4c735d939bdd0e9b7ec5246f51e57f299..6a33cb47c5dac403ad90ef95a56b99a6869e0459 100644 +--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +@@ -31,6 +31,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL + private static final Component IGNORE_STATUS_REASON = Component.translatable("disconnect.ignoring_status_request"); + private final MinecraftServer server; + private final Connection connection; ++ private static final boolean BYPASS_HOSTCHECK = Boolean.getBoolean("Paper.bypassHostCheck"); // Paper + + public ServerHandshakePacketListenerImpl(MinecraftServer server, Connection connection) { + this.server = server; +@@ -159,7 +160,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL + String[] split = packet.hostName().split("\00"); + if (!handledByEvent && proxyLogicEnabled) { // Paper + // if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above! +- if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { ++ if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.BYPASS_HOSTCHECK || ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { // Paper - Add bypass host check + this.connection.hostname = split[0]; + this.connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort()); + this.connection.spoofedUUID = com.mojang.util.UndashedUuid.fromStringLenient( split[2] ); diff --git a/patches/unapplied/server/0546-Set-area-affect-cloud-rotation.patch b/patches/server/0529-Set-area-affect-cloud-rotation.patch similarity index 79% rename from patches/unapplied/server/0546-Set-area-affect-cloud-rotation.patch rename to patches/server/0529-Set-area-affect-cloud-rotation.patch index 1904854b96..e78e14e0a0 100644 --- a/patches/unapplied/server/0546-Set-area-affect-cloud-rotation.patch +++ b/patches/server/0529-Set-area-affect-cloud-rotation.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Set area affect cloud rotation diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java -index c3a55347b630c57aa36f9c761e1937dc95027bb7..0aa6cd6da72c4a48d8bb48adeccc2bb49939fabd 100644 +index 3bbd314d94de3736e039b4b2d836afa8cc892511..abcfb3accb715a5a041de4b798cf3582d1fde325 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java -@@ -365,7 +365,7 @@ public final class CraftEntityTypes { +@@ -373,7 +373,7 @@ public final class CraftEntityTypes { register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new, spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null) // Paper )); - register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, spawnData -> new net.minecraft.world.entity.AreaEffectCloud(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); + register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, createAndMove(net.minecraft.world.entity.EntityType.AREA_EFFECT_CLOUD))); // Paper - set area effect cloud rotation register(new EntityTypeData<>(EntityType.EGG, Egg.class, CraftEgg::new, spawnData -> new ThrownEgg(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); - register(new EntityTypeData<>(EntityType.LEASH_HITCH, LeashHitch.class, CraftLeash::new, spawnData -> new LeashFenceKnotEntity(spawnData.minecraftWorld(), BlockPos.containing(spawnData.x(), spawnData.y(), spawnData.z())))); // SPIGOT-5732: LeashHitch has no direction and is always centered at a block + register(new EntityTypeData<>(EntityType.LEASH_KNOT, LeashHitch.class, CraftLeash::new, spawnData -> new LeashFenceKnotEntity(spawnData.minecraftWorld(), BlockPos.containing(spawnData.x(), spawnData.y(), spawnData.z())))); // SPIGOT-5732: LeashHitch has no direction and is always centered at a block register(new EntityTypeData<>(EntityType.SNOWBALL, Snowball.class, CraftSnowball::new, spawnData -> new net.minecraft.world.entity.projectile.Snowball(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); diff --git a/patches/unapplied/server/0547-add-isDeeplySleeping-to-HumanEntity.patch b/patches/server/0530-add-isDeeplySleeping-to-HumanEntity.patch similarity index 83% rename from patches/unapplied/server/0547-add-isDeeplySleeping-to-HumanEntity.patch rename to patches/server/0530-add-isDeeplySleeping-to-HumanEntity.patch index b3cc3b4e68..26e38b4777 100644 --- a/patches/unapplied/server/0547-add-isDeeplySleeping-to-HumanEntity.patch +++ b/patches/server/0530-add-isDeeplySleeping-to-HumanEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] add isDeeplySleeping to HumanEntity diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index e7726862f99cb16b7335b06675af73db773b54e8..b895b3972dc48ec91dba9d44546508badef73865 100644 +index 796945fb1a8b43987ed9f01375113b2c13ff67c0..6c500a2ccc050fc44076e443032b0ef9d87a7de8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -134,6 +134,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -132,6 +132,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } // Paper end diff --git a/patches/unapplied/server/0548-add-consumeFuel-to-FurnaceBurnEvent.patch b/patches/server/0531-add-consumeFuel-to-FurnaceBurnEvent.patch similarity index 86% rename from patches/unapplied/server/0548-add-consumeFuel-to-FurnaceBurnEvent.patch rename to patches/server/0531-add-consumeFuel-to-FurnaceBurnEvent.patch index bfdd2e8c45..2f79b2a47f 100644 --- a/patches/unapplied/server/0548-add-consumeFuel-to-FurnaceBurnEvent.patch +++ b/patches/server/0531-add-consumeFuel-to-FurnaceBurnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] add consumeFuel to FurnaceBurnEvent 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 d975e80b6a7849bcbabf20bf12f7d63ab1a6335f..c7ba7ac1a3869e4db1ef6b0350b3cab7f31a94c4 100644 +index e18ebeef377411f1e921e3d769c4a1d379a12be4..614ddebb92aba91694951fc22900fed362b3426d 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 -@@ -359,7 +359,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -364,7 +364,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit if (blockEntity.isLit() && furnaceBurnEvent.isBurning()) { // CraftBukkit end flag1 = true; diff --git a/patches/unapplied/server/0549-add-get-set-drop-chance-to-EntityEquipment.patch b/patches/server/0532-add-get-set-drop-chance-to-EntityEquipment.patch similarity index 100% rename from patches/unapplied/server/0549-add-get-set-drop-chance-to-EntityEquipment.patch rename to patches/server/0532-add-get-set-drop-chance-to-EntityEquipment.patch diff --git a/patches/unapplied/server/0550-fix-PigZombieAngerEvent-cancellation.patch b/patches/server/0533-fix-PigZombieAngerEvent-cancellation.patch similarity index 81% rename from patches/unapplied/server/0550-fix-PigZombieAngerEvent-cancellation.patch rename to patches/server/0533-fix-PigZombieAngerEvent-cancellation.patch index 8b29ccdead..ad3619023e 100644 --- a/patches/unapplied/server/0550-fix-PigZombieAngerEvent-cancellation.patch +++ b/patches/server/0533-fix-PigZombieAngerEvent-cancellation.patch @@ -5,18 +5,18 @@ Subject: [PATCH] fix PigZombieAngerEvent cancellation diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java -index 7e703bf1ca3cf824b06b6be731b866cd407aaff1..fbabbd0808304f5d0d12f987d00c9e43a89fb1c9 100644 +index 6db402d0c515956af8a2462a2461fac783f0c1e2..a6def4133f06c41be287e9942643e80a7b8e8218 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java -@@ -57,6 +57,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -55,6 +55,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { + private static final int ALERT_RANGE_Y = 10; + private static final UniformInt ALERT_INTERVAL = TimeUtil.rangeOfSeconds(4, 6); private int ticksUntilNextAlert; - private static final float ZOMBIFIED_PIGLIN_EYE_HEIGHT = 1.79F; - private static final float ZOMBIFIED_PIGLIN_BABY_EYE_HEIGHT_ADJUSTMENT = 0.82F; + private HurtByTargetGoal pathfinderGoalHurtByTarget; // Paper - fix PigZombieAngerEvent cancellation public ZombifiedPiglin(EntityType type, Level world) { super(type, world); -@@ -72,7 +73,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -70,7 +71,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 7e703bf1ca3cf824b06b6be731b866cd407aaff1..fbabbd0808304f5d0d12f987d00c9e43 this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt)); this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true)); } -@@ -180,6 +181,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -178,6 +179,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/0551-fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/0534-fix-PlayerItemHeldEvent-firing-twice.patch similarity index 88% rename from patches/unapplied/server/0551-fix-PlayerItemHeldEvent-firing-twice.patch rename to patches/server/0534-fix-PlayerItemHeldEvent-firing-twice.patch index 91ef3ef252..7f2cc5554a 100644 --- a/patches/unapplied/server/0551-fix-PlayerItemHeldEvent-firing-twice.patch +++ b/patches/server/0534-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 6225499d926c0d83ea1cfd07a0340677a05a64e1..d0409856a3aee811714c9254f4436b7f6bb94bf0 100644 +index f1bdea575fbc52929076e5adea94af51f1f603ec..67727392a03cfad851f5092bbd4801c667a017f5 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1921,6 +1921,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1923,6 +1923,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/0552-Add-PlayerDeepSleepEvent.patch b/patches/server/0535-Add-PlayerDeepSleepEvent.patch similarity index 86% rename from patches/unapplied/server/0552-Add-PlayerDeepSleepEvent.patch rename to patches/server/0535-Add-PlayerDeepSleepEvent.patch index 4ae6ac9026..638530f645 100644 --- a/patches/unapplied/server/0552-Add-PlayerDeepSleepEvent.patch +++ b/patches/server/0535-Add-PlayerDeepSleepEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add 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 6fe21c29aa9d119490fbf1d69eb03c146674cde5..8ab62f37c9e1eb1582fba4adc02c3404bebc80f4 100644 +index ecae1708feee507df1440ad2822e7af8c3c278de..1f4351c1701465a3b5dfcb8d61aa5035956bbd42 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -248,6 +248,13 @@ public abstract class Player extends LivingEntity { +@@ -260,6 +260,13 @@ public abstract class Player extends LivingEntity { if (this.isSleeping()) { ++this.sleepCounter; diff --git a/patches/unapplied/server/0553-More-World-API.patch b/patches/server/0536-More-World-API.patch similarity index 95% rename from patches/unapplied/server/0553-More-World-API.patch rename to patches/server/0536-More-World-API.patch index 3090623a76..e97d494494 100644 --- a/patches/unapplied/server/0553-More-World-API.patch +++ b/patches/server/0536-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 3893b70926140f3658f6bab68c5c4f7c41dc603a..fc117c5c3ab09c24600fdbdbff56356e7ad64473 100644 +index 4a51d0125d59b1edd2da7aac1db1ca49374c008c..20c1e6f485a4067b04e39479ae2b122332c94c27 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2130,6 +2130,53 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2128,6 +2128,53 @@ public class CraftWorld extends CraftRegionAccessor implements World { return new CraftStructureSearchResult(CraftStructure.minecraftToBukkit(found.getSecond().value()), CraftLocation.toBukkit(found.getFirst(), this)); } diff --git a/patches/unapplied/server/0554-Add-PlayerBedFailEnterEvent.patch b/patches/server/0537-Add-PlayerBedFailEnterEvent.patch similarity index 94% rename from patches/unapplied/server/0554-Add-PlayerBedFailEnterEvent.patch rename to patches/server/0537-Add-PlayerBedFailEnterEvent.patch index 945dacae7c..aff72983ac 100644 --- a/patches/unapplied/server/0554-Add-PlayerBedFailEnterEvent.patch +++ b/patches/server/0537-Add-PlayerBedFailEnterEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerBedFailEnterEvent diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java -index 77438ea56b83f6aecd5f9acb9c55d4cd6e86ff95..c5d892950b4027cf9879eafc1c0f4e4c62fb4f51 100644 +index 68326d7c3bd14e5a66971f34e6ec8ec8e93b728a..03035ed3df2f32e14a8eb9bc3d536ef64b5d87ba 100644 --- a/src/main/java/net/minecraft/world/level/block/BedBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java -@@ -119,14 +119,23 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -118,14 +118,23 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock BlockPos finalblockposition = pos; // CraftBukkit end player.startSleepInBed(pos).ifLeft((entityhuman_enumbedresult) -> { diff --git a/patches/unapplied/server/0555-Implement-methods-to-convert-between-Component-and-B.patch b/patches/server/0538-Implement-methods-to-convert-between-Component-and-B.patch similarity index 94% rename from patches/unapplied/server/0555-Implement-methods-to-convert-between-Component-and-B.patch rename to patches/server/0538-Implement-methods-to-convert-between-Component-and-B.patch index ebc86dc755..fc7d02c151 100644 --- a/patches/unapplied/server/0555-Implement-methods-to-convert-between-Component-and-B.patch +++ b/patches/server/0538-Implement-methods-to-convert-between-Component-and-B.patch @@ -42,10 +42,10 @@ index 0000000000000000000000000000000000000000..dd6012b6a097575b2d1471be5069ecce + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index dd13627f140ab93901a32901eeb51488421ae91f..a78b14b828526549e1309e94c271667043129a87 100644 +index e3eaa004ecc4ddb57be4eeb993c37a7876cd55a1..5d62639b18d0bf8f5f7c8adc3470a6087980241b 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -210,6 +210,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -223,6 +223,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now diff --git a/patches/unapplied/server/0556-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch b/patches/server/0539-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch similarity index 89% rename from patches/unapplied/server/0556-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch rename to patches/server/0539-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch index 4fa56f22b6..d67b68a9ef 100644 --- a/patches/unapplied/server/0556-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch +++ b/patches/server/0539-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expand PlayerRespawnEvent, fix passed parameter issues Co-authored-by: Jake Potrebic diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index d0409856a3aee811714c9254f4436b7f6bb94bf0..872e59c5de3a98bbdf40cf6d2aeb0694f2b88689 100644 +index 67727392a03cfad851f5092bbd4801c667a017f5..801b0e027d1034bb343fb1c176cfa1174e4ff8b9 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2632,7 +2632,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2716,7 +2716,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl case PERFORM_RESPAWN: if (this.player.wonGame) { this.player.wonGame = false; @@ -19,10 +19,10 @@ index d0409856a3aee811714c9254f4436b7f6bb94bf0..872e59c5de3a98bbdf40cf6d2aeb0694 } 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 563e287cfb885f212ebe9dfc8309aa123713897a..e913acef00c0a1a2f49779800b46997588b46253 100644 +index dd02a271ca6b642ce8567d492c57faf6d9bcf146..454abe63a51e6d39a672778382842bdddeba3d9b 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -780,6 +780,12 @@ public abstract class PlayerList { +@@ -779,6 +779,12 @@ public abstract class PlayerList { } public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason) { @@ -35,7 +35,7 @@ index 563e287cfb885f212ebe9dfc8309aa123713897a..e913acef00c0a1a2f49779800b469975 entityplayer.stopRiding(); // CraftBukkit this.players.remove(entityplayer); this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot -@@ -821,6 +827,7 @@ public abstract class PlayerList { +@@ -820,6 +826,7 @@ public abstract class PlayerList { // Paper start - Add PlayerPostRespawnEvent boolean isBedSpawn = false; @@ -43,7 +43,7 @@ index 563e287cfb885f212ebe9dfc8309aa123713897a..e913acef00c0a1a2f49779800b469975 boolean isRespawn = false; boolean isLocAltered = false; // Paper - Fix SPIGOT-5989 // Paper end - Add PlayerPostRespawnEvent -@@ -841,6 +848,7 @@ public abstract class PlayerList { +@@ -840,6 +847,7 @@ public abstract class PlayerList { if (optional.isPresent()) { BlockState iblockdata = worldserver1.getBlockState(blockposition); boolean flag3 = iblockdata.is(Blocks.RESPAWN_ANCHOR); @@ -51,7 +51,7 @@ index 563e287cfb885f212ebe9dfc8309aa123713897a..e913acef00c0a1a2f49779800b469975 Vec3 vec3d = (Vec3) optional.get(); float f1; -@@ -869,7 +877,7 @@ public abstract class PlayerList { +@@ -868,7 +876,7 @@ public abstract class PlayerList { } Player respawnPlayer = entityplayer1.getBukkitEntity(); diff --git a/patches/unapplied/server/0557-Introduce-beacon-activation-deactivation-events.patch b/patches/server/0540-Introduce-beacon-activation-deactivation-events.patch similarity index 89% rename from patches/unapplied/server/0557-Introduce-beacon-activation-deactivation-events.patch rename to patches/server/0540-Introduce-beacon-activation-deactivation-events.patch index f793b533a2..e230faa779 100644 --- a/patches/unapplied/server/0557-Introduce-beacon-activation-deactivation-events.patch +++ b/patches/server/0540-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 49f25826aea528d9da085b9e65cb4c85cd78c415..61a618f09af475407a78343eecb4352052b1df1e 100644 +index 32a242d4b67b4edbc1996fa64a151dc60e7e996e..7cec5aeee93e4fb14d403559293ec3c9be7955a6 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 -@@ -221,6 +221,15 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -225,6 +225,15 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name BeaconBlockEntity.playSound(world, pos, SoundEvents.BEACON_AMBIENT); } } @@ -24,7 +24,7 @@ index 49f25826aea528d9da085b9e65cb4c85cd78c415..61a618f09af475407a78343eecb43520 if (blockEntity.lastCheckY >= l) { blockEntity.lastCheckY = world.getMinBuildHeight() - 1; -@@ -278,6 +287,10 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -282,6 +291,10 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @Override public void setRemoved() { diff --git a/patches/unapplied/server/0558-Add-Channel-initialization-listeners.patch b/patches/server/0541-Add-Channel-initialization-listeners.patch similarity index 92% rename from patches/unapplied/server/0558-Add-Channel-initialization-listeners.patch rename to patches/server/0541-Add-Channel-initialization-listeners.patch index 51eee16dd9..8b6d7c3c06 100644 --- a/patches/unapplied/server/0558-Add-Channel-initialization-listeners.patch +++ b/patches/server/0541-Add-Channel-initialization-listeners.patch @@ -122,18 +122,18 @@ 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 ddc84de84c8a503a01e40c42fe83558af7159f8f..37b16918451859c22f92bcbcbce05c16b8beff75 100644 +index fe89e8f509f3972ceb71c9aa6277524baa39985b..6c30eb3750f434341ecec0bf8e9054bb331f9757 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -633,6 +633,7 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -668,6 +668,7 @@ public class Connection extends SimpleChannelInboundHandler> { } else { - this.channel.pipeline().addBefore("encoder", "compress", new CompressionEncoder(compressionThreshold)); + this.channel.pipeline().addAfter("prepender", "compress", new CompressionEncoder(compressionThreshold)); } + this.channel.pipeline().fireUserEventTriggered(io.papermc.paper.network.ConnectionEvent.COMPRESSION_THRESHOLD_SET); // Paper - Add Channel initialization listeners } else { if (this.channel.pipeline().get("decompress") instanceof CompressionDecoder) { this.channel.pipeline().remove("decompress"); -@@ -641,6 +642,7 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -676,6 +677,7 @@ public class Connection extends SimpleChannelInboundHandler> { if (this.channel.pipeline().get("compress") instanceof CompressionEncoder) { this.channel.pipeline().remove("compress"); } @@ -142,10 +142,10 @@ index ddc84de84c8a503a01e40c42fe83558af7159f8f..37b16918451859c22f92bcbcbce05c16 } diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java -index 3b6bafb242d2623c15f26acdacd036478c7dc214..25ddfe8e5da65e4ac70be2820ba139e7f3852c0c 100644 +index 64119f2188f8958b8a5913fec82ac5bba1b74b2a..d6d7f1c446ba5507f67038ff27775ba75156f4a7 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 { +@@ -115,6 +115,7 @@ public class ServerConnectionListener { pending.add(object); // Paper - prevent blocking on adding a new connection while the server is ticking ((Connection) object).configurePacketHandler(channelpipeline); ((Connection) object).setListenerForServerboundHandshake(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object)); diff --git a/patches/unapplied/server/0559-Send-empty-commands-if-tab-completion-is-disabled.patch b/patches/server/0542-Send-empty-commands-if-tab-completion-is-disabled.patch similarity index 88% rename from patches/unapplied/server/0559-Send-empty-commands-if-tab-completion-is-disabled.patch rename to patches/server/0542-Send-empty-commands-if-tab-completion-is-disabled.patch index f385186300..d414ea5eae 100644 --- a/patches/unapplied/server/0559-Send-empty-commands-if-tab-completion-is-disabled.patch +++ b/patches/server/0542-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 0741c0f85536c5188d8552e999943a9c771a548e..c11977dceeba4120cdb63972c4ec486640d8114e 100644 +index 83091987b320171ef9071cbef6b10a1bd72d38e2..8bc9da1a23a7bac65557114171f2f9391b0a32b0 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -455,7 +455,12 @@ public class Commands { +@@ -458,7 +458,12 @@ public class Commands { } public void sendCommands(ServerPlayer player) { diff --git a/patches/unapplied/server/0560-Add-more-WanderingTrader-API.patch b/patches/server/0543-Add-more-WanderingTrader-API.patch similarity index 93% rename from patches/unapplied/server/0560-Add-more-WanderingTrader-API.patch rename to patches/server/0543-Add-more-WanderingTrader-API.patch index 6e3c9d60f5..07cdb98c54 100644 --- a/patches/unapplied/server/0560-Add-more-WanderingTrader-API.patch +++ b/patches/server/0543-Add-more-WanderingTrader-API.patch @@ -5,7 +5,7 @@ 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 6b8d6ae203b7f7f2b591c35586baa4e8951a3677..9b0f54af3160c5756784e31cf1347eb97ca77e47 100644 +index 057eca881d279c610e933ebff5fb654625b036be..63189d6325173a42b619907b44a426848fbc6988 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java @@ -61,6 +61,10 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill @@ -22,7 +22,7 @@ index 6b8d6ae203b7f7f2b591c35586baa4e8951a3677..9b0f54af3160c5756784e31cf1347eb9 @@ -71,10 +75,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) -> { + this.goalSelector.addGoal(0, new UseItemGoal<>(this, PotionContents.createItemStack(Items.POTION, Potions.INVISIBILITY), SoundEvents.WANDERING_TRADER_DISAPPEARED, (entityvillagertrader) -> { - return this.level().isNight() && !entityvillagertrader.isInvisible(); + return this.canDrinkPotion && this.level().isNight() && !entityvillagertrader.isInvisible(); // Paper - Add more WanderingTrader API })); diff --git a/patches/unapplied/server/0561-Add-EntityBlockStorage-clearEntities.patch b/patches/server/0544-Add-EntityBlockStorage-clearEntities.patch similarity index 77% rename from patches/unapplied/server/0561-Add-EntityBlockStorage-clearEntities.patch rename to patches/server/0544-Add-EntityBlockStorage-clearEntities.patch index 1297267437..e52d1c5e1c 100644 --- a/patches/unapplied/server/0561-Add-EntityBlockStorage-clearEntities.patch +++ b/patches/server/0544-Add-EntityBlockStorage-clearEntities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityBlockStorage#clearEntities() diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -index b0c57922fa6160772ba1aaf61c0e97c03a0e6e8c..a69a81ba6a2b65978b5cf00810ed12156a5f89e6 100644 +index 344b18127d3e8c7408a162cc85287382bdfdda9a..b18494d2a83473e9bc4197f86ff599de59043217 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -@@ -143,6 +143,11 @@ public class BeehiveBlockEntity extends BlockEntity { +@@ -151,6 +151,11 @@ public class BeehiveBlockEntity extends BlockEntity { return this.stored.size(); } @@ -21,12 +21,12 @@ index b0c57922fa6160772ba1aaf61c0e97c03a0e6e8c..a69a81ba6a2b65978b5cf00810ed1215 return (Integer) state.getValue(BeehiveBlock.HONEY_LEVEL); } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java -index 54fd63a9293c9d6a444a184be1dc08e4bd948a10..2e51fab98d95c93d2095f7be6dbb5d5474158bfb 100644 +index fbacbef0dd51037fa0af56fedeea50a5c7bed8c7..1a2a05160ba51d9c75f1ae6ae61d944d81428722 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java -@@ -90,4 +90,11 @@ public class CraftBeehive extends CraftBlockEntityState impl - public CraftBeehive copy() { - return new CraftBeehive(this); +@@ -95,4 +95,11 @@ public class CraftBeehive extends CraftBlockEntityState impl + public CraftBeehive copy(Location location) { + return new CraftBeehive(this, location); } + + // Paper start - Add EntityBlockStorage clearEntities diff --git a/patches/unapplied/server/0562-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch b/patches/server/0545-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch similarity index 96% rename from patches/unapplied/server/0562-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch rename to patches/server/0545-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch index 4a803357b6..839c465c9c 100644 --- a/patches/unapplied/server/0562-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch +++ b/patches/server/0545-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch @@ -5,7 +5,7 @@ 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 6e0073a54f59621d8adb4e8a70e6c89c708eabba..24e5993b281448734eb67c7a8439a349bbf9fd72 100644 +index f46fa0fbfec19904d21729847788c6c624a3e97f..c7e1f2bac3eca9bb72bf1f8c26cccb2905e1ddfc 100644 --- a/src/main/java/net/minecraft/server/PlayerAdvancements.java +++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java @@ -236,11 +236,21 @@ public class PlayerAdvancements { diff --git a/patches/unapplied/server/0563-Add-HiddenPotionEffect-API.patch b/patches/server/0546-Add-HiddenPotionEffect-API.patch similarity index 78% rename from patches/unapplied/server/0563-Add-HiddenPotionEffect-API.patch rename to patches/server/0546-Add-HiddenPotionEffect-API.patch index 5f9960d071..724bbc9ff5 100644 --- a/patches/unapplied/server/0563-Add-HiddenPotionEffect-API.patch +++ b/patches/server/0546-Add-HiddenPotionEffect-API.patch @@ -7,18 +7,18 @@ Subject: [PATCH] Add HiddenPotionEffect API public net.minecraft.world.effect.MobEffectInstance hiddenEffect diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java -index 844fb8c662a409670f631228f687d85c5436d3dd..e938255fcc5db0c289d3e132175a541187e4a748 100644 +index 068a9b2d7b6895f14077d9647a8c9fed3e3d3ade..14c58cf8d255c51473fd3d0092faeaf5a3c1ae0c 100644 --- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java +++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java -@@ -73,6 +73,7 @@ public class CraftPotionUtil { +@@ -10,6 +10,7 @@ public class CraftPotionUtil { public static MobEffectInstance fromBukkit(PotionEffect effect) { - MobEffect type = CraftPotionEffectType.bukkitToMinecraft(effect.getType()); + Holder type = CraftPotionEffectType.bukkitToMinecraftHolder(effect.getType()); + // Paper - Note: do not copy over the hidden effect, as this method is only used for applying to entities which we do not want to convert over. return new MobEffectInstance(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon()); // Paper } -@@ -82,7 +83,7 @@ public class CraftPotionUtil { +@@ -19,7 +20,7 @@ public class CraftPotionUtil { int duration = effect.getDuration(); boolean ambient = effect.isAmbient(); boolean particles = effect.isVisible(); @@ -26,4 +26,4 @@ index 844fb8c662a409670f631228f687d85c5436d3dd..e938255fcc5db0c289d3e132175a5411 + return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon(), effect.hiddenEffect == null ? null : toBukkit(effect.hiddenEffect)); // Paper } - public static boolean equals(MobEffect mobEffect, PotionEffectType type) { + public static boolean equals(Holder mobEffect, PotionEffectType type) { diff --git a/patches/unapplied/server/0564-Inventory-close.patch b/patches/server/0547-Inventory-close.patch similarity index 100% rename from patches/unapplied/server/0564-Inventory-close.patch rename to patches/server/0547-Inventory-close.patch diff --git a/patches/unapplied/server/0565-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch b/patches/server/0548-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch similarity index 87% rename from patches/unapplied/server/0565-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch rename to patches/server/0548-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch index 1d2850637b..950600a9e0 100644 --- a/patches/unapplied/server/0565-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch +++ b/patches/server/0548-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch @@ -6,12 +6,12 @@ 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 117d466e1b4f545f6fd5006c3822c5586db96032..40664cc7e3665432a2ab5e552802c3fc3edbdb22 100644 +index 7013f1b76311a11fb7e2543ab1e792479ecad610..87ada535362303097862e811d3d573997983064f 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 - return MobType.UNDEAD; - } +@@ -92,9 +92,15 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo + + abstract SoundEvent getStepSound(); + // Paper start - shouldBurnInDay API + private boolean shouldBurnInDay = true; @@ -48,19 +48,19 @@ index 117d466e1b4f545f6fd5006c3822c5586db96032..40664cc7e3665432a2ab5e552802c3fc @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 ea980c2fdf01988ba25bffc7f8963d775101bee1..187037c43ebb5b245ffa4b50163d443490668744 100644 +index ac119e2efff7ba3c32425783ffcf4b3c44156f27..68f8945292753535a3b73acb9f48c1594f0789a4 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java +++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java -@@ -145,7 +145,7 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -138,7 +138,7 @@ public class Phantom extends FlyingMob implements Enemy { @Override public void aiStep() { - if (this.isAlive() && this.isSunBurnTick()) { -+ if (this.isAlive() && shouldBurnInDay && this.isSunBurnTick()) { // Paper - shouldBurnInDay API - this.setSecondsOnFire(8); ++ if (this.isAlive() && this.shouldBurnInDay && this.isSunBurnTick()) { // Paper - shouldBurnInDay API + this.igniteForSeconds(8); } -@@ -176,6 +176,9 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -169,6 +169,9 @@ public class Phantom extends FlyingMob implements Enemy { if (nbt.hasUUID("Paper.SpawningEntity")) { this.spawningEntity = nbt.getUUID("Paper.SpawningEntity"); } @@ -70,7 +70,7 @@ index ea980c2fdf01988ba25bffc7f8963d775101bee1..187037c43ebb5b245ffa4b50163d4434 // Paper end } -@@ -190,6 +193,7 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -183,6 +186,7 @@ public class Phantom extends FlyingMob implements Enemy { if (this.spawningEntity != null) { nbt.putUUID("Paper.SpawningEntity", this.spawningEntity); } @@ -78,16 +78,16 @@ index ea980c2fdf01988ba25bffc7f8963d775101bee1..187037c43ebb5b245ffa4b50163d4434 // Paper end } -@@ -258,6 +262,9 @@ public class Phantom extends FlyingMob implements Enemy { - return spawningEntity; +@@ -238,6 +242,9 @@ public class Phantom extends FlyingMob implements Enemy { + return this.spawningEntity; } public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; } + private boolean shouldBurnInDay = true; + public boolean shouldBurnInDay() { return shouldBurnInDay; } + public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; } // Paper end - private static enum AttackPhase { + private static enum AttackPhase { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractSkeleton.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractSkeleton.java index 5ff566186431440c25a26900aba14e4adb642031..5beaa2bb0d58fe477ce8d2de8b77600d3b416d8c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractSkeleton.java diff --git a/patches/unapplied/server/0566-Add-basic-Datapack-API.patch b/patches/server/0549-Add-basic-Datapack-API.patch similarity index 95% rename from patches/unapplied/server/0566-Add-basic-Datapack-API.patch rename to patches/server/0549-Add-basic-Datapack-API.patch index 93aebb5a94..e53f421ee9 100644 --- a/patches/unapplied/server/0566-Add-basic-Datapack-API.patch +++ b/patches/server/0549-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 b453673f7bab09a1b10898a7d1f85d133e63ac72..236e73eed6caac7f98236ca418185a143f78c5fa 100644 +index 6debfd5866d4411ef8d51995bd07a0e2ece781b3..507cad6ef11603924389956305908fd157043178 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -303,6 +303,7 @@ public final class CraftServer implements Server { +@@ -305,6 +305,7 @@ public final class CraftServer implements Server { public boolean ignoreVanillaPermissions = false; private final List playerView; public int reloadCount; @@ -111,7 +111,7 @@ index b453673f7bab09a1b10898a7d1f85d133e63ac72..236e73eed6caac7f98236ca418185a14 } public boolean getCommandBlockOverride(String command) { -@@ -2957,5 +2959,11 @@ public final class CraftServer implements Server { +@@ -2976,5 +2978,11 @@ public final class CraftServer implements Server { public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() { return mobGoals; } diff --git a/patches/unapplied/server/0567-Add-environment-variable-to-disable-server-gui.patch b/patches/server/0550-Add-environment-variable-to-disable-server-gui.patch similarity index 74% rename from patches/unapplied/server/0567-Add-environment-variable-to-disable-server-gui.patch rename to patches/server/0550-Add-environment-variable-to-disable-server-gui.patch index 787ab50918..e4de8ec477 100644 --- a/patches/unapplied/server/0567-Add-environment-variable-to-disable-server-gui.patch +++ b/patches/server/0550-Add-environment-variable-to-disable-server-gui.patch @@ -5,14 +5,14 @@ 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 4e3001d46340cc18108683c024f6ebe12266dd32..d3b1fa89c1ae96abebfc0a792f2bc592de05443f 100644 +index ded1b7ab4ca1ae3a2d799fe31d05bd6a0c27dcb7..467b8ca8007c5d3a7b72b88e3a979bdf09f1a283 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -314,6 +314,7 @@ public class Main { +@@ -318,6 +318,7 @@ public class Main { */ - boolean flag1 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui"); + boolean flag2 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui"); + if(!Boolean.parseBoolean(System.getenv().getOrDefault("PAPER_DISABLE_SERVER_GUI", String.valueOf(false)))) // Paper - Add environment variable to disable server gui - if (flag1 && !GraphicsEnvironment.isHeadless()) { + if (flag2 && !GraphicsEnvironment.isHeadless()) { dedicatedserver1.showGui(); } diff --git a/patches/unapplied/server/0568-Expand-PlayerGameModeChangeEvent.patch b/patches/server/0551-Expand-PlayerGameModeChangeEvent.patch similarity index 89% rename from patches/unapplied/server/0568-Expand-PlayerGameModeChangeEvent.patch rename to patches/server/0551-Expand-PlayerGameModeChangeEvent.patch index 369bfda4fb..6242e14495 100644 --- a/patches/unapplied/server/0568-Expand-PlayerGameModeChangeEvent.patch +++ b/patches/server/0551-Expand-PlayerGameModeChangeEvent.patch @@ -45,10 +45,10 @@ index 7f09119bc7d661e08a960dd2bd46006efe752d3e..d1da3600dc07107309b20ebe6e7c0c4d } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 19baf0ecd04ae058fac709889db34bf27679ab5e..28baa63b9b750a7f03da364d9c1fe691d3ce1706 100644 +index 2db78d991ef0595a0d8806414a959479e289c0fc..50c6b668a8e915081007dfd9c9fc1aae179e16c9 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1940,8 +1940,16 @@ public class ServerPlayer extends Player { +@@ -2024,8 +2024,16 @@ public class ServerPlayer extends Player { } public boolean setGameMode(GameType gameMode) { @@ -67,7 +67,7 @@ index 19baf0ecd04ae058fac709889db34bf27679ab5e..28baa63b9b750a7f03da364d9c1fe691 } else { this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.CHANGE_GAME_MODE, (float) gameMode.getId())); if (gameMode == GameType.SPECTATOR) { -@@ -1953,7 +1961,7 @@ public class ServerPlayer extends Player { +@@ -2037,7 +2045,7 @@ public class ServerPlayer extends Player { this.onUpdateAbilities(); this.updateEffectVisibility(); @@ -76,7 +76,7 @@ index 19baf0ecd04ae058fac709889db34bf27679ab5e..28baa63b9b750a7f03da364d9c1fe691 } } -@@ -2365,6 +2373,16 @@ public class ServerPlayer extends Player { +@@ -2447,6 +2455,16 @@ public class ServerPlayer extends Player { } public void loadGameTypes(@Nullable CompoundTag nbt) { @@ -94,10 +94,10 @@ index 19baf0ecd04ae058fac709889db34bf27679ab5e..28baa63b9b750a7f03da364d9c1fe691 } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index a03d1a85019afdc42de2b8449fc38384c4dac51e..4fe571915b247ec612b2376dce57991e441f63c2 100644 +index 486d9c4dbe3ee23198eba7f34ea8b5f4e9048c0b..f080322bc766361b9d2d8b1214c3dff1c3df9ae8 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 { +@@ -72,14 +72,21 @@ public class ServerPlayerGameMode { } public boolean changeGameModeForPlayer(GameType gameMode) { @@ -122,19 +122,20 @@ index a03d1a85019afdc42de2b8449fc38384c4dac51e..4fe571915b247ec612b2376dce57991e } // CraftBukkit end this.setGameModeForPlayer(gameMode, this.previousGameModeForPlayer); - this.player.onUpdateAbilities(); - this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit - this.level.updateSleepingPlayerList(); +@@ -90,7 +97,7 @@ public class ServerPlayerGameMode { + this.player.resetCurrentImpulseContext(); + } + - return true; + return event; // Paper - Expand PlayerGameModeChangeEvent } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 872e59c5de3a98bbdf40cf6d2aeb0694f2b88689..77560a31fc90387efb14ae0432b7a6aafb8cab61 100644 +index 801b0e027d1034bb343fb1c176cfa1174e4ff8b9..fadcba80fb2f852e1d8356127195648950615c65 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2641,7 +2641,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2725,7 +2725,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player = this.server.getPlayerList().respawn(this.player, false, RespawnReason.DEATH); if (this.server.isHardcore()) { @@ -144,10 +145,10 @@ index 872e59c5de3a98bbdf40cf6d2aeb0694f2b88689..77560a31fc90387efb14ae0432b7a6aa } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 79a57bafc3b99e58f435bacbc65b9fd4c4c80b8a..7212d6f8fc7653983aa66d3731d7559a24b026ba 100644 +index 0cfc8b5faa56ae2a3dd94c5dbcb22a7e208b38bd..e38d8d7e4c114fa00dbc30ce409991d8ec8c8975 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1564,7 +1564,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1640,7 +1640,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/0569-ItemStack-repair-check-API.patch b/patches/server/0552-ItemStack-repair-check-API.patch similarity index 95% rename from patches/unapplied/server/0569-ItemStack-repair-check-API.patch rename to patches/server/0552-ItemStack-repair-check-API.patch index 63cbb56089..044b285c4b 100644 --- a/patches/unapplied/server/0569-ItemStack-repair-check-API.patch +++ b/patches/server/0552-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 81c2f1dbadb678907cac3cc18e7d0bb307304f00..79977c677b4348bbfc8dcd4cb5e4c01c6fceb354 100644 +index 3640e0d4ba4629f78a0030d132e1e1ddb1177557..a82f21809b14d36fd8e440dcc7fd11f57cdbd3dc 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -556,6 +556,14 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -553,6 +553,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/0570-More-Enchantment-API.patch b/patches/server/0553-More-Enchantment-API.patch similarity index 94% rename from patches/unapplied/server/0570-More-Enchantment-API.patch rename to patches/server/0553-More-Enchantment-API.patch index c2c88eec8b..02483779b4 100644 --- a/patches/unapplied/server/0570-More-Enchantment-API.patch +++ b/patches/server/0553-More-Enchantment-API.patch @@ -9,10 +9,10 @@ public net.minecraft.world.item.enchantment.Enchantment slots Co-authored-by: Luis diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -index 3feaaca5aaee12e48fa2e5f5d05329c9980b161e..a151b5d7c6e41b08e57c806bc43e067af48263ed 100644 +index bb8a3e670924ebcce48669c5dce57e2df03fad77..5b6490786a7670a836fbf0a99545f77ae04771a6 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -@@ -81,7 +81,7 @@ public class CraftEnchantment extends Enchantment implements Handleable -Date: Thu, 27 Aug 2020 15:02:48 -0400 -Subject: [PATCH] Add PlayerShearBlockEvent - - -diff --git a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java -index 44e72176a0da08a77fa192ee31c0fcd53f0dc22d..27f1c1ac12251f1438ee8bf14f4afb5fe601138f 100644 ---- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java -@@ -127,7 +127,7 @@ public class BeehiveBlock extends BaseEntityBlock { - } - - public static void dropHoneycomb(Level world, BlockPos pos) { -- popResource(world, pos, new ItemStack(Items.HONEYCOMB, 3)); -+ popResource(world, pos, new ItemStack(Items.HONEYCOMB, 3)); // Paper - Add PlayerShearBlockEvent; conflict on change, item needs to be set below - } - - @Override -@@ -140,8 +140,19 @@ public class BeehiveBlock extends BaseEntityBlock { - Item item = itemstack.getItem(); - - if (itemstack.is(Items.SHEARS)) { -+ // Paper start - Add PlayerShearBlockEvent -+ io.papermc.paper.event.block.PlayerShearBlockEvent event = new io.papermc.paper.event.block.PlayerShearBlockEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand), new java.util.ArrayList<>()); -+ event.getDrops().add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(new ItemStack(Items.HONEYCOMB, 3))); -+ if (!event.callEvent()) { -+ return InteractionResult.PASS; -+ } -+ // Paper end - world.playSound(player, player.getX(), player.getY(), player.getZ(), SoundEvents.BEEHIVE_SHEAR, SoundSource.BLOCKS, 1.0F, 1.0F); -- BeehiveBlock.dropHoneycomb(world, pos); -+ // Paper start - Add PlayerShearBlockEvent -+ for (org.bukkit.inventory.ItemStack itemDrop : event.getDrops()) { -+ popResource(world, pos, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(itemDrop)); -+ } -+ // Paper end - Add PlayerShearBlockEvent - itemstack.hurtAndBreak(1, player, (entityhuman1) -> { - entityhuman1.broadcastBreakEvent(hand); - }); -diff --git a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java -index c0098fe96201bfc448e7d2e3d672c310c9c9e75a..966783c646dae5a79259c1a322a9cfc8dd83d997 100644 ---- a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java -@@ -35,16 +35,24 @@ public class PumpkinBlock extends Block { - ItemStack itemStack = player.getItemInHand(hand); - if (itemStack.is(Items.SHEARS)) { - if (!world.isClientSide) { -+ // Paper start - Add PlayerShearBlockEvent -+ io.papermc.paper.event.block.PlayerShearBlockEvent event = new io.papermc.paper.event.block.PlayerShearBlockEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand), new java.util.ArrayList<>()); -+ event.getDrops().add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(new ItemStack(Items.PUMPKIN_SEEDS, 4))); -+ if (!event.callEvent()) { -+ return InteractionResult.PASS; -+ } -+ // Paper end - Add PlayerShearBlockEvent - Direction direction = hit.getDirection(); - Direction direction2 = direction.getAxis() == Direction.Axis.Y ? player.getDirection().getOpposite() : direction; - world.playSound(null, pos, SoundEvents.PUMPKIN_CARVE, SoundSource.BLOCKS, 1.0F, 1.0F); - world.setBlock(pos, Blocks.CARVED_PUMPKIN.defaultBlockState().setValue(CarvedPumpkinBlock.FACING, direction2), 11); -+ for (org.bukkit.inventory.ItemStack item : event.getDrops()) { // Paper - Add PlayerShearBlockEvent - ItemEntity itemEntity = new ItemEntity( - world, - (double)pos.getX() + 0.5 + (double)direction2.getStepX() * 0.65, - (double)pos.getY() + 0.1, - (double)pos.getZ() + 0.5 + (double)direction2.getStepZ() * 0.65, -- new ItemStack(Items.PUMPKIN_SEEDS, 4) -+ org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(item) // Paper - Add PlayerShearBlockEvent - ); - itemEntity.setDeltaMovement( - 0.05 * (double)direction2.getStepX() + world.random.nextDouble() * 0.02, -@@ -52,6 +60,7 @@ public class PumpkinBlock extends Block { - 0.05 * (double)direction2.getStepZ() + world.random.nextDouble() * 0.02 - ); - world.addFreshEntity(itemEntity); -+ } // Paper - Add PlayerShearBlockEvent - itemStack.hurtAndBreak(1, player, playerx -> playerx.broadcastBreakEvent(hand)); - world.gameEvent(player, GameEvent.SHEAR, pos); - player.awardStat(Stats.ITEM_USED.get(Items.SHEARS)); diff --git a/patches/unapplied/server/0489-Add-PlayerFlowerPotManipulateEvent.patch b/patches/unapplied/server/0489-Add-PlayerFlowerPotManipulateEvent.patch deleted file mode 100644 index ba8831c6f6..0000000000 --- a/patches/unapplied/server/0489-Add-PlayerFlowerPotManipulateEvent.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MisterVector -Date: Tue, 13 Aug 2019 19:45:06 -0700 -Subject: [PATCH] Add PlayerFlowerPotManipulateEvent - - -diff --git a/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java b/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java -index cb77c7af329dd9fa8dc28ee3cfc475baa4b1392b..8e8fa6e0823258220b604ceef8e1f5ae15556b9a 100644 ---- a/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java -@@ -66,6 +66,21 @@ public class FlowerPotBlock extends Block { - boolean bl = blockState.is(Blocks.AIR); - boolean bl2 = this.isEmpty(); - if (bl != bl2) { -+ // Paper start - Add PlayerFlowerPotManipulateEvent -+ boolean placing = bl2; // OBFHELPER -+ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos); -+ org.bukkit.inventory.ItemStack placedStack = org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemStack); -+ org.bukkit.inventory.ItemStack pottedStack = new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.block.CraftBlockType.minecraftToBukkit(this.potted)); -+ org.bukkit.inventory.ItemStack stack = placing ? placedStack : pottedStack; -+ -+ io.papermc.paper.event.player.PlayerFlowerPotManipulateEvent event = new io.papermc.paper.event.player.PlayerFlowerPotManipulateEvent((org.bukkit.entity.Player) player.getBukkitEntity(), block, stack, placing); -+ if (!event.callEvent()) { -+ // Update client -+ player.containerMenu.sendAllDataToRemote(); -+ -+ return InteractionResult.PASS; -+ } -+ // Paper end - Add PlayerFlowerPotManipulateEvent - if (bl2) { - world.setBlock(pos, blockState, 3); - player.awardStat(Stats.POT_FLOWER); diff --git a/patches/unapplied/server/0493-Add-EntityLoadCrossbowEvent.patch b/patches/unapplied/server/0493-Add-EntityLoadCrossbowEvent.patch deleted file mode 100644 index ae4000c9dc..0000000000 --- a/patches/unapplied/server/0493-Add-EntityLoadCrossbowEvent.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: JRoy -Date: Wed, 7 Oct 2020 12:04:01 -0400 -Subject: [PATCH] Add EntityLoadCrossbowEvent - - -diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java -index ba570f1c9654e1004e068a1efe2118f36c954505..f3a428f80c265639250114498b10067b4bf1ada1 100644 ---- a/src/main/java/net/minecraft/world/item/CrossbowItem.java -+++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java -@@ -89,7 +89,14 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { - int j = this.getUseDuration(stack) - remainingUseTicks; - float f = CrossbowItem.getPowerForTime(j, stack); - -- if (f >= 1.0F && !CrossbowItem.isCharged(stack) && CrossbowItem.tryLoadProjectiles(user, stack)) { -+ // Paper start - Add EntityLoadCrossbowEvent -+ if (f >= 1.0F && !CrossbowItem.isCharged(stack) /*&& CrossbowItem.tryLoadProjectiles(entityliving, itemstack)*/) { -+ final io.papermc.paper.event.entity.EntityLoadCrossbowEvent event = new io.papermc.paper.event.entity.EntityLoadCrossbowEvent(user.getBukkitLivingEntity(), stack.asBukkitMirror(), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(user.getUsedItemHand())); -+ if (!event.callEvent() || !tryLoadProjectiles(user, stack, event.shouldConsumeItem())) { -+ if (user instanceof ServerPlayer player) player.containerMenu.sendAllDataToRemote(); -+ return; -+ } -+ // Paper end - Add EntityLoadCrossbowEvent - CrossbowItem.setCharged(stack, true); - SoundSource soundcategory = user instanceof Player ? SoundSource.PLAYERS : SoundSource.HOSTILE; - -@@ -98,10 +105,16 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { - - } - -+ @io.papermc.paper.annotation.DoNotUse // Paper - Add EntityLoadCrossbowEvent - private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow) { -+ // Paper start - Add EntityLoadCrossbowEvent -+ return CrossbowItem.tryLoadProjectiles(shooter, crossbow, true); -+ } -+ private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow, boolean consume) { -+ // Paper end - Add EntityLoadCrossbowEvent - int i = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.MULTISHOT, crossbow); - int j = i == 0 ? 1 : 3; -- boolean flag = shooter instanceof Player && ((Player) shooter).getAbilities().instabuild; -+ boolean flag = !consume || shooter instanceof Player && ((Player) shooter).getAbilities().instabuild; // Paper - Add EntityLoadCrossbowEvent - ItemStack itemstack1 = shooter.getProjectile(crossbow); - ItemStack itemstack2 = itemstack1.copy(); - diff --git a/patches/unapplied/server/0541-Don-t-ignore-result-of-PlayerEditBookEvent.patch b/patches/unapplied/server/0541-Don-t-ignore-result-of-PlayerEditBookEvent.patch deleted file mode 100644 index c76d4e61a2..0000000000 --- a/patches/unapplied/server/0541-Don-t-ignore-result-of-PlayerEditBookEvent.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> -Date: Mon, 5 Apr 2021 18:35:15 -0700 -Subject: [PATCH] Don't ignore result of PlayerEditBookEvent - - -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9f9ac6b67123339b77ff85830f7cf2419b0fc330..6225499d926c0d83ea1cfd07a0340677a05a64e1 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1187,7 +1187,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - } - - itemstack.addTagElement("pages", nbttaglist); -- CraftEventFactory.handleEditBookEvent(this.player, slot, handItem, itemstack); // CraftBukkit -+ this.player.getInventory().setItem(slot, CraftEventFactory.handleEditBookEvent(this.player, slot, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent) - } - - @Override diff --git a/patches/unapplied/server/0545-Add-bypass-host-check.patch b/patches/unapplied/server/0545-Add-bypass-host-check.patch deleted file mode 100644 index b53ee2c2d8..0000000000 --- a/patches/unapplied/server/0545-Add-bypass-host-check.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Sun, 18 Apr 2021 21:27:01 +0100 -Subject: [PATCH] Add bypass host check - -Paper.bypassHostCheck - -Seriously, fix your firewalls. -.- - -diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -index 9b611fc277baf99a5d24b30a11f0efa77b22693f..0c6d172c8b723d2ceff7443dfe50ae280cb6dc2d 100644 ---- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -@@ -30,6 +30,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL - private static final Component IGNORE_STATUS_REASON = Component.translatable("disconnect.ignoring_status_request"); - private final MinecraftServer server; - private final Connection connection; -+ private static final boolean BYPASS_HOSTCHECK = Boolean.getBoolean("Paper.bypassHostCheck"); // Paper - - public ServerHandshakePacketListenerImpl(MinecraftServer server, Connection connection) { - this.server = server; -@@ -129,7 +130,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL - if (!handledByEvent && proxyLogicEnabled) { - // Paper end - PlayerHandshakeEvent - // if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above! -- if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { -+ if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.BYPASS_HOSTCHECK || ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { // Paper - Add bypass host check - this.connection.hostname = split[0]; - this.connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort()); - this.connection.spoofedUUID = com.mojang.util.UndashedUuid.fromStringLenient( split[2] ); diff --git a/patches/unapplied/server/0452-Reduce-blockpos-allocation-from-pathfinding.patch b/removed-patches-1-20-5/0452-Reduce-blockpos-allocation-from-pathfinding.patch similarity index 100% rename from patches/unapplied/server/0452-Reduce-blockpos-allocation-from-pathfinding.patch rename to removed-patches-1-20-5/0452-Reduce-blockpos-allocation-from-pathfinding.patch diff --git a/patches/unapplied/server/0486-Cache-burn-durations.patch b/removed-patches-1-20-5/0486-Cache-burn-durations.patch similarity index 100% rename from patches/unapplied/server/0486-Cache-burn-durations.patch rename to removed-patches-1-20-5/0486-Cache-burn-durations.patch diff --git a/patches/unapplied/server/0532-Prevent-grindstones-from-overstacking-items.patch b/removed-patches-1-20-5/0532-Prevent-grindstones-from-overstacking-items.patch similarity index 100% rename from patches/unapplied/server/0532-Prevent-grindstones-from-overstacking-items.patch rename to removed-patches-1-20-5/0532-Prevent-grindstones-from-overstacking-items.patch