craftbukkit/nms-patches/PathfinderGoalRemoveBlock.patch

30 lines
1.1 KiB
Diff
Raw Normal View History

--- a/net/minecraft/server/PathfinderGoalRemoveBlock.java
+++ b/net/minecraft/server/PathfinderGoalRemoveBlock.java
2021-03-09 08:47:33 +11:00
@@ -3,6 +3,11 @@
import java.util.Random;
import javax.annotation.Nullable;
2021-03-09 08:47:33 +11:00
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.event.entity.EntityInteractEvent;
+// CraftBukkit end
2021-03-09 08:47:33 +11:00
+
public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget {
2021-03-09 08:47:33 +11:00
private final Block g;
@@ -81,6 +86,14 @@
}
2019-04-23 12:00:00 +10:00
if (this.i > 60) {
+ // CraftBukkit start - Step on eggs
2018-12-06 10:00:00 +11:00
+ EntityInteractEvent event = new EntityInteractEvent(this.entity.getBukkitEntity(), CraftBlock.at(world, blockposition1));
+ world.getServer().getPluginManager().callEvent((EntityInteractEvent) event);
+
+ if (event.isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
2019-04-23 12:00:00 +10:00
world.a(blockposition1, false);
if (!world.isClientSide) {
for (int i = 0; i < 20; ++i) {