From 9120ce5d4b604fc46dd91fe7f7e4efcbdd081244 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 13 Jun 2024 11:09:28 -0700 Subject: [PATCH] 194 --- ...-get-a-BlockState-without-a-snapshot.patch | 0 .../Ability-to-apply-mending-to-XP-API.patch | 0 ...-to-control-if-armor-stands-can-move.patch | 0 .../server/Add-ArmorStand-Item-Meta.patch | 0 .../Add-EntityTeleportEndGatewayEvent.patch | 29 ++++++ ...PlayerAdvancementCriterionGrantEvent.patch | 0 .../server/Add-PlayerArmorChangeEvent.patch | 0 .../server/Add-PlayerJumpEvent.patch | 0 .../server/Add-UnknownCommandEvent.patch | 0 ...n-option-to-prevent-player-names-fro.patch | 0 ...dd-more-fields-to-AsyncPreLoginEvent.patch | 0 .../Add-openSign-method-to-HumanEntity.patch | 0 ...ke-parrots-stay-on-shoulders-despite.patch | 0 .../Add-setPlayerProfile-API-for-Skulls.patch | 0 ...-a-custom-authentication-servers-dow.patch | 0 .../server/AsyncTabCompleteEvent.patch | 0 .../server/Basic-PlayerProfile-API.patch | 0 .../Block-Enderpearl-Travel-Exploit.patch | 0 ...player-logins-during-server-shutdown.patch | 0 ...ServerListPingEvent-for-legacy-pings.patch | 0 .../server/Cap-Entity-Collisions.patch | 0 ...figurable-Cartographer-Treasure-Maps.patch | 0 ...urable-sprint-interruption-on-attack.patch | 13 ++- ...le-Explicit-Network-Manager-Flushing.patch | 0 ...-profile-lookups-to-worldgen-threads.patch | 2 +- .../server/Enderman.teleportRandomly.patch | 0 .../server/EndermanAttackPlayerEvent.patch | 0 .../server/EndermanEscapeEvent.patch | 0 .../server/Enforce-Sync-Player-Saves.patch | 0 .../server/Entity-fromMobSpawner.patch | 0 ...ld.spawnParticle-API-and-add-Builder.patch | 0 ...PI-for-Reason-Source-Triggering-play.patch | 5 +- ...nt-protocol-version-and-virtual-host.patch | 0 .../Extend-Player-Interact-cancellation.patch | 0 .../server/Fill-Profile-Property-Events.patch | 0 .../server/Firework-API-s.patch | 0 ...117075-Block-entity-unload-lag-spike.patch | 0 ...-allowed-colored-signs-to-be-created.patch | 0 .../server/Fix-this-stupid-bullshit.patch | 2 +- .../Flag-to-disable-the-channel-limit.patch | 0 ...nt-extended-PaperServerListPingEvent.patch | 0 .../server/Implement-getI18NDisplayName.patch | 0 .../Improve-the-Saddle-API-for-Horses.patch | 0 .../Improved-Async-Task-Scheduler.patch | 0 .../server/Item-canEntityPickup.patch | 2 +- .../ItemStack-getMaxItemUseDuration.patch | 0 .../server/LivingEntity-setKiller.patch | 0 ...ke-legacy-ping-handler-more-reliable.patch | 0 ...awns-should-honor-nametags-and-leash.patch | 0 .../server/Player.setPlayerProfile-API.patch | 0 .../server/PlayerAttemptPickupItemEvent.patch | 0 .../PlayerNaturallySpawnCreaturesEvent.patch | 2 +- .../server/PlayerPickupExperienceEvent.patch | 6 +- ...PlayerPickupItemEvent-setFlyAtPlayer.patch | 0 .../PlayerTeleportEndGatewayEvent.patch | 35 +++++++ .../server/PreCreatureSpawnEvent.patch | 0 ...rom-being-processed-when-the-player-.patch | 0 .../server/Profile-Lookup-Events.patch | 0 .../server/ProfileWhitelistVerifyEvent.patch | 0 .../Properly-fix-item-duplication-bug.patch | 2 +- ...le-async-calls-to-restart-the-server.patch | 4 +- ...rovide-E-TE-Chunk-count-stat-methods.patch | 0 ...e-CraftScheduler-Async-Task-Debugger.patch | 0 ...imer-when-spawner-event-is-cancelled.patch | 0 ...dEffects-only-to-players-who-can-see.patch | 91 +++++++++++++------ .../Shoulder-Entities-Release-API.patch | 0 .../server/String-based-Action-Bar-API.patch | 0 .../Tameable-getOwnerUniqueId-API.patch | 0 .../server/Toggleable-player-crits.patch | 12 +-- .../server/WitchConsumePotionEvent.patch | 0 .../server/WitchReadyPotionEvent.patch | 5 +- .../server/WitchThrowPotionEvent.patch | 0 .../server/ensureServerConversions-API.patch | 0 .../server/getPlayerUniqueId-API.patch | 0 ...dle-ServerboundKeepAlivePacket-async.patch | 0 ...urable-option-to-disable-creeper-lin.patch | 0 ...rt-serverside-behavior-of-keepalives.patch | 0 ...e-implementations-for-captured-block.patch | 0 .../Add-EntityTeleportEndGatewayEvent.patch | 27 ------ .../PlayerTeleportEndGatewayEvent.patch | 26 ------ 80 files changed, 152 insertions(+), 111 deletions(-) rename patches/{unapplied => }/server/API-to-get-a-BlockState-without-a-snapshot.patch (100%) rename patches/{unapplied => }/server/Ability-to-apply-mending-to-XP-API.patch (100%) rename patches/{unapplied => }/server/Add-API-methods-to-control-if-armor-stands-can-move.patch (100%) rename patches/{unapplied => }/server/Add-ArmorStand-Item-Meta.patch (100%) create mode 100644 patches/server/Add-EntityTeleportEndGatewayEvent.patch rename patches/{unapplied => }/server/Add-PlayerAdvancementCriterionGrantEvent.patch (100%) rename patches/{unapplied => }/server/Add-PlayerArmorChangeEvent.patch (100%) rename patches/{unapplied => }/server/Add-PlayerJumpEvent.patch (100%) rename patches/{unapplied => }/server/Add-UnknownCommandEvent.patch (100%) rename patches/{unapplied => }/server/Add-configuration-option-to-prevent-player-names-fro.patch (100%) rename patches/{unapplied => }/server/Add-more-fields-to-AsyncPreLoginEvent.patch (100%) rename patches/{unapplied => }/server/Add-openSign-method-to-HumanEntity.patch (100%) rename patches/{unapplied => }/server/Add-option-to-make-parrots-stay-on-shoulders-despite.patch (100%) rename patches/{unapplied => }/server/Add-setPlayerProfile-API-for-Skulls.patch (100%) rename patches/{unapplied => }/server/Allow-specifying-a-custom-authentication-servers-dow.patch (100%) rename patches/{unapplied => }/server/AsyncTabCompleteEvent.patch (100%) rename patches/{unapplied => }/server/Basic-PlayerProfile-API.patch (100%) rename patches/{unapplied => }/server/Block-Enderpearl-Travel-Exploit.patch (100%) rename patches/{unapplied => }/server/Block-player-logins-during-server-shutdown.patch (100%) rename patches/{unapplied => }/server/Call-PaperServerListPingEvent-for-legacy-pings.patch (100%) rename patches/{unapplied => }/server/Cap-Entity-Collisions.patch (100%) rename patches/{unapplied => }/server/Configurable-Cartographer-Treasure-Maps.patch (100%) rename patches/{unapplied => }/server/Configurable-sprint-interruption-on-attack.patch (73%) rename patches/{unapplied => }/server/Disable-Explicit-Network-Manager-Flushing.patch (100%) rename patches/{unapplied => }/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch (97%) rename patches/{unapplied => }/server/Enderman.teleportRandomly.patch (100%) rename patches/{unapplied => }/server/EndermanAttackPlayerEvent.patch (100%) rename patches/{unapplied => }/server/EndermanEscapeEvent.patch (100%) rename patches/{unapplied => }/server/Enforce-Sync-Player-Saves.patch (100%) rename patches/{unapplied => }/server/Entity-fromMobSpawner.patch (100%) rename patches/{unapplied => }/server/Expand-World.spawnParticle-API-and-add-Builder.patch (100%) rename patches/{unapplied => }/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch (98%) rename patches/{unapplied => }/server/Expose-client-protocol-version-and-virtual-host.patch (100%) rename patches/{unapplied => }/server/Extend-Player-Interact-cancellation.patch (100%) rename patches/{unapplied => }/server/Fill-Profile-Property-Events.patch (100%) rename patches/{unapplied => }/server/Firework-API-s.patch (100%) rename patches/{unapplied => }/server/Fix-MC-117075-Block-entity-unload-lag-spike.patch (100%) rename patches/{unapplied => }/server/Fix-exploit-that-allowed-colored-signs-to-be-created.patch (100%) rename patches/{unapplied => }/server/Fix-this-stupid-bullshit.patch (97%) rename patches/{unapplied => }/server/Flag-to-disable-the-channel-limit.patch (100%) rename patches/{unapplied => }/server/Implement-extended-PaperServerListPingEvent.patch (100%) rename patches/{unapplied => }/server/Implement-getI18NDisplayName.patch (100%) rename patches/{unapplied => }/server/Improve-the-Saddle-API-for-Horses.patch (100%) rename patches/{unapplied => }/server/Improved-Async-Task-Scheduler.patch (100%) rename patches/{unapplied => }/server/Item-canEntityPickup.patch (98%) rename patches/{unapplied => }/server/ItemStack-getMaxItemUseDuration.patch (100%) rename patches/{unapplied => }/server/LivingEntity-setKiller.patch (100%) rename patches/{unapplied => }/server/Make-legacy-ping-handler-more-reliable.patch (100%) rename patches/{unapplied => }/server/Ocelot-despawns-should-honor-nametags-and-leash.patch (100%) rename patches/{unapplied => }/server/Player.setPlayerProfile-API.patch (100%) rename patches/{unapplied => }/server/PlayerAttemptPickupItemEvent.patch (100%) rename patches/{unapplied => }/server/PlayerNaturallySpawnCreaturesEvent.patch (98%) rename patches/{unapplied => }/server/PlayerPickupExperienceEvent.patch (76%) rename patches/{unapplied => }/server/PlayerPickupItemEvent-setFlyAtPlayer.patch (100%) create mode 100644 patches/server/PlayerTeleportEndGatewayEvent.patch rename patches/{unapplied => }/server/PreCreatureSpawnEvent.patch (100%) rename patches/{unapplied => }/server/Prevent-logins-from-being-processed-when-the-player-.patch (100%) rename patches/{unapplied => }/server/Profile-Lookup-Events.patch (100%) rename patches/{unapplied => }/server/ProfileWhitelistVerifyEvent.patch (100%) rename patches/{unapplied => }/server/Properly-fix-item-duplication-bug.patch (94%) rename patches/{unapplied => }/server/Properly-handle-async-calls-to-restart-the-server.patch (98%) rename patches/{unapplied => }/server/Provide-E-TE-Chunk-count-stat-methods.patch (100%) rename patches/{unapplied => }/server/Remove-CraftScheduler-Async-Task-Debugger.patch (100%) rename patches/{unapplied => }/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch (100%) rename patches/{unapplied => }/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch (55%) rename patches/{unapplied => }/server/Shoulder-Entities-Release-API.patch (100%) rename patches/{unapplied => }/server/String-based-Action-Bar-API.patch (100%) rename patches/{unapplied => }/server/Tameable-getOwnerUniqueId-API.patch (100%) rename patches/{unapplied => }/server/Toggleable-player-crits.patch (50%) rename patches/{unapplied => }/server/WitchConsumePotionEvent.patch (100%) rename patches/{unapplied => }/server/WitchReadyPotionEvent.patch (95%) rename patches/{unapplied => }/server/WitchThrowPotionEvent.patch (100%) rename patches/{unapplied => }/server/ensureServerConversions-API.patch (100%) rename patches/{unapplied => }/server/getPlayerUniqueId-API.patch (100%) rename patches/{unapplied => }/server/handle-ServerboundKeepAlivePacket-async.patch (100%) rename patches/{unapplied => }/server/provide-a-configurable-option-to-disable-creeper-lin.patch (100%) rename patches/{unapplied => }/server/revert-serverside-behavior-of-keepalives.patch (100%) rename patches/{unapplied => }/server/use-CB-BlockState-implementations-for-captured-block.patch (100%) delete mode 100644 patches/unapplied/server/Add-EntityTeleportEndGatewayEvent.patch delete mode 100644 patches/unapplied/server/PlayerTeleportEndGatewayEvent.patch diff --git a/patches/unapplied/server/API-to-get-a-BlockState-without-a-snapshot.patch b/patches/server/API-to-get-a-BlockState-without-a-snapshot.patch similarity index 100% rename from patches/unapplied/server/API-to-get-a-BlockState-without-a-snapshot.patch rename to patches/server/API-to-get-a-BlockState-without-a-snapshot.patch diff --git a/patches/unapplied/server/Ability-to-apply-mending-to-XP-API.patch b/patches/server/Ability-to-apply-mending-to-XP-API.patch similarity index 100% rename from patches/unapplied/server/Ability-to-apply-mending-to-XP-API.patch rename to patches/server/Ability-to-apply-mending-to-XP-API.patch diff --git a/patches/unapplied/server/Add-API-methods-to-control-if-armor-stands-can-move.patch b/patches/server/Add-API-methods-to-control-if-armor-stands-can-move.patch similarity index 100% rename from patches/unapplied/server/Add-API-methods-to-control-if-armor-stands-can-move.patch rename to patches/server/Add-API-methods-to-control-if-armor-stands-can-move.patch diff --git a/patches/unapplied/server/Add-ArmorStand-Item-Meta.patch b/patches/server/Add-ArmorStand-Item-Meta.patch similarity index 100% rename from patches/unapplied/server/Add-ArmorStand-Item-Meta.patch rename to patches/server/Add-ArmorStand-Item-Meta.patch diff --git a/patches/server/Add-EntityTeleportEndGatewayEvent.patch b/patches/server/Add-EntityTeleportEndGatewayEvent.patch new file mode 100644 index 0000000000..845cac5bac --- /dev/null +++ b/patches/server/Add-EntityTeleportEndGatewayEvent.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Sat, 9 Jun 2018 14:08:39 +0200 +Subject: [PATCH] Add EntityTeleportEndGatewayEvent + + +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.isRemoved()) { + // CraftBukkit start + Location to = new Location(teleportTarget.newLevel().getWorld(), teleportTarget.pos().x, teleportTarget.pos().y, teleportTarget.pos().z, teleportTarget.yRot(), teleportTarget.xRot()); +- EntityTeleportEvent teleEvent = CraftEventFactory.callEntityTeleportEvent(this, to); +- if (teleEvent.isCancelled()) { ++ // Paper start - gateway-specific teleport event ++ final EntityTeleportEvent teleEvent; ++ if (this.portalProcess != null && this.portalProcess.isSamePortal(((net.minecraft.world.level.block.EndGatewayBlock) net.minecraft.world.level.block.Blocks.END_GATEWAY)) && this.level.getBlockEntity(this.portalProcess.getEntryPosition()) instanceof net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity theEndGatewayBlockEntity) { ++ teleEvent = new com.destroystokyo.paper.event.entity.EntityTeleportEndGatewayEvent(this.getBukkitEntity(), this.getBukkitEntity().getLocation(), to, new org.bukkit.craftbukkit.block.CraftEndGateway(to.getWorld(), theEndGatewayBlockEntity)); ++ teleEvent.callEvent(); ++ } else { ++ teleEvent = CraftEventFactory.callEntityTeleportEvent(this, to); ++ } ++ // Paper end - gateway-specific teleport event ++ if (teleEvent.isCancelled() || teleEvent.getTo() == null) { + return null; + } + to = teleEvent.getTo(); diff --git a/patches/unapplied/server/Add-PlayerAdvancementCriterionGrantEvent.patch b/patches/server/Add-PlayerAdvancementCriterionGrantEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerAdvancementCriterionGrantEvent.patch rename to patches/server/Add-PlayerAdvancementCriterionGrantEvent.patch diff --git a/patches/unapplied/server/Add-PlayerArmorChangeEvent.patch b/patches/server/Add-PlayerArmorChangeEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerArmorChangeEvent.patch rename to patches/server/Add-PlayerArmorChangeEvent.patch diff --git a/patches/unapplied/server/Add-PlayerJumpEvent.patch b/patches/server/Add-PlayerJumpEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerJumpEvent.patch rename to patches/server/Add-PlayerJumpEvent.patch diff --git a/patches/unapplied/server/Add-UnknownCommandEvent.patch b/patches/server/Add-UnknownCommandEvent.patch similarity index 100% rename from patches/unapplied/server/Add-UnknownCommandEvent.patch rename to patches/server/Add-UnknownCommandEvent.patch diff --git a/patches/unapplied/server/Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/Add-configuration-option-to-prevent-player-names-fro.patch similarity index 100% rename from patches/unapplied/server/Add-configuration-option-to-prevent-player-names-fro.patch rename to patches/server/Add-configuration-option-to-prevent-player-names-fro.patch diff --git a/patches/unapplied/server/Add-more-fields-to-AsyncPreLoginEvent.patch b/patches/server/Add-more-fields-to-AsyncPreLoginEvent.patch similarity index 100% rename from patches/unapplied/server/Add-more-fields-to-AsyncPreLoginEvent.patch rename to patches/server/Add-more-fields-to-AsyncPreLoginEvent.patch diff --git a/patches/unapplied/server/Add-openSign-method-to-HumanEntity.patch b/patches/server/Add-openSign-method-to-HumanEntity.patch similarity index 100% rename from patches/unapplied/server/Add-openSign-method-to-HumanEntity.patch rename to patches/server/Add-openSign-method-to-HumanEntity.patch diff --git a/patches/unapplied/server/Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/patches/server/Add-option-to-make-parrots-stay-on-shoulders-despite.patch similarity index 100% rename from patches/unapplied/server/Add-option-to-make-parrots-stay-on-shoulders-despite.patch rename to patches/server/Add-option-to-make-parrots-stay-on-shoulders-despite.patch diff --git a/patches/unapplied/server/Add-setPlayerProfile-API-for-Skulls.patch b/patches/server/Add-setPlayerProfile-API-for-Skulls.patch similarity index 100% rename from patches/unapplied/server/Add-setPlayerProfile-API-for-Skulls.patch rename to patches/server/Add-setPlayerProfile-API-for-Skulls.patch diff --git a/patches/unapplied/server/Allow-specifying-a-custom-authentication-servers-dow.patch b/patches/server/Allow-specifying-a-custom-authentication-servers-dow.patch similarity index 100% rename from patches/unapplied/server/Allow-specifying-a-custom-authentication-servers-dow.patch rename to patches/server/Allow-specifying-a-custom-authentication-servers-dow.patch diff --git a/patches/unapplied/server/AsyncTabCompleteEvent.patch b/patches/server/AsyncTabCompleteEvent.patch similarity index 100% rename from patches/unapplied/server/AsyncTabCompleteEvent.patch rename to patches/server/AsyncTabCompleteEvent.patch diff --git a/patches/unapplied/server/Basic-PlayerProfile-API.patch b/patches/server/Basic-PlayerProfile-API.patch similarity index 100% rename from patches/unapplied/server/Basic-PlayerProfile-API.patch rename to patches/server/Basic-PlayerProfile-API.patch diff --git a/patches/unapplied/server/Block-Enderpearl-Travel-Exploit.patch b/patches/server/Block-Enderpearl-Travel-Exploit.patch similarity index 100% rename from patches/unapplied/server/Block-Enderpearl-Travel-Exploit.patch rename to patches/server/Block-Enderpearl-Travel-Exploit.patch diff --git a/patches/unapplied/server/Block-player-logins-during-server-shutdown.patch b/patches/server/Block-player-logins-during-server-shutdown.patch similarity index 100% rename from patches/unapplied/server/Block-player-logins-during-server-shutdown.patch rename to patches/server/Block-player-logins-during-server-shutdown.patch diff --git a/patches/unapplied/server/Call-PaperServerListPingEvent-for-legacy-pings.patch b/patches/server/Call-PaperServerListPingEvent-for-legacy-pings.patch similarity index 100% rename from patches/unapplied/server/Call-PaperServerListPingEvent-for-legacy-pings.patch rename to patches/server/Call-PaperServerListPingEvent-for-legacy-pings.patch diff --git a/patches/unapplied/server/Cap-Entity-Collisions.patch b/patches/server/Cap-Entity-Collisions.patch similarity index 100% rename from patches/unapplied/server/Cap-Entity-Collisions.patch rename to patches/server/Cap-Entity-Collisions.patch diff --git a/patches/unapplied/server/Configurable-Cartographer-Treasure-Maps.patch b/patches/server/Configurable-Cartographer-Treasure-Maps.patch similarity index 100% rename from patches/unapplied/server/Configurable-Cartographer-Treasure-Maps.patch rename to patches/server/Configurable-Cartographer-Treasure-Maps.patch diff --git a/patches/unapplied/server/Configurable-sprint-interruption-on-attack.patch b/patches/server/Configurable-sprint-interruption-on-attack.patch similarity index 73% rename from patches/unapplied/server/Configurable-sprint-interruption-on-attack.patch rename to patches/server/Configurable-sprint-interruption-on-attack.patch index 3591ef99c5..e9afaf92c1 100644 --- a/patches/unapplied/server/Configurable-sprint-interruption-on-attack.patch +++ b/patches/server/Configurable-sprint-interruption-on-attack.patch @@ -10,15 +10,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - } - this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D)); + this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D)); + this.setSprinting(false); + // Paper start - Configurable sprint interruption on attack + if (!this.level().paperConfig().misc.disableSprintInterruptionOnAttack) { - this.setSprinting(false); - } -+ // Paper end - Configurable sprint interruption on attack ++ this.setSprinting(false); + } ++ // Paper end - Configurable sprint interruption on attack + } - if (flag3) { - float f4 = 1.0F + EnchantmentHelper.getSweepingDamageRatio(this) * f; + LivingEntity entityliving2; diff --git a/patches/unapplied/server/Disable-Explicit-Network-Manager-Flushing.patch b/patches/server/Disable-Explicit-Network-Manager-Flushing.patch similarity index 100% rename from patches/unapplied/server/Disable-Explicit-Network-Manager-Flushing.patch rename to patches/server/Disable-Explicit-Network-Manager-Flushing.patch diff --git a/patches/unapplied/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch b/patches/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch similarity index 97% rename from patches/unapplied/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch rename to patches/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch index 3485a085ff..688f4125a3 100644 --- a/patches/unapplied/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch +++ b/patches/server/Do-not-submit-profile-lookups-to-worldgen-threads.patch @@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - don't submit BLOCKING PROFILE LOOKUPS to the world gen thread private static final DateTimeFormatter FILENAME_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH.mm.ss", Locale.ROOT); public static final int LINEAR_LOOKUP_THRESHOLD = 8; - public static final long NANOS_PER_MILLI = 1000000L; + private static final Set ALLOWED_UNTRUSTED_LINK_PROTOCOLS = Set.of("http", "https"); diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java diff --git a/patches/unapplied/server/Enderman.teleportRandomly.patch b/patches/server/Enderman.teleportRandomly.patch similarity index 100% rename from patches/unapplied/server/Enderman.teleportRandomly.patch rename to patches/server/Enderman.teleportRandomly.patch diff --git a/patches/unapplied/server/EndermanAttackPlayerEvent.patch b/patches/server/EndermanAttackPlayerEvent.patch similarity index 100% rename from patches/unapplied/server/EndermanAttackPlayerEvent.patch rename to patches/server/EndermanAttackPlayerEvent.patch diff --git a/patches/unapplied/server/EndermanEscapeEvent.patch b/patches/server/EndermanEscapeEvent.patch similarity index 100% rename from patches/unapplied/server/EndermanEscapeEvent.patch rename to patches/server/EndermanEscapeEvent.patch diff --git a/patches/unapplied/server/Enforce-Sync-Player-Saves.patch b/patches/server/Enforce-Sync-Player-Saves.patch similarity index 100% rename from patches/unapplied/server/Enforce-Sync-Player-Saves.patch rename to patches/server/Enforce-Sync-Player-Saves.patch diff --git a/patches/unapplied/server/Entity-fromMobSpawner.patch b/patches/server/Entity-fromMobSpawner.patch similarity index 100% rename from patches/unapplied/server/Entity-fromMobSpawner.patch rename to patches/server/Entity-fromMobSpawner.patch diff --git a/patches/unapplied/server/Expand-World.spawnParticle-API-and-add-Builder.patch b/patches/server/Expand-World.spawnParticle-API-and-add-Builder.patch similarity index 100% rename from patches/unapplied/server/Expand-World.spawnParticle-API-and-add-Builder.patch rename to patches/server/Expand-World.spawnParticle-API-and-add-Builder.patch diff --git a/patches/unapplied/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch similarity index 98% rename from patches/unapplied/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch rename to patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index 3ae3fd7736..b1a4130bcb 100644 --- a/patches/unapplied/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -131,11 +131,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { - protected void dropExperience() { + protected void dropExperience(@Nullable Entity attacker) { // CraftBukkit start - Update getExpReward() above if the removed if() changes! - if (true && !(this instanceof net.minecraft.world.entity.boss.enderdragon.EnderDragon)) { // CraftBukkit - SPIGOT-2420: Special case ender dragon will drop the xp over time + if (!(this instanceof net.minecraft.world.entity.boss.enderdragon.EnderDragon)) { // CraftBukkit - SPIGOT-2420: Special case ender dragon will drop the xp over time - ExperienceOrb.award((ServerLevel) this.level(), this.position(), this.expToDrop); -+ LivingEntity attacker = this.lastHurtByPlayer != null ? this.lastHurtByPlayer : this.lastHurtByMob; // Paper + ExperienceOrb.award((ServerLevel) this.level(), this.position(), this.expToDrop, this instanceof ServerPlayer ? org.bukkit.entity.ExperienceOrb.SpawnReason.PLAYER_DEATH : org.bukkit.entity.ExperienceOrb.SpawnReason.ENTITY_DEATH, attacker, this); // Paper this.expToDrop = 0; } diff --git a/patches/unapplied/server/Expose-client-protocol-version-and-virtual-host.patch b/patches/server/Expose-client-protocol-version-and-virtual-host.patch similarity index 100% rename from patches/unapplied/server/Expose-client-protocol-version-and-virtual-host.patch rename to patches/server/Expose-client-protocol-version-and-virtual-host.patch diff --git a/patches/unapplied/server/Extend-Player-Interact-cancellation.patch b/patches/server/Extend-Player-Interact-cancellation.patch similarity index 100% rename from patches/unapplied/server/Extend-Player-Interact-cancellation.patch rename to patches/server/Extend-Player-Interact-cancellation.patch diff --git a/patches/unapplied/server/Fill-Profile-Property-Events.patch b/patches/server/Fill-Profile-Property-Events.patch similarity index 100% rename from patches/unapplied/server/Fill-Profile-Property-Events.patch rename to patches/server/Fill-Profile-Property-Events.patch diff --git a/patches/unapplied/server/Firework-API-s.patch b/patches/server/Firework-API-s.patch similarity index 100% rename from patches/unapplied/server/Firework-API-s.patch rename to patches/server/Firework-API-s.patch diff --git a/patches/unapplied/server/Fix-MC-117075-Block-entity-unload-lag-spike.patch b/patches/server/Fix-MC-117075-Block-entity-unload-lag-spike.patch similarity index 100% rename from patches/unapplied/server/Fix-MC-117075-Block-entity-unload-lag-spike.patch rename to patches/server/Fix-MC-117075-Block-entity-unload-lag-spike.patch diff --git a/patches/unapplied/server/Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/patches/server/Fix-exploit-that-allowed-colored-signs-to-be-created.patch similarity index 100% rename from patches/unapplied/server/Fix-exploit-that-allowed-colored-signs-to-be-created.patch rename to patches/server/Fix-exploit-that-allowed-colored-signs-to-be-created.patch diff --git a/patches/unapplied/server/Fix-this-stupid-bullshit.patch b/patches/server/Fix-this-stupid-bullshit.patch similarity index 97% rename from patches/unapplied/server/Fix-this-stupid-bullshit.patch rename to patches/server/Fix-this-stupid-bullshit.patch index 7b77f054b4..2748352d35 100644 --- a/patches/unapplied/server/Fix-this-stupid-bullshit.patch +++ b/patches/server/Fix-this-stupid-bullshit.patch @@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -21); + deadline.add(Calendar.DAY_OF_YEAR, -3); if (buildDate.before(deadline.getTime())) { - System.err.println("*** Error, this build is outdated ***"); + // Paper start - This is some stupid bullshit diff --git a/patches/unapplied/server/Flag-to-disable-the-channel-limit.patch b/patches/server/Flag-to-disable-the-channel-limit.patch similarity index 100% rename from patches/unapplied/server/Flag-to-disable-the-channel-limit.patch rename to patches/server/Flag-to-disable-the-channel-limit.patch diff --git a/patches/unapplied/server/Implement-extended-PaperServerListPingEvent.patch b/patches/server/Implement-extended-PaperServerListPingEvent.patch similarity index 100% rename from patches/unapplied/server/Implement-extended-PaperServerListPingEvent.patch rename to patches/server/Implement-extended-PaperServerListPingEvent.patch diff --git a/patches/unapplied/server/Implement-getI18NDisplayName.patch b/patches/server/Implement-getI18NDisplayName.patch similarity index 100% rename from patches/unapplied/server/Implement-getI18NDisplayName.patch rename to patches/server/Implement-getI18NDisplayName.patch diff --git a/patches/unapplied/server/Improve-the-Saddle-API-for-Horses.patch b/patches/server/Improve-the-Saddle-API-for-Horses.patch similarity index 100% rename from patches/unapplied/server/Improve-the-Saddle-API-for-Horses.patch rename to patches/server/Improve-the-Saddle-API-for-Horses.patch diff --git a/patches/unapplied/server/Improved-Async-Task-Scheduler.patch b/patches/server/Improved-Async-Task-Scheduler.patch similarity index 100% rename from patches/unapplied/server/Improved-Async-Task-Scheduler.patch rename to patches/server/Improved-Async-Task-Scheduler.patch diff --git a/patches/unapplied/server/Item-canEntityPickup.patch b/patches/server/Item-canEntityPickup.patch similarity index 98% rename from patches/unapplied/server/Item-canEntityPickup.patch rename to patches/server/Item-canEntityPickup.patch index e88302ccd8..5bcfed7b9f 100644 --- a/patches/unapplied/server/Item-canEntityPickup.patch +++ b/patches/server/Item-canEntityPickup.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab ItemEntity entityitem = (ItemEntity) iterator.next(); if (!entityitem.isRemoved() && !entityitem.getItem().isEmpty() && !entityitem.hasPickUpDelay() && this.wantsToPickUp(entityitem.getItem())) { diff --git a/patches/unapplied/server/ItemStack-getMaxItemUseDuration.patch b/patches/server/ItemStack-getMaxItemUseDuration.patch similarity index 100% rename from patches/unapplied/server/ItemStack-getMaxItemUseDuration.patch rename to patches/server/ItemStack-getMaxItemUseDuration.patch diff --git a/patches/unapplied/server/LivingEntity-setKiller.patch b/patches/server/LivingEntity-setKiller.patch similarity index 100% rename from patches/unapplied/server/LivingEntity-setKiller.patch rename to patches/server/LivingEntity-setKiller.patch diff --git a/patches/unapplied/server/Make-legacy-ping-handler-more-reliable.patch b/patches/server/Make-legacy-ping-handler-more-reliable.patch similarity index 100% rename from patches/unapplied/server/Make-legacy-ping-handler-more-reliable.patch rename to patches/server/Make-legacy-ping-handler-more-reliable.patch diff --git a/patches/unapplied/server/Ocelot-despawns-should-honor-nametags-and-leash.patch b/patches/server/Ocelot-despawns-should-honor-nametags-and-leash.patch similarity index 100% rename from patches/unapplied/server/Ocelot-despawns-should-honor-nametags-and-leash.patch rename to patches/server/Ocelot-despawns-should-honor-nametags-and-leash.patch diff --git a/patches/unapplied/server/Player.setPlayerProfile-API.patch b/patches/server/Player.setPlayerProfile-API.patch similarity index 100% rename from patches/unapplied/server/Player.setPlayerProfile-API.patch rename to patches/server/Player.setPlayerProfile-API.patch diff --git a/patches/unapplied/server/PlayerAttemptPickupItemEvent.patch b/patches/server/PlayerAttemptPickupItemEvent.patch similarity index 100% rename from patches/unapplied/server/PlayerAttemptPickupItemEvent.patch rename to patches/server/PlayerAttemptPickupItemEvent.patch diff --git a/patches/unapplied/server/PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/PlayerNaturallySpawnCreaturesEvent.patch similarity index 98% rename from patches/unapplied/server/PlayerNaturallySpawnCreaturesEvent.patch rename to patches/server/PlayerNaturallySpawnCreaturesEvent.patch index 60569ce201..5f8f541daf 100644 --- a/patches/unapplied/server/PlayerNaturallySpawnCreaturesEvent.patch +++ b/patches/server/PlayerNaturallySpawnCreaturesEvent.patch @@ -63,7 +63,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 { // CraftBukkit end public boolean isRealPlayer; // Paper public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper diff --git a/patches/unapplied/server/PlayerPickupExperienceEvent.patch b/patches/server/PlayerPickupExperienceEvent.patch similarity index 76% rename from patches/unapplied/server/PlayerPickupExperienceEvent.patch rename to patches/server/PlayerPickupExperienceEvent.patch index 0d12051913..8685664c53 100644 --- a/patches/unapplied/server/PlayerPickupExperienceEvent.patch +++ b/patches/server/PlayerPickupExperienceEvent.patch @@ -12,9 +12,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class ExperienceOrb extends Entity { @Override public void playerTouch(Player player) { - if (!this.level().isClientSide) { + if (player instanceof ServerPlayer entityplayer) { - if (player.takeXpDelay == 0) { -+ if (player.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((net.minecraft.server.level.ServerPlayer) player).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - PlayerPickupExperienceEvent ++ if (player.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(entityplayer.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - PlayerPickupExperienceEvent player.takeXpDelay = CraftEventFactory.callPlayerXpCooldownEvent(player, 2, PlayerExpCooldownChangeEvent.ChangeReason.PICKUP_ORB).getNewCooldown(); // CraftBukkit - entityhuman.takeXpDelay = 2; player.take(this, 1); - int i = this.repairPlayerItems(player, this.value); + int i = this.repairPlayerItems(entityplayer, this.value); diff --git a/patches/unapplied/server/PlayerPickupItemEvent-setFlyAtPlayer.patch b/patches/server/PlayerPickupItemEvent-setFlyAtPlayer.patch similarity index 100% rename from patches/unapplied/server/PlayerPickupItemEvent-setFlyAtPlayer.patch rename to patches/server/PlayerPickupItemEvent-setFlyAtPlayer.patch diff --git a/patches/server/PlayerTeleportEndGatewayEvent.patch b/patches/server/PlayerTeleportEndGatewayEvent.patch new file mode 100644 index 0000000000..7f0fd91903 --- /dev/null +++ b/patches/server/PlayerTeleportEndGatewayEvent.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sat, 31 Dec 2016 21:44:50 -0500 +Subject: [PATCH] PlayerTeleportEndGatewayEvent + +Allows you to access the Gateway being used in a teleport event +Fix the offset used for player teleportation + +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 net.minecraft.world.entity.player.Player { + ResourceKey resourcekey = worldserver1.getTypeKey(); + + if (worldserver != null && worldserver.dimension() == worldserver1.dimension()) { // CraftBukkit ++ // Paper start - gateway-specific teleport event ++ if (this.portalProcess != null && this.portalProcess.isSamePortal(((net.minecraft.world.level.block.EndGatewayBlock) net.minecraft.world.level.block.Blocks.END_GATEWAY)) && this.serverLevel().getBlockEntity(this.portalProcess.getEntryPosition()) instanceof net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity theEndGatewayBlockEntity) { ++ Location to = CraftLocation.toBukkit(teleportTarget.pos(), this.serverLevel().getWorld(), teleportTarget.yRot(), teleportTarget.xRot()); ++ final com.destroystokyo.paper.event.player.PlayerTeleportEndGatewayEvent event = new com.destroystokyo.paper.event.player.PlayerTeleportEndGatewayEvent(this.getBukkitEntity(), this.getBukkitEntity().getLocation(), to, new org.bukkit.craftbukkit.block.CraftEndGateway(to.getWorld(), theEndGatewayBlockEntity)); ++ if (!event.callEvent() || event.getTo() == null) { ++ return null; ++ } ++ this.connection.teleport(event.getTo()); ++ } else { ++ // Paper end - gateway-specific teleport event + boolean result = this.connection.teleport(teleportTarget.pos().x, teleportTarget.pos().y, teleportTarget.pos().z, teleportTarget.yRot(), teleportTarget.xRot(), teleportTarget.cause()); + if (!result) { + return null; + } + // CraftBukkit end ++ } // Paper + this.connection.resetPosition(); + teleportTarget.postDimensionTransition().onTransition(this); + return this; diff --git a/patches/unapplied/server/PreCreatureSpawnEvent.patch b/patches/server/PreCreatureSpawnEvent.patch similarity index 100% rename from patches/unapplied/server/PreCreatureSpawnEvent.patch rename to patches/server/PreCreatureSpawnEvent.patch diff --git a/patches/unapplied/server/Prevent-logins-from-being-processed-when-the-player-.patch b/patches/server/Prevent-logins-from-being-processed-when-the-player-.patch similarity index 100% rename from patches/unapplied/server/Prevent-logins-from-being-processed-when-the-player-.patch rename to patches/server/Prevent-logins-from-being-processed-when-the-player-.patch diff --git a/patches/unapplied/server/Profile-Lookup-Events.patch b/patches/server/Profile-Lookup-Events.patch similarity index 100% rename from patches/unapplied/server/Profile-Lookup-Events.patch rename to patches/server/Profile-Lookup-Events.patch diff --git a/patches/unapplied/server/ProfileWhitelistVerifyEvent.patch b/patches/server/ProfileWhitelistVerifyEvent.patch similarity index 100% rename from patches/unapplied/server/ProfileWhitelistVerifyEvent.patch rename to patches/server/ProfileWhitelistVerifyEvent.patch diff --git a/patches/unapplied/server/Properly-fix-item-duplication-bug.patch b/patches/server/Properly-fix-item-duplication-bug.patch similarity index 94% rename from patches/unapplied/server/Properly-fix-item-duplication-bug.patch rename to patches/server/Properly-fix-item-duplication-bug.patch index 31a744a5e3..07c6a68cd2 100644 --- a/patches/unapplied/server/Properly-fix-item-duplication-bug.patch +++ b/patches/server/Properly-fix-item-duplication-bug.patch @@ -9,7 +9,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 { @Override public boolean isImmobile() { diff --git a/patches/unapplied/server/Properly-handle-async-calls-to-restart-the-server.patch b/patches/server/Properly-handle-async-calls-to-restart-the-server.patch similarity index 98% rename from patches/unapplied/server/Properly-handle-async-calls-to-restart-the-server.patch rename to patches/server/Properly-handle-async-calls-to-restart-the-server.patch index 4cc2883793..d6da58a68f 100644 --- a/patches/unapplied/server/Properly-handle-async-calls-to-restart-the-server.patch +++ b/patches/server/Properly-handle-async-calls-to-restart-the-server.patch @@ -119,7 +119,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - // Kick all players - for ( ServerPlayer p : (List) MinecraftServer.getServer().getPlayerList().players ) - { -- p.connection.disconnect(SpigotConfig.restartMessage); +- p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage ) ); - } - // Give the socket a chance to send the packets - try @@ -138,7 +138,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Kick all players + for ( ServerPlayer p : com.google.common.collect.ImmutableList.copyOf( MinecraftServer.getServer().getPlayerList().players ) ) + { -+ p.connection.disconnect(SpigotConfig.restartMessage); ++ p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage ) ); + } + // Give the socket a chance to send the packets + try diff --git a/patches/unapplied/server/Provide-E-TE-Chunk-count-stat-methods.patch b/patches/server/Provide-E-TE-Chunk-count-stat-methods.patch similarity index 100% rename from patches/unapplied/server/Provide-E-TE-Chunk-count-stat-methods.patch rename to patches/server/Provide-E-TE-Chunk-count-stat-methods.patch diff --git a/patches/unapplied/server/Remove-CraftScheduler-Async-Task-Debugger.patch b/patches/server/Remove-CraftScheduler-Async-Task-Debugger.patch similarity index 100% rename from patches/unapplied/server/Remove-CraftScheduler-Async-Task-Debugger.patch rename to patches/server/Remove-CraftScheduler-Async-Task-Debugger.patch diff --git a/patches/unapplied/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch similarity index 100% rename from patches/unapplied/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch rename to patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch diff --git a/patches/unapplied/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch b/patches/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch similarity index 55% rename from patches/unapplied/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch rename to patches/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch index 26d3ba2c72..40318ea913 100644 --- a/patches/unapplied/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch +++ b/patches/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch @@ -10,51 +10,84 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { + boolean flag1; - i += EnchantmentHelper.getKnockbackBonus(this); - if (this.isSprinting() && flag) { -- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); -+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility - ++i; - flag1 = true; - } + if (this.isSprinting() && flag) { +- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); ++ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility + flag1 = true; + } else { + flag1 = false; @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - } } + } -- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_SWEEP, this.getSoundSource(), 1.0F, 1.0F); +- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_SWEEP, this.getSoundSource(), 1.0F, 1.0F); +- this.sweepAttack(); +- } + sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_SWEEP, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility - this.sweepAttack(); - } ++ this.sweepAttack(); ++ } + if (target instanceof ServerPlayer && target.hurtMarked) { + // CraftBukkit start - Add Velocity Event @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - } + // CraftBukkit end + } - if (flag2) { -- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_CRIT, this.getSoundSource(), 1.0F, 1.0F); +- if (flag2) { +- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_CRIT, this.getSoundSource(), 1.0F, 1.0F); +- this.crit(target); +- } ++ if (flag2) { + sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_CRIT, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility - this.crit(target); - } ++ this.crit(target); ++ } - if (!flag2 && !flag3) { - if (flag) { -- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_STRONG, this.getSoundSource(), 1.0F, 1.0F); +- if (!flag2 && !flag3) { +- if (flag) { +- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_STRONG, this.getSoundSource(), 1.0F, 1.0F); +- } else { +- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_WEAK, this.getSoundSource(), 1.0F, 1.0F); ++ if (!flag2 && !flag3) { ++ if (flag) { + sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_STRONG, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility - } else { -- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_WEAK, this.getSoundSource(), 1.0F, 1.0F); ++ } else { + sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_WEAK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility - } ++ } } +- } + if (f1 > 0.0F) { + this.magicCrit(target); @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - - this.causeFoodExhaustion(this.level().spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value - } else { -- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F); -+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility - if (flag4) { - target.clearFire(); } + } + +- this.causeFoodExhaustion(this.level().spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value +- } else { +- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F); +- // CraftBukkit start - resync on cancelled event +- if (this instanceof ServerPlayer) { +- ((ServerPlayer) this).getBukkitEntity().updateInventory(); ++ this.causeFoodExhaustion(this.level().spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value ++ } else { ++ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility ++ if (flag4) { ++ target.clearFire(); ++ } ++ // CraftBukkit start - resync on cancelled event ++ if (this instanceof ServerPlayer) { ++ ((ServerPlayer) this).getBukkitEntity().updateInventory(); ++ } ++ // CraftBukkit end + } +- // CraftBukkit end + } +- } + + } + } @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { public int getXpNeededForNextLevel() { return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2); diff --git a/patches/unapplied/server/Shoulder-Entities-Release-API.patch b/patches/server/Shoulder-Entities-Release-API.patch similarity index 100% rename from patches/unapplied/server/Shoulder-Entities-Release-API.patch rename to patches/server/Shoulder-Entities-Release-API.patch diff --git a/patches/unapplied/server/String-based-Action-Bar-API.patch b/patches/server/String-based-Action-Bar-API.patch similarity index 100% rename from patches/unapplied/server/String-based-Action-Bar-API.patch rename to patches/server/String-based-Action-Bar-API.patch diff --git a/patches/unapplied/server/Tameable-getOwnerUniqueId-API.patch b/patches/server/Tameable-getOwnerUniqueId-API.patch similarity index 100% rename from patches/unapplied/server/Tameable-getOwnerUniqueId-API.patch rename to patches/server/Tameable-getOwnerUniqueId-API.patch diff --git a/patches/unapplied/server/Toggleable-player-crits.patch b/patches/server/Toggleable-player-crits.patch similarity index 50% rename from patches/unapplied/server/Toggleable-player-crits.patch rename to patches/server/Toggleable-player-crits.patch index 9c994bd2ed..da9b5eda1b 100644 --- a/patches/unapplied/server/Toggleable-player-crits.patch +++ b/patches/server/Toggleable-player-crits.patch @@ -9,10 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - f += this.getItemInHand(InteractionHand.MAIN_HAND).getItem().getAttackDamageBonus(this, f); - boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity && !this.isSprinting(); + f += itemstack.getItem().getAttackDamageBonus(target, f, damagesource); + boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity && !this.isSprinting(); -+ flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits - if (flag2) { - f *= 1.5F; - } ++ flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits + if (flag2) { + f *= 1.5F; + } diff --git a/patches/unapplied/server/WitchConsumePotionEvent.patch b/patches/server/WitchConsumePotionEvent.patch similarity index 100% rename from patches/unapplied/server/WitchConsumePotionEvent.patch rename to patches/server/WitchConsumePotionEvent.patch diff --git a/patches/unapplied/server/WitchReadyPotionEvent.patch b/patches/server/WitchReadyPotionEvent.patch similarity index 95% rename from patches/unapplied/server/WitchReadyPotionEvent.patch rename to patches/server/WitchReadyPotionEvent.patch index 8d4ba04685..22abcd7e55 100644 --- a/patches/unapplied/server/WitchReadyPotionEvent.patch +++ b/patches/server/WitchReadyPotionEvent.patch @@ -12,15 +12,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } if (holder != null) { -- this.setItemSlot(EquipmentSlot.MAINHAND, PotionContents.createItemStack(Items.POTION, holder)); + // Paper start + ItemStack potion = PotionContents.createItemStack(Items.POTION, holder); + potion = org.bukkit.craftbukkit.event.CraftEventFactory.handleWitchReadyPotionEvent(this, potion); + this.setItemSlot(EquipmentSlot.MAINHAND, potion); + // Paper end - this.usingTime = this.getMainHandItem().getUseDuration(); + this.setItemSlot(EquipmentSlot.MAINHAND, PotionContents.createItemStack(Items.POTION, holder)); + this.usingTime = this.getMainHandItem().getUseDuration(this); this.setUsingItem(true); - if (!this.isSilent()) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/patches/unapplied/server/WitchThrowPotionEvent.patch b/patches/server/WitchThrowPotionEvent.patch similarity index 100% rename from patches/unapplied/server/WitchThrowPotionEvent.patch rename to patches/server/WitchThrowPotionEvent.patch diff --git a/patches/unapplied/server/ensureServerConversions-API.patch b/patches/server/ensureServerConversions-API.patch similarity index 100% rename from patches/unapplied/server/ensureServerConversions-API.patch rename to patches/server/ensureServerConversions-API.patch diff --git a/patches/unapplied/server/getPlayerUniqueId-API.patch b/patches/server/getPlayerUniqueId-API.patch similarity index 100% rename from patches/unapplied/server/getPlayerUniqueId-API.patch rename to patches/server/getPlayerUniqueId-API.patch diff --git a/patches/unapplied/server/handle-ServerboundKeepAlivePacket-async.patch b/patches/server/handle-ServerboundKeepAlivePacket-async.patch similarity index 100% rename from patches/unapplied/server/handle-ServerboundKeepAlivePacket-async.patch rename to patches/server/handle-ServerboundKeepAlivePacket-async.patch diff --git a/patches/unapplied/server/provide-a-configurable-option-to-disable-creeper-lin.patch b/patches/server/provide-a-configurable-option-to-disable-creeper-lin.patch similarity index 100% rename from patches/unapplied/server/provide-a-configurable-option-to-disable-creeper-lin.patch rename to patches/server/provide-a-configurable-option-to-disable-creeper-lin.patch diff --git a/patches/unapplied/server/revert-serverside-behavior-of-keepalives.patch b/patches/server/revert-serverside-behavior-of-keepalives.patch similarity index 100% rename from patches/unapplied/server/revert-serverside-behavior-of-keepalives.patch rename to patches/server/revert-serverside-behavior-of-keepalives.patch diff --git a/patches/unapplied/server/use-CB-BlockState-implementations-for-captured-block.patch b/patches/server/use-CB-BlockState-implementations-for-captured-block.patch similarity index 100% rename from patches/unapplied/server/use-CB-BlockState-implementations-for-captured-block.patch rename to patches/server/use-CB-BlockState-implementations-for-captured-block.patch diff --git a/patches/unapplied/server/Add-EntityTeleportEndGatewayEvent.patch b/patches/unapplied/server/Add-EntityTeleportEndGatewayEvent.patch deleted file mode 100644 index f74a3c437c..0000000000 --- a/patches/unapplied/server/Add-EntityTeleportEndGatewayEvent.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Sat, 9 Jun 2018 14:08:39 +0200 -Subject: [PATCH] Add EntityTeleportEndGatewayEvent - - -diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -@@ -0,0 +0,0 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity { - - } - -- org.bukkit.event.entity.EntityTeleportEvent teleEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTeleportEvent(entity1, blockposition1.getX() + 0.5, blockposition1.getY() + 0.5, blockposition1.getZ() + 0.5); -- if (teleEvent.isCancelled()) { -+ // Paper start - EntityTeleportEndGatewayEvent -+ org.bukkit.Location location = new org.bukkit.Location(world.getWorld(), blockposition1.getX() + 0.5D, blockposition1.getY(), blockposition1.getZ() + 0.5D); -+ location.setPitch(entity1.getXRot()); -+ location.setYaw(entity1.getBukkitYaw()); -+ org.bukkit.entity.Entity bukkitEntity = entity1.getBukkitEntity(); -+ org.bukkit.event.entity.EntityTeleportEvent teleEvent = new com.destroystokyo.paper.event.entity.EntityTeleportEndGatewayEvent(bukkitEntity, bukkitEntity.getLocation(), location, new org.bukkit.craftbukkit.block.CraftEndGateway(world.getWorld(), blockEntity)); -+ if (!teleEvent.callEvent() || teleEvent.getTo() == null) { -+ // Paper end - EntityTeleportEndGatewayEvent - return; - } - diff --git a/patches/unapplied/server/PlayerTeleportEndGatewayEvent.patch b/patches/unapplied/server/PlayerTeleportEndGatewayEvent.patch deleted file mode 100644 index 44e9bcb8f3..0000000000 --- a/patches/unapplied/server/PlayerTeleportEndGatewayEvent.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sat, 31 Dec 2016 21:44:50 -0500 -Subject: [PATCH] PlayerTeleportEndGatewayEvent - -Allows you to access the Gateway being used in a teleport event -Fix the offset used for player teleportation - -diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -@@ -0,0 +0,0 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity { - // CraftBukkit start - Fire PlayerTeleportEvent/EntityTeleportEvent - if (entity1 instanceof ServerPlayer) { - org.bukkit.craftbukkit.entity.CraftPlayer player = (CraftPlayer) entity1.getBukkitEntity(); -- org.bukkit.Location location = CraftLocation.toBukkit(blockposition1, world.getWorld()).add(0.5D, 0.5D, 0.5D); -+ org.bukkit.Location location = CraftLocation.toBukkit(blockposition1, world.getWorld()).add(0.5D, 0, 0.5D); // Paper - use the right Y offset - location.setPitch(player.getLocation().getPitch()); - location.setYaw(player.getLocation().getYaw()); - -- PlayerTeleportEvent teleEvent = new PlayerTeleportEvent(player, player.getLocation(), location, PlayerTeleportEvent.TeleportCause.END_GATEWAY); -+ PlayerTeleportEvent teleEvent = new com.destroystokyo.paper.event.player.PlayerTeleportEndGatewayEvent(player, player.getLocation(), location, new org.bukkit.craftbukkit.block.CraftEndGateway(worldserver.getWorld(), blockEntity)); // Paper - Bukkit.getPluginManager().callEvent(teleEvent); - if (teleEvent.isCancelled()) { - return;