From 09d49ff9feef42383186369194b9566545c820ca Mon Sep 17 00:00:00 2001 From: Noah van der Aa Date: Mon, 29 Apr 2024 23:25:53 +0200 Subject: [PATCH] Fix BlockExplodeEvent stuff --- ...ck-state-to-BlockExplodeEvent-and-En.patch | 12 +--- ...ck-state-to-BlockExplodeEvent-and-En.patch | 64 +------------------ .../0821-Add-EntityFertilizeEggEvent.patch | 2 +- ...-Fix-a-couple-of-upstream-bed-issues.patch | 8 +-- .../0842-Expand-PlayerItemMendEvent.patch | 2 +- ...0857-Call-missing-BlockDispenseEvent.patch | 2 +- ...enceOrb-should-call-EntitySpawnEvent.patch | 2 +- ...91-Add-BlockFace-to-BlockDamageEvent.patch | 2 +- ...-titleOverride-to-InventoryOpenEvent.patch | 2 +- ...estore-vanilla-entity-drops-behavior.patch | 2 +- .../0943-Add-drops-to-shear-events.patch | 2 +- .../server/0969-Fix-DamageSource-API.patch | 10 +-- ...met-damage-reduction-inconsistencies.patch | 2 +- 13 files changed, 23 insertions(+), 89 deletions(-) diff --git a/patches/api/0394-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch b/patches/api/0394-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch index f81be68815..e788ef02f6 100644 --- a/patches/api/0394-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch +++ b/patches/api/0394-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add exploded block state to BlockExplodeEvent and diff --git a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java -index 8309b030c2120f1496d244f3ebc1094def41c869..b8bc5718dc1325f0b9d413851c486d91603c3ab4 100644 +index 8309b030c2120f1496d244f3ebc1094def41c869..c924279a84a1979517a7b79936966c5c543df2a8 100644 --- a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java @@ -13,9 +13,6 @@ import org.jetbrains.annotations.NotNull; @@ -19,18 +19,10 @@ index 8309b030c2120f1496d244f3ebc1094def41c869..b8bc5718dc1325f0b9d413851c486d91 */ public class BlockExplodeEvent extends BlockEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); -@@ -32,6 +29,15 @@ public class BlockExplodeEvent extends BlockEvent implements Cancellable { +@@ -32,6 +29,7 @@ public class BlockExplodeEvent extends BlockEvent implements Cancellable { this.cancel = false; } -+ // Paper start -+ @io.papermc.paper.annotation.DoNotUse -+ @Deprecated(forRemoval = true) -+ public BlockExplodeEvent(@NotNull final Block what, @NotNull final List blocks, final float yield, @org.jetbrains.annotations.Nullable org.bukkit.block.BlockState explodedBlockState) { -+ this(what, explodedBlockState != null ? explodedBlockState : what.getState(), blocks, yield); -+ } -+ // Paper end -+ + @io.papermc.paper.annotation.DoNotUse // Paper @Deprecated(forRemoval = true) public BlockExplodeEvent(@NotNull final Block what, @NotNull final List blocks, final float yield) { diff --git a/patches/server/0812-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch b/patches/server/0812-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch index d71675e351..e4d0a1d431 100644 --- a/patches/server/0812-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch +++ b/patches/server/0812-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch @@ -5,26 +5,6 @@ Subject: [PATCH] Add exploded block state to BlockExplodeEvent and EntityDamageByBlockEvent -diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -index ffb7c966617bdfa2c3f05ec4e753e32996493343..74e9fb1e9172c2c20158514420467b291b10b40f 100644 ---- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java -+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -@@ -21,6 +21,7 @@ public class DamageSource { - private final Entity directEntity; - @Nullable - private final Vec3 damageSourcePosition; -+ public org.bukkit.block.BlockState explodedBlockState; // Paper - add exploded state - // CraftBukkit start - @Nullable - private org.bukkit.block.Block directBlock; // The block that caused the damage. damageSourcePosition is not used for all block damages -@@ -96,6 +97,7 @@ public class DamageSource { - - private DamageSource cloneInstance() { - DamageSource damageSource = new DamageSource(this.type, this.directEntity, this.causingEntity, this.damageSourcePosition); -+ damageSource.explodedBlockState = this.explodedBlockState; // Paper - Include explodedBlockState when clone this instance of DamageSource - damageSource.directBlock = this.getDirectBlock(); - damageSource.withSweep = this.isSweep(); - damageSource.poison = this.isPoison(); diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSources.java b/src/main/java/net/minecraft/world/damagesource/DamageSources.java index 89928dad3182a0131c3fba19c9c131d6997028eb..f30b5c355e979e7782a046ebb111e472d39b132d 100644 --- a/src/main/java/net/minecraft/world/damagesource/DamageSources.java @@ -46,46 +26,8 @@ index 89928dad3182a0131c3fba19c9c131d6997028eb..f30b5c355e979e7782a046ebb111e472 } return damageSource; // CraftBukkit end -diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java -index c353643a9c9b400d351ef49e1b7d4f516ed0b0eb..eea868abd226b5c1862e69244af87e279284c151 100644 ---- a/src/main/java/net/minecraft/world/level/block/BedBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java -@@ -95,6 +95,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock - - // CraftBukkit - moved world and biome check into EntityHuman - if (false && !BedBlock.canSetSpawn(world)) { -+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getUnplacedBlockState(world, pos, state); // Paper - add exploded state (this won't be called due to the false, but it's good for reference) - world.removeBlock(pos, false); - BlockPos blockposition1 = pos.relative(((Direction) state.getValue(BedBlock.FACING)).getOpposite()); - -@@ -104,7 +105,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock - - Vec3 vec3d = pos.getCenter(); - -- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); -+ world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - add exploded state - return InteractionResult.SUCCESS; - } else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) { - if (!this.kickVillagerOutOfBed(world, pos)) { -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -index 411c2de93c71e480f95229c882cdf43b8801edc8..489c17d002a5c3580637fda1c51f1bd63814bfa0 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -@@ -291,6 +291,12 @@ public final class CraftBlockStates { - BlockEntity tileEntity = (blockEntityTag == null) ? null : BlockEntity.loadStatic(blockPosition, blockData, blockEntityTag, registry); - return CraftBlockStates.getBlockState(null, blockPosition, blockData, tileEntity); - } -+ // Paper start - add exploded state -+ public static BlockState getUnplacedBlockState(net.minecraft.world.level.BlockGetter levelAccessor, BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockData) { -+ BlockEntity tileEntity = levelAccessor.getBlockEntity(blockPos); -+ return CraftBlockStates.getBlockState(null, blockPos, blockData, tileEntity); -+ } -+ // Paper end - add exploded state - - // See BlockStateFactory#createBlockState(World, BlockPosition, IBlockData, TileEntity) - private static CraftBlockState getBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index c52cb55cd1da988ec646e4e1484ec1a72513291d..a226b7cdc9c63ef09d7d48269c287af1ab6dbdc4 100644 +index c52cb55cd1da988ec646e4e1484ec1a72513291d..0ab1cf162016422007426698dec60ffd875631a0 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1070,7 +1070,7 @@ public class CraftEventFactory { @@ -93,7 +35,7 @@ index c52cb55cd1da988ec646e4e1484ec1a72513291d..a226b7cdc9c63ef09d7d48269c287af1 if (source.is(DamageTypeTags.IS_EXPLOSION)) { if (damager == null) { - return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled); -+ return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.explodedBlockState); // Paper - Include BlockState for damage ++ return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.blockState); // Paper - Include BlockState for damage } DamageCause damageCause = (damager.getBukkitEntity() instanceof org.bukkit.entity.TNTPrimed) ? DamageCause.BLOCK_EXPLOSION : DamageCause.ENTITY_EXPLOSION; return CraftEventFactory.callEntityDamageEvent(damager, entity, damageCause, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API @@ -102,7 +44,7 @@ index c52cb55cd1da988ec646e4e1484ec1a72513291d..a226b7cdc9c63ef09d7d48269c287af1 throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, source.getDirectBlock(), source.getMsgId())); } - return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, cause, bukkitDamageSource, modifiers, modifierFunctions, cancelled); -+ return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, cause, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.explodedBlockState); // Paper - Include BlockState for damage ++ return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, cause, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.blockState); // Paper - Include BlockState for damage } DamageCause cause; diff --git a/patches/server/0821-Add-EntityFertilizeEggEvent.patch b/patches/server/0821-Add-EntityFertilizeEggEvent.patch index 4936a75506..9121d938b7 100644 --- a/patches/server/0821-Add-EntityFertilizeEggEvent.patch +++ b/patches/server/0821-Add-EntityFertilizeEggEvent.patch @@ -69,7 +69,7 @@ index a0c52ce65d4035d135b1536c7408a6867a553447..dc035bf94c5f6574ed8ad369b327b7f7 this.playSound(SoundEvents.SNIFFER_EGG_PLOP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 0.5F); } // Paper - Call EntityDropItemEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index a226b7cdc9c63ef09d7d48269c287af1ab6dbdc4..e9a70547324dabd97dc90820515a11d2b630a704 100644 +index 0ab1cf162016422007426698dec60ffd875631a0..160ebf499b2f088a3fb1ca683e3d7b02acbd548f 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -2109,4 +2109,28 @@ public class CraftEventFactory { diff --git a/patches/server/0836-Fix-a-couple-of-upstream-bed-issues.patch b/patches/server/0836-Fix-a-couple-of-upstream-bed-issues.patch index be595ce45e..c39d5850ee 100644 --- a/patches/server/0836-Fix-a-couple-of-upstream-bed-issues.patch +++ b/patches/server/0836-Fix-a-couple-of-upstream-bed-issues.patch @@ -10,18 +10,18 @@ but then replaced it with a bed, you could respawn at the bed in that world. diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java -index eea868abd226b5c1862e69244af87e279284c151..83b5eeaf67520cc7dfa67ebac7f6eccfdf823372 100644 +index c353643a9c9b400d351ef49e1b7d4f516ed0b0eb..f726c3839ab93cc81fee26bfeb821bead3533b5e 100644 --- a/src/main/java/net/minecraft/world/level/block/BedBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java -@@ -108,6 +108,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock - world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - add exploded state +@@ -107,6 +107,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock + world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); return InteractionResult.SUCCESS; } else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) { + if (!BedBlock.canSetSpawn(world)) return this.explodeBed(state, world, pos); // Paper - check explode first if (!this.kickVillagerOutOfBed(world, pos)) { player.displayClientMessage(Component.translatable("block.minecraft.bed.occupied"), true); } -@@ -164,8 +165,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -163,8 +164,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock // CraftBukkit end public static boolean canSetSpawn(Level world) { diff --git a/patches/server/0842-Expand-PlayerItemMendEvent.patch b/patches/server/0842-Expand-PlayerItemMendEvent.patch index 617b45a407..02f6324ef9 100644 --- a/patches/server/0842-Expand-PlayerItemMendEvent.patch +++ b/patches/server/0842-Expand-PlayerItemMendEvent.patch @@ -51,7 +51,7 @@ index 37c23923ebd4dfd6405d3c19fa42609fc683a42e..7c039d79b6fba3358daaaf8894e05d94 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index e9a70547324dabd97dc90820515a11d2b630a704..c1b5d9713cb301dc06b74d97dca4fd5562c539e2 100644 +index 160ebf499b2f088a3fb1ca683e3d7b02acbd548f..c8627846dc213f2230327e37ac1114d5cd7447ef 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1267,10 +1267,10 @@ public class CraftEventFactory { diff --git a/patches/server/0857-Call-missing-BlockDispenseEvent.patch b/patches/server/0857-Call-missing-BlockDispenseEvent.patch index f018b2ae74..11a27bb794 100644 --- a/patches/server/0857-Call-missing-BlockDispenseEvent.patch +++ b/patches/server/0857-Call-missing-BlockDispenseEvent.patch @@ -50,7 +50,7 @@ index 9507dbbb4b490149b9248c384be5adaccae40c41..5bbadc890a72f1cb22c6881ebcc163b0 for (int k = 0; k < 5; ++k) { worldserver.sendParticles(ParticleTypes.SPLASH, (double) blockposition.getX() + worldserver.random.nextDouble(), (double) (blockposition.getY() + 1), (double) blockposition.getZ() + worldserver.random.nextDouble(), 1, 0.0D, 0.0D, 0.0D, 1.0D); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index c1b5d9713cb301dc06b74d97dca4fd5562c539e2..27bafd5349805171399dbd141f5c568ec35286f4 100644 +index c8627846dc213f2230327e37ac1114d5cd7447ef..3679bc4573346666088995903a3418c359444532 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -2110,6 +2110,32 @@ public class CraftEventFactory { diff --git a/patches/server/0866-ExperienceOrb-should-call-EntitySpawnEvent.patch b/patches/server/0866-ExperienceOrb-should-call-EntitySpawnEvent.patch index 96941a19e5..e5768c83cb 100644 --- a/patches/server/0866-ExperienceOrb-should-call-EntitySpawnEvent.patch +++ b/patches/server/0866-ExperienceOrb-should-call-EntitySpawnEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] ExperienceOrb should call EntitySpawnEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 27bafd5349805171399dbd141f5c568ec35286f4..5af62603415865068ca4b79a7e68d8eb813596b1 100644 +index 3679bc4573346666088995903a3418c359444532..d3b85371b014e462b3bd53ec179214c17640ef72 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -735,7 +735,8 @@ public class CraftEventFactory { diff --git a/patches/server/0891-Add-BlockFace-to-BlockDamageEvent.patch b/patches/server/0891-Add-BlockFace-to-BlockDamageEvent.patch index 3af304961a..cbd04c8454 100644 --- a/patches/server/0891-Add-BlockFace-to-BlockDamageEvent.patch +++ b/patches/server/0891-Add-BlockFace-to-BlockDamageEvent.patch @@ -18,7 +18,7 @@ index 7b4426ac0435d3f419d9ece29dc9eccdb8f99950..cef3a64b5e6c4d34ed079078420078a7 if (blockEvent.isCancelled()) { // Let the client know the block still exists diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 5af62603415865068ca4b79a7e68d8eb813596b1..47a02b7786d284370d8019b07b8d85f895dc280a 100644 +index d3b85371b014e462b3bd53ec179214c17640ef72..f883781f88fdc00a8c9a789b135569ac805b6860 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -650,13 +650,13 @@ public class CraftEventFactory { diff --git a/patches/server/0901-Add-titleOverride-to-InventoryOpenEvent.patch b/patches/server/0901-Add-titleOverride-to-InventoryOpenEvent.patch index 157d433e22..94d372fe34 100644 --- a/patches/server/0901-Add-titleOverride-to-InventoryOpenEvent.patch +++ b/patches/server/0901-Add-titleOverride-to-InventoryOpenEvent.patch @@ -79,7 +79,7 @@ index 3d36d79a4e7f16f6face3465cdf54656984f3ebc..41f3cdec7deabf34358b8087df77169f if (!player.isImmobile()) player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, io.papermc.paper.adventure.PaperAdventure.asVanilla(adventure$title))); // Paper - Prevent opening inventories when frozen player.containerMenu = container; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 47a02b7786d284370d8019b07b8d85f895dc280a..eefdb3da069d9615db7c663bcf8a72b78a0e6817 100644 +index f883781f88fdc00a8c9a789b135569ac805b6860..da89b73b08b27ec979545e825efe15aec5cf3af2 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1384,10 +1384,21 @@ public class CraftEventFactory { diff --git a/patches/server/0937-Restore-vanilla-entity-drops-behavior.patch b/patches/server/0937-Restore-vanilla-entity-drops-behavior.patch index 1b3e74a14f..0360231caf 100644 --- a/patches/server/0937-Restore-vanilla-entity-drops-behavior.patch +++ b/patches/server/0937-Restore-vanilla-entity-drops-behavior.patch @@ -165,7 +165,7 @@ index b1b0b0554e0ad035463fd53aa440d9c079b7cfb4..2ed6845f16fab175e2e9e96e76391e63 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index eefdb3da069d9615db7c663bcf8a72b78a0e6817..822bfebc779646dde655239ac217bad011a9eee4 100644 +index da89b73b08b27ec979545e825efe15aec5cf3af2..fe2fd48e8e8c7d5aed409605dda969d9017889d0 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -964,17 +964,23 @@ public class CraftEventFactory { diff --git a/patches/server/0943-Add-drops-to-shear-events.patch b/patches/server/0943-Add-drops-to-shear-events.patch index 2c756b4953..40a0413a25 100644 --- a/patches/server/0943-Add-drops-to-shear-events.patch +++ b/patches/server/0943-Add-drops-to-shear-events.patch @@ -271,7 +271,7 @@ index 9c0bfddd479eef688d2509ad700371c3c860ff1a..754eb747179d9318bc5a3883e5622cc4 public boolean readyForShearing() { return !this.isSheared() && this.isAlive(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 822bfebc779646dde655239ac217bad011a9eee4..444287fea080182df533198f5c659533de86c5dc 100644 +index fe2fd48e8e8c7d5aed409605dda969d9017889d0..31bc4a0408da3bf3b0d8eb56b045e9742a898a39 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1669,20 +1669,20 @@ public class CraftEventFactory { diff --git a/patches/server/0969-Fix-DamageSource-API.patch b/patches/server/0969-Fix-DamageSource-API.patch index 6bd800ff4e..5cb5829aa4 100644 --- a/patches/server/0969-Fix-DamageSource-API.patch +++ b/patches/server/0969-Fix-DamageSource-API.patch @@ -7,10 +7,10 @@ Uses the correct entity in the EntityDamageByEntity event Returns the correct entity for API's DamageSource#getCausingEntity diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -index 74e9fb1e9172c2c20158514420467b291b10b40f..df1ac533a1469a22557d66682aa8a0e64f317dca 100644 +index ffb7c966617bdfa2c3f05ec4e753e32996493343..359a2f0492a9b938a4f015c546e100e0092ae1d4 100644 --- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java +++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -@@ -30,7 +30,8 @@ public class DamageSource { +@@ -29,7 +29,8 @@ public class DamageSource { private boolean withSweep = false; private boolean melting = false; private boolean poison = false; @@ -20,7 +20,7 @@ index 74e9fb1e9172c2c20158514420467b291b10b40f..df1ac533a1469a22557d66682aa8a0e6 public DamageSource sweep() { this.withSweep = true; -@@ -59,18 +60,18 @@ public class DamageSource { +@@ -58,18 +59,18 @@ public class DamageSource { return this.poison; } @@ -190,7 +190,7 @@ index 4c6e15535fa40aad8cf1920f392589404f9ba79c..35eb95ef6fb6a0f7ea63351e90741c48 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 444287fea080182df533198f5c659533de86c5dc..544567e576023709f86abf57963c37a5490ab9f0 100644 +index 31bc4a0408da3bf3b0d8eb56b045e9742a898a39..92a9643a31d3b753c997854a0db0ceabe883fd29 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1082,7 +1082,7 @@ public class CraftEventFactory { @@ -201,4 +201,4 @@ index 444287fea080182df533198f5c659533de86c5dc..544567e576023709f86abf57963c37a5 + final Entity damager = source.getCustomEventDamager(); // Paper - fix DamageSource API if (source.is(DamageTypeTags.IS_EXPLOSION)) { if (damager == null) { - return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.explodedBlockState); // Paper - Include BlockState for damage + return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.blockState); // Paper - Include BlockState for damage diff --git a/patches/server/1042-Fix-helmet-damage-reduction-inconsistencies.patch b/patches/server/1042-Fix-helmet-damage-reduction-inconsistencies.patch index 38d5a20724..f5b5797303 100644 --- a/patches/server/1042-Fix-helmet-damage-reduction-inconsistencies.patch +++ b/patches/server/1042-Fix-helmet-damage-reduction-inconsistencies.patch @@ -7,7 +7,7 @@ Affect the falling stalactite damage type where the reduction is not applied like in Vanilla diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 544567e576023709f86abf57963c37a5490ab9f0..5a9c68b60cf3bf694fe1fcd3b095516b6481f8a2 100644 +index 92a9643a31d3b753c997854a0db0ceabe883fd29..547ab158cd0cbf51da06ea97740cfce34bca651b 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1215,7 +1215,7 @@ public class CraftEventFactory {