SPIGOT-5462: Cancelling EntitySpawnEvent takes Ender Eye from inventory

This commit is contained in:
md_5 2019-12-18 13:07:14 +11:00
parent 30a1b6911f
commit d31f05fbc6

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