From e7b5d8a7cf1e8c821d36372ae0a4dcdbfe4b085f Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 27 Dec 2018 10:45:36 +1100 Subject: [PATCH] SPIGOT-794: Call EntityPlaceEvent for Minecart placement By: md_5 --- paper-server/nms-patches/ItemMinecart.patch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/paper-server/nms-patches/ItemMinecart.patch b/paper-server/nms-patches/ItemMinecart.patch index ef20cdf99d..9890f44fd2 100644 --- a/paper-server/nms-patches/ItemMinecart.patch +++ b/paper-server/nms-patches/ItemMinecart.patch @@ -58,11 +58,16 @@ return itemstack; } -@@ -84,7 +118,7 @@ +@@ -84,7 +118,12 @@ entityminecartabstract.setCustomName(itemstack.getName()); } - world.addEntity(entityminecartabstract); ++ // CraftBukkit start ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(itemactioncontext, entityminecartabstract).isCancelled()) { ++ return EnumInteractionResult.FAIL; ++ } ++ // CraftBukkit end + if (!world.addEntity(entityminecartabstract)) return EnumInteractionResult.PASS; // CraftBukkit }