From a0f4d303eb3a6f60341091c4079618f4f8f88aca Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 13 Jun 2024 18:30:23 -0700 Subject: [PATCH] 788/1053 --- patches/api/Add-EntityPortalReadyEvent.patch | 6 +- ...-command-sender-which-forwards-feedb.patch | 0 .../Add-API-for-item-entity-health.patch | 0 ...eEvent-and-CollarColorable-interface.patch | 0 .../server/Add-EntityPortalReadyEvent.patch | 28 ++++ .../server/Add-EntityToggleSitEvent.patch | 8 +- .../server/Add-GameEvent-tags.patch | 0 .../server/Add-Moving-Piston-API.patch | 0 .../Add-NamespacedKey-biome-methods.patch | 0 .../Add-Player-Warden-Warning-API.patch | 0 .../server/Add-Player-getFishHook.patch | 0 .../Add-PlayerInventorySlotChangeEvent.patch | 2 +- .../server/Add-PlayerStopUsingItemEvent.patch | 0 .../Add-PrePlayerAttackEntityEvent.patch | 6 +- .../Add-TameableDeathMessageEvent.patch | 0 .../Add-Velocity-IP-Forwarding-Support.patch | 0 .../server/Add-WardenAngerChangeEvent.patch | 0 ...arameter-to-ProjectileSource-launchP.patch | 0 .../Add-and-fix-missing-BlockFadeEvents.patch | 0 ...tion-for-worlds-affected-by-time-cmd.patch | 0 ...-configurable-height-for-slime-spawn.patch | 0 .../server/Add-entity-knockback-API.patch | 0 .../server/Add-fire-tick-delay-option.patch | 0 .../server/Add-getDrops-to-BlockState.patch | 0 ...check-for-PersistentDataContainer-ha.patch | 0 ...date-calls-to-CraftServer-getSpawnLi.patch | 0 ...dd-missing-block-data-mins-and-maxes.patch | 0 ...rtant-BlockStateListPopulator-method.patch | 0 ...d-missing-structure-set-seed-configs.patch | 0 ...-strict-advancement-dimension-checks.patch | 2 +- .../Add-paper-dumplisteners-command.patch | 0 .../Add-support-for-Proxy-Protocol.patch | 0 ...us-missing-EntityDropItemEvent-calls.patch | 0 ...-serialization-deserialization-for-P.patch | 0 ...low-changing-bed-s-occupied-property.patch | 0 ...llow-changing-the-EnderDragon-podium.patch | 0 .../server/Block-Ticking-API.patch | 0 .../server/Bucketable-API.patch | 0 .../server/Buffer-OOB-setBlock-calls.patch | 2 +- .../Call-BlockPhysicsEvent-more-often.patch | 0 .../server/Collision-API.patch | 0 .../Configurable-chat-thread-limit.patch | 0 ...max-block-light-for-monster-spawning.patch | 0 ...igurable-sculk-sensor-listener-range.patch | 6 +- ...-interactions-with-items-on-cooldown.patch | 0 ...stom-Chat-Completion-Suggestions-API.patch | 0 .../server/Custom-Potion-Mixes.patch | 0 .../server/Detect-headless-JREs.patch | 0 ...t-selector-resolving-in-books-by-def.patch | 0 ...-chunk-for-dynamic-game-event-listen.patch | 0 ...cle-movement-from-players-while-tele.patch | 4 +- ...broadcast-messages-to-command-blocks.patch | 0 .../server/Don-t-tick-markers.patch | 0 ...-level-random-in-entity-constructors.patch | 0 .../Dont-resent-entity-on-art-update.patch | 0 .../Elder-Guardian-appearance-API.patch | 0 ...assenger-world-matches-ridden-entity.patch | 0 .../server/Entity-powdered-snow-API.patch | 0 .../server/EntityPickupItemEvent-fixes.patch | 0 ...sks-fairly-for-worlds-while-waiting-.patch | 0 .../server/Expand-FallingBlock-API.patch | 2 +- .../server/Expand-PlayerItemDamageEvent.patch | 23 +++ .../Expose-furnace-minecart-push-values.patch | 0 ...d-canSmelt-methods-to-FurnaceInvento.patch | 0 ...vanilla-BiomeProvider-from-WorldInfo.patch | 0 ...-CauldronLevelChange-on-initial-fill.patch | 0 ...ntityChangeBlockEvent-in-more-places.patch | 31 ++-- .../server/Fix-Bee-flower-NPE.patch | 0 ...shPotion-and-LingeringPotion-spawnin.patch | 0 ...E-in-CraftPersistentDataTypeRegistry.patch | 0 ...nt-suggestion-permissions-to-align-w.patch | 0 ...tEvent-cancellation-cant-fully-preve.patch | 0 ...ntory-for-smokers-and-blast-furnaces.patch | 0 ...verriding-a-block-entity-during-worl.patch | 0 .../server/Fix-NotePlayEvent.patch | 0 ...ix-OfflinePlayer-getBedSpawnLocation.patch | 0 ...g-not-using-commands.spam-exclusions.patch | 6 +- .../server/Fix-a-bunch-of-vanilla-bugs.patch | 136 +++++------------- ...async-entity-add-due-to-fungus-trees.patch | 0 ...elled-powdered-snow-bucket-placement.patch | 0 ...rojectileHitEvent-for-piercing-arrow.patch | 0 .../Fix-custom-piglin-loved-items.patch | 0 .../Fix-falling-block-spawn-methods.patch | 0 ...lock-data-for-EntityChangeBlockEvent.patch | 0 ...ix-plugin-loggers-on-server-shutdown.patch | 0 .../server/Fix-saving-in-unloadWorld.patch | 0 ...-pistons-and-BlockPistonRetractEvent.patch | 0 ...and-message-for-brigadier-syntax-exc.patch | 0 ...ix-swamp-hut-cat-generation-deadlock.patch | 0 .../Fix-xp-reward-for-baby-zombies.patch | 6 +- .../Force-close-world-loading-screen.patch | 2 +- ...ward-CraftEntity-in-teleport-command.patch | 20 ++- .../server/Freeze-Tick-Lock-API.patch | 0 .../server/Furnace-RecipesUsed-API.patch | 0 .../server/Ignore-impossible-spawn-tick.patch | 0 .../Implement-enchantWithLevels-API.patch | 0 .../Implement-getComputedBiome-API.patch | 0 .../server/Implement-regenerateChunk.patch | 0 .../server/Improve-scoreboard-entries.patch | 0 .../server/ItemStack-damage-API.patch | 56 +++++--- .../server/Make-some-itemstacks-nonnull.patch | 0 ...ter-animal-spawn-height-configurable.patch | 0 .../server/Missing-eating-regain-reason.patch | 0 .../server/Missing-effect-cause.patch | 2 +- ...-of-WorldCreator-keepSpawnLoaded-ret.patch | 0 .../server/More-PotionEffectType-API.patch | 0 .../server/More-Projectile-API.patch | 6 +- .../server/More-Teleport-API.patch | 2 +- ...la-friendly-methods-to-update-trades.patch | 0 ...ulti-Block-Change-API-Implementation.patch | 0 .../Multiple-Entries-with-Scoreboards.patch | 0 .../server/Nameable-Banner-API.patch | 0 ...efault-CustomSpawners-in-custom-worl.patch | 0 ...mpty-items-from-being-added-to-world.patch | 0 ...entity-loading-causing-async-lookups.patch | 0 ...nt-tile-entity-copies-loading-chunks.patch | 0 ...o-worldlist-before-initing-the-world.patch | 0 ...ry-onTrackingStart-during-navigation.patch | 0 .../Reset-placed-block-on-exception.patch | 0 .../Sanitize-sent-BlockEntity-NBT.patch | 0 ...ck-entities-after-destroy-prediction.patch | 0 ...ook-changes-from-crashing-the-server.patch | 0 ...n-on-world-create-while-being-ticked.patch | 0 ..._destroyed-trigger-in-the-correct-pl.patch | 0 ...-for-StructureTemplate.Pallete-cache.patch | 0 ...tead-of-display-name-in-PlayerList-g.patch | 0 .../server/Validate-usernames.patch | 0 ...-on-plugins-accessing-faraway-chunks.patch | 0 .../server/WorldCreator-keepSpawnLoaded.patch | 0 .../server/cache-resource-keys.patch | 0 ...global-player-list-where-appropriate.patch | 12 +- ...re-reset-EnderDragon-boss-event-name.patch | 0 .../fix-Jigsaw-block-kicking-user.patch | 18 --- ...y-vehicle-collision-event-not-called.patch | 0 ...ables-running-when-mob-loot-gamerule.patch | 2 +- ...-snow-cauldrons-not-turning-to-water.patch | 0 ...rmEvent-for-mud-converting-into-clay.patch | 0 .../server/Add-EntityPortalReadyEvent.patch | 32 ----- .../server/Expand-PlayerItemDamageEvent.patch | 23 --- .../server/Fix-Entity-Position-Desync.patch | 23 --- ...7-green-map-markers-do-not-disappear.patch | 36 ----- 141 files changed, 180 insertions(+), 322 deletions(-) rename patches/{unapplied => }/server/API-for-creating-command-sender-which-forwards-feedb.patch (100%) rename patches/{unapplied => }/server/Add-API-for-item-entity-health.patch (100%) rename patches/{unapplied => }/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch (100%) create mode 100644 patches/server/Add-EntityPortalReadyEvent.patch rename patches/{unapplied => }/server/Add-EntityToggleSitEvent.patch (96%) rename patches/{unapplied => }/server/Add-GameEvent-tags.patch (100%) rename patches/{unapplied => }/server/Add-Moving-Piston-API.patch (100%) rename patches/{unapplied => }/server/Add-NamespacedKey-biome-methods.patch (100%) rename patches/{unapplied => }/server/Add-Player-Warden-Warning-API.patch (100%) rename patches/{unapplied => }/server/Add-Player-getFishHook.patch (100%) rename patches/{unapplied => }/server/Add-PlayerInventorySlotChangeEvent.patch (97%) rename patches/{unapplied => }/server/Add-PlayerStopUsingItemEvent.patch (100%) rename patches/{unapplied => }/server/Add-PrePlayerAttackEntityEvent.patch (83%) rename patches/{unapplied => }/server/Add-TameableDeathMessageEvent.patch (100%) rename patches/{unapplied => }/server/Add-Velocity-IP-Forwarding-Support.patch (100%) rename patches/{unapplied => }/server/Add-WardenAngerChangeEvent.patch (100%) rename patches/{unapplied => }/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch (100%) rename patches/{unapplied => }/server/Add-and-fix-missing-BlockFadeEvents.patch (100%) rename patches/{unapplied => }/server/Add-config-option-for-worlds-affected-by-time-cmd.patch (100%) rename patches/{unapplied => }/server/Add-configurable-height-for-slime-spawn.patch (100%) rename patches/{unapplied => }/server/Add-entity-knockback-API.patch (100%) rename patches/{unapplied => }/server/Add-fire-tick-delay-option.patch (100%) rename patches/{unapplied => }/server/Add-getDrops-to-BlockState.patch (100%) rename patches/{unapplied => }/server/Add-missing-IAE-check-for-PersistentDataContainer-ha.patch (100%) rename patches/{unapplied => }/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch (100%) rename patches/{unapplied => }/server/Add-missing-block-data-mins-and-maxes.patch (100%) rename patches/{unapplied => }/server/Add-missing-important-BlockStateListPopulator-method.patch (100%) rename patches/{unapplied => }/server/Add-missing-structure-set-seed-configs.patch (100%) rename patches/{unapplied => }/server/Add-option-for-strict-advancement-dimension-checks.patch (96%) rename patches/{unapplied => }/server/Add-paper-dumplisteners-command.patch (100%) rename patches/{unapplied => }/server/Add-support-for-Proxy-Protocol.patch (100%) rename patches/{unapplied => }/server/Add-various-missing-EntityDropItemEvent-calls.patch (100%) rename patches/{unapplied => }/server/Added-byte-array-serialization-deserialization-for-P.patch (100%) rename patches/{unapplied => }/server/Allow-changing-bed-s-occupied-property.patch (100%) rename patches/{unapplied => }/server/Allow-changing-the-EnderDragon-podium.patch (100%) rename patches/{unapplied => }/server/Block-Ticking-API.patch (100%) rename patches/{unapplied => }/server/Bucketable-API.patch (100%) rename patches/{unapplied => }/server/Buffer-OOB-setBlock-calls.patch (91%) rename patches/{unapplied => }/server/Call-BlockPhysicsEvent-more-often.patch (100%) rename patches/{unapplied => }/server/Collision-API.patch (100%) rename patches/{unapplied => }/server/Configurable-chat-thread-limit.patch (100%) rename patches/{unapplied => }/server/Configurable-max-block-light-for-monster-spawning.patch (100%) rename patches/{unapplied => }/server/Configurable-sculk-sensor-listener-range.patch (94%) rename patches/{unapplied => }/server/Correctly-handle-interactions-with-items-on-cooldown.patch (100%) rename patches/{unapplied => }/server/Custom-Chat-Completion-Suggestions-API.patch (100%) rename patches/{unapplied => }/server/Custom-Potion-Mixes.patch (100%) rename patches/{unapplied => }/server/Detect-headless-JREs.patch (100%) rename patches/{unapplied => }/server/Disable-component-selector-resolving-in-books-by-def.patch (100%) rename patches/{unapplied => }/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch (100%) rename patches/{unapplied => }/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch (84%) rename patches/{unapplied => }/server/Don-t-broadcast-messages-to-command-blocks.patch (100%) rename patches/{unapplied => }/server/Don-t-tick-markers.patch (100%) rename patches/{unapplied => }/server/Don-t-use-level-random-in-entity-constructors.patch (100%) rename patches/{unapplied => }/server/Dont-resent-entity-on-art-update.patch (100%) rename patches/{unapplied => }/server/Elder-Guardian-appearance-API.patch (100%) rename patches/{unapplied => }/server/Ensure-entity-passenger-world-matches-ridden-entity.patch (100%) rename patches/{unapplied => }/server/Entity-powdered-snow-API.patch (100%) rename patches/{unapplied => }/server/EntityPickupItemEvent-fixes.patch (100%) rename patches/{unapplied => }/server/Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch (100%) rename patches/{unapplied => }/server/Expand-FallingBlock-API.patch (98%) create mode 100644 patches/server/Expand-PlayerItemDamageEvent.patch rename patches/{unapplied => }/server/Expose-furnace-minecart-push-values.patch (100%) rename patches/{unapplied => }/server/Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch (100%) rename patches/{unapplied => }/server/Expose-vanilla-BiomeProvider-from-WorldInfo.patch (100%) rename patches/{unapplied => }/server/Fire-CauldronLevelChange-on-initial-fill.patch (100%) rename patches/{unapplied => }/server/Fire-EntityChangeBlockEvent-in-more-places.patch (95%) rename patches/{unapplied => }/server/Fix-Bee-flower-NPE.patch (100%) rename patches/{unapplied => }/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch (100%) rename patches/{unapplied => }/server/Fix-CME-in-CraftPersistentDataTypeRegistry.patch (100%) rename patches/{unapplied => }/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch (100%) rename patches/{unapplied => }/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch (100%) rename patches/{unapplied => }/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch (100%) rename patches/{unapplied => }/server/Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch (100%) rename patches/{unapplied => }/server/Fix-NotePlayEvent.patch (100%) rename patches/{unapplied => }/server/Fix-OfflinePlayer-getBedSpawnLocation.patch (100%) rename patches/{unapplied => }/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch (71%) rename patches/{unapplied => }/server/Fix-a-bunch-of-vanilla-bugs.patch (75%) rename patches/{unapplied => }/server/Fix-async-entity-add-due-to-fungus-trees.patch (100%) rename patches/{unapplied => }/server/Fix-cancelled-powdered-snow-bucket-placement.patch (100%) rename patches/{unapplied => }/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch (100%) rename patches/{unapplied => }/server/Fix-custom-piglin-loved-items.patch (100%) rename patches/{unapplied => }/server/Fix-falling-block-spawn-methods.patch (100%) rename patches/{unapplied => }/server/Fix-new-block-data-for-EntityChangeBlockEvent.patch (100%) rename patches/{unapplied => }/server/Fix-plugin-loggers-on-server-shutdown.patch (100%) rename patches/{unapplied => }/server/Fix-saving-in-unloadWorld.patch (100%) rename patches/{unapplied => }/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch (100%) rename patches/{unapplied => }/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch (100%) rename patches/{unapplied => }/server/Fix-swamp-hut-cat-generation-deadlock.patch (100%) rename patches/{unapplied => }/server/Fix-xp-reward-for-baby-zombies.patch (89%) rename patches/{unapplied => }/server/Force-close-world-loading-screen.patch (97%) rename patches/{unapplied => }/server/Forward-CraftEntity-in-teleport-command.patch (63%) rename patches/{unapplied => }/server/Freeze-Tick-Lock-API.patch (100%) rename patches/{unapplied => }/server/Furnace-RecipesUsed-API.patch (100%) rename patches/{unapplied => }/server/Ignore-impossible-spawn-tick.patch (100%) rename patches/{unapplied => }/server/Implement-enchantWithLevels-API.patch (100%) rename patches/{unapplied => }/server/Implement-getComputedBiome-API.patch (100%) rename patches/{unapplied => }/server/Implement-regenerateChunk.patch (100%) rename patches/{unapplied => }/server/Improve-scoreboard-entries.patch (100%) rename patches/{unapplied => }/server/ItemStack-damage-API.patch (65%) rename patches/{unapplied => }/server/Make-some-itemstacks-nonnull.patch (100%) rename patches/{unapplied => }/server/Make-water-animal-spawn-height-configurable.patch (100%) rename patches/{unapplied => }/server/Missing-eating-regain-reason.patch (100%) rename patches/{unapplied => }/server/Missing-effect-cause.patch (97%) rename patches/{unapplied => }/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch (100%) rename patches/{unapplied => }/server/More-PotionEffectType-API.patch (100%) rename patches/{unapplied => }/server/More-Projectile-API.patch (99%) rename patches/{unapplied => }/server/More-Teleport-API.patch (98%) rename patches/{unapplied => }/server/More-vanilla-friendly-methods-to-update-trades.patch (100%) rename patches/{unapplied => }/server/Multi-Block-Change-API-Implementation.patch (100%) rename patches/{unapplied => }/server/Multiple-Entries-with-Scoreboards.patch (100%) rename patches/{unapplied => }/server/Nameable-Banner-API.patch (100%) rename patches/{unapplied => }/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch (100%) rename patches/{unapplied => }/server/Prevent-empty-items-from-being-added-to-world.patch (100%) rename patches/{unapplied => }/server/Prevent-entity-loading-causing-async-lookups.patch (100%) rename patches/{unapplied => }/server/Prevent-tile-entity-copies-loading-chunks.patch (100%) rename patches/{unapplied => }/server/Put-world-into-worldlist-before-initing-the-world.patch (100%) rename patches/{unapplied => }/server/Remove-unnecessary-onTrackingStart-during-navigation.patch (100%) rename patches/{unapplied => }/server/Reset-placed-block-on-exception.patch (100%) rename patches/{unapplied => }/server/Sanitize-sent-BlockEntity-NBT.patch (100%) rename patches/{unapplied => }/server/Send-block-entities-after-destroy-prediction.patch (100%) rename patches/{unapplied => }/server/Stop-large-look-changes-from-crashing-the-server.patch (100%) rename patches/{unapplied => }/server/Throw-exception-on-world-create-while-being-ticked.patch (100%) rename patches/{unapplied => }/server/Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch (100%) rename patches/{unapplied => }/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch (100%) rename patches/{unapplied => }/server/Use-username-instead-of-display-name-in-PlayerList-g.patch (100%) rename patches/{unapplied => }/server/Validate-usernames.patch (100%) rename patches/{unapplied => }/server/Warn-on-plugins-accessing-faraway-chunks.patch (100%) rename patches/{unapplied => }/server/WorldCreator-keepSpawnLoaded.patch (100%) rename patches/{unapplied => }/server/cache-resource-keys.patch (100%) rename patches/{unapplied => }/server/check-global-player-list-where-appropriate.patch (89%) rename patches/{unapplied => }/server/ensure-reset-EnderDragon-boss-event-name.patch (100%) rename patches/{unapplied => }/server/fix-Jigsaw-block-kicking-user.patch (59%) rename patches/{unapplied => }/server/fix-entity-vehicle-collision-event-not-called.patch (100%) rename patches/{unapplied => }/server/fix-player-loottables-running-when-mob-loot-gamerule.patch (93%) rename patches/{unapplied => }/server/fix-powder-snow-cauldrons-not-turning-to-water.patch (100%) rename patches/{unapplied => }/server/use-BlockFormEvent-for-mud-converting-into-clay.patch (100%) delete mode 100644 patches/unapplied/server/Add-EntityPortalReadyEvent.patch delete mode 100644 patches/unapplied/server/Expand-PlayerItemDamageEvent.patch delete mode 100644 patches/unapplied/server/Fix-Entity-Position-Desync.patch delete mode 100644 patches/unapplied/server/fix-MC-252817-green-map-markers-do-not-disappear.patch diff --git a/patches/api/Add-EntityPortalReadyEvent.patch b/patches/api/Add-EntityPortalReadyEvent.patch index e8ca1299eb..8d6fbd5257 100644 --- a/patches/api/Add-EntityPortalReadyEvent.patch +++ b/patches/api/Add-EntityPortalReadyEvent.patch @@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private static final HandlerList HANDLER_LIST = new HandlerList(); + + private final PortalType portalType; -+ private World targetWorld; ++ private final World targetWorld; + + private boolean cancelled; + @@ -71,9 +71,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * or {@link EntityPortalEvent}. + * + * @param targetWorld the world ++ * @deprecated changing the target world has no effect + */ ++ @Deprecated(forRemoval = true, since = "1.21") + public void setTargetWorld(final @Nullable World targetWorld) { -+ this.targetWorld = targetWorld; ++ // this.targetWorld = targetWorld; + } + + /** diff --git a/patches/unapplied/server/API-for-creating-command-sender-which-forwards-feedb.patch b/patches/server/API-for-creating-command-sender-which-forwards-feedb.patch similarity index 100% rename from patches/unapplied/server/API-for-creating-command-sender-which-forwards-feedb.patch rename to patches/server/API-for-creating-command-sender-which-forwards-feedb.patch diff --git a/patches/unapplied/server/Add-API-for-item-entity-health.patch b/patches/server/Add-API-for-item-entity-health.patch similarity index 100% rename from patches/unapplied/server/Add-API-for-item-entity-health.patch rename to patches/server/Add-API-for-item-entity-health.patch diff --git a/patches/unapplied/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch b/patches/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch similarity index 100% rename from patches/unapplied/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch rename to patches/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch diff --git a/patches/server/Add-EntityPortalReadyEvent.patch b/patches/server/Add-EntityPortalReadyEvent.patch new file mode 100644 index 0000000000..acf6eb8baa --- /dev/null +++ b/patches/server/Add-EntityPortalReadyEvent.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Wed, 12 May 2021 04:30:42 -0700 +Subject: [PATCH] Add EntityPortalReadyEvent + + +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + if (this.portalProcess != null) { + if (this.portalProcess.processPortalTeleportation(worldserver, this, this.canUsePortal(false))) { + worldserver.getProfiler().push("portal"); ++ // Paper start - Add EntityPortalReadyEvent ++ ServerLevel changedTarget = worldserver.getServer().getLevel(worldserver.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER ? Level.OVERWORLD : Level.NETHER); ++ if (this.portalProcess.isSamePortal(((net.minecraft.world.level.block.NetherPortalBlock) net.minecraft.world.level.block.Blocks.NETHER_PORTAL))) { ++ io.papermc.paper.event.entity.EntityPortalReadyEvent event = new io.papermc.paper.event.entity.EntityPortalReadyEvent(this.getBukkitEntity(), changedTarget == null ? null : changedTarget.getWorld(), org.bukkit.PortalType.NETHER); ++ if (!event.callEvent()) { ++ this.portalProcess = null; ++ worldserver.getProfiler().pop(); ++ return; ++ } ++ } ++ // Paper end - Add EntityPortalReadyEvent + this.setPortalCooldown(); + DimensionTransition dimensiontransition = this.portalProcess.getPortalDestination(worldserver, this); + diff --git a/patches/unapplied/server/Add-EntityToggleSitEvent.patch b/patches/server/Add-EntityToggleSitEvent.patch similarity index 96% rename from patches/unapplied/server/Add-EntityToggleSitEvent.patch rename to patches/server/Add-EntityToggleSitEvent.patch index 8655cc3b4a..2be3659f7d 100644 --- a/patches/unapplied/server/Add-EntityToggleSitEvent.patch +++ b/patches/server/Add-EntityToggleSitEvent.patch @@ -21,15 +21,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public void setInSittingPose(boolean inSittingPose) { -+ // Paper start - Add EntityToggleSitEvent ++ // Paper start - Add EntityToggleSitEvent + this.setInSittingPose(inSittingPose, true); + } + public void setInSittingPose(boolean inSittingPose, boolean callEvent) { + if (callEvent && !new io.papermc.paper.event.entity.EntityToggleSitEvent(this.getBukkitEntity(), inSittingPose).callEvent()) return; -+ // Paper end - Add EntityToggleSitEvent - byte b = this.entityData.get(DATA_FLAGS_ID); ++ // Paper end - Add EntityToggleSitEvent + byte b0 = (Byte) this.entityData.get(TamableAnimal.DATA_FLAGS_ID); + if (inSittingPose) { - this.entityData.set(DATA_FLAGS_ID, (byte)(b | 1)); diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java diff --git a/patches/unapplied/server/Add-GameEvent-tags.patch b/patches/server/Add-GameEvent-tags.patch similarity index 100% rename from patches/unapplied/server/Add-GameEvent-tags.patch rename to patches/server/Add-GameEvent-tags.patch diff --git a/patches/unapplied/server/Add-Moving-Piston-API.patch b/patches/server/Add-Moving-Piston-API.patch similarity index 100% rename from patches/unapplied/server/Add-Moving-Piston-API.patch rename to patches/server/Add-Moving-Piston-API.patch diff --git a/patches/unapplied/server/Add-NamespacedKey-biome-methods.patch b/patches/server/Add-NamespacedKey-biome-methods.patch similarity index 100% rename from patches/unapplied/server/Add-NamespacedKey-biome-methods.patch rename to patches/server/Add-NamespacedKey-biome-methods.patch diff --git a/patches/unapplied/server/Add-Player-Warden-Warning-API.patch b/patches/server/Add-Player-Warden-Warning-API.patch similarity index 100% rename from patches/unapplied/server/Add-Player-Warden-Warning-API.patch rename to patches/server/Add-Player-Warden-Warning-API.patch diff --git a/patches/unapplied/server/Add-Player-getFishHook.patch b/patches/server/Add-Player-getFishHook.patch similarity index 100% rename from patches/unapplied/server/Add-Player-getFishHook.patch rename to patches/server/Add-Player-getFishHook.patch diff --git a/patches/unapplied/server/Add-PlayerInventorySlotChangeEvent.patch b/patches/server/Add-PlayerInventorySlotChangeEvent.patch similarity index 97% rename from patches/unapplied/server/Add-PlayerInventorySlotChangeEvent.patch rename to patches/server/Add-PlayerInventorySlotChangeEvent.patch index 5802ca2e38..831c0b2c44 100644 --- a/patches/unapplied/server/Add-PlayerInventorySlotChangeEvent.patch +++ b/patches/server/Add-PlayerInventorySlotChangeEvent.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { } } diff --git a/patches/unapplied/server/Add-PlayerStopUsingItemEvent.patch b/patches/server/Add-PlayerStopUsingItemEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerStopUsingItemEvent.patch rename to patches/server/Add-PlayerStopUsingItemEvent.patch diff --git a/patches/unapplied/server/Add-PrePlayerAttackEntityEvent.patch b/patches/server/Add-PrePlayerAttackEntityEvent.patch similarity index 83% rename from patches/unapplied/server/Add-PrePlayerAttackEntityEvent.patch rename to patches/server/Add-PrePlayerAttackEntityEvent.patch index 32a40012d6..5cc4819f34 100644 --- a/patches/unapplied/server/Add-PrePlayerAttackEntityEvent.patch +++ b/patches/server/Add-PrePlayerAttackEntityEvent.patch @@ -25,6 +25,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (playerAttackEntityEvent.callEvent() && willAttack) { // Logic moved to willAttack local variable. + { + // Paper end - PlayerAttackEntityEvent - float f = (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE); - float f1 = EnchantmentHelper.getDamageBonus(this.getMainHandItem(), target.getType()); - float f2 = this.getAttackStrengthScale(0.5F); + float f = this.isAutoSpinAttack() ? this.autoSpinAttackDmg : (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE); + ItemStack itemstack = this.getWeaponItem(); + DamageSource damagesource = this.damageSources().playerAttack(this); diff --git a/patches/unapplied/server/Add-TameableDeathMessageEvent.patch b/patches/server/Add-TameableDeathMessageEvent.patch similarity index 100% rename from patches/unapplied/server/Add-TameableDeathMessageEvent.patch rename to patches/server/Add-TameableDeathMessageEvent.patch diff --git a/patches/unapplied/server/Add-Velocity-IP-Forwarding-Support.patch b/patches/server/Add-Velocity-IP-Forwarding-Support.patch similarity index 100% rename from patches/unapplied/server/Add-Velocity-IP-Forwarding-Support.patch rename to patches/server/Add-Velocity-IP-Forwarding-Support.patch diff --git a/patches/unapplied/server/Add-WardenAngerChangeEvent.patch b/patches/server/Add-WardenAngerChangeEvent.patch similarity index 100% rename from patches/unapplied/server/Add-WardenAngerChangeEvent.patch rename to patches/server/Add-WardenAngerChangeEvent.patch diff --git a/patches/unapplied/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch b/patches/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch similarity index 100% rename from patches/unapplied/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch rename to patches/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch diff --git a/patches/unapplied/server/Add-and-fix-missing-BlockFadeEvents.patch b/patches/server/Add-and-fix-missing-BlockFadeEvents.patch similarity index 100% rename from patches/unapplied/server/Add-and-fix-missing-BlockFadeEvents.patch rename to patches/server/Add-and-fix-missing-BlockFadeEvents.patch diff --git a/patches/unapplied/server/Add-config-option-for-worlds-affected-by-time-cmd.patch b/patches/server/Add-config-option-for-worlds-affected-by-time-cmd.patch similarity index 100% rename from patches/unapplied/server/Add-config-option-for-worlds-affected-by-time-cmd.patch rename to patches/server/Add-config-option-for-worlds-affected-by-time-cmd.patch diff --git a/patches/unapplied/server/Add-configurable-height-for-slime-spawn.patch b/patches/server/Add-configurable-height-for-slime-spawn.patch similarity index 100% rename from patches/unapplied/server/Add-configurable-height-for-slime-spawn.patch rename to patches/server/Add-configurable-height-for-slime-spawn.patch diff --git a/patches/unapplied/server/Add-entity-knockback-API.patch b/patches/server/Add-entity-knockback-API.patch similarity index 100% rename from patches/unapplied/server/Add-entity-knockback-API.patch rename to patches/server/Add-entity-knockback-API.patch diff --git a/patches/unapplied/server/Add-fire-tick-delay-option.patch b/patches/server/Add-fire-tick-delay-option.patch similarity index 100% rename from patches/unapplied/server/Add-fire-tick-delay-option.patch rename to patches/server/Add-fire-tick-delay-option.patch diff --git a/patches/unapplied/server/Add-getDrops-to-BlockState.patch b/patches/server/Add-getDrops-to-BlockState.patch similarity index 100% rename from patches/unapplied/server/Add-getDrops-to-BlockState.patch rename to patches/server/Add-getDrops-to-BlockState.patch diff --git a/patches/unapplied/server/Add-missing-IAE-check-for-PersistentDataContainer-ha.patch b/patches/server/Add-missing-IAE-check-for-PersistentDataContainer-ha.patch similarity index 100% rename from patches/unapplied/server/Add-missing-IAE-check-for-PersistentDataContainer-ha.patch rename to patches/server/Add-missing-IAE-check-for-PersistentDataContainer-ha.patch diff --git a/patches/unapplied/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch b/patches/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch similarity index 100% rename from patches/unapplied/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch rename to patches/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch diff --git a/patches/unapplied/server/Add-missing-block-data-mins-and-maxes.patch b/patches/server/Add-missing-block-data-mins-and-maxes.patch similarity index 100% rename from patches/unapplied/server/Add-missing-block-data-mins-and-maxes.patch rename to patches/server/Add-missing-block-data-mins-and-maxes.patch diff --git a/patches/unapplied/server/Add-missing-important-BlockStateListPopulator-method.patch b/patches/server/Add-missing-important-BlockStateListPopulator-method.patch similarity index 100% rename from patches/unapplied/server/Add-missing-important-BlockStateListPopulator-method.patch rename to patches/server/Add-missing-important-BlockStateListPopulator-method.patch diff --git a/patches/unapplied/server/Add-missing-structure-set-seed-configs.patch b/patches/server/Add-missing-structure-set-seed-configs.patch similarity index 100% rename from patches/unapplied/server/Add-missing-structure-set-seed-configs.patch rename to patches/server/Add-missing-structure-set-seed-configs.patch diff --git a/patches/unapplied/server/Add-option-for-strict-advancement-dimension-checks.patch b/patches/server/Add-option-for-strict-advancement-dimension-checks.patch similarity index 96% rename from patches/unapplied/server/Add-option-for-strict-advancement-dimension-checks.patch rename to patches/server/Add-option-for-strict-advancement-dimension-checks.patch index 9ae27585e1..93fbb332c9 100644 --- a/patches/unapplied/server/Add-option-for-strict-advancement-dimension-checks.patch +++ b/patches/server/Add-option-for-strict-advancement-dimension-checks.patch @@ -27,7 +27,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { ResourceKey maindimensionkey = CraftDimensionUtil.getMainDimensionKey(origin); ResourceKey maindimensionkey1 = CraftDimensionUtil.getMainDimensionKey(this.level()); diff --git a/patches/unapplied/server/Add-paper-dumplisteners-command.patch b/patches/server/Add-paper-dumplisteners-command.patch similarity index 100% rename from patches/unapplied/server/Add-paper-dumplisteners-command.patch rename to patches/server/Add-paper-dumplisteners-command.patch diff --git a/patches/unapplied/server/Add-support-for-Proxy-Protocol.patch b/patches/server/Add-support-for-Proxy-Protocol.patch similarity index 100% rename from patches/unapplied/server/Add-support-for-Proxy-Protocol.patch rename to patches/server/Add-support-for-Proxy-Protocol.patch diff --git a/patches/unapplied/server/Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/Add-various-missing-EntityDropItemEvent-calls.patch similarity index 100% rename from patches/unapplied/server/Add-various-missing-EntityDropItemEvent-calls.patch rename to patches/server/Add-various-missing-EntityDropItemEvent-calls.patch diff --git a/patches/unapplied/server/Added-byte-array-serialization-deserialization-for-P.patch b/patches/server/Added-byte-array-serialization-deserialization-for-P.patch similarity index 100% rename from patches/unapplied/server/Added-byte-array-serialization-deserialization-for-P.patch rename to patches/server/Added-byte-array-serialization-deserialization-for-P.patch diff --git a/patches/unapplied/server/Allow-changing-bed-s-occupied-property.patch b/patches/server/Allow-changing-bed-s-occupied-property.patch similarity index 100% rename from patches/unapplied/server/Allow-changing-bed-s-occupied-property.patch rename to patches/server/Allow-changing-bed-s-occupied-property.patch diff --git a/patches/unapplied/server/Allow-changing-the-EnderDragon-podium.patch b/patches/server/Allow-changing-the-EnderDragon-podium.patch similarity index 100% rename from patches/unapplied/server/Allow-changing-the-EnderDragon-podium.patch rename to patches/server/Allow-changing-the-EnderDragon-podium.patch diff --git a/patches/unapplied/server/Block-Ticking-API.patch b/patches/server/Block-Ticking-API.patch similarity index 100% rename from patches/unapplied/server/Block-Ticking-API.patch rename to patches/server/Block-Ticking-API.patch diff --git a/patches/unapplied/server/Bucketable-API.patch b/patches/server/Bucketable-API.patch similarity index 100% rename from patches/unapplied/server/Bucketable-API.patch rename to patches/server/Bucketable-API.patch diff --git a/patches/unapplied/server/Buffer-OOB-setBlock-calls.patch b/patches/server/Buffer-OOB-setBlock-calls.patch similarity index 91% rename from patches/unapplied/server/Buffer-OOB-setBlock-calls.patch rename to patches/server/Buffer-OOB-setBlock-calls.patch index 2788221211..0bfab3b834 100644 --- a/patches/unapplied/server/Buffer-OOB-setBlock-calls.patch +++ b/patches/server/Buffer-OOB-setBlock-calls.patch @@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { + // Paper start - Buffer OOB setBlock calls + if (!hasSetFarWarned) { - Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStatus) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get())); + Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStep.targetStatus()) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get())); + hasSetFarWarned = true; + if (this.getServer() != null && this.getServer().isDebugging()) { + io.papermc.paper.util.TraceUtil.dumpTraceForThread("far setBlock call"); diff --git a/patches/unapplied/server/Call-BlockPhysicsEvent-more-often.patch b/patches/server/Call-BlockPhysicsEvent-more-often.patch similarity index 100% rename from patches/unapplied/server/Call-BlockPhysicsEvent-more-often.patch rename to patches/server/Call-BlockPhysicsEvent-more-often.patch diff --git a/patches/unapplied/server/Collision-API.patch b/patches/server/Collision-API.patch similarity index 100% rename from patches/unapplied/server/Collision-API.patch rename to patches/server/Collision-API.patch diff --git a/patches/unapplied/server/Configurable-chat-thread-limit.patch b/patches/server/Configurable-chat-thread-limit.patch similarity index 100% rename from patches/unapplied/server/Configurable-chat-thread-limit.patch rename to patches/server/Configurable-chat-thread-limit.patch diff --git a/patches/unapplied/server/Configurable-max-block-light-for-monster-spawning.patch b/patches/server/Configurable-max-block-light-for-monster-spawning.patch similarity index 100% rename from patches/unapplied/server/Configurable-max-block-light-for-monster-spawning.patch rename to patches/server/Configurable-max-block-light-for-monster-spawning.patch diff --git a/patches/unapplied/server/Configurable-sculk-sensor-listener-range.patch b/patches/server/Configurable-sculk-sensor-listener-range.patch similarity index 94% rename from patches/unapplied/server/Configurable-sculk-sensor-listener-range.patch rename to patches/server/Configurable-sculk-sensor-listener-range.patch index 2837a17298..bc69aeaf73 100644 --- a/patches/unapplied/server/Configurable-sculk-sensor-listener-range.patch +++ b/patches/server/Configurable-sculk-sensor-listener-range.patch @@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 protected SculkSensorBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) { super(type, pos, state); @@ -0,0 +0,0 @@ public class SculkSensorBlockEntity extends BlockEntity implements GameEventList - .resultOrPartial(LOGGER::error) + .resultOrPartial(string -> LOGGER.error("Failed to parse vibration listener for Sculk Sensor: '{}'", string)) .ifPresent(listener -> this.vibrationData = listener); } + // Paper start - Configurable sculk sensor listener range @@ -61,8 +61,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 protected void saveAdditional(CompoundTag nbt, HolderLookup.Provider registryLookup) { super.saveAdditional(nbt, registryLookup); @@ -0,0 +0,0 @@ public class SculkSensorBlockEntity extends BlockEntity implements GameEventList - .encodeStart(NbtOps.INSTANCE, this.vibrationData) - .resultOrPartial(LOGGER::error) + .encodeStart(registryOps, this.vibrationData) + .resultOrPartial(string -> LOGGER.error("Failed to encode vibration listener for Sculk Sensor: '{}'", string)) .ifPresent(listenerNbt -> nbt.put("listener", listenerNbt)); + this.saveRangeOverride(nbt); // Paper - Configurable sculk sensor listener range + } diff --git a/patches/unapplied/server/Correctly-handle-interactions-with-items-on-cooldown.patch b/patches/server/Correctly-handle-interactions-with-items-on-cooldown.patch similarity index 100% rename from patches/unapplied/server/Correctly-handle-interactions-with-items-on-cooldown.patch rename to patches/server/Correctly-handle-interactions-with-items-on-cooldown.patch diff --git a/patches/unapplied/server/Custom-Chat-Completion-Suggestions-API.patch b/patches/server/Custom-Chat-Completion-Suggestions-API.patch similarity index 100% rename from patches/unapplied/server/Custom-Chat-Completion-Suggestions-API.patch rename to patches/server/Custom-Chat-Completion-Suggestions-API.patch diff --git a/patches/unapplied/server/Custom-Potion-Mixes.patch b/patches/server/Custom-Potion-Mixes.patch similarity index 100% rename from patches/unapplied/server/Custom-Potion-Mixes.patch rename to patches/server/Custom-Potion-Mixes.patch diff --git a/patches/unapplied/server/Detect-headless-JREs.patch b/patches/server/Detect-headless-JREs.patch similarity index 100% rename from patches/unapplied/server/Detect-headless-JREs.patch rename to patches/server/Detect-headless-JREs.patch diff --git a/patches/unapplied/server/Disable-component-selector-resolving-in-books-by-def.patch b/patches/server/Disable-component-selector-resolving-in-books-by-def.patch similarity index 100% rename from patches/unapplied/server/Disable-component-selector-resolving-in-books-by-def.patch rename to patches/server/Disable-component-selector-resolving-in-books-by-def.patch diff --git a/patches/unapplied/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch b/patches/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch similarity index 100% rename from patches/unapplied/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch rename to patches/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch diff --git a/patches/unapplied/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch b/patches/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch similarity index 84% rename from patches/unapplied/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch rename to patches/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch index 22d74b6e10..2d685a7c47 100644 --- a/patches/unapplied/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch +++ b/patches/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch @@ -11,8 +11,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - this.disconnect(Component.translatable("multiplayer.disconnect.invalid_vehicle_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_VEHICLE_MOVEMENT); // Paper - kick event cause - } else { + this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_vehicle_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_VEHICLE_MOVEMENT); // Paper - kick event cause + } else if (!this.updateAwaitingTeleport()) { Entity entity = this.player.getRootVehicle(); + // Paper start - Don't allow vehicle movement from players while teleporting + if (this.awaitingPositionFromClient != null || this.player.isImmobile() || entity.isRemoved()) { diff --git a/patches/unapplied/server/Don-t-broadcast-messages-to-command-blocks.patch b/patches/server/Don-t-broadcast-messages-to-command-blocks.patch similarity index 100% rename from patches/unapplied/server/Don-t-broadcast-messages-to-command-blocks.patch rename to patches/server/Don-t-broadcast-messages-to-command-blocks.patch diff --git a/patches/unapplied/server/Don-t-tick-markers.patch b/patches/server/Don-t-tick-markers.patch similarity index 100% rename from patches/unapplied/server/Don-t-tick-markers.patch rename to patches/server/Don-t-tick-markers.patch diff --git a/patches/unapplied/server/Don-t-use-level-random-in-entity-constructors.patch b/patches/server/Don-t-use-level-random-in-entity-constructors.patch similarity index 100% rename from patches/unapplied/server/Don-t-use-level-random-in-entity-constructors.patch rename to patches/server/Don-t-use-level-random-in-entity-constructors.patch diff --git a/patches/unapplied/server/Dont-resent-entity-on-art-update.patch b/patches/server/Dont-resent-entity-on-art-update.patch similarity index 100% rename from patches/unapplied/server/Dont-resent-entity-on-art-update.patch rename to patches/server/Dont-resent-entity-on-art-update.patch diff --git a/patches/unapplied/server/Elder-Guardian-appearance-API.patch b/patches/server/Elder-Guardian-appearance-API.patch similarity index 100% rename from patches/unapplied/server/Elder-Guardian-appearance-API.patch rename to patches/server/Elder-Guardian-appearance-API.patch diff --git a/patches/unapplied/server/Ensure-entity-passenger-world-matches-ridden-entity.patch b/patches/server/Ensure-entity-passenger-world-matches-ridden-entity.patch similarity index 100% rename from patches/unapplied/server/Ensure-entity-passenger-world-matches-ridden-entity.patch rename to patches/server/Ensure-entity-passenger-world-matches-ridden-entity.patch diff --git a/patches/unapplied/server/Entity-powdered-snow-API.patch b/patches/server/Entity-powdered-snow-API.patch similarity index 100% rename from patches/unapplied/server/Entity-powdered-snow-API.patch rename to patches/server/Entity-powdered-snow-API.patch diff --git a/patches/unapplied/server/EntityPickupItemEvent-fixes.patch b/patches/server/EntityPickupItemEvent-fixes.patch similarity index 100% rename from patches/unapplied/server/EntityPickupItemEvent-fixes.patch rename to patches/server/EntityPickupItemEvent-fixes.patch diff --git a/patches/unapplied/server/Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch similarity index 100% rename from patches/unapplied/server/Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch rename to patches/server/Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch diff --git a/patches/unapplied/server/Expand-FallingBlock-API.patch b/patches/server/Expand-FallingBlock-API.patch similarity index 98% rename from patches/unapplied/server/Expand-FallingBlock-API.patch rename to patches/server/Expand-FallingBlock-API.patch index 209296a4b0..54c98f061f 100644 --- a/patches/unapplied/server/Expand-FallingBlock-API.patch +++ b/patches/server/Expand-FallingBlock-API.patch @@ -17,8 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -0,0 +0,0 @@ public class FallingBlockEntity extends Entity { - @Nullable public CompoundTag blockData; + public boolean forceTickAfterTeleportToDuplicate; protected static final EntityDataAccessor DATA_START_POS = SynchedEntityData.defineId(FallingBlockEntity.class, EntityDataSerializers.BLOCK_POS); + public boolean autoExpire = true; // Paper - Expand FallingBlock API diff --git a/patches/server/Expand-PlayerItemDamageEvent.patch b/patches/server/Expand-PlayerItemDamageEvent.patch new file mode 100644 index 0000000000..a3b8ef8d07 --- /dev/null +++ b/patches/server/Expand-PlayerItemDamageEvent.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: HexedHero <6012891+HexedHero@users.noreply.github.com> +Date: Sun, 10 Apr 2022 06:26:32 +0100 +Subject: [PATCH] Expand PlayerItemDamageEvent + + +diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/item/ItemStack.java ++++ b/src/main/java/net/minecraft/world/item/ItemStack.java +@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { + if (this.isDamageableItem()) { + if (player == null || !player.hasInfiniteMaterials()) { + if (amount > 0) { ++ int originalDamage = amount; // Paper - Expand PlayerItemDamageEvent + amount = EnchantmentHelper.processDurabilityChange(world, this, amount); + // CraftBukkit start + if (player instanceof ServerPlayer serverPlayer) { // Paper - Add EntityDamageItemEvent +- PlayerItemDamageEvent event = new PlayerItemDamageEvent(serverPlayer.getBukkitEntity(), CraftItemStack.asCraftMirror(this), amount); // Paper - Add EntityDamageItemEvent ++ PlayerItemDamageEvent event = new PlayerItemDamageEvent(serverPlayer.getBukkitEntity(), CraftItemStack.asCraftMirror(this), amount, originalDamage); // Paper - Add EntityDamageItemEvent & Expand PlayerItemDamageEvent + event.getPlayer().getServer().getPluginManager().callEvent(event); + + if (amount != event.getDamage() || event.isCancelled()) { diff --git a/patches/unapplied/server/Expose-furnace-minecart-push-values.patch b/patches/server/Expose-furnace-minecart-push-values.patch similarity index 100% rename from patches/unapplied/server/Expose-furnace-minecart-push-values.patch rename to patches/server/Expose-furnace-minecart-push-values.patch diff --git a/patches/unapplied/server/Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch b/patches/server/Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch similarity index 100% rename from patches/unapplied/server/Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch rename to patches/server/Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch diff --git a/patches/unapplied/server/Expose-vanilla-BiomeProvider-from-WorldInfo.patch b/patches/server/Expose-vanilla-BiomeProvider-from-WorldInfo.patch similarity index 100% rename from patches/unapplied/server/Expose-vanilla-BiomeProvider-from-WorldInfo.patch rename to patches/server/Expose-vanilla-BiomeProvider-from-WorldInfo.patch diff --git a/patches/unapplied/server/Fire-CauldronLevelChange-on-initial-fill.patch b/patches/server/Fire-CauldronLevelChange-on-initial-fill.patch similarity index 100% rename from patches/unapplied/server/Fire-CauldronLevelChange-on-initial-fill.patch rename to patches/server/Fire-CauldronLevelChange-on-initial-fill.patch diff --git a/patches/unapplied/server/Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch similarity index 95% rename from patches/unapplied/server/Fire-EntityChangeBlockEvent-in-more-places.patch rename to patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch index f7ea814a45..3e678843ab 100644 --- a/patches/unapplied/server/Fire-EntityChangeBlockEvent-in-more-places.patch +++ b/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch @@ -84,17 +84,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/item/AxeItem.java +++ b/src/main/java/net/minecraft/world/item/AxeItem.java @@ -0,0 +0,0 @@ public class AxeItem extends DiggerItem { - return InteractionResult.PASS; - } else { - ItemStack itemStack = context.getItemInHand(); -+ // Paper start - EntityChangeBlockEvent -+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, blockPos, optional.get())) { -+ return InteractionResult.PASS; -+ } -+ // Paper end - if (player instanceof ServerPlayer) { - CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, blockPos, itemStack); - } + return InteractionResult.PASS; + } else { + ItemStack itemStack = context.getItemInHand(); ++ // Paper start - EntityChangeBlockEvent ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, blockPos, optional.get())) { ++ return InteractionResult.PASS; ++ } ++ // Paper end + if (player instanceof ServerPlayer) { + CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, blockPos, itemStack); + } diff --git a/src/main/java/net/minecraft/world/item/EnderEyeItem.java b/src/main/java/net/minecraft/world/item/EnderEyeItem.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/EnderEyeItem.java @@ -187,19 +187,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/block/CakeBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CakeBlock.java @@ -0,0 +0,0 @@ public class CakeBlock extends Block { - if (block instanceof CandleBlock) { CandleBlock candleblock = (CandleBlock) block; -- + + // Paper start - call change block event + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, CandleCakeBlock.byCandle(candleblock))) { + player.containerMenu.sendAllDataToRemote(); // update inv because candle could decrease + return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + } + // Paper end - call change block event - if (!player.isCreative()) { - stack.shrink(1); - } + stack.consume(1, player); + world.playSound((Player) null, pos, SoundEvents.CAKE_ADD_CANDLE, SoundSource.BLOCKS, 1.0F, 1.0F); + world.setBlockAndUpdate(pos, CandleCakeBlock.byCandle(candleblock)); @@ -0,0 +0,0 @@ public class CakeBlock extends Block { if (!player.canEat(false)) { return InteractionResult.PASS; diff --git a/patches/unapplied/server/Fix-Bee-flower-NPE.patch b/patches/server/Fix-Bee-flower-NPE.patch similarity index 100% rename from patches/unapplied/server/Fix-Bee-flower-NPE.patch rename to patches/server/Fix-Bee-flower-NPE.patch diff --git a/patches/unapplied/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch b/patches/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch similarity index 100% rename from patches/unapplied/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch rename to patches/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch diff --git a/patches/unapplied/server/Fix-CME-in-CraftPersistentDataTypeRegistry.patch b/patches/server/Fix-CME-in-CraftPersistentDataTypeRegistry.patch similarity index 100% rename from patches/unapplied/server/Fix-CME-in-CraftPersistentDataTypeRegistry.patch rename to patches/server/Fix-CME-in-CraftPersistentDataTypeRegistry.patch diff --git a/patches/unapplied/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch b/patches/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch similarity index 100% rename from patches/unapplied/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch rename to patches/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch diff --git a/patches/unapplied/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch b/patches/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch similarity index 100% rename from patches/unapplied/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch rename to patches/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch diff --git a/patches/unapplied/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch b/patches/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch similarity index 100% rename from patches/unapplied/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch rename to patches/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch diff --git a/patches/unapplied/server/Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch b/patches/server/Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch similarity index 100% rename from patches/unapplied/server/Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch rename to patches/server/Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch diff --git a/patches/unapplied/server/Fix-NotePlayEvent.patch b/patches/server/Fix-NotePlayEvent.patch similarity index 100% rename from patches/unapplied/server/Fix-NotePlayEvent.patch rename to patches/server/Fix-NotePlayEvent.patch diff --git a/patches/unapplied/server/Fix-OfflinePlayer-getBedSpawnLocation.patch b/patches/server/Fix-OfflinePlayer-getBedSpawnLocation.patch similarity index 100% rename from patches/unapplied/server/Fix-OfflinePlayer-getBedSpawnLocation.patch rename to patches/server/Fix-OfflinePlayer-getBedSpawnLocation.patch diff --git a/patches/unapplied/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch similarity index 71% rename from patches/unapplied/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch rename to patches/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch index 013093e461..7baa70425d 100644 --- a/patches/unapplied/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch +++ b/patches/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch @@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // Spigot end // this.chatSpamTickCount += 20; -- if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { -+ if (counted && this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper - exclude from SpigotConfig.spamExclusions +- if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { ++ if (counted && this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { // Paper - exclude from SpigotConfig.spamExclusions // CraftBukkit end - this.disconnect(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause + this.disconnect((Component) Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause } diff --git a/patches/unapplied/server/Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch similarity index 75% rename from patches/unapplied/server/Fix-a-bunch-of-vanilla-bugs.patch rename to patches/server/Fix-a-bunch-of-vanilla-bugs.patch index 7c9aee414e..f068e5ae15 100644 --- a/patches/unapplied/server/Fix-a-bunch-of-vanilla-bugs.patch +++ b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch @@ -22,9 +22,6 @@ https://bugs.mojang.com/browse/MC-147659 https://bugs.mojang.com/browse/MC-179072 Creepers do not defuse when switching from Survival to Creative/Spectator -https://bugs.mojang.com/browse/MC-191591 - Fix items equipped on AbstractHorse losing NBT - https://bugs.mojang.com/browse/MC-259571 Fix changeGameModeForPlayer to use gameModeForPlayer @@ -43,9 +40,6 @@ https://bugs.mojang.com/browse/MC-210802 https://bugs.mojang.com/browse/MC-123848 Fixes item frames dropping items above when pointing down -https://bugs.mojang.com/browse/MC-84789 - Fix wild wolves not considering bones interesting - https://bugs.mojang.com/browse/MC-174630 Fix secondary beacon effect remaining after switching effect @@ -64,19 +58,6 @@ public net/minecraft/world/entity/Mob leashInfoTag Co-authored-by: William Blake Galbreath Co-authored-by: Spottedleaf -diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -@@ -0,0 +0,0 @@ public interface DispenseItemBehavior { - } - } - // CraftBukkit end -- ((Saddleable) list.get(0)).equipSaddle(SoundSource.BLOCKS); -+ ((Saddleable) list.get(0)).equipSaddle(SoundSource.BLOCKS, CraftItemStack.asNMSCopy(event.getItem())); // Paper - Fix saddles losing nbt data - MC-191591 - // itemstack.shrink(1); // CraftBukkit - handled above - this.setSuccess(true); - return stack; diff --git a/src/main/java/net/minecraft/server/commands/DeOpCommands.java b/src/main/java/net/minecraft/server/commands/DeOpCommands.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/commands/DeOpCommands.java @@ -129,27 +110,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 }); if (!list.isEmpty()) { -diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/level/ServerPlayer.java -+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { - BlockPos blockposition1 = PlayerRespawnLogic.getOverworldRespawnPos(world, blockposition.getX() + j2 - i, blockposition.getZ() + k2 - i); - - if (blockposition1 != null) { -- this.moveTo(blockposition1, 0.0F, 0.0F); -+ this.moveTo(blockposition1, world.getSharedSpawnAngle(), 0.0F); // Paper - MC-200092 - fix first spawn pos yaw being ignored - if (world.noCollision((Entity) this)) { - break; - } - } - } - } else { -- this.moveTo(blockposition, 0.0F, 0.0F); -+ this.moveTo(blockposition, world.getSharedSpawnAngle(), 0.0F); // Paper - MC-200092 - fix first spawn pos yaw being ignored - - while (!world.noCollision((Entity) this) && this.getY() < (double) (world.getMaxBuildHeight() - 1)) { - this.setPos(this.getX(), this.getY() + 1.0D, this.getZ()); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java @@ -167,6 +127,15 @@ diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java +@@ -0,0 +0,0 @@ public abstract class PlayerList { + } + if (optional.isEmpty() || invalidPlayerWorld[0]) { + // Paper end - reset to main world spawn if first spawn or invalid world +- player.moveTo(player.adjustSpawnLocation(worldserver1, worldserver1.getSharedSpawnPos()).getBottomCenter(), 0.0F, 0.0F); ++ player.moveTo(player.adjustSpawnLocation(worldserver1, worldserver1.getSharedSpawnPos()).getBottomCenter(), worldserver1.getSharedSpawnAngle(), 0.0F); // Paper - MC-200092 - fix first spawn pos yaw being ignored + } + // Paper end - Entity#getEntitySpawnReason + player.setServerLevel(worldserver1); @@ -0,0 +0,0 @@ public abstract class PlayerList { Player player = entity.getBukkitEntity(); PlayerLoginEvent event = new PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.channel.remoteAddress()).getAddress()); @@ -180,35 +149,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ichatmutablecomponent = Component.translatable("multiplayer.disconnect.banned.reason", gameprofilebanentry.getReason()); if (gameprofilebanentry.getExpires() != null) { -diff --git a/src/main/java/net/minecraft/world/entity/Saddleable.java b/src/main/java/net/minecraft/world/entity/Saddleable.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/Saddleable.java -+++ b/src/main/java/net/minecraft/world/entity/Saddleable.java -@@ -0,0 +0,0 @@ public interface Saddleable { - boolean isSaddleable(); - - void equipSaddle(@Nullable SoundSource sound); -+ // Paper start - Fix saddles losing nbt data - MC-191591 -+ default void equipSaddle(final @Nullable SoundSource sound, final @Nullable net.minecraft.world.item.ItemStack stack) { -+ this.equipSaddle(sound); -+ } -+ // Paper end - - default SoundEvent getSaddleSoundEvent() { - return SoundEvents.HORSE_SADDLE; -diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/BegGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/BegGoal.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/ai/goal/BegGoal.java -+++ b/src/main/java/net/minecraft/world/entity/ai/goal/BegGoal.java -@@ -0,0 +0,0 @@ public class BegGoal extends Goal { - private boolean playerHoldingInteresting(Player player) { - for (InteractionHand interactionHand : InteractionHand.values()) { - ItemStack itemStack = player.getItemInHand(interactionHand); -- if (this.wolf.isTame() && itemStack.is(Items.BONE)) { -+ if (!this.wolf.isTame() && itemStack.is(Items.BONE)) { // Paper - Fix MC-84789 - return true; - } - diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java @@ -275,25 +215,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.level().playSound((Player) null, (Entity) this, this.getEatingSound(itemstack), SoundSource.NEUTRAL, 1.0F, Mth.randomBetween(this.level().random, 0.8F, 1.2F)); } -diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java -+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java -@@ -0,0 +0,0 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, - - @Override - public void equipSaddle(@Nullable SoundSource sound) { -- this.inventory.setItem(0, new ItemStack(Items.SADDLE)); -+ // Paper start - Fix saddles losing nbt data - MC-191591 -+ this.equipSaddle(sound, null); -+ } -+ @Override -+ public void equipSaddle(@Nullable SoundSource sound, @Nullable ItemStack stack) { -+ this.inventory.setItem(0, stack != null ? stack : new ItemStack(Items.SADDLE)); -+ // Paper end - } - - public void equipBodyArmor(Player player, ItemStack stack) { 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java @@ -311,8 +232,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + @Nullable - public MapId getFramedMapId() { - return (MapId) this.getItem().get(DataComponents.MAP_ID); + public MapId getFramedMapId(ItemStack itemstack) { + return (MapId) itemstack.get(DataComponents.MAP_ID); diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java @@ -343,19 +264,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.paymentSlot.hasItem()) { // Paper start - Add PlayerChangeBeaconEffectEvent io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent event = new io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent((org.bukkit.entity.Player) this.player.player.getBukkitEntity(), convert(primary), convert(secondary), this.access.getLocation().getBlock()); -diff --git a/src/main/java/net/minecraft/world/item/SaddleItem.java b/src/main/java/net/minecraft/world/item/SaddleItem.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/item/SaddleItem.java -+++ b/src/main/java/net/minecraft/world/item/SaddleItem.java -@@ -0,0 +0,0 @@ public class SaddleItem extends Item { - public InteractionResult interactLivingEntity(ItemStack stack, Player user, LivingEntity entity, InteractionHand hand) { - if (entity instanceof Saddleable saddleable && entity.isAlive() && !saddleable.isSaddled() && saddleable.isSaddleable()) { - if (!user.level().isClientSide) { -- saddleable.equipSaddle(SoundSource.NEUTRAL); -+ saddleable.equipSaddle(SoundSource.NEUTRAL, stack.copyWithCount(1)); // Paper - Fix saddles losing nbt data - MC-191591 - entity.level().gameEvent(entity, GameEvent.EQUIP, entity.position()); - stack.shrink(1); - } diff --git a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java @@ -423,3 +331,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 super.setRemoved(); } +diff --git a/src/main/java/net/minecraft/world/level/portal/DimensionTransition.java b/src/main/java/net/minecraft/world/level/portal/DimensionTransition.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/portal/DimensionTransition.java ++++ b/src/main/java/net/minecraft/world/level/portal/DimensionTransition.java +@@ -0,0 +0,0 @@ public record DimensionTransition(ServerLevel newLevel, Vec3 pos, Vec3 speed, fl + } + + public DimensionTransition(ServerLevel worldserver, Entity entity, DimensionTransition.PostDimensionTransition dimensiontransition_a, PlayerTeleportEvent.TeleportCause cause) { +- this(worldserver, findAdjustedSharedSpawnPos(worldserver, entity), Vec3.ZERO, 0.0F, 0.0F, false, dimensiontransition_a, cause); ++ this(worldserver, findAdjustedSharedSpawnPos(worldserver, entity), Vec3.ZERO, worldserver.getSharedSpawnAngle(), 0.0F, false, dimensiontransition_a, cause); // Paper - MC-200092 - fix spawn pos yaw being ignored + // CraftBukkit end + } + +@@ -0,0 +0,0 @@ public record DimensionTransition(ServerLevel newLevel, Vec3 pos, Vec3 speed, fl + } + + public static DimensionTransition missingRespawnBlock(ServerLevel world, Entity entity, DimensionTransition.PostDimensionTransition postDimensionTransition) { +- return new DimensionTransition(world, findAdjustedSharedSpawnPos(world, entity), Vec3.ZERO, 0.0F, 0.0F, true, postDimensionTransition); ++ return new DimensionTransition(world, findAdjustedSharedSpawnPos(world, entity), Vec3.ZERO, world.getSharedSpawnAngle(), 0.0F, true, postDimensionTransition); // Paper - MC-200092 - fix spawn pos yaw being ignored + } + + private static Vec3 findAdjustedSharedSpawnPos(ServerLevel world, Entity entity) { diff --git a/patches/unapplied/server/Fix-async-entity-add-due-to-fungus-trees.patch b/patches/server/Fix-async-entity-add-due-to-fungus-trees.patch similarity index 100% rename from patches/unapplied/server/Fix-async-entity-add-due-to-fungus-trees.patch rename to patches/server/Fix-async-entity-add-due-to-fungus-trees.patch diff --git a/patches/unapplied/server/Fix-cancelled-powdered-snow-bucket-placement.patch b/patches/server/Fix-cancelled-powdered-snow-bucket-placement.patch similarity index 100% rename from patches/unapplied/server/Fix-cancelled-powdered-snow-bucket-placement.patch rename to patches/server/Fix-cancelled-powdered-snow-bucket-placement.patch diff --git a/patches/unapplied/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch b/patches/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch similarity index 100% rename from patches/unapplied/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch rename to patches/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch diff --git a/patches/unapplied/server/Fix-custom-piglin-loved-items.patch b/patches/server/Fix-custom-piglin-loved-items.patch similarity index 100% rename from patches/unapplied/server/Fix-custom-piglin-loved-items.patch rename to patches/server/Fix-custom-piglin-loved-items.patch diff --git a/patches/unapplied/server/Fix-falling-block-spawn-methods.patch b/patches/server/Fix-falling-block-spawn-methods.patch similarity index 100% rename from patches/unapplied/server/Fix-falling-block-spawn-methods.patch rename to patches/server/Fix-falling-block-spawn-methods.patch diff --git a/patches/unapplied/server/Fix-new-block-data-for-EntityChangeBlockEvent.patch b/patches/server/Fix-new-block-data-for-EntityChangeBlockEvent.patch similarity index 100% rename from patches/unapplied/server/Fix-new-block-data-for-EntityChangeBlockEvent.patch rename to patches/server/Fix-new-block-data-for-EntityChangeBlockEvent.patch diff --git a/patches/unapplied/server/Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/Fix-plugin-loggers-on-server-shutdown.patch similarity index 100% rename from patches/unapplied/server/Fix-plugin-loggers-on-server-shutdown.patch rename to patches/server/Fix-plugin-loggers-on-server-shutdown.patch diff --git a/patches/unapplied/server/Fix-saving-in-unloadWorld.patch b/patches/server/Fix-saving-in-unloadWorld.patch similarity index 100% rename from patches/unapplied/server/Fix-saving-in-unloadWorld.patch rename to patches/server/Fix-saving-in-unloadWorld.patch diff --git a/patches/unapplied/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch b/patches/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch similarity index 100% rename from patches/unapplied/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch rename to patches/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch diff --git a/patches/unapplied/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch b/patches/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch similarity index 100% rename from patches/unapplied/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch rename to patches/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch diff --git a/patches/unapplied/server/Fix-swamp-hut-cat-generation-deadlock.patch b/patches/server/Fix-swamp-hut-cat-generation-deadlock.patch similarity index 100% rename from patches/unapplied/server/Fix-swamp-hut-cat-generation-deadlock.patch rename to patches/server/Fix-swamp-hut-cat-generation-deadlock.patch diff --git a/patches/unapplied/server/Fix-xp-reward-for-baby-zombies.patch b/patches/server/Fix-xp-reward-for-baby-zombies.patch similarity index 89% rename from patches/unapplied/server/Fix-xp-reward-for-baby-zombies.patch rename to patches/server/Fix-xp-reward-for-baby-zombies.patch index e0214193e8..807669a5b8 100644 --- a/patches/unapplied/server/Fix-xp-reward-for-baby-zombies.patch +++ b/patches/server/Fix-xp-reward-for-baby-zombies.patch @@ -15,15 +15,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class Zombie extends Monster { @Override - public int getExperienceReward() { + protected int getBaseExperienceReward() { + final int previousReward = this.xpReward; // Paper - store previous value to reset after calculating XP reward if (this.isBaby()) { this.xpReward = (int) ((double) this.xpReward * 2.5D); } -- return super.getExperienceReward(); +- return super.getBaseExperienceReward(); + // Paper start - store previous value to reset after calculating XP reward -+ int reward = super.getExperienceReward(); ++ int reward = super.getBaseExperienceReward(); + this.xpReward = previousReward; + return reward; + // Paper end - store previous value to reset after calculating XP reward diff --git a/patches/unapplied/server/Force-close-world-loading-screen.patch b/patches/server/Force-close-world-loading-screen.patch similarity index 97% rename from patches/unapplied/server/Force-close-world-loading-screen.patch rename to patches/server/Force-close-world-loading-screen.patch index 223e9a8332..597e1b3551 100644 --- a/patches/unapplied/server/Force-close-world-loading-screen.patch +++ b/patches/server/Force-close-world-loading-screen.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { - } + this.sendActivePlayerEffects(player); // Paper start - Fire PlayerJoinEvent when Player is actually ready; move vehicle into method so it can be called above - short circuit around that code this.onPlayerJoinFinish(player, worldserver1, s1); + // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead diff --git a/patches/unapplied/server/Forward-CraftEntity-in-teleport-command.patch b/patches/server/Forward-CraftEntity-in-teleport-command.patch similarity index 63% rename from patches/unapplied/server/Forward-CraftEntity-in-teleport-command.patch rename to patches/server/Forward-CraftEntity-in-teleport-command.patch index 348d39aa32..dec40618bf 100644 --- a/patches/unapplied/server/Forward-CraftEntity-in-teleport-command.patch +++ b/patches/server/Forward-CraftEntity-in-teleport-command.patch @@ -23,17 +23,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 nbttagcompound.remove("Dimension"); @@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - } + entity2.restoreFrom(this); + this.removeAfterChangingDimensions(); + // CraftBukkit start - Forward the CraftEntity to the new entity +- this.getBukkitEntity().setHandle(entity2); +- entity2.bukkitEntity = this.getBukkitEntity(); ++ // this.getBukkitEntity().setHandle(entity2); // Paper - forward CraftEntity in teleport command; moved to Entity#restoreFrom ++ // entity2.bukkitEntity = this.getBukkitEntity(); + // CraftBukkit end } - // CraftBukkit end -- // CraftBukkit start - Forward the CraftEntity to the new entity -- this.getBukkitEntity().setHandle(entity); -- entity.bukkitEntity = this.getBukkitEntity(); -- // CraftBukkit end -+ // // CraftBukkit start - Forward the CraftEntity to the new entity // Paper - Forward CraftEntity in teleport command; moved to Entity#restoreFrom -+ // this.getBukkitEntity().setHandle(entity); -+ // entity.bukkitEntity = this.getBukkitEntity(); -+ // // CraftBukkit end - } - this.removeAfterChangingDimensions(); diff --git a/patches/unapplied/server/Freeze-Tick-Lock-API.patch b/patches/server/Freeze-Tick-Lock-API.patch similarity index 100% rename from patches/unapplied/server/Freeze-Tick-Lock-API.patch rename to patches/server/Freeze-Tick-Lock-API.patch diff --git a/patches/unapplied/server/Furnace-RecipesUsed-API.patch b/patches/server/Furnace-RecipesUsed-API.patch similarity index 100% rename from patches/unapplied/server/Furnace-RecipesUsed-API.patch rename to patches/server/Furnace-RecipesUsed-API.patch diff --git a/patches/unapplied/server/Ignore-impossible-spawn-tick.patch b/patches/server/Ignore-impossible-spawn-tick.patch similarity index 100% rename from patches/unapplied/server/Ignore-impossible-spawn-tick.patch rename to patches/server/Ignore-impossible-spawn-tick.patch diff --git a/patches/unapplied/server/Implement-enchantWithLevels-API.patch b/patches/server/Implement-enchantWithLevels-API.patch similarity index 100% rename from patches/unapplied/server/Implement-enchantWithLevels-API.patch rename to patches/server/Implement-enchantWithLevels-API.patch diff --git a/patches/unapplied/server/Implement-getComputedBiome-API.patch b/patches/server/Implement-getComputedBiome-API.patch similarity index 100% rename from patches/unapplied/server/Implement-getComputedBiome-API.patch rename to patches/server/Implement-getComputedBiome-API.patch diff --git a/patches/unapplied/server/Implement-regenerateChunk.patch b/patches/server/Implement-regenerateChunk.patch similarity index 100% rename from patches/unapplied/server/Implement-regenerateChunk.patch rename to patches/server/Implement-regenerateChunk.patch diff --git a/patches/unapplied/server/Improve-scoreboard-entries.patch b/patches/server/Improve-scoreboard-entries.patch similarity index 100% rename from patches/unapplied/server/Improve-scoreboard-entries.patch rename to patches/server/Improve-scoreboard-entries.patch diff --git a/patches/unapplied/server/ItemStack-damage-API.patch b/patches/server/ItemStack-damage-API.patch similarity index 65% rename from patches/unapplied/server/ItemStack-damage-API.patch rename to patches/server/ItemStack-damage-API.patch index 55a5656bd7..ed6ff97839 100644 --- a/patches/unapplied/server/ItemStack-damage-API.patch +++ b/patches/server/ItemStack-damage-API.patch @@ -15,29 +15,41 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { - return; - } - } -+ // Paper start - ItemStack damage API - split hurtAndBreak to skip pre-checks like creative mode -+ this.hurtAndBreakWithoutChecks(amount, entity, slot); -+ } + } + + public void hurtAndBreak(int amount, ServerLevel world, @Nullable LivingEntity player, Consumer breakCallback) { // Paper - Add EntityDamageItemEvent ++ // Paper start - add param to skip infinite mats check ++ this.hurtAndBreak(amount, world, player, breakCallback, false); + } - -+ public void hurtAndBreakWithoutChecks(int amount, LivingEntity entity, @org.checkerframework.checker.nullness.qual.Nullable EquipmentSlot slot) { -+ { -+ // Paper end - ItemStack damage API - split hurtAndBreak to skip pre-checks like creative mode - RandomSource randomsource = entity.getRandom(); - ServerPlayer entityplayer; - ++ public void hurtAndBreak(int amount, ServerLevel world, @Nullable LivingEntity player, Consumer breakCallback, boolean force) { ++ // Paper end - add param to skip infinite mats check + if (this.isDamageableItem()) { +- if (player == null || !player.hasInfiniteMaterials()) { ++ if (player == null || !player.hasInfiniteMaterials() || force) { // Paper + if (amount > 0) { + int originalDamage = amount; // Paper - Expand PlayerItemDamageEvent + amount = EnchantmentHelper.processDurabilityChange(world, this, amount); @@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { - } + } - this.hurtAndBreak(amount, randomsource, entity, () -> { // Paper - Add EntityDamageItemEvent -- entity.broadcastBreakEvent(slot); -+ if (slot != null) entity.broadcastBreakEvent(slot); // Paper - ItemStack damage API - slot is nullable - Item item = this.getItem(); - // CraftBukkit start - Check for item breaking - if (this.count == 1 && entity instanceof net.minecraft.world.entity.player.Player) { + public void hurtAndBreak(int amount, LivingEntity entity, EquipmentSlot slot) { ++ // Paper start - add param to skip infinite mats check ++ this.hurtAndBreak(amount, entity, slot, false); ++ } ++ public void hurtAndBreak(int amount, LivingEntity entity, EquipmentSlot slot, boolean force) { ++ // Paper end - add param to skip infinite mats check + Level world = entity.level(); + + if (world instanceof ServerLevel worldserver) { +@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { + } + // CraftBukkit end + entity.onEquippedItemBroken(item, slot); +- }); ++ }, force); // Paper + } + + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -49,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + // Paper start - ItemStack damage API + public void broadcastSlotBreak(final org.bukkit.inventory.EquipmentSlot slot) { -+ this.getHandle().broadcastBreakEvent(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot)); ++ this.getHandle().level().broadcastEntityEvent(this.getHandle(), net.minecraft.world.entity.LivingEntity.entityEventForEquipmentBreak(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot))); + } + + @Override @@ -87,7 +99,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + private void damageItemStack0(final net.minecraft.world.item.ItemStack nmsStack, final int amount, final net.minecraft.world.entity.EquipmentSlot slot) { -+ nmsStack.hurtAndBreakWithoutChecks(amount, this.getHandle(), slot); ++ nmsStack.hurtAndBreak(amount, this.getHandle(), slot, true); + } + // Paper end - ItemStack damage API } diff --git a/patches/unapplied/server/Make-some-itemstacks-nonnull.patch b/patches/server/Make-some-itemstacks-nonnull.patch similarity index 100% rename from patches/unapplied/server/Make-some-itemstacks-nonnull.patch rename to patches/server/Make-some-itemstacks-nonnull.patch diff --git a/patches/unapplied/server/Make-water-animal-spawn-height-configurable.patch b/patches/server/Make-water-animal-spawn-height-configurable.patch similarity index 100% rename from patches/unapplied/server/Make-water-animal-spawn-height-configurable.patch rename to patches/server/Make-water-animal-spawn-height-configurable.patch diff --git a/patches/unapplied/server/Missing-eating-regain-reason.patch b/patches/server/Missing-eating-regain-reason.patch similarity index 100% rename from patches/unapplied/server/Missing-eating-regain-reason.patch rename to patches/server/Missing-eating-regain-reason.patch diff --git a/patches/unapplied/server/Missing-effect-cause.patch b/patches/server/Missing-effect-cause.patch similarity index 97% rename from patches/unapplied/server/Missing-effect-cause.patch rename to patches/server/Missing-effect-cause.patch index 0d69fe7c49..e4a8c0a517 100644 --- a/patches/unapplied/server/Missing-effect-cause.patch +++ b/patches/server/Missing-effect-cause.patch @@ -42,4 +42,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + user.addEffect(entry.createEffectInstance(), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD); // Paper - Add missing effect cause } - super.finishUsingItem(stack, world, user); + return super.finishUsingItem(stack, world, user); diff --git a/patches/unapplied/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch b/patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch similarity index 100% rename from patches/unapplied/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch rename to patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch diff --git a/patches/unapplied/server/More-PotionEffectType-API.patch b/patches/server/More-PotionEffectType-API.patch similarity index 100% rename from patches/unapplied/server/More-PotionEffectType-API.patch rename to patches/server/More-PotionEffectType-API.patch diff --git a/patches/unapplied/server/More-Projectile-API.patch b/patches/server/More-Projectile-API.patch similarity index 99% rename from patches/unapplied/server/More-Projectile-API.patch rename to patches/server/More-Projectile-API.patch index 525e080e41..7a0f23277a 100644 --- a/patches/unapplied/server/More-Projectile-API.patch +++ b/patches/server/More-Projectile-API.patch @@ -32,8 +32,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { // CraftBukkit start - logic to modify fishing wait time - this.timeUntilLured = Mth.nextInt(this.random, this.minWaitTime, this.maxWaitTime); -- this.timeUntilLured -= (this.applyLure) ? (this.lureSpeed * 20 * 5 >= this.maxWaitTime ? this.timeUntilLured - 1 : this.lureSpeed * 20 * 5) : 0; // Paper - Fix Lure infinite loop -+ resetTimeUntilLured(); // Paper - more projectile api - extract time until lured reset logic +- this.timeUntilLured -= (this.applyLure) ? (this.lureSpeed >= this.maxWaitTime ? this.timeUntilLured - 1 : this.lureSpeed ) : 0; // Paper - Fix Lure infinite loop ++ this.resetTimeUntilLured(); // Paper - more projectile api - extract time until lured reset logic // CraftBukkit end } } @@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - more projectile api - extract time until lured reset logic + public void resetTimeUntilLured() { + this.timeUntilLured = Mth.nextInt(this.random, this.minWaitTime, this.maxWaitTime); -+ this.timeUntilLured -= (this.applyLure) ? (this.lureSpeed * 20 * 5 >= this.maxWaitTime ? this.timeUntilLured - 1 : this.lureSpeed * 20 * 5) : 0; // Paper - Fix Lure infinite loop ++ this.timeUntilLured -= (this.applyLure) ? (this.lureSpeed >= this.maxWaitTime ? this.timeUntilLured - 1 : this.lureSpeed ) : 0; // Paper - Fix Lure infinite loop + } + // Paper end - more projectile api - extract time until lured reset logic diff --git a/patches/unapplied/server/More-Teleport-API.patch b/patches/server/More-Teleport-API.patch similarity index 98% rename from patches/unapplied/server/More-Teleport-API.patch rename to patches/server/More-Teleport-API.patch index c956008017..20e8d25283 100644 --- a/patches/unapplied/server/More-Teleport-API.patch +++ b/patches/server/More-Teleport-API.patch @@ -266,4 +266,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - Teleport API } else { // The respawn reason should never be used if the passed location is non null. - this.server.getHandle().respawn(entity, toWorld, true, to, !toWorld.paperConfig().environment.disableTeleportationSuffocationCheck, null); // Paper + this.server.getHandle().respawn(entity, true, Entity.RemovalReason.CHANGED_DIMENSION, null, to); diff --git a/patches/unapplied/server/More-vanilla-friendly-methods-to-update-trades.patch b/patches/server/More-vanilla-friendly-methods-to-update-trades.patch similarity index 100% rename from patches/unapplied/server/More-vanilla-friendly-methods-to-update-trades.patch rename to patches/server/More-vanilla-friendly-methods-to-update-trades.patch diff --git a/patches/unapplied/server/Multi-Block-Change-API-Implementation.patch b/patches/server/Multi-Block-Change-API-Implementation.patch similarity index 100% rename from patches/unapplied/server/Multi-Block-Change-API-Implementation.patch rename to patches/server/Multi-Block-Change-API-Implementation.patch diff --git a/patches/unapplied/server/Multiple-Entries-with-Scoreboards.patch b/patches/server/Multiple-Entries-with-Scoreboards.patch similarity index 100% rename from patches/unapplied/server/Multiple-Entries-with-Scoreboards.patch rename to patches/server/Multiple-Entries-with-Scoreboards.patch diff --git a/patches/unapplied/server/Nameable-Banner-API.patch b/patches/server/Nameable-Banner-API.patch similarity index 100% rename from patches/unapplied/server/Nameable-Banner-API.patch rename to patches/server/Nameable-Banner-API.patch diff --git a/patches/unapplied/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch b/patches/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch similarity index 100% rename from patches/unapplied/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch rename to patches/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch diff --git a/patches/unapplied/server/Prevent-empty-items-from-being-added-to-world.patch b/patches/server/Prevent-empty-items-from-being-added-to-world.patch similarity index 100% rename from patches/unapplied/server/Prevent-empty-items-from-being-added-to-world.patch rename to patches/server/Prevent-empty-items-from-being-added-to-world.patch diff --git a/patches/unapplied/server/Prevent-entity-loading-causing-async-lookups.patch b/patches/server/Prevent-entity-loading-causing-async-lookups.patch similarity index 100% rename from patches/unapplied/server/Prevent-entity-loading-causing-async-lookups.patch rename to patches/server/Prevent-entity-loading-causing-async-lookups.patch diff --git a/patches/unapplied/server/Prevent-tile-entity-copies-loading-chunks.patch b/patches/server/Prevent-tile-entity-copies-loading-chunks.patch similarity index 100% rename from patches/unapplied/server/Prevent-tile-entity-copies-loading-chunks.patch rename to patches/server/Prevent-tile-entity-copies-loading-chunks.patch diff --git a/patches/unapplied/server/Put-world-into-worldlist-before-initing-the-world.patch b/patches/server/Put-world-into-worldlist-before-initing-the-world.patch similarity index 100% rename from patches/unapplied/server/Put-world-into-worldlist-before-initing-the-world.patch rename to patches/server/Put-world-into-worldlist-before-initing-the-world.patch diff --git a/patches/unapplied/server/Remove-unnecessary-onTrackingStart-during-navigation.patch b/patches/server/Remove-unnecessary-onTrackingStart-during-navigation.patch similarity index 100% rename from patches/unapplied/server/Remove-unnecessary-onTrackingStart-during-navigation.patch rename to patches/server/Remove-unnecessary-onTrackingStart-during-navigation.patch diff --git a/patches/unapplied/server/Reset-placed-block-on-exception.patch b/patches/server/Reset-placed-block-on-exception.patch similarity index 100% rename from patches/unapplied/server/Reset-placed-block-on-exception.patch rename to patches/server/Reset-placed-block-on-exception.patch diff --git a/patches/unapplied/server/Sanitize-sent-BlockEntity-NBT.patch b/patches/server/Sanitize-sent-BlockEntity-NBT.patch similarity index 100% rename from patches/unapplied/server/Sanitize-sent-BlockEntity-NBT.patch rename to patches/server/Sanitize-sent-BlockEntity-NBT.patch diff --git a/patches/unapplied/server/Send-block-entities-after-destroy-prediction.patch b/patches/server/Send-block-entities-after-destroy-prediction.patch similarity index 100% rename from patches/unapplied/server/Send-block-entities-after-destroy-prediction.patch rename to patches/server/Send-block-entities-after-destroy-prediction.patch diff --git a/patches/unapplied/server/Stop-large-look-changes-from-crashing-the-server.patch b/patches/server/Stop-large-look-changes-from-crashing-the-server.patch similarity index 100% rename from patches/unapplied/server/Stop-large-look-changes-from-crashing-the-server.patch rename to patches/server/Stop-large-look-changes-from-crashing-the-server.patch diff --git a/patches/unapplied/server/Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/Throw-exception-on-world-create-while-being-ticked.patch similarity index 100% rename from patches/unapplied/server/Throw-exception-on-world-create-while-being-ticked.patch rename to patches/server/Throw-exception-on-world-create-while-being-ticked.patch diff --git a/patches/unapplied/server/Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch b/patches/server/Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch similarity index 100% rename from patches/unapplied/server/Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch rename to patches/server/Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch diff --git a/patches/unapplied/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch b/patches/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch similarity index 100% rename from patches/unapplied/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch rename to patches/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch diff --git a/patches/unapplied/server/Use-username-instead-of-display-name-in-PlayerList-g.patch b/patches/server/Use-username-instead-of-display-name-in-PlayerList-g.patch similarity index 100% rename from patches/unapplied/server/Use-username-instead-of-display-name-in-PlayerList-g.patch rename to patches/server/Use-username-instead-of-display-name-in-PlayerList-g.patch diff --git a/patches/unapplied/server/Validate-usernames.patch b/patches/server/Validate-usernames.patch similarity index 100% rename from patches/unapplied/server/Validate-usernames.patch rename to patches/server/Validate-usernames.patch diff --git a/patches/unapplied/server/Warn-on-plugins-accessing-faraway-chunks.patch b/patches/server/Warn-on-plugins-accessing-faraway-chunks.patch similarity index 100% rename from patches/unapplied/server/Warn-on-plugins-accessing-faraway-chunks.patch rename to patches/server/Warn-on-plugins-accessing-faraway-chunks.patch diff --git a/patches/unapplied/server/WorldCreator-keepSpawnLoaded.patch b/patches/server/WorldCreator-keepSpawnLoaded.patch similarity index 100% rename from patches/unapplied/server/WorldCreator-keepSpawnLoaded.patch rename to patches/server/WorldCreator-keepSpawnLoaded.patch diff --git a/patches/unapplied/server/cache-resource-keys.patch b/patches/server/cache-resource-keys.patch similarity index 100% rename from patches/unapplied/server/cache-resource-keys.patch rename to patches/server/cache-resource-keys.patch diff --git a/patches/unapplied/server/check-global-player-list-where-appropriate.patch b/patches/server/check-global-player-list-where-appropriate.patch similarity index 89% rename from patches/unapplied/server/check-global-player-list-where-appropriate.patch rename to patches/server/check-global-player-list-where-appropriate.patch index 0aaaf846bf..a3bf542347 100644 --- a/patches/unapplied/server/check-global-player-list-where-appropriate.patch +++ b/patches/server/check-global-player-list-where-appropriate.patch @@ -41,14 +41,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java @@ -0,0 +0,0 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { - entityvillager.finalizeSpawn(world, world.getCurrentDifficultyAt(entityvillager.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null); - entityvillager.refreshBrain(world); - if (this.conversionStarter != null) { -- Player entityhuman = world.getPlayerByUUID(this.conversionStarter); + entityvillager.finalizeSpawn(world, world.getCurrentDifficultyAt(entityvillager.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null); + entityvillager.refreshBrain(world); + if (this.conversionStarter != null) { +- Player entityhuman = world.getPlayerByUUID(this.conversionStarter); + Player entityhuman = world.getGlobalPlayerByUUID(this.conversionStarter); // Paper - check global player list where appropriate - if (entityhuman instanceof ServerPlayer) { - CriteriaTriggers.CURED_ZOMBIE_VILLAGER.trigger((ServerPlayer) entityhuman, this, entityvillager); + if (entityhuman instanceof ServerPlayer) { + CriteriaTriggers.CURED_ZOMBIE_VILLAGER.trigger((ServerPlayer) entityhuman, this, entityvillager); diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/EntityGetter.java diff --git a/patches/unapplied/server/ensure-reset-EnderDragon-boss-event-name.patch b/patches/server/ensure-reset-EnderDragon-boss-event-name.patch similarity index 100% rename from patches/unapplied/server/ensure-reset-EnderDragon-boss-event-name.patch rename to patches/server/ensure-reset-EnderDragon-boss-event-name.patch diff --git a/patches/unapplied/server/fix-Jigsaw-block-kicking-user.patch b/patches/server/fix-Jigsaw-block-kicking-user.patch similarity index 59% rename from patches/unapplied/server/fix-Jigsaw-block-kicking-user.patch rename to patches/server/fix-Jigsaw-block-kicking-user.patch index 1ccfcd44ff..09ab2a6971 100644 --- a/patches/unapplied/server/fix-Jigsaw-block-kicking-user.patch +++ b/patches/server/fix-Jigsaw-block-kicking-user.patch @@ -22,21 +22,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 JigsawPlacement.generateJigsaw(world, holder, this.target, maxDepth, blockPos, keepJigsaws); } -diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java b/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java -+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java -@@ -0,0 +0,0 @@ public class StructureTemplatePool { - } - - public StructurePoolElement getRandomTemplate(RandomSource random) { -+ //Paper start - Prevent random.nextInt throwing an IllegalArgumentException -+ if (this.templates.size() == 0) { -+ return EmptyPoolElement.INSTANCE; -+ } else { - return this.templates.get(random.nextInt(this.templates.size())); -+ } -+ // Paper end - } - - public List getShuffledTemplates(RandomSource random) { diff --git a/patches/unapplied/server/fix-entity-vehicle-collision-event-not-called.patch b/patches/server/fix-entity-vehicle-collision-event-not-called.patch similarity index 100% rename from patches/unapplied/server/fix-entity-vehicle-collision-event-not-called.patch rename to patches/server/fix-entity-vehicle-collision-event-not-called.patch diff --git a/patches/unapplied/server/fix-player-loottables-running-when-mob-loot-gamerule.patch b/patches/server/fix-player-loottables-running-when-mob-loot-gamerule.patch similarity index 93% rename from patches/unapplied/server/fix-player-loottables-running-when-mob-loot-gamerule.patch rename to patches/server/fix-player-loottables-running-when-mob-loot-gamerule.patch index b06910c842..69f1a5d9d1 100644 --- a/patches/unapplied/server/fix-player-loottables-running-when-mob-loot-gamerule.patch +++ b/patches/server/fix-player-loottables-running-when-mob-loot-gamerule.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { } } } diff --git a/patches/unapplied/server/fix-powder-snow-cauldrons-not-turning-to-water.patch b/patches/server/fix-powder-snow-cauldrons-not-turning-to-water.patch similarity index 100% rename from patches/unapplied/server/fix-powder-snow-cauldrons-not-turning-to-water.patch rename to patches/server/fix-powder-snow-cauldrons-not-turning-to-water.patch diff --git a/patches/unapplied/server/use-BlockFormEvent-for-mud-converting-into-clay.patch b/patches/server/use-BlockFormEvent-for-mud-converting-into-clay.patch similarity index 100% rename from patches/unapplied/server/use-BlockFormEvent-for-mud-converting-into-clay.patch rename to patches/server/use-BlockFormEvent-for-mud-converting-into-clay.patch diff --git a/patches/unapplied/server/Add-EntityPortalReadyEvent.patch b/patches/unapplied/server/Add-EntityPortalReadyEvent.patch deleted file mode 100644 index 27c43c0df1..0000000000 --- a/patches/unapplied/server/Add-EntityPortalReadyEvent.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Wed, 12 May 2021 04:30:42 -0700 -Subject: [PATCH] Add EntityPortalReadyEvent - - -diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/Entity.java -+++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit - this.level().getProfiler().push("portal"); - this.portalTime = i; -+ // Paper start - Add EntityPortalReadyEvent -+ io.papermc.paper.event.entity.EntityPortalReadyEvent event = new io.papermc.paper.event.entity.EntityPortalReadyEvent(this.getBukkitEntity(), worldserver1 == null ? null : worldserver1.getWorld(), org.bukkit.PortalType.NETHER); -+ if (!event.callEvent()) { -+ this.portalTime = 0; -+ } else { -+ worldserver1 = event.getTargetWorld() == null ? null : ((CraftWorld) event.getTargetWorld()).getHandle(); -+ // Paper end - Add EntityPortalReadyEvent - this.setPortalCooldown(); - // CraftBukkit start - if (this instanceof ServerPlayer) { -@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - } else { - this.changeDimension(worldserver1); - } -+ } // Paper - Add EntityPortalReadyEvent - // CraftBukkit end - this.level().getProfiler().pop(); - } diff --git a/patches/unapplied/server/Expand-PlayerItemDamageEvent.patch b/patches/unapplied/server/Expand-PlayerItemDamageEvent.patch deleted file mode 100644 index 30e1156d6c..0000000000 --- a/patches/unapplied/server/Expand-PlayerItemDamageEvent.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: HexedHero <6012891+HexedHero@users.noreply.github.com> -Date: Sun, 10 Apr 2022 06:26:32 +0100 -Subject: [PATCH] Expand PlayerItemDamageEvent - - -diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/item/ItemStack.java -+++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { - } - } - -+ int originalDamage = amount; // Paper - Expand PlayerItemDamageEvent - amount -= k; - // CraftBukkit start - if (player instanceof ServerPlayer serverPlayer) { // Paper - Add EntityDamageItemEvent -- PlayerItemDamageEvent event = new PlayerItemDamageEvent(serverPlayer.getBukkitEntity(), CraftItemStack.asCraftMirror(this), amount); // Paper - Add EntityDamageItemEvent -+ PlayerItemDamageEvent event = new PlayerItemDamageEvent(serverPlayer.getBukkitEntity(), CraftItemStack.asCraftMirror(this), amount, originalDamage); // Paper - Add EntityDamageItemEvent & Expand PlayerItemDamageEvent - event.getPlayer().getServer().getPluginManager().callEvent(event); - - if (amount != event.getDamage() || event.isCancelled()) { diff --git a/patches/unapplied/server/Fix-Entity-Position-Desync.patch b/patches/unapplied/server/Fix-Entity-Position-Desync.patch deleted file mode 100644 index ddd85cc493..0000000000 --- a/patches/unapplied/server/Fix-Entity-Position-Desync.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> -Date: Thu, 23 Dec 2021 23:59:12 -0500 -Subject: [PATCH] Fix Entity Position Desync - -If entities were teleported in the first tick it would not be send to the client. - -This excludes hanging entities, as this fix caused problematic behavior due to them having their own -position field. - -diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/level/ServerEntity.java -+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java -@@ -0,0 +0,0 @@ public class ServerEntity { - boolean flag4 = false; - boolean flag5 = false; - -- if (this.tickCount > 0 || this.entity instanceof AbstractArrow) { -+ if (!(this.entity instanceof net.minecraft.world.entity.decoration.HangingEntity) || this.tickCount > 0 || this.entity instanceof AbstractArrow) { // Paper - Always update position to fix first-tick teleports - long k = this.positionCodec.encodeX(vec3d); - long l = this.positionCodec.encodeY(vec3d); - long i1 = this.positionCodec.encodeZ(vec3d); diff --git a/patches/unapplied/server/fix-MC-252817-green-map-markers-do-not-disappear.patch b/patches/unapplied/server/fix-MC-252817-green-map-markers-do-not-disappear.patch deleted file mode 100644 index 002509c64a..0000000000 --- a/patches/unapplied/server/fix-MC-252817-green-map-markers-do-not-disappear.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: braindead -Date: Sat, 5 Nov 2022 17:47:26 -0400 -Subject: [PATCH] fix MC-252817 (green map markers do not disappear). - -this bug is caused by the fact that the itemframe's item is set to empty before the green marker is requested to be removed. this is fixed by getting the mapid from this method's parameter, rather than the air block now stored by the item frame. - -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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -@@ -0,0 +0,0 @@ public class ItemFrame extends HangingEntity { - } - - private void removeFramedMap(ItemStack stack) { -- MapId mapid = this.getFramedMapId(); -+ MapId mapid = this.getFramedMapIdForItem(stack); // Paper - fix MC-252817 (green map markers do not disappear) - - if (mapid != null) { - MapItemSavedData worldmap = MapItem.getSavedData(mapid, this.level()); -@@ -0,0 +0,0 @@ public class ItemFrame extends HangingEntity { - - @Nullable - public MapId getFramedMapId() { -- return (MapId) this.getItem().get(DataComponents.MAP_ID); -+ // Paper start -+ return this.getFramedMapIdForItem(this.getItem()); -+ } -+ -+ @Nullable -+ public MapId getFramedMapIdForItem(ItemStack item) { -+ return (MapId) item.get(DataComponents.MAP_ID); -+ // Paper end - } - - public boolean hasFramedMap() {