mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-04 22:14:40 +01:00
SPIGOT-4810: Call EntityChangeBlockEvent for Ravager destroying leaves
This commit is contained in:
parent
5193f762a7
commit
ea5d868cf9
1 changed files with 20 additions and 0 deletions
20
nms-patches/EntityRavager.patch
Normal file
20
nms-patches/EntityRavager.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
--- a/net/minecraft/server/EntityRavager.java
|
||||
+++ b/net/minecraft/server/EntityRavager.java
|
||||
@@ -28,7 +28,7 @@
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 0.4D));
|
||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
|
||||
- this.targetSelector.a(2, (new PathfinderGoalHurtByTarget(this, new Class[] { EntityRaider.class})).a());
|
||||
+ this.targetSelector.a(2, (new PathfinderGoalHurtByTarget(this, new Class[] { EntityRaider.class})).a(new Class[0])); // CraftBukkit - decompile error
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true));
|
||||
this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
||||
@@ -126,7 +126,7 @@
|
||||
IBlockData iblockdata = this.world.getType(blockposition);
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
- if (block instanceof BlockLeaves) {
|
||||
+ if (block instanceof BlockLeaves && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { // CraftBukkit
|
||||
flag = this.world.b(blockposition, true) || flag;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue