From d31f05fbc65e99ac93407f1ac8706803121d1d25 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 18 Dec 2019 13:07:14 +1100 Subject: [PATCH] SPIGOT-5462: Cancelling EntitySpawnEvent takes Ender Eye from inventory --- nms-patches/ItemEnderEye.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 nms-patches/ItemEnderEye.patch diff --git a/nms-patches/ItemEnderEye.patch b/nms-patches/ItemEnderEye.patch new file mode 100644 index 0000000000..fb6e1c9113 --- /dev/null +++ b/nms-patches/ItemEnderEye.patch @@ -0,0 +1,15 @@ +--- a/net/minecraft/server/ItemEnderEye.java ++++ b/net/minecraft/server/ItemEnderEye.java +@@ -61,7 +61,11 @@ + + entityendersignal.b(itemstack); + entityendersignal.a(blockposition); +- world.addEntity(entityendersignal); ++ // CraftBukkit start ++ if (!world.addEntity(entityendersignal)) { ++ return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack); ++ } ++ // CraftBukkit end + if (entityhuman instanceof EntityPlayer) { + CriterionTriggers.m.a((EntityPlayer) entityhuman, blockposition); + }