aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2022-02-20 13:22:38 -0800
committerGitHub <[email protected]>2022-02-20 13:22:38 -0800
commitc53577e3c0ed48a3e5c728c9e8fac96312b1c6f1 (patch)
tree6db87bcd3ce95ed8c3774301116a2311687f621c
parentcc43ba70ff3107e5a044a5f7f37b7f5536058939 (diff)
downloadPaper-c53577e3c0ed48a3e5c728c9e8fac96312b1c6f1.tar.gz
Paper-c53577e3c0ed48a3e5c728c9e8fac96312b1c6f1.zip
[1.17.1] Backport #5740 and #7355 to 1.17.1 (#7384)
-rw-r--r--patches/server/0263-Improve-death-events.patch55
-rw-r--r--patches/server/0276-Add-LivingEntity-getTargetEntity.patch6
-rw-r--r--patches/server/0297-force-entity-dismount-during-teleportation.patch8
-rw-r--r--patches/server/0343-Prevent-consuming-the-wrong-itemstack.patch8
-rw-r--r--patches/server/0360-Lag-compensate-eating.patch12
-rw-r--r--patches/server/0379-Entity-Jump-API.patch4
-rw-r--r--patches/server/0409-Don-t-run-entity-collision-code-if-not-needed.patch4
-rw-r--r--patches/server/0418-Add-PlayerAttackEntityCooldownResetEvent.patch4
-rw-r--r--patches/server/0421-Fix-numerous-item-duplication-issues-and-teleport-is.patch57
-rw-r--r--patches/server/0484-Add-PrepareResultEvent.patch4
-rw-r--r--patches/server/0486-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch4
-rw-r--r--patches/server/0560-Climbing-should-not-bypass-cramming-gamerule.patch10
-rw-r--r--patches/server/0590-Implemented-BlockFailedDispenseEvent.patch4
-rw-r--r--patches/server/0605-Implement-BlockPreDispenseEvent.patch4
-rw-r--r--patches/server/0611-Add-dropLeash-variable-to-EntityUnleashEvent.patch14
-rw-r--r--patches/server/0615-EntityMoveEvent.patch8
-rw-r--r--patches/server/0650-Fix-PlayerItemConsumeEvent-cancelling-properly.patch4
-rw-r--r--patches/server/0702-Line-Of-Sight-Changes.patch6
-rw-r--r--patches/server/0721-Add-a-bunch-of-missing-forceDrop-toggles.patch4
-rw-r--r--patches/server/0727-Improve-boat-collision-performance.patch4
-rw-r--r--patches/server/0738-Make-EntityUnleashEvent-cancellable.patch4
-rw-r--r--patches/server/0830-Add-critical-damage-API.patch14
22 files changed, 165 insertions, 77 deletions
diff --git a/patches/server/0263-Improve-death-events.patch b/patches/server/0263-Improve-death-events.patch
index b554873581..053064b23f 100644
--- a/patches/server/0263-Improve-death-events.patch
+++ b/patches/server/0263-Improve-death-events.patch
@@ -70,7 +70,7 @@ index 3d5db5ce2e60ca72ad202caebe49f3fc80d1af37..91f8b8e8e2ed15481ceafc8695068c8d
}
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index db366a5d81dac6748bb0b20188117266aee095d1..f4828c1bdc7d5e67941926f8d772b1bbc83031cf 100644
+index db366a5d81dac6748bb0b20188117266aee095d1..fc284d0f44a6cd0c36ca8a3d7dcdd611fbe6148e 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -261,6 +261,7 @@ public abstract class LivingEntity extends Entity {
@@ -104,15 +104,15 @@ index db366a5d81dac6748bb0b20188117266aee095d1..f4828c1bdc7d5e67941926f8d772b1bb
Entity entity = source.getEntity();
LivingEntity entityliving = this.getKillCredit();
-
-+ /* // Paper - move down to make death event cancellable - this is the runKillTrigger below
++ /* // Paper - move down to make death event cancellable - this is the awardKillScore below
if (this.deathScore >= 0 && entityliving != null) {
entityliving.awardKillScore(this, this.deathScore, source);
}
-@@ -1613,20 +1613,46 @@ public abstract class LivingEntity extends Entity {
+@@ -1613,20 +1613,52 @@ public abstract class LivingEntity extends Entity {
if (!this.level.isClientSide && this.hasCustomName()) {
if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
}
-+ */ // Paper - move down to make death event cancellable - this is the runKillTrigger below
++ */ // Paper - move down to make death event cancellable - this is the awardKillScore below
this.dead = true;
- this.getCombatTracker().recheckStatus();
@@ -130,6 +130,12 @@ index db366a5d81dac6748bb0b20188117266aee095d1..f4828c1bdc7d5e67941926f8d772b1bb
+ if (this.deathScore >= 0 && entityliving != null) {
+ entityliving.awardKillScore(this, this.deathScore, source);
+ }
++ if (this instanceof Mob) { // Clear equipment slots marked as cleared
++ for (EquipmentSlot slot : this.clearedEquipmentSlots) {
++ this.setItemSlot(slot, ItemStack.EMPTY);
++ }
++ this.clearedEquipmentSlots.clear();
++ }
+
+ if (this.isSleeping()) {
+ this.stopSleeping();
@@ -158,7 +164,7 @@ index db366a5d81dac6748bb0b20188117266aee095d1..f4828c1bdc7d5e67941926f8d772b1bb
}
}
-@@ -1634,7 +1660,7 @@ public abstract class LivingEntity extends Entity {
+@@ -1634,7 +1666,7 @@ public abstract class LivingEntity extends Entity {
if (!this.level.isClientSide) {
boolean flag = false;
@@ -167,17 +173,30 @@ index db366a5d81dac6748bb0b20188117266aee095d1..f4828c1bdc7d5e67941926f8d772b1bb
if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
BlockPos blockposition = this.blockPosition();
BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
-@@ -1663,7 +1689,7 @@ public abstract class LivingEntity extends Entity {
+@@ -1663,7 +1695,11 @@ public abstract class LivingEntity extends Entity {
}
}
- protected void dropAllDeathLoot(DamageSource source) {
-+ protected org.bukkit.event.entity.EntityDeathEvent dropAllDeathLoot(DamageSource source) { // Paper
++ // Paper start
++ protected boolean clearEquipmentSlots = true;
++ protected Set<EquipmentSlot> clearedEquipmentSlots = new HashSet<>();
++ protected org.bukkit.event.entity.EntityDeathEvent dropAllDeathLoot(DamageSource source) {
++ // Paper end
Entity entity = source.getEntity();
int i;
-@@ -1681,15 +1707,18 @@ public abstract class LivingEntity extends Entity {
+@@ -1678,18 +1714,27 @@ public abstract class LivingEntity extends Entity {
+ this.dropEquipment(); // CraftBukkit - from below
+ if (this.shouldDropLoot() && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
+ this.dropFromLootTable(source, flag);
++ // Paper start - collect cleared slots, but don't clear to run advancement triggers
++ final boolean prev = this.clearEquipmentSlots;
++ this.clearEquipmentSlots = false;
++ this.clearedEquipmentSlots.clear();
++ // Paper end
this.dropCustomDeathLoot(source, i, flag);
++ this.clearEquipmentSlots = prev; // Paper
}
// CraftBukkit start - Call death event
- CraftEventFactory.callEntityDeathEvent(this, this.drops);
@@ -196,6 +215,24 @@ index db366a5d81dac6748bb0b20188117266aee095d1..f4828c1bdc7d5e67941926f8d772b1bb
// CraftBukkit start
public int getExpReward() {
+diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
+index 3429521aa78596069f3bead01ad04874fea7ee91..0242bb4ee546d6f7044d563433d7fb0639abdb7a 100644
+--- a/src/main/java/net/minecraft/world/entity/Mob.java
++++ b/src/main/java/net/minecraft/world/entity/Mob.java
+@@ -987,7 +987,13 @@ public abstract class Mob extends LivingEntity {
+ }
+
+ this.spawnAtLocation(itemstack);
++ if (this.clearEquipmentSlots) { // Paper
+ this.setItemSlot(enumitemslot, ItemStack.EMPTY);
++ // Paper start
++ } else {
++ this.clearedEquipmentSlots.add(enumitemslot);
++ }
++ // Paper end
+ }
+ }
+
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 7de3d73232d985ab18d7266371d301c490b79b9f..bfb042f4828e1cd47124939ca3b9caadc7fe1b39 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
@@ -289,7 +326,7 @@ index 3be9882ac1e96441f479f22099b77a25dd7cb8dd..7b7ceefbcc1f0be710dd8995f0afaad9
public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-index e094b1b00d5fb73da73abcadb02ffd98b91fb869..3ef52d7705f3c59e19c56aac6250f2e5b5712600 100644
+index 0d1c6f609a5198c21c895e8f6ace467355b0f166..61c95f98a3e3e52a23f65f7c957019f7f1aa7417 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -807,9 +807,16 @@ public class CraftEventFactory {
diff --git a/patches/server/0276-Add-LivingEntity-getTargetEntity.patch b/patches/server/0276-Add-LivingEntity-getTargetEntity.patch
index 8a49b6613e..4ee9df66fd 100644
--- a/patches/server/0276-Add-LivingEntity-getTargetEntity.patch
+++ b/patches/server/0276-Add-LivingEntity-getTargetEntity.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 1c35ba0d74aa02b0a94400308c20485ccaad7a13..a7aa62e52105b7adb7725f7abeae376df8f7bb3e 100644
+index fc284d0f44a6cd0c36ca8a3d7dcdd611fbe6148e..191c64e54392e63f0993ffb4b07ed5c18112bec9 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -116,6 +116,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
@@ -16,7 +16,7 @@ index 1c35ba0d74aa02b0a94400308c20485ccaad7a13..a7aa62e52105b7adb7725f7abeae376d
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.PlayerTeam;
-@@ -3736,6 +3737,38 @@ public abstract class LivingEntity extends Entity {
+@@ -3752,6 +3753,38 @@ public abstract class LivingEntity extends Entity {
return level.clip(raytrace);
}
@@ -56,7 +56,7 @@ index 1c35ba0d74aa02b0a94400308c20485ccaad7a13..a7aa62e52105b7adb7725f7abeae376d
public int getShieldBlockingDelay() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
-index 873b70c36d145a14632102c9e92d501745064fa4..c396ad36084e46c4b812d970e07a9188aed16daf 100644
+index 8c01d072287ddd1e73a0043868130e60a78b8c9e..814363d0dee4a91c2e1d5f91e67530fec383c0cb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -1,5 +1,6 @@
diff --git a/patches/server/0297-force-entity-dismount-during-teleportation.patch b/patches/server/0297-force-entity-dismount-during-teleportation.patch
index 934cde4f2c..debf1dcf9d 100644
--- a/patches/server/0297-force-entity-dismount-during-teleportation.patch
+++ b/patches/server/0297-force-entity-dismount-during-teleportation.patch
@@ -20,7 +20,7 @@ this is going to be the best soultion all around.
Improvements/suggestions welcome!
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index d32e6feca6c39a28f80574e4b080ddd4cbb60fdc..42035548577b7c60806a557dd9f9931ca9584e8c 100644
+index b63af81646a468881b32d50cf18abcd4f2c4c84f..a45b21a882b34cce3f36ce71a5f803d53331deb0 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1296,11 +1296,13 @@ public class ServerPlayer extends Player {
@@ -41,7 +41,7 @@ index d32e6feca6c39a28f80574e4b080ddd4cbb60fdc..42035548577b7c60806a557dd9f9931c
if (entity1 != entity && this.connection != null) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index b4f2b969ad30be38c0a9e3f8efd2a57c3e0f7df0..3c7e75b8fc1bfbe08e232fcba412c83f4aba274c 100644
+index 56e0b6d14574a7f66cb7291543aa57cd1d8810ee..929cc28e5ec6df29d099477c0780e39eb755f25b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2245,12 +2245,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -93,10 +93,10 @@ index b4f2b969ad30be38c0a9e3f8efd2a57c3e0f7df0..3c7e75b8fc1bfbe08e232fcba412c83f
if (this.valid) {
Bukkit.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index a7aa62e52105b7adb7725f7abeae376df8f7bb3e..472b8db386dfb580734999900562d358e5ea146a 100644
+index 191c64e54392e63f0993ffb4b07ed5c18112bec9..5a162ebc4c57501a0bec66a9010051283fc210fe 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3335,11 +3335,13 @@ public abstract class LivingEntity extends Entity {
+@@ -3351,11 +3351,13 @@ public abstract class LivingEntity extends Entity {
return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 4) != 0;
}
diff --git a/patches/server/0343-Prevent-consuming-the-wrong-itemstack.patch b/patches/server/0343-Prevent-consuming-the-wrong-itemstack.patch
index e3390da758..3dad25d14e 100644
--- a/patches/server/0343-Prevent-consuming-the-wrong-itemstack.patch
+++ b/patches/server/0343-Prevent-consuming-the-wrong-itemstack.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Prevent consuming the wrong itemstack
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 472b8db386dfb580734999900562d358e5ea146a..55ac5e8cad4c7eee3d8b165698200e9afcd44594 100644
+index 5a162ebc4c57501a0bec66a9010051283fc210fe..04e10f0073ec4cea9a980a89af36327489e173aa 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3554,15 +3554,18 @@ public abstract class LivingEntity extends Entity {
+@@ -3570,15 +3570,18 @@ public abstract class LivingEntity extends Entity {
this.entityData.set(LivingEntity.DATA_LIVING_ENTITY_FLAGS, (byte) j);
}
@@ -31,7 +31,7 @@ index 472b8db386dfb580734999900562d358e5ea146a..55ac5e8cad4c7eee3d8b165698200e9a
}
}
-@@ -3635,6 +3638,7 @@ public abstract class LivingEntity extends Entity {
+@@ -3651,6 +3654,7 @@ public abstract class LivingEntity extends Entity {
this.releaseUsingItem();
} else {
if (!this.useItem.isEmpty() && this.isUsingItem()) {
@@ -39,7 +39,7 @@ index 472b8db386dfb580734999900562d358e5ea146a..55ac5e8cad4c7eee3d8b165698200e9a
this.triggerItemUseEffects(this.useItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
-@@ -3669,8 +3673,8 @@ public abstract class LivingEntity extends Entity {
+@@ -3685,8 +3689,8 @@ public abstract class LivingEntity extends Entity {
}
this.stopUsingItem();
diff --git a/patches/server/0360-Lag-compensate-eating.patch b/patches/server/0360-Lag-compensate-eating.patch
index d8f5ced945..7f97361a7d 100644
--- a/patches/server/0360-Lag-compensate-eating.patch
+++ b/patches/server/0360-Lag-compensate-eating.patch
@@ -7,10 +7,10 @@ When the server is lagging, players will wait longer when eating.
Change to also use a time check instead if it passes.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 55ac5e8cad4c7eee3d8b165698200e9afcd44594..50d180daff7258795d476b9cd43412fba2fba50f 100644
+index 04e10f0073ec4cea9a980a89af36327489e173aa..f02894450715b7d08e13c0c4a95a3079e4a577a4 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3498,6 +3498,11 @@ public abstract class LivingEntity extends Entity {
+@@ -3514,6 +3514,11 @@ public abstract class LivingEntity extends Entity {
return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 2) > 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
}
@@ -22,7 +22,7 @@ index 55ac5e8cad4c7eee3d8b165698200e9afcd44594..50d180daff7258795d476b9cd43412fb
private void updatingUsingItem() {
if (this.isUsingItem()) {
if (ItemStack.isSameIgnoreDurability(this.getItemInHand(this.getUsedItemHand()), this.useItem)) {
-@@ -3515,8 +3520,12 @@ public abstract class LivingEntity extends Entity {
+@@ -3531,8 +3536,12 @@ public abstract class LivingEntity extends Entity {
if (this.shouldTriggerItemUseEffects()) {
this.triggerItemUseEffects(stack, 5);
}
@@ -37,7 +37,7 @@ index 55ac5e8cad4c7eee3d8b165698200e9afcd44594..50d180daff7258795d476b9cd43412fb
this.completeUsingItem();
}
-@@ -3562,7 +3571,10 @@ public abstract class LivingEntity extends Entity {
+@@ -3578,7 +3587,10 @@ public abstract class LivingEntity extends Entity {
if (!itemstack.isEmpty() && !this.isUsingItem() || forceUpdate) { // Paper use override flag
this.useItem = itemstack;
@@ -49,7 +49,7 @@ index 55ac5e8cad4c7eee3d8b165698200e9afcd44594..50d180daff7258795d476b9cd43412fb
if (!this.level.isClientSide) {
this.setLivingEntityFlag(1, true);
this.setLivingEntityFlag(2, enumhand == InteractionHand.OFF_HAND);
-@@ -3586,7 +3598,10 @@ public abstract class LivingEntity extends Entity {
+@@ -3602,7 +3614,10 @@ public abstract class LivingEntity extends Entity {
}
} else if (!this.isUsingItem() && !this.useItem.isEmpty()) {
this.useItem = ItemStack.EMPTY;
@@ -61,7 +61,7 @@ index 55ac5e8cad4c7eee3d8b165698200e9afcd44594..50d180daff7258795d476b9cd43412fb
}
}
-@@ -3712,7 +3727,10 @@ public abstract class LivingEntity extends Entity {
+@@ -3728,7 +3743,10 @@ public abstract class LivingEntity extends Entity {
}
this.useItem = ItemStack.EMPTY;
diff --git a/patches/server/0379-Entity-Jump-API.patch b/patches/server/0379-Entity-Jump-API.patch
index 82f946b3c5..7ba649fb82 100644
--- a/patches/server/0379-Entity-Jump-API.patch
+++ b/patches/server/0379-Entity-Jump-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Entity Jump API
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 7fc15f7731b9a249f5a1b82278c4ad61105462ce..3837cdc92174914e503dc573f496ea3464c7b566 100644
+index f02894450715b7d08e13c0c4a95a3079e4a577a4..8b355064c114fe9b65602024087b6c77fc209cc6 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3165,8 +3165,10 @@ public abstract class LivingEntity extends Entity {
+@@ -3181,8 +3181,10 @@ public abstract class LivingEntity extends Entity {
} else if (this.isInLava() && (!this.onGround || d7 > d8)) {
this.jumpInLiquid((Tag) FluidTags.LAVA);
} else if ((this.onGround || flag && d7 <= d8) && this.noJumpDelay == 0) {
diff --git a/patches/server/0409-Don-t-run-entity-collision-code-if-not-needed.patch b/patches/server/0409-Don-t-run-entity-collision-code-if-not-needed.patch
index 384947eab1..c3afc27f4e 100644
--- a/patches/server/0409-Don-t-run-entity-collision-code-if-not-needed.patch
+++ b/patches/server/0409-Don-t-run-entity-collision-code-if-not-needed.patch
@@ -7,10 +7,10 @@ Will not run if max entity craming is disabled and
the max collisions per entity is less than or equal to 0
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 64403a0a1bddeb1f126b8e315187ea79a859582a..478204aa91d33232f33708816fcc7ea2fe1b55d4 100644
+index 8b355064c114fe9b65602024087b6c77fc209cc6..f63ec915eab78a63eee67560494fea2162caabaf 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3262,10 +3262,16 @@ public abstract class LivingEntity extends Entity {
+@@ -3278,10 +3278,16 @@ public abstract class LivingEntity extends Entity {
protected void serverAiStep() {}
protected void pushEntities() {
diff --git a/patches/server/0418-Add-PlayerAttackEntityCooldownResetEvent.patch b/patches/server/0418-Add-PlayerAttackEntityCooldownResetEvent.patch
index 343e379a58..02c7353565 100644
--- a/patches/server/0418-Add-PlayerAttackEntityCooldownResetEvent.patch
+++ b/patches/server/0418-Add-PlayerAttackEntityCooldownResetEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 478204aa91d33232f33708816fcc7ea2fe1b55d4..fab8098ce72feb9b08960e55ab1a4aebaae22276 100644
+index f63ec915eab78a63eee67560494fea2162caabaf..4755bfe5f49a8d110dfbb20d241c8496a14b0703 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -2040,7 +2040,16 @@ public abstract class LivingEntity extends Entity {
+@@ -2056,7 +2056,16 @@ public abstract class LivingEntity extends Entity {
EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption);
if (damagesource.getEntity() instanceof net.minecraft.world.entity.player.Player) {
diff --git a/patches/server/0421-Fix-numerous-item-duplication-issues-and-teleport-is.patch b/patches/server/0421-Fix-numerous-item-duplication-issues-and-teleport-is.patch
index 9dd3452ca9..a822a1a0c9 100644
--- a/patches/server/0421-Fix-numerous-item-duplication-issues-and-teleport-is.patch
+++ b/patches/server/0421-Fix-numerous-item-duplication-issues-and-teleport-is.patch
@@ -16,7 +16,7 @@ So even if something NEW comes up, it would be impossible to drop the
same item twice because the source was destroyed.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 5802b1721a0d8e1c40d87be099d4f1b1c8a921d7..fbcbe0443f843d04738938f10b433bfe1631fe78 100644
+index de4e47ced31b0711eda98c1cf53c80950a730143..326d00f9889cdca2e5af3ca7f7964cd7b43b3411 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2159,11 +2159,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -79,6 +79,40 @@ index 5802b1721a0d8e1c40d87be099d4f1b1c8a921d7..fbcbe0443f843d04738938f10b433bfe
}
public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) {
+diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
+index 4755bfe5f49a8d110dfbb20d241c8496a14b0703..9c6ed2b6384edf8d507ec70852ea65d988528be6 100644
+--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
+@@ -1626,9 +1626,9 @@ public abstract class LivingEntity extends Entity {
+ // Paper start
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = this.dropAllDeathLoot(source);
+ if (deathEvent == null || !deathEvent.isCancelled()) {
+- if (this.deathScore >= 0 && entityliving != null) {
+- entityliving.awardKillScore(this, this.deathScore, source);
+- }
++ // if (this.deathScore >= 0 && entityliving != null) { // Paper - moved to be run earlier in #dropAllDeathLoot before destroying the drop items in CraftEventFactory#callEntityDeathEvent
++ // entityliving.awardKillScore(this, this.deathScore, source);
++ // }
+ if (this instanceof Mob) { // Clear equipment slots marked as cleared
+ for (EquipmentSlot slot : this.clearedEquipmentSlots) {
+ this.setItemSlot(slot, ItemStack.EMPTY);
+@@ -1723,8 +1723,14 @@ public abstract class LivingEntity extends Entity {
+ this.dropCustomDeathLoot(source, i, flag);
+ this.clearEquipmentSlots = prev; // Paper
+ }
+- // CraftBukkit start - Call death event
+- org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops); // Paper
++ // CraftBukkit start - Call death event // Paper start - run advancement triggers before destroying drop itemstacks
++ org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops, () -> {
++ final LivingEntity entityliving = this.getKillCredit();
++ if (this.deathScore >= 0 && entityliving != null) {
++ entityliving.awardKillScore(this, this.deathScore, source);
++ }
++ });
++ // Paper end
+ this.postDeathDropItems(deathEvent); // Paper
+ this.drops = new ArrayList<>();
+ // CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index b41e6fb0b7e02b50e5ad05555ed911d09055d694..c5e9273055ff7302941b7475d8175be53eaece1f 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -102,10 +136,27 @@ index b41e6fb0b7e02b50e5ad05555ed911d09055d694..c5e9273055ff7302941b7475d8175be5
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-index 4c2ebb2eb93c1f8a805dbe0919f9726ccb4fff1f..54aa3a95118176e7f91f4d669253790167fcd958 100644
+index bf7c61c767bdfe8ddb63367f1b38dbbeba17ba02..4533988489fa2af009ffab95314a2a34344d0b87 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-@@ -827,7 +827,8 @@ public class CraftEventFactory {
+@@ -810,6 +810,11 @@ public class CraftEventFactory {
+ }
+
+ public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, List<org.bukkit.inventory.ItemStack> drops) {
++ // Paper start
++ return CraftEventFactory.callEntityDeathEvent(victim, drops, com.google.common.util.concurrent.Runnables.doNothing());
++ }
++ public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, List<org.bukkit.inventory.ItemStack> drops, Runnable lootCheck) {
++ // Paper end
+ CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity();
+ EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward());
+ populateFields(victim, event); // Paper - make cancellable
+@@ -823,11 +828,13 @@ public class CraftEventFactory {
+ playDeathSound(victim, event);
+ // Paper end
+ victim.expToDrop = event.getDroppedExp();
++ lootCheck.run(); // Paper - run advancement triggers before destroying the equipment stacks below
+
for (org.bukkit.inventory.ItemStack stack : event.getDrops()) {
if (stack == null || stack.getType() == Material.AIR || stack.getAmount() == 0) continue;
diff --git a/patches/server/0484-Add-PrepareResultEvent.patch b/patches/server/0484-Add-PrepareResultEvent.patch
index ba54754ac2..09c094e641 100644
--- a/patches/server/0484-Add-PrepareResultEvent.patch
+++ b/patches/server/0484-Add-PrepareResultEvent.patch
@@ -94,10 +94,10 @@ index 3df5031ec2c50dc6eb2533318cf8a98f21b03d2a..c971a534ded962e3be92c71059c75cc1
private void setupRecipeList(Container input, ItemStack stack) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-index ff2149572a82d6605a0b28f2fdd0dadb86af25a1..869990c181403a025d219dbd0e1201005973ffe9 100644
+index c976bd81d76124b8afd1e25305d51571f08ab3af..dc7d3f57c0e27c5948da66a2a1cacbf40c532e30 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-@@ -1556,19 +1556,44 @@ public class CraftEventFactory {
+@@ -1562,19 +1562,44 @@ public class CraftEventFactory {
return event;
}
diff --git a/patches/server/0486-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch b/patches/server/0486-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch
index c3db540373..20cdaed31d 100644
--- a/patches/server/0486-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch
+++ b/patches/server/0486-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't check chunk for portal on world gen entity add
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index fab8098ce72feb9b08960e55ab1a4aebaae22276..2e7d7bd60ac340568b1bc0f3052affcf445090f7 100644
+index 9c6ed2b6384edf8d507ec70852ea65d988528be6..cb7d46b31575c170dcbda4656b7520ccc2c699ff 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3359,7 +3359,7 @@ public abstract class LivingEntity extends Entity {
+@@ -3381,7 +3381,7 @@ public abstract class LivingEntity extends Entity {
Entity entity = this.getVehicle();
super.stopRiding(suppressCancellation); // Paper - suppress
diff --git a/patches/server/0560-Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/0560-Climbing-should-not-bypass-cramming-gamerule.patch
index c8a88b5795..185cbfdf2f 100644
--- a/patches/server/0560-Climbing-should-not-bypass-cramming-gamerule.patch
+++ b/patches/server/0560-Climbing-should-not-bypass-cramming-gamerule.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Climbing should not bypass cramming gamerule
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-index e1aa521a3947b38643866e038c7d0536658c58f2..a6cfc237fe5e06d43732dcd76b3a52a886ae8fe3 100644
+index 6113aaf4949427b0b5a1cc37013ac46fd93144fe..5143682786c6f046853f723f33bf904e54e8d6fa 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -93,6 +93,11 @@ public class PaperWorldConfig {
@@ -21,7 +21,7 @@ index e1aa521a3947b38643866e038c7d0536658c58f2..a6cfc237fe5e06d43732dcd76b3a52a8
private void keepLoadedRange() {
keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16);
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 368c80ac596b66396985521e6e8c6aee6af26697..7e0f711ded0ecf0b94a79f69a3d75c2afa57c5a9 100644
+index 8174e09d349ec8e01966ca902364eb155e4b8fca..8d34c99af7593c6dff45f8d2b21ae3e5836d6312 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1749,6 +1749,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -61,10 +61,10 @@ index 8fb89326395a7e70982c0d757b506565e98b12a4..a060cca08631fb42041e3a79a9abc422
} else if (entity.level.isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) {
return false;
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 40964014376aa911f412f6a5b717c6cf523530ab..327199d0e002bb7e7c2194fb54c213e837dd8dd8 100644
+index cb7d46b31575c170dcbda4656b7520ccc2c699ff..21e5c87c3d2163f24f0497b4185cd4d971486960 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3277,7 +3277,7 @@ public abstract class LivingEntity extends Entity {
+@@ -3299,7 +3299,7 @@ public abstract class LivingEntity extends Entity {
return;
}
// Paper end - don't run getEntities if we're not going to use its result
@@ -73,7 +73,7 @@ index 40964014376aa911f412f6a5b717c6cf523530ab..327199d0e002bb7e7c2194fb54c213e8
if (!list.isEmpty()) {
// Paper - move up
-@@ -3444,9 +3444,16 @@ public abstract class LivingEntity extends Entity {
+@@ -3466,9 +3466,16 @@ public abstract class LivingEntity extends Entity {
return !this.isRemoved() && this.collides; // CraftBukkit
}
diff --git a/patches/server/0590-Implemented-BlockFailedDispenseEvent.patch b/patches/server/0590-Implemented-BlockFailedDispenseEvent.patch
index 34b1b6a512..551214cba7 100644
--- a/patches/server/0590-Implemented-BlockFailedDispenseEvent.patch
+++ b/patches/server/0590-Implemented-BlockFailedDispenseEvent.patch
@@ -32,10 +32,10 @@ index 51723c8f740c7b0bbd15acc0f1c848790c2ff299..5a95b550c767284563c124df1ff45322
} else {
ItemStack itemstack = tileentitydispenser.getItem(i);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-index aaefea1af4086e74f356bbb09b130a9845fa82f1..31445c2e888d3020c1cba01f208fd60e424fb173 100644
+index aeba8355da7cbe8595b403ea660869d01ae08350..92d970961ea7be9577d7fad452deeeadc535c96b 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-@@ -1830,4 +1830,12 @@ public class CraftEventFactory {
+@@ -1836,4 +1836,12 @@ public class CraftEventFactory {
EntitiesUnloadEvent event = new EntitiesUnloadEvent(new CraftChunk((ServerLevel) world, coords.x, coords.z), bukkitEntities);
Bukkit.getPluginManager().callEvent(event);
}
diff --git a/patches/server/0605-Implement-BlockPreDispenseEvent.patch b/patches/server/0605-Implement-BlockPreDispenseEvent.patch
index d85e167ea5..e1e94e74fa 100644
--- a/patches/server/0605-Implement-BlockPreDispenseEvent.patch
+++ b/patches/server/0605-Implement-BlockPreDispenseEvent.patch
@@ -17,10 +17,10 @@ index 501a5483160dba050261bb3448317a097cdb7ef2..2dcac4b638073aa1748f26f61219dbf9
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-index 70452799bb3436fdb11462f77097ee52d1139f0d..db6b057eb6b0f08f7fcb998f8b646b757a98d3f6 100644
+index 59791b45abe1984c93d2b3b54b67011bbb33086b..a921d98d2bc35e59e948893b2cb034b009db4753 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-@@ -1848,5 +1848,11 @@ public class CraftEventFactory {
+@@ -1854,5 +1854,11 @@ public class CraftEventFactory {
io.papermc.paper.event.block.BlockFailedDispenseEvent event = new io.papermc.paper.event.block.BlockFailedDispenseEvent(block);
return event.callEvent();
}
diff --git a/patches/server/0611-Add-dropLeash-variable-to-EntityUnleashEvent.patch b/patches/server/0611-Add-dropLeash-variable-to-EntityUnleashEvent.patch
index a44fd00d40..266b283a5d 100644
--- a/patches/server/0611-Add-dropLeash-variable-to-EntityUnleashEvent.patch
+++ b/patches/server/0611-Add-dropLeash-variable-to-EntityUnleashEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add dropLeash variable to EntityUnleashEvent
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
-index 976dbf40292b10364f9e80bebe96ec9c4dfb657e..c375081e02925da6085a2d433bfc2c3719770f78 100644
+index 62d296ac82d322f3574021f54779dbb10954397e..79ca304ee934e29145f7fa2fa06cbdc3ba67d54d 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
-@@ -1213,12 +1213,15 @@ public abstract class Mob extends LivingEntity {
+@@ -1219,12 +1219,15 @@ public abstract class Mob extends LivingEntity {
return InteractionResult.PASS;
} else if (this.getLeashHolder() == player) {
// CraftBukkit start - fire PlayerUnleashEntityEvent
@@ -26,7 +26,7 @@ index 976dbf40292b10364f9e80bebe96ec9c4dfb657e..c375081e02925da6085a2d433bfc2c37
return InteractionResult.sidedSuccess(this.level.isClientSide);
} else {
InteractionResult enuminteractionresult = this.checkAndHandleImportantInteractions(player, hand);
-@@ -1376,8 +1379,11 @@ public abstract class Mob extends LivingEntity {
+@@ -1382,8 +1385,11 @@ public abstract class Mob extends LivingEntity {
if (this.leashHolder != null) {
if (!this.isAlive() || !this.leashHolder.isAlive()) {
@@ -40,7 +40,7 @@ index 976dbf40292b10364f9e80bebe96ec9c4dfb657e..c375081e02925da6085a2d433bfc2c37
}
}
-@@ -1440,8 +1446,11 @@ public abstract class Mob extends LivingEntity {
+@@ -1446,8 +1452,11 @@ public abstract class Mob extends LivingEntity {
boolean flag1 = super.startRiding(entity, force);
if (flag1 && this.isLeashed()) {
@@ -54,7 +54,7 @@ index 976dbf40292b10364f9e80bebe96ec9c4dfb657e..c375081e02925da6085a2d433bfc2c37
}
return flag1;
-@@ -1611,8 +1620,11 @@ public abstract class Mob extends LivingEntity {
+@@ -1617,8 +1626,11 @@ public abstract class Mob extends LivingEntity {
@Override
protected void removeAfterChangingDimensions() {
super.removeAfterChangingDimensions();
@@ -122,10 +122,10 @@ index b9b67134f02fd7484ed19905c9ae1f9b8a26ce26..c05f173b7642380900fdd77ce5d2c020
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-index db6b057eb6b0f08f7fcb998f8b646b757a98d3f6..33a8e174c4e3b3b5164157c90c8f5b5f9c6d8263 100644
+index a921d98d2bc35e59e948893b2cb034b009db4753..ae3ee371530a52d9a2b12e5c18fd85f6da6fc2de 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-@@ -1489,8 +1489,10 @@ public class CraftEventFactory {
+@@ -1495,8 +1495,10 @@ public class CraftEventFactory {
return itemInHand;
}
diff --git a/patches/server/0615-EntityMoveEvent.patch b/patches/server/0615-EntityMoveEvent.patch
index d08300cf38..c7efef70ff 100644
--- a/patches/server/0615-EntityMoveEvent.patch
+++ b/patches/server/0615-EntityMoveEvent.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] EntityMoveEvent
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index d37b14523dd2a0e6412449001c7876bd27bf760e..f3976a53514249e64d91075ec2e620e4c7cef37f 100644
+index 13d3e1a07ea4ac2ef0f043486181daf23633cb32..3704d4b00a819c4d23b1c77c3e61958b45bba85c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1527,6 +1527,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -17,7 +17,7 @@ index d37b14523dd2a0e6412449001c7876bd27bf760e..f3976a53514249e64d91075ec2e620e4
this.profiler.push(() -> {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 073dbf69b5b58c4351110d28491e7feb2e47081c..c58b0de1cf1c51ceb0a0ecc145f4a98929521934 100644
+index ec583ee3b9e0ffed230f219283e384035e73828d..09474f7e973563585e102cc839ab6842a3a10c0c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -197,6 +197,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -29,10 +29,10 @@ index 073dbf69b5b58c4351110d28491e7feb2e47081c..c58b0de1cf1c51ceb0a0ecc145f4a989
return new Throwable(entity + " Added to world at " + new java.util.Date());
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index e3d8557733e20a51bb71d9c968f4f12cc3192624..8ce983822ab44ade6306b52cad352ad95f6d6bad 100644
+index 21e5c87c3d2163f24f0497b4185cd4d971486960..b04d3b86931f3c0b6560a4af8f3793d0a19a317f 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3223,6 +3223,20 @@ public abstract class LivingEntity extends Entity {
+@@ -3245,6 +3245,20 @@ public abstract class LivingEntity extends Entity {
this.pushEntities();
this.level.getProfiler().pop();
diff --git a/patches/server/0650-Fix-PlayerItemConsumeEvent-cancelling-properly.patch b/patches/server/0650-Fix-PlayerItemConsumeEvent-cancelling-properly.patch
index 7454a65a68..ae22a31e73 100644
--- a/patches/server/0650-Fix-PlayerItemConsumeEvent-cancelling-properly.patch
+++ b/patches/server/0650-Fix-PlayerItemConsumeEvent-cancelling-properly.patch
@@ -9,10 +9,10 @@ till their item is switched.
This patch clears the active item when the event is cancelled
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 8ce983822ab44ade6306b52cad352ad95f6d6bad..b84e20cd955fd75582a2c52f0c571d54ead555b2 100644
+index b04d3b86931f3c0b6560a4af8f3793d0a19a317f..2ec47f83ab238edbd9abe7efded86852329bce95 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3702,6 +3702,7 @@ public abstract class LivingEntity extends Entity {
+@@ -3724,6 +3724,7 @@ public abstract class LivingEntity extends Entity {
level.getCraftServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
diff --git a/patches/server/0702-Line-Of-Sight-Changes.patch b/patches/server/0702-Line-Of-Sight-Changes.patch
index 6ff2325313..f1820a6193 100644
--- a/patches/server/0702-Line-Of-Sight-Changes.patch
+++ b/patches/server/0702-Line-Of-Sight-Changes.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Line Of Sight Changes
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index b84e20cd955fd75582a2c52f0c571d54ead555b2..a60d289f3cf3826ac5368f3de77584fb63bf5e64 100644
+index 2ec47f83ab238edbd9abe7efded86852329bce95..692bef7e1c0350c826a2961217e9c0f96c1eec70 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3430,7 +3430,8 @@ public abstract class LivingEntity extends Entity {
+@@ -3452,7 +3452,8 @@ public abstract class LivingEntity extends Entity {
Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ());
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
@@ -42,7 +42,7 @@ index 483ca752016c0d5e669b462396e50e83b66d3ef1..6a4c379a2905455b14c3cbd4a46a0f95
private static final Random rand = new Random();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
-index 20e619baa4bce6a133ade5e5d6a6f04f49a1b176..1c684244213d04b36589dd50ea66052a9cdad072 100644
+index ee63e6a650f93c973ffb2034e04b974cc1350540..675faa296d4da33db9fce9625d480a79103ffa10 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -29,6 +29,9 @@ import net.minecraft.world.entity.projectile.ThrownEgg;
diff --git a/patches/server/0721-Add-a-bunch-of-missing-forceDrop-toggles.patch b/patches/server/0721-Add-a-bunch-of-missing-forceDrop-toggles.patch
index 946acb8cc9..46bd42ca2e 100644
--- a/patches/server/0721-Add-a-bunch-of-missing-forceDrop-toggles.patch
+++ b/patches/server/0721-Add-a-bunch-of-missing-forceDrop-toggles.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add a bunch of missing forceDrop toggles
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
-index c375081e02925da6085a2d433bfc2c3719770f78..a8e5be1c941755b3e5b335d8211ca70a6c6fc32f 100644
+index 79ca304ee934e29145f7fa2fa06cbdc3ba67d54d..19acb348bdb950ffeb3803feec24245699a2b4fc 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
-@@ -1474,7 +1474,9 @@ public abstract class Mob extends LivingEntity {
+@@ -1480,7 +1480,9 @@ public abstract class Mob extends LivingEntity {
}
if (this.tickCount > 100) {
diff --git a/patches/server/0727-Improve-boat-collision-performance.patch b/patches/server/0727-Improve-boat-collision-performance.patch
index 1f77e7c704..c8923cfe57 100644
--- a/patches/server/0727-Improve-boat-collision-performance.patch
+++ b/patches/server/0727-Improve-boat-collision-performance.patch
@@ -17,7 +17,7 @@ index 81f4f26a6b83079d36acd1fd86dede0eb1116c01..59437f04911662f06596ef61b91017ca
public static <K, V> Collector<Entry<? extends K, ? extends V>, ?, Map<K, V>> toMap() {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 38e8d8c7d37fc824323dac372c56550480360515..1018f4640bab5876c5e0afb5b88f71437fb79662 100644
+index eda7e3ee1f44eb0677a357fb06c59a8954986fc1..df3459ecd78b915f8f1b2b9825fc5e423cd332b6 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1321,7 +1321,7 @@ public abstract class LivingEntity extends Entity {
@@ -44,7 +44,7 @@ index 38e8d8c7d37fc824323dac372c56550480360515..1018f4640bab5876c5e0afb5b88f7143
d0 = (Math.random() - Math.random()) * 0.01D;
}
-@@ -2086,7 +2087,7 @@ public abstract class LivingEntity extends Entity {
+@@ -2108,7 +2109,7 @@ public abstract class LivingEntity extends Entity {
this.hurtCurrentlyUsedShield((float) -event.getDamage(DamageModifier.BLOCKING));
Entity entity = damagesource.getDirectEntity();
diff --git a/patches/server/0738-Make-EntityUnleashEvent-cancellable.patch b/patches/server/0738-Make-EntityUnleashEvent-cancellable.patch
index d76f60ac65..1af7379248 100644
--- a/patches/server/0738-Make-EntityUnleashEvent-cancellable.patch
+++ b/patches/server/0738-Make-EntityUnleashEvent-cancellable.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Make EntityUnleashEvent cancellable
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
-index a8e5be1c941755b3e5b335d8211ca70a6c6fc32f..bada11542390b7575466f0e7062470665b8266c4 100644
+index 19acb348bdb950ffeb3803feec24245699a2b4fc..6cde7bde7a8675b9956e2eb420250e740379c3c3 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
-@@ -1448,7 +1448,7 @@ public abstract class Mob extends LivingEntity {
+@@ -1454,7 +1454,7 @@ public abstract class Mob extends LivingEntity {
if (flag1 && this.isLeashed()) {
// Paper start - drop leash variable
EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN, true);
diff --git a/patches/server/0830-Add-critical-damage-API.patch b/patches/server/0830-Add-critical-damage-API.patch
index 24e67d23bf..6c1ebf4e19 100644
--- a/patches/server/0830-Add-critical-damage-API.patch
+++ b/patches/server/0830-Add-critical-damage-API.patch
@@ -29,10 +29,10 @@ index 80d19af2ad423bd3de0e039c5bb8f97af536aaa9..a828cad27fcd39f8bfbaefa97052a2a3
public static DamageSource sting(LivingEntity attacker) {
return new EntityDamageSource("sting", attacker);
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index fa904d0477fabc20ce9830d85c840426b94950ac..465dab588e770bf4d1e645e1f451a066f388014a 100644
+index df3459ecd78b915f8f1b2b9825fc5e423cd332b6..7d2e106931f6d3eef5159eca9621bf158ee726c4 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -2571,15 +2571,27 @@ public abstract class LivingEntity extends Entity {
+@@ -2593,15 +2593,27 @@ public abstract class LivingEntity extends Entity {
return this.hasEffect(MobEffects.JUMP) ? (double) (0.1F * (float) (this.getEffect(MobEffects.JUMP).getAmplifier() + 1)) : 0.0D;
}
@@ -105,10 +105,10 @@ index 6636845ea044c3810e1880aad8b679134cd33668..52e4948fd1657fa1776ac6b0142e8c21
int k = entity.getRemainingFireTicks();
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-index 5013a93f9bdc6d2c52239ca0434c7aa40f0572e1..aaf47d3f58819ead3553973c159c5c6eec4abe43 100644
+index f6f6e061169628bd48fb7e6056dbff1f5ce6c0a2..ea01507f96d81c6fbcfeb65902017bbc332de650 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-@@ -964,7 +964,7 @@ public class CraftEventFactory {
+@@ -970,7 +970,7 @@ public class CraftEventFactory {
} else {
damageCause = DamageCause.ENTITY_EXPLOSION;
}
@@ -117,7 +117,7 @@ index 5013a93f9bdc6d2c52239ca0434c7aa40f0572e1..aaf47d3f58819ead3553973c159c5c6e
}
event.setCancelled(cancelled);
-@@ -989,7 +989,7 @@ public class CraftEventFactory {
+@@ -995,7 +995,7 @@ public class CraftEventFactory {
cause = DamageCause.THORNS;
}
@@ -126,7 +126,7 @@ index 5013a93f9bdc6d2c52239ca0434c7aa40f0572e1..aaf47d3f58819ead3553973c159c5c6e
} else if (source == DamageSource.OUT_OF_WORLD) {
EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions);
event.setCancelled(cancelled);
-@@ -1044,7 +1044,7 @@ public class CraftEventFactory {
+@@ -1050,7 +1050,7 @@ public class CraftEventFactory {
} else {
throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager.getHandle(), source.msgId));
}
@@ -135,7 +135,7 @@ index 5013a93f9bdc6d2c52239ca0434c7aa40f0572e1..aaf47d3f58819ead3553973c159c5c6e
event.setCancelled(cancelled);
CraftEventFactory.callEvent(event);
if (!event.isCancelled()) {
-@@ -1087,20 +1087,28 @@ public class CraftEventFactory {
+@@ -1093,20 +1093,28 @@ public class CraftEventFactory {
}
if (cause != null) {