SPIGOT-5462: Cancelling EntitySpawnEvent takes Ender Eye from inventory

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2019-12-18 13:07:14 +11:00
parent 351402accf
commit 3dacf34bca

View file

@ -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);
}