0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git synced 2024-11-25 08:06:14 +00:00
craftbukkit/nms-patches/net/minecraft/world/entity/monster/EntityRavager.patch
2024-10-23 02:15:00 +11:00

26 lines
1.1 KiB
Diff

--- a/net/minecraft/world/entity/monster/EntityRavager.java
+++ b/net/minecraft/world/entity/monster/EntityRavager.java
@@ -45,6 +45,10 @@
import net.minecraft.world.phys.AxisAlignedBB;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end
+
public class EntityRavager extends EntityRaider {
private static final Predicate<Entity> ROAR_TARGET_WITH_GRIEFING = (entity) -> {
@@ -161,6 +165,11 @@
Block block = iblockdata.getBlock();
if (block instanceof BlockLeaves) {
+ // CraftBukkit start
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, net.minecraft.world.level.block.Blocks.AIR.defaultBlockState())) {
+ continue;
+ }
+ // CraftBukkit end
flag = worldserver.destroyBlock(blockposition, true, this) || flag;
}
}