From e0a245d2ea9dbb8cecd94aef33ae348e9bd6374b Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:36:49 -0400 Subject: [PATCH] Patches!!!!!!! --- ...es-in-dispense-events-regarding-sta.patch} | 232 +++++++----------- .../0808-Add-BlockLockCheckEvent.patch} | 10 +- .../0809-Add-Sneaking-API-for-Entities.patch} | 2 +- .../0810-Improve-logging-and-errors.patch} | 32 +-- .../0811-Improve-PortalEvents.patch} | 4 +- ...ion-for-spider-worldborder-climbing.patch} | 4 +- ...sing-SpigotConfig-logCommands-check.patch} | 6 +- ...Allay-stopDancing-while-not-dancing.patch} | 0 .../0815-Flying-Fall-Damage.patch} | 14 +- ...k-state-to-BlockExplodeEvent-and-En.patch} | 46 ++-- ...ion-moving-velocity-to-VehicleBlock.patch} | 6 +- ...config-for-disabling-entity-tag-tags.patch | 27 ++ ...e-player-info-update-packet-on-join.patch} | 10 +- ...k-items-during-EntityResurrectEvent.patch} | 4 +- .../0821-Win-Screen-API.patch} | 4 +- ...ItemStack-setAmount-null-assignment.patch} | 4 +- ...ix-force-opening-enchantment-tables.patch} | 8 +- .../0824-Add-Entity-Body-Yaw-API.patch} | 8 +- ...vent-sleeping-villagers-moving-towa.patch} | 4 +- .../0826-Add-EntityFertilizeEggEvent.patch} | 18 +- ...ty-drop-not-updating-the-client-inv.patch} | 4 +- ...temEvent-and-EntityCompostItemEvent.patch} | 6 +- ...ctly-handle-ArmorStand-invisibility.patch} | 0 ...ancement-triggers-for-entity-damage.patch} | 16 +- ...831-Fix-text-display-error-on-spawn.patch} | 4 +- ...nventories-returning-null-Locations.patch} | 8 +- .../0833-Add-Shearable-API.patch} | 2 +- ...Fix-SpawnEggMeta-get-setSpawnedType.patch} | 4 +- ...g-to-bad-recipes-in-furnace-like-ti.patch} | 4 +- ...ence-violations-like-they-should-be.patch} | 4 +- ...uplicate-animate-packet-for-records.patch} | 4 +- ...xpired-keys-from-impacting-new-join.patch} | 14 +- ...ts-being-fired-from-unloaded-chunks.patch} | 6 +- ...0840-Use-array-for-gamerule-storage.patch} | 12 +- ...Fix-a-couple-of-upstream-bed-issues.patch} | 6 +- ...ix-demo-flag-not-enabling-demo-mode.patch} | 12 +- .../0843-Add-Mob-Experience-reward-API.patch} | 4 +- ...redstone-on-top-of-trap-doors-early.patch} | 2 +- ...Lazy-Initialization-for-Enum-Fields.patch} | 2 +- ...46-More-accurate-isInOpenWater-impl.patch} | 0 .../0847-Expand-PlayerItemMendEvent.patch} | 14 +- ...sh-ProjectileSource-for-projectiles.patch} | 10 +- .../0849-Add-transient-modifier-API.patch} | 2 +- .../0850-Fix-block-place-logic.patch} | 18 +- ...nd-playing-for-BlockItem-ItemStacks.patch} | 4 +- ...l-BlockGrowEvent-for-missing-blocks.patch} | 2 +- ...nhasbukkit-default-if-alias-block-e.patch} | 2 +- ...pLike-spam-for-missing-key-selector.patch} | 6 +- ...-Fix-sniffer-removeExploredLocation.patch} | 0 ...to-remove-all-active-potion-effects.patch} | 4 +- ...rafting-result-amount-for-fireworks.patch} | 6 +- ...8-Add-event-for-player-editing-sign.patch} | 30 +-- ...k-item-frames-if-players-can-see-it.patch} | 10 +- ...ermission-levels-for-command-blocks.patch} | 12 +- ...Add-option-to-disable-block-updates.patch} | 58 ++--- ...862-Call-missing-BlockDispenseEvent.patch} | 12 +- ...-chunks-for-supporting-block-checks.patch} | 4 +- ...Optimize-player-lookups-for-beacons.patch} | 4 +- ...865-Add-Sign-getInteractableSideFor.patch} | 11 +- ...6-fix-item-meta-for-tadpole-buckets.patch} | 16 +- .../0867-Fix-BanList-API.patch} | 8 +- ...d-water-fluid-explosion-resistance-.patch} | 0 ...x-possible-NPE-on-painting-creation.patch} | 6 +- ...imer-for-Wandering-Traders-spawned-.patch} | 4 +- ...nceOrb-should-call-EntitySpawnEvent.patch} | 4 +- ...t-throw-both-Spread-and-Grow-Events.patch} | 2 +- .../0873-Add-whitelist-events.patch} | 0 .../0874-Implement-PlayerFailMoveEvent.patch} | 24 +- ...olia-scheduler-and-owned-region-API.patch} | 22 +- ...se-allay-memory-on-non-item-targets.patch} | 0 ...API-for-updating-recipes-on-clients.patch} | 18 +- ...tion-when-spawning-display-entities.patch} | 10 +- ...879-Only-capture-actual-tree-growth.patch} | 14 +- ...rce-for-mushroom-block-spread-event.patch} | 2 +- ...Data-on-more-entities-when-spawning.patch} | 20 +- ...-Use-correct-seed-on-api-world-load.patch} | 6 +- ...ta-neighbour-ticks-outside-of-range.patch} | 2 +- .../0884-Cache-map-ids-on-item-frames.patch} | 12 +- ...-custom-statistic-criteria-creation.patch} | 4 +- .../0886-Bandaid-fix-for-Effect.patch} | 24 +- .../0887-SculkCatalyst-bloom-API.patch} | 8 +- ...API-for-an-entity-s-scoreboard-name.patch} | 4 +- ...lace-methods-with-old-StructureType.patch} | 6 +- ...e-namespaced-commands-if-send-names.patch} | 4 +- ...-handle-BlockBreakEvent-isDropItems.patch} | 26 +- ...entity-death-event-for-ender-dragon.patch} | 4 +- ...tity-tracking-range-by-Y-coordinate.patch} | 4 +- .../0894-Add-Listing-API-for-Player.patch} | 25 +- ...figurable-Region-Compression-Format.patch} | 28 +-- ...6-Add-BlockFace-to-BlockDamageEvent.patch} | 8 +- .../0897-Fix-NPE-on-Boat-getStatus.patch} | 0 .../0898-Expand-Pose-API.patch} | 8 +- .../0899-More-DragonBattle-API.patch} | 2 +- .../0900-Add-PlayerPickItemEvent.patch} | 8 +- .../0901-Allow-trident-custom-damage.patch} | 12 +- ...2-Expose-hand-in-BlockCanBuildEvent.patch} | 4 +- ...-nearest-structure-border-iteration.patch} | 4 +- ...Implement-OfflinePlayer-isConnected.patch} | 8 +- .../0905-Fix-inventory-desync.patch} | 8 +- ...titleOverride-to-InventoryOpenEvent.patch} | 20 +- ...07-Configure-sniffer-egg-hatch-time.patch} | 2 +- ...-proximity-check-before-entity-look.patch} | 8 +- ...kip-POI-finding-if-stuck-in-vehicle.patch} | 0 ...t-sanity-checks-in-container-clicks.patch} | 6 +- ...ll-BlockRedstoneEvents-for-lecterns.patch} | 2 +- ...roper-checking-of-empty-item-stacks.patch} | 4 +- ...ix-silent-equipment-change-for-mobs.patch} | 13 +- .../0914-Fix-spigot-s-Forced-Stats.patch} | 0 ...ing-InventoryHolders-to-inventories.patch} | 34 +-- ...entities-in-chunks-that-are-positio.patch} | 8 +- ...sing-logs-for-log-ips-config-option.patch} | 0 ...n-on-UpgradeData.BlockFixers-class-.patch} | 2 +- ...-AdvancementProgress-getDateAwarded.patch} | 0 ...idebar-objectives-not-being-cleared.patch} | 0 ...x-missing-map-initialize-event-call.patch} | 11 +- ...a-when-attaching-firework-to-entity.patch} | 0 ...23-Fix-UnsafeValues-loadAdvancement.patch} | 6 +- .../0924-Add-player-idle-duration-API.patch} | 4 +- ...-if-we-can-see-non-visible-entities.patch} | 4 +- ...NPE-in-SculkBloomEvent-world-access.patch} | 6 +- ...tack-for-Player-sendEquipmentChange.patch} | 4 +- .../0928-Optimize-VarInts.patch} | 0 ...e-collision-shape-of-a-block-before.patch} | 4 +- ...redicate-for-blocks-when-raytracing.patch} | 8 +- ...em-packets-with-collector-as-source.patch} | 4 +- .../0932-Expand-LingeringPotion-API.patch} | 10 +- .../0933-Add-MaterialTagsTest.patch} | 0 ...ngEffect-powers-lightning-rods-and-.patch} | 12 +- ...config-for-disabling-entity-tag-tags.patch | 24 -- ...access-to-lookups-field-in-RegistryO.patch | 0 ...896-Array-backed-synched-entity-data.patch | 0 .../0931-Deep-clone-unhandled-nbt-tags.patch | 0 ...able-for-initializing-CraftLootTable.patch | 0 133 files changed, 631 insertions(+), 700 deletions(-) rename patches/{unapplied/server/0836-Fix-inconsistencies-in-dispense-events-regarding-sta.patch => server/0807-Fix-inconsistencies-in-dispense-events-regarding-sta.patch} (75%) rename patches/{unapplied/server/0837-Add-BlockLockCheckEvent.patch => server/0808-Add-BlockLockCheckEvent.patch} (92%) rename patches/{unapplied/server/0838-Add-Sneaking-API-for-Entities.patch => server/0809-Add-Sneaking-API-for-Entities.patch} (91%) rename patches/{unapplied/server/0839-Improve-logging-and-errors.patch => server/0810-Improve-logging-and-errors.patch} (84%) rename patches/{unapplied/server/0840-Improve-PortalEvents.patch => server/0811-Improve-PortalEvents.patch} (86%) rename patches/{unapplied/server/0841-Add-config-option-for-spider-worldborder-climbing.patch => server/0812-Add-config-option-for-spider-worldborder-climbing.patch} (85%) rename patches/{unapplied/server/0842-Add-missing-SpigotConfig-logCommands-check.patch => server/0813-Add-missing-SpigotConfig-logCommands-check.patch} (80%) rename patches/{unapplied/server/0843-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch => server/0814-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch} (100%) rename patches/{unapplied/server/0844-Flying-Fall-Damage.patch => server/0815-Flying-Fall-Damage.patch} (80%) rename patches/{unapplied/server/0845-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch => server/0816-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch} (88%) rename patches/{unapplied/server/0846-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch => server/0817-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch} (81%) create mode 100644 patches/server/0818-config-for-disabling-entity-tag-tags.patch rename patches/{unapplied/server/0848-Use-single-player-info-update-packet-on-join.patch => server/0819-Use-single-player-info-update-packet-on-join.patch} (89%) rename patches/{unapplied/server/0849-Correctly-shrink-items-during-EntityResurrectEvent.patch => server/0820-Correctly-shrink-items-during-EntityResurrectEvent.patch} (92%) rename patches/{unapplied/server/0850-Win-Screen-API.patch => server/0821-Win-Screen-API.patch} (88%) rename patches/{unapplied/server/0851-Remove-CraftItemStack-setAmount-null-assignment.patch => server/0822-Remove-CraftItemStack-setAmount-null-assignment.patch} (88%) rename patches/{unapplied/server/0852-Fix-force-opening-enchantment-tables.patch => server/0823-Fix-force-opening-enchantment-tables.patch} (75%) rename patches/{unapplied/server/0853-Add-Entity-Body-Yaw-API.patch => server/0824-Add-Entity-Body-Yaw-API.patch} (85%) rename patches/{unapplied/server/0854-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch => server/0825-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch} (89%) rename patches/{unapplied/server/0855-Add-EntityFertilizeEggEvent.patch => server/0826-Add-EntityFertilizeEggEvent.patch} (89%) rename patches/{unapplied/server/0856-Fix-HumanEntity-drop-not-updating-the-client-inv.patch => server/0827-Fix-HumanEntity-drop-not-updating-the-client-inv.patch} (90%) rename patches/{unapplied/server/0857-Add-CompostItemEvent-and-EntityCompostItemEvent.patch => server/0828-Add-CompostItemEvent-and-EntityCompostItemEvent.patch} (91%) rename patches/{unapplied/server/0858-Correctly-handle-ArmorStand-invisibility.patch => server/0829-Correctly-handle-ArmorStand-invisibility.patch} (100%) rename patches/{unapplied/server/0859-Fix-advancement-triggers-for-entity-damage.patch => server/0830-Fix-advancement-triggers-for-entity-damage.patch} (82%) rename patches/{unapplied/server/0860-Fix-text-display-error-on-spawn.patch => server/0831-Fix-text-display-error-on-spawn.patch} (85%) rename patches/{unapplied/server/0861-Fix-inventories-returning-null-Locations.patch => server/0832-Fix-inventories-returning-null-Locations.patch} (89%) rename patches/{unapplied/server/0862-Add-Shearable-API.patch => server/0833-Add-Shearable-API.patch} (97%) rename patches/{unapplied/server/0863-Fix-SpawnEggMeta-get-setSpawnedType.patch => server/0834-Fix-SpawnEggMeta-get-setSpawnedType.patch} (91%) rename patches/{unapplied/server/0864-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch => server/0835-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch} (88%) rename patches/{unapplied/server/0865-Treat-sequence-violations-like-they-should-be.patch => server/0836-Treat-sequence-violations-like-they-should-be.patch} (86%) rename patches/{unapplied/server/0866-remove-duplicate-animate-packet-for-records.patch => server/0837-remove-duplicate-animate-packet-for-records.patch} (86%) rename patches/{unapplied/server/0867-Prevent-causing-expired-keys-from-impacting-new-join.patch => server/0838-Prevent-causing-expired-keys-from-impacting-new-join.patch} (87%) rename patches/{unapplied/server/0868-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch => server/0839-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch} (77%) rename patches/{unapplied/server/0869-Use-array-for-gamerule-storage.patch => server/0840-Use-array-for-gamerule-storage.patch} (81%) rename patches/{unapplied/server/0870-Fix-a-couple-of-upstream-bed-issues.patch => server/0841-Fix-a-couple-of-upstream-bed-issues.patch} (89%) rename patches/{unapplied/server/0871-Fix-demo-flag-not-enabling-demo-mode.patch => server/0842-Fix-demo-flag-not-enabling-demo-mode.patch} (75%) rename patches/{unapplied/server/0872-Add-Mob-Experience-reward-API.patch => server/0843-Add-Mob-Experience-reward-API.patch} (81%) rename patches/{unapplied/server/0873-Break-redstone-on-top-of-trap-doors-early.patch => server/0844-Break-redstone-on-top-of-trap-doors-early.patch} (96%) rename patches/{unapplied/server/0874-Avoid-Lazy-Initialization-for-Enum-Fields.patch => server/0845-Avoid-Lazy-Initialization-for-Enum-Fields.patch} (95%) rename patches/{unapplied/server/0875-More-accurate-isInOpenWater-impl.patch => server/0846-More-accurate-isInOpenWater-impl.patch} (100%) rename patches/{unapplied/server/0877-Expand-PlayerItemMendEvent.patch => server/0847-Expand-PlayerItemMendEvent.patch} (89%) rename patches/{unapplied/server/0878-Refresh-ProjectileSource-for-projectiles.patch => server/0848-Refresh-ProjectileSource-for-projectiles.patch} (91%) rename patches/{unapplied/server/0879-Add-transient-modifier-API.patch => server/0849-Add-transient-modifier-API.patch} (95%) rename patches/{unapplied/server/0880-Fix-block-place-logic.patch => server/0850-Fix-block-place-logic.patch} (83%) rename patches/{unapplied/server/0881-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch => server/0851-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch} (89%) rename patches/{unapplied/server/0882-Call-BlockGrowEvent-for-missing-blocks.patch => server/0852-Call-BlockGrowEvent-for-missing-blocks.patch} (96%) rename patches/{unapplied/server/0883-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch => server/0853-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch} (94%) rename patches/{unapplied/server/0884-fix-MapLike-spam-for-missing-key-selector.patch => server/0854-fix-MapLike-spam-for-missing-key-selector.patch} (85%) rename patches/{unapplied/server/0885-Fix-sniffer-removeExploredLocation.patch => server/0855-Fix-sniffer-removeExploredLocation.patch} (100%) rename patches/{unapplied/server/0886-Add-method-to-remove-all-active-potion-effects.patch => server/0856-Add-method-to-remove-all-active-potion-effects.patch} (86%) rename patches/{unapplied/server/0887-Fix-incorrect-crafting-result-amount-for-fireworks.patch => server/0857-Fix-incorrect-crafting-result-amount-for-fireworks.patch} (78%) rename patches/{unapplied/server/0888-Add-event-for-player-editing-sign.patch => server/0858-Add-event-for-player-editing-sign.patch} (81%) rename patches/{unapplied/server/0889-Only-tick-item-frames-if-players-can-see-it.patch => server/0859-Only-tick-item-frames-if-players-can-see-it.patch} (79%) rename patches/{unapplied/server/0890-Fix-cmd-permission-levels-for-command-blocks.patch => server/0860-Fix-cmd-permission-levels-for-command-blocks.patch} (92%) rename patches/{unapplied/server/0891-Add-option-to-disable-block-updates.patch => server/0861-Add-option-to-disable-block-updates.patch} (79%) rename patches/{unapplied/server/0892-Call-missing-BlockDispenseEvent.patch => server/0862-Call-missing-BlockDispenseEvent.patch} (92%) rename patches/{unapplied/server/0893-Don-t-load-chunks-for-supporting-block-checks.patch => server/0863-Don-t-load-chunks-for-supporting-block-checks.patch} (81%) rename patches/{unapplied/server/0894-Optimize-player-lookups-for-beacons.patch => server/0864-Optimize-player-lookups-for-beacons.patch} (91%) rename patches/{unapplied/server/0895-Add-Sign-getInteractableSideFor.patch => server/0865-Add-Sign-getInteractableSideFor.patch} (84%) rename patches/{unapplied/server/0897-fix-item-meta-for-tadpole-buckets.patch => server/0866-fix-item-meta-for-tadpole-buckets.patch} (84%) rename patches/{unapplied/server/0898-Fix-BanList-API.patch => server/0867-Fix-BanList-API.patch} (98%) rename patches/{unapplied/server/0899-Determine-lava-and-water-fluid-explosion-resistance-.patch => server/0868-Determine-lava-and-water-fluid-explosion-resistance-.patch} (100%) rename patches/{unapplied/server/0900-Fix-possible-NPE-on-painting-creation.patch => server/0869-Fix-possible-NPE-on-painting-creation.patch} (92%) rename patches/{unapplied/server/0901-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch => server/0870-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch} (92%) rename patches/{unapplied/server/0902-ExperienceOrb-should-call-EntitySpawnEvent.patch => server/0871-ExperienceOrb-should-call-EntitySpawnEvent.patch} (89%) rename patches/{unapplied/server/0903-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch => server/0872-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch} (93%) rename patches/{unapplied/server/0904-Add-whitelist-events.patch => server/0873-Add-whitelist-events.patch} (100%) rename patches/{unapplied/server/0905-Implement-PlayerFailMoveEvent.patch => server/0874-Implement-PlayerFailMoveEvent.patch} (91%) rename patches/{unapplied/server/0906-Folia-scheduler-and-owned-region-API.patch => server/0875-Folia-scheduler-and-owned-region-API.patch} (98%) rename patches/{unapplied/server/0907-Only-erase-allay-memory-on-non-item-targets.patch => server/0876-Only-erase-allay-memory-on-non-item-targets.patch} (100%) rename patches/{unapplied/server/0908-API-for-updating-recipes-on-clients.patch => server/0877-API-for-updating-recipes-on-clients.patch} (87%) rename patches/{unapplied/server/0909-Fix-rotation-when-spawning-display-entities.patch => server/0878-Fix-rotation-when-spawning-display-entities.patch} (85%) rename patches/{unapplied/server/0910-Only-capture-actual-tree-growth.patch => server/0879-Only-capture-actual-tree-growth.patch} (88%) rename patches/{unapplied/server/0911-Use-correct-source-for-mushroom-block-spread-event.patch => server/0880-Use-correct-source-for-mushroom-block-spread-event.patch} (94%) rename patches/{unapplied/server/0912-Respect-randomizeData-on-more-entities-when-spawning.patch => server/0881-Respect-randomizeData-on-more-entities-when-spawning.patch} (76%) rename patches/{unapplied/server/0913-Use-correct-seed-on-api-world-load.patch => server/0882-Use-correct-seed-on-api-world-load.patch} (79%) rename patches/{unapplied/server/0914-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch => server/0883-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch} (95%) rename patches/{unapplied/server/0915-Cache-map-ids-on-item-frames.patch => server/0884-Cache-map-ids-on-item-frames.patch} (82%) rename patches/{unapplied/server/0916-Fix-custom-statistic-criteria-creation.patch => server/0885-Fix-custom-statistic-criteria-creation.patch} (88%) rename patches/{unapplied/server/0917-Bandaid-fix-for-Effect.patch => server/0886-Bandaid-fix-for-Effect.patch} (88%) rename patches/{unapplied/server/0918-SculkCatalyst-bloom-API.patch => server/0887-SculkCatalyst-bloom-API.patch} (84%) rename patches/{unapplied/server/0919-API-for-an-entity-s-scoreboard-name.patch => server/0888-API-for-an-entity-s-scoreboard-name.patch} (86%) rename patches/{unapplied/server/0920-Deprecate-and-replace-methods-with-old-StructureType.patch => server/0889-Deprecate-and-replace-methods-with-old-StructureType.patch} (92%) rename patches/{unapplied/server/0921-Don-t-tab-complete-namespaced-commands-if-send-names.patch => server/0890-Don-t-tab-complete-namespaced-commands-if-send-names.patch} (92%) rename patches/{unapplied/server/0922-Properly-handle-BlockBreakEvent-isDropItems.patch => server/0891-Properly-handle-BlockBreakEvent-isDropItems.patch} (90%) rename patches/{unapplied/server/0923-Fire-entity-death-event-for-ender-dragon.patch => server/0892-Fire-entity-death-event-for-ender-dragon.patch} (88%) rename patches/{unapplied/server/0924-Configurable-entity-tracking-range-by-Y-coordinate.patch => server/0893-Configurable-entity-tracking-range-by-Y-coordinate.patch} (91%) rename patches/{unapplied/server/0925-Add-Listing-API-for-Player.patch => server/0894-Add-Listing-API-for-Player.patch} (92%) rename patches/{unapplied/server/0926-Configurable-Region-Compression-Format.patch => server/0895-Configurable-Region-Compression-Format.patch} (67%) rename patches/{unapplied/server/0927-Add-BlockFace-to-BlockDamageEvent.patch => server/0896-Add-BlockFace-to-BlockDamageEvent.patch} (88%) rename patches/{unapplied/server/0928-Fix-NPE-on-Boat-getStatus.patch => server/0897-Fix-NPE-on-Boat-getStatus.patch} (100%) rename patches/{unapplied/server/0929-Expand-Pose-API.patch => server/0898-Expand-Pose-API.patch} (83%) rename patches/{unapplied/server/0930-More-DragonBattle-API.patch => server/0899-More-DragonBattle-API.patch} (97%) rename patches/{unapplied/server/0932-Add-PlayerPickItemEvent.patch => server/0900-Add-PlayerPickItemEvent.patch} (89%) rename patches/{unapplied/server/0933-Allow-trident-custom-damage.patch => server/0901-Allow-trident-custom-damage.patch} (77%) rename patches/{unapplied/server/0934-Expose-hand-in-BlockCanBuildEvent.patch => server/0902-Expose-hand-in-BlockCanBuildEvent.patch} (94%) rename patches/{unapplied/server/0935-Optimize-nearest-structure-border-iteration.patch => server/0903-Optimize-nearest-structure-border-iteration.patch} (93%) rename patches/{unapplied/server/0936-Implement-OfflinePlayer-isConnected.patch => server/0904-Implement-OfflinePlayer-isConnected.patch} (81%) rename patches/{unapplied/server/0937-Fix-inventory-desync.patch => server/0905-Fix-inventory-desync.patch} (83%) rename patches/{unapplied/server/0938-Add-titleOverride-to-InventoryOpenEvent.patch => server/0906-Add-titleOverride-to-InventoryOpenEvent.patch} (92%) rename patches/{unapplied/server/0939-Configure-sniffer-egg-hatch-time.patch => server/0907-Configure-sniffer-egg-hatch-time.patch} (94%) rename patches/{unapplied/server/0940-Do-crystal-portal-proximity-check-before-entity-look.patch => server/0908-Do-crystal-portal-proximity-check-before-entity-look.patch} (92%) rename patches/{unapplied/server/0941-Skip-POI-finding-if-stuck-in-vehicle.patch => server/0909-Skip-POI-finding-if-stuck-in-vehicle.patch} (100%) rename patches/{unapplied/server/0942-Add-slot-sanity-checks-in-container-clicks.patch => server/0910-Add-slot-sanity-checks-in-container-clicks.patch} (91%) rename patches/{unapplied/server/0943-Call-BlockRedstoneEvents-for-lecterns.patch => server/0911-Call-BlockRedstoneEvents-for-lecterns.patch} (93%) rename patches/{unapplied/server/0944-Allow-proper-checking-of-empty-item-stacks.patch => server/0912-Allow-proper-checking-of-empty-item-stacks.patch} (89%) rename patches/{unapplied/server/0945-Fix-silent-equipment-change-for-mobs.patch => server/0913-Fix-silent-equipment-change-for-mobs.patch} (88%) rename patches/{unapplied/server/0946-Fix-spigot-s-Forced-Stats.patch => server/0914-Fix-spigot-s-Forced-Stats.patch} (100%) rename patches/{unapplied/server/0947-Add-missing-InventoryHolders-to-inventories.patch => server/0915-Add-missing-InventoryHolders-to-inventories.patch} (91%) rename patches/{unapplied/server/0948-Do-not-read-tile-entities-in-chunks-that-are-positio.patch => server/0916-Do-not-read-tile-entities-in-chunks-that-are-positio.patch} (92%) rename patches/{unapplied/server/0949-Add-missing-logs-for-log-ips-config-option.patch => server/0917-Add-missing-logs-for-log-ips-config-option.patch} (100%) rename patches/{unapplied/server/0950-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch => server/0918-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch} (93%) rename patches/{unapplied/server/0951-Fix-NPE-in-AdvancementProgress-getDateAwarded.patch => server/0919-Fix-NPE-in-AdvancementProgress-getDateAwarded.patch} (100%) rename patches/{unapplied/server/0952-Fix-team-sidebar-objectives-not-being-cleared.patch => server/0920-Fix-team-sidebar-objectives-not-being-cleared.patch} (100%) rename patches/{unapplied/server/0953-Fix-missing-map-initialize-event-call.patch => server/0921-Fix-missing-map-initialize-event-call.patch} (80%) rename patches/{unapplied/server/0954-Update-entity-data-when-attaching-firework-to-entity.patch => server/0922-Update-entity-data-when-attaching-firework-to-entity.patch} (100%) rename patches/{unapplied/server/0956-Fix-UnsafeValues-loadAdvancement.patch => server/0923-Fix-UnsafeValues-loadAdvancement.patch} (86%) rename patches/{unapplied/server/0957-Add-player-idle-duration-API.patch => server/0924-Add-player-idle-duration-API.patch} (85%) rename patches/{unapplied/server/0958-Don-t-check-if-we-can-see-non-visible-entities.patch => server/0925-Don-t-check-if-we-can-see-non-visible-entities.patch} (85%) rename patches/{unapplied/server/0959-Fix-NPE-in-SculkBloomEvent-world-access.patch => server/0926-Fix-NPE-in-SculkBloomEvent-world-access.patch} (91%) rename patches/{unapplied/server/0960-Allow-null-itemstack-for-Player-sendEquipmentChange.patch => server/0927-Allow-null-itemstack-for-Player-sendEquipmentChange.patch} (84%) rename patches/{unapplied/server/0961-Optimize-VarInts.patch => server/0928-Optimize-VarInts.patch} (100%) rename patches/{unapplied/server/0962-Add-API-to-get-the-collision-shape-of-a-block-before.patch => server/0929-Add-API-to-get-the-collision-shape-of-a-block-before.patch} (90%) rename patches/{unapplied/server/0963-Add-predicate-for-blocks-when-raytracing.patch => server/0930-Add-predicate-for-blocks-when-raytracing.patch} (96%) rename patches/{unapplied/server/0964-Broadcast-take-item-packets-with-collector-as-source.patch => server/0931-Broadcast-take-item-packets-with-collector-as-source.patch} (88%) rename patches/{unapplied/server/0965-Expand-LingeringPotion-API.patch => server/0932-Expand-LingeringPotion-API.patch} (61%) rename patches/{unapplied/server/0966-Add-MaterialTagsTest.patch => server/0933-Add-MaterialTagsTest.patch} (100%) rename patches/{unapplied/server/0967-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch => server/0934-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch} (89%) delete mode 100644 patches/unapplied/server/0847-config-for-disabling-entity-tag-tags.patch rename {patches/unapplied/server => removed-patches-1-20-5}/0876-Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch (100%) rename {patches/unapplied/server => removed-patches-1-20-5}/0896-Array-backed-synched-entity-data.patch (100%) rename {patches/unapplied/server => removed-patches-1-20-5}/0931-Deep-clone-unhandled-nbt-tags.patch (100%) rename {patches/unapplied/server => removed-patches-1-20-5}/0955-Use-correct-variable-for-initializing-CraftLootTable.patch (100%) diff --git a/patches/unapplied/server/0836-Fix-inconsistencies-in-dispense-events-regarding-sta.patch b/patches/server/0807-Fix-inconsistencies-in-dispense-events-regarding-sta.patch similarity index 75% rename from patches/unapplied/server/0836-Fix-inconsistencies-in-dispense-events-regarding-sta.patch rename to patches/server/0807-Fix-inconsistencies-in-dispense-events-regarding-sta.patch index afdba86d7..5b38409d1 100644 --- a/patches/unapplied/server/0836-Fix-inconsistencies-in-dispense-events-regarding-sta.patch +++ b/patches/server/0807-Fix-inconsistencies-in-dispense-events-regarding-sta.patch @@ -8,44 +8,6 @@ item which is being dispensed. Before this fix, sometimes it was the whole stack before a single item had been taken. This fixes that so the stack size is always 1. -diff --git a/src/main/java/net/minecraft/core/dispenser/AbstractProjectileDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/AbstractProjectileDispenseBehavior.java -index e22d71c371952e91b838d10206d3dcdf9dc8716d..155bd3d6d9c7d3cac7fd04de8210301251d1e17a 100644 ---- a/src/main/java/net/minecraft/core/dispenser/AbstractProjectileDispenseBehavior.java -+++ b/src/main/java/net/minecraft/core/dispenser/AbstractProjectileDispenseBehavior.java -@@ -27,7 +27,7 @@ public abstract class AbstractProjectileDispenseBehavior extends DefaultDispense - - // CraftBukkit start - // iprojectile.shoot((double) enumdirection.getStepX(), (double) ((float) enumdirection.getStepY() + 0.1F), (double) enumdirection.getStepZ(), this.getPower(), this.getUncertainty()); -- ItemStack itemstack1 = stack.split(1); -+ ItemStack itemstack1 = stack.copyWithCount(1); // Paper - shrink below and single item in event - org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); - CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); - -@@ -37,12 +37,13 @@ public abstract class AbstractProjectileDispenseBehavior extends DefaultDispense - } - - if (event.isCancelled()) { -- stack.grow(1); -+ // stack.grow(1); // Paper - shrink below - return stack; - } - -+ boolean shrink = true; // Paper - if (!event.getItem().equals(craftItem)) { -- stack.grow(1); -+ shrink = false; // Paper - shrink below - // Chain to handler for new item - ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -56,7 +57,7 @@ public abstract class AbstractProjectileDispenseBehavior extends DefaultDispense - ((Entity) iprojectile).projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource(pointer.blockEntity()); - // CraftBukkit end - worldserver.addFreshEntity(iprojectile); -- // itemstack.shrink(1); // CraftBukkit - Handled during event processing -+ if (shrink) stack.shrink(1); // Paper - actually handle here - return stack; - } - diff --git a/src/main/java/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java index 90e1914599b43c8bf813596b3b428d8be3bac1b5..6df0db8b4cdab23494ea34236949ece4989110a3 100644 --- a/src/main/java/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java @@ -86,10 +48,10 @@ index 90e1914599b43c8bf813596b3b428d8be3bac1b5..6df0db8b4cdab23494ea34236949ece4 } diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea883bba41c 100644 +index 2bb3d1f0b89ef5b9b1f9f8da1070d21168830645..9507dbbb4b490149b9248c384be5adaccae40c41 100644 --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -@@ -217,7 +217,7 @@ public interface DispenseItemBehavior { +@@ -109,7 +109,7 @@ public interface DispenseItemBehavior { // CraftBukkit start ServerLevel worldserver = pointer.level(); @@ -98,7 +60,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); -@@ -227,12 +227,13 @@ public interface DispenseItemBehavior { +@@ -119,12 +119,13 @@ public interface DispenseItemBehavior { } if (event.isCancelled()) { @@ -114,16 +76,16 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -249,7 +250,7 @@ public interface DispenseItemBehavior { +@@ -141,7 +142,7 @@ public interface DispenseItemBehavior { return ItemStack.EMPTY; } - // itemstack.shrink(1); // Handled during event processing + if (shrink) stack.shrink(1); // Paper - actually handle here // CraftBukkit end - pointer.level().gameEvent((Entity) null, GameEvent.ENTITY_PLACE, pointer.pos()); + pointer.level().gameEvent((Entity) null, (Holder) GameEvent.ENTITY_PLACE, pointer.pos()); return stack; -@@ -271,7 +272,7 @@ public interface DispenseItemBehavior { +@@ -163,7 +164,7 @@ public interface DispenseItemBehavior { ServerLevel worldserver = pointer.level(); // CraftBukkit start @@ -132,7 +94,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); -@@ -281,12 +282,13 @@ public interface DispenseItemBehavior { +@@ -173,12 +174,13 @@ public interface DispenseItemBehavior { } if (event.isCancelled()) { @@ -148,8 +110,8 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -303,7 +305,7 @@ public interface DispenseItemBehavior { - ArmorStand entityarmorstand = (ArmorStand) EntityType.ARMOR_STAND.spawn(worldserver, stack.getTag(), consumer, blockposition, MobSpawnType.DISPENSER, false, false); +@@ -195,7 +197,7 @@ public interface DispenseItemBehavior { + ArmorStand entityarmorstand = (ArmorStand) EntityType.ARMOR_STAND.spawn(worldserver, consumer, blockposition, MobSpawnType.DISPENSER, false, false); if (entityarmorstand != null) { - // itemstack.shrink(1); // CraftBukkit - Handled during event processing @@ -157,16 +119,16 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 } return stack; -@@ -325,7 +327,7 @@ public interface DispenseItemBehavior { +@@ -215,7 +217,7 @@ public interface DispenseItemBehavior { if (!list.isEmpty()) { // CraftBukkit start - ItemStack itemstack1 = stack.split(1); + ItemStack itemstack1 = stack.copyWithCount(1); // Paper - shrink below and single item in event - Level world = pointer.level(); + ServerLevel world = pointer.level(); org.bukkit.block.Block block = CraftBlock.at(world, pointer.pos()); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); -@@ -336,12 +338,13 @@ public interface DispenseItemBehavior { +@@ -226,12 +228,13 @@ public interface DispenseItemBehavior { } if (event.isCancelled()) { @@ -182,7 +144,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -352,7 +355,7 @@ public interface DispenseItemBehavior { +@@ -242,7 +245,7 @@ public interface DispenseItemBehavior { } // CraftBukkit end ((Saddleable) list.get(0)).equipSaddle(SoundSource.BLOCKS, CraftItemStack.asNMSCopy(event.getItem())); // Paper - Fix saddles losing nbt data - MC-191591 @@ -191,16 +153,16 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 this.setSuccess(true); return stack; } else { -@@ -380,7 +383,7 @@ public interface DispenseItemBehavior { - } while (!entityhorseabstract.isArmor(stack) || entityhorseabstract.isWearingArmor() || !entityhorseabstract.isTamed()); +@@ -270,7 +273,7 @@ public interface DispenseItemBehavior { + } while (!entityhorseabstract.isBodyArmorItem(stack) || entityhorseabstract.isWearingBodyArmor() || !entityhorseabstract.isTamed()); // CraftBukkit start - ItemStack itemstack1 = stack.split(1); + ItemStack itemstack1 = stack.copyWithCount(1); // Paper - shrink below and single item in event - Level world = pointer.level(); + ServerLevel world = pointer.level(); org.bukkit.block.Block block = CraftBlock.at(world, pointer.pos()); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); -@@ -391,12 +394,13 @@ public interface DispenseItemBehavior { +@@ -281,12 +284,13 @@ public interface DispenseItemBehavior { } if (event.isCancelled()) { @@ -216,24 +178,24 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -406,6 +410,7 @@ public interface DispenseItemBehavior { +@@ -296,6 +300,7 @@ public interface DispenseItemBehavior { } } + if (shrink) stack.shrink(1); // Paper - shrink here - entityhorseabstract.getSlot(401).set(CraftItemStack.asNMSCopy(event.getItem())); + entityhorseabstract.setBodyArmorItem(CraftItemStack.asNMSCopy(event.getItem())); // CraftBukkit end this.setSuccess(true); -@@ -452,7 +457,7 @@ public interface DispenseItemBehavior { +@@ -342,7 +347,7 @@ public interface DispenseItemBehavior { entityhorsechestedabstract = (AbstractChestedHorse) iterator1.next(); // CraftBukkit start } while (!entityhorsechestedabstract.isTamed()); - ItemStack itemstack1 = stack.split(1); + ItemStack itemstack1 = stack.copyWithCount(1); // Paper - shrink below - Level world = pointer.level(); + ServerLevel world = pointer.level(); org.bukkit.block.Block block = CraftBlock.at(world, pointer.pos()); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); -@@ -463,10 +468,13 @@ public interface DispenseItemBehavior { +@@ -353,10 +358,13 @@ public interface DispenseItemBehavior { } if (event.isCancelled()) { @@ -247,7 +209,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -478,7 +486,7 @@ public interface DispenseItemBehavior { +@@ -368,7 +376,7 @@ public interface DispenseItemBehavior { entityhorsechestedabstract.getSlot(499).set(CraftItemStack.asNMSCopy(event.getItem())); // CraftBukkit end @@ -256,75 +218,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 this.setSuccess(true); return stack; } -@@ -489,7 +497,7 @@ public interface DispenseItemBehavior { - Direction enumdirection = (Direction) pointer.state().getValue(DispenserBlock.FACING); - // CraftBukkit start - ServerLevel worldserver = pointer.level(); -- ItemStack itemstack1 = stack.split(1); -+ ItemStack itemstack1 = stack.copyWithCount(1); // Paper - shrink below and single item in event - org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); - CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); - -@@ -499,12 +507,13 @@ public interface DispenseItemBehavior { - } - - if (event.isCancelled()) { -- stack.grow(1); -+ // stack.grow(1); // Paper - shrink below - return stack; - } - -+ boolean shrink = true; // Paper - if (!event.getItem().equals(craftItem)) { -- stack.grow(1); -+ shrink = false; // Paper - shrink below - // Chain to handler for new item - ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -521,7 +530,7 @@ public interface DispenseItemBehavior { - - entityfireworks.shoot((double) enumdirection.getStepX(), (double) enumdirection.getStepY(), (double) enumdirection.getStepZ(), 0.5F, 1.0F); - pointer.level().addFreshEntity(entityfireworks); -- // itemstack.shrink(1); // Handled during event processing -+ if (shrink) stack.shrink(1); // Paper - actually handle here - // CraftBukkit end - return stack; - } -@@ -546,7 +555,7 @@ public interface DispenseItemBehavior { - double d5 = randomsource.triangle((double) enumdirection.getStepZ(), 0.11485000000000001D); - - // CraftBukkit start -- ItemStack itemstack1 = stack.split(1); -+ ItemStack itemstack1 = stack.copyWithCount(1); // Paper - shrink below and single item in event - org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); - CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); - -@@ -556,12 +565,13 @@ public interface DispenseItemBehavior { - } - - if (event.isCancelled()) { -- stack.grow(1); -+ // stack.grow(1); // Paper - shrink at end - return stack; - } - -+ boolean shrink = true; // Paper - if (!event.getItem().equals(craftItem)) { -- stack.grow(1); -+ shrink = false; // Paper - shrink at end - // Chain to handler for new item - ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -576,7 +586,7 @@ public interface DispenseItemBehavior { - entitysmallfireball.projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource(pointer.blockEntity()); - - worldserver.addFreshEntity(entitysmallfireball); -- // itemstack.shrink(1); // Handled during event processing -+ if (shrink) stack.shrink(1); // Paper - actually handle here - // CraftBukkit end - return stack; - } -@@ -626,7 +636,7 @@ public interface DispenseItemBehavior { +@@ -413,7 +421,7 @@ public interface DispenseItemBehavior { if (willEmptyContentsSolidBucketItem || willEmptyBucketItem) { // Paper end - correctly check if the bucket place will succeed org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); @@ -333,7 +227,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(x, y, z)); if (!DispenserBlock.eventFired) { -@@ -700,7 +710,7 @@ public interface DispenseItemBehavior { +@@ -486,7 +494,7 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -342,7 +236,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); if (!DispenserBlock.eventFired) { -@@ -747,7 +757,7 @@ public interface DispenseItemBehavior { +@@ -533,7 +541,7 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -351,7 +245,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); if (!DispenserBlock.eventFired) { -@@ -808,7 +818,7 @@ public interface DispenseItemBehavior { +@@ -596,7 +604,7 @@ public interface DispenseItemBehavior { BlockPos blockposition = pointer.pos().relative((Direction) pointer.state().getValue(DispenserBlock.FACING)); // CraftBukkit start org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); @@ -360,7 +254,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); if (!DispenserBlock.eventFired) { -@@ -874,7 +884,7 @@ public interface DispenseItemBehavior { +@@ -662,7 +670,7 @@ public interface DispenseItemBehavior { // CraftBukkit start // EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldserver, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null); @@ -369,7 +263,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); -@@ -884,12 +894,13 @@ public interface DispenseItemBehavior { +@@ -672,12 +680,13 @@ public interface DispenseItemBehavior { } if (event.isCancelled()) { @@ -385,16 +279,16 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -905,7 +916,7 @@ public interface DispenseItemBehavior { +@@ -693,7 +702,7 @@ public interface DispenseItemBehavior { worldserver.addFreshEntity(entitytntprimed); worldserver.playSound((Player) null, entitytntprimed.getX(), entitytntprimed.getY(), entitytntprimed.getZ(), SoundEvents.TNT_PRIMED, SoundSource.BLOCKS, 1.0F, 1.0F); - worldserver.gameEvent((Entity) null, GameEvent.ENTITY_PLACE, blockposition); + worldserver.gameEvent((Entity) null, (Holder) GameEvent.ENTITY_PLACE, blockposition); - // itemstack.shrink(1); // CraftBukkit - handled above + if (shrink) stack.shrink(1); // Paper - actually handle here return stack; } }); -@@ -932,7 +943,7 @@ public interface DispenseItemBehavior { +@@ -720,7 +729,7 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -403,7 +297,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); if (!DispenserBlock.eventFired) { -@@ -981,7 +992,7 @@ public interface DispenseItemBehavior { +@@ -769,7 +778,7 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -412,7 +306,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); if (!DispenserBlock.eventFired) { -@@ -1054,7 +1065,7 @@ public interface DispenseItemBehavior { +@@ -842,7 +851,7 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -421,11 +315,49 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); if (!DispenserBlock.eventFired) { +diff --git a/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java +index 1b1c54ce8f187b968352d4aad05821ece182e20b..985954030654d521291cccbfc3ca49b67ee4357d 100644 +--- a/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java ++++ b/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java +@@ -40,7 +40,7 @@ public class ProjectileDispenseBehavior extends DefaultDispenseItemBehavior { + + // CraftBukkit start + // this.projectileItem.shoot(iprojectile, (double) enumdirection.getStepX(), (double) enumdirection.getStepY(), (double) enumdirection.getStepZ(), this.dispenseConfig.power(), this.dispenseConfig.uncertainty()); +- ItemStack itemstack1 = stack.split(1); ++ ItemStack itemstack1 = stack.copyWithCount(1); // Paper + org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos()); + CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); + +@@ -50,12 +50,13 @@ public class ProjectileDispenseBehavior extends DefaultDispenseItemBehavior { + } + + if (event.isCancelled()) { +- stack.grow(1); ++ // stack.grow(1); // Paper - shrink below + return stack; + } + ++ boolean shrink = true; // Paper + if (!event.getItem().equals(craftItem)) { +- stack.grow(1); ++ shrink = false; // Paper - shrink below + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); + DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); +@@ -69,7 +70,7 @@ public class ProjectileDispenseBehavior extends DefaultDispenseItemBehavior { + ((Entity) iprojectile).projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource(pointer.blockEntity()); + // CraftBukkit end + worldserver.addFreshEntity(iprojectile); +- // itemstack.shrink(1); // CraftBukkit - Handled during event processing ++ if (shrink) stack.shrink(1); // Paper - actually handle here + return stack; + } + diff --git a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java -index e17090003988ad2c890d48666c2234b14d511345..45d356c1ed888b4d749379ceaa8a95d7d7c876d5 100644 +index 4924926327787e7564116e9d6e20d2c2e98b2229..fbed5d57db0c0e79996f85571b9af0071fa953c7 100644 --- a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java -@@ -37,7 +37,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior { +@@ -38,7 +38,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior { ServerLevel worldserver = pointer.level(); // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -448,10 +380,10 @@ index f84987c36a16df19286d6f1badfb1ffb9cc7e770..6f2adf2334e35e8a617a4ced0c1af2ab BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); if (!DispenserBlock.eventFired) { diff --git a/src/main/java/net/minecraft/world/item/ArmorItem.java b/src/main/java/net/minecraft/world/item/ArmorItem.java -index a745dc02ae25bcf10cee954b6e53f8b106fd045d..42d87800a328f71c5127ce5599ca4c71cc9bb1cd 100644 +index f1cee3266e95094dd1afd501c96e4beaa3d71796..e766397aae3f73548b290b0809b9d1ca0967ea39 100644 --- a/src/main/java/net/minecraft/world/item/ArmorItem.java +++ b/src/main/java/net/minecraft/world/item/ArmorItem.java -@@ -62,7 +62,7 @@ public class ArmorItem extends Item implements Equipable { +@@ -64,7 +64,7 @@ public class ArmorItem extends Item implements Equipable { } else { LivingEntity entityliving = (LivingEntity) list.get(0); EquipmentSlot enumitemslot = Mob.getEquipmentSlotForItem(armor); @@ -460,7 +392,7 @@ index a745dc02ae25bcf10cee954b6e53f8b106fd045d..42d87800a328f71c5127ce5599ca4c71 // CraftBukkit start Level world = pointer.level(); org.bukkit.block.Block block = CraftBlock.at(world, pointer.pos()); -@@ -74,12 +74,13 @@ public class ArmorItem extends Item implements Equipable { +@@ -76,12 +76,13 @@ public class ArmorItem extends Item implements Equipable { } if (event.isCancelled()) { @@ -476,7 +408,7 @@ index a745dc02ae25bcf10cee954b6e53f8b106fd045d..42d87800a328f71c5127ce5599ca4c71 // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -96,6 +97,7 @@ public class ArmorItem extends Item implements Equipable { +@@ -98,6 +99,7 @@ public class ArmorItem extends Item implements Equipable { ((Mob) entityliving).setPersistenceRequired(); } @@ -485,10 +417,10 @@ index a745dc02ae25bcf10cee954b6e53f8b106fd045d..42d87800a328f71c5127ce5599ca4c71 } } diff --git a/src/main/java/net/minecraft/world/item/MinecartItem.java b/src/main/java/net/minecraft/world/item/MinecartItem.java -index 9bcca21ba03dc838f3e857018adee9506d8bb6a3..3aa73cd44aa8c86b78c35bc1788e4f83018c49ed 100644 +index 727319e86aa77b5a67b4c4f03b1e9aba9fe6bcde..66074445d3908b9bb1c8d70e1e27d057720ec8e5 100644 --- a/src/main/java/net/minecraft/world/item/MinecartItem.java +++ b/src/main/java/net/minecraft/world/item/MinecartItem.java -@@ -65,7 +65,7 @@ public class MinecartItem extends Item { +@@ -66,7 +66,7 @@ public class MinecartItem extends Item { // CraftBukkit start // EntityMinecartAbstract entityminecartabstract = EntityMinecartAbstract.createMinecart(worldserver, d0, d1 + d3, d2, ((ItemMinecart) itemstack.getItem()).type); @@ -497,7 +429,7 @@ index 9bcca21ba03dc838f3e857018adee9506d8bb6a3..3aa73cd44aa8c86b78c35bc1788e4f83 org.bukkit.block.Block block2 = CraftBlock.at(worldserver, pointer.pos()); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); -@@ -75,12 +75,13 @@ public class MinecartItem extends Item { +@@ -76,12 +76,13 @@ public class MinecartItem extends Item { } if (event.isCancelled()) { @@ -513,7 +445,7 @@ index 9bcca21ba03dc838f3e857018adee9506d8bb6a3..3aa73cd44aa8c86b78c35bc1788e4f83 // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -93,8 +94,7 @@ public class MinecartItem extends Item { +@@ -94,8 +95,7 @@ public class MinecartItem extends Item { itemstack1 = CraftItemStack.asNMSCopy(event.getItem()); AbstractMinecart entityminecartabstract = AbstractMinecart.createMinecart(worldserver, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), ((MinecartItem) itemstack1.getItem()).type, itemstack1, (Player) null); diff --git a/patches/unapplied/server/0837-Add-BlockLockCheckEvent.patch b/patches/server/0808-Add-BlockLockCheckEvent.patch similarity index 92% rename from patches/unapplied/server/0837-Add-BlockLockCheckEvent.patch rename to patches/server/0808-Add-BlockLockCheckEvent.patch index 3ac83356d..9d9e7c4dd 100644 --- a/patches/unapplied/server/0837-Add-BlockLockCheckEvent.patch +++ b/patches/server/0808-Add-BlockLockCheckEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add BlockLockCheckEvent diff --git a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java -index fce3a45d09a93ca68a3d49f2e666afa4c860d042..b8b4d74076fa5ed6eb3b2045384db77e165931b2 100644 +index ff3f26c31bd11b48f48e354ea6b33aa55dcbff5d..02675f15e157ce68506c813b19cf5472bf67bc00 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java -@@ -69,17 +69,44 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co +@@ -73,17 +73,44 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co protected abstract Component getDefaultName(); public boolean canOpen(Player player) { @@ -54,12 +54,12 @@ index fce3a45d09a93ca68a3d49f2e666afa4c860d042..b8b4d74076fa5ed6eb3b2045384db77e + } // Paper - Add BlockLockCheckEvent } - @Nullable + protected abstract NonNullList getItems(); 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 247f24c7fadc203ee0f6a6f85122c91ab4c82f80..eff48e43a35a752bd33de2b55a0ad04332109ce0 100644 +index 35c7d05b1898adf6b193d0b0b53f3c3be186d4ce..2e3d89ca35b513340cd1ebefa875280b32e1756e 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 -@@ -470,7 +470,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -472,7 +472,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @Nullable @Override public AbstractContainerMenu createMenu(int syncId, Inventory playerInventory, Player player) { diff --git a/patches/unapplied/server/0838-Add-Sneaking-API-for-Entities.patch b/patches/server/0809-Add-Sneaking-API-for-Entities.patch similarity index 91% rename from patches/unapplied/server/0838-Add-Sneaking-API-for-Entities.patch rename to patches/server/0809-Add-Sneaking-API-for-Entities.patch index 7ab8bbe76..47d08328f 100644 --- a/patches/unapplied/server/0838-Add-Sneaking-API-for-Entities.patch +++ b/patches/server/0809-Add-Sneaking-API-for-Entities.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add Sneaking API for Entities diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index f6d6b2c7aefc39a6e6e2b0e61fd9afb334bee764..4dfbcaba4615bd761c1eb9d5994168c7202fc571 100644 +index 92c80776273f6be43b40686c7ab7dd7371b1c06f..365281dfc0308c5db0c72b56208d9b87be0e955e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -872,6 +872,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { diff --git a/patches/unapplied/server/0839-Improve-logging-and-errors.patch b/patches/server/0810-Improve-logging-and-errors.patch similarity index 84% rename from patches/unapplied/server/0839-Improve-logging-and-errors.patch rename to patches/server/0810-Improve-logging-and-errors.patch index fff7048b9..e7e871ed2 100644 --- a/patches/unapplied/server/0839-Improve-logging-and-errors.patch +++ b/patches/server/0810-Improve-logging-and-errors.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Improve logging and errors Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> diff --git a/src/main/java/net/minecraft/advancements/AdvancementTree.java b/src/main/java/net/minecraft/advancements/AdvancementTree.java -index 938fe76677139e7e99698b61691bfcadf70dbd87..a017ebf550e3430c14a7159baa9a644530a0b5ab 100644 +index 2665170b8391a77d6b3fb7ae7b5ccfc0be65acd7..e00d4e0896c0163c43d79af63338de67c7cb0dc4 100644 --- a/src/main/java/net/minecraft/advancements/AdvancementTree.java +++ b/src/main/java/net/minecraft/advancements/AdvancementTree.java @@ -35,7 +35,7 @@ public class AdvancementTree { @@ -28,10 +28,10 @@ index 938fe76677139e7e99698b61691bfcadf70dbd87..a017ebf550e3430c14a7159baa9a6445 private boolean tryInsert(AdvancementHolder advancement) { diff --git a/src/main/java/net/minecraft/server/ServerAdvancementManager.java b/src/main/java/net/minecraft/server/ServerAdvancementManager.java -index 536f0c496ce36ca3248fc6eeac9bbd77214a36f9..31718823250a1490b783f426fff65bf5a067b6f4 100644 +index 4fa6abfe79ab7ff0e7643975351ab1a10efdc278..b4f15c51faae544bc0a4fcc33760df66e1397f87 100644 --- a/src/main/java/net/minecraft/server/ServerAdvancementManager.java +++ b/src/main/java/net/minecraft/server/ServerAdvancementManager.java -@@ -66,6 +66,7 @@ public class ServerAdvancementManager extends SimpleJsonResourceReloadListener { +@@ -67,6 +67,7 @@ public class ServerAdvancementManager extends SimpleJsonResourceReloadListener { AdvancementTree advancementtree = new AdvancementTree(); advancementtree.addAll(this.advancements.values()); @@ -40,10 +40,10 @@ index 536f0c496ce36ca3248fc6eeac9bbd77214a36f9..31718823250a1490b783f426fff65bf5 while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 5675931fe3ea896027a510944fc484f41f5ef555..1b38d267daa7902bcb7d2a71d28b3f39da722ad1 100644 +index fdff82ed5dbf5176d470b9b6c41acfe6b98c7039..00679b76715fde4b90a999fd11cca40d048b1349 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -265,6 +265,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -278,6 +278,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface DedicatedServer.LOGGER.warn("**** FAILED TO BIND TO PORT!"); DedicatedServer.LOGGER.warn("The exception was: {}", ioexception.toString()); DedicatedServer.LOGGER.warn("Perhaps a server is already running on that port?"); @@ -52,10 +52,10 @@ index 5675931fe3ea896027a510944fc484f41f5ef555..1b38d267daa7902bcb7d2a71d28b3f39 } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index faa43550844fd3a3595bd9621b5730c209a54124..dd7f0aed33183dd51e3378d2430df4f7c96ae730 100644 +index d20baa57c5367861fb5b3b6ea746a6391b6115cc..c9b4960d9818b71ca2af5e2e23755545ca7da55a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3309,7 +3309,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3393,7 +3393,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator)); } catch (ProfilePublicKey.ValidationException profilepublickey_b) { @@ -65,10 +65,10 @@ index faa43550844fd3a3595bd9621b5730c209a54124..dd7f0aed33183dd51e3378d2430df4f7 } diff --git a/src/main/java/net/minecraft/server/packs/PathPackResources.java b/src/main/java/net/minecraft/server/packs/PathPackResources.java -index 87928500f40ceeaad6669de194d2c80089051e60..8d554e7bb1291ac24a958a92458f993344e3be3b 100644 +index ed1d3d30404dfc6303e746f31295b6b1aa40f204..8d7565eda4536e8aa42dd3dcbcfac38cbf16020a 100644 --- a/src/main/java/net/minecraft/server/packs/PathPackResources.java +++ b/src/main/java/net/minecraft/server/packs/PathPackResources.java -@@ -102,6 +102,12 @@ public class PathPackResources extends AbstractPackResources { +@@ -103,6 +103,12 @@ public class PathPackResources extends AbstractPackResources { try (DirectoryStream directoryStream = Files.newDirectoryStream(path)) { for (Path path2 : directoryStream) { String string = path2.getFileName().toString(); @@ -82,20 +82,20 @@ index 87928500f40ceeaad6669de194d2c80089051e60..8d554e7bb1291ac24a958a92458f9933 set.add(string); } else { diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -index 4259181bab2dc4f2d0409b56fdf81d966003376d..a0ab3c55826af292d1cdac05648139b4d31f1376 100644 +index 9ae23dbf076e977c9d9b98a02c5925e9a8f68f7f..0126b88f60904dfbf1e29eb3b89a985061d91f91 100644 --- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java +++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -@@ -84,7 +84,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { - return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* // todo: is this needed anymore? - })); - this.byName = Maps.newHashMap(builder.build()); // CraftBukkit -- RecipeManager.LOGGER.info("Loaded {} recipes", map1.size()); +@@ -79,7 +79,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { + this.byType = LinkedHashMultimap.create(builder.build()); + this.byName = Maps.newHashMap(com_google_common_collect_immutablemap_builder.build()); + // CraftBukkit end +- RecipeManager.LOGGER.info("Loaded {} recipes", this.byType.size()); + RecipeManager.LOGGER.info("Loaded {} recipes", this.byName.size()); // Paper - Improve logging and errors; log correct number of recipes } // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java -index 080cca90f15d90249b7a38f33286ae2f735ba7d9..fde9aadd6c688b9797a6755f9d214918047598a0 100644 +index 1f82491fc885e3c349fca779ce98798a5c6efde5..71d057dc8c7362f8e7aaca5e31c9f02b2bf3f281 100644 --- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java +++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java @@ -44,6 +44,7 @@ import org.bukkit.material.MaterialData; diff --git a/patches/unapplied/server/0840-Improve-PortalEvents.patch b/patches/server/0811-Improve-PortalEvents.patch similarity index 86% rename from patches/unapplied/server/0840-Improve-PortalEvents.patch rename to patches/server/0811-Improve-PortalEvents.patch index eb9278ff7..680471754 100644 --- a/patches/unapplied/server/0840-Improve-PortalEvents.patch +++ b/patches/server/0811-Improve-PortalEvents.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Improve PortalEvents diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 96a1f1460daba1507659a8ed34b608ded7084c0f..99035a91f04cc838e30b860d480ef710e1dbe2ea 100644 +index 63e4fa54c6931a3fc33b081662823f5b736d8496..48103cefacf75a51619f7a3ebeb7731956a65a4f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3495,7 +3495,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3513,7 +3513,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess Location enter = bukkitEntity.getLocation(); Location exit = CraftLocation.toBukkit(exitPosition, exitWorldServer.getWorld()); diff --git a/patches/unapplied/server/0841-Add-config-option-for-spider-worldborder-climbing.patch b/patches/server/0812-Add-config-option-for-spider-worldborder-climbing.patch similarity index 85% rename from patches/unapplied/server/0841-Add-config-option-for-spider-worldborder-climbing.patch rename to patches/server/0812-Add-config-option-for-spider-worldborder-climbing.patch index c4325b822..b10bcacd3 100644 --- a/patches/unapplied/server/0841-Add-config-option-for-spider-worldborder-climbing.patch +++ b/patches/server/0812-Add-config-option-for-spider-worldborder-climbing.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add config option for spider worldborder climbing diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java -index 4d5cfaa58bdf4e6cb975134004d14c591f6e85fa..d90da2f9e4d6214577bc81bd6c70ba8593788898 100644 +index c80019f0c9f814c5259b4d3ec2d8a85669dc728f..6006480d9f6d60bb7b5628eabe6740013066cde4 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Spider.java +++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java -@@ -86,7 +86,7 @@ public class Spider extends Monster { +@@ -82,7 +82,7 @@ public class Spider extends Monster { public void tick() { super.tick(); if (!this.level().isClientSide) { diff --git a/patches/unapplied/server/0842-Add-missing-SpigotConfig-logCommands-check.patch b/patches/server/0813-Add-missing-SpigotConfig-logCommands-check.patch similarity index 80% rename from patches/unapplied/server/0842-Add-missing-SpigotConfig-logCommands-check.patch rename to patches/server/0813-Add-missing-SpigotConfig-logCommands-check.patch index 940b244dc..6a58073ce 100644 --- a/patches/unapplied/server/0842-Add-missing-SpigotConfig-logCommands-check.patch +++ b/patches/server/0813-Add-missing-SpigotConfig-logCommands-check.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Add missing SpigotConfig logCommands check diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index dd7f0aed33183dd51e3378d2430df4f7c96ae730..5f1c31323d58cdc4419cf5f8870a8acf121c7669 100644 +index c9b4960d9818b71ca2af5e2e23755545ca7da55a..6e6024d9c397894903130a4b91a621ae1844a4b5 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2060,7 +2060,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - private void performChatCommand(ServerboundChatCommandPacket packet, LastSeenMessages lastSeenMessages) { +@@ -2087,7 +2087,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + private void performSignedChatCommand(ServerboundChatCommandSignedPacket packet, LastSeenMessages lastSeenMessages) { // CraftBukkit start String command = "/" + packet.command(); + if (org.spigotmc.SpigotConfig.logCommands) { // Paper - Add missing SpigotConfig logCommands check diff --git a/patches/unapplied/server/0843-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch b/patches/server/0814-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch similarity index 100% rename from patches/unapplied/server/0843-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch rename to patches/server/0814-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch diff --git a/patches/unapplied/server/0844-Flying-Fall-Damage.patch b/patches/server/0815-Flying-Fall-Damage.patch similarity index 80% rename from patches/unapplied/server/0844-Flying-Fall-Damage.patch rename to patches/server/0815-Flying-Fall-Damage.patch index 0bdc65209..774420bd9 100644 --- a/patches/unapplied/server/0844-Flying-Fall-Damage.patch +++ b/patches/server/0815-Flying-Fall-Damage.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Flying Fall Damage 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 262cefa51856cf6a58ae3b80b1ae93a5dd7bfaa7..e92cb12a04827c2afc0662a26320458527aa2bd4 100644 +index 761e8a0c4e1db465c18892999e86885f27ca8075..230ffd3c4541ef8979605d733b6463e39cd00206 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -182,6 +182,7 @@ public abstract class Player extends LivingEntity { - public FishingHook fishing; - public float hurtDir; // Paper - protected -> public +@@ -194,6 +194,7 @@ public abstract class Player extends LivingEntity { + public Entity currentExplosionCause; + public boolean ignoreFallDamageFromCurrentImpulse; public boolean affectsSpawning = true; // Paper - Affects Spawning API + public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage // CraftBukkit start public boolean fauxSleeping; -@@ -1680,7 +1681,7 @@ public abstract class Player extends LivingEntity { +@@ -1693,7 +1694,7 @@ public abstract class Player extends LivingEntity { @Override public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { @@ -26,10 +26,10 @@ index 262cefa51856cf6a58ae3b80b1ae93a5dd7bfaa7..e92cb12a04827c2afc0662a263204585 } else { if (fallDistance >= 2.0F) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f80a71100d317c8670b728a7c289ffa40dd2038b..5a2969f97207b3d42937e8afffbc9293cba7cbf6 100644 +index af6713dc949cce945f3625092a01f04ad41120e7..1925d55ffb0fbf554fc3d6f6d75f119146f60dca 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2500,6 +2500,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2566,6 +2566,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().onUpdateAbilities(); } diff --git a/patches/unapplied/server/0845-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch b/patches/server/0816-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch similarity index 88% rename from patches/unapplied/server/0845-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch rename to patches/server/0816-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch index 09acddcf7..8da485006 100644 --- a/patches/unapplied/server/0845-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch +++ b/patches/server/0816-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add exploded block state to BlockExplodeEvent and diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -index 8187feffe52efa5c887f1910e581a37c6e439401..1561b85a45f52a8162f43553f8485bfe084b8f1f 100644 +index ec52c7a75d9988475fbb4fe12ef7f4489ef3d894..a78fd4f9ce97ebece45979908382de8f5fc14c1b 100644 --- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java +++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -@@ -20,6 +20,7 @@ public class DamageSource { +@@ -21,6 +21,7 @@ public class DamageSource { private final Entity directEntity; @Nullable private final Vec3 damageSourcePosition; @@ -17,7 +17,7 @@ index 8187feffe52efa5c887f1910e581a37c6e439401..1561b85a45f52a8162f43553f8485bfe // CraftBukkit start @Nullable private org.bukkit.block.Block directBlock; // The block that caused the damage. damageSourcePosition is not used for all block damages -@@ -88,6 +89,7 @@ public class DamageSource { +@@ -94,6 +95,7 @@ public class DamageSource { private DamageSource cloneInstance() { DamageSource damageSource = new DamageSource(this.type, this.directEntity, this.causingEntity, this.damageSourcePosition); @@ -26,10 +26,10 @@ index 8187feffe52efa5c887f1910e581a37c6e439401..1561b85a45f52a8162f43553f8485bfe damageSource.withSweep = this.isSweep(); damageSource.poison = this.isPoison(); diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSources.java b/src/main/java/net/minecraft/world/damagesource/DamageSources.java -index 8c0653012192144cd11c802d1ad9bf7e42e94f59..a47473c9875c70c52b9a61e0156e55961f34c694 100644 +index 2f5591aa232b834bb9b69a2a349ce93d1a9c63fa..8ba60de95845f4d56f299c5f1b2b5163461ba38d 100644 --- a/src/main/java/net/minecraft/world/damagesource/DamageSources.java +++ b/src/main/java/net/minecraft/world/damagesource/DamageSources.java -@@ -257,8 +257,17 @@ public class DamageSources { +@@ -265,8 +265,17 @@ public class DamageSources { return this.source(DamageTypes.SONIC_BOOM, attacker); } @@ -49,10 +49,10 @@ index 8c0653012192144cd11c802d1ad9bf7e42e94f59..a47473c9875c70c52b9a61e0156e5596 public DamageSource outOfBorder() { diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 2d1fe6af7923ad4a0143f2d3fd28abc85e6092c1..217018dbdd78af4b89d9d4e7154956593dfa8dae 100644 +index aa81144975fa66bcdb3d107e2a461b6d62d8e59e..fbd1f4f3a8c94a4842f91b7cc6c21f0cf7edd7ac 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java -@@ -383,7 +383,7 @@ public class Explosion { +@@ -386,7 +386,7 @@ public class Explosion { bukkitBlocks = event.blockList(); this.yield = event.getYield(); } else { @@ -62,10 +62,10 @@ index 2d1fe6af7923ad4a0143f2d3fd28abc85e6092c1..217018dbdd78af4b89d9d4e715495659 this.wasCanceled = event.isCancelled(); bukkitBlocks = event.blockList(); 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 c5d892950b4027cf9879eafc1c0f4e4c62fb4f51..c14cddd42c61512c312231b1e93ccc6efbde620c 100644 +index 03035ed3df2f32e14a8eb9bc3d536ef64b5d87ba..872bec4c366c86177334452315cc4a8097dae3c0 100644 --- a/src/main/java/net/minecraft/world/level/block/BedBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java -@@ -96,6 +96,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -95,6 +95,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock // CraftBukkit - moved world and biome check into EntityHuman if (false && !BedBlock.canSetSpawn(world)) { @@ -73,7 +73,7 @@ index c5d892950b4027cf9879eafc1c0f4e4c62fb4f51..c14cddd42c61512c312231b1e93ccc6e world.removeBlock(pos, false); BlockPos blockposition1 = pos.relative(((Direction) state.getValue(BedBlock.FACING)).getOpposite()); -@@ -105,7 +106,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -104,7 +105,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock Vec3 vec3d = pos.getCenter(); @@ -82,7 +82,7 @@ index c5d892950b4027cf9879eafc1c0f4e4c62fb4f51..c14cddd42c61512c312231b1e93ccc6e return InteractionResult.SUCCESS; } else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) { if (!this.kickVillagerOutOfBed(world, pos)) { -@@ -147,6 +148,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -146,6 +147,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock private InteractionResult explodeBed(BlockState iblockdata, Level world, BlockPos blockposition) { { { @@ -90,7 +90,7 @@ index c5d892950b4027cf9879eafc1c0f4e4c62fb4f51..c14cddd42c61512c312231b1e93ccc6e world.removeBlock(blockposition, false); BlockPos blockposition1 = blockposition.relative(((Direction) iblockdata.getValue(BedBlock.FACING)).getOpposite()); -@@ -156,7 +158,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -155,7 +157,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock Vec3 vec3d = blockposition.getCenter(); @@ -100,10 +100,10 @@ index c5d892950b4027cf9879eafc1c0f4e4c62fb4f51..c14cddd42c61512c312231b1e93ccc6e } } diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java -index acd5ec218b8d4c096f44ae2eec1379eeaf30ddc5..088262f306755a9cb785c7a0cf0a9c66ed0965a8 100644 +index a4a90df0b500fb440226b07462faaa87594b12a5..c389e2f891655bd8c9f307057dc1ad62dfcbc79e 100644 --- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java +++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java -@@ -131,6 +131,7 @@ public class RespawnAnchorBlock extends Block { +@@ -133,6 +133,7 @@ public class RespawnAnchorBlock extends Block { } private void explode(BlockState state, Level world, final BlockPos explodedPos) { @@ -111,7 +111,7 @@ index acd5ec218b8d4c096f44ae2eec1379eeaf30ddc5..088262f306755a9cb785c7a0cf0a9c66 world.removeBlock(explodedPos, false); Stream stream = Direction.Plane.HORIZONTAL.stream(); // CraftBukkit - decompile error -@@ -147,7 +148,7 @@ public class RespawnAnchorBlock extends Block { +@@ -149,7 +150,7 @@ public class RespawnAnchorBlock extends Block { }; Vec3 vec3d = explodedPos.getCenter(); @@ -121,11 +121,11 @@ index acd5ec218b8d4c096f44ae2eec1379eeaf30ddc5..088262f306755a9cb785c7a0cf0a9c66 public static boolean canSetSpawn(Level world) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -index f81c0d07a5efc92942d8ab5c50a8260db033307d..8afc396c162d928902a9d9beb9f039b06630f755 100644 +index c38b7148a3bbe7d29adea19d08dde4d9c8e29704..30b40d3715f98eff90d16aad491f5be5162be9e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -@@ -276,6 +276,12 @@ public final class CraftBlockStates { - BlockEntity tileEntity = (blockEntityTag == null) ? null : BlockEntity.loadStatic(blockPosition, blockData, blockEntityTag); +@@ -291,6 +291,12 @@ public final class CraftBlockStates { + BlockEntity tileEntity = (blockEntityTag == null) ? null : BlockEntity.loadStatic(blockPosition, blockData, blockEntityTag, registry); return CraftBlockStates.getBlockState(null, blockPosition, blockData, tileEntity); } + // Paper start - add exploded state @@ -138,11 +138,11 @@ index f81c0d07a5efc92942d8ab5c50a8260db033307d..8afc396c162d928902a9d9beb9f039b0 // See BlockStateFactory#createBlockState(World, BlockPosition, IBlockData, TileEntity) private static CraftBlockState getBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 6b226ab2b6365788362683e629c8cece12118233..82c0a13558948a5f5e5cee0e2b67fcde5a906301 100644 +index c52cb55cd1da988ec646e4e1484ec1a72513291d..a226b7cdc9c63ef09d7d48269c287af1ab6dbdc4 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1071,7 +1071,7 @@ public class CraftEventFactory { - Entity damager = source.getCausingEntity(); +@@ -1070,7 +1070,7 @@ public class CraftEventFactory { + Entity damager = (bukkitDamageSource.isIndirect() && source.getDirectEntity() != null) ? source.getDirectEntity() : source.getCausingEntity(); if (source.is(DamageTypeTags.IS_EXPLOSION)) { if (damager == null) { - return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled); @@ -150,7 +150,7 @@ index 6b226ab2b6365788362683e629c8cece12118233..82c0a13558948a5f5e5cee0e2b67fcde } DamageCause damageCause = (damager.getBukkitEntity() instanceof org.bukkit.entity.TNTPrimed) ? DamageCause.BLOCK_EXPLOSION : DamageCause.ENTITY_EXPLOSION; return CraftEventFactory.callEntityDamageEvent(damager, entity, damageCause, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API -@@ -1122,7 +1122,7 @@ public class CraftEventFactory { +@@ -1117,7 +1117,7 @@ public class CraftEventFactory { } else { throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, source.getDirectBlock(), source.getMsgId())); } @@ -159,7 +159,7 @@ index 6b226ab2b6365788362683e629c8cece12118233..82c0a13558948a5f5e5cee0e2b67fcde } DamageCause cause; -@@ -1175,8 +1175,13 @@ public class CraftEventFactory { +@@ -1170,8 +1170,13 @@ public class CraftEventFactory { return CraftEventFactory.callEntityDamageEvent(event, damagee, cancelled); } diff --git a/patches/unapplied/server/0846-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch b/patches/server/0817-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch similarity index 81% rename from patches/unapplied/server/0846-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch rename to patches/server/0817-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch index 1cb441062..214bb6516 100644 --- a/patches/unapplied/server/0846-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch +++ b/patches/server/0817-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose pre-collision moving velocity to diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 99035a91f04cc838e30b860d480ef710e1dbe2ea..9eecdc0a6fb111fb36e4e8e8666d056563e48cda 100644 +index 48103cefacf75a51619f7a3ebeb7731956a65a4f..09defe4a20c7b0794cba358c177e787f1c0273c1 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -957,6 +957,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -968,6 +968,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public void move(MoverType movementType, Vec3 movement) { @@ -17,7 +17,7 @@ index 99035a91f04cc838e30b860d480ef710e1dbe2ea..9eecdc0a6fb111fb36e4e8e8666d0565 if (this.noPhysics) { this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); } else { -@@ -1041,7 +1042,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1052,7 +1053,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } if (!bl.getType().isAir()) { diff --git a/patches/server/0818-config-for-disabling-entity-tag-tags.patch b/patches/server/0818-config-for-disabling-entity-tag-tags.patch new file mode 100644 index 000000000..f673ff71b --- /dev/null +++ b/patches/server/0818-config-for-disabling-entity-tag-tags.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Wed, 15 Sep 2021 14:52:42 -0700 +Subject: [PATCH] config for disabling entity tag tags + + +diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java +index 3ac31c869d0e53410558ddeb79c21d3f5a3decb6..c36b5aa3cf7ecff839f7115bf9be4776bcee13c3 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityType.java ++++ b/src/main/java/net/minecraft/world/entity/EntityType.java +@@ -502,6 +502,16 @@ public class EntityType implements FeatureElement, EntityTypeT + + if (minecraftserver != null && entity != null) { + if (world.isClientSide || !entity.onlyOpCanSetNbt() || player != null && minecraftserver.getPlayerList().isOp(player.getGameProfile())) { ++ // Paper start - filter out protected tags ++ if (player == null || !player.getBukkitEntity().hasPermission("minecraft.nbt.place")) { ++ nbt = nbt.update((compound) -> { ++ for (net.minecraft.commands.arguments.NbtPathArgument.NbtPath tag : world.paperConfig().entities.spawning.filteredEntityTagNbtPaths) { ++ tag.remove(compound); ++ } ++ }); ++ } ++ // Paper end - filter out protected tags ++ + nbt.loadInto(entity); + } + } diff --git a/patches/unapplied/server/0848-Use-single-player-info-update-packet-on-join.patch b/patches/server/0819-Use-single-player-info-update-packet-on-join.patch similarity index 89% rename from patches/unapplied/server/0848-Use-single-player-info-update-packet-on-join.patch rename to patches/server/0819-Use-single-player-info-update-packet-on-join.patch index 64b13bd01..cd6bae445 100644 --- a/patches/unapplied/server/0848-Use-single-player-info-update-packet-on-join.patch +++ b/patches/server/0819-Use-single-player-info-update-packet-on-join.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use single player info update packet on join diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 5f1c31323d58cdc4419cf5f8870a8acf121c7669..0c87fff227448f7f88e3377989b1091e4badcc53 100644 +index 6e6024d9c397894903130a4b91a621ae1844a4b5..c3beef7d81e43466d99dbc6a42150a4ae9fa7f54 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3339,7 +3339,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3429,7 +3429,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.signedMessageDecoder = session.createMessageDecoder(this.player.getUUID()); this.chatMessageChain.append(() -> { this.player.setChatSession(session); @@ -18,10 +18,10 @@ index 5f1c31323d58cdc4419cf5f8870a8acf121c7669..0c87fff227448f7f88e3377989b1091e } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 1478def0ba4bc02c1c466d80cc2b90919612c18a..0747b0042446271385371f1ca9c8fefdebd851b8 100644 +index b2634bdedfe8359da602cf600a2bdddbd762e7c2..eef1fb3265a088a2f6718631c1728f3e32014c14 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -359,6 +359,7 @@ public abstract class PlayerList { +@@ -361,6 +361,7 @@ public abstract class PlayerList { // CraftBukkit start - sendAll above replaced with this loop ClientboundPlayerInfoUpdatePacket packet = ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(player)); @@ -29,7 +29,7 @@ index 1478def0ba4bc02c1c466d80cc2b90919612c18a..0747b0042446271385371f1ca9c8fefd for (int i = 0; i < this.players.size(); ++i) { ServerPlayer entityplayer1 = (ServerPlayer) this.players.get(i); -@@ -366,12 +367,17 @@ public abstract class PlayerList { +@@ -368,12 +369,17 @@ public abstract class PlayerList { entityplayer1.connection.send(packet); } diff --git a/patches/unapplied/server/0849-Correctly-shrink-items-during-EntityResurrectEvent.patch b/patches/server/0820-Correctly-shrink-items-during-EntityResurrectEvent.patch similarity index 92% rename from patches/unapplied/server/0849-Correctly-shrink-items-during-EntityResurrectEvent.patch rename to patches/server/0820-Correctly-shrink-items-during-EntityResurrectEvent.patch index 54b162da7..d4dc43a7c 100644 --- a/patches/unapplied/server/0849-Correctly-shrink-items-during-EntityResurrectEvent.patch +++ b/patches/server/0820-Correctly-shrink-items-during-EntityResurrectEvent.patch @@ -22,10 +22,10 @@ This patch corrects this behaviour by only shrinking the item if a totem of undying was found and the event was called uncancelled. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 084d988ec3dcdae54a10309d34d335ca4f37b7b0..c022ec61fa6a84f4e68f4df0a0f07ba8bb368302 100644 +index 6ac6848fe27336a96a813c84d7d797cc9bc4c297..810e94674acff08eda6d98e91546a2338706ef42 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1618,7 +1618,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1638,7 +1638,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.level().getCraftServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { diff --git a/patches/unapplied/server/0850-Win-Screen-API.patch b/patches/server/0821-Win-Screen-API.patch similarity index 88% rename from patches/unapplied/server/0850-Win-Screen-API.patch rename to patches/server/0821-Win-Screen-API.patch index d42c24f3b..5844bd44e 100644 --- a/patches/unapplied/server/0850-Win-Screen-API.patch +++ b/patches/server/0821-Win-Screen-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Win Screen API public net.minecraft.server.level.ServerPlayer seenCredits diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5a2969f97207b3d42937e8afffbc9293cba7cbf6..c52399e0c19fd919d59c007786de7c8036c9a424 100644 +index 1925d55ffb0fbf554fc3d6f6d75f119146f60dca..1519220d02dfeb14fded5687b77a85306faf6dcd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1216,6 +1216,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1292,6 +1292,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(packet); } diff --git a/patches/unapplied/server/0851-Remove-CraftItemStack-setAmount-null-assignment.patch b/patches/server/0822-Remove-CraftItemStack-setAmount-null-assignment.patch similarity index 88% rename from patches/unapplied/server/0851-Remove-CraftItemStack-setAmount-null-assignment.patch rename to patches/server/0822-Remove-CraftItemStack-setAmount-null-assignment.patch index 0e5413097..35eb74a74 100644 --- a/patches/unapplied/server/0851-Remove-CraftItemStack-setAmount-null-assignment.patch +++ b/patches/server/0822-Remove-CraftItemStack-setAmount-null-assignment.patch @@ -16,10 +16,10 @@ with less than zero amounts, so this code doesn't create a problem with operations on the vanilla ItemStack. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 6b75314023adf313937990e31323dff9bacc564b..fb2e4881096459eff16a7c46faa9921166837ee9 100644 +index 79529a5208810d25aeab537eac70ed9c6583ef18..be2b7c2b412a1d64466c25c1b19b10a869cd288d 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -@@ -161,7 +161,7 @@ public final class CraftItemStack extends ItemStack { +@@ -160,7 +160,7 @@ public final class CraftItemStack extends ItemStack { } this.handle.setCount(amount); diff --git a/patches/unapplied/server/0852-Fix-force-opening-enchantment-tables.patch b/patches/server/0823-Fix-force-opening-enchantment-tables.patch similarity index 75% rename from patches/unapplied/server/0852-Fix-force-opening-enchantment-tables.patch rename to patches/server/0823-Fix-force-opening-enchantment-tables.patch index 57955b6cc..eac3ab63e 100644 --- a/patches/unapplied/server/0852-Fix-force-opening-enchantment-tables.patch +++ b/patches/server/0823-Fix-force-opening-enchantment-tables.patch @@ -5,16 +5,16 @@ Subject: [PATCH] Fix force-opening enchantment tables diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 98ee3a7eff6cd1dd3fdbd7cc6a94deebcefbc565..103d5e14972516968030df255cde49c82b93c38f 100644 +index 79faf3c64891899bf5d6d119154aba02d4665b3b..e1150d36de56466ad9fdd5f2cdb4c30855d4af70 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -405,7 +405,18 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -403,7 +403,18 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { // If there isn't an enchant table we can force create one, won't be very useful though. BlockPos pos = CraftLocation.toBlockPosition(location); -- this.getHandle().openMenu(((EnchantmentTableBlock) Blocks.ENCHANTING_TABLE).getMenuProvider(null, this.getHandle().level(), pos)); +- this.getHandle().openMenu(Blocks.ENCHANTING_TABLE.defaultBlockState().getMenuProvider(this.getHandle().level(), pos)); + // Paper start -+ MenuProvider menuProvider = ((EnchantmentTableBlock) Blocks.ENCHANTING_TABLE).getMenuProvider(null, this.getHandle().level(), pos); ++ MenuProvider menuProvider = Blocks.ENCHANTING_TABLE.defaultBlockState().getMenuProvider(this.getHandle().level(), pos); + if (menuProvider == null) { + if (!force) { + return null; diff --git a/patches/unapplied/server/0853-Add-Entity-Body-Yaw-API.patch b/patches/server/0824-Add-Entity-Body-Yaw-API.patch similarity index 85% rename from patches/unapplied/server/0853-Add-Entity-Body-Yaw-API.patch rename to patches/server/0824-Add-Entity-Body-Yaw-API.patch index d8eb3655e..e3035f51a 100644 --- a/patches/unapplied/server/0853-Add-Entity-Body-Yaw-API.patch +++ b/patches/server/0824-Add-Entity-Body-Yaw-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Entity Body Yaw API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 4dfbcaba4615bd761c1eb9d5994168c7202fc571..8025b3e9afebc9ad0c08453403422589bf5dd27d 100644 +index 365281dfc0308c5db0c72b56208d9b87be0e955e..991b94ff1186b1071a94b2662873dc071255e2e6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1154,6 +1154,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1164,6 +1164,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } // Paper end - entity powdered snow API @@ -43,10 +43,10 @@ index 4dfbcaba4615bd761c1eb9d5994168c7202fc571..8025b3e9afebc9ad0c08453403422589 @Override public boolean isInvisible() { // Paper - moved up from LivingEntity diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index b0c03854ee9936b1dac9cbf89e9977d978712d56..ab1e1a56f3811d4446a6b0a7461c0bddd8015228 100644 +index 51e9b9f7460ec4f8b14d570356026d433351806d..4f31bf6f51a72b010b850e1e62a06b455eac906c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -1191,4 +1191,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -1176,4 +1176,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { this.getHandle().frictionState = state; } // Paper end - friction API diff --git a/patches/unapplied/server/0854-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch b/patches/server/0825-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch similarity index 89% rename from patches/unapplied/server/0854-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch rename to patches/server/0825-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch index 355a9ece0..962917dab 100644 --- a/patches/unapplied/server/0854-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch +++ b/patches/server/0825-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch @@ -10,10 +10,10 @@ https://bugs.mojang.com/browse/MC-157464 https://github.com/PaperMC/Paper/issues/8569 diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java b/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java -index 5feef31a37aa30a0fdabd14396f5cdb05ad63030..d2917f9b215919890f28b513601863ccaced17c7 100644 +index 5a18bf854792339fcd54e32f8053d014f3d195a5..f000a6c1e61198e6dd06ae5f084d12fdf309f50a 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java -@@ -35,7 +35,7 @@ public class VillagerGoalPackages { +@@ -38,7 +38,7 @@ public class VillagerGoalPackages { Pair.of(1, new MoveToTargetSink()), Pair.of(2, PoiCompetitorScan.create()), Pair.of(3, new LookAndFollowTradingPlayerSink(speed)), diff --git a/patches/unapplied/server/0855-Add-EntityFertilizeEggEvent.patch b/patches/server/0826-Add-EntityFertilizeEggEvent.patch similarity index 89% rename from patches/unapplied/server/0855-Add-EntityFertilizeEggEvent.patch rename to patches/server/0826-Add-EntityFertilizeEggEvent.patch index 975cf3163..4936a7550 100644 --- a/patches/unapplied/server/0855-Add-EntityFertilizeEggEvent.patch +++ b/patches/server/0826-Add-EntityFertilizeEggEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityFertilizeEggEvent diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -index cfc0cee09dfd522409bb5853fc96528bd0137475..6a98f66b7701e8af389ca9a1e9eb230a6100c838 100644 +index b550befd7bd05951be160f81600200b0b31bae5b..3eabf1e94c0a1086f471e30bf523581907169c58 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -@@ -443,6 +443,10 @@ public class Turtle extends Animal { +@@ -441,6 +441,10 @@ public class Turtle extends Animal { if (entityplayer == null && this.partner.getLoveCause() != null) { entityplayer = this.partner.getLoveCause(); } @@ -19,7 +19,7 @@ index cfc0cee09dfd522409bb5853fc96528bd0137475..6a98f66b7701e8af389ca9a1e9eb230a if (entityplayer != null) { entityplayer.awardStat(Stats.ANIMALS_BRED); -@@ -457,7 +461,7 @@ public class Turtle extends Animal { +@@ -455,7 +459,7 @@ public class Turtle extends Animal { RandomSource randomsource = this.animal.getRandom(); if (this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { @@ -29,10 +29,10 @@ index cfc0cee09dfd522409bb5853fc96528bd0137475..6a98f66b7701e8af389ca9a1e9eb230a } diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -index 70bbc325e3a1f7f334a6d1024097800efa6bec03..a03fb7aa9f4528f4885db88eaf480202d5f54750 100644 +index a7af50ebc17abd829a7254c03785206da9624060..816977990639ec0559b652fc9666afd5046f0a5d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -@@ -263,7 +263,12 @@ public class Frog extends Animal implements VariantHolder { +@@ -261,7 +261,12 @@ public class Frog extends Animal implements VariantHolder> { @Override public void spawnChildFromBreeding(ServerLevel world, Animal other) { @@ -47,10 +47,10 @@ index 70bbc325e3a1f7f334a6d1024097800efa6bec03..a03fb7aa9f4528f4885db88eaf480202 } diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -index 0e85e3ab58d848b119212fa7d2eb4f92d3efe29b..0a5b953bd8c0c7f181da4090b950e9e6524b6d61 100644 +index a0c52ce65d4035d135b1536c7408a6867a553447..dc035bf94c5f6574ed8ad369b327b7f7a145e1d6 100644 --- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -@@ -347,11 +347,16 @@ public class Sniffer extends Animal { +@@ -345,11 +345,16 @@ public class Sniffer extends Animal { @Override public void spawnChildFromBreeding(ServerLevel world, Animal other) { @@ -69,10 +69,10 @@ index 0e85e3ab58d848b119212fa7d2eb4f92d3efe29b..0a5b953bd8c0c7f181da4090b950e9e6 this.playSound(SoundEvents.SNIFFER_EGG_PLOP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 0.5F); } // Paper - Call EntityDropItemEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 82c0a13558948a5f5e5cee0e2b67fcde5a906301..3291d8e14b53185a774b0219251d8a080192992b 100644 +index a226b7cdc9c63ef09d7d48269c287af1ab6dbdc4..e9a70547324dabd97dc90820515a11d2b630a704 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -2114,4 +2114,28 @@ public class CraftEventFactory { +@@ -2109,4 +2109,28 @@ public class CraftEventFactory { return event.callEvent(); } // Paper end diff --git a/patches/unapplied/server/0856-Fix-HumanEntity-drop-not-updating-the-client-inv.patch b/patches/server/0827-Fix-HumanEntity-drop-not-updating-the-client-inv.patch similarity index 90% rename from patches/unapplied/server/0856-Fix-HumanEntity-drop-not-updating-the-client-inv.patch rename to patches/server/0827-Fix-HumanEntity-drop-not-updating-the-client-inv.patch index d7bf05c02..a3e0925b4 100644 --- a/patches/unapplied/server/0856-Fix-HumanEntity-drop-not-updating-the-client-inv.patch +++ b/patches/server/0827-Fix-HumanEntity-drop-not-updating-the-client-inv.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Fix HumanEntity#drop not updating the client inv public net.minecraft.server.level.ServerPlayer containerSynchronizer diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 103d5e14972516968030df255cde49c82b93c38f..6a52789d6e68438c1eaa2fb9af591fa9e1d381e2 100644 +index e1150d36de56466ad9fdd5f2cdb4c30855d4af70..3d36d79a4e7f16f6face3465cdf54656984f3ebc 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -752,8 +752,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -750,8 +750,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { // Paper end @Override public boolean dropItem(boolean dropAll) { diff --git a/patches/unapplied/server/0857-Add-CompostItemEvent-and-EntityCompostItemEvent.patch b/patches/server/0828-Add-CompostItemEvent-and-EntityCompostItemEvent.patch similarity index 91% rename from patches/unapplied/server/0857-Add-CompostItemEvent-and-EntityCompostItemEvent.patch rename to patches/server/0828-Add-CompostItemEvent-and-EntityCompostItemEvent.patch index a1fa4eea7..e909caa12 100644 --- a/patches/unapplied/server/0857-Add-CompostItemEvent-and-EntityCompostItemEvent.patch +++ b/patches/server/0828-Add-CompostItemEvent-and-EntityCompostItemEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add CompostItemEvent and EntityCompostItemEvent diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java -index 413b307acaad5823b9e06f49fa2faf561f5f7b9a..f9084e2605d7403721fe6b714bfad051f932aaef 100644 +index fcd8a977eaa52cd478507c3b44fa72b194df9540..0af05d6f046368af5a5a600288b8329c17f278c7 100644 --- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java -@@ -328,7 +328,21 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { +@@ -336,7 +336,21 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { int i = (Integer) iblockdata.getValue(ComposterBlock.LEVEL); float f = ComposterBlock.COMPOSTABLES.getFloat(itemstack.getItem()); @@ -31,7 +31,7 @@ index 413b307acaad5823b9e06f49fa2faf561f5f7b9a..f9084e2605d7403721fe6b714bfad051 return iblockdata; } else { int j = i + 1; -@@ -477,6 +491,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { +@@ -485,6 +499,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { if (!itemstack.isEmpty()) { this.changed = true; BlockState iblockdata = ComposterBlock.addItem((Entity) null, this.state, this.level, this.pos, itemstack); diff --git a/patches/unapplied/server/0858-Correctly-handle-ArmorStand-invisibility.patch b/patches/server/0829-Correctly-handle-ArmorStand-invisibility.patch similarity index 100% rename from patches/unapplied/server/0858-Correctly-handle-ArmorStand-invisibility.patch rename to patches/server/0829-Correctly-handle-ArmorStand-invisibility.patch diff --git a/patches/unapplied/server/0859-Fix-advancement-triggers-for-entity-damage.patch b/patches/server/0830-Fix-advancement-triggers-for-entity-damage.patch similarity index 82% rename from patches/unapplied/server/0859-Fix-advancement-triggers-for-entity-damage.patch rename to patches/server/0830-Fix-advancement-triggers-for-entity-damage.patch index e5b6bd487..2d2416267 100644 --- a/patches/unapplied/server/0859-Fix-advancement-triggers-for-entity-damage.patch +++ b/patches/server/0830-Fix-advancement-triggers-for-entity-damage.patch @@ -10,23 +10,23 @@ Fixes a couple places where the original damage and modified damage were passed in the reverse order to the advancement triggers diff --git a/src/main/java/net/minecraft/world/entity/Interaction.java b/src/main/java/net/minecraft/world/entity/Interaction.java -index f054d67a637b204de604fadc0d321f5c9816d808..fc5f1e1b445f0a55a35a31d58a90920a80275662 100644 +index 2ebbf7954dc5e0d6c9d53327d05b725eec310086..c5bd2e90ad74ba08910f65a2e07b6f76435df10f 100644 --- a/src/main/java/net/minecraft/world/entity/Interaction.java +++ b/src/main/java/net/minecraft/world/entity/Interaction.java -@@ -160,7 +160,7 @@ public class Interaction extends Entity implements Attackable, Targeting { - if (entityhuman instanceof ServerPlayer) { - ServerPlayer entityplayer = (ServerPlayer) entityhuman; - +@@ -156,7 +156,7 @@ public class Interaction extends Entity implements Attackable, Targeting { + // CraftBukkit end + this.attack = new Interaction.PlayerAction(entityhuman.getUUID(), this.level().getGameTime()); + if (entityhuman instanceof ServerPlayer entityplayer) { - CriteriaTriggers.PLAYER_HURT_ENTITY.trigger(entityplayer, this, source, (float) event.getFinalDamage(), 1.0F, false); // CraftBukkit + CriteriaTriggers.PLAYER_HURT_ENTITY.trigger(entityplayer, this, entityhuman.damageSources().generic(), 1.0F, (float) event.getFinalDamage(), false); // CraftBukkit // Paper - use correct source and fix taken/dealt param order } return !this.getResponse(); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index c022ec61fa6a84f4e68f4df0a0f07ba8bb368302..09a48779046484c2f3628d1499659e247c736fce 100644 +index 810e94674acff08eda6d98e91546a2338706ef42..a356d0476e6ff9389809e8db1f584ac4bffe8be9 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2322,7 +2322,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2369,7 +2369,7 @@ public abstract class LivingEntity extends Entity implements Attackable { // Duplicate triggers if blocking if (event.getDamage(DamageModifier.BLOCKING) < 0) { if (this instanceof ServerPlayer) { @@ -35,7 +35,7 @@ index c022ec61fa6a84f4e68f4df0a0f07ba8bb368302..09a48779046484c2f3628d1499659e24 f2 = (float) -event.getDamage(DamageModifier.BLOCKING); if (f2 > 0.0F && f2 < 3.4028235E37F) { ((ServerPlayer) this).awardStat(Stats.DAMAGE_BLOCKED_BY_SHIELD, Math.round(originalDamage * 10.0F)); -@@ -2330,7 +2330,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2377,7 +2377,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } if (damagesource.getEntity() instanceof ServerPlayer) { diff --git a/patches/unapplied/server/0860-Fix-text-display-error-on-spawn.patch b/patches/server/0831-Fix-text-display-error-on-spawn.patch similarity index 85% rename from patches/unapplied/server/0860-Fix-text-display-error-on-spawn.patch rename to patches/server/0831-Fix-text-display-error-on-spawn.patch index 5ee377452..7f64cfe6d 100644 --- a/patches/unapplied/server/0860-Fix-text-display-error-on-spawn.patch +++ b/patches/server/0831-Fix-text-display-error-on-spawn.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix text display error on spawn diff --git a/src/main/java/net/minecraft/world/entity/Display.java b/src/main/java/net/minecraft/world/entity/Display.java -index 4a9aad128c884d659f42f5d6b35e2d7147c4bc17..bba45aa7ba4fa578344ec2b9dfa552097770a59f 100644 +index bd56721485b3b4ac81c97d60fc2a83bfc20977c0..a658943669cdfd49f66ba713505d11b33306ed86 100644 --- a/src/main/java/net/minecraft/world/entity/Display.java +++ b/src/main/java/net/minecraft/world/entity/Display.java -@@ -899,7 +899,7 @@ public abstract class Display extends Entity { +@@ -892,7 +892,7 @@ public abstract class Display extends Entity { b = loadFlag(b, nbt, "default_background", (byte)4); Optional optional = Display.TextDisplay.Align.CODEC .decode(NbtOps.INSTANCE, nbt.get("alignment")) diff --git a/patches/unapplied/server/0861-Fix-inventories-returning-null-Locations.patch b/patches/server/0832-Fix-inventories-returning-null-Locations.patch similarity index 89% rename from patches/unapplied/server/0861-Fix-inventories-returning-null-Locations.patch rename to patches/server/0832-Fix-inventories-returning-null-Locations.patch index 763bde395..8c992b49d 100644 --- a/patches/unapplied/server/0861-Fix-inventories-returning-null-Locations.patch +++ b/patches/server/0832-Fix-inventories-returning-null-Locations.patch @@ -9,7 +9,7 @@ when a block or entity location is readily available Co-authored-by: Lukas Planz diff --git a/src/main/java/net/minecraft/world/SimpleContainer.java b/src/main/java/net/minecraft/world/SimpleContainer.java -index d5eeb2fcb119b815213aeffb3811d4a843502e50..ff1aba1e69cfde633fd01724f1a8d0af7f59437f 100644 +index c26161784359ea167e11de8aa58eda3b4851059c..6632cf24ebe6d147950a1fdb876660937da86b73 100644 --- a/src/main/java/net/minecraft/world/SimpleContainer.java +++ b/src/main/java/net/minecraft/world/SimpleContainer.java @@ -63,6 +63,16 @@ public class SimpleContainer implements Container, StackedContentsCompatible { @@ -30,10 +30,10 @@ index d5eeb2fcb119b815213aeffb3811d4a843502e50..ff1aba1e69cfde633fd01724f1a8d0af } diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -index 9599a5f96601030bf7f7cbd3392861d626959f9d..2813a87a01d0704a3de210cd005073f953d538f8 100644 +index 580e5714c62aef5a5fdd16606712b96f3d41c938..37735417e2a3df96eea88aa0a3f2d7faeb823a2e 100644 --- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java +++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -@@ -51,6 +51,12 @@ public class BeaconMenu extends AbstractContainerMenu { +@@ -52,6 +52,12 @@ public class BeaconMenu extends AbstractContainerMenu { public int getMaxStackSize() { return 1; } @@ -47,7 +47,7 @@ index 9599a5f96601030bf7f7cbd3392861d626959f9d..2813a87a01d0704a3de210cd005073f9 checkContainerDataCount(propertyDelegate, 3); this.beaconData = propertyDelegate; diff --git a/src/main/java/net/minecraft/world/inventory/MerchantContainer.java b/src/main/java/net/minecraft/world/inventory/MerchantContainer.java -index 083e50e27685f441ede4c75e913d671fe45d1d15..ac4ec7157cf93b0cbc4472dc42fbbbff3402335a 100644 +index 7cc96b62f6bacdb44a37d74db214bd0e11c4d503..9140fab07aab32065f7a3b5d13dd17d61dc6d646 100644 --- a/src/main/java/net/minecraft/world/inventory/MerchantContainer.java +++ b/src/main/java/net/minecraft/world/inventory/MerchantContainer.java @@ -65,7 +65,7 @@ public class MerchantContainer implements Container { diff --git a/patches/unapplied/server/0862-Add-Shearable-API.patch b/patches/server/0833-Add-Shearable-API.patch similarity index 97% rename from patches/unapplied/server/0862-Add-Shearable-API.patch rename to patches/server/0833-Add-Shearable-API.patch index f97657b8e..34eb025e6 100644 --- a/patches/unapplied/server/0862-Add-Shearable-API.patch +++ b/patches/server/0833-Add-Shearable-API.patch @@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..bcf254e3c81cf1e401bddc850fb24ad2 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java -index cc69f471c623c65251ccf7015499d8dbdb70ffad..b453a47cadbda2e22262bcdc5454c4c6cf5b2583 100644 +index 986f7b18112ef183de3bbff269a92bf6ac945477..9cc81bcccbf1141f66fedada1359b7c0dfa8e22a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java @@ -14,7 +14,7 @@ import org.bukkit.entity.MushroomCow; diff --git a/patches/unapplied/server/0863-Fix-SpawnEggMeta-get-setSpawnedType.patch b/patches/server/0834-Fix-SpawnEggMeta-get-setSpawnedType.patch similarity index 91% rename from patches/unapplied/server/0863-Fix-SpawnEggMeta-get-setSpawnedType.patch rename to patches/server/0834-Fix-SpawnEggMeta-get-setSpawnedType.patch index 682696f50..bf2852895 100644 --- a/patches/unapplied/server/0863-Fix-SpawnEggMeta-get-setSpawnedType.patch +++ b/patches/server/0834-Fix-SpawnEggMeta-get-setSpawnedType.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix SpawnEggMeta#get/setSpawnedType diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java -index 50a5321a59895739d3d42f2d06ac9d1b43480cfa..7ff690f386b7fb9e090c86a28f649119505af7b9 100644 +index c36c004156d3a89dc2209423c57a2ce230d686dc..a6d2370113eb44c0863b7837362dbb350f5057c6 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java -@@ -219,6 +219,30 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { +@@ -224,6 +224,30 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { public void setSpawnedType(EntityType type) { throw new UnsupportedOperationException("Must change item type to set spawned type"); } diff --git a/patches/unapplied/server/0864-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch b/patches/server/0835-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch similarity index 88% rename from patches/unapplied/server/0864-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch rename to patches/server/0835-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch index 576441539..c51be7e3a 100644 --- a/patches/unapplied/server/0864-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch +++ b/patches/server/0835-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix crash relating to bad recipes in furnace-like tile 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 d7beeac4a8e4a16221809663a5aa03389a759742..d04fc84eef11adb5ea64077f48794b6ed7fb3ada 100644 +index d19e799491f790ca967a0731ef95a06993a7ab9a..f40b2582d9087f9dbb5cab950304698f33fdd879 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 -@@ -643,6 +643,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -613,6 +613,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit Entry entry = (Entry) objectiterator.next(); worldserver.getRecipeManager().byKey((ResourceLocation) entry.getKey()).ifPresent((recipeholder) -> { diff --git a/patches/unapplied/server/0865-Treat-sequence-violations-like-they-should-be.patch b/patches/server/0836-Treat-sequence-violations-like-they-should-be.patch similarity index 86% rename from patches/unapplied/server/0865-Treat-sequence-violations-like-they-should-be.patch rename to patches/server/0836-Treat-sequence-violations-like-they-should-be.patch index 10cef59fc..78ba284e6 100644 --- a/patches/unapplied/server/0865-Treat-sequence-violations-like-they-should-be.patch +++ b/patches/server/0836-Treat-sequence-violations-like-they-should-be.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Treat sequence violations like they should be diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0c87fff227448f7f88e3377989b1091e4badcc53..f2b6c74317dbedaa983bb5d821255dc40e1c81e4 100644 +index c3beef7d81e43466d99dbc6a42150a4ae9fa7f54..e351ed77fbe1ea9de2dd5600d61524eb39c17899 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1964,6 +1964,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1966,6 +1966,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl public void ackBlockChangesUpTo(int sequence) { if (sequence < 0) { diff --git a/patches/unapplied/server/0866-remove-duplicate-animate-packet-for-records.patch b/patches/server/0837-remove-duplicate-animate-packet-for-records.patch similarity index 86% rename from patches/unapplied/server/0866-remove-duplicate-animate-packet-for-records.patch rename to patches/server/0837-remove-duplicate-animate-packet-for-records.patch index 9254f5b8c..47fc3e8c3 100644 --- a/patches/unapplied/server/0866-remove-duplicate-animate-packet-for-records.patch +++ b/patches/server/0837-remove-duplicate-animate-packet-for-records.patch @@ -5,10 +5,10 @@ Subject: [PATCH] remove duplicate animate packet for records diff --git a/src/main/java/net/minecraft/world/item/RecordItem.java b/src/main/java/net/minecraft/world/item/RecordItem.java -index eca08037fd2742e6e969f91367a0ae053f61a23b..d2ea1b1ea4ac37af09985e1c9da14049c262df7a 100644 +index 115ac21ea743d30fe8ba62b206da4f5a1bd56cc4..815220924753e87a8f485c2c928222561c726855 100644 --- a/src/main/java/net/minecraft/world/item/RecordItem.java +++ b/src/main/java/net/minecraft/world/item/RecordItem.java -@@ -46,7 +46,7 @@ public class RecordItem extends Item { +@@ -47,7 +47,7 @@ public class RecordItem extends Item { ItemStack itemstack = context.getItemInHand(); if (!world.isClientSide) { diff --git a/patches/unapplied/server/0867-Prevent-causing-expired-keys-from-impacting-new-join.patch b/patches/server/0838-Prevent-causing-expired-keys-from-impacting-new-join.patch similarity index 87% rename from patches/unapplied/server/0867-Prevent-causing-expired-keys-from-impacting-new-join.patch rename to patches/server/0838-Prevent-causing-expired-keys-from-impacting-new-join.patch index e66fad7ec..6a02dff90 100644 --- a/patches/unapplied/server/0867-Prevent-causing-expired-keys-from-impacting-new-join.patch +++ b/patches/server/0838-Prevent-causing-expired-keys-from-impacting-new-join.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent causing expired keys from impacting new joins diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java -index e4f0949b6538734ff25daf68a428262481feeb81..754a2a5e958a04b3f8bf216b6022f547aa1cd36f 100644 +index 68c062cbaa030d62d97c9c003651f8fc17a00a6b..6247a21c9c391abf1f6db3482c659593e4f29355 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java -@@ -101,7 +101,15 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet serialized.chatSession = buf.readNullable(RemoteChatSession.Data::read), @@ -26,10 +26,10 @@ index e4f0949b6538734ff25daf68a428262481feeb81..754a2a5e958a04b3f8bf216b6022f547 UPDATE_GAME_MODE((serialized, buf) -> serialized.gameMode = GameType.byId(buf.readVarInt()), (buf, entry) -> buf.writeVarInt(entry.gameMode().getId())), UPDATE_LISTED((serialized, buf) -> serialized.listed = buf.readBoolean(), (buf, entry) -> buf.writeBoolean(entry.listed())), diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f2b6c74317dbedaa983bb5d821255dc40e1c81e4..1de8ee39347a6f4c56c2d3aa0e32887b57b80524 100644 +index e351ed77fbe1ea9de2dd5600d61524eb39c17899..1a0245c798107d2d4239e07262f5cc89490a3b08 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -286,6 +286,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -296,6 +296,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private int knownMovePacketCount; @Nullable private RemoteChatSession chatSession; @@ -37,7 +37,7 @@ index f2b6c74317dbedaa983bb5d821255dc40e1c81e4..1de8ee39347a6f4c56c2d3aa0e32887b private SignedMessageChain.Decoder signedMessageDecoder; private final LastSeenMessagesValidator lastSeenMessages = new LastSeenMessagesValidator(20); private final MessageSignatureCache messageSignatureCache = MessageSignatureCache.createDefault(); -@@ -394,6 +395,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -408,6 +409,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause } @@ -50,8 +50,8 @@ index f2b6c74317dbedaa983bb5d821255dc40e1c81e4..1de8ee39347a6f4c56c2d3aa0e32887b + } - public void resetPosition() { -@@ -3337,6 +3345,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + private int getMaximumFlyingTicks(Entity vehicle) { +@@ -3427,6 +3435,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private void resetPlayerChatState(RemoteChatSession session) { this.chatSession = session; diff --git a/patches/unapplied/server/0868-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch b/patches/server/0839-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch similarity index 77% rename from patches/unapplied/server/0868-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch rename to patches/server/0839-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch index b0714f833..ac0b41b78 100644 --- a/patches/unapplied/server/0868-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch +++ b/patches/server/0839-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Prevent GameEvents being fired from unloaded chunks diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 5f1a4a35d2179b7ff5a95390f82d65cacf4fd457..a6af6585aca50033f45138a4408218b056b8b785 100644 +index 2eda55a09632a6c5668600251a8c491c501fbe2b..80c927c906d1b6119c1b32b8982d879fbbd4d257 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1368,6 +1368,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1374,6 +1374,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @Override - public void gameEvent(GameEvent event, Vec3 emitterPos, GameEvent.Context emitter) { + public void gameEvent(Holder event, Vec3 emitterPos, GameEvent.Context emitter) { + // Paper start - Prevent GameEvents being fired from unloaded chunks + if (this.getChunkIfLoadedImmediately((Mth.floor(emitterPos.x) >> 4), (Mth.floor(emitterPos.z) >> 4)) == null) { + return; diff --git a/patches/unapplied/server/0869-Use-array-for-gamerule-storage.patch b/patches/server/0840-Use-array-for-gamerule-storage.patch similarity index 81% rename from patches/unapplied/server/0869-Use-array-for-gamerule-storage.patch rename to patches/server/0840-Use-array-for-gamerule-storage.patch index 1a7c2006a..194ff8f15 100644 --- a/patches/unapplied/server/0869-Use-array-for-gamerule-storage.patch +++ b/patches/server/0840-Use-array-for-gamerule-storage.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Use array for gamerule storage diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java -index ac7a5410b01a6741e3b548d153f37ea1d8c1a4cb..4a340bd1f1859e43bb58e68aee4018fdb4ca7a5a 100644 +index 51e560d7856f230c5aa2dc32706c3a4996720aa5..89e327bc3a45879fe68887c7aadb077f31a770eb 100644 --- a/src/main/java/net/minecraft/world/level/GameRules.java +++ b/src/main/java/net/minecraft/world/level/GameRules.java -@@ -115,6 +115,7 @@ public class GameRules { - public static final GameRules.Key RULE_DO_VINES_SPREAD = GameRules.register("doVinesSpread", GameRules.Category.UPDATES, GameRules.BooleanValue.create(true)); - public static final GameRules.Key RULE_ENDER_PEARLS_VANISH_ON_DEATH = GameRules.register("enderPearlsVanishOnDeath", GameRules.Category.PLAYER, GameRules.BooleanValue.create(true)); +@@ -122,6 +122,7 @@ public class GameRules { + worldserver.setDefaultSpawnPos(worldserver.getSharedSpawnPos(), worldserver.getSharedSpawnAngle()); + })); private final Map, GameRules.Value> rules; + private final GameRules.Value[] gameruleArray; // Paper - Perf: Use array for gamerule storage private static > GameRules.Key register(String name, GameRules.Category category, GameRules.Type type) { GameRules.Key gamerules_gamerulekey = new GameRules.Key<>(name, category); -@@ -133,17 +134,30 @@ public class GameRules { +@@ -140,17 +141,30 @@ public class GameRules { } public GameRules() { @@ -50,7 +50,7 @@ index ac7a5410b01a6741e3b548d153f37ea1d8c1a4cb..4a340bd1f1859e43bb58e68aee4018fd } public CompoundTag createTag() { -@@ -202,6 +216,10 @@ public class GameRules { +@@ -209,6 +223,10 @@ public class GameRules { } public static final class Key> { diff --git a/patches/unapplied/server/0870-Fix-a-couple-of-upstream-bed-issues.patch b/patches/server/0841-Fix-a-couple-of-upstream-bed-issues.patch similarity index 89% rename from patches/unapplied/server/0870-Fix-a-couple-of-upstream-bed-issues.patch rename to patches/server/0841-Fix-a-couple-of-upstream-bed-issues.patch index 6740daf4d..b2cad9c8d 100644 --- a/patches/unapplied/server/0870-Fix-a-couple-of-upstream-bed-issues.patch +++ b/patches/server/0841-Fix-a-couple-of-upstream-bed-issues.patch @@ -10,10 +10,10 @@ but then replaced it with a bed, you could respawn at the bed in that world. 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 c14cddd42c61512c312231b1e93ccc6efbde620c..38fcde81d797dc46409f5a9ed426fe296d79bdfa 100644 +index 872bec4c366c86177334452315cc4a8097dae3c0..e9f8949267208b93f0c56c36ada38274ed4280f5 100644 --- a/src/main/java/net/minecraft/world/level/block/BedBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java -@@ -109,6 +109,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -108,6 +108,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - add exploded state return InteractionResult.SUCCESS; } else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) { @@ -21,7 +21,7 @@ index c14cddd42c61512c312231b1e93ccc6efbde620c..38fcde81d797dc46409f5a9ed426fe29 if (!this.kickVillagerOutOfBed(world, pos)) { player.displayClientMessage(Component.translatable("block.minecraft.bed.occupied"), true); } -@@ -166,8 +167,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -165,8 +166,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock // CraftBukkit end public static boolean canSetSpawn(Level world) { diff --git a/patches/unapplied/server/0871-Fix-demo-flag-not-enabling-demo-mode.patch b/patches/server/0842-Fix-demo-flag-not-enabling-demo-mode.patch similarity index 75% rename from patches/unapplied/server/0871-Fix-demo-flag-not-enabling-demo-mode.patch rename to patches/server/0842-Fix-demo-flag-not-enabling-demo-mode.patch index af05cbe09..d64dd23e3 100644 --- a/patches/unapplied/server/0871-Fix-demo-flag-not-enabling-demo-mode.patch +++ b/patches/server/0842-Fix-demo-flag-not-enabling-demo-mode.patch @@ -6,17 +6,17 @@ Subject: [PATCH] Fix demo flag not enabling demo mode https://github.com/PaperMC/Paper/issues/9046 diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 953e228afc6f706b819bb26655b91761436cc68d..2906cb10461b5334a7555046384c28848eec149f 100644 +index 13e1a914d4523f1c192db2a9a1ee6522e0ee27da..c33f85b570f159ab465b5a10a8044a81f2797f43 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -321,7 +321,9 @@ public class Main { +@@ -325,7 +325,9 @@ public class Main { /* - dedicatedserver1.setPort((Integer) optionset.valueOf(optionspec10)); + dedicatedserver1.setPort((Integer) optionset.valueOf(optionspec11)); - dedicatedserver1.setDemo(optionset.has(optionspec2)); + */ -+ dedicatedserver1.setDemo(optionset.has("demo")); // Paper - Restore setting the demo mode ++ dedicatedserver1.setDemo(optionset.has("demo")); // Paper + /* - dedicatedserver1.setId((String) optionset.valueOf(optionspec11)); + dedicatedserver1.setId((String) optionset.valueOf(optionspec12)); */ - boolean flag1 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui"); + boolean flag2 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui"); diff --git a/patches/unapplied/server/0872-Add-Mob-Experience-reward-API.patch b/patches/server/0843-Add-Mob-Experience-reward-API.patch similarity index 81% rename from patches/unapplied/server/0872-Add-Mob-Experience-reward-API.patch rename to patches/server/0843-Add-Mob-Experience-reward-API.patch index 874d48152..487fe9e56 100644 --- a/patches/unapplied/server/0872-Add-Mob-Experience-reward-API.patch +++ b/patches/server/0843-Add-Mob-Experience-reward-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Mob Experience reward API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index ad293ad9d5dcd7836a4fa29b4b687346e3ae516c..31f62fbb54ec7b270fbd8afba7bd7c4bfafa09e3 100644 +index 921594a78ea511337434b29b5bc1a037eb30992c..e155501fb3a88edf3ddac3aa0aae1b6a5a84962e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -@@ -170,4 +170,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { +@@ -167,4 +167,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { this.getHandle().setAggressive(aggressive); } // Paper end diff --git a/patches/unapplied/server/0873-Break-redstone-on-top-of-trap-doors-early.patch b/patches/server/0844-Break-redstone-on-top-of-trap-doors-early.patch similarity index 96% rename from patches/unapplied/server/0873-Break-redstone-on-top-of-trap-doors-early.patch rename to patches/server/0844-Break-redstone-on-top-of-trap-doors-early.patch index fd04a3843..2f89b7d78 100644 --- a/patches/unapplied/server/0873-Break-redstone-on-top-of-trap-doors-early.patch +++ b/patches/server/0844-Break-redstone-on-top-of-trap-doors-early.patch @@ -7,7 +7,7 @@ This logic hooks into the neighbour update which should be invoked as a result of redstone powering the trap door. diff --git a/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java b/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java -index 98566a0d8776bd460abc28d56c5df7d6b7ff0506..1027e5e8da4323714a3e7fed8d39264b8b9e50e7 100644 +index 26096c28f654118b0d541f33c659fbc43b34509b..2b5fdcb12dcd8730df24113b9a6d295f000dd9f6 100644 --- a/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java @@ -153,7 +153,26 @@ public class TrapDoorBlock extends HorizontalDirectionalBlock implements SimpleW diff --git a/patches/unapplied/server/0874-Avoid-Lazy-Initialization-for-Enum-Fields.patch b/patches/server/0845-Avoid-Lazy-Initialization-for-Enum-Fields.patch similarity index 95% rename from patches/unapplied/server/0874-Avoid-Lazy-Initialization-for-Enum-Fields.patch rename to patches/server/0845-Avoid-Lazy-Initialization-for-Enum-Fields.patch index ac37b3fe8..becde16ce 100644 --- a/patches/unapplied/server/0874-Avoid-Lazy-Initialization-for-Enum-Fields.patch +++ b/patches/server/0845-Avoid-Lazy-Initialization-for-Enum-Fields.patch @@ -7,7 +7,7 @@ This patch is meant to get rid of any instances of lazy initialization that Mine This has the possibility to create race condition issues, and generally don't make sense to be lazily done anyways. diff --git a/src/main/java/com/mojang/math/OctahedralGroup.java b/src/main/java/com/mojang/math/OctahedralGroup.java -index 05d28a08c1fdf75221f5d774fe49d905840ae472..207f424b2bf5e0c48f33e4553c7c6019ef2dd009 100644 +index 0a3b6b8e250bd35530c05a1cdaf2eb8a9af4c72b..9aa82fc757c67a9456b2bdec744c0cb474d64df6 100644 --- a/src/main/java/com/mojang/math/OctahedralGroup.java +++ b/src/main/java/com/mojang/math/OctahedralGroup.java @@ -110,6 +110,7 @@ public enum OctahedralGroup implements StringRepresentable { diff --git a/patches/unapplied/server/0875-More-accurate-isInOpenWater-impl.patch b/patches/server/0846-More-accurate-isInOpenWater-impl.patch similarity index 100% rename from patches/unapplied/server/0875-More-accurate-isInOpenWater-impl.patch rename to patches/server/0846-More-accurate-isInOpenWater-impl.patch diff --git a/patches/unapplied/server/0877-Expand-PlayerItemMendEvent.patch b/patches/server/0847-Expand-PlayerItemMendEvent.patch similarity index 89% rename from patches/unapplied/server/0877-Expand-PlayerItemMendEvent.patch rename to patches/server/0847-Expand-PlayerItemMendEvent.patch index 8faaf4a00..9e637574b 100644 --- a/patches/unapplied/server/0877-Expand-PlayerItemMendEvent.patch +++ b/patches/server/0847-Expand-PlayerItemMendEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expand PlayerItemMendEvent diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -index a9c30fb4cfe4ff7bb27d498218373c572031fab8..36422fb394a158f36c84ba0ee03cc704956c91b2 100644 +index adc3e6298a1946fdea029c82a9954fb5b6e24497..a207a31d80a302dbdfe80f8727222542d3a78da2 100644 --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -@@ -338,7 +338,7 @@ public class ExperienceOrb extends Entity { +@@ -344,7 +344,7 @@ public class ExperienceOrb extends Entity { ItemStack itemstack = (ItemStack) entry.getValue(); int j = Math.min(this.xpToDurability(amount), itemstack.getDamageValue()); // CraftBukkit start @@ -17,7 +17,7 @@ index a9c30fb4cfe4ff7bb27d498218373c572031fab8..36422fb394a158f36c84ba0ee03cc704 j = event.getRepairAmount(); if (event.isCancelled()) { return amount; -@@ -346,8 +346,13 @@ public class ExperienceOrb extends Entity { +@@ -352,8 +352,13 @@ public class ExperienceOrb extends Entity { // CraftBukkit end itemstack.setDamageValue(itemstack.getDamageValue() - j); @@ -33,10 +33,10 @@ index a9c30fb4cfe4ff7bb27d498218373c572031fab8..36422fb394a158f36c84ba0ee03cc704 return k > 0 ? this.repairPlayerItems(player, k) : 0; } else { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c52399e0c19fd919d59c007786de7c8036c9a424..af4cf6ff7123b67807b147b80d143405ec6998a4 100644 +index 1519220d02dfeb14fded5687b77a85306faf6dcd..722c69e0149a9bf35159a7ffbb338fbc42600f0e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1759,11 +1759,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1835,11 +1835,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ()); int i = Math.min(orb.xpToDurability(amount), itemstack.getDamageValue()); @@ -51,10 +51,10 @@ index c52399e0c19fd919d59c007786de7c8036c9a424..af4cf6ff7123b67807b147b80d143405 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 3291d8e14b53185a774b0219251d8a080192992b..e457cd3b6a5a627f18fa8ce7fca90e75e0adb8ea 100644 +index e9a70547324dabd97dc90820515a11d2b630a704..c1b5d9713cb301dc06b74d97dca4fd5562c539e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1272,10 +1272,10 @@ public class CraftEventFactory { +@@ -1267,10 +1267,10 @@ public class CraftEventFactory { return event; } diff --git a/patches/unapplied/server/0878-Refresh-ProjectileSource-for-projectiles.patch b/patches/server/0848-Refresh-ProjectileSource-for-projectiles.patch similarity index 91% rename from patches/unapplied/server/0878-Refresh-ProjectileSource-for-projectiles.patch rename to patches/server/0848-Refresh-ProjectileSource-for-projectiles.patch index 2041ea768..4b9522e0d 100644 --- a/patches/unapplied/server/0878-Refresh-ProjectileSource-for-projectiles.patch +++ b/patches/server/0848-Refresh-ProjectileSource-for-projectiles.patch @@ -14,10 +14,10 @@ clearing the owner. Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com> diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 9eecdc0a6fb111fb36e4e8e8666d056563e48cda..ee9ab1abbed298138e48c659481e03c01ac5940a 100644 +index 09defe4a20c7b0794cba358c177e787f1c0273c1..b2e2bd4d7e3b373a92d3a4a13446f27fbf652c0a 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -384,6 +384,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -386,6 +386,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public boolean inWorld = false; public boolean generation; public int maxAirTicks = this.getDefaultMaxAirSupply(); // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir() @@ -26,10 +26,10 @@ index 9eecdc0a6fb111fb36e4e8e8666d056563e48cda..ee9ab1abbed298138e48c659481e03c0 public boolean lastDamageCancelled; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled public boolean persistentInvisibility = false; diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index 0a207f3f2e4c0790e784fb4b0c3c2dfa49c39724..156809090f1f83ad68e7e2477a3cfddac5757a8e 100644 +index 734e00caf72a694654319f69f793dcbf616f1784..64f7ae4d9e37daf2d48231f44f686008953ad39b 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -@@ -50,14 +50,31 @@ public abstract class Projectile extends Entity implements TraceableEntity { +@@ -51,14 +51,31 @@ public abstract class Projectile extends Entity implements TraceableEntity { this.ownerUUID = entity.getUUID(); this.cachedOwner = entity; } @@ -63,7 +63,7 @@ index 0a207f3f2e4c0790e784fb4b0c3c2dfa49c39724..156809090f1f83ad68e7e2477a3cfdda return this.cachedOwner; } else { if (this.ownerUUID != null) { -@@ -67,6 +84,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { +@@ -68,6 +85,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { ServerLevel worldserver = (ServerLevel) world; this.cachedOwner = worldserver.getEntity(this.ownerUUID); diff --git a/patches/unapplied/server/0879-Add-transient-modifier-API.patch b/patches/server/0849-Add-transient-modifier-API.patch similarity index 95% rename from patches/unapplied/server/0879-Add-transient-modifier-API.patch rename to patches/server/0849-Add-transient-modifier-API.patch index 8144e5dc4..5614f7362 100644 --- a/patches/unapplied/server/0879-Add-transient-modifier-API.patch +++ b/patches/server/0849-Add-transient-modifier-API.patch @@ -21,7 +21,7 @@ index 12135ffeacd648f6bc4d7d327059ea1a7e8c79c4..52439f4b959c74027eb191a3af960c70 public void removeModifier(AttributeModifier modifier) { throw new UnsupportedOperationException("Cannot modify default attributes"); diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java -index a88acd3ebc0f11f9b5caca3fbf2401ca5eb3f553..e0faf9bf55f95ab21bd3452cee73196ae7ba8122 100644 +index 8afbb8e0cb368e95f23bb78c1261f9aa9b8abd86..c0fb6da6bc3c5b4f37601d898fa421d430417d97 100644 --- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java +++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java @@ -50,6 +50,14 @@ public class CraftAttributeInstance implements AttributeInstance { diff --git a/patches/unapplied/server/0880-Fix-block-place-logic.patch b/patches/server/0850-Fix-block-place-logic.patch similarity index 83% rename from patches/unapplied/server/0880-Fix-block-place-logic.patch rename to patches/server/0850-Fix-block-place-logic.patch index 16fd6d2e8..907a92a8c 100644 --- a/patches/unapplied/server/0880-Fix-block-place-logic.patch +++ b/patches/server/0850-Fix-block-place-logic.patch @@ -9,23 +9,23 @@ Fix several issues when a player interact with a block: * poi can desync when the BlockPhysicsEvent is cancelled diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java -index 1ac739c92031e80c35e1af4417e6358346079580..8c54b92b65b3d379e14a11370b09d45351ab22e1 100644 +index 7d76cdc59984b156628273c8357485eb10046007..7180996027f70aef7afe32fb2adfce6431429401 100644 --- a/src/main/java/net/minecraft/world/item/BlockItem.java +++ b/src/main/java/net/minecraft/world/item/BlockItem.java -@@ -130,7 +130,7 @@ public class BlockItem extends Item { +@@ -128,7 +128,7 @@ public class BlockItem extends Item { SoundType soundeffecttype = iblockdata1.getSoundType(); - // world.playSound(entityhuman, blockposition, this.getPlaceSound(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F); + if (entityhuman == null) world.playSound(entityhuman, blockposition, this.getPlaceSound(iblockdata1), net.minecraft.sounds.SoundSource.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F); // Paper - Fix block place logic; reintroduce this for the dispenser (i.e the shulker) - world.gameEvent(GameEvent.BLOCK_PLACE, blockposition, GameEvent.Context.of(entityhuman, iblockdata1)); - if ((entityhuman == null || !entityhuman.getAbilities().instabuild) && itemstack != ItemStack.EMPTY) { // CraftBukkit - itemstack.shrink(1); + world.gameEvent((Holder) GameEvent.BLOCK_PLACE, blockposition, GameEvent.Context.of(entityhuman, iblockdata1)); + itemstack.consume(1, entityhuman); + return InteractionResult.sidedSuccess(world.isClientSide); diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 59c4550b4cb8b0317f5256efc9376265f4583b60..964d6af9eb9752b9e08f712c80b67bd9410d1554 100644 +index a80d225a7a4206acc4b93e328c96adf4411dad1d..1e104a724a327b98963ef2f23c10c426de6113a5 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -494,13 +494,7 @@ public final class ItemStack { +@@ -507,13 +507,7 @@ public final class ItemStack implements DataComponentHolder { if (tileentity instanceof JukeboxBlockEntity) { JukeboxBlockEntity tileentityjukebox = (JukeboxBlockEntity) tileentity; @@ -41,10 +41,10 @@ index 59c4550b4cb8b0317f5256efc9376265f4583b60..964d6af9eb9752b9e08f712c80b67bd9 } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 59dba562e17e9463c1e00dee4979b61a0f68643e..336ae7f1fc4bd045183c967f8e3bfb5a967a40a1 100644 +index 37c81d6c95efaab12a05075e6397ab2548c76722..19a177041e6e9621b0e35ca4f4ceb79b72448680 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -560,17 +560,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -554,17 +554,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // CraftBukkit start iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam CraftWorld world = ((ServerLevel) this).getWorld(); diff --git a/patches/unapplied/server/0881-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch b/patches/server/0851-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch similarity index 89% rename from patches/unapplied/server/0881-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch rename to patches/server/0851-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch index 288b2c371..81d964ecd 100644 --- a/patches/unapplied/server/0881-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch +++ b/patches/server/0851-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix spigot sound playing for BlockItem ItemStacks diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 964d6af9eb9752b9e08f712c80b67bd9410d1554..30cf71507c45432b2b5ac636aff852acf662ce60 100644 +index 1e104a724a327b98963ef2f23c10c426de6113a5..735a56648a783a618891b391418a8fd0d2968f4f 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -545,7 +545,11 @@ public final class ItemStack { +@@ -558,7 +558,11 @@ public final class ItemStack implements DataComponentHolder { // SPIGOT-1288 - play sound stripped from ItemBlock if (this.item instanceof BlockItem) { diff --git a/patches/unapplied/server/0882-Call-BlockGrowEvent-for-missing-blocks.patch b/patches/server/0852-Call-BlockGrowEvent-for-missing-blocks.patch similarity index 96% rename from patches/unapplied/server/0882-Call-BlockGrowEvent-for-missing-blocks.patch rename to patches/server/0852-Call-BlockGrowEvent-for-missing-blocks.patch index 4938d57d1..895a528de 100644 --- a/patches/unapplied/server/0882-Call-BlockGrowEvent-for-missing-blocks.patch +++ b/patches/server/0852-Call-BlockGrowEvent-for-missing-blocks.patch @@ -19,7 +19,7 @@ index d06e3892cf42723f8e3f621b5497c5348fa1a715..5f1ec3f69295760b7b8097916c82cbf9 world.setBlock(pos.above(), blockState.setValue(HALF, DoubleBlockHalf.UPPER), 3); } diff --git a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java -index 9766a919f85abfd52497ecd6d2e2002d3de8051d..4f1ff12df44756b63e3c3f9fc43e7ea485df6f57 100644 +index f53808e200bd83ab80954ec5c1e9c14250302be8..b943384eb6a4612993556036f0d3beec6939a559 100644 --- a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java @@ -71,8 +71,13 @@ public class SnifferEggBlock extends Block { diff --git a/patches/unapplied/server/0883-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch b/patches/server/0853-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch similarity index 94% rename from patches/unapplied/server/0883-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch rename to patches/server/0853-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch index 954f7480a..a2763420a 100644 --- a/patches/unapplied/server/0883-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch +++ b/patches/server/0853-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't enforce icanhasbukkit default if alias block exists diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 10450a2bb6973a647fb6969d3c142e7a6a1011a4..56a6b3921c74bdeb27f8736302503bee1f731065 100644 +index d5575fcc1458fe3083821792f09f9ed53c12e825..29a11dc69b64ddc6022812757b2839931e271ac2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -354,7 +354,11 @@ public final class CraftServer implements Server { diff --git a/patches/unapplied/server/0884-fix-MapLike-spam-for-missing-key-selector.patch b/patches/server/0854-fix-MapLike-spam-for-missing-key-selector.patch similarity index 85% rename from patches/unapplied/server/0884-fix-MapLike-spam-for-missing-key-selector.patch rename to patches/server/0854-fix-MapLike-spam-for-missing-key-selector.patch index 2fee78531..591273e2f 100644 --- a/patches/unapplied/server/0884-fix-MapLike-spam-for-missing-key-selector.patch +++ b/patches/server/0854-fix-MapLike-spam-for-missing-key-selector.patch @@ -5,12 +5,12 @@ Subject: [PATCH] fix MapLike spam for missing key 'selector' diff --git a/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java b/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java -index e7bd45e9834ffc6b94dd07cf69a685de66c9c37a..af5019716f487d9e4259b259712cf022f987603b 100644 +index 8c8c16ce53f5bdf88274cb80767decf0a2612637..d4288ae84c08ff6cb2f6763eeb9c358d5bf38f55 100644 --- a/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java +++ b/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java -@@ -347,7 +347,7 @@ public interface VibrationSystem { +@@ -353,7 +353,7 @@ public interface VibrationSystem { public static Codec CODEC = RecordCodecBuilder.create((instance) -> { - return instance.group(VibrationInfo.CODEC.optionalFieldOf("event").forGetter((vibrationsystem_a) -> { + return instance.group(VibrationInfo.CODEC.lenientOptionalFieldOf("event").forGetter((vibrationsystem_a) -> { return Optional.ofNullable(vibrationsystem_a.currentVibration); - }), VibrationSelector.CODEC.fieldOf("selector").forGetter(VibrationSystem.Data::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> { + }), Codec.optionalField("selector", VibrationSelector.CODEC).xmap(o -> o.orElseGet(VibrationSelector::new), Optional::of).forGetter(VibrationSystem.Data::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> { // Paper - fix MapLike spam for missing "selector" in 1.19.2 diff --git a/patches/unapplied/server/0885-Fix-sniffer-removeExploredLocation.patch b/patches/server/0855-Fix-sniffer-removeExploredLocation.patch similarity index 100% rename from patches/unapplied/server/0885-Fix-sniffer-removeExploredLocation.patch rename to patches/server/0855-Fix-sniffer-removeExploredLocation.patch diff --git a/patches/unapplied/server/0886-Add-method-to-remove-all-active-potion-effects.patch b/patches/server/0856-Add-method-to-remove-all-active-potion-effects.patch similarity index 86% rename from patches/unapplied/server/0886-Add-method-to-remove-all-active-potion-effects.patch rename to patches/server/0856-Add-method-to-remove-all-active-potion-effects.patch index 1461dfa24..cf3fcf9f0 100644 --- a/patches/unapplied/server/0886-Add-method-to-remove-all-active-potion-effects.patch +++ b/patches/server/0856-Add-method-to-remove-all-active-potion-effects.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add method to remove all active potion effects diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index ab1e1a56f3811d4446a6b0a7461c0bddd8015228..c4a166a0c226c6083c25c58145d9631d4296e615 100644 +index 4f31bf6f51a72b010b850e1e62a06b455eac906c..eca55d45e1529fffbfcf5d6b8fd23935385e8bcd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -556,6 +556,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -555,6 +555,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return effects; } diff --git a/patches/unapplied/server/0887-Fix-incorrect-crafting-result-amount-for-fireworks.patch b/patches/server/0857-Fix-incorrect-crafting-result-amount-for-fireworks.patch similarity index 78% rename from patches/unapplied/server/0887-Fix-incorrect-crafting-result-amount-for-fireworks.patch rename to patches/server/0857-Fix-incorrect-crafting-result-amount-for-fireworks.patch index 6436cefd4..702619dd0 100644 --- a/patches/unapplied/server/0887-Fix-incorrect-crafting-result-amount-for-fireworks.patch +++ b/patches/server/0857-Fix-incorrect-crafting-result-amount-for-fireworks.patch @@ -6,13 +6,13 @@ Subject: [PATCH] Fix incorrect crafting result amount for fireworks Although vanilla does not specifically call this method anywhere, this fixes a bug where the result using the Bukkit API returns the wrong amount. diff --git a/src/main/java/net/minecraft/world/item/crafting/FireworkRocketRecipe.java b/src/main/java/net/minecraft/world/item/crafting/FireworkRocketRecipe.java -index 54da7997123b4159a29baedf402608b7db7cb745..a86507569b759f8ef85f3fc32324677c37f65d28 100644 +index da924bb34354b1a8b3db3ad63b5705253d942514..56c8900c8771919d5e0e62b4d165ae6f00042872 100644 --- a/src/main/java/net/minecraft/world/item/crafting/FireworkRocketRecipe.java +++ b/src/main/java/net/minecraft/world/item/crafting/FireworkRocketRecipe.java -@@ -80,7 +80,7 @@ public class FireworkRocketRecipe extends CustomRecipe { +@@ -78,7 +78,7 @@ public class FireworkRocketRecipe extends CustomRecipe { @Override - public ItemStack getResultItem(RegistryAccess registryManager) { + public ItemStack getResultItem(HolderLookup.Provider registriesLookup) { - return new ItemStack(Items.FIREWORK_ROCKET); + return new ItemStack(Items.FIREWORK_ROCKET, 3); // Paper - Fix incorrect crafting result amount } diff --git a/patches/unapplied/server/0888-Add-event-for-player-editing-sign.patch b/patches/server/0858-Add-event-for-player-editing-sign.patch similarity index 81% rename from patches/unapplied/server/0888-Add-event-for-player-editing-sign.patch rename to patches/server/0858-Add-event-for-player-editing-sign.patch index 321cccc3d..173fdb866 100644 --- a/patches/unapplied/server/0888-Add-event-for-player-editing-sign.patch +++ b/patches/server/0858-Add-event-for-player-editing-sign.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add event for player editing sign diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 30cf71507c45432b2b5ac636aff852acf662ce60..5a86b2c205250ddcd833a15accb27ca4a580eadd 100644 +index 735a56648a783a618891b391418a8fd0d2968f4f..31f67c83416031079569375e5f69738dd639b93f 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -524,7 +524,7 @@ public final class ItemStack { +@@ -537,7 +537,7 @@ public final class ItemStack implements DataComponentHolder { try { if (world.getBlockEntity(SignItem.openSign) instanceof SignBlockEntity tileentitysign) { if (world.getBlockState(SignItem.openSign).getBlock() instanceof SignBlock blocksign) { @@ -18,19 +18,19 @@ index 30cf71507c45432b2b5ac636aff852acf662ce60..5a86b2c205250ddcd833a15accb27ca4 } } finally { diff --git a/src/main/java/net/minecraft/world/level/block/SignBlock.java b/src/main/java/net/minecraft/world/level/block/SignBlock.java -index 57b79e7fa34755e68b06f5b3010e68745cabbb7e..27a1e8ffc43efe4e086e7fd88ee4d80c23f98674 100644 +index e602c58bc14036d78a00ad548a821650b92e29df..f7bae8060d993176799ff3ff4653d760a137faba 100644 --- a/src/main/java/net/minecraft/world/level/block/SignBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SignBlock.java -@@ -118,7 +118,7 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo - } else if (flag2) { - return InteractionResult.SUCCESS; - } else if (!this.otherPlayerIsEditingSign(player, tileentitysign) && player.mayBuild() && this.hasEditableText(player, tileentitysign, flag1)) { -- this.openTextEdit(player, tileentitysign, flag1, org.bukkit.event.player.PlayerSignOpenEvent.Cause.INTERACT); // CraftBukkit -+ this.openTextEdit(player, tileentitysign, flag1, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause.INTERACT); // Paper - Add PlayerOpenSignEvent - return this.getInteractionResult(flag); - } else { - return InteractionResult.PASS; -@@ -170,16 +170,33 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo +@@ -142,7 +142,7 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo + } else if (flag1) { + return InteractionResult.SUCCESS; + } else if (!this.otherPlayerIsEditingSign(player, tileentitysign) && player.mayBuild() && this.hasEditableText(player, tileentitysign, flag)) { +- this.openTextEdit(player, tileentitysign, flag, org.bukkit.event.player.PlayerSignOpenEvent.Cause.INTERACT); // CraftBukkit ++ this.openTextEdit(player, tileentitysign, flag, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause.INTERACT); // Paper - Add PlayerOpenSignEvent + return InteractionResult.SUCCESS; + } else { + return InteractionResult.PASS; +@@ -187,16 +187,33 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo return blockpropertywood; } @@ -72,10 +72,10 @@ index 57b79e7fa34755e68b06f5b3010e68745cabbb7e..27a1e8ffc43efe4e086e7fd88ee4d80c entityhuman.openTextEdit(tileentitysign, flag); } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java -index d1b335d7342aa85478daeb7801a999ccd4be7136..1d0ef05cc694c5519dc233d24fd002c0699cd2ab 100644 +index a12702cdf36c75572e661b5b5758270f5058c181..8303343ecca91076839f4436d6b3a3bf4739c2fd 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java -@@ -162,9 +162,15 @@ public class CraftSign extends CraftBlockEntityState< +@@ -168,9 +168,15 @@ public class CraftSign extends CraftBlockEntityState< Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed"); Preconditions.checkArgument(sign.getWorld() == player.getWorld(), "Sign must be in same world as Player"); diff --git a/patches/unapplied/server/0889-Only-tick-item-frames-if-players-can-see-it.patch b/patches/server/0859-Only-tick-item-frames-if-players-can-see-it.patch similarity index 79% rename from patches/unapplied/server/0889-Only-tick-item-frames-if-players-can-see-it.patch rename to patches/server/0859-Only-tick-item-frames-if-players-can-see-it.patch index 2ae56c085..bee9b4efe 100644 --- a/patches/unapplied/server/0889-Only-tick-item-frames-if-players-can-see-it.patch +++ b/patches/server/0859-Only-tick-item-frames-if-players-can-see-it.patch @@ -6,15 +6,15 @@ Subject: [PATCH] Only tick item frames if players can see it In the event that an item frame cannot be seen by any players, ticking the item frame every tick is unnecessary. This can be a very hot section of the entity tracker when lots of item frames are present on a server, so this reduces the logic which speeds it up. diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 40949825392281c2f7c756007781c672ec24665d..888cbfaf49aa6d1d1b8cc87cf411a1dd53fbe89d 100644 +index f355dd986bf861da3edb90d7e05f901e19686fef..b195de05371e9762654b69365f0e722443425d33 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java -@@ -111,7 +111,7 @@ public class ServerEntity { +@@ -113,7 +113,7 @@ public class ServerEntity { Entity entity = this.entity; -- if (entity instanceof ItemFrame) { +- if (entity instanceof ItemFrame entityitemframe) { + if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame) { // Paper - Perf: Only tick item frames if players can see it - ItemFrame entityitemframe = (ItemFrame) entity; - if (true || this.tickCount % 10 == 0) { // CraftBukkit - Moved below, should always enter this block + ItemStack itemstack = entityitemframe.getItem(); + diff --git a/patches/unapplied/server/0890-Fix-cmd-permission-levels-for-command-blocks.patch b/patches/server/0860-Fix-cmd-permission-levels-for-command-blocks.patch similarity index 92% rename from patches/unapplied/server/0890-Fix-cmd-permission-levels-for-command-blocks.patch rename to patches/server/0860-Fix-cmd-permission-levels-for-command-blocks.patch index 8bc99edf2..31edf0f25 100644 --- a/patches/unapplied/server/0890-Fix-cmd-permission-levels-for-command-blocks.patch +++ b/patches/server/0860-Fix-cmd-permission-levels-for-command-blocks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix cmd permission levels for command blocks diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index 907bc9d84dbc98427384cf529bfde4b09d8ce8ca..faa375f2722793a86265248a4be4fa14736d9818 100644 +index f3c83bb20a73b489f1fb6bacb69388902b1b6fe7..3c0d2332207ba638faaaa4280bce18c334a01271 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java @@ -204,10 +204,29 @@ public class CommandSourceStack implements ExecutionCommandSource optional = HoneycombItem.getWaxed(iblockdata); if (optional.isPresent()) { @@ -36,7 +36,7 @@ index b83af374a33a66a6ceeca119b961eea883bba41c..175b965c92b8b8be9c671e1ee478afa9 worldserver.setBlockAndUpdate(blockposition, (BlockState) optional.get()); worldserver.levelEvent(3003, blockposition, 0); stack.shrink(1); -@@ -1159,6 +1173,12 @@ public interface DispenseItemBehavior { +@@ -1004,6 +1018,12 @@ public interface DispenseItemBehavior { if (!worldserver.getBlockState(blockposition1).is(BlockTags.CONVERTABLE_TO_MUD)) { return this.defaultDispenseItemBehavior.dispense(pointer, stack); } else { @@ -50,10 +50,10 @@ index b83af374a33a66a6ceeca119b961eea883bba41c..175b965c92b8b8be9c671e1ee478afa9 for (int k = 0; k < 5; ++k) { worldserver.sendParticles(ParticleTypes.SPLASH, (double) blockposition.getX() + worldserver.random.nextDouble(), (double) (blockposition.getY() + 1), (double) blockposition.getZ() + worldserver.random.nextDouble(), 1, 0.0D, 0.0D, 0.0D, 1.0D); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index e457cd3b6a5a627f18fa8ce7fca90e75e0adb8ea..600b340bd7fc6db3914ad67684a15428b619a9a3 100644 +index c1b5d9713cb301dc06b74d97dca4fd5562c539e2..27bafd5349805171399dbd141f5c568ec35286f4 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -2115,6 +2115,32 @@ public class CraftEventFactory { +@@ -2110,6 +2110,32 @@ public class CraftEventFactory { } // Paper end diff --git a/patches/unapplied/server/0893-Don-t-load-chunks-for-supporting-block-checks.patch b/patches/server/0863-Don-t-load-chunks-for-supporting-block-checks.patch similarity index 81% rename from patches/unapplied/server/0893-Don-t-load-chunks-for-supporting-block-checks.patch rename to patches/server/0863-Don-t-load-chunks-for-supporting-block-checks.patch index 2e07b7125..4dd0bce76 100644 --- a/patches/unapplied/server/0893-Don-t-load-chunks-for-supporting-block-checks.patch +++ b/patches/server/0863-Don-t-load-chunks-for-supporting-block-checks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't load chunks for supporting block checks diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index ee9ab1abbed298138e48c659481e03c01ac5940a..fe768bd70c08719f11e28e793fe90a908f22c4ad 100644 +index b2e2bd4d7e3b373a92d3a4a13446f27fbf652c0a..16f36d1bfe6458f9aa935cdc63066c082bc83f8e 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1200,7 +1200,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1211,7 +1211,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } protected BlockPos getOnPos(float offset) { diff --git a/patches/unapplied/server/0894-Optimize-player-lookups-for-beacons.patch b/patches/server/0864-Optimize-player-lookups-for-beacons.patch similarity index 91% rename from patches/unapplied/server/0894-Optimize-player-lookups-for-beacons.patch rename to patches/server/0864-Optimize-player-lookups-for-beacons.patch index 3b3d11c54..7ffe90e86 100644 --- a/patches/unapplied/server/0894-Optimize-player-lookups-for-beacons.patch +++ b/patches/server/0864-Optimize-player-lookups-for-beacons.patch @@ -7,10 +7,10 @@ For larger ranges, it's better to iterate over the player list than the entity slices. 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 eff48e43a35a752bd33de2b55a0ad04332109ce0..4b81b0180dfc96fc6a88646838a886ca5b5d301b 100644 +index 2e3d89ca35b513340cd1ebefa875280b32e1756e..8a89ba2f50b0032b9db854d2c8cb6493f58dbe34 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 -@@ -329,7 +329,22 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -333,7 +333,22 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name double d0 = blockEntity != null ? blockEntity.getEffectRange() : (i * 10 + 10); // Paper - Custom beacon ranges AABB axisalignedbb = (new AABB(blockposition)).inflate(d0).expandTowards(0.0D, (double) world.getHeight(), 0.0D); diff --git a/patches/unapplied/server/0895-Add-Sign-getInteractableSideFor.patch b/patches/server/0865-Add-Sign-getInteractableSideFor.patch similarity index 84% rename from patches/unapplied/server/0895-Add-Sign-getInteractableSideFor.patch rename to patches/server/0865-Add-Sign-getInteractableSideFor.patch index c5009d0b4..a837a8e76 100644 --- a/patches/unapplied/server/0895-Add-Sign-getInteractableSideFor.patch +++ b/patches/server/0865-Add-Sign-getInteractableSideFor.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Sign#getInteractableSideFor diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java -index f3cea7a8de334419b4a2f6dc64ef0e20fd715e75..927c7ea03560be0c86884cec70ee8e408e66cb07 100644 +index a55a2db66d8c8482c5b4107b21bb82d7e8ff4288..749b24cdc0cc2f04fe7fa29da7ea2ffd4ee153e5 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java -@@ -66,13 +66,18 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C +@@ -68,12 +68,17 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C } public boolean isFacingFrontText(net.minecraft.world.entity.player.Player player) { @@ -19,8 +19,7 @@ index f3cea7a8de334419b4a2f6dc64ef0e20fd715e75..927c7ea03560be0c86884cec70ee8e40 + // Paper end - Add Sign#getInteractableSideFor Block block = this.getBlockState().getBlock(); - if (block instanceof SignBlock) { - SignBlock blocksign = (SignBlock) block; + if (block instanceof SignBlock blocksign) { Vec3 vec3d = blocksign.getSignHitboxCenterPosition(this.getBlockState()); - double d0 = player.getX() - ((double) this.getBlockPos().getX() + vec3d.x); - double d1 = player.getZ() - ((double) this.getBlockPos().getZ() + vec3d.z); @@ -30,10 +29,10 @@ index f3cea7a8de334419b4a2f6dc64ef0e20fd715e75..927c7ea03560be0c86884cec70ee8e40 float f1 = (float) (Mth.atan2(d1, d0) * 57.2957763671875D) - 90.0F; diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java -index 1d0ef05cc694c5519dc233d24fd002c0699cd2ab..ec96e8020c2042d939ab836464c547838447d708 100644 +index 8303343ecca91076839f4436d6b3a3bf4739c2fd..cefbb015a77b9e3cab56e5ed4fe35fba91641632 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java -@@ -192,6 +192,14 @@ public class CraftSign extends CraftBlockEntityState< +@@ -198,6 +198,14 @@ public class CraftSign extends CraftBlockEntityState< } // Paper end diff --git a/patches/unapplied/server/0897-fix-item-meta-for-tadpole-buckets.patch b/patches/server/0866-fix-item-meta-for-tadpole-buckets.patch similarity index 84% rename from patches/unapplied/server/0897-fix-item-meta-for-tadpole-buckets.patch rename to patches/server/0866-fix-item-meta-for-tadpole-buckets.patch index 7ee950152..d6f483306 100644 --- a/patches/unapplied/server/0897-fix-item-meta-for-tadpole-buckets.patch +++ b/patches/server/0866-fix-item-meta-for-tadpole-buckets.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix item meta for tadpole buckets diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index c421649a0c88ee9c773bb6985f7114e58f08a7a1..71aac5d4cf29cea9daa378fc8ac584750de4d1ca 100644 +index 071f4fe53fbea333b5db52ac719c5e6b833ffe19..4cc5f39ee20948e2369b21041b663a7e50d15ac1 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -357,6 +357,7 @@ public final class CraftItemFactory implements ItemFactory { +@@ -364,6 +364,7 @@ public final class CraftItemFactory implements ItemFactory { case COD_BUCKET: case PUFFERFISH_BUCKET: case SALMON_BUCKET: @@ -17,10 +17,10 @@ index c421649a0c88ee9c773bb6985f7114e58f08a7a1..71aac5d4cf29cea9daa378fc8ac58475 case GLOW_ITEM_FRAME: case PAINTING: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index fb2e4881096459eff16a7c46faa9921166837ee9..f106db3aa5e5b3b0b8133eff77dbc65c8895ff2e 100644 +index be2b7c2b412a1d64466c25c1b19b10a869cd288d..d544a4e4d88b51cf6ca53e048c411aa23c64d78f 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -@@ -601,6 +601,7 @@ public final class CraftItemStack extends ItemStack { +@@ -600,6 +600,7 @@ public final class CraftItemStack extends ItemStack { case COD_BUCKET: case PUFFERFISH_BUCKET: case SALMON_BUCKET: @@ -29,10 +29,10 @@ index fb2e4881096459eff16a7c46faa9921166837ee9..f106db3aa5e5b3b0b8133eff77dbc65c case GLOW_ITEM_FRAME: case PAINTING: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEntityTag.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEntityTag.java -index 6aa64334943a22da8cfcac88d48ae8156ad7a9b4..630e16403cb1fc0f4ba798993bb0c3139196a97c 100644 +index 27af7ca9d62bdb4a24be5af139c181d7bc271ba5..3ff0340c40e9dc9a6e690de15ccade7a0c4e8f02 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEntityTag.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEntityTag.java -@@ -16,6 +16,7 @@ public class CraftMetaEntityTag extends CraftMetaItem { +@@ -19,6 +19,7 @@ public class CraftMetaEntityTag extends CraftMetaItem { Material.COD_BUCKET, Material.PUFFERFISH_BUCKET, Material.SALMON_BUCKET, @@ -41,10 +41,10 @@ index 6aa64334943a22da8cfcac88d48ae8156ad7a9b4..630e16403cb1fc0f4ba798993bb0c313 Material.GLOW_ITEM_FRAME, Material.PAINTING diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index adb7c742e8fe3b8e0c2ecf63c627e7566285fd55..9f96ee1ac21f44ca7a41122353f72339b148f036 100644 +index 7237e24686885c754c87e7eec53c6400fd0b47bf..f071968be481a164192085a3e405bea2d26062b6 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -@@ -235,6 +235,27 @@ public class ItemMetaTest extends AbstractTestingBase { +@@ -234,6 +234,27 @@ public class ItemMetaTest extends AbstractTestingBase { } } diff --git a/patches/unapplied/server/0898-Fix-BanList-API.patch b/patches/server/0867-Fix-BanList-API.patch similarity index 98% rename from patches/unapplied/server/0898-Fix-BanList-API.patch rename to patches/server/0867-Fix-BanList-API.patch index 5c2d7a655..9ea9cba11 100644 --- a/patches/unapplied/server/0898-Fix-BanList-API.patch +++ b/patches/server/0867-Fix-BanList-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix BanList API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index ef2dfa30686bba3eb510bf95172174cc9972422e..96408d505ce80799868ff84554a3b0b25adabb22 100644 +index 8caee0181f256e2ffd4e880274859eaf5f81ae96..4d654c4f0b6210a9841427789ba70ce5d1d308be 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -115,17 +115,17 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa @@ -208,10 +208,10 @@ index 172202accf4448a933fcf1ff820316c7910dd7f7..50ee7656580d386db473c054f5c5ec57 return null; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index af4cf6ff7123b67807b147b80d143405ec6998a4..d4875f4477d1d76857bc135f6f0849b889baca22 100644 +index 722c69e0149a9bf35159a7ffbb338fbc42600f0e..1c6fdad145d81a25ccd2b1193ebe4b5ad96bfb9c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1657,23 +1657,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1733,23 +1733,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } @Override @@ -240,7 +240,7 @@ index af4cf6ff7123b67807b147b80d143405ec6998a4..d4875f4477d1d76857bc135f6f0849b8 if (kickPlayer) { this.kickPlayer(reason); } -@@ -1681,12 +1681,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1757,12 +1757,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } @Override diff --git a/patches/unapplied/server/0899-Determine-lava-and-water-fluid-explosion-resistance-.patch b/patches/server/0868-Determine-lava-and-water-fluid-explosion-resistance-.patch similarity index 100% rename from patches/unapplied/server/0899-Determine-lava-and-water-fluid-explosion-resistance-.patch rename to patches/server/0868-Determine-lava-and-water-fluid-explosion-resistance-.patch diff --git a/patches/unapplied/server/0900-Fix-possible-NPE-on-painting-creation.patch b/patches/server/0869-Fix-possible-NPE-on-painting-creation.patch similarity index 92% rename from patches/unapplied/server/0900-Fix-possible-NPE-on-painting-creation.patch rename to patches/server/0869-Fix-possible-NPE-on-painting-creation.patch index a503b8ac4..cf51e817d 100644 --- a/patches/unapplied/server/0900-Fix-possible-NPE-on-painting-creation.patch +++ b/patches/server/0869-Fix-possible-NPE-on-painting-creation.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix possible NPE on painting creation diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java -index 08316493785e0cf1f93f07dda8016ca5956216f8..a97ceea235f756cbca3c82aa1965d90cf7767580 100644 +index 7ba6302ecb72fa6e523054e7e3223d79eedf6589..63f9852de5b557351793ba3aebdd7e752caf2417 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java -@@ -318,8 +318,13 @@ public final class CraftEntityTypes { +@@ -325,8 +325,13 @@ public final class CraftEntityTypes { // Hanging register(new EntityTypeData<>(EntityType.PAINTING, Painting.class, CraftPainting::new, createHanging(Painting.class, (spawnData, hangingData) -> { if (spawnData.normalWorld && hangingData.randomize()) { @@ -24,7 +24,7 @@ index 08316493785e0cf1f93f07dda8016ca5956216f8..a97ceea235f756cbca3c82aa1965d90c net.minecraft.world.entity.decoration.Painting entity = new net.minecraft.world.entity.decoration.Painting(net.minecraft.world.entity.EntityType.PAINTING, spawnData.minecraftWorld()); entity.absMoveTo(spawnData.x(), spawnData.y(), spawnData.z(), spawnData.yaw(), spawnData.pitch()); entity.setDirection(hangingData.direction()); -@@ -457,6 +462,7 @@ public final class CraftEntityTypes { +@@ -465,6 +470,7 @@ public final class CraftEntityTypes { AABB bb = (ItemFrame.class.isAssignableFrom(clazz)) ? net.minecraft.world.entity.decoration.ItemFrame.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height) : HangingEntity.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height); diff --git a/patches/unapplied/server/0901-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch b/patches/server/0870-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch similarity index 92% rename from patches/unapplied/server/0901-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch rename to patches/server/0870-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch index 54c442e54..0a756f54a 100644 --- a/patches/unapplied/server/0901-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch +++ b/patches/server/0870-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Only set despawnTimer for Wandering Traders spawned by 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 9b0f54af3160c5756784e31cf1347eb97ca77e47..8d1cc1a644415be251f469ab1cb2ebc09fe5c3eb 100644 +index 63189d6325173a42b619907b44a426848fbc6988..0854e9b7ee2e6b23b6c1ee6a324a5a253c9d4679 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java @@ -68,7 +68,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill @@ -19,7 +19,7 @@ index 9b0f54af3160c5756784e31cf1347eb97ca77e47..8d1cc1a644415be251f469ab1cb2ebc0 @Override 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 a089f72695b5fb49c7918e89fd5015e8c3a3dd0e..d7bddedb19c10f62fd1f7d3128453ad706ed16be 100644 +index d5d27b0d352ca3fd57a26605cb35c499e88b57fc..f4cdb97ed6c0850da980760c0c2df69480485940 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java @@ -120,7 +120,7 @@ public class WanderingTraderSpawner implements CustomSpawner { diff --git a/patches/unapplied/server/0902-ExperienceOrb-should-call-EntitySpawnEvent.patch b/patches/server/0871-ExperienceOrb-should-call-EntitySpawnEvent.patch similarity index 89% rename from patches/unapplied/server/0902-ExperienceOrb-should-call-EntitySpawnEvent.patch rename to patches/server/0871-ExperienceOrb-should-call-EntitySpawnEvent.patch index d36555915..96941a19e 100644 --- a/patches/unapplied/server/0902-ExperienceOrb-should-call-EntitySpawnEvent.patch +++ b/patches/server/0871-ExperienceOrb-should-call-EntitySpawnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ExperienceOrb should call EntitySpawnEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 600b340bd7fc6db3914ad67684a15428b619a9a3..592670a6ebaed9b42d76afe66264265fc0664934 100644 +index 27bafd5349805171399dbd141f5c568ec35286f4..5af62603415865068ca4b79a7e68d8eb813596b1 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -736,7 +736,8 @@ public class CraftEventFactory { +@@ -735,7 +735,8 @@ public class CraftEventFactory { // Spigot start - SPIGOT-7523: Merge after spawn event and only merge if the event was not cancelled (gets checked above) if (entity instanceof net.minecraft.world.entity.ExperienceOrb xp) { double radius = world.spigotConfig.expMerge; diff --git a/patches/unapplied/server/0903-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch b/patches/server/0872-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch similarity index 93% rename from patches/unapplied/server/0903-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch rename to patches/server/0872-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch index 96b4aa8c4..301b345fb 100644 --- a/patches/unapplied/server/0903-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch +++ b/patches/server/0872-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make Amethyst throw both Spread and Grow Events diff --git a/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java b/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java -index 79f1fb45447350b5bedee8ce3efe6c150aa9772c..7f58c9f5935cd14ea1096de14633f653eb486d7e 100644 +index 6c402bfd9bed54cbb9b337d3528fdcffbd3d87c0..8920855b07a31715327b8102c7faafc9f916825d 100644 --- a/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java @@ -45,7 +45,13 @@ public class BuddingAmethystBlock extends AmethystBlock { diff --git a/patches/unapplied/server/0904-Add-whitelist-events.patch b/patches/server/0873-Add-whitelist-events.patch similarity index 100% rename from patches/unapplied/server/0904-Add-whitelist-events.patch rename to patches/server/0873-Add-whitelist-events.patch diff --git a/patches/unapplied/server/0905-Implement-PlayerFailMoveEvent.patch b/patches/server/0874-Implement-PlayerFailMoveEvent.patch similarity index 91% rename from patches/unapplied/server/0905-Implement-PlayerFailMoveEvent.patch rename to patches/server/0874-Implement-PlayerFailMoveEvent.patch index 3d263f8ee..aa30ea473 100644 --- a/patches/unapplied/server/0905-Implement-PlayerFailMoveEvent.patch +++ b/patches/server/0874-Implement-PlayerFailMoveEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerFailMoveEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1de8ee39347a6f4c56c2d3aa0e32887b57b80524..91e9e8a62ae25360ad82ab12ef07f8a51a2665ca 100644 +index 1a0245c798107d2d4239e07262f5cc89490a3b08..8085e59bf16d3a5c85bd9d328126f226c026f163 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1279,8 +1279,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1272,8 +1272,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d0 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX(this.player.getX())); final double toX = d0; // Paper - OBFHELPER double d1 = ServerGamePacketListenerImpl.clampVertical(packet.getY(this.player.getY())); final double toY = d1; // Paper - OBFHELPER double d2 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ(this.player.getZ())); final double toZ = d2; // Paper - OBFHELPER @@ -19,7 +19,7 @@ index 1de8ee39347a6f4c56c2d3aa0e32887b57b80524..91e9e8a62ae25360ad82ab12ef07f8a5 if (this.player.isPassenger()) { this.player.absMoveTo(this.player.getX(), this.player.getY(), this.player.getZ(), f, f1); -@@ -1345,8 +1345,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1340,8 +1340,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Paper start - Prevent moving into unloaded chunks if (this.player.level().paperConfig().chunks.preventMovingIntoUnloadedChunks && (this.player.getX() != toX || this.player.getZ() != toZ) && !worldserver.areChunksLoadedForMove(this.player.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(this.player.position())))) { @@ -36,7 +36,7 @@ index 1de8ee39347a6f4c56c2d3aa0e32887b57b80524..91e9e8a62ae25360ad82ab12ef07f8a5 } // Paper end - Prevent moving into unloaded chunks -@@ -1355,9 +1361,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1350,9 +1356,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // CraftBukkit end @@ -56,26 +56,28 @@ index 1de8ee39347a6f4c56c2d3aa0e32887b57b80524..91e9e8a62ae25360ad82ab12ef07f8a5 } } } -@@ -1419,14 +1432,29 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1414,14 +1427,31 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl d8 = d2 - this.player.getZ(); d10 = d6 * d6 + d7 * d7 + d8 * d8; -- boolean flag2 = false; +- boolean flag3 = false; + boolean movedWrongly = false; // Paper - Add fail move event; rename if (!this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot -- flag2 = true; +- flag3 = true; + // Paper start - Add fail move event + io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_WRONGLY, + toX, toY, toZ, toYaw, toPitch, true); + if (!event.isAllowed()) { + movedWrongly = true; + if (event.getLogWarning()) ++ // Paper end ServerGamePacketListenerImpl.LOGGER.warn("{} moved wrongly!", this.player.getName().getString()); -+ } ++ } // Paper } -- if (!this.player.noPhysics && !this.player.isSleeping() && (flag2 && worldserver.noCollision(this.player, axisalignedbb) || this.isPlayerCollidingWithAnythingNew(worldserver, axisalignedbb, d0, d1, d2))) { +- if (!this.player.noPhysics && !this.player.isSleeping() && (flag3 && worldserver.noCollision(this.player, axisalignedbb) || this.isPlayerCollidingWithAnythingNew(worldserver, axisalignedbb, d0, d1, d2))) { ++ // Paper start - Add fail move event + boolean teleportBack = !this.player.noPhysics && !this.player.isSleeping() && (movedWrongly && worldserver.noCollision(this.player, axisalignedbb) || this.isPlayerCollidingWithAnythingNew(worldserver, axisalignedbb, d0, d1, d2)); + if (teleportBack) { + io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.CLIPPED_INTO_BLOCK, @@ -85,11 +87,11 @@ index 1de8ee39347a6f4c56c2d3aa0e32887b57b80524..91e9e8a62ae25360ad82ab12ef07f8a5 + } + } + if (teleportBack) { -+ // Paper end - Add fail move event ++ // Paper end - Add fail move event this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet()); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet. this.player.doCheckFallDamage(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5, packet.isOnGround()); } else { -@@ -3363,4 +3391,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3456,4 +3486,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl InteractionResult run(ServerPlayer player, Entity entity, InteractionHand hand); } diff --git a/patches/unapplied/server/0906-Folia-scheduler-and-owned-region-API.patch b/patches/server/0875-Folia-scheduler-and-owned-region-API.patch similarity index 98% rename from patches/unapplied/server/0906-Folia-scheduler-and-owned-region-API.patch rename to patches/server/0875-Folia-scheduler-and-owned-region-API.patch index e7344d765..4b4c8cc92 100644 --- a/patches/unapplied/server/0906-Folia-scheduler-and-owned-region-API.patch +++ b/patches/server/0875-Folia-scheduler-and-owned-region-API.patch @@ -1148,10 +1148,10 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a540c744ca88884207c4520794091c01c1c9f50e..882b6effa39b62172914b41af54e54c2890480fb 100644 +index f12165838f77ae83437f5770faeac1e46b326e98..1d8c63a5a0b05340396a9f7ba079eb7fceda03e2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1497,6 +1497,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop ROT = (spawnData, entity) -> entity.setRot(spawnData.yaw(), spawnData.pitch()); // Paper private static final Map, EntityTypeData> CLASS_TYPE_DATA = new HashMap<>(); private static final Map> ENTITY_TYPE_DATA = new HashMap<>(); -@@ -352,10 +353,10 @@ public final class CraftEntityTypes { +@@ -360,10 +361,10 @@ public final class CraftEntityTypes { // Set pos register(new EntityTypeData<>(EntityType.MARKER, Marker.class, CraftMarker::new, createAndSetPos(net.minecraft.world.entity.EntityType.MARKER))); @@ -29,4 +29,4 @@ index a97ceea235f756cbca3c82aa1965d90cf7767580..2c60f2d82daacfcfc1eb9f64267ca8ae + register(new EntityTypeData<>(EntityType.TEXT_DISPLAY, TextDisplay.class, CraftTextDisplay::new, combine(createAndSetPos(net.minecraft.world.entity.EntityType.TEXT_DISPLAY), ROT))); // Paper // MISC - register(new EntityTypeData<>(EntityType.DROPPED_ITEM, Item.class, CraftItem::new, spawnData -> { + register(new EntityTypeData<>(EntityType.ITEM, Item.class, CraftItem::new, spawnData -> { diff --git a/patches/unapplied/server/0910-Only-capture-actual-tree-growth.patch b/patches/server/0879-Only-capture-actual-tree-growth.patch similarity index 88% rename from patches/unapplied/server/0910-Only-capture-actual-tree-growth.patch rename to patches/server/0879-Only-capture-actual-tree-growth.patch index 683dad551..671b9fd6a 100644 --- a/patches/unapplied/server/0910-Only-capture-actual-tree-growth.patch +++ b/patches/server/0879-Only-capture-actual-tree-growth.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Only capture actual tree growth diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index 175b965c92b8b8be9c671e1ee478afa9a2f7bf82..1fb809486ee56efd3d0ef3fa02503ba9be459f68 100644 +index 5bbadc890a72f1cb22c6881ebcc163b0c06a367a..4fa838bf97ede6e1c893ba64f53aa7af5db0405a 100644 --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -@@ -868,6 +868,7 @@ public interface DispenseItemBehavior { +@@ -654,6 +654,7 @@ public interface DispenseItemBehavior { if (!fertilizeEvent.isCancelled()) { for (org.bukkit.block.BlockState blockstate : blocks) { blockstate.update(true); @@ -17,10 +17,10 @@ index 175b965c92b8b8be9c671e1ee478afa9a2f7bf82..1fb809486ee56efd3d0ef3fa02503ba9 } } diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 5a86b2c205250ddcd833a15accb27ca4a580eadd..9b4e20d4bfba2de08084f1d69cb2ebfff7455c14 100644 +index 31f67c83416031079569375e5f69738dd639b93f..789740cadc1b66531b465bb0a052e2392852c4a8 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -424,6 +424,7 @@ public final class ItemStack { +@@ -437,6 +437,7 @@ public final class ItemStack implements DataComponentHolder { for (CraftBlockState blockstate : blocks) { // SPIGOT-7572 - Move fix for SPIGOT-7248 to CapturedBlockState, to allow bees in bee nest CapturedBlockState.setBlockState(blockstate); @@ -29,10 +29,10 @@ index 5a86b2c205250ddcd833a15accb27ca4a580eadd..9b4e20d4bfba2de08084f1d69cb2ebff entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 336ae7f1fc4bd045183c967f8e3bfb5a967a40a1..e881ed9de9d864e0522e1f7f97dc3debf57cf4b6 100644 +index 19a177041e6e9621b0e35ca4f4ceb79b72448680..f3486d042a592cb538c5e8f681673a0c2c45ffd9 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -1372,4 +1372,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1366,4 +1366,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent } // Paper end - respect global sound events gamerule @@ -48,7 +48,7 @@ index 336ae7f1fc4bd045183c967f8e3bfb5a967a40a1..e881ed9de9d864e0522e1f7f97dc3deb + // Paper end - notify observers even if grow failed } diff --git a/src/main/java/net/minecraft/world/level/block/SaplingBlock.java b/src/main/java/net/minecraft/world/level/block/SaplingBlock.java -index 83e6e3286d04c39d6d7ba496251aec962621f72e..3ff0d08e4964aae82d8e51d3b8bf9aa002096f81 100644 +index 2d7290ace5fc8890325a8ec623075ad32f9b1d44..d262a5a6da57ef9ba9a6fe0dfbc88f577105e74f 100644 --- a/src/main/java/net/minecraft/world/level/block/SaplingBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SaplingBlock.java @@ -86,6 +86,7 @@ public class SaplingBlock extends BushBlock implements BonemealableBlock { diff --git a/patches/unapplied/server/0911-Use-correct-source-for-mushroom-block-spread-event.patch b/patches/server/0880-Use-correct-source-for-mushroom-block-spread-event.patch similarity index 94% rename from patches/unapplied/server/0911-Use-correct-source-for-mushroom-block-spread-event.patch rename to patches/server/0880-Use-correct-source-for-mushroom-block-spread-event.patch index ef72acd36..a295e29bc 100644 --- a/patches/unapplied/server/0911-Use-correct-source-for-mushroom-block-spread-event.patch +++ b/patches/server/0880-Use-correct-source-for-mushroom-block-spread-event.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use correct source for mushroom block spread event diff --git a/src/main/java/net/minecraft/world/level/block/MushroomBlock.java b/src/main/java/net/minecraft/world/level/block/MushroomBlock.java -index 1448386e71a1f7c81b48788ac42b49d6dff29912..1f27ae8abd5891a0b8057b454f2210b088b4e95a 100644 +index f549cac99a665f20f1cd1d8c807ed3649fed7531..1172d85c5c26ab2142343d91149766e5993cb36a 100644 --- a/src/main/java/net/minecraft/world/level/block/MushroomBlock.java +++ b/src/main/java/net/minecraft/world/level/block/MushroomBlock.java @@ -68,6 +68,7 @@ public class MushroomBlock extends BushBlock implements BonemealableBlock { diff --git a/patches/unapplied/server/0912-Respect-randomizeData-on-more-entities-when-spawning.patch b/patches/server/0881-Respect-randomizeData-on-more-entities-when-spawning.patch similarity index 76% rename from patches/unapplied/server/0912-Respect-randomizeData-on-more-entities-when-spawning.patch rename to patches/server/0881-Respect-randomizeData-on-more-entities-when-spawning.patch index 0b50ce9b7..777f9a2e5 100644 --- a/patches/unapplied/server/0912-Respect-randomizeData-on-more-entities-when-spawning.patch +++ b/patches/server/0881-Respect-randomizeData-on-more-entities-when-spawning.patch @@ -9,11 +9,11 @@ Subject: [PATCH] Respect randomizeData on more entities when spawning * ExperienceOrb diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java -index 2c60f2d82daacfcfc1eb9f64267ca8ae70726d17..21d3b6f2021b2afd88c5ef6b9a375977d1ccadef 100644 +index 2c44056065b75efecdf7bc835d1e899d1b50ccfe..405caaff1459d8928f91be0fc85213b80ee8b8af 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java -@@ -217,6 +217,13 @@ public final class CraftEntityTypes { - entity.setDirection(direction.getX(), direction.getY(), direction.getZ()); +@@ -221,6 +221,13 @@ public final class CraftEntityTypes { + entity.assignPower(direction.getX(), direction.getY(), direction.getZ()); }; private static final BiConsumer ROT = (spawnData, entity) -> entity.setRot(spawnData.yaw(), spawnData.pitch()); // Paper + // Paper start - respect randomizeData @@ -26,7 +26,7 @@ index 2c60f2d82daacfcfc1eb9f64267ca8ae70726d17..21d3b6f2021b2afd88c5ef6b9a375977 private static final Map, EntityTypeData> CLASS_TYPE_DATA = new HashMap<>(); private static final Map> ENTITY_TYPE_DATA = new HashMap<>(); -@@ -365,11 +372,12 @@ public final class CraftEntityTypes { +@@ -373,11 +380,12 @@ public final class CraftEntityTypes { net.minecraft.world.item.ItemStack itemStack = new net.minecraft.world.item.ItemStack(Items.STONE); ItemEntity item = new ItemEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), itemStack); item.setPickUpDelay(10); @@ -40,19 +40,19 @@ index 2c60f2d82daacfcfc1eb9f64267ca8ae70726d17..21d3b6f2021b2afd88c5ef6b9a375977 )); 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()))); -@@ -381,12 +389,23 @@ public final class CraftEntityTypes { +@@ -389,12 +397,23 @@ public final class CraftEntityTypes { entity.setItem(CraftItemStack.asNMSCopy(new ItemStack(Material.SPLASH_POTION, 1))); return entity; })); -- register(new EntityTypeData<>(EntityType.PRIMED_TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null))); -+ register(new EntityTypeData<>(EntityType.PRIMED_TNT, TNTPrimed.class, CraftTNTPrimed::new, combine(spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null), CLEAR_MOVE_IF_NOT_RANDOMIZED))); // Paper - respect randomizeData +- register(new EntityTypeData<>(EntityType.TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null))); ++ register(new EntityTypeData<>(EntityType.TNT, TNTPrimed.class, CraftTNTPrimed::new, combine(spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null), CLEAR_MOVE_IF_NOT_RANDOMIZED))); // Paper - respect randomizeData register(new EntityTypeData<>(EntityType.FALLING_BLOCK, FallingBlock.class, CraftFallingBlock::new, spawnData -> { BlockPos pos = BlockPos.containing(spawnData.x(), spawnData.y(), spawnData.z()); return new FallingBlockEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), spawnData.world().getBlockState(pos)); // Paper - create falling block entities correctly })); -- register(new EntityTypeData<>(EntityType.FIREWORK, Firework.class, CraftFirework::new, spawnData -> new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY))); +- register(new EntityTypeData<>(EntityType.FIREWORK_ROCKET, Firework.class, CraftFirework::new, spawnData -> new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY))); + // Paper start - respect randomizeData -+ register(new EntityTypeData<>(EntityType.FIREWORK, Firework.class, CraftFirework::new, spawnData -> { ++ register(new EntityTypeData<>(EntityType.FIREWORK_ROCKET, Firework.class, CraftFirework::new, spawnData -> { + FireworkRocketEntity entity = new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY); + if (!spawnData.randomizeData()) { + // logic below was taken from FireworkRocketEntity constructor @@ -64,5 +64,5 @@ index 2c60f2d82daacfcfc1eb9f64267ca8ae70726d17..21d3b6f2021b2afd88c5ef6b9a375977 + })); + // Paper end - respect randomizeData register(new EntityTypeData<>(EntityType.EVOKER_FANGS, EvokerFangs.class, CraftEvokerFangs::new, spawnData -> new net.minecraft.world.entity.projectile.EvokerFangs(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), (float) Math.toRadians(spawnData.yaw()), 0, null))); - register(new EntityTypeData<>(EntityType.MINECART_COMMAND, CommandMinecart.class, CraftMinecartCommand::new, spawnData -> new MinecartCommandBlock(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); + register(new EntityTypeData<>(EntityType.COMMAND_BLOCK_MINECART, CommandMinecart.class, CraftMinecartCommand::new, spawnData -> new MinecartCommandBlock(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); register(new EntityTypeData<>(EntityType.MINECART, RideableMinecart.class, CraftMinecartRideable::new, spawnData -> new Minecart(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); diff --git a/patches/unapplied/server/0913-Use-correct-seed-on-api-world-load.patch b/patches/server/0882-Use-correct-seed-on-api-world-load.patch similarity index 79% rename from patches/unapplied/server/0913-Use-correct-seed-on-api-world-load.patch rename to patches/server/0882-Use-correct-seed-on-api-world-load.patch index a39775a33..fa3c90d19 100644 --- a/patches/unapplied/server/0913-Use-correct-seed-on-api-world-load.patch +++ b/patches/server/0882-Use-correct-seed-on-api-world-load.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Use correct seed on api world load diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 458bf151cb733e023b897a2acff2ab3a10fe0949..33d5454b95011395e0868b4e6a338a2db4b5c398 100644 +index 810ffd7cd1a8a7facc63e10e9eb5fed0504737e3..0daa352795a6533289370388c9c75c98c82396ca 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1361,7 +1361,7 @@ public final class CraftServer implements Server { - net.minecraft.server.Main.forceUpgrade(worldSession, DataFixers.getDataFixer(), this.console.options.has("eraseCache"), () -> true, iregistry); +@@ -1364,7 +1364,7 @@ public final class CraftServer implements Server { + net.minecraft.server.Main.forceUpgrade(worldSession, DataFixers.getDataFixer(), this.console.options.has("eraseCache"), () -> true, iregistrycustom_dimension, this.console.options.has("recreateRegionFiles")); } - long j = BiomeManager.obfuscateSeed(creator.seed()); diff --git a/patches/unapplied/server/0914-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch b/patches/server/0883-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch similarity index 95% rename from patches/unapplied/server/0914-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch rename to patches/server/0883-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch index 930a90563..2f19c9d94 100644 --- a/patches/unapplied/server/0914-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch +++ b/patches/server/0883-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch @@ -7,7 +7,7 @@ The lists are only supposed to contain ticks for the 1 radius neighbours of the chunk. diff --git a/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java b/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java -index ae52f9a04221efed322bc3dc76ac0d56738ffba7..25c1abaeb916781f810d580a4d388d4d3adad75a 100644 +index bfb73e016f107fb8da12903bf233a824d062ed73..22b6d0851a51da180cd8fbbe6554c5370f5ac5bd 100644 --- a/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java +++ b/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java @@ -100,6 +100,25 @@ public class UpgradeData { diff --git a/patches/unapplied/server/0915-Cache-map-ids-on-item-frames.patch b/patches/server/0884-Cache-map-ids-on-item-frames.patch similarity index 82% rename from patches/unapplied/server/0915-Cache-map-ids-on-item-frames.patch rename to patches/server/0884-Cache-map-ids-on-item-frames.patch index 19972857b..c8d063a6e 100644 --- a/patches/unapplied/server/0915-Cache-map-ids-on-item-frames.patch +++ b/patches/server/0884-Cache-map-ids-on-item-frames.patch @@ -5,23 +5,23 @@ Subject: [PATCH] Cache map ids on item frames diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 888cbfaf49aa6d1d1b8cc87cf411a1dd53fbe89d..c2a4fde17673a2bc3133aa0c68608c3da75d5cc5 100644 +index b195de05371e9762654b69365f0e722443425d33..fbb138aefe19237aeeba2f5fc8070bf81e289dc3 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java @@ -118,7 +118,7 @@ public class ServerEntity { ItemStack itemstack = entityitemframe.getItem(); if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 && itemstack.getItem() instanceof MapItem) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable -- Integer integer = MapItem.getMapId(itemstack); +- MapId mapid = (MapId) itemstack.get(DataComponents.MAP_ID); + Integer integer = entityitemframe.cachedMapId; // Paper - Perf: Cache map ids on item frames - MapItemSavedData worldmap = MapItem.getSavedData(integer, this.level); + MapItemSavedData worldmap = MapItem.getSavedData(mapid, this.level); if (worldmap != null) { diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -index e875196824ef9618a52ca3f172f202d5584990df..c34701f95580e4cf45fe086115563127432a28c5 100644 +index 6bf89686ce5cf700ac06ec1e38f53af745098fa3..3f35e16a91b3cf360a3b8a69ee495aaca9210e13 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -@@ -50,6 +50,7 @@ public class ItemFrame extends HangingEntity { +@@ -49,6 +49,7 @@ public class ItemFrame extends HangingEntity { public static final int NUM_ROTATIONS = 8; public float dropChance; public boolean fixed; @@ -29,7 +29,7 @@ index e875196824ef9618a52ca3f172f202d5584990df..c34701f95580e4cf45fe086115563127 public ItemFrame(EntityType type, Level world) { super(type, world); -@@ -388,6 +389,7 @@ public class ItemFrame extends HangingEntity { +@@ -364,6 +365,7 @@ public class ItemFrame extends HangingEntity { } private void onItemChanged(ItemStack stack) { diff --git a/patches/unapplied/server/0916-Fix-custom-statistic-criteria-creation.patch b/patches/server/0885-Fix-custom-statistic-criteria-creation.patch similarity index 88% rename from patches/unapplied/server/0916-Fix-custom-statistic-criteria-creation.patch rename to patches/server/0885-Fix-custom-statistic-criteria-creation.patch index 9137af35a..99ed0c845 100644 --- a/patches/unapplied/server/0916-Fix-custom-statistic-criteria-creation.patch +++ b/patches/server/0885-Fix-custom-statistic-criteria-creation.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix custom statistic criteria creation diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 0d49d7b92305977fe66f13c1e66739c1430dc7fd..6cba1d9f5c6e77309399c245d209662eb4548d56 100644 +index b2755299789dea3bcc49e66d3647a6e8a5080b4d..9ed12c6f896470f140f9ed4bdc565d2b4edda1eb 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -638,6 +638,12 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -635,6 +635,12 @@ public final class CraftMagicNumbers implements UnsafeValues { net.minecraft.core.Holder biomeBase = cra.getHandle().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.BIOME).getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.BIOME, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(biomeKey))); cra.setBiome(x, y, z, biomeBase); } diff --git a/patches/unapplied/server/0917-Bandaid-fix-for-Effect.patch b/patches/server/0886-Bandaid-fix-for-Effect.patch similarity index 88% rename from patches/unapplied/server/0917-Bandaid-fix-for-Effect.patch rename to patches/server/0886-Bandaid-fix-for-Effect.patch index 8b1e531d3..84a9cdb7d 100644 --- a/patches/unapplied/server/0917-Bandaid-fix-for-Effect.patch +++ b/patches/server/0886-Bandaid-fix-for-Effect.patch @@ -9,10 +9,10 @@ upstream. Until then, this test and these fixes should address all the known issues with them diff --git a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java -index a4519762175c68256b1f303daca8b9408ac182bb..457e9093adb99d31ffc7f061d8c858f98c5d0572 100644 +index 71733f918ed84b9879ac1b142ef6205c5e768a9c..7ee13c0a0cd12979c7f8cc2e403baf9300fd61c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java -@@ -16,12 +16,16 @@ public class CraftEffect { +@@ -15,6 +15,8 @@ public class CraftEffect { public static int getDataValue(Effect effect, T data) { int datavalue; switch (effect) { @@ -21,15 +21,7 @@ index a4519762175c68256b1f303daca8b9408ac182bb..457e9093adb99d31ffc7f061d8c858f9 case VILLAGER_PLANT_GROW: datavalue = (Integer) data; break; - case POTION_BREAK: -+ if (data instanceof Potion) { // Paper - use Color for POTION_BREAK - datavalue = ((Potion) data).toDamageValue() & 0x3F; - break; -+ } // Paper - Color will fall through to cast below - case INSTANT_POTION_BREAK: - datavalue = ((Color) data).asRGB(); - break; -@@ -29,6 +33,13 @@ public class CraftEffect { +@@ -26,6 +28,13 @@ public class CraftEffect { Preconditions.checkArgument(data == Material.AIR || ((Material) data).isRecord(), "Invalid record type for Material %s!", data); datavalue = Item.getId(CraftItemType.bukkitToMinecraft((Material) data)); break; @@ -43,7 +35,7 @@ index a4519762175c68256b1f303daca8b9408ac182bb..457e9093adb99d31ffc7f061d8c858f9 case SMOKE: switch ((BlockFace) data) { case DOWN: -@@ -60,8 +71,15 @@ public class CraftEffect { +@@ -57,8 +66,15 @@ public class CraftEffect { } break; case STEP_SOUND: @@ -60,10 +52,10 @@ index a4519762175c68256b1f303daca8b9408ac182bb..457e9093adb99d31ffc7f061d8c858f9 case COMPOSTER_FILL_ATTEMPT: datavalue = ((Boolean) data) ? 1 : 0; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 51e709beb32499f2f56189a0426bba93c43e1c0d..9dadce62fc3e248fa2a8607fe87960491353c317 100644 +index 6231bc770ea6eb6aba47abbc74b6380fd9360d8c..81e5768f556628f3f37dc8091193c0a1b853f1da 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1391,7 +1391,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1400,7 +1400,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { public void playEffect(Location loc, Effect effect, T data, int radius) { if (data != null) { Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect); @@ -73,10 +65,10 @@ index 51e709beb32499f2f56189a0426bba93c43e1c0d..9dadce62fc3e248fa2a8607fe8796049 // Special case: the axis is optional for ELECTRIC_SPARK Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d4875f4477d1d76857bc135f6f0849b889baca22..9eec302c02ebed13859bab0316896ae5a1c084d2 100644 +index 1c6fdad145d81a25ccd2b1193ebe4b5ad96bfb9c..0fe81e58541dbc46ac493897aa190ebf9ddbc805 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -839,7 +839,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -914,7 +914,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Preconditions.checkArgument(effect != null, "Effect cannot be null"); if (data != null) { Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect); diff --git a/patches/unapplied/server/0918-SculkCatalyst-bloom-API.patch b/patches/server/0887-SculkCatalyst-bloom-API.patch similarity index 84% rename from patches/unapplied/server/0918-SculkCatalyst-bloom-API.patch rename to patches/server/0887-SculkCatalyst-bloom-API.patch index 77742addd..ba050f608 100644 --- a/patches/unapplied/server/0918-SculkCatalyst-bloom-API.patch +++ b/patches/server/0887-SculkCatalyst-bloom-API.patch @@ -7,12 +7,12 @@ Subject: [PATCH] SculkCatalyst bloom API public net.minecraft.world.level.block.entity.SculkCatalystBlockEntity$CatalystListener bloom(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/util/RandomSource;)V diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSculkCatalyst.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSculkCatalyst.java -index 139026c06589bb9c4201e20cd200887a8527fe55..a4ad8a90d0c2e4978370f9631dbd3a430e951b1c 100644 +index 5211dc80f449cec09f992a42667e869ab9e7115e..407d5b1d87d14e18878f0ebf1d676a7f49e7cfaf 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSculkCatalyst.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSculkCatalyst.java -@@ -32,4 +32,20 @@ public class CraftSculkCatalyst extends CraftBlockEntityState parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { diff --git a/patches/unapplied/server/0922-Properly-handle-BlockBreakEvent-isDropItems.patch b/patches/server/0891-Properly-handle-BlockBreakEvent-isDropItems.patch similarity index 90% rename from patches/unapplied/server/0922-Properly-handle-BlockBreakEvent-isDropItems.patch rename to patches/server/0891-Properly-handle-BlockBreakEvent-isDropItems.patch index 025a22302..4468fb1d5 100644 --- a/patches/unapplied/server/0922-Properly-handle-BlockBreakEvent-isDropItems.patch +++ b/patches/server/0891-Properly-handle-BlockBreakEvent-isDropItems.patch @@ -9,10 +9,10 @@ food consumption, turtle egg count decreases, ice to water conversions and beehive releases diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 3621770701c6fb1da75c69a41297684493380e37..4747b05619f37009a5a236678aceec6cfc1c0b79 100644 +index ee7f36700863b9f504a70a56c5f28c8e39b45c91..7b4426ac0435d3f419d9ece29dc9eccdb8f99950 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -431,8 +431,8 @@ public class ServerPlayerGameMode { +@@ -434,8 +434,8 @@ public class ServerPlayerGameMode { isCorrectTool = flag1; // Paper - Trigger bee_nest_destroyed trigger in the correct place itemstack.mineBlock(this.level, iblockdata1, pos, this.player); @@ -24,10 +24,10 @@ index 3621770701c6fb1da75c69a41297684493380e37..4747b05619f37009a5a236678aceec6c // return true; // CraftBukkit 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 799e44ae5a7c3d6994653d43d455c39f3e30b012..25e8d6066fb94d0b9a244ab1fec5139b9266d86d 100644 +index 4e8bafa97127632799a1f0260c1ef3367cb8a54c..6ef43d544e9d3dd31506c5a55b0db428fb074b47 100644 --- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java -@@ -84,8 +84,8 @@ public class BeehiveBlock extends BaseEntityBlock { +@@ -86,8 +86,8 @@ public class BeehiveBlock extends BaseEntityBlock { } @Override @@ -35,14 +35,14 @@ index 799e44ae5a7c3d6994653d43d455c39f3e30b012..25e8d6066fb94d0b9a244ab1fec5139b - super.playerDestroy(world, player, pos, state, blockEntity, tool); + public void playerDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack tool, boolean includeDrops, boolean dropExp) { // Paper - fix drops not preventing stats/food exhaustion + super.playerDestroy(world, player, pos, state, blockEntity, tool, includeDrops, dropExp); // Paper - fix drops not preventing stats/food exhaustion - if (!world.isClientSide && blockEntity instanceof BeehiveBlockEntity) { - BeehiveBlockEntity tileentitybeehive = (BeehiveBlockEntity) blockEntity; - + if (!world.isClientSide && blockEntity instanceof BeehiveBlockEntity tileentitybeehive) { + if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) == 0) { + tileentitybeehive.emptyAllLivingFromHive(player, state, BeehiveBlockEntity.BeeReleaseStatus.EMERGENCY); diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 57d92c1785586dfab2b3934733d8ba253e042e2e..c4bf01177b2dfcc88f6992dc85de216d448a79f8 100644 +index c09851136944bd58d82b3a9d19719b0354802824..a757a45d423e1729c9374391df4186ae0522e1ac 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -411,10 +411,18 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -403,10 +403,18 @@ public class Block extends BlockBehaviour implements ItemLike { return this.defaultBlockState(); } @@ -62,7 +62,7 @@ index 57d92c1785586dfab2b3934733d8ba253e042e2e..c4bf01177b2dfcc88f6992dc85de216d public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {} diff --git a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java -index 0f0750f8c790d0db72a0e6b277449a1461674890..03b5ab8251497c0c94467f90e6663a0dc766babb 100644 +index 7fdf744a2be55313cc75c1322f6534f55cf463f5..f446c40c4d90307c568faa2866800f5326634df6 100644 --- a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java @@ -96,8 +96,8 @@ public class DoublePlantBlock extends BushBlock { @@ -77,7 +77,7 @@ index 0f0750f8c790d0db72a0e6b277449a1461674890..03b5ab8251497c0c94467f90e6663a0d protected static void preventDropFromBottomPart(Level world, BlockPos pos, BlockState state, Player player) { diff --git a/src/main/java/net/minecraft/world/level/block/IceBlock.java b/src/main/java/net/minecraft/world/level/block/IceBlock.java -index 52c6c26a300cfd19c478afba411a17c8d5ea0c3c..9c8c1df5187daefb1c8098b4d4a0976c71a7bbfd 100644 +index 4bfe53e3a231a7bec461759e78c7a6cbcb8bb625..013302623d3ca3ff88f242d740af935dcf4844a6 100644 --- a/src/main/java/net/minecraft/world/level/block/IceBlock.java +++ b/src/main/java/net/minecraft/world/level/block/IceBlock.java @@ -33,8 +33,8 @@ public class IceBlock extends HalfTransparentBlock { @@ -92,10 +92,10 @@ index 52c6c26a300cfd19c478afba411a17c8d5ea0c3c..9c8c1df5187daefb1c8098b4d4a0976c this.afterDestroy(world, pos, tool); } diff --git a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java -index c79f3a8885a5ffc9ebac51992e63df14929d9f24..b4646e26965e0f1f26c5019e7c6a13fdf22bdb47 100644 +index bdcb732a31fff0cfc2119132079ce197c7a77c9a..a6f408e56fa6c9de82fd93555fe21e1b11ce1022 100644 --- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java -@@ -173,8 +173,8 @@ public class TurtleEggBlock extends Block { +@@ -174,8 +174,8 @@ public class TurtleEggBlock extends Block { } @Override diff --git a/patches/unapplied/server/0923-Fire-entity-death-event-for-ender-dragon.patch b/patches/server/0892-Fire-entity-death-event-for-ender-dragon.patch similarity index 88% rename from patches/unapplied/server/0923-Fire-entity-death-event-for-ender-dragon.patch rename to patches/server/0892-Fire-entity-death-event-for-ender-dragon.patch index 46c12c1b6..08b740927 100644 --- a/patches/unapplied/server/0923-Fire-entity-death-event-for-ender-dragon.patch +++ b/patches/server/0892-Fire-entity-death-event-for-ender-dragon.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fire entity death event for ender dragon diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 61e4f8be9f5927b65ae03da98250d3cd4c1e8c13..1df13af62af7d0bbd92c84d424a07da66bb8583f 100644 +index e8be7ddbef12b27ed5c5fcfa8b726d5a85058aa9..6f14607a88761171a72e274b3c9b476b20a272f1 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -@@ -643,6 +643,15 @@ public class EnderDragon extends Mob implements Enemy { +@@ -641,6 +641,15 @@ public class EnderDragon extends Mob implements Enemy { @Override public void kill() { diff --git a/patches/unapplied/server/0924-Configurable-entity-tracking-range-by-Y-coordinate.patch b/patches/server/0893-Configurable-entity-tracking-range-by-Y-coordinate.patch similarity index 91% rename from patches/unapplied/server/0924-Configurable-entity-tracking-range-by-Y-coordinate.patch rename to patches/server/0893-Configurable-entity-tracking-range-by-Y-coordinate.patch index 81dacf5aa..1cf3f3d9a 100644 --- a/patches/unapplied/server/0924-Configurable-entity-tracking-range-by-Y-coordinate.patch +++ b/patches/server/0893-Configurable-entity-tracking-range-by-Y-coordinate.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable entity tracking range by Y coordinate Options to configure entity tracking by Y coordinate, also for each entity category. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index ca24463405f138deb882f319bf84696f52a1f606..aed4f4ac21b8ddc9c9ee7ce5151bbfc8bb6cf7f5 100644 +index bff776f07bcc7841acc5757c1f53bde1812756c8..e7994d0f45b186938dd5606284290f56f110d7ed 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1741,6 +1741,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1754,6 +1754,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z; double d2 = d0 * d0; boolean flag = d1 <= d2 && this.entity.broadcastToPlayer(player) && ChunkMap.this.isChunkTracked(player, this.entity.chunkPosition().x, this.entity.chunkPosition().z); diff --git a/patches/unapplied/server/0925-Add-Listing-API-for-Player.patch b/patches/server/0894-Add-Listing-API-for-Player.patch similarity index 92% rename from patches/unapplied/server/0925-Add-Listing-API-for-Player.patch rename to patches/server/0894-Add-Listing-API-for-Player.patch index 8d97e7bc6..45468d2ff 100644 --- a/patches/unapplied/server/0925-Add-Listing-API-for-Player.patch +++ b/patches/server/0894-Add-Listing-API-for-Player.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Listing API for Player diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java -index 754a2a5e958a04b3f8bf216b6022f547aa1cd36f..d41fe931daf03c40ca1d7b9159001d0122d72f0c 100644 +index 6247a21c9c391abf1f6db3482c659593e4f29355..9ccca41bf23efadba5329cc584bbcdcacbe09a92 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java -@@ -29,6 +29,17 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet players) { EnumSet enumSet = EnumSet.of( -@@ -42,6 +53,29 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet { -@@ -146,16 +180,24 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet channels = new HashSet(); private final Map>> invertedVisibilityEntities = new HashMap<>(); @@ -131,7 +130,7 @@ index 9eec302c02ebed13859bab0316896ae5a1c084d2..2c7c39eab2bdbedf4aea903ba76f3289 private static final WeakHashMap> pluginWeakReferences = new WeakHashMap<>(); private int hash = 0; private double health = 20; -@@ -1997,7 +1998,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2073,7 +2074,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { otherPlayer.setUUID(uuidOverride); } // Paper end @@ -140,7 +139,7 @@ index 9eec302c02ebed13859bab0316896ae5a1c084d2..2c7c39eab2bdbedf4aea903ba76f3289 if (original != null) otherPlayer.setUUID(original); // Paper - uuid override } -@@ -2104,6 +2105,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2180,6 +2181,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it } diff --git a/patches/unapplied/server/0926-Configurable-Region-Compression-Format.patch b/patches/server/0895-Configurable-Region-Compression-Format.patch similarity index 67% rename from patches/unapplied/server/0926-Configurable-Region-Compression-Format.patch rename to patches/server/0895-Configurable-Region-Compression-Format.patch index 315bfdce0..b3f767d90 100644 --- a/patches/unapplied/server/0926-Configurable-Region-Compression-Format.patch +++ b/patches/server/0895-Configurable-Region-Compression-Format.patch @@ -5,27 +5,26 @@ Subject: [PATCH] Configurable Region Compression Format diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -index 169e375c814ff814d15101d09dccc67783f50465..8d20e265872e1f8200de186a69a29f498ceb8588 100644 +index f1237f6fd6414900ffbad0caee31aa83310eeef4..e956bca0d06382b8dd63453a6eb111deae68b62e 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -@@ -46,7 +46,7 @@ public class RegionFile implements AutoCloseable { +@@ -50,7 +50,7 @@ public class RegionFile implements AutoCloseable { protected final RegionBitmap usedSectors; - public RegionFile(Path file, Path directory, boolean dsync) throws IOException { -- this(file, directory, RegionFileVersion.VERSION_DEFLATE, dsync); + public RegionFile(RegionStorageInfo storageKey, Path directory, Path path, boolean dsync) throws IOException { +- this(storageKey, directory, path, RegionFileVersion.getSelected(), dsync); + this(file, directory, RegionFileVersion.getCompressionFormat(), dsync); // Paper - Configurable region compression format } - public RegionFile(Path file, Path directory, RegionFileVersion outputChunkStreamVersion, boolean dsync) throws IOException { + public RegionFile(RegionStorageInfo storageKey, Path path, Path directory, RegionFileVersion compressionFormat, boolean dsync) throws IOException { diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileVersion.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileVersion.java -index ebe6fafc26031bc503ca032976f2a593a0f54c6b..581912e1315a4a8b46042a27df54826fa63e9c75 100644 +index cbd892598287c9358c1c2a3840c517462820b389..ef68b57ef1d8d7cb317c417569dd23a777fba4ad 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileVersion.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileVersion.java -@@ -26,6 +26,17 @@ public class RegionFileVersion { - ) - ); - public static final RegionFileVersion VERSION_NONE = register(new RegionFileVersion(3, stream -> stream, stream -> stream)); -+ +@@ -58,6 +58,15 @@ public class RegionFileVersion { + private final RegionFileVersion.StreamWrapper inputWrapper; + private final RegionFileVersion.StreamWrapper outputWrapper; + + // Paper start - Configurable region compression format + public static RegionFileVersion getCompressionFormat() { + return switch (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.compressionFormat) { @@ -35,7 +34,6 @@ index ebe6fafc26031bc503ca032976f2a593a0f54c6b..581912e1315a4a8b46042a27df54826f + }; + } + // Paper end - Configurable region compression format -+ - private final int id; - private final RegionFileVersion.StreamWrapper inputWrapper; - private final RegionFileVersion.StreamWrapper outputWrapper; + private RegionFileVersion( + int id, + @Nullable String name, diff --git a/patches/unapplied/server/0927-Add-BlockFace-to-BlockDamageEvent.patch b/patches/server/0896-Add-BlockFace-to-BlockDamageEvent.patch similarity index 88% rename from patches/unapplied/server/0927-Add-BlockFace-to-BlockDamageEvent.patch rename to patches/server/0896-Add-BlockFace-to-BlockDamageEvent.patch index d17954042..3af304961 100644 --- a/patches/unapplied/server/0927-Add-BlockFace-to-BlockDamageEvent.patch +++ b/patches/server/0896-Add-BlockFace-to-BlockDamageEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add BlockFace to BlockDamageEvent diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 4747b05619f37009a5a236678aceec6cfc1c0b79..d0ca98c3f9ea5c8cb1053da6b17e9a90c86b3ae7 100644 +index 7b4426ac0435d3f419d9ece29dc9eccdb8f99950..cef3a64b5e6c4d34ed079078420078a7adfcd574 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -253,7 +253,7 @@ public class ServerPlayerGameMode { +@@ -256,7 +256,7 @@ public class ServerPlayerGameMode { } return; } @@ -18,10 +18,10 @@ index 4747b05619f37009a5a236678aceec6cfc1c0b79..d0ca98c3f9ea5c8cb1053da6b17e9a90 if (blockEvent.isCancelled()) { // Let the client know the block still exists diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 592670a6ebaed9b42d76afe66264265fc0664934..cd237b81a09b89926b15460eccb503af5267eb34 100644 +index 5af62603415865068ca4b79a7e68d8eb813596b1..47a02b7786d284370d8019b07b8d85f895dc280a 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -651,13 +651,13 @@ public class CraftEventFactory { +@@ -650,13 +650,13 @@ public class CraftEventFactory { /** * BlockDamageEvent */ diff --git a/patches/unapplied/server/0928-Fix-NPE-on-Boat-getStatus.patch b/patches/server/0897-Fix-NPE-on-Boat-getStatus.patch similarity index 100% rename from patches/unapplied/server/0928-Fix-NPE-on-Boat-getStatus.patch rename to patches/server/0897-Fix-NPE-on-Boat-getStatus.patch diff --git a/patches/unapplied/server/0929-Expand-Pose-API.patch b/patches/server/0898-Expand-Pose-API.patch similarity index 83% rename from patches/unapplied/server/0929-Expand-Pose-API.patch rename to patches/server/0898-Expand-Pose-API.patch index 8704e4d4d..1a247ee6f 100644 --- a/patches/unapplied/server/0929-Expand-Pose-API.patch +++ b/patches/server/0898-Expand-Pose-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expand Pose API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3ae2f450ac43c3752f779eeb40ec7761590f9e51..ad3cdb1a3ab07c48bf6b2662b93ddad5974db1a6 100644 +index 638aeef75dc5f7ab8b8e050118a7c709246a85f4..acf2cc8afaf4dee193ecf3bfc4a39b8c39ffc376 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -419,6 +419,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -421,6 +421,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @javax.annotation.Nullable private UUID originWorld; public boolean freezeLocked = false; // Paper - Freeze Tick Lock API @@ -16,7 +16,7 @@ index 3ae2f450ac43c3752f779eeb40ec7761590f9e51..ad3cdb1a3ab07c48bf6b2662b93ddad5 public void setOrigin(@javax.annotation.Nonnull Location location) { this.origin = location.toVector(); -@@ -631,6 +632,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -644,6 +645,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public void onClientRemoval() {} public void setPose(net.minecraft.world.entity.Pose pose) { @@ -25,7 +25,7 @@ index 3ae2f450ac43c3752f779eeb40ec7761590f9e51..ad3cdb1a3ab07c48bf6b2662b93ddad5 if (pose == this.getPose()) { return; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index cbcfb0bc3a85b60e13014245f256e5c356b4b79b..6fcc7949351c5741908a0150498b811f57961899 100644 +index 96448895a0a18e6f819d0a2a629c04abd331fa85..d52b7c5739b8ea51cb91c45ddcad6237b9ce5a5e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -897,6 +897,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { diff --git a/patches/unapplied/server/0930-More-DragonBattle-API.patch b/patches/server/0899-More-DragonBattle-API.patch similarity index 97% rename from patches/unapplied/server/0930-More-DragonBattle-API.patch rename to patches/server/0899-More-DragonBattle-API.patch index 1ff4688b5..a6e0c111c 100644 --- a/patches/unapplied/server/0930-More-DragonBattle-API.patch +++ b/patches/server/0899-More-DragonBattle-API.patch @@ -10,7 +10,7 @@ public net.minecraft.world.level.dimension.end.EndDragonFight respawnCrystals public net.minecraft.world.level.dimension.end.EndDragonFight spawnNewGateway(Lnet/minecraft/core/BlockPos;)V 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 8737501e14792de13adf95da24fa6177bfb77946..b9c85289776971f90eb5749262a9014befe465f7 100644 +index f6f5fad52e41d5ccc37dc28c40904fce014907fb..6b59c4b5906c0fb4fdbc674452c6ff3df42b099b 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 @@ -439,6 +439,24 @@ public class EndDragonFight { diff --git a/patches/unapplied/server/0932-Add-PlayerPickItemEvent.patch b/patches/server/0900-Add-PlayerPickItemEvent.patch similarity index 89% rename from patches/unapplied/server/0932-Add-PlayerPickItemEvent.patch rename to patches/server/0900-Add-PlayerPickItemEvent.patch index 6bda42823..8e18bf4d9 100644 --- a/patches/unapplied/server/0932-Add-PlayerPickItemEvent.patch +++ b/patches/server/0900-Add-PlayerPickItemEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerPickItemEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a580b36ae2dafc1b178fd2333afcc23e0691e5f2..6349ac2f093c067311efac06dd84c92996b1c64a 100644 +index b88d6230172311d92844a9621f2eb3be644ac2aa..88baa1235210553248a7fec765bd5ad660ad5295 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -907,8 +907,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -938,8 +938,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.disconnect("Invalid hotbar selection (Hacking?)", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause return; } @@ -28,10 +28,10 @@ index a580b36ae2dafc1b178fd2333afcc23e0691e5f2..6349ac2f093c067311efac06dd84c929 this.player.connection.send(new ClientboundContainerSetSlotPacket(-2, 0, packet.getSlot(), this.player.getInventory().getItem(packet.getSlot()))); this.player.connection.send(new ClientboundSetCarriedItemPacket(this.player.getInventory().selected)); diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java -index 395cecc385e4126a7534ac9aeb15cf323efab03e..309acf7bd07e38043aa81e0e686edba1136bd04c 100644 +index 2c20441cce1e07239a65aadfb85004fcdf3672c8..1e77482a98869e464c1f0a873cff8febf7924c8c 100644 --- a/src/main/java/net/minecraft/world/entity/player/Inventory.java +++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java -@@ -174,7 +174,13 @@ public class Inventory implements Container, Nameable { +@@ -171,7 +171,13 @@ public class Inventory implements Container, Nameable { } public void pickSlot(int slot) { diff --git a/patches/unapplied/server/0933-Allow-trident-custom-damage.patch b/patches/server/0901-Allow-trident-custom-damage.patch similarity index 77% rename from patches/unapplied/server/0933-Allow-trident-custom-damage.patch rename to patches/server/0901-Allow-trident-custom-damage.patch index fb6397821..eaa126da9 100644 --- a/patches/unapplied/server/0933-Allow-trident-custom-damage.patch +++ b/patches/server/0901-Allow-trident-custom-damage.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Allow trident custom damage diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java -index 870db6ab82ef2ecb989342bb6a66435f823a9263..8ae7d62b72fb72d893e68b02b645d48374595ae6 100644 +index c75ac52f302e8e29e0bdea32c85ccf6713257a9b..3ff06cc6ad35567bcb1f29115db63c11a8e79dbb 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java +++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java -@@ -37,10 +37,12 @@ public class ThrownTrident extends AbstractArrow { +@@ -35,10 +35,12 @@ public class ThrownTrident extends AbstractArrow { public ThrownTrident(EntityType type, Level world) { - super(type, world, ThrownTrident.DEFAULT_ARROW_STACK); + super(type, world); + this.setBaseDamage(net.minecraft.world.item.TridentItem.BASE_DAMAGE); // Paper - Allow trident custom damage } @@ -21,12 +21,12 @@ index 870db6ab82ef2ecb989342bb6a66435f823a9263..8ae7d62b72fb72d893e68b02b645d483 this.entityData.set(ThrownTrident.ID_LOYALTY, (byte) EnchantmentHelper.getLoyalty(stack)); this.entityData.set(ThrownTrident.ID_FOIL, stack.hasFoil()); } -@@ -124,7 +126,7 @@ public class ThrownTrident extends AbstractArrow { +@@ -128,7 +130,7 @@ public class ThrownTrident extends AbstractArrow { @Override protected void onHitEntity(EntityHitResult entityHitResult) { Entity entity = entityHitResult.getEntity(); - float f = 8.0F; + float f = (float) this.getBaseDamage(); // Paper - Allow trident custom damage - if (entity instanceof LivingEntity) { - LivingEntity entityliving = (LivingEntity) entity; + if (entity instanceof LivingEntity entityliving) { + f += EnchantmentHelper.getDamageBonus(this.getPickupItemStackOrigin(), entityliving.getType()); diff --git a/patches/unapplied/server/0934-Expose-hand-in-BlockCanBuildEvent.patch b/patches/server/0902-Expose-hand-in-BlockCanBuildEvent.patch similarity index 94% rename from patches/unapplied/server/0934-Expose-hand-in-BlockCanBuildEvent.patch rename to patches/server/0902-Expose-hand-in-BlockCanBuildEvent.patch index ab17992d3..4abc7e9fc 100644 --- a/patches/unapplied/server/0934-Expose-hand-in-BlockCanBuildEvent.patch +++ b/patches/server/0902-Expose-hand-in-BlockCanBuildEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose hand in BlockCanBuildEvent diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java -index 8c54b92b65b3d379e14a11370b09d45351ab22e1..e258e5915b286f1117bc1413dfd3d2a5c4655380 100644 +index 7180996027f70aef7afe32fb2adfce6431429401..fc7d978f9e57814a933b9cb725c3af1e7d403795 100644 --- a/src/main/java/net/minecraft/world/item/BlockItem.java +++ b/src/main/java/net/minecraft/world/item/BlockItem.java -@@ -214,7 +214,7 @@ public class BlockItem extends Item { +@@ -191,7 +191,7 @@ public class BlockItem extends Item { boolean defaultReturn = (!this.mustSurvive() || state.canSurvive(context.getLevel(), context.getClickedPos())) && world.checkEntityCollision(state, entityhuman, voxelshapecollision, context.getClickedPos(), true); // Paper - Cancel hit for vanished players org.bukkit.entity.Player player = (context.getPlayer() instanceof ServerPlayer) ? (org.bukkit.entity.Player) context.getPlayer().getBukkitEntity() : null; diff --git a/patches/unapplied/server/0935-Optimize-nearest-structure-border-iteration.patch b/patches/server/0903-Optimize-nearest-structure-border-iteration.patch similarity index 93% rename from patches/unapplied/server/0935-Optimize-nearest-structure-border-iteration.patch rename to patches/server/0903-Optimize-nearest-structure-border-iteration.patch index 0cad8d11f..805af0f26 100644 --- a/patches/unapplied/server/0935-Optimize-nearest-structure-border-iteration.patch +++ b/patches/server/0903-Optimize-nearest-structure-border-iteration.patch @@ -14,10 +14,10 @@ ensure that the returned found structure (which may for example be a buried treasure that will be marked on a treasure map) is the same as in vanilla. 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 a7ac9a0c4966c2f9d2b325fa59e8792850d376e8..84a2a5384a8a31eff5363e6391c9a5187212ff36 100644 +index c4972e5767488878f7929226258c41c1cc30a47f..c9cd18ce79a6ee7297a8fd14f4dbe712570b3ced 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -@@ -260,12 +260,15 @@ public abstract class ChunkGenerator { +@@ -266,12 +266,15 @@ public abstract class ChunkGenerator { int i1 = placement.spacing(); for (int j1 = -radius; j1 <= radius; ++j1) { diff --git a/patches/unapplied/server/0936-Implement-OfflinePlayer-isConnected.patch b/patches/server/0904-Implement-OfflinePlayer-isConnected.patch similarity index 81% rename from patches/unapplied/server/0936-Implement-OfflinePlayer-isConnected.patch rename to patches/server/0904-Implement-OfflinePlayer-isConnected.patch index 37cdf1cbc..ceef01055 100644 --- a/patches/unapplied/server/0936-Implement-OfflinePlayer-isConnected.patch +++ b/patches/server/0904-Implement-OfflinePlayer-isConnected.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement OfflinePlayer#isConnected diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 96408d505ce80799868ff84554a3b0b25adabb22..4a875bce9563f3b9351ebecde9b0eb1287beb50e 100644 +index 4d654c4f0b6210a9841427789ba70ce5d1d308be..9d93130f23addb18b97d7f5ec013faef17a74529 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -54,6 +54,13 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa @@ -23,10 +23,10 @@ index 96408d505ce80799868ff84554a3b0b25adabb22..4a875bce9563f3b9351ebecde9b0eb12 public String getName() { Player player = this.getPlayer(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 2c7c39eab2bdbedf4aea903ba76f3289285bd7e7..3cbebe9a08a6f37c8716a71db9c34454025b458a 100644 +index 1d6ea70c8039b7dcae3742ce7ef6a52015d6bc52..b8999852f132ac25da3ddb5164c73c886a3fa572 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -243,6 +243,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -253,6 +253,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.server.getPlayer(this.getUniqueId()) != null; } @@ -39,4 +39,4 @@ index 2c7c39eab2bdbedf4aea903ba76f3289285bd7e7..3cbebe9a08a6f37c8716a71db9c34454 + @Override public InetSocketAddress getAddress() { - if (this.getHandle().connection == null) return null; + if (this.getHandle().connection.protocol() == null) return null; diff --git a/patches/unapplied/server/0937-Fix-inventory-desync.patch b/patches/server/0905-Fix-inventory-desync.patch similarity index 83% rename from patches/unapplied/server/0937-Fix-inventory-desync.patch rename to patches/server/0905-Fix-inventory-desync.patch index f69c4d7ee..683a9dc78 100644 --- a/patches/unapplied/server/0937-Fix-inventory-desync.patch +++ b/patches/server/0905-Fix-inventory-desync.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix inventory desync diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index d1833dcc92b1570e62a1941bbea6d66ff0b2ee5f..5da7ffee71bf6d82a53b3c2f99e2bd898d0b1799 100644 +index b7cc2b5ee85e8e6a5c8cb8ce1f3c934773be32e6..7f93b60e9bdfc2739c77f4dfa69031fbe2097d65 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1336,6 +1336,7 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1464,6 +1464,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti // CraftBukkit start - fire PlayerLeashEntityEvent if (CraftEventFactory.callPlayerLeashEntityEvent(this, player, player, hand).isCancelled()) { ((ServerPlayer) player).connection.send(new ClientboundSetEntityLinkPacket(this, this.getLeashHolder())); @@ -17,10 +17,10 @@ index d1833dcc92b1570e62a1941bbea6d66ff0b2ee5f..5da7ffee71bf6d82a53b3c2f99e2bd89 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java -index e258e5915b286f1117bc1413dfd3d2a5c4655380..8d2c0accadaf0c5d28e7db6e62a05f6c619cf02f 100644 +index fc7d978f9e57814a933b9cb725c3af1e7d403795..96fb69ec6db2e7c8c728435f0c537b076259b2fb 100644 --- a/src/main/java/net/minecraft/world/item/BlockItem.java +++ b/src/main/java/net/minecraft/world/item/BlockItem.java -@@ -116,7 +116,7 @@ public class BlockItem extends Item { +@@ -114,7 +114,7 @@ public class BlockItem extends Item { if (placeEvent != null && (placeEvent.isCancelled() || !placeEvent.canBuild())) { blockstate.update(true, false); diff --git a/patches/unapplied/server/0938-Add-titleOverride-to-InventoryOpenEvent.patch b/patches/server/0906-Add-titleOverride-to-InventoryOpenEvent.patch similarity index 92% rename from patches/unapplied/server/0938-Add-titleOverride-to-InventoryOpenEvent.patch rename to patches/server/0906-Add-titleOverride-to-InventoryOpenEvent.patch index 76cb094c3..c4903a4da 100644 --- a/patches/unapplied/server/0938-Add-titleOverride-to-InventoryOpenEvent.patch +++ b/patches/server/0906-Add-titleOverride-to-InventoryOpenEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add titleOverride to InventoryOpenEvent diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 406794c439900a0d86fd4fe67d05a98bde625aec..2bb82dcffd8fdc25d658ec36a34f959b25217396 100644 +index c70e1a17d855f2a9d160e8cd15a6a4bcf39b8945..b2bf086506ba7eda6ba6912ebf51a9da154cd414 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1523,12 +1523,17 @@ public class ServerPlayer extends Player { +@@ -1607,12 +1607,17 @@ public class ServerPlayer extends Player { this.nextContainerCounter(); AbstractContainerMenu container = factory.createMenu(this.containerCounter, this.getInventory(), this); @@ -27,7 +27,7 @@ index 406794c439900a0d86fd4fe67d05a98bde625aec..2bb82dcffd8fdc25d658ec36a34f959b if (container == null && !cancelled) { // Let pre-cancelled events fall through // SPIGOT-5263 - close chest if cancelled if (factory instanceof Container) { -@@ -1550,7 +1555,7 @@ public class ServerPlayer extends Player { +@@ -1634,7 +1639,7 @@ public class ServerPlayer extends Player { } else { // CraftBukkit start this.containerMenu = container; @@ -37,10 +37,10 @@ index 406794c439900a0d86fd4fe67d05a98bde625aec..2bb82dcffd8fdc25d658ec36a34f959b this.initMenu(container); return OptionalInt.of(this.containerCounter); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 6a52789d6e68438c1eaa2fb9af591fa9e1d381e2..7984365c8290ac9e526a413b56e1c8c0841e330c 100644 +index 3d36d79a4e7f16f6face3465cdf54656984f3ebc..41f3cdec7deabf34358b8087df77169f85a5b919 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -360,12 +360,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -358,12 +358,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { Preconditions.checkArgument(windowType != null, "Unknown windowType"); AbstractContainerMenu container = new CraftContainer(inventory, player, player.nextContainerCounter()); @@ -58,7 +58,7 @@ index 6a52789d6e68438c1eaa2fb9af591fa9e1d381e2..7984365c8290ac9e526a413b56e1c8c0 //player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, CraftChatMessage.fromString(title)[0])); // Paper - comment if (!player.isImmobile()) player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, io.papermc.paper.adventure.PaperAdventure.asVanilla(adventure$title))); // Paper - Prevent opening inventories when frozen -@@ -441,7 +445,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -439,7 +443,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } // Trigger an INVENTORY_OPEN event @@ -70,7 +70,7 @@ index 6a52789d6e68438c1eaa2fb9af591fa9e1d381e2..7984365c8290ac9e526a413b56e1c8c0 if (container == null) { return; } -@@ -452,6 +459,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -450,6 +457,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { //String title = inventory.getTitle(); // Paper - comment net.kyori.adventure.text.Component adventure$title = inventory.title(); // Paper if (adventure$title == null) adventure$title = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(inventory.getTitle()); // Paper @@ -79,10 +79,10 @@ index 6a52789d6e68438c1eaa2fb9af591fa9e1d381e2..7984365c8290ac9e526a413b56e1c8c0 if (!player.isImmobile()) player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, io.papermc.paper.adventure.PaperAdventure.asVanilla(adventure$title))); // Paper - Prevent opening inventories when frozen player.containerMenu = container; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index cd237b81a09b89926b15460eccb503af5267eb34..53c3b2123d6fa78367aef53d6949e58170cb9fce 100644 +index 47a02b7786d284370d8019b07b8d85f895dc280a..eefdb3da069d9615db7c663bcf8a72b78a0e6817 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1389,10 +1389,21 @@ public class CraftEventFactory { +@@ -1384,10 +1384,21 @@ public class CraftEventFactory { } public static AbstractContainerMenu callInventoryOpenEvent(ServerPlayer player, AbstractContainerMenu container) { @@ -105,7 +105,7 @@ index cd237b81a09b89926b15460eccb503af5267eb34..53c3b2123d6fa78367aef53d6949e581 if (player.containerMenu != player.inventoryMenu) { // fire INVENTORY_CLOSE if one already open player.connection.handleContainerClose(new ServerboundContainerClosePacket(player.containerMenu.containerId), InventoryCloseEvent.Reason.OPEN_NEW); // Paper - Inventory close reason } -@@ -1407,10 +1418,10 @@ public class CraftEventFactory { +@@ -1402,10 +1413,10 @@ public class CraftEventFactory { if (event.isCancelled()) { container.transferTo(player.containerMenu, craftPlayer); diff --git a/patches/unapplied/server/0939-Configure-sniffer-egg-hatch-time.patch b/patches/server/0907-Configure-sniffer-egg-hatch-time.patch similarity index 94% rename from patches/unapplied/server/0939-Configure-sniffer-egg-hatch-time.patch rename to patches/server/0907-Configure-sniffer-egg-hatch-time.patch index 702bef175..7def55b1f 100644 --- a/patches/unapplied/server/0939-Configure-sniffer-egg-hatch-time.patch +++ b/patches/server/0907-Configure-sniffer-egg-hatch-time.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configure sniffer egg hatch time diff --git a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java -index 4f1ff12df44756b63e3c3f9fc43e7ea485df6f57..e225595bbf044ff126797f44b233221c358ef641 100644 +index b943384eb6a4612993556036f0d3beec6939a559..ffe5e14cf8190774c8935513ebeb041eda81f912 100644 --- a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java @@ -62,7 +62,7 @@ public class SnifferEggBlock extends Block { diff --git a/patches/unapplied/server/0940-Do-crystal-portal-proximity-check-before-entity-look.patch b/patches/server/0908-Do-crystal-portal-proximity-check-before-entity-look.patch similarity index 92% rename from patches/unapplied/server/0940-Do-crystal-portal-proximity-check-before-entity-look.patch rename to patches/server/0908-Do-crystal-portal-proximity-check-before-entity-look.patch index 43740a74f..c83b2614f 100644 --- a/patches/unapplied/server/0940-Do-crystal-portal-proximity-check-before-entity-look.patch +++ b/patches/server/0908-Do-crystal-portal-proximity-check-before-entity-look.patch @@ -12,10 +12,10 @@ some servers that have players placing end crystals as a style of combat. The very cheap distance check prevents running the entity lookup every time. diff --git a/src/main/java/net/minecraft/world/item/EndCrystalItem.java b/src/main/java/net/minecraft/world/item/EndCrystalItem.java -index ca1edc083847b47bb450b291723aca778a5912dc..e1696f6b77df4c8fceaece64701d4db78b0a4c42 100644 +index f9a940cdff3983d9d4de46bd5ddc1905f9254dcf..dd1bdb4bb87a3a59c229ba76b36841d199717624 100644 --- a/src/main/java/net/minecraft/world/item/EndCrystalItem.java +++ b/src/main/java/net/minecraft/world/item/EndCrystalItem.java -@@ -29,7 +29,7 @@ public class EndCrystalItem extends Item { +@@ -30,7 +30,7 @@ public class EndCrystalItem extends Item { if (!iblockdata.is(Blocks.OBSIDIAN) && !iblockdata.is(Blocks.BEDROCK)) { return InteractionResult.FAIL; } else { @@ -24,7 +24,7 @@ index ca1edc083847b47bb450b291723aca778a5912dc..e1696f6b77df4c8fceaece64701d4db7 if (!world.isEmptyBlock(blockposition1)) { return InteractionResult.FAIL; -@@ -56,7 +56,7 @@ public class EndCrystalItem extends Item { +@@ -57,7 +57,7 @@ public class EndCrystalItem extends Item { EndDragonFight enderdragonbattle = ((ServerLevel) world).getDragonFight(); if (enderdragonbattle != null) { @@ -34,7 +34,7 @@ index ca1edc083847b47bb450b291723aca778a5912dc..e1696f6b77df4c8fceaece64701d4db7 } 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 b9c85289776971f90eb5749262a9014befe465f7..d4f903c402765c6e8e1db99e148613748f530726 100644 +index 6b59c4b5906c0fb4fdbc674452c6ff3df42b099b..18a1b4325cac81b040596071dab99ef9bf6f3142 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 @@ -558,6 +558,12 @@ public class EndDragonFight { diff --git a/patches/unapplied/server/0941-Skip-POI-finding-if-stuck-in-vehicle.patch b/patches/server/0909-Skip-POI-finding-if-stuck-in-vehicle.patch similarity index 100% rename from patches/unapplied/server/0941-Skip-POI-finding-if-stuck-in-vehicle.patch rename to patches/server/0909-Skip-POI-finding-if-stuck-in-vehicle.patch diff --git a/patches/unapplied/server/0942-Add-slot-sanity-checks-in-container-clicks.patch b/patches/server/0910-Add-slot-sanity-checks-in-container-clicks.patch similarity index 91% rename from patches/unapplied/server/0942-Add-slot-sanity-checks-in-container-clicks.patch rename to patches/server/0910-Add-slot-sanity-checks-in-container-clicks.patch index dc29fcbde..cb7ca8285 100644 --- a/patches/unapplied/server/0942-Add-slot-sanity-checks-in-container-clicks.patch +++ b/patches/server/0910-Add-slot-sanity-checks-in-container-clicks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add slot sanity checks in container clicks diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 6349ac2f093c067311efac06dd84c92996b1c64a..33560f75dd76f946203faa34ca5d10f213cd62c9 100644 +index 88baa1235210553248a7fec765bd5ad660ad5295..f03cef6fffddcf3aea30c2c9033046c0b1f42aa5 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2892,6 +2892,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2978,6 +2978,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl break; case SWAP: if ((packet.getButtonNum() >= 0 && packet.getButtonNum() < 9) || packet.getButtonNum() == 40) { @@ -22,7 +22,7 @@ index 6349ac2f093c067311efac06dd84c92996b1c64a..33560f75dd76f946203faa34ca5d10f2 Slot clickedSlot = this.player.containerMenu.getSlot(packet.getSlotNum()); if (clickedSlot.mayPickup(this.player)) { diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index 24caa1cf91cd50a5972238119aca1f85ec2b3d2b..75f836f07c66dbf71017ef0b7697851353d0f2e1 100644 +index 85fb19177690ea7235c10f64789066599db08b05..428e454116804c27496cfbf796edd44780890d33 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java @@ -423,6 +423,7 @@ public abstract class AbstractContainerMenu { diff --git a/patches/unapplied/server/0943-Call-BlockRedstoneEvents-for-lecterns.patch b/patches/server/0911-Call-BlockRedstoneEvents-for-lecterns.patch similarity index 93% rename from patches/unapplied/server/0943-Call-BlockRedstoneEvents-for-lecterns.patch rename to patches/server/0911-Call-BlockRedstoneEvents-for-lecterns.patch index c5d3495f3..57df928cb 100644 --- a/patches/unapplied/server/0943-Call-BlockRedstoneEvents-for-lecterns.patch +++ b/patches/server/0911-Call-BlockRedstoneEvents-for-lecterns.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Call BlockRedstoneEvents for lecterns diff --git a/src/main/java/net/minecraft/world/level/block/LecternBlock.java b/src/main/java/net/minecraft/world/level/block/LecternBlock.java -index f14f35e0f5a087845f7229a68e996feb06c946d4..95652e63870f3d7473b1bb144515a77d9d8c3b1c 100644 +index 76ec78b5e28a29cb83b24dec02aacb0f022dcc1a..a6b4d483f94663315abcfcea7f54be2ecebb28c2 100644 --- a/src/main/java/net/minecraft/world/level/block/LecternBlock.java +++ b/src/main/java/net/minecraft/world/level/block/LecternBlock.java @@ -178,6 +178,16 @@ public class LecternBlock extends BaseEntityBlock { diff --git a/patches/unapplied/server/0944-Allow-proper-checking-of-empty-item-stacks.patch b/patches/server/0912-Allow-proper-checking-of-empty-item-stacks.patch similarity index 89% rename from patches/unapplied/server/0944-Allow-proper-checking-of-empty-item-stacks.patch rename to patches/server/0912-Allow-proper-checking-of-empty-item-stacks.patch index 1ffc2241c..70c9dc2da 100644 --- a/patches/unapplied/server/0944-Allow-proper-checking-of-empty-item-stacks.patch +++ b/patches/server/0912-Allow-proper-checking-of-empty-item-stacks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow proper checking of empty item stacks diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index f106db3aa5e5b3b0b8133eff77dbc65c8895ff2e..38ceeca108c258852eeb7a48015010a689ac43ec 100644 +index d544a4e4d88b51cf6ca53e048c411aa23c64d78f..97e1bd56de2c7f6d606e3a4968b2f55cd4689b91 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -@@ -37,12 +37,19 @@ public final class CraftItemStack extends ItemStack { +@@ -36,12 +36,19 @@ public final class CraftItemStack extends ItemStack { } // Paper end - MC Utils diff --git a/patches/unapplied/server/0945-Fix-silent-equipment-change-for-mobs.patch b/patches/server/0913-Fix-silent-equipment-change-for-mobs.patch similarity index 88% rename from patches/unapplied/server/0945-Fix-silent-equipment-change-for-mobs.patch rename to patches/server/0913-Fix-silent-equipment-change-for-mobs.patch index 46482b386..0232f6df8 100644 --- a/patches/unapplied/server/0945-Fix-silent-equipment-change-for-mobs.patch +++ b/patches/server/0913-Fix-silent-equipment-change-for-mobs.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix silent equipment change for mobs diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 5da7ffee71bf6d82a53b3c2f99e2bd898d0b1799..a59ee9d9b93404060e7a4702497071859daec6df 100644 +index 7f93b60e9bdfc2739c77f4dfa69031fbe2097d65..506101a692c73f6acf2e647c3ab18024ccdff866 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1047,13 +1047,20 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1150,19 +1150,26 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti @Override public void setItemSlot(EquipmentSlot slot, ItemStack stack) { @@ -28,11 +28,18 @@ index 5da7ffee71bf6d82a53b3c2f99e2bd898d0b1799..a59ee9d9b93404060e7a470249707185 case ARMOR: - this.onEquipItem(slot, (ItemStack) this.armorItems.set(slot.getIndex(), stack), stack); + this.onEquipItem(slot, (ItemStack) this.armorItems.set(slot.getIndex(), stack), stack, silent); // Paper - Fix silent equipment change + break; + case BODY: + ItemStack itemstack1 = this.bodyArmorItem; + + this.bodyArmorItem = stack; +- this.onEquipItem(slot, itemstack1, stack); ++ this.onEquipItem(slot, itemstack1, stack, silent); // Paper - Fix silent equipment change } } 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 40664cc7e3665432a2ab5e552802c3fc3edbdb22..586e3e92ccc275446df6dbbff9bf010a37a9aa8f 100644 +index 87ada535362303097862e811d3d573997983064f..0c5fe46d2da113beff3e220843593d616e37d4ca 100644 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java @@ -250,8 +250,8 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo diff --git a/patches/unapplied/server/0946-Fix-spigot-s-Forced-Stats.patch b/patches/server/0914-Fix-spigot-s-Forced-Stats.patch similarity index 100% rename from patches/unapplied/server/0946-Fix-spigot-s-Forced-Stats.patch rename to patches/server/0914-Fix-spigot-s-Forced-Stats.patch diff --git a/patches/unapplied/server/0947-Add-missing-InventoryHolders-to-inventories.patch b/patches/server/0915-Add-missing-InventoryHolders-to-inventories.patch similarity index 91% rename from patches/unapplied/server/0947-Add-missing-InventoryHolders-to-inventories.patch rename to patches/server/0915-Add-missing-InventoryHolders-to-inventories.patch index e6954fc31..152d57f68 100644 --- a/patches/unapplied/server/0947-Add-missing-InventoryHolders-to-inventories.patch +++ b/patches/server/0915-Add-missing-InventoryHolders-to-inventories.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add missing InventoryHolders to inventories diff --git a/src/main/java/net/minecraft/world/Container.java b/src/main/java/net/minecraft/world/Container.java -index da5ff65fade5cdf14fad3705c08b48896bc4c36d..d6cbe98e67fdbf8db46338a88ab1356dd63b50a3 100644 +index 39f126347459a68e8bcc59e374a1b9fe507b7497..f402dbbfe3a443e6bc51f88b85abe937852b52f0 100644 --- a/src/main/java/net/minecraft/world/Container.java +++ b/src/main/java/net/minecraft/world/Container.java -@@ -100,7 +100,7 @@ public interface Container extends Clearable { +@@ -103,7 +103,7 @@ public interface Container extends Clearable { java.util.List getViewers(); @@ -18,7 +18,7 @@ index da5ff65fade5cdf14fad3705c08b48896bc4c36d..d6cbe98e67fdbf8db46338a88ab1356d void setMaxStackSize(int size); diff --git a/src/main/java/net/minecraft/world/SimpleContainer.java b/src/main/java/net/minecraft/world/SimpleContainer.java -index ff1aba1e69cfde633fd01724f1a8d0af7f59437f..9546d93f90ca34b4d35bd98df847bf896c654043 100644 +index 6632cf24ebe6d147950a1fdb876660937da86b73..d04bf7d06855022c973073fb84c5d3d65f2553e1 100644 --- a/src/main/java/net/minecraft/world/SimpleContainer.java +++ b/src/main/java/net/minecraft/world/SimpleContainer.java @@ -30,7 +30,7 @@ public class SimpleContainer implements Container, StackedContentsCompatible { @@ -57,10 +57,10 @@ index ff1aba1e69cfde633fd01724f1a8d0af7f59437f..9546d93f90ca34b4d35bd98df847bf89 public SimpleContainer(int i, org.bukkit.inventory.InventoryHolder owner) { this.bukkitOwner = owner; diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index 75f836f07c66dbf71017ef0b7697851353d0f2e1..eef0d3c59f0ce6e89033a5e228d31b63339c2773 100644 +index 428e454116804c27496cfbf796edd44780890d33..4c7e91977fa590abfe7eb3704d8008ed6d4e3ab3 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -@@ -993,4 +993,15 @@ public abstract class AbstractContainerMenu { +@@ -991,4 +991,15 @@ public abstract class AbstractContainerMenu { this.stateId = this.stateId + 1 & 32767; return this.stateId; } @@ -77,23 +77,23 @@ index 75f836f07c66dbf71017ef0b7697851353d0f2e1..eef0d3c59f0ce6e89033a5e228d31b63 + // Paper end - Add missing InventoryHolders } diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -index 2813a87a01d0704a3de210cd005073f953d538f8..88842f31836df70717fdf7f77f39a2ad8bb45326 100644 +index 37735417e2a3df96eea88aa0a3f2d7faeb823a2e..5031155b72f9a7b6b65cc6d72a5bdf963ac19e22 100644 --- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java +++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -@@ -41,7 +41,7 @@ public class BeaconMenu extends AbstractContainerMenu { +@@ -42,7 +42,7 @@ public class BeaconMenu extends AbstractContainerMenu { public BeaconMenu(int syncId, Container inventory, ContainerData propertyDelegate, ContainerLevelAccess context) { super(MenuType.BEACON, syncId); this.player = (Inventory) inventory; // CraftBukkit - TODO: check this -- this.beacon = new SimpleContainer(1) { -+ this.beacon = new SimpleContainer(this.createBlockHolder(context), 1) { // Paper - Add missing InventoryHolders +- this.beacon = new SimpleContainer(1) { // CraftBukkit - decompile error ++ this.beacon = new SimpleContainer(this.createBlockHolder(context), 1) { // CraftBukkit - decompile error // Paper - Add missing InventoryHolders @Override public boolean canPlaceItem(int slot, ItemStack stack) { return stack.is(ItemTags.BEACON_PAYMENT_ITEMS); diff --git a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java b/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java -index ca3c8b31967a6efd7b0caacb091ab2151e7c0bee..45bf1c95d86bdfc709c5f1a1fbefb18e1cc51f4c 100644 +index c52c4c4210bc6ae082443318d9795c48c816aba6..ab98637bf967ac19f0bc06e8cb7f18a8b13ec809 100644 --- a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java +++ b/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java -@@ -52,7 +52,7 @@ public class CartographyTableMenu extends AbstractContainerMenu { +@@ -54,7 +54,7 @@ public class CartographyTableMenu extends AbstractContainerMenu { public CartographyTableMenu(int syncId, Inventory inventory, final ContainerLevelAccess context) { super(MenuType.CARTOGRAPHY_TABLE, syncId); @@ -102,7 +102,7 @@ index ca3c8b31967a6efd7b0caacb091ab2151e7c0bee..45bf1c95d86bdfc709c5f1a1fbefb18e @Override public void setChanged() { CartographyTableMenu.this.slotsChanged(this); -@@ -66,7 +66,7 @@ public class CartographyTableMenu extends AbstractContainerMenu { +@@ -68,7 +68,7 @@ public class CartographyTableMenu extends AbstractContainerMenu { } // CraftBukkit end }; @@ -148,10 +148,10 @@ index 85e336637db8643fc5aca1dba724c9b341cbf46f..12b466ccb7c36021cf807c4f3fd2bcb0 @Override public Optional evaluate(BiFunction getter) { diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java -index c2d6265933dc4ceed80e2bd517970d02164a63df..343f44db579839eb61376f876b5eff2e615dc2e5 100644 +index beec777ae79f6c649f5fa1f0a8a30ac3e272a129..46beb8e45788950b8ca863aaf07c6d0587d8f693 100644 --- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java +++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java -@@ -61,7 +61,7 @@ public class EnchantmentMenu extends AbstractContainerMenu { +@@ -59,7 +59,7 @@ public class EnchantmentMenu extends AbstractContainerMenu { public EnchantmentMenu(int syncId, Inventory playerInventory, ContainerLevelAccess context) { super(MenuType.ENCHANTMENT, syncId); @@ -161,7 +161,7 @@ index c2d6265933dc4ceed80e2bd517970d02164a63df..343f44db579839eb61376f876b5eff2e public void setChanged() { super.setChanged(); diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -index 95ac3446fba1f37637c9700080de2e1ce7a3550a..23462de504932bd351b8dfacde514fe361343912 100644 +index ecf3cdc16d1ea830c4d45b57f69204118af3218a..db9444dda248260372d96ce239a590e88a4c1142 100644 --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java @@ -59,8 +59,8 @@ public class GrindstoneMenu extends AbstractContainerMenu { @@ -176,7 +176,7 @@ index 95ac3446fba1f37637c9700080de2e1ce7a3550a..23462de504932bd351b8dfacde514fe3 public void setChanged() { super.setChanged(); diff --git a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java -index eb36a69b8da492aec9609cc9ef80d7d68ff9af03..62e1b7096fa659778b737b3d520389e73138dc5d 100644 +index be840717e180b6b5abd14db6cc9263349737f9a3..7de5e47f9a54263734eeef855a2dc07ef64d30ea 100644 --- a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java @@ -18,7 +18,7 @@ public abstract class ItemCombinerMenu extends AbstractContainerMenu { @@ -206,7 +206,7 @@ index eb36a69b8da492aec9609cc9ef80d7d68ff9af03..62e1b7096fa659778b737b3d520389e7 public void setChanged() { super.setChanged(); diff --git a/src/main/java/net/minecraft/world/inventory/LoomMenu.java b/src/main/java/net/minecraft/world/inventory/LoomMenu.java -index e8c755dc71d9818f025eb25224122b19c5f9e15b..c1c9cfd3f77b2dbbc39741d629c7dfb24a48d4f6 100644 +index 03b6622ec13338005005c9a11e0e6395da1b15a7..4a7df3429a2b43312eff9b36568761bea854df74 100644 --- a/src/main/java/net/minecraft/world/inventory/LoomMenu.java +++ b/src/main/java/net/minecraft/world/inventory/LoomMenu.java @@ -73,7 +73,7 @@ public class LoomMenu extends AbstractContainerMenu { diff --git a/patches/unapplied/server/0948-Do-not-read-tile-entities-in-chunks-that-are-positio.patch b/patches/server/0916-Do-not-read-tile-entities-in-chunks-that-are-positio.patch similarity index 92% rename from patches/unapplied/server/0948-Do-not-read-tile-entities-in-chunks-that-are-positio.patch rename to patches/server/0916-Do-not-read-tile-entities-in-chunks-that-are-positio.patch index a5090d6c0..21515b5db 100644 --- a/patches/unapplied/server/0948-Do-not-read-tile-entities-in-chunks-that-are-positio.patch +++ b/patches/server/0916-Do-not-read-tile-entities-in-chunks-that-are-positio.patch @@ -10,10 +10,10 @@ which would cause a crash on Folia but would appear to function fine on Paper. diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index 3b046dc106b96b7ca2b148d605e8b7c97453d033..85de64c1e75e1323f8425fc53e525c215ff417ce 100644 +index 2ca1f01ab59000949cbde1766c9811a72dbfb4ff..88f0aca2da0e14ed5ec0513944fa0ba28b73b5d1 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -@@ -307,6 +307,13 @@ public class ChunkSerializer { +@@ -301,6 +301,13 @@ public class ChunkSerializer { for (int k1 = 0; k1 < nbttaglist3.size(); ++k1) { CompoundTag nbttagcompound4 = nbttaglist3.getCompound(k1); @@ -27,7 +27,7 @@ index 3b046dc106b96b7ca2b148d605e8b7c97453d033..85de64c1e75e1323f8425fc53e525c21 ((ChunkAccess) object1).setBlockEntityNbt(nbttagcompound4); } -@@ -517,10 +524,19 @@ public class ChunkSerializer { +@@ -505,10 +512,19 @@ public class ChunkSerializer { CompoundTag nbttagcompound1 = nbttaglist1.getCompound(i); boolean flag = nbttagcompound1.getBoolean("keepPacked"); @@ -45,6 +45,6 @@ index 3b046dc106b96b7ca2b148d605e8b7c97453d033..85de64c1e75e1323f8425fc53e525c21 } else { - BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound1); + // Paper - do not read tile entities positioned outside the chunk; move up - BlockEntity tileentity = BlockEntity.loadStatic(blockposition, chunk.getBlockState(blockposition), nbttagcompound1); + BlockEntity tileentity = BlockEntity.loadStatic(blockposition, chunk.getBlockState(blockposition), nbttagcompound1, world.registryAccess()); if (tileentity != null) { diff --git a/patches/unapplied/server/0949-Add-missing-logs-for-log-ips-config-option.patch b/patches/server/0917-Add-missing-logs-for-log-ips-config-option.patch similarity index 100% rename from patches/unapplied/server/0949-Add-missing-logs-for-log-ips-config-option.patch rename to patches/server/0917-Add-missing-logs-for-log-ips-config-option.patch diff --git a/patches/unapplied/server/0950-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch b/patches/server/0918-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch similarity index 93% rename from patches/unapplied/server/0950-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch rename to patches/server/0918-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch index e547ae252..e1f2934da 100644 --- a/patches/unapplied/server/0950-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch +++ b/patches/server/0918-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch @@ -14,7 +14,7 @@ field by calling any method on the class, and for convenience we use values(). diff --git a/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java b/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java -index 25c1abaeb916781f810d580a4d388d4d3adad75a..932c9ba8d9ef82746cac0c40292a8e41ffb4ea33 100644 +index 22b6d0851a51da180cd8fbbe6554c5370f5ac5bd..cd9b65f278a750a0177a3252271015d43172b2e9 100644 --- a/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java +++ b/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java @@ -140,6 +140,7 @@ public class UpgradeData { diff --git a/patches/unapplied/server/0951-Fix-NPE-in-AdvancementProgress-getDateAwarded.patch b/patches/server/0919-Fix-NPE-in-AdvancementProgress-getDateAwarded.patch similarity index 100% rename from patches/unapplied/server/0951-Fix-NPE-in-AdvancementProgress-getDateAwarded.patch rename to patches/server/0919-Fix-NPE-in-AdvancementProgress-getDateAwarded.patch diff --git a/patches/unapplied/server/0952-Fix-team-sidebar-objectives-not-being-cleared.patch b/patches/server/0920-Fix-team-sidebar-objectives-not-being-cleared.patch similarity index 100% rename from patches/unapplied/server/0952-Fix-team-sidebar-objectives-not-being-cleared.patch rename to patches/server/0920-Fix-team-sidebar-objectives-not-being-cleared.patch diff --git a/patches/unapplied/server/0953-Fix-missing-map-initialize-event-call.patch b/patches/server/0921-Fix-missing-map-initialize-event-call.patch similarity index 80% rename from patches/unapplied/server/0953-Fix-missing-map-initialize-event-call.patch rename to patches/server/0921-Fix-missing-map-initialize-event-call.patch index 20b3a50d5..f190f7aa2 100644 --- a/patches/unapplied/server/0953-Fix-missing-map-initialize-event-call.patch +++ b/patches/server/0921-Fix-missing-map-initialize-event-call.patch @@ -7,15 +7,15 @@ Subject: [PATCH] Fix missing map initialize event call public net.minecraft.world.level.storage.DimensionDataStorage readSavedData(Ljava/util/function/Function;Lnet/minecraft/util/datafix/DataFixTypes;Ljava/lang/String;)Lnet/minecraft/world/level/saveddata/SavedData; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index a6af6585aca50033f45138a4408218b056b8b785..8235dace0f4a1090dfbd403db34231ccafe5f30e 100644 +index 80c927c906d1b6119c1b32b8982d879fbbd4d257..7662bcb0e622acadb31b78a670807149779395d9 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1657,13 +1657,25 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1664,13 +1664,24 @@ public class ServerLevel extends Level implements WorldGenLevel { @Nullable @Override - public MapItemSavedData getMapData(String id) { + public MapItemSavedData getMapData(MapId id) { - // CraftBukkit start -- MapItemSavedData worldmap = (MapItemSavedData) this.getServer().overworld().getDataStorage().get(MapItemSavedData.factory(), id); +- MapItemSavedData worldmap = (MapItemSavedData) this.getServer().overworld().getDataStorage().get(MapItemSavedData.factory(), id.key()); - if (worldmap != null) { - worldmap.id = id; + // Paper start - Call missing map initialize event and set id @@ -23,8 +23,7 @@ index a6af6585aca50033f45138a4408218b056b8b785..8235dace0f4a1090dfbd403db34231cc + + final net.minecraft.world.level.saveddata.SavedData existing = storage.cache.get(id); + if (existing == null && !storage.cache.containsKey(id)) { -+ final net.minecraft.world.level.saveddata.SavedData.Factory factory = MapItemSavedData.factory(); -+ final MapItemSavedData map = storage.readSavedData(factory.deserializer(), factory.type(), id); ++ final MapItemSavedData worldmap = (MapItemSavedData) this.getServer().overworld().getDataStorage().get(MapItemSavedData.factory(), id.key()); + storage.cache.put(id, map); + if (map != null) { + map.id = id; diff --git a/patches/unapplied/server/0954-Update-entity-data-when-attaching-firework-to-entity.patch b/patches/server/0922-Update-entity-data-when-attaching-firework-to-entity.patch similarity index 100% rename from patches/unapplied/server/0954-Update-entity-data-when-attaching-firework-to-entity.patch rename to patches/server/0922-Update-entity-data-when-attaching-firework-to-entity.patch diff --git a/patches/unapplied/server/0956-Fix-UnsafeValues-loadAdvancement.patch b/patches/server/0923-Fix-UnsafeValues-loadAdvancement.patch similarity index 86% rename from patches/unapplied/server/0956-Fix-UnsafeValues-loadAdvancement.patch rename to patches/server/0923-Fix-UnsafeValues-loadAdvancement.patch index 60d7a4d75..b9bdb9dd5 100644 --- a/patches/unapplied/server/0956-Fix-UnsafeValues-loadAdvancement.patch +++ b/patches/server/0923-Fix-UnsafeValues-loadAdvancement.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Fix UnsafeValues#loadAdvancement diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 6cba1d9f5c6e77309399c245d209662eb4548d56..8627d9d89e0288e35c17834c23ce94673ac08236 100644 +index 9ed12c6f896470f140f9ed4bdc565d2b4edda1eb..1cfd122fd734b359705e8091215dc5f6332e6f0b 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -321,7 +321,27 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -320,7 +320,27 @@ public final class CraftMagicNumbers implements UnsafeValues { JsonElement jsonelement = ServerAdvancementManager.GSON.fromJson(advancement, JsonElement.class); - net.minecraft.advancements.Advancement nms = Util.getOrThrow(net.minecraft.advancements.Advancement.CODEC.parse(JsonOps.INSTANCE, jsonelement), JsonParseException::new); + net.minecraft.advancements.Advancement nms = net.minecraft.advancements.Advancement.CODEC.parse(JsonOps.INSTANCE, jsonelement).getOrThrow(JsonParseException::new); if (nms != null) { - MinecraftServer.getServer().getAdvancements().advancements.put(minecraftkey, new AdvancementHolder(minecraftkey, nms)); + // Paper start - Fix throw UnsupportedOperationException diff --git a/patches/unapplied/server/0957-Add-player-idle-duration-API.patch b/patches/server/0924-Add-player-idle-duration-API.patch similarity index 85% rename from patches/unapplied/server/0957-Add-player-idle-duration-API.patch rename to patches/server/0924-Add-player-idle-duration-API.patch index a702fe431..bbc033f10 100644 --- a/patches/unapplied/server/0957-Add-player-idle-duration-API.patch +++ b/patches/server/0924-Add-player-idle-duration-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API Implements API for getting and resetting a player's idle duration. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3cbebe9a08a6f37c8716a71db9c34454025b458a..84df724997ac36fb2e27e78ba08a31e3009cabf4 100644 +index b8999852f132ac25da3ddb5164c73c886a3fa572..cbe2edee5503386bbd0ef02cc90d1685ae4a5121 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3337,6 +3337,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3402,6 +3402,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/unapplied/server/0958-Don-t-check-if-we-can-see-non-visible-entities.patch b/patches/server/0925-Don-t-check-if-we-can-see-non-visible-entities.patch similarity index 85% rename from patches/unapplied/server/0958-Don-t-check-if-we-can-see-non-visible-entities.patch rename to patches/server/0925-Don-t-check-if-we-can-see-non-visible-entities.patch index 1c1aa40a9..a63a8d3cb 100644 --- a/patches/unapplied/server/0958-Don-t-check-if-we-can-see-non-visible-entities.patch +++ b/patches/server/0925-Don-t-check-if-we-can-see-non-visible-entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't check if we can see non-visible entities diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index aed4f4ac21b8ddc9c9ee7ce5151bbfc8bb6cf7f5..22558aa7f83191519ca21357925309119d0718c7 100644 +index e7994d0f45b186938dd5606284290f56f110d7ed..027f2734b0ff226437f4c94430215929b6ea2219 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1752,7 +1752,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1765,7 +1765,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper end - Configurable entity tracking range by Y // CraftBukkit start - respect vanish API diff --git a/patches/unapplied/server/0959-Fix-NPE-in-SculkBloomEvent-world-access.patch b/patches/server/0926-Fix-NPE-in-SculkBloomEvent-world-access.patch similarity index 91% rename from patches/unapplied/server/0959-Fix-NPE-in-SculkBloomEvent-world-access.patch rename to patches/server/0926-Fix-NPE-in-SculkBloomEvent-world-access.patch index b66e61a52..3f575aef2 100644 --- a/patches/unapplied/server/0959-Fix-NPE-in-SculkBloomEvent-world-access.patch +++ b/patches/server/0926-Fix-NPE-in-SculkBloomEvent-world-access.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix NPE in SculkBloomEvent world access diff --git a/src/main/java/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java -index ccb1db9649dfded891b308c346a6aeb870b61ce2..83481539e058e5f428d9951e409fed62ef159e5c 100644 +index faa708976469263093b673d756ac5570f3680236..81dd0aa6a90fd9dda9e7752f85b9cf4568e3b575 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java -@@ -32,9 +32,16 @@ public class SculkCatalystBlockEntity extends BlockEntity implements GameEventLi +@@ -34,9 +34,16 @@ public class SculkCatalystBlockEntity extends BlockEntity implements GameEventLi public SculkCatalystBlockEntity(BlockPos pos, BlockState state) { super(BlockEntityType.SCULK_CATALYST, pos, state); this.catalystListener = new SculkCatalystBlockEntity.CatalystListener(state, new BlockPositionSource(pos)); @@ -26,7 +26,7 @@ index ccb1db9649dfded891b308c346a6aeb870b61ce2..83481539e058e5f428d9951e409fed62 public static void serverTick(Level world, BlockPos pos, BlockState state, SculkCatalystBlockEntity blockEntity) { org.bukkit.craftbukkit.event.CraftEventFactory.sourceBlockOverride = blockEntity.getBlockPos(); // CraftBukkit - SPIGOT-7068: Add source block override, not the most elegant way but better than passing down a BlockPosition up to five methods deep. blockEntity.catalystListener.getSculkSpreader().updateCursors(world, pos, world.getRandom(), true); -@@ -64,13 +71,12 @@ public class SculkCatalystBlockEntity extends BlockEntity implements GameEventLi +@@ -66,13 +73,12 @@ public class SculkCatalystBlockEntity extends BlockEntity implements GameEventLi final SculkSpreader sculkSpreader; private final BlockState blockState; private final PositionSource positionSource; diff --git a/patches/unapplied/server/0960-Allow-null-itemstack-for-Player-sendEquipmentChange.patch b/patches/server/0927-Allow-null-itemstack-for-Player-sendEquipmentChange.patch similarity index 84% rename from patches/unapplied/server/0960-Allow-null-itemstack-for-Player-sendEquipmentChange.patch rename to patches/server/0927-Allow-null-itemstack-for-Player-sendEquipmentChange.patch index 6f15e00d6..4fe9c9b75 100644 --- a/patches/unapplied/server/0960-Allow-null-itemstack-for-Player-sendEquipmentChange.patch +++ b/patches/server/0927-Allow-null-itemstack-for-Player-sendEquipmentChange.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow null itemstack for Player#sendEquipmentChange diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 84df724997ac36fb2e27e78ba08a31e3009cabf4..482b6bd9277277923528d8c9a3e9b49d3f5628bc 100644 +index cbe2edee5503386bbd0ef02cc90d1685ae4a5121..843e1d61b4bfa2be48e26e4ca95cbf757c0da736 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1049,7 +1049,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1125,7 +1125,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void sendEquipmentChange(LivingEntity entity, EquipmentSlot slot, ItemStack item) { diff --git a/patches/unapplied/server/0961-Optimize-VarInts.patch b/patches/server/0928-Optimize-VarInts.patch similarity index 100% rename from patches/unapplied/server/0961-Optimize-VarInts.patch rename to patches/server/0928-Optimize-VarInts.patch diff --git a/patches/unapplied/server/0962-Add-API-to-get-the-collision-shape-of-a-block-before.patch b/patches/server/0929-Add-API-to-get-the-collision-shape-of-a-block-before.patch similarity index 90% rename from patches/unapplied/server/0962-Add-API-to-get-the-collision-shape-of-a-block-before.patch rename to patches/server/0929-Add-API-to-get-the-collision-shape-of-a-block-before.patch index 9794102b9..e2e767fdf 100644 --- a/patches/unapplied/server/0962-Add-API-to-get-the-collision-shape-of-a-block-before.patch +++ b/patches/server/0929-Add-API-to-get-the-collision-shape-of-a-block-before.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add API to get the collision shape of a block before it's 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 37c5d66dafd877d2231c8d191f5a84748bf24551..d6480b44f94f1a8d21eb5b5ded2956889883c560 100644 +index 841b6cabd319229bff9f830c2fe4de102ad74906..df1ae4a1c0c3bf7bfb3a83aa175ba237ccf2ab77 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -678,6 +678,20 @@ public class CraftBlockData implements BlockData { +@@ -679,6 +679,20 @@ public class CraftBlockData implements BlockData { return this.state.isFaceSturdy(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CraftBlock.blockFaceToNotch(face), CraftBlockSupport.toNMS(support)); } diff --git a/patches/unapplied/server/0963-Add-predicate-for-blocks-when-raytracing.patch b/patches/server/0930-Add-predicate-for-blocks-when-raytracing.patch similarity index 96% rename from patches/unapplied/server/0963-Add-predicate-for-blocks-when-raytracing.patch rename to patches/server/0930-Add-predicate-for-blocks-when-raytracing.patch index efe5b6e6b..56057f1ee 100644 --- a/patches/unapplied/server/0963-Add-predicate-for-blocks-when-raytracing.patch +++ b/patches/server/0930-Add-predicate-for-blocks-when-raytracing.patch @@ -47,10 +47,10 @@ index c978f3b2d42f512e982f289e76c2422e41b7eec6..bb8e962e63c7a2d931f9bd7f7c002aa3 Vec3 vec3d = raytrace1.getFrom().subtract(raytrace1.getTo()); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 9dadce62fc3e248fa2a8607fe87960491353c317..6b6e5d483adc47a8db177359fbfcd626825c460f 100644 +index 81e5768f556628f3f37dc8091193c0a1b853f1da..eb429b4f77f2f8efb6d2b1fc6a8a07690f0a320c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1125,9 +1125,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1134,9 +1134,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize, Predicate filter) { @@ -68,7 +68,7 @@ index 9dadce62fc3e248fa2a8607fe87960491353c317..6b6e5d483adc47a8db177359fbfcd626 Preconditions.checkArgument(direction != null, "Vector direction cannot be null"); direction.checkFinite(); -@@ -1177,9 +1183,16 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1186,9 +1192,16 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) { @@ -87,7 +87,7 @@ index 9dadce62fc3e248fa2a8607fe87960491353c317..6b6e5d483adc47a8db177359fbfcd626 Preconditions.checkArgument(direction != null, "Vector direction cannot be null"); direction.checkFinite(); -@@ -1192,16 +1205,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1201,16 +1214,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { } Vector dir = direction.clone().normalize().multiply(maxDistance); diff --git a/patches/unapplied/server/0964-Broadcast-take-item-packets-with-collector-as-source.patch b/patches/server/0931-Broadcast-take-item-packets-with-collector-as-source.patch similarity index 88% rename from patches/unapplied/server/0964-Broadcast-take-item-packets-with-collector-as-source.patch rename to patches/server/0931-Broadcast-take-item-packets-with-collector-as-source.patch index 762ec4c8f..a1301dea2 100644 --- a/patches/unapplied/server/0964-Broadcast-take-item-packets-with-collector-as-source.patch +++ b/patches/server/0931-Broadcast-take-item-packets-with-collector-as-source.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Broadcast take item packets with collector as source This fixes players (which can't view the collector) seeing item pickups with themselves as the target. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 09a48779046484c2f3628d1499659e247c736fce..6b591f8b484be20418e8a6ca09aba84cda398a3d 100644 +index a356d0476e6ff9389809e8db1f584ac4bffe8be9..a8b168f56c74feeaca55335731b1d485289736cb 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3724,7 +3724,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3708,7 +3708,7 @@ public abstract class LivingEntity extends Entity implements Attackable { public void take(Entity item, int count) { if (!item.isRemoved() && !this.level().isClientSide && (item instanceof ItemEntity || item instanceof AbstractArrow || item instanceof ExperienceOrb)) { diff --git a/patches/unapplied/server/0965-Expand-LingeringPotion-API.patch b/patches/server/0932-Expand-LingeringPotion-API.patch similarity index 61% rename from patches/unapplied/server/0965-Expand-LingeringPotion-API.patch rename to patches/server/0932-Expand-LingeringPotion-API.patch index abc4c7243..7aa019995 100644 --- a/patches/unapplied/server/0965-Expand-LingeringPotion-API.patch +++ b/patches/server/0932-Expand-LingeringPotion-API.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Expand LingeringPotion API diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java -index 2b05824f5826a2da2539f8a6d373a16c185aa80a..19af5552e36964996082226b4f77561d7deb99f6 100644 +index d5e9f2bb692a162c3a2ed93498aa9649d6554cd9..eb144ebe10c51d73a5da9b731e8d4a789e8664d0 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java +++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java -@@ -289,7 +289,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie - +@@ -272,7 +272,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie + boolean noEffects = potioncontents.hasEffects(); // Paper - Fix potions splash events // CraftBukkit start org.bukkit.event.entity.LingeringPotionSplashEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callLingeringPotionSplashEvent(this, position, entityareaeffectcloud); -- if (!(event.isCancelled() || entityareaeffectcloud.isRemoved() || (noEffects && entityareaeffectcloud.effects.isEmpty() && entityareaeffectcloud.getPotion().getEffects().isEmpty()))) { // Paper - don't spawn area effect cloud if the effects were empty and not changed during the event handling -+ if (!(event.isCancelled() || entityareaeffectcloud.isRemoved() || (!event.allowsEmptyCreation() && (noEffects && entityareaeffectcloud.effects.isEmpty() && entityareaeffectcloud.getPotion().getEffects().isEmpty())))) { // Paper - don't spawn area effect cloud if the effects were empty and not changed during the event handling +- if (!(event.isCancelled() || entityareaeffectcloud.isRemoved() || (noEffects && !entityareaeffectcloud.potionContents.hasEffects()))) { // Paper - don't spawn area effect cloud if the effects were empty and not changed during the event handling ++ if (!(event.isCancelled() || entityareaeffectcloud.isRemoved() || (!event.allowsEmptyCreation() && (noEffects && !entityareaeffectcloud.potionContents.hasEffects())))) { // Paper - don't spawn area effect cloud if the effects were empty and not changed during the event handling this.level().addFreshEntity(entityareaeffectcloud); } else { entityareaeffectcloud.discard(null); // CraftBukkit - add Bukkit remove cause diff --git a/patches/unapplied/server/0966-Add-MaterialTagsTest.patch b/patches/server/0933-Add-MaterialTagsTest.patch similarity index 100% rename from patches/unapplied/server/0966-Add-MaterialTagsTest.patch rename to patches/server/0933-Add-MaterialTagsTest.patch diff --git a/patches/unapplied/server/0967-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch b/patches/server/0934-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch similarity index 89% rename from patches/unapplied/server/0967-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch rename to patches/server/0934-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch index a6ef0b68f..81f523b2f 100644 --- a/patches/unapplied/server/0967-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch +++ b/patches/server/0934-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix strikeLightningEffect powers lightning rods and clears diff --git a/src/main/java/net/minecraft/world/entity/LightningBolt.java b/src/main/java/net/minecraft/world/entity/LightningBolt.java -index 41a3ca4edf4fa662f2af13efd7b78b56e24aa4a7..0a8a53710c693a220e9475f6f3112b91d8209c00 100644 +index 0471d9c85af02133f99cca4e181b83b58a3f1abc..4f701788bd21b61cad251a3a88f9bc416fb99051 100644 --- a/src/main/java/net/minecraft/world/entity/LightningBolt.java +++ b/src/main/java/net/minecraft/world/entity/LightningBolt.java -@@ -46,6 +46,7 @@ public class LightningBolt extends Entity { +@@ -47,6 +47,7 @@ public class LightningBolt extends Entity { private ServerPlayer cause; private final Set hitEntities = Sets.newHashSet(); private int blocksSetOnFire; @@ -17,7 +17,7 @@ index 41a3ca4edf4fa662f2af13efd7b78b56e24aa4a7..0a8a53710c693a220e9475f6f3112b91 public LightningBolt(EntityType type, Level world) { super(type, world); -@@ -86,7 +87,7 @@ public class LightningBolt extends Entity { +@@ -87,7 +88,7 @@ public class LightningBolt extends Entity { @Override public void tick() { super.tick(); @@ -26,7 +26,7 @@ index 41a3ca4edf4fa662f2af13efd7b78b56e24aa4a7..0a8a53710c693a220e9475f6f3112b91 if (this.level().isClientSide()) { this.level().playLocalSound(this.getX(), this.getY(), this.getZ(), SoundEvents.LIGHTNING_BOLT_THUNDER, SoundSource.WEATHER, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F, false); this.level().playLocalSound(this.getX(), this.getY(), this.getZ(), SoundEvents.LIGHTNING_BOLT_IMPACT, SoundSource.WEATHER, 2.0F, 0.5F + this.random.nextFloat() * 0.2F, false); -@@ -133,7 +134,7 @@ public class LightningBolt extends Entity { +@@ -134,7 +135,7 @@ public class LightningBolt extends Entity { } } @@ -35,7 +35,7 @@ index 41a3ca4edf4fa662f2af13efd7b78b56e24aa4a7..0a8a53710c693a220e9475f6f3112b91 if (!(this.level() instanceof ServerLevel)) { this.level().setSkyFlashTime(2); } else if (!this.visualOnly) { -@@ -162,7 +163,7 @@ public class LightningBolt extends Entity { +@@ -163,7 +164,7 @@ public class LightningBolt extends Entity { } private void spawnFire(int spreadAttempts) { @@ -45,7 +45,7 @@ index 41a3ca4edf4fa662f2af13efd7b78b56e24aa4a7..0a8a53710c693a220e9475f6f3112b91 BlockState iblockdata = BaseFireBlock.getState(this.level(), blockposition); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 6b6e5d483adc47a8db177359fbfcd626825c460f..cdcab87bfe2e207ee1f4f8a111682efefbd96511 100644 +index eb429b4f77f2f8efb6d2b1fc6a8a07690f0a320c..d50cd69b3c26605852a8b01efe768abfc43728b4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -766,7 +766,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/unapplied/server/0847-config-for-disabling-entity-tag-tags.patch b/patches/unapplied/server/0847-config-for-disabling-entity-tag-tags.patch deleted file mode 100644 index 822a325fe..000000000 --- a/patches/unapplied/server/0847-config-for-disabling-entity-tag-tags.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Wed, 15 Sep 2021 14:52:42 -0700 -Subject: [PATCH] config for disabling entity tag tags - - -diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 557df259ae54defb43e475e10fc4732854e64f77..656c68b37bc25d6b77f295f9efe0a81dd20b69c1 100644 ---- a/src/main/java/net/minecraft/world/entity/EntityType.java -+++ b/src/main/java/net/minecraft/world/entity/EntityType.java -@@ -493,6 +493,13 @@ public class EntityType implements FeatureElement, EntityTypeT - if (world.isClientSide || !entity.onlyOpCanSetNbt() || player != null && minecraftserver.getPlayerList().isOp(player.getGameProfile())) { - CompoundTag nbttagcompound1 = entity.saveWithoutId(new CompoundTag()); - UUID uuid = entity.getUUID(); -+ // Paper start - filter out protected tags -+ if (player == null || !player.getBukkitEntity().hasPermission("minecraft.nbt.place")) { -+ for (net.minecraft.commands.arguments.NbtPathArgument.NbtPath tag : world.paperConfig().entities.spawning.filteredEntityTagNbtPaths) { -+ tag.remove(itemNbt.getCompound("EntityTag")); -+ } -+ } -+ // Paper end - filter out protected tags - - nbttagcompound1.merge(itemNbt.getCompound("EntityTag")); - entity.setUUID(uuid); diff --git a/patches/unapplied/server/0876-Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch b/removed-patches-1-20-5/0876-Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch similarity index 100% rename from patches/unapplied/server/0876-Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch rename to removed-patches-1-20-5/0876-Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch diff --git a/patches/unapplied/server/0896-Array-backed-synched-entity-data.patch b/removed-patches-1-20-5/0896-Array-backed-synched-entity-data.patch similarity index 100% rename from patches/unapplied/server/0896-Array-backed-synched-entity-data.patch rename to removed-patches-1-20-5/0896-Array-backed-synched-entity-data.patch diff --git a/patches/unapplied/server/0931-Deep-clone-unhandled-nbt-tags.patch b/removed-patches-1-20-5/0931-Deep-clone-unhandled-nbt-tags.patch similarity index 100% rename from patches/unapplied/server/0931-Deep-clone-unhandled-nbt-tags.patch rename to removed-patches-1-20-5/0931-Deep-clone-unhandled-nbt-tags.patch diff --git a/patches/unapplied/server/0955-Use-correct-variable-for-initializing-CraftLootTable.patch b/removed-patches-1-20-5/0955-Use-correct-variable-for-initializing-CraftLootTable.patch similarity index 100% rename from patches/unapplied/server/0955-Use-correct-variable-for-initializing-CraftLootTable.patch rename to removed-patches-1-20-5/0955-Use-correct-variable-for-initializing-CraftLootTable.patch