mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 16:18:02 +01:00
SPIGOT-4483: Missing EntityInteractEvent call for zombies on eggs
This commit is contained in:
parent
3a9118280c
commit
17ff1e0467
1 changed files with 28 additions and 0 deletions
28
nms-patches/PathfinderGoalRemoveBlock.patch
Normal file
28
nms-patches/PathfinderGoalRemoveBlock.patch
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
--- 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 {
|
||||||
|
|
||||||
|
@@ -66,6 +70,14 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.h > 60) {
|
||||||
|
+ // CraftBukkit start - Step on eggs
|
||||||
|
+ EntityInteractEvent event = new EntityInteractEvent(this.g.getBukkitEntity(), CraftBlock.at(world, blockposition1));
|
||||||
|
+ world.getServer().getPluginManager().callEvent((EntityInteractEvent) event);
|
||||||
|
+
|
||||||
|
+ if (event.isCancelled()) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
world.setAir(blockposition1);
|
||||||
|
if (!world.isClientSide) {
|
||||||
|
for (int i = 0; i < 20; ++i) {
|
Loading…
Reference in a new issue