Fire EntityChangeBlockEvent in more places

Co-authored-by: ChristopheG <61288881+chrisgdt@users.noreply.github.com>
Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com>
This commit is contained in:
Jake Potrebic
2021-08-09 20:45:46 -07:00
parent 2aae5e2218
commit 75c623590f
11 changed files with 261 additions and 28 deletions

View File

@@ -1,6 +1,18 @@
--- a/net/minecraft/world/item/EnderEyeItem.java
+++ b/net/minecraft/world/item/EnderEyeItem.java
@@ -62,7 +62,27 @@
@@ -45,6 +45,11 @@
return InteractionResult.SUCCESS;
} else {
BlockState iblockdata1 = (BlockState) iblockdata.setValue(EndPortalFrameBlock.HAS_EYE, true);
+ // Paper start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(context.getPlayer(), blockposition, iblockdata1)) {
+ return InteractionResult.PASS;
+ }
+ // Paper end
Block.pushEntitiesUp(iblockdata, iblockdata1, world, blockposition);
world.setBlock(blockposition, iblockdata1, 2);
@@ -62,7 +67,27 @@
}
}
@@ -29,7 +41,7 @@
}
return InteractionResult.SUCCESS;
@@ -99,7 +119,11 @@
@@ -99,7 +124,11 @@
entityendersignal.setItem(itemstack);
entityendersignal.signalTo(blockposition);
world.gameEvent((Holder) GameEvent.PROJECTILE_SHOOT, entityendersignal.position(), GameEvent.Context.of((Entity) user));