From 199310d0bd6ebf37bf942ab306651cf51d72f0e1 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 15 Jun 2024 18:47:12 +1000 Subject: [PATCH] SPIGOT-7761: Ender pearl does not damage or spawn endermites By: md_5 --- .../net/minecraft/server/network/PlayerConnection.patch | 4 ++-- .../nms-patches/net/minecraft/world/entity/EntityLiving.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paper-server/nms-patches/net/minecraft/server/network/PlayerConnection.patch b/paper-server/nms-patches/net/minecraft/server/network/PlayerConnection.patch index 5373c1dec4..998c286cc8 100644 --- a/paper-server/nms-patches/net/minecraft/server/network/PlayerConnection.patch +++ b/paper-server/nms-patches/net/minecraft/server/network/PlayerConnection.patch @@ -566,7 +566,7 @@ + // SPIGOT-5171: Triggered on join + if (from.equals(to)) { + this.internalTeleport(d0, d1, d2, f, f1, set); -+ return false; // CraftBukkit - Return event status ++ return true; // CraftBukkit - Return event status + } + + PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause); @@ -583,7 +583,7 @@ + } + + this.internalTeleport(d0, d1, d2, f, f1, set); -+ return event.isCancelled(); // CraftBukkit - Return event status ++ return !event.isCancelled(); // CraftBukkit - Return event status + } + + public void teleport(Location dest) { diff --git a/paper-server/nms-patches/net/minecraft/world/entity/EntityLiving.patch b/paper-server/nms-patches/net/minecraft/world/entity/EntityLiving.patch index fb794de497..63d030a940 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/EntityLiving.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/EntityLiving.patch @@ -1062,7 +1062,7 @@ + } + } else { + // player teleport event is called in the underlining code -+ if (((EntityPlayer) this).connection.teleport(d0, d6, d2, this.getYRot(), this.getXRot(), java.util.Collections.emptySet(), cause)) { ++ if (!((EntityPlayer) this).connection.teleport(d0, d6, d2, this.getYRot(), this.getXRot(), java.util.Collections.emptySet(), cause)) { + return Optional.empty(); + } + }