Fix passenger check not working on versions below 1.11.2 (#3132)

This commit is contained in:
Josh Roy 2020-04-04 11:48:21 -04:00 committed by GitHub
parent b08d380643
commit 85a5e517c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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