SPIGOT-7761: Ender pearl does not damage or spawn endermites

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2024-06-15 18:47:12 +10:00
parent 7feadbf2ee
commit 199310d0bd
2 changed files with 3 additions and 3 deletions

View file

@ -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) {

View file

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