From 85a5e517c9afa41c3127cdd8accf0453ad2bd9ad Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Sat, 4 Apr 2020 11:48:21 -0400 Subject: [PATCH] Fix passenger check not working on versions below 1.11.2 (#3132) --- Essentials/src/com/earth2me/essentials/Teleport.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java index 91ca82d27..d63378c37 100644 --- a/Essentials/src/com/earth2me/essentials/Teleport.java +++ b/Essentials/src/com/earth2me/essentials/Teleport.java @@ -6,11 +6,10 @@ import io.papermc.lib.PaperLib; import net.ess3.api.IEssentials; import net.ess3.api.ITeleport; import net.ess3.api.IUser; -import net.ess3.api.events.UserWarpEvent; import net.ess3.api.events.UserTeleportEvent; +import net.ess3.api.events.UserWarpEvent; import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -132,13 +131,11 @@ public class Teleport implements ITeleport { teleportee.setLastLocation(); - if (!teleportee.getBase().getPassengers().isEmpty()) { + if (!teleportee.getBase().isEmpty()) { if (!ess.getSettings().isTeleportPassengerDismount()) { throw new Exception(tl("passengerTeleportFail")); } - for (Entity entity : teleportee.getBase().getPassengers()) { - entity.leaveVehicle(); - } + teleportee.getBase().eject(); } if (LocationUtil.isBlockUnsafeForUser(teleportee, loc.getWorld(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())) {