3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00
Paper/nms-patches/PathfinderGoalRemoveBlock.patch
2019-04-23 12:00:00 +10:00

29 Zeilen
1.0 KiB
Diff

--- a/net/minecraft/server/PathfinderGoalRemoveBlock.java
+++ b/net/minecraft/server/PathfinderGoalRemoveBlock.java
@@ -2,6 +2,10 @@
import java.util.Random;
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.event.entity.EntityInteractEvent;
+// CraftBukkit end
public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget {
@@ -81,6 +85,14 @@
}
if (this.i > 60) {
+ // CraftBukkit start - Step on eggs
+ EntityInteractEvent event = new EntityInteractEvent(this.entity.getBukkitEntity(), CraftBlock.at(world, blockposition1));
+ world.getServer().getPluginManager().callEvent((EntityInteractEvent) event);
+
+ if (event.isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.a(blockposition1, false);
if (!world.isClientSide) {
for (int i = 0; i < 20; ++i) {