diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/item/EnderEyeItem.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/item/EnderEyeItem.java.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/EnderEyeItem.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/EnderEyeItem.java.patch new file mode 100644 index 0000000000..3d409494f3 --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/EnderEyeItem.java.patch @@ -0,0 +1,32 @@ +--- a/net/minecraft/world/item/EnderEyeItem.java ++++ b/net/minecraft/world/item/EnderEyeItem.java +@@ -71,14 +79,21 @@ + return InteractionResultHolder.pass(itemInHand); + } else { + player.startUsingItem(hand); +- if (level instanceof ServerLevel serverLevel) { +- BlockPos blockPos = serverLevel.findNearestMapStructure(StructureTags.EYE_OF_ENDER_LOCATED, player.blockPosition(), 100, false); +- if (blockPos != null) { +- EyeOfEnder eyeOfEnder = new EyeOfEnder(level, player.getX(), player.getY(0.5), player.getZ()); +- eyeOfEnder.setItem(itemInHand); +- eyeOfEnder.signalTo(blockPos); +- level.gameEvent(GameEvent.PROJECTILE_SHOOT, eyeOfEnder.position(), GameEvent.Context.of(player)); +- level.addFreshEntity(eyeOfEnder); ++ if (level instanceof ServerLevel) { ++ ServerLevel worldserver = (ServerLevel) level; ++ BlockPos blockposition = worldserver.findNearestMapStructure(StructureTags.EYE_OF_ENDER_LOCATED, player.blockPosition(), 100, false); ++ ++ if (blockposition != null) { ++ EyeOfEnder entityendersignal = new EyeOfEnder(level, player.getX(), player.getY(0.5D), player.getZ()); ++ ++ entityendersignal.setItem(itemstack); ++ entityendersignal.signalTo(blockposition); ++ level.gameEvent(GameEvent.PROJECTILE_SHOOT, entityendersignal.position(), GameEvent.Context.of((Entity) player)); ++ // CraftBukkit start ++ if (!level.addFreshEntity(entityendersignal)) { ++ return new InteractionResultHolder(InteractionResult.FAIL, itemstack); ++ } ++ // CraftBukkit end + if (player instanceof ServerPlayer) { + CriteriaTriggers.USED_ENDER_EYE.trigger((ServerPlayer)player, blockPos); + } |