Resend frozen ticks when cancelling EntityInsideBlockEvent for powder snow fixes #13033 (#13035)

This commit is contained in:
Jason Penilla
2025-08-28 18:11:29 -07:00
committed by GitHub
parent 9d1d0ef3f3
commit 704107c3dd
2 changed files with 8 additions and 2 deletions
+1
View File
@@ -188,6 +188,7 @@ public net.minecraft.world.entity.Display$TextDisplay getTextOpacity()B
public net.minecraft.world.entity.Display$TextDisplay setFlags(B)V public net.minecraft.world.entity.Display$TextDisplay setFlags(B)V
public net.minecraft.world.entity.Display$TextDisplay setText(Lnet/minecraft/network/chat/Component;)V public net.minecraft.world.entity.Display$TextDisplay setText(Lnet/minecraft/network/chat/Component;)V
public net.minecraft.world.entity.Display$TextDisplay setTextOpacity(B)V public net.minecraft.world.entity.Display$TextDisplay setTextOpacity(B)V
public net.minecraft.world.entity.Entity DATA_TICKS_FROZEN
public net.minecraft.world.entity.Entity FLAG_INVISIBLE public net.minecraft.world.entity.Entity FLAG_INVISIBLE
public net.minecraft.world.entity.Entity getEncodeId()Ljava/lang/String; public net.minecraft.world.entity.Entity getEncodeId()Ljava/lang/String;
public net.minecraft.world.entity.Entity getFireImmuneTicks()I public net.minecraft.world.entity.Entity getFireImmuneTicks()I
@@ -1,10 +1,15 @@
--- a/net/minecraft/world/level/block/PowderSnowBlock.java --- a/net/minecraft/world/level/block/PowderSnowBlock.java
+++ b/net/minecraft/world/level/block/PowderSnowBlock.java +++ b/net/minecraft/world/level/block/PowderSnowBlock.java
@@ -60,6 +_,7 @@ @@ -60,6 +_,12 @@
@Override @Override
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier) { protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier) {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent + // Paper start - Add EntityInsideBlockEvent
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) {
+ entity.getEntityData().markDirty(net.minecraft.world.entity.Entity.DATA_TICKS_FROZEN); // prevent desync on cancelled event
+ return;
+ }
+ // Paper end - Add EntityInsideBlockEvent
if (!(entity instanceof LivingEntity) || entity.getInBlockState().is(this)) { if (!(entity instanceof LivingEntity) || entity.getInBlockState().is(this)) {
entity.makeStuckInBlock(state, new Vec3(0.9F, 1.5, 0.9F)); entity.makeStuckInBlock(state, new Vec3(0.9F, 1.5, 0.9F));
if (level.isClientSide) { if (level.isClientSide) {