PaperMC/paper-server/nms-patches/net/minecraft/world/item/ItemEnderEye.patch
CraftBukkit/Spigot 65bc2541a3 Update to Minecraft 1.20.5
By: md_5 <git@md-5.net>
2024-04-24 01:15:00 +10:00

15 lines
917 B
Diff

--- a/net/minecraft/world/item/ItemEnderEye.java
+++ b/net/minecraft/world/item/ItemEnderEye.java
@@ -95,7 +95,11 @@
entityendersignal.setItem(itemstack);
entityendersignal.signalTo(blockposition);
world.gameEvent((Holder) GameEvent.PROJECTILE_SHOOT, entityendersignal.position(), GameEvent.a.of((Entity) entityhuman));
- world.addFreshEntity(entityendersignal);
+ // CraftBukkit start
+ if (!world.addFreshEntity(entityendersignal)) {
+ return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack);
+ }
+ // CraftBukkit end
if (entityhuman instanceof EntityPlayer) {
CriterionTriggers.USED_ENDER_EYE.trigger((EntityPlayer) entityhuman, blockposition);
}