aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/monster/Ravager.java.patch
blob: 052e734c64dc9f335a9342c364a53a056d5aba47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- a/net/minecraft/world/entity/monster/Ravager.java
+++ b/net/minecraft/world/entity/monster/Ravager.java
@@ -41,6 +43,10 @@
 import net.minecraft.world.phys.Vec3;
 import org.joml.Vector3f;
 
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end
+
 public class Ravager extends Raider {
     private static final Predicate<Entity> NO_RAVAGER_AND_ALIVE = entity -> entity.isAlive() && !(entity instanceof Ravager);
     private static final double BASE_MOVEMENT_SPEED = 0.3;
@@ -149,7 +157,12 @@
                     BlockState blockState = this.level().getBlockState(blockPos);
                     Block block = blockState.getBlock();
                     if (block instanceof LeavesBlock) {
-                        flag = this.level().destroyBlock(blockPos, true, this) || flag;
+                        // CraftBukkit start
+                        if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, net.minecraft.world.level.block.Blocks.AIR.defaultBlockState())) {
+                            continue;
+                        }
+                        // CraftBukkit end
+                        flag = this.level().destroyBlock(blockposition, true, this) || flag;
                     }
                 }